summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-02-09 14:49:04 +0100
committerGünther Deschner <gd@samba.org>2010-02-09 16:38:04 +0100
commit8088a1712868b645e273c35ab06c0511892dd3d3 (patch)
treeaca86639e1be1b3b2c7ca757926dad1d71e65cb9
parente0472c59c8f9e0fe5aafd539ca901468cd599a30 (diff)
downloadsamba-8088a1712868b645e273c35ab06c0511892dd3d3.tar.gz
samba-8088a1712868b645e273c35ab06c0511892dd3d3.tar.bz2
samba-8088a1712868b645e273c35ab06c0511892dd3d3.zip
testprogs: print form info levels in EnumForms(),GetForm() spoolss tests.
Guenther
-rw-r--r--testprogs/win32/spoolss/printlib.c59
-rw-r--r--testprogs/win32/spoolss/spoolss.c8
2 files changed, 67 insertions, 0 deletions
diff --git a/testprogs/win32/spoolss/printlib.c b/testprogs/win32/spoolss/printlib.c
index 8480e309e1..2c84c78395 100644
--- a/testprogs/win32/spoolss/printlib.c
+++ b/testprogs/win32/spoolss/printlib.c
@@ -276,6 +276,65 @@ void print_form_info_1(PFORM_INFO_1 info)
return;
}
+void print_form_info_2(PFORM_INFO_2 info)
+{
+ printf("\tForm Name\t= %s\n", info->pName);
+ printf("\tFlags\t\t= 0x%x\n", info->Flags);
+ printf("\tSize\t\t= %d x %d\n", info->Size.cx, info->Size.cy);
+ printf("\tRectangle\t= [left]%d [right]%d [top]%d [bottom]%d\n",
+ info->ImageableArea.left, info->ImageableArea.right,
+ info->ImageableArea.top, info->ImageableArea.bottom);
+ printf("\tKeyword\t= %s\n", info->pKeyword);
+ printf("\tString Type\t= 0x%08x\n", info->StringType);
+ printf("\tMui DLL\t= %s\n", info->pMuiDll);
+ printf("\tResource Id\t= 0x%08x\n", info->dwResourceId);
+ printf("\tDisplay Name\t= %s\n",info->pDisplayName);
+ printf("\tLang Id\t= 0x%04x\n", info->wLangId);
+
+ return;
+}
+
+void print_form_info_bylevel(DWORD level, LPBYTE buffer, DWORD count)
+{
+ DWORD i;
+ PFORM_INFO_1 buffer1 = NULL;
+ PFORM_INFO_2 buffer2 = NULL;
+
+ if (!buffer) {
+ return;
+ }
+
+ switch (level) {
+ case 1:
+ buffer1 = (PFORM_INFO_1)buffer;
+ break;
+ case 2:
+ buffer2 = (PFORM_INFO_2)buffer;
+ break;
+ default:
+ break;
+ }
+
+ printf("Form Info Level %d:\n", level);
+
+ switch (level) {
+ case 1:
+ for (i=0; i<count; i++) {
+ print_form_info_1(&buffer1[i]);
+ printf("\n");
+ }
+ break;
+ case 2:
+ for (i=0; i<count; i++) {
+ print_form_info_2(&buffer2[i]);
+ printf("\n");
+ }
+ break;
+ default:
+ break;
+ }
+}
+
void print_printer_info_1(PPRINTER_INFO_1 info)
{
printf("\tPrinter Name\t= %s\n", info->pName);
diff --git a/testprogs/win32/spoolss/spoolss.c b/testprogs/win32/spoolss/spoolss.c
index c74fb2066a..ac3a313843 100644
--- a/testprogs/win32/spoolss/spoolss.c
+++ b/testprogs/win32/spoolss/spoolss.c
@@ -209,6 +209,10 @@ static BOOL test_GetForm(struct torture_context *tctx,
}
}
+ if (tctx->print) {
+ print_form_info_bylevel(levels[i], buffer, 1);
+ }
+
free(buffer);
buffer = NULL;
}
@@ -257,6 +261,10 @@ static BOOL test_EnumForms(struct torture_context *tctx,
}
}
+ if (tctx->print) {
+ print_form_info_bylevel(levels[i], buffer, returned);
+ }
+
free(buffer);
buffer = NULL;
}