summaryrefslogtreecommitdiff
path: root/testprogs/win32
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-02-09 15:24:34 +0100
committerGünther Deschner <gd@samba.org>2010-02-09 16:39:34 +0100
commit5db64e88c7f8e1e689e0dabc67db1074eb1fef86 (patch)
treea214edc548e1ff2ec39a783333e820502d29d996 /testprogs/win32
parent5afae257249d0034d999d5c588732c86732ee9d2 (diff)
downloadsamba-5db64e88c7f8e1e689e0dabc67db1074eb1fef86.tar.gz
samba-5db64e88c7f8e1e689e0dabc67db1074eb1fef86.tar.bz2
samba-5db64e88c7f8e1e689e0dabc67db1074eb1fef86.zip
testprogs: print monitor info levels in EnumMonitors() spoolss tests.
Guenther
Diffstat (limited to 'testprogs/win32')
-rw-r--r--testprogs/win32/spoolss/printlib.c41
-rw-r--r--testprogs/win32/spoolss/spoolss.c4
2 files changed, 45 insertions, 0 deletions
diff --git a/testprogs/win32/spoolss/printlib.c b/testprogs/win32/spoolss/printlib.c
index 0790144db1..e696909ed6 100644
--- a/testprogs/win32/spoolss/printlib.c
+++ b/testprogs/win32/spoolss/printlib.c
@@ -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);
diff --git a/testprogs/win32/spoolss/spoolss.c b/testprogs/win32/spoolss/spoolss.c
index 90cdc816cd..5741e354ef 100644
--- a/testprogs/win32/spoolss/spoolss.c
+++ b/testprogs/win32/spoolss/spoolss.c
@@ -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;
}