1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

testprogs: print monitor info levels in EnumMonitors() spoolss tests.

Guenther
This commit is contained in:
Günther Deschner 2010-02-09 15:24:34 +01:00
parent 5afae25724
commit 5db64e88c7
2 changed files with 45 additions and 0 deletions

View File

@ -264,6 +264,47 @@ void print_monitor_info_2(PMONITOR_INFO_2 info)
return;
}
void print_monitor_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
{
DWORD i;
PMONITOR_INFO_1 buffer1 = NULL;
PMONITOR_INFO_2 buffer2 = NULL;
if (!buffer) {
return;
}
switch (level) {
case 1:
buffer1 = (PMONITOR_INFO_1)buffer;
break;
case 2:
buffer2 = (PMONITOR_INFO_2)buffer;
break;
default:
break;
}
printf("Monitor Info Level %d:\n", level);
switch (level) {
case 1:
for (i=0; i<count; i++) {
print_monitor_info_1(&buffer1[i]);
printf("\n");
}
break;
case 2:
for (i=0; i<count; i++) {
print_monitor_info_2(&buffer2[i]);
printf("\n");
}
break;
default:
break;
}
}
void print_port_info_1(PPORT_INFO_1 info)
{
printf("\tPort Name\t= %s\n", info->pName);

View File

@ -363,6 +363,10 @@ static BOOL test_EnumMonitors(struct torture_context *tctx,
}
}
if (tctx->print) {
print_monitor_info_bylevel(levels[i], buffer, returned);
}
free(buffer);
buffer = NULL;
}