summaryrefslogtreecommitdiff
path: root/testprogs/win32/spoolss
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-02-09 15:00:54 +0100
committerGünther Deschner <gd@samba.org>2010-02-09 16:39:30 +0100
commit5afae257249d0034d999d5c588732c86732ee9d2 (patch)
treee155dac9a7f47e083ace56cece2922f44d4b6e0c /testprogs/win32/spoolss
parent8088a1712868b645e273c35ab06c0511892dd3d3 (diff)
downloadsamba-5afae257249d0034d999d5c588732c86732ee9d2.tar.gz
samba-5afae257249d0034d999d5c588732c86732ee9d2.tar.bz2
samba-5afae257249d0034d999d5c588732c86732ee9d2.zip
testprogs: print port info levels in EnumPorts() spoolss tests.
Guenther
Diffstat (limited to 'testprogs/win32/spoolss')
-rw-r--r--testprogs/win32/spoolss/printlib.c75
-rw-r--r--testprogs/win32/spoolss/spoolss.c4
2 files changed, 79 insertions, 0 deletions
diff --git a/testprogs/win32/spoolss/printlib.c b/testprogs/win32/spoolss/printlib.c
index 2c84c78395..0790144db1 100644
--- a/testprogs/win32/spoolss/printlib.c
+++ b/testprogs/win32/spoolss/printlib.c
@@ -264,6 +264,81 @@ void print_monitor_info_2(PMONITOR_INFO_2 info)
return;
}
+void print_port_info_1(PPORT_INFO_1 info)
+{
+ printf("\tPort Name\t= %s\n", info->pName);
+ return;
+}
+
+void print_port_info_2(PPORT_INFO_2 info)
+{
+ printf("\tPort Name\t= %s\n", info->pPortName);
+ printf("\tMonitor Name\t= %s\n",info->pMonitorName);
+ printf("\tDescription\t= %s\n", info->pDescription);
+ printf("\tPort Type\t= 0x%08x\n", info->fPortType);
+ printf("\tReserved\t= 0x%08x\n", info->Reserved);
+ return;
+}
+
+void print_port_info_3(PPORT_INFO_3 info)
+{
+ printf("\tStatus\t= 0x%08x\n", info->dwStatus);
+ printf("\tStatus String\t= %s\n", info->pszStatus);
+ printf("\tSeverity\t= 0x%08x\n", info->dwSeverity);
+ return;
+}
+
+void print_port_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
+{
+ DWORD i;
+ PPORT_INFO_1 buffer1 = NULL;
+ PPORT_INFO_2 buffer2 = NULL;
+ PPORT_INFO_3 buffer3 = NULL;
+
+ if (!buffer) {
+ return;
+ }
+
+ switch (level) {
+ case 1:
+ buffer1 = (PPORT_INFO_1)buffer;
+ break;
+ case 2:
+ buffer2 = (PPORT_INFO_2)buffer;
+ break;
+ case 3:
+ buffer3 = (PPORT_INFO_3)buffer;
+ break;
+ default:
+ break;
+ }
+
+ printf("Port Info Level %d:\n", level);
+
+ switch (level) {
+ case 1:
+ for (i=0; i<count; i++) {
+ print_port_info_1(&buffer1[i]);
+ printf("\n");
+ }
+ break;
+ case 2:
+ for (i=0; i<count; i++) {
+ print_port_info_2(&buffer2[i]);
+ printf("\n");
+ }
+ break;
+ case 3:
+ for (i=0; i<count; i++) {
+ print_port_info_3(&buffer3[i]);
+ printf("\n");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
void print_form_info_1(PFORM_INFO_1 info)
{
printf("\tForm Name\t= %s\n", info->pName);
diff --git a/testprogs/win32/spoolss/spoolss.c b/testprogs/win32/spoolss/spoolss.c
index ac3a313843..90cdc816cd 100644
--- a/testprogs/win32/spoolss/spoolss.c
+++ b/testprogs/win32/spoolss/spoolss.c
@@ -312,6 +312,10 @@ static BOOL test_EnumPorts(struct torture_context *tctx,
}
}
+ if (tctx->print) {
+ print_port_info_bylevel(levels[i], buffer, returned);
+ }
+
free(buffer);
buffer = NULL;
}