testprogs: print printprocessor info levels in EnumPrintProcessors() spoolss tests.
authorGünther Deschner <gd@samba.org>
Tue, 9 Feb 2010 14:54:25 +0000 (15:54 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 9 Feb 2010 15:39:34 +0000 (16:39 +0100)
Guenther

testprogs/win32/spoolss/printlib.c
testprogs/win32/spoolss/spoolss.c

index e696909ed65205ec9e59df7d55d75d62cca8d1e3..a5d2342ce8b63d2c612638b6a2aa499a19f2c323 100644 (file)
@@ -637,6 +637,37 @@ void print_printprocessor_info_1(PPRINTPROCESSOR_INFO_1 info)
        return;
 }
 
        return;
 }
 
+void print_printprocessor_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
+{
+       DWORD i;
+       PPRINTPROCESSOR_INFO_1 buffer1 = NULL;
+
+       if (!buffer) {
+               return;
+       }
+
+       switch (level) {
+       case 1:
+               buffer1 = (PPRINTPROCESSOR_INFO_1)buffer;
+               break;
+       default:
+               break;
+       }
+
+       printf("Print Processor Info Level %d:\n", level);
+
+       switch (level) {
+       case 1:
+               for (i=0; i<count; i++) {
+                       print_printprocessor_info_1(&buffer1[i]);
+                       printf("\n");
+               }
+               break;
+       default:
+               break;
+       }
+}
+
 void print_driver_info_1(PDRIVER_INFO_1 info)
 {
        printf("\tDriver Name\t= %s\n\n",       info->pName);
 void print_driver_info_1(PDRIVER_INFO_1 info)
 {
        printf("\tDriver Name\t= %s\n\n",       info->pName);
index 5741e354ef16a8a412caef0c210cc9dce2dbd707..4e1672e67c52ababa0dc06c7b3af3f3f8b85d419 100644 (file)
@@ -415,6 +415,10 @@ static BOOL test_EnumPrintProcessors(struct torture_context *tctx,
                        }
                }
 
                        }
                }
 
+               if (tctx->print) {
+                       print_printprocessor_info_bylevel(levels[i], buffer, returned);
+               }
+
                free(buffer);
                buffer = NULL;
        }
                free(buffer);
                buffer = NULL;
        }