2 Unix SMB/CIFS implementation.
3 test suite for spoolss rpc operations
5 Copyright (C) Gerald (Jerry) Carter 2007
6 Copyright (C) Guenther Deschner 2009-2010
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 void print_devmode(DEVMODE
*pDevModeIn
)
28 if (pDevModeIn
== NULL
) {
29 printf("\tDevice Mode\t= (null)\n");
33 printf("\tDEVMODE:----------\n");
34 printf("\tDeviceName: [%s]\n", pDevModeIn
->dmDeviceName
);
35 printf("\tSpecVersion: %d\n", pDevModeIn
->dmSpecVersion
);
36 printf("\tDriverVersion: %d\n", pDevModeIn
->dmDriverVersion
);
37 printf("\tSize: %d\n", pDevModeIn
->dmSize
);
38 printf("\tDriverExtra: %d\n", pDevModeIn
->dmDriverExtra
);
39 printf("\tFields: 0x%x\n", pDevModeIn
->dmFields
);
41 if (pDevModeIn
->dmFields
& DM_ORIENTATION
)
42 printf("\tOrientation: %d\n", pDevModeIn
->dmOrientation
);
43 if (pDevModeIn
->dmFields
& DM_PAPERSIZE
)
44 printf("\tPaperSize: %d\n", pDevModeIn
->dmPaperSize
);
45 if (pDevModeIn
->dmFields
& DM_PAPERLENGTH
)
46 printf("\tPaperLength: %d\n", pDevModeIn
->dmPaperLength
);
47 if (pDevModeIn
->dmFields
& DM_PAPERWIDTH
)
48 printf("\tPaperWidth: %d\n", pDevModeIn
->dmPaperWidth
);
49 // if (pDevModeIn->dmFields & DM_POSITION)
50 // printf("\tPosition: %d\n", pDevModeIn->dmPosition);
51 if (pDevModeIn
->dmFields
& DM_SCALE
)
52 printf("\tScale: %d\n", pDevModeIn
->dmScale
);
53 if (pDevModeIn
->dmFields
& DM_COPIES
)
54 printf("\tCopies: %d\n", pDevModeIn
->dmCopies
);
55 if (pDevModeIn
->dmFields
& DM_DEFAULTSOURCE
)
56 printf("\tDefaultSource: %d\n", pDevModeIn
->dmDefaultSource
);
57 if (pDevModeIn
->dmFields
& DM_PRINTQUALITY
)
58 printf("\tPrintQuality: %d\n", pDevModeIn
->dmPrintQuality
);
59 if (pDevModeIn
->dmFields
& DM_COLOR
)
60 printf("\tColor: %d\n", pDevModeIn
->dmColor
);
61 if (pDevModeIn
->dmFields
& DM_DUPLEX
)
62 printf("\tDuplex: %d\n", pDevModeIn
->dmDuplex
);
63 if (pDevModeIn
->dmFields
& DM_YRESOLUTION
)
64 printf("\tYResolution: %d\n", pDevModeIn
->dmYResolution
);
65 if (pDevModeIn
->dmFields
& DM_TTOPTION
)
66 printf("\tTTOption: %d\n", pDevModeIn
->dmTTOption
);
67 if (pDevModeIn
->dmFields
& DM_COLLATE
)
68 printf("\tCollate: %d\n", pDevModeIn
->dmCollate
);
69 if (pDevModeIn
->dmFields
& DM_FORMNAME
)
70 printf("\tForm: [%s]\n", pDevModeIn
->dmFormName
);
71 if (pDevModeIn
->dmFields
& DM_LOGPIXELS
)
72 printf("\tLogPixels: %d\n", pDevModeIn
->dmLogPixels
);
73 if (pDevModeIn
->dmFields
& DM_BITSPERPEL
)
74 printf("\tBitsPerPel: %d\n", pDevModeIn
->dmBitsPerPel
);
75 if (pDevModeIn
->dmFields
& DM_PELSWIDTH
)
76 printf("\tPelsWidth: %d\n", pDevModeIn
->dmPelsWidth
);
77 if (pDevModeIn
->dmFields
& DM_PELSHEIGHT
)
78 printf("\tPelsHeight: %d\n", pDevModeIn
->dmPelsHeight
);
79 if (pDevModeIn
->dmFields
& DM_DISPLAYFLAGS
)
80 printf("\tDisplayFlags: %d\n", pDevModeIn
->dmDisplayFlags
);
81 // if (pDevModeIn->dmFields & DM_NUP)
82 // printf("\tNup: %d\n", pDevModeIn->dmNup);
83 if (pDevModeIn
->dmFields
& DM_DISPLAYFREQUENCY
)
84 printf("\tDisplayFrequency:%d\n", pDevModeIn
->dmDisplayFrequency
);
85 if (pDevModeIn
->dmFields
& DM_ICMMETHOD
)
86 printf("\tICMMethod: %d\n", pDevModeIn
->dmICMMethod
);
87 if (pDevModeIn
->dmFields
& DM_ICMINTENT
)
88 printf("\tICMIntent: %d\n", pDevModeIn
->dmICMIntent
);
89 if (pDevModeIn
->dmFields
& DM_MEDIATYPE
)
90 printf("\tMediaType: %d\n", pDevModeIn
->dmMediaType
);
91 if (pDevModeIn
->dmFields
& DM_DITHERTYPE
)
92 printf("\tDitherType: %d\n", pDevModeIn
->dmDitherType
);
93 // if (pDevModeIn->dmFields & DM_PANNINGWIDTH)
94 // printf("\tPanningWidth: %d\n", pDevModeIn->dmPanningWidth);
95 // if (pDevModeIn->dmFields & DM_PANNINGHEIGHT)
96 // printf("\tPanningHeight: %d\n", pDevModeIn->dmPanningHeight);
101 Dump((BYTE
*)pDevModeIn
, sizeof(DEVMODE
), LEADER
);
103 if (pDevModeIn
->dmDriverExtra
) {
104 printf("DriverExtra\n");
105 Dump((BYTE
*)pDevModeIn
+ sizeof(DEVMODE
), pDevModeIn
->dmDriverExtra
, LEADER
);
113 void print_acl(const char* str
, ACL
*acl
)
119 printf("\t\tACL Revision \t\t 0x%x\n", acl
->AclRevision
);
120 printf("\t\tSbz1\t\t 0x%x\n", acl
->Sbz1
);
121 printf("\t\tSbz2\t\t 0x%x\n", acl
->Sbz2
);
122 printf("\t\tACL Size\t\t 0x%x\n", acl
->AclSize
);
123 printf("\t\tACL Count\t\t 0x%x\n", acl
->AceCount
);
128 void print_sid(const char* str
, SID
*sid
)
133 printf("0x%x\n", sid
);
136 printf("\t\tRevision\t\t0x%x\n", sid
->Revision
);
137 printf("\t\tSubAuthorityCount\t0x%x\n", sid
->SubAuthorityCount
);
138 printf("\t\tSubAuthority\n\t");
139 while (i
< sid
->SubAuthorityCount
) {
140 printf("\t0x%x", sid
->SubAuthority
[i
]);
149 void print_secdesc(SECURITY_DESCRIPTOR
*secdesc
)
151 if (secdesc
== NULL
) {
152 printf("\tSecurity Descriptor\t= (null)\n");
156 printf("\tRevision\t= 0x%x\n", secdesc
->Revision
);
157 printf("\tSbz1\t\t= 0x%x\n", secdesc
->Sbz1
);
159 print_sid("\tOwner\t\t= ", secdesc
->Owner
);
160 print_sid("\tGroup\t\t= ",secdesc
->Group
);
161 print_acl("\tSacl\t\t= ", secdesc
->Sacl
);
162 print_acl("\tDacl\t\t= ", secdesc
->Dacl
);
167 void PrintLastError()
172 status
= GetLastError();
174 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER
| FORMAT_MESSAGE_FROM_SYSTEM
| FORMAT_MESSAGE_IGNORE_INSERTS
,
175 NULL
, GetLastError(), MAKELANGID(LANG_NEUTRAL
, SUBLANG_DEFAULT
), // Default language
176 (LPTSTR
)&lpMsgBuf
, 0, NULL
);
177 printf("ERROR [0x%x] : %s\n", status
, (char*)lpMsgBuf
);
184 void print_job_info_1(PJOB_INFO_1 info
)
186 printf("\tJob ID\t\t= %d\n", info
->JobId
);
187 printf("\tPrinter Name\t= %s\n", info
->pPrinterName
);
188 printf("\tMachine Name\t= %s\n", info
->pMachineName
);
189 printf("\tUser Name\t= %s\n", info
->pUserName
);
190 printf("\tDocument\t= %s\n", info
->pDocument
);
191 printf("\tDatatype\t= %s\n", info
->pDatatype
);
192 printf("\tStatus\t\t= %s\n", info
->pStatus
);
193 printf("\tStatus\t= %d\n", info
->Status
);
194 printf("\tPriority\t= %d\n", info
->Priority
);
195 printf("\tPosition\t= %d\n", info
->Position
);
196 printf("\tTotal Pages\t= %d\n", info
->TotalPages
);
197 printf("\tPages Printed\t= %d\n", info
->PagesPrinted
);
198 printf("\tSubmitted (DD:MM:YY HH:MM:SS)\t= %d:%d:%d %d:%d:%d UTC\n",
199 info
->Submitted
.wDay
, info
->Submitted
.wMonth
,
200 info
->Submitted
.wYear
, info
->Submitted
.wHour
,
201 info
->Submitted
.wMinute
, info
->Submitted
.wSecond
);
206 void print_job_info_2(PJOB_INFO_2 info
)
208 printf("\tJob ID\t\t= %d\n", info
->JobId
);
209 printf("\tPrinter Name\t= %s\n", info
->pPrinterName
);
210 printf("\tMachine Name\t= %s\n", info
->pMachineName
);
211 printf("\tUser Name\t= %s\n", info
->pUserName
);
212 printf("\tDocument\t= %s\n", info
->pDocument
);
213 printf("\tDatatype\t= %s\n", info
->pDatatype
);
214 printf("\tNotify Name\t= %s\n", info
->pNotifyName
);
215 printf("\tPrint Processor\t= %s\n", info
->pPrintProcessor
);
216 printf("\tParameters\t= %s\n", info
->pParameters
);
217 printf("\tDriver Name\t= %s\n", info
->pDriverName
);
218 printf("\tStatus\t\t= %s\n", info
->pStatus
);
219 printf("\tStatus\t\t= %d\n", info
->Status
);
220 printf("\tPriority\t= %d\n", info
->Priority
);
221 printf("\tPosition\t= %d\n", info
->Position
);
222 printf("\tTotal Pages\t= %d\n", info
->TotalPages
);
223 printf("\tPages Printed\t= %d\n", info
->PagesPrinted
);
224 printf("\tStart Time\t= %d\n", info
->StartTime
);
225 printf("\tUntil Time\t= %d\n", info
->UntilTime
);
226 printf("\tTime\t\t= %d\n", info
->Time
);
227 printf("\tSize\t\t= %d\n", info
->Size
);
228 printf("\tSubmitted (DD:MM:YY HH:MM:SS)\t= %d:%d:%d %d:%d:%d UTC\n",
229 info
->Submitted
.wDay
, info
->Submitted
.wMonth
,
230 info
->Submitted
.wYear
, info
->Submitted
.wHour
,
231 info
->Submitted
.wMinute
, info
->Submitted
.wSecond
);
232 printf("\tDevice Mode Information\n");
233 printf("\t-----------------------\n");
234 print_devmode(info
->pDevMode
);
235 printf("\tSecurity Descriptor Information\n");
236 printf("\t-------------------------------\n");
237 print_secdesc(info
->pSecurityDescriptor
);
242 void print_job_info_3(PJOB_INFO_3 info
)
244 printf("\tJob ID\t\t= %d\n", info
->JobId
);
245 printf("\tJob ID Next Job\t= %d\n", info
->NextJobId
);
246 printf("\tReserved (must be 0)\t= %d\n",info
->Reserved
);
251 void print_monitor_info_1(PMONITOR_INFO_1 info
)
253 printf("\tMonitor Name\t= %s\n", info
->pName
);
258 void print_monitor_info_2(PMONITOR_INFO_2 info
)
260 printf("\tMonitor Name\t= %s\n", info
->pName
);
261 printf("\tEnvironment\t= %s\n", info
->pEnvironment
);
262 printf("\tDLL Name\t= %s\n", info
->pDLLName
);
267 void print_form_info_1(PFORM_INFO_1 info
)
269 printf("\tForm Name\t= %s\n", info
->pName
);
270 printf("\tFlags\t\t= 0x%x\n", info
->Flags
);
271 printf("\tSize\t\t= %d x %d\n", info
->Size
.cx
, info
->Size
.cy
);
272 printf("\tRectangle\t= [left]%d [right]%d [top]%d [bottom]%d\n",
273 info
->ImageableArea
.left
, info
->ImageableArea
.right
,
274 info
->ImageableArea
.top
, info
->ImageableArea
.bottom
);
279 void print_form_info_2(PFORM_INFO_2 info
)
281 printf("\tForm Name\t= %s\n", info
->pName
);
282 printf("\tFlags\t\t= 0x%x\n", info
->Flags
);
283 printf("\tSize\t\t= %d x %d\n", info
->Size
.cx
, info
->Size
.cy
);
284 printf("\tRectangle\t= [left]%d [right]%d [top]%d [bottom]%d\n",
285 info
->ImageableArea
.left
, info
->ImageableArea
.right
,
286 info
->ImageableArea
.top
, info
->ImageableArea
.bottom
);
287 printf("\tKeyword\t= %s\n", info
->pKeyword
);
288 printf("\tString Type\t= 0x%08x\n", info
->StringType
);
289 printf("\tMui DLL\t= %s\n", info
->pMuiDll
);
290 printf("\tResource Id\t= 0x%08x\n", info
->dwResourceId
);
291 printf("\tDisplay Name\t= %s\n",info
->pDisplayName
);
292 printf("\tLang Id\t= 0x%04x\n", info
->wLangId
);
297 void print_form_info_bylevel(DWORD level
, LPBYTE buffer
, DWORD count
)
300 PFORM_INFO_1 buffer1
= NULL
;
301 PFORM_INFO_2 buffer2
= NULL
;
309 buffer1
= (PFORM_INFO_1
)buffer
;
312 buffer2
= (PFORM_INFO_2
)buffer
;
318 printf("Form Info Level %d:\n", level
);
322 for (i
=0; i
<count
; i
++) {
323 print_form_info_1(&buffer1
[i
]);
328 for (i
=0; i
<count
; i
++) {
329 print_form_info_2(&buffer2
[i
]);
338 void print_printer_info_1(PPRINTER_INFO_1 info
)
340 printf("\tPrinter Name\t= %s\n", info
->pName
);
341 printf("\tDescription\t= %s\n", info
->pDescription
);
342 printf("\tComment\t\t= %s\n", info
->pComment
);
343 printf("\tFlags\t\t= 0x%x\n", info
->Flags
);
348 void print_printer_info_2(PPRINTER_INFO_2 info
)
350 printf("\tServer Name\t\t= %s\n", info
->pServerName
);
351 printf("\tPrinter Name\t\t= %s\n", info
->pPrinterName
);
352 printf("\tPort Name\t\t= %s\n", info
->pPortName
);
353 printf("\tShare Name\t\t= %s\n", info
->pShareName
);
354 printf("\tDriver Name\t\t= %s\n", info
->pDriverName
);
355 printf("\tComment\t\t\t= %s\n", info
->pComment
);
356 printf("\tLocation\t\t= %s\n", info
->pLocation
);
357 printf("\tSeparator File\t\t= %s\n", info
->pSepFile
);
358 printf("\tDefault Data Type\t= %s\n", info
->pDatatype
);
359 printf("\tPrint Processor\t\t= %s\n", info
->pPrintProcessor
);
360 printf("\tParameters\t\t= %s\n", info
->pParameters
);
361 printf("\tAttributes\t\t= 0x%x\n", info
->Attributes
);
362 printf("\tPriority\t\t= 0x%x\n", info
->Priority
);
363 printf("\tDefault Priority\t= 0x%x\n", info
->DefaultPriority
);
364 printf("\tStart Time\t\t= 0x%x\n", info
->StartTime
);
365 printf("\tUntil Time\t\t= 0x%x\n", info
->UntilTime
);
366 printf("\tStatus\t\t\t= 0x%x\n", info
->Status
);
367 printf("\tcJobs\t\t\t= 0x%x\n", info
->cJobs
);
368 printf("\tAverage PPM\t\t= 0x%x\n", info
->AveragePPM
);
370 printf("\tDevice Mode Information\n");
371 printf("\t-----------------------\n");
372 print_devmode(info
->pDevMode
);
374 printf("\tSecurity Descriptor Information\n");
375 printf("\t-------------------------------\n");
376 print_secdesc(info
->pSecurityDescriptor
);
381 void print_printer_info_5(PPRINTER_INFO_5 info
)
383 printf("\tPrinter Name\t\t\t= %s\n", info
->pPrinterName
);
384 printf("\tPort Name\t\t\t= %s\n", info
->pPortName
);
385 printf("\tAttributes\t\t\t= 0x%x\n", info
->Attributes
);
386 printf("\tDev NotSelect Timeout\t= 0x%x\n", info
->DeviceNotSelectedTimeout
);
387 printf("\tTX RetryTimeout\t\t= 0x%x\n", info
->TransmissionRetryTimeout
);
391 void print_printer_info_6(PPRINTER_INFO_6 info
)
393 printf("\tStatus\t\t\t= 0x%x\n", info
->dwStatus
);
397 void print_printer_info_7(PPRINTER_INFO_7 info
)
399 printf("\tObject GUID\t\t\t= %s\n", info
->pszObjectGUID
);
400 printf("\tAction\t\t\t= 0x%x\n", info
->dwAction
);
404 void print_printer_info_8(PPRINTER_INFO_8 info
)
406 print_devmode(info
->pDevMode
);
409 void print_printer_info_9(PPRINTER_INFO_9 info
)
411 print_devmode(info
->pDevMode
);
414 void print_printer_info_bylevel(DWORD level
, LPBYTE buffer
, DWORD count
)
417 PPRINTER_INFO_1 buffer1
= NULL
;
418 PPRINTER_INFO_2 buffer2
= NULL
;
419 PPRINTER_INFO_3 buffer3
= NULL
;
420 PPRINTER_INFO_4 buffer4
= NULL
;
421 PPRINTER_INFO_5 buffer5
= NULL
;
422 PPRINTER_INFO_6 buffer6
= NULL
;
423 PPRINTER_INFO_7 buffer7
= NULL
;
424 PPRINTER_INFO_8 buffer8
= NULL
;
432 buffer1
= (PPRINTER_INFO_1
)buffer
;
435 buffer2
= (PPRINTER_INFO_2
)buffer
;
438 buffer3
= (PPRINTER_INFO_3
)buffer
;
441 buffer4
= (PPRINTER_INFO_4
)buffer
;
444 buffer5
= (PPRINTER_INFO_5
)buffer
;
447 buffer6
= (PPRINTER_INFO_6
)buffer
;
450 buffer7
= (PPRINTER_INFO_7
)buffer
;
453 buffer8
= (PPRINTER_INFO_8
)buffer
;
459 printf("Printer Info Level %d:\n", level
);
463 for (i
=0; i
<count
; i
++) {
464 print_printer_info_1(&buffer1
[i
]);
469 for (i
=0; i
<count
; i
++) {
470 print_printer_info_2(&buffer2
[i
]);
476 for (i
=0; i
<count
; i
++) {
477 print_printer_info_3(&buffer3
[i
]);
482 for (i
=0; i
<count
; i
++) {
483 print_printer_info_4(&buffer4
[i
]);
489 for (i
=0; i
<count
; i
++) {
490 print_printer_info_5(&buffer5
[i
]);
495 for (i
=0; i
<count
; i
++) {
496 print_printer_info_6(&buffer6
[i
]);
501 for (i
=0; i
<count
; i
++) {
502 print_printer_info_7(&buffer7
[i
]);
507 for (i
=0; i
<count
; i
++) {
508 print_printer_info_8(&buffer8
[i
]);
517 void print_printprocessor_info_1(PPRINTPROCESSOR_INFO_1 info
)
519 printf("\tPrint Processor Name\t= %s\n", info
->pName
);
524 void print_driver_info_1(PDRIVER_INFO_1 info
)
526 printf("\tDriver Name\t= %s\n\n", info
->pName
);
531 void print_driver_info_2(PDRIVER_INFO_2 info
)
533 printf("\tDriver Name\t= %s\n", info
->pName
);
534 printf("\tEnvironment\t= %s\n", info
->pEnvironment
);
535 printf("\tVersion\t\t= %d\n", info
->cVersion
);
536 printf("\tDriver Path\t= %s\n", info
->pDriverPath
);
537 printf("\tData File\t= %s\n", info
->pDataFile
);
538 printf("\tConfig File\t= %s\n\n", info
->pConfigFile
);
543 void print_driver_info_3(PDRIVER_INFO_3 info
)
547 printf("\tDriver Name\t= %s\n", info
->pName
);
548 printf("\tEnvironment\t= %s\n", info
->pEnvironment
);
549 printf("\tVersion\t\t= %d\n", info
->cVersion
);
550 printf("\tDriver Path\t= %s\n", info
->pDriverPath
);
551 printf("\tData File\t= %s\n", info
->pDataFile
);
552 printf("\tConfig File\t= %s\n", info
->pConfigFile
);
553 printf("\tHelp Path\t= %s\n", info
->pHelpFile
);
554 printf("\tMonitor Name\t= %s\n", info
->pMonitorName
);
555 printf("\tData Type\t= %s\n", info
->pDefaultDataType
);
556 ptr
= (char*)info
->pDependentFiles
;
557 while ((ptr
!= NULL
) && (*ptr
!= '\0')) {
558 printf("\tDependent Files\t= %s\n", ptr
);
559 for (;*ptr
!= '\0'; ptr
++)
560 /* printf("%s\n", ptr); */
568 void print_driver_info_4(PDRIVER_INFO_4 info
)
572 printf("\tDriver Name\t= %s\n", info
->pName
);
573 printf("\tEnvironment\t= %s\n", info
->pEnvironment
);
574 printf("\tVersion\t\t= %d\n", info
->cVersion
);
575 printf("\tDriver Path\t= %s\n", info
->pDriverPath
);
576 printf("\tData File\t= %s\n", info
->pDataFile
);
577 printf("\tConfig File\t= %s\n", info
->pConfigFile
);
578 printf("\tHelp Path\t= %s\n", info
->pHelpFile
);
579 printf("\tMonitor Name\t= %s\n", info
->pMonitorName
);
580 printf("\tData Type\t= %s\n", info
->pDefaultDataType
);
581 printf("\tPrevious Names\t= %s\n", info
->pszzPreviousNames
);
582 ptr
= (char*)info
->pDependentFiles
;
583 while ((ptr
!= NULL
) && (*ptr
!= '\0')) {
584 printf("\tDependent Files\t= %s\n", ptr
);
585 for (;*ptr
!= '\0'; ptr
++)
586 /* printf("%s\n", ptr); */
594 void print_driver_info_5(PDRIVER_INFO_5 info
)
596 printf("\tDriver Name\t= %s\n", info
->pName
);
597 printf("\tEnvironment\t= %s\n", info
->pEnvironment
);
598 printf("\tVersion\t\t= %d\n", info
->cVersion
);
599 printf("\tDriver Path\t= %s\n", info
->pDriverPath
);
600 printf("\tData File\t= %s\n", info
->pDataFile
);
601 printf("\tConfig File\t= %s\n", info
->pConfigFile
);
602 printf("\tDriver Attributes\t= %d\n", info
->dwDriverAttributes
);
603 printf("\tConfig Version\t= %d\n", info
->dwConfigVersion
);
604 printf("\tDriver Version\t= %d\n", info
->dwDriverVersion
);
609 void print_driver_info_6(PDRIVER_INFO_6 info
)
613 printf("\tDriver Name\t= %s\n", info
->pName
);
614 printf("\tEnvironment\t= %s\n", info
->pEnvironment
);
615 printf("\tVersion\t\t= %d\n", info
->cVersion
);
616 printf("\tDriver Path\t= %s\n", info
->pDriverPath
);
617 printf("\tData File\t= %s\n", info
->pDataFile
);
618 printf("\tConfig File\t= %s\n", info
->pConfigFile
);
619 printf("\tHelp Path\t= %s\n", info
->pHelpFile
);
620 printf("\tMonitor Name\t= %s\n", info
->pMonitorName
);
621 printf("\tData Type\t= %s\n", info
->pDefaultDataType
);
622 printf("\tPrevious Names\t= %s\n", info
->pszzPreviousNames
);
623 ptr
= (char*)info
->pDependentFiles
;
625 while (*ptr
!= '\0') {
626 printf("\tDependent Files\t= %s\n", ptr
);
627 for (;*ptr
!= '\0'; ptr
++)
628 /* printf("%s\n", ptr); */
633 printf("\tPrevious Names\t= (null)\n");
636 ptr
= (char*)info
->pszzPreviousNames
;
638 while (*ptr
!= '\0') {
639 printf("\tPrevious Names\t= %s\n", ptr
);
640 for (;*ptr
!= '\0'; ptr
++)
641 /* printf("%s\n", ptr); */
646 printf("\tPrevious Names\t= (null)\n");
649 printf("\tDriver Date\t= %d\n", info
->ftDriverDate
);
650 printf("\tDriver Version\t= %d\n", info
->dwlDriverVersion
);
651 printf("\tManufacture Name = %s\n", info
->pszMfgName
);
652 printf("\tOEM URL\t\t= %s\n", info
->pszOEMUrl
);
653 printf("\tHardware ID\t= %s\n", info
->pszHardwareID
);
654 printf("\tProvider\t= %s\n", info
->pszProvider
);
658 static void print_multi_sz(LPSTR multisz
)
662 ptr
= (char *)multisz
;
669 while (*ptr
!= '\0') {
671 for (; *ptr
!= '\0'; ptr
++) {
672 /* printf("%s\n", ptr); */
679 void print_driver_info_8(PDRIVER_INFO_8 info
)
681 printf("\tDriver Name\t= %s\n", info
->pName
);
682 printf("\tEnvironment\t= %s\n", info
->pEnvironment
);
683 printf("\tVersion\t\t= %d\n", info
->cVersion
);
684 printf("\tDriver Path\t= %s\n", info
->pDriverPath
);
685 printf("\tData File\t= %s\n", info
->pDataFile
);
686 printf("\tConfig File\t= %s\n", info
->pConfigFile
);
687 printf("\tHelp Path\t= %s\n", info
->pHelpFile
);
688 printf("\tMonitor Name\t= %s\n", info
->pMonitorName
);
689 printf("\tData Type\t= %s\n", info
->pDefaultDataType
);
690 printf("\tPrevious Names\t=\n");
691 print_multi_sz(info
->pszzPreviousNames
);
692 printf("\tDependent Files\t=\n");
693 print_multi_sz(info
->pDependentFiles
);
694 printf("\tDriver Date\t= %d\n", info
->ftDriverDate
);
695 printf("\tDriver Version\t= %d\n", info
->dwlDriverVersion
);
696 printf("\tManufacture Name = %s\n", info
->pszMfgName
);
697 printf("\tOEM URL\t\t= %s\n", info
->pszOEMUrl
);
698 printf("\tHardware ID\t= %s\n", info
->pszHardwareID
);
699 printf("\tProvider\t= %s\n", info
->pszProvider
);
700 printf("\tPrint Processor\t= %s\n", info
->pszPrintProcessor
);
701 printf("\tVendor Setup\t= %s\n", info
->pszVendorSetup
);
702 printf("\tColor Profiles\t=\n");
703 print_multi_sz(info
->pszzColorProfiles
);
704 printf("\tInf Path\t= %s\n", info
->pszInfPath
);
705 printf("\tPrinter Driver Attributes = %d\n", info
->dwPrinterDriverAttributes
);
706 printf("\tCore Driver Dependencies\t=\n");
707 print_multi_sz(info
->pszzCoreDriverDependencies
);
708 printf("\tMin Inbox Driver VerDate\t= %d\n", info
->ftMinInboxDriverVerDate
);
709 printf("\tMin Inbox Driver VerVersion\t= %d\n", info
->dwlMinInboxDriverVerVersion
);
713 void print_driver_info_bylevel(DWORD level
, LPBYTE buffer
, DWORD count
)
716 PDRIVER_INFO_1 buffer1
= NULL
;
717 PDRIVER_INFO_2 buffer2
= NULL
;
718 PDRIVER_INFO_3 buffer3
= NULL
;
719 PDRIVER_INFO_4 buffer4
= NULL
;
720 PDRIVER_INFO_5 buffer5
= NULL
;
721 PDRIVER_INFO_6 buffer6
= NULL
;
722 PDRIVER_INFO_8 buffer8
= NULL
;
730 buffer1
= (PDRIVER_INFO_1
)buffer
;
733 buffer2
= (PDRIVER_INFO_2
)buffer
;
736 buffer3
= (PDRIVER_INFO_3
)buffer
;
739 buffer4
= (PDRIVER_INFO_4
)buffer
;
742 buffer5
= (PDRIVER_INFO_5
)buffer
;
745 buffer6
= (PDRIVER_INFO_6
)buffer
;
748 buffer8
= (PDRIVER_INFO_8
)buffer
;
754 printf("Driver Info Level %d:\n", level
);
758 for (i
=0; i
<count
; i
++) {
759 print_driver_info_1(&buffer1
[i
]);
764 for (i
=0; i
<count
; i
++) {
765 print_driver_info_2(&buffer2
[i
]);
770 for (i
=0; i
<count
; i
++) {
771 print_driver_info_3(&buffer3
[i
]);
776 for (i
=0; i
<count
; i
++) {
777 print_driver_info_4(&buffer4
[i
]);
782 for (i
=0; i
<count
; i
++) {
783 print_driver_info_5(&buffer5
[i
]);
788 for (i
=0; i
<count
; i
++) {
789 print_driver_info_6(&buffer6
[i
]);
794 for (i
=0; i
<count
; i
++) {
795 print_driver_info_8(&buffer8
[i
]);
804 void print_doc_info_1(PDOC_INFO_1 info
)
806 printf("\tDocument Name\t= %s\n", info
->pDocName
);
807 printf("\tOutput Filename\t= %s\n", info
->pOutputFile
);
808 printf("\tDatatype\t= %s\n", info
->pDatatype
);
812 void print_printer_keys(LPSTR buffer
)
820 for (; *p
; p
= CharNext(p
)) {
826 static LPSTR
reg_type_str(DWORD type
)
834 return "REG_MULTI_SZ";
842 void print_printer_data(LPSTR keyname
, LPSTR valuename
, DWORD size
, LPBYTE buffer
, DWORD type
)
848 printf("\tKey Name:\t%s\n", keyname
);
851 printf("\tValue Name:\t%s\n", valuename
);
852 printf("\tSize: 0x%x (%d)\n", size
, size
);
853 printf("\tType:\t\t%s\n", reg_type_str(type
));
857 printf("\t\t%s\n", (LPSTR
)buffer
);
863 for (; *p
; p
= CharNext(p
)) {
870 printf("\t\t0x%08x\n", (DWORD
)*buffer
);
873 for (i
=0; i
< size
; i
++) {
874 printf("\t0x%x", buffer
[i
]);
885 void print_printer_enum_values(PRINTER_ENUM_VALUES
*info
)
887 print_printer_data(NULL
, info
->pValueName
, info
->cbData
, info
->pData
, info
->dwType
);