Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2420 lines
94 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1990 - 2000
  3. All rights reserved.
  4. Module Name:
  5. dbgspl.c
  6. Abstract:
  7. This module provides all the public exported APIs relating to Printer
  8. and Job management for the Local Print Providor
  9. Author:
  10. Krishna Ganugapati (KrishnaG) 1-July-1993
  11. Revision History:
  12. KrishnaG: Created: 1-July-1993 (imported most of IanJa's stuff)
  13. KrishnaG: Added: 7-July-1993 (added AndrewBe's UnicodeAnsi conversion routines)
  14. KrishnaG Added: 3-Aug-1993 (added DevMode/SecurityDescriptor dumps)
  15. MattFe 7 NOV 94 win32spl debug extentions
  16. To do:
  17. Write a generic dump unicode string (reduce the code!!)
  18. --*/
  19. #include "precomp.h"
  20. #pragma hdrstop
  21. #include "dbglocal.h"
  22. #include "dbgsec.h"
  23. #define NULL_TERMINATED 0
  24. #define VERBOSE_ON 1
  25. #define VERBOSE_OFF 0
  26. typedef void (*PNTSD_OUTPUT_ROUTINE)(char *, ...);
  27. BOOL
  28. DbgDumpIniPrintProc(
  29. HANDLE hCurrentProcess,
  30. PNTSD_OUTPUT_ROUTINE Print,
  31. PINIPRINTPROC pIniPrintProc
  32. );
  33. BOOL
  34. DbgDumpIniDriver(
  35. HANDLE hCurrentProcess,
  36. PNTSD_OUTPUT_ROUTINE Print,
  37. PINIDRIVER pIniDriver
  38. );
  39. BOOL
  40. DbgDumpIniEnvironment(
  41. HANDLE hCurrentProcess,
  42. PNTSD_OUTPUT_ROUTINE Print,
  43. PINIENVIRONMENT pIniEnvironment
  44. );
  45. BOOL
  46. DbgDumpIniNetPrint(
  47. HANDLE hCurrentProcess,
  48. PNTSD_OUTPUT_ROUTINE Print,
  49. PININETPRINT pIniNetPrint
  50. );
  51. BOOL
  52. DbgDumpIniMonitor(
  53. HANDLE hCurrentProcess,
  54. PNTSD_OUTPUT_ROUTINE Print,
  55. PINIMONITOR pIniMonitor
  56. );
  57. BOOL
  58. DbgDumpIniPort(
  59. HANDLE hCurrentProcess,
  60. PNTSD_OUTPUT_ROUTINE Print,
  61. PINIPORT pIniPort
  62. );
  63. BOOL
  64. DbgDumpIniPrinter(
  65. HANDLE hCurrentProcess,
  66. PNTSD_OUTPUT_ROUTINE Print,
  67. PINIPRINTER pIniPrinter
  68. );
  69. BOOL
  70. DbgDumpIniForm(
  71. HANDLE hCurrentProcess,
  72. PNTSD_OUTPUT_ROUTINE Print,
  73. PINIFORM pForm
  74. );
  75. BOOL
  76. DbgDumpIniJob(
  77. HANDLE hCurrentProcess,
  78. PNTSD_OUTPUT_ROUTINE Print,
  79. PINIJOB pIniJob
  80. );
  81. BOOL
  82. DbgDumpProvidor(
  83. HANDLE hCurrentProcess,
  84. PNTSD_OUTPUT_ROUTINE Print,
  85. LPPROVIDOR pProvidor
  86. );
  87. BOOL
  88. DbgDumpSpool(
  89. HANDLE hCurrentProcess,
  90. PNTSD_OUTPUT_ROUTINE Print,
  91. PSPOOL pSpool
  92. );
  93. BOOL
  94. DbgDumpShadowFile(
  95. HANDLE hCurrentProcess,
  96. PNTSD_OUTPUT_ROUTINE Print,
  97. PSHADOWFILE pShadowFile
  98. );
  99. BOOL
  100. DbgDumpShadowFile2(
  101. HANDLE hCurrentProcess,
  102. PNTSD_OUTPUT_ROUTINE Print,
  103. PSHADOWFILE_2 pShadowFile
  104. );
  105. VOID
  106. PrintData(
  107. PNTSD_OUTPUT_ROUTINE Print,
  108. LPSTR TypeString,
  109. LPSTR VarString,
  110. ...
  111. );
  112. BOOL
  113. DbgDumpWCacheIniPrinter(
  114. HANDLE hCurrentProcess,
  115. PNTSD_OUTPUT_ROUTINE Print,
  116. PWCACHEINIPRINTEREXTRA pWCacheIniPrinter
  117. );
  118. BOOL
  119. DbgDumpWSpool(
  120. HANDLE hCurrentProcess,
  121. PNTSD_OUTPUT_ROUTINE Print,
  122. PWSPOOL pSpool
  123. );
  124. BOOL
  125. DbgDumpIniSpooler(
  126. HANDLE hCurrentProcess,
  127. PNTSD_OUTPUT_ROUTINE Print,
  128. PINISPOOLER pIniSpooler
  129. );
  130. BOOL
  131. DbgDumpIniVersion(
  132. HANDLE hCurrentProcess,
  133. PNTSD_OUTPUT_ROUTINE Print,
  134. PINIVERSION pIniVersion
  135. );
  136. BOOL
  137. DbgDumpPrintHandle(
  138. HANDLE hCurrentProcess,
  139. PNTSD_OUTPUT_ROUTINE Print,
  140. PPRINTHANDLE pPrintHandle
  141. );
  142. typedef struct _DBG_PRINTER_ACCESS
  143. {
  144. DWORD Attribute;
  145. LPSTR String;
  146. } DBG_PRINTER_ACCESS, *PDBG_PRINTER_ACCESS;
  147. DBG_PRINTER_ACCESS
  148. PrinterAccessTable[] =
  149. {
  150. SERVER_ACCESS_ADMINISTER ,"Server_Access_Administer",
  151. SERVER_ACCESS_ENUMERATE ,"Server_Access_Enumerate",
  152. PRINTER_ACCESS_ADMINISTER ,"Printer_Access_Administer",
  153. PRINTER_ACCESS_USE ,"Printer_Access_Use",
  154. JOB_ACCESS_ADMINISTER ,"Job_Access_Administer"
  155. };
  156. typedef struct _DBG_SPOOLER_FLAGS
  157. {
  158. DWORD SpoolerFlags;
  159. LPSTR String;
  160. } DBG_SPOOLER_FLAGS, *PDBG_SPOOLER_FLAGS;
  161. DBG_SPOOLER_FLAGS
  162. SpoolerFlagsTable[] =
  163. {
  164. SPL_UPDATE_WININI_DEVICES ,"Update_WinIni_Devices",
  165. SPL_PRINTER_CHANGES ,"Printer_Changes",
  166. SPL_LOG_EVENTS ,"Log_Events",
  167. SPL_FORMS_CHANGE ,"Forms_Change",
  168. SPL_BROADCAST_CHANGE ,"Broadcast_Change",
  169. SPL_SECURITY_CHECK ,"Security_Check",
  170. SPL_OPEN_CREATE_PORTS ,"Open_Create_Ports",
  171. SPL_FAIL_OPEN_PRINTERS_PENDING_DELETION ,"Fail_Open_Printers_Pending_Deletion",
  172. SPL_REMOTE_HANDLE_CHECK ,"Remote_Handle_Check"
  173. };
  174. typedef struct _DBG_PRINTER_STATUS
  175. {
  176. DWORD Status;
  177. LPSTR String;
  178. } DBG_PRINTER_STATUS, *PDBG_PRINTER_STATUS;
  179. DBG_PRINTER_STATUS
  180. PrinterStatusTable[] =
  181. {
  182. PRINTER_ZOMBIE_OBJECT, "Zombie_Object",
  183. PRINTER_PENDING_CREATION, "Pending_Creation",
  184. PRINTER_OK, "OK",
  185. PRINTER_FROM_REG, "From_Reg",
  186. PRINTER_WAS_SHARED, "Was_Shared",
  187. PRINTER_ERROR, "Error",
  188. PRINTER_PAPER_JAM, "PaperJam",
  189. PRINTER_PAPEROUT, "PaperOut",
  190. PRINTER_MANUAL_FEED, "ManualFeed",
  191. PRINTER_PAPER_PROBLEM, "PaperProblem",
  192. PRINTER_OFFLINE, "OffLine",
  193. PRINTER_IO_ACTIVE, "IOActive",
  194. PRINTER_BUSY, "Busy",
  195. PRINTER_PRINTING, "Printing",
  196. PRINTER_OUTPUT_BIN_FULL, "OutputBinFull",
  197. PRINTER_NOT_AVAILABLE, "NotAvailable",
  198. PRINTER_WAITING, "Waiting",
  199. PRINTER_PROCESSING, "Processing",
  200. PRINTER_INITIALIZING, "Initializing",
  201. PRINTER_WARMING_UP, "WarmingUp",
  202. PRINTER_TONER_LOW, "TonerLow",
  203. PRINTER_NO_TONER, "NoToner",
  204. PRINTER_PAGE_PUNT, "PagePunt",
  205. PRINTER_USER_INTERVENTION, "UserIntervention",
  206. PRINTER_OUT_OF_MEMORY, "OutOfMemory",
  207. PRINTER_DOOR_OPEN, "DoorOpen",
  208. PRINTER_SERVER_UNKNOWN, "ServerUnknown",
  209. PRINTER_PAUSED, "Paused",
  210. PRINTER_PENDING_DELETION, "Pending_Deletion",
  211. };
  212. typedef struct _DBG_EXTERNAL_PRINTER_STATUS
  213. {
  214. DWORD Status;
  215. LPSTR String;
  216. } DBG_EXTERNAL_PRINTER_STATUS, *PDBG_EXTERNAL_PRINTER_STATUS;
  217. DBG_EXTERNAL_PRINTER_STATUS
  218. ExternalPrinterStatusTable[] =
  219. {
  220. PRINTER_STATUS_PAUSED , "Paused",
  221. PRINTER_STATUS_ERROR , "Error",
  222. PRINTER_STATUS_PENDING_DELETION , "Pending_Deletion",
  223. PRINTER_STATUS_PAPER_JAM , "Paper_Jam",
  224. PRINTER_STATUS_PAPER_OUT , "Paper_Out",
  225. PRINTER_STATUS_MANUAL_FEED , "Manual_Feed",
  226. PRINTER_STATUS_PAPER_PROBLEM , "Paper_Problem",
  227. PRINTER_STATUS_OFFLINE , "OffLine",
  228. PRINTER_STATUS_IO_ACTIVE , "IO_Active",
  229. PRINTER_STATUS_BUSY , "Busy",
  230. PRINTER_STATUS_PRINTING , "Printing",
  231. PRINTER_STATUS_OUTPUT_BIN_FULL , "Output_Bin_Full",
  232. PRINTER_STATUS_NOT_AVAILABLE , "Not_Available",
  233. PRINTER_STATUS_WAITING , "Waiting",
  234. PRINTER_STATUS_PROCESSING , "Processing",
  235. PRINTER_STATUS_INITIALIZING , "Initializing",
  236. PRINTER_STATUS_WARMING_UP , "Warming_Up",
  237. PRINTER_STATUS_TONER_LOW , "Toner_Low",
  238. PRINTER_STATUS_NO_TONER , "No_Toner",
  239. PRINTER_STATUS_PAGE_PUNT , "Page_Punt",
  240. PRINTER_STATUS_USER_INTERVENTION , "User_Intervention",
  241. PRINTER_STATUS_OUT_OF_MEMORY , "Out_Of_Memory",
  242. PRINTER_STATUS_DOOR_OPEN , "Door_Open",
  243. PRINTER_STATUS_SERVER_UNKNOWN , "Server_Unknown"
  244. };
  245. typedef struct _DBG_PORT_STATUS
  246. {
  247. DWORD Status;
  248. LPSTR String;
  249. } DBG_PORT_STATUS, *PDBG_PORT_STATUS;
  250. DBG_PORT_STATUS
  251. PortStatusTable[] =
  252. {
  253. PORT_STATUS_OFFLINE , "Offline",
  254. PORT_STATUS_PAPER_JAM , "PaperJam",
  255. PORT_STATUS_PAPER_OUT , "PaperOut",
  256. PORT_STATUS_OUTPUT_BIN_FULL , "OutputBinFull",
  257. PORT_STATUS_PAPER_PROBLEM , "PaperJam",
  258. PORT_STATUS_NO_TONER , "NoToner",
  259. PORT_STATUS_DOOR_OPEN , "DoorOpen",
  260. PORT_STATUS_USER_INTERVENTION , "UserIntervention",
  261. PORT_STATUS_OUT_OF_MEMORY , "OutOfMemory",
  262. PORT_STATUS_TONER_LOW , "TonerLow",
  263. PORT_STATUS_WARMING_UP , "WarmingUp",
  264. PORT_STATUS_POWER_SAVE , "PowerSave"
  265. };
  266. typedef struct _DBG_PRINTER_ATTRIBUTE
  267. {
  268. DWORD Attribute;
  269. LPSTR String;
  270. } DBG_PRINTER_ATTRIBUTE, *PDBG_PRINTER_ATTRIBUTE;
  271. DBG_PRINTER_ATTRIBUTE
  272. ChangeStatusTable[] =
  273. {
  274. STATUS_CHANGE_FORMING, "Forming",
  275. STATUS_CHANGE_VALID, "Valid",
  276. STATUS_CHANGE_CLOSING, "Closing",
  277. STATUS_CHANGE_CLIENT, "Client",
  278. STATUS_CHANGE_ACTIVE, "Active",
  279. STATUS_CHANGE_INFO, "Info",
  280. STATUS_CHANGE_ACTIVE_REQ, "ActiveRequest",
  281. STATUS_CHANGE_DISCARDED, "Discarded",
  282. STATUS_CHANGE_DISCARDNOTED, "DiscardNoted",
  283. };
  284. DBG_PRINTER_ATTRIBUTE
  285. PrinterAttributeTable[] =
  286. {
  287. PRINTER_ATTRIBUTE_QUEUED, "Queued",
  288. PRINTER_ATTRIBUTE_DIRECT, "Direct",
  289. PRINTER_ATTRIBUTE_DEFAULT, "Default",
  290. PRINTER_ATTRIBUTE_SHARED, "Shared",
  291. PRINTER_ATTRIBUTE_NETWORK, "Network",
  292. PRINTER_ATTRIBUTE_LOCAL, "Local",
  293. PRINTER_ATTRIBUTE_HIDDEN, "Hidden",
  294. PRINTER_ATTRIBUTE_ENABLE_DEVQ, "Enable_DevQ",
  295. PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS, "KeepPrintedJobs",
  296. PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST, "DoCompleteFirst",
  297. PRINTER_ATTRIBUTE_ENABLE_BIDI, "EnableBidi",
  298. PRINTER_ATTRIBUTE_FAX, "Fax",
  299. PRINTER_ATTRIBUTE_WORK_OFFLINE, "Offline"
  300. };
  301. typedef struct _DBG_JOB_STATUS
  302. {
  303. DWORD Status;
  304. LPSTR String;
  305. } DBG_JOB_STATUS, *PDBG_JOB_STATUS;
  306. DBG_JOB_STATUS
  307. JobStatusTable[] =
  308. {
  309. JOB_PAUSED, "Paused",
  310. JOB_ERROR, "Error",
  311. JOB_OFFLINE, "OffLine",
  312. JOB_PAPEROUT, "PaperOut",
  313. JOB_PENDING_DELETION, "Deleting",
  314. JOB_SPOOLING, "Spooling",
  315. JOB_PRINTING, "Printing",
  316. JOB_PRINTED, "Printed",
  317. JOB_BLOCKED_DEVQ, "Blocked_DevQ",
  318. JOB_DELETED, "Deleted",
  319. JOB_DESPOOLING, "Despooling",
  320. JOB_DIRECT, "Direct",
  321. JOB_COMPLETE, "Complete",
  322. JOB_RESTART, "Restart",
  323. JOB_REMOTE, "Remote",
  324. JOB_NOTIFICATION_SENT, "Notification_Sent",
  325. JOB_PRINT_TO_FILE, "Print_To_File",
  326. JOB_TYPE_ADDJOB, "AddJob",
  327. JOB_SCHEDULE_JOB, "Schedule_Job",
  328. JOB_TIMEOUT, "Timeout",
  329. JOB_ABANDON, "Abandon",
  330. JOB_TRUE_EOJ, "TrueEOJ",
  331. JOB_COMPOUND, "Compound",
  332. JOB_HIDDEN, "Hidden",
  333. JOB_TYPE_OPTIMIZE, "MemoryMap Optimization",
  334. JOB_PP_CLOSE, "Print Proccessor Close",
  335. JOB_DOWNLEVEL, "Downlevel Job"
  336. };
  337. typedef struct _DBG_PINIPORT_STATUS
  338. {
  339. DWORD Status;
  340. LPSTR String;
  341. } DBG_PINIPORT_STATUS, *PDBG_PINIPORT_STATUS;
  342. DBG_PINIPORT_STATUS
  343. pIniPortStatusTable[]=
  344. {
  345. PP_PAUSED ,"Paused",
  346. PP_WAITING ,"Waiting",
  347. PP_RUNTHREAD ,"RunThread",
  348. PP_THREADRUNNING ,"ThreadRunning",
  349. PP_RESTART ,"Restart",
  350. PP_CHECKMON ,"CheckMon",
  351. PP_STOPMON ,"StopMon",
  352. PP_QPROCCHECK ,"QProcCheck",
  353. PP_QPROCPAUSE ,"QProcPause",
  354. PP_QPROCABORT ,"QProctAbort",
  355. PP_QPROCCLOSE ,"QProcClose",
  356. PP_PAUSEAFTER ,"PauseAfter",
  357. PP_MONITORRUNNING ,"MonitorRunning",
  358. PP_RUNMONITOR ,"RunMonitor",
  359. PP_MONITOR ,"Monitor",
  360. PP_FILE ,"File",
  361. PP_ERROR ,"Error",
  362. PP_WARNING ,"Warning",
  363. PP_INFORMATIONAL ,"Informational",
  364. PP_DELETING ,"Deleting",
  365. PP_STARTDOC ,"StartDoc",
  366. PP_PLACEHOLDER ,"Placeholder",
  367. };
  368. typedef struct _DBG_WSPOOL_STATUS
  369. {
  370. DWORD Status;
  371. LPSTR String;
  372. } DBG_WSPOOL_STATUS, *PDBG_WSPOOL_STATUS;
  373. DBG_WSPOOL_STATUS
  374. WSpoolStatusTable[]=
  375. {
  376. WSPOOL_STATUS_STARTDOC ,"StartDoc",
  377. WSPOOL_STATUS_BEGINPAGE ,"BeginPage",
  378. WSPOOL_STATUS_TEMP_CONNECTION ,"Temp_Connection",
  379. WSPOOL_STATUS_OPEN_ERROR ,"Open_Error",
  380. WSPOOL_STATUS_PRINT_FILE ,"Print_File",
  381. WSPOOL_STATUS_USE_CACHE ,"Use_Cache",
  382. WSPOOL_STATUS_NO_RPC_HANDLE ,"No_Rpc_Handle",
  383. WSPOOL_STATUS_PENDING_DELETE ,"Pending_delete",
  384. WSPOOL_STATUS_RESETPRINTER_PENDING ,"ResetPrinter_Pending"
  385. };
  386. typedef struct _DBG_PSPOOL_STATUS
  387. {
  388. DWORD Status;
  389. LPSTR String;
  390. } DBG_PSPOOL_STATUS, *PDBG_PSPOOL_STATUS;
  391. DBG_PSPOOL_STATUS
  392. pSpoolStatusTable[]=
  393. {
  394. SPOOL_STATUS_STARTDOC ,"StartDoc",
  395. SPOOL_STATUS_BEGINPAGE ,"BeginPage",
  396. SPOOL_STATUS_CANCELLED ,"Cancelled",
  397. SPOOL_STATUS_PRINTING ,"Printing",
  398. SPOOL_STATUS_ADDJOB ,"AddJob",
  399. SPOOL_STATUS_PRINT_FILE ,"Print_File",
  400. SPOOL_STATUS_NOTIFY ,"Notify",
  401. SPOOL_STATUS_FLUSH_PRINTER ,"FlushPrinter"
  402. };
  403. typedef struct _DBG_PSPOOL_TYPE_OF_HANDLE
  404. {
  405. DWORD TypeOfHandle;
  406. LPSTR String;
  407. } DBG_PSPOOL_TYPE_OF_HANDLE, *PDBG_PSPOOL_TYPE_OF_HANDLE;
  408. DBG_PSPOOL_TYPE_OF_HANDLE
  409. pSpoolTypeOfHandleTable[]=
  410. {
  411. PRINTER_HANDLE_PRINTER, "Printer",
  412. PRINTER_HANDLE_REMOTE_DATA, "RemoteData",
  413. PRINTER_HANDLE_REMOTE_CALL, "RemoteCall",
  414. PRINTER_HANDLE_JOB, "Job",
  415. PRINTER_HANDLE_PORT, "Port",
  416. PRINTER_HANDLE_DIRECT, "Direct",
  417. PRINTER_HANDLE_SERVER, "Server",
  418. PRINTER_HANDLE_3XCLIENT, "Nt3x_Client",
  419. PRINTER_HANDLE_REMOTE_ADMIN, "Remote Admin"
  420. };
  421. typedef struct _DBG_WCACHEPRINTER_STATUS
  422. {
  423. DWORD Status;
  424. LPSTR String;
  425. } DBG_WCACHEPRINTER_STATUS, *PDBG_WCACHEPRINTER_STATUS;
  426. DBG_WCACHEPRINTER_STATUS
  427. WCachePrinterStatusTable[]=
  428. {
  429. EXTRA_STATUS_PENDING_FFPCN ,"Pending_FFPCN",
  430. EXTRA_STATUS_DOING_REFRESH ,"Doing_Refresh"
  431. };
  432. typedef struct _DBG_DEVMODE_FIELDS {
  433. DWORD dmField;
  434. LPSTR String;
  435. }DBG_DEVMODE_FIELDS;
  436. #define MAX_DEVMODE_FIELDS 14
  437. DBG_DEVMODE_FIELDS DevModeFieldsTable[] =
  438. {
  439. 0x00000001, "dm_orientation",
  440. 0x00000002, "dm_papersize",
  441. 0x00000004, "dm_paperlength",
  442. 0x00000008, "dm_paperwidth",
  443. 0x00000010, "dm_scale",
  444. 0x00000100, "dm_copies",
  445. 0x00000200, "dm_defautsource",
  446. 0x00000400, "dm_printquality",
  447. 0x00000800, "dm_color",
  448. 0x00001000, "dm_duplex",
  449. 0x00002000, "dm_yresolution",
  450. 0x00004000, "dm_ttoption",
  451. 0x00008000, "dm_collate",
  452. 0x00010000, "dm_formname"
  453. };
  454. typedef struct _DBG_PINIDRIVER_FLAGS {
  455. DWORD dwDriverFlag;
  456. LPSTR String;
  457. } DBG_PINIDRIVER_FLAGS;
  458. DBG_PINIDRIVER_FLAGS pIniDriverFlagsTable[] =
  459. {
  460. PRINTER_DRIVER_PENDING_DELETION, "Pending-Deletion"
  461. };
  462. #define MAX_DEVMODE_PAPERSIZES 41
  463. LPSTR DevModePaperSizes[] =
  464. {
  465. " Letter 8 1/2 x 11 in ",
  466. " Letter Small 8 1/2 x 11 in ",
  467. " Tabloid 11 x 17 in ",
  468. " Ledger 17 x 11 in ",
  469. " Legal 8 1/2 x 14 in ",
  470. " Statement 5 1/2 x 8 1/2 in ",
  471. " Executive 7 1/4 x 10 1/2 in ",
  472. " A3 297 x 420 mm ",
  473. " A4 210 x 297 mm ",
  474. " A4 Small 210 x 297 mm ",
  475. " A5 148 x 210 mm ",
  476. " B4 250 x 354 ",
  477. " B5 182 x 257 mm ",
  478. " Folio 8 1/2 x 13 in ",
  479. " Quarto 215 x 275 mm ",
  480. " 10x14 in ",
  481. " 11x17 in ",
  482. " Note 8 1/2 x 11 in ",
  483. " Envelope #9 3 7/8 x 8 7/8 ",
  484. " Envelope #10 4 1/8 x 9 1/2 ",
  485. " Envelope #11 4 1/2 x 10 3/8 ",
  486. " Envelope #12 4 \276 x 11 ",
  487. " Envelope #14 5 x 11 1/2 ",
  488. " C size sheet ",
  489. " D size sheet ",
  490. " E size sheet ",
  491. " Envelope DL 110 x 220mm ",
  492. " Envelope C5 162 x 229 mm ",
  493. " Envelope C3 324 x 458 mm ",
  494. " Envelope C4 229 x 324 mm ",
  495. " Envelope C6 114 x 162 mm ",
  496. " Envelope C65 114 x 229 mm ",
  497. " Envelope B4 250 x 353 mm ",
  498. " Envelope B5 176 x 250 mm ",
  499. " Envelope B6 176 x 125 mm ",
  500. " Envelope 110 x 230 mm ",
  501. " Envelope Monarch 3.875 x 7.5 in ",
  502. " 6 3/4 Envelope 3 5/8 x 6 1/2 in ",
  503. " US Std Fanfold 14 7/8 x 11 in ",
  504. " German Std Fanfold 8 1/2 x 12 in ",
  505. " German Legal Fanfold 8 1/2 x 13 in "
  506. };
  507. VOID
  508. ExtractPrinterAccess(PNTSD_OUTPUT_ROUTINE Print, DWORD Attribute)
  509. {
  510. DWORD i = 0;
  511. if ( Attribute != 0 ) {
  512. (*Print)(" ");
  513. while (i < sizeof(PrinterAccessTable)/sizeof(PrinterAccessTable[0])) {
  514. if (Attribute & PrinterAccessTable[i].Attribute) {
  515. (*Print)("%s ", PrinterAccessTable[i].String);
  516. }
  517. i++;
  518. }
  519. (*Print)("\n");
  520. }
  521. }
  522. VOID
  523. ExtractPrinterAttributes(PNTSD_OUTPUT_ROUTINE Print, DWORD Attribute)
  524. {
  525. DWORD i = 0;
  526. if ( Attribute != 0 ) {
  527. (*Print)(" ");
  528. while (i < sizeof(PrinterAttributeTable)/sizeof(PrinterAttributeTable[0])) {
  529. if (Attribute & PrinterAttributeTable[i].Attribute) {
  530. (*Print)("%s ", PrinterAttributeTable[i].String);
  531. }
  532. i++;
  533. }
  534. (*Print)("\n");
  535. }
  536. }
  537. VOID
  538. ExtractChangeStatus(PNTSD_OUTPUT_ROUTINE Print, ESTATUS eStatus)
  539. {
  540. DWORD i = 0;
  541. if ( eStatus != 0 ) {
  542. (*Print)(" ");
  543. while (i < sizeof(ChangeStatusTable)/sizeof(ChangeStatusTable[0])) {
  544. if (eStatus & ChangeStatusTable[i].Attribute) {
  545. (*Print)("%s ", ChangeStatusTable[i].String);
  546. }
  547. i++;
  548. }
  549. (*Print)("\n");
  550. }
  551. }
  552. VOID
  553. ExtractExternalPrinterStatus(PNTSD_OUTPUT_ROUTINE Print, DWORD Status)
  554. {
  555. DWORD i = 0;
  556. if ( Status != 0 ) {
  557. (*Print)(" ");
  558. while (i < sizeof(ExternalPrinterStatusTable)/sizeof(ExternalPrinterStatusTable[0])) {
  559. if (Status & ExternalPrinterStatusTable[i].Status) {
  560. (*Print)("%s ", ExternalPrinterStatusTable[i].String);
  561. }
  562. i++;
  563. }
  564. (*Print)("\n");
  565. }
  566. }
  567. VOID
  568. ExtractSpoolerFlags(PNTSD_OUTPUT_ROUTINE Print, DWORD SpoolerFlags)
  569. {
  570. DWORD i = 0;
  571. if ( SpoolerFlags != 0 ) {
  572. (*Print)(" ");
  573. while (i < sizeof(SpoolerFlagsTable)/sizeof(SpoolerFlagsTable[0])) {
  574. if (SpoolerFlags & SpoolerFlagsTable[i].SpoolerFlags) {
  575. (*Print)("%s ", SpoolerFlagsTable[i].String);
  576. }
  577. i++;
  578. }
  579. (*Print)("\n");
  580. }
  581. }
  582. VOID
  583. ExtractPrinterStatus(PNTSD_OUTPUT_ROUTINE Print, DWORD Status)
  584. {
  585. DWORD i = 0;
  586. if ( Status != 0 ) {
  587. (*Print)(" ");
  588. while (i < sizeof(PrinterStatusTable)/sizeof(PrinterStatusTable[0])) {
  589. if (Status & PrinterStatusTable[i].Status) {
  590. (*Print)("%s ", PrinterStatusTable[i].String);
  591. }
  592. i++;
  593. }
  594. (*Print)("\n");
  595. }
  596. }
  597. VOID
  598. ExtractWCachePrinterStatus(PNTSD_OUTPUT_ROUTINE Print, DWORD Status)
  599. {
  600. DWORD i = 0;
  601. if ( Status != 0 ) {
  602. (*Print)(" ");
  603. while (i < sizeof(WCachePrinterStatusTable)/sizeof(WCachePrinterStatusTable[0])) {
  604. if (Status & WCachePrinterStatusTable[i].Status) {
  605. (*Print)("%s ", WCachePrinterStatusTable[i].String);
  606. }
  607. i++;
  608. }
  609. (*Print)("\n");
  610. }
  611. }
  612. VOID
  613. ExtractPortStatus(PNTSD_OUTPUT_ROUTINE Print, DWORD Status)
  614. {
  615. DWORD i = 0;
  616. (*Print)(" ");
  617. if ( Status != 0 ) {
  618. while (i < sizeof(PortStatusTable)/sizeof(PortStatusTable[0])) {
  619. if (Status == PortStatusTable[i].Status) {
  620. (*Print)("%s ", PortStatusTable[i].String);
  621. }
  622. i++;
  623. }
  624. } else {
  625. }
  626. (*Print)("\n");
  627. }
  628. VOID
  629. ExtractJobStatus(PNTSD_OUTPUT_ROUTINE Print, DWORD Status)
  630. {
  631. DWORD i = 0;
  632. if ( Status != 0 ) {
  633. (*Print)(" ");
  634. while (i < sizeof(JobStatusTable)/sizeof(JobStatusTable[0])) {
  635. if (Status & JobStatusTable[i].Status) {
  636. (*Print)("%s ", JobStatusTable[i].String);
  637. }
  638. i++;
  639. }
  640. (*Print)("\n");
  641. }
  642. }
  643. VOID
  644. ExtractpSpoolTypeOfHandle(PNTSD_OUTPUT_ROUTINE Print, DWORD TypeOfHandle)
  645. {
  646. DWORD i = 0;
  647. if ( TypeOfHandle != 0 ) {
  648. (*Print)(" ");
  649. while (i < sizeof(pSpoolTypeOfHandleTable)/sizeof(pSpoolTypeOfHandleTable[0])) {
  650. if (TypeOfHandle & pSpoolTypeOfHandleTable[i].TypeOfHandle) {
  651. (*Print)("%s ", pSpoolTypeOfHandleTable[i].String);
  652. }
  653. i++;
  654. }
  655. (*Print)("\n");
  656. }
  657. }
  658. VOID
  659. ExtractpSpoolStatus(PNTSD_OUTPUT_ROUTINE Print, DWORD Status)
  660. {
  661. DWORD i = 0;
  662. if ( Status != 0 ) {
  663. (*Print)(" ");
  664. while (i < sizeof(pSpoolStatusTable)/sizeof(pSpoolStatusTable[0])) {
  665. if (Status & pSpoolStatusTable[i].Status) {
  666. (*Print)("%s ", pSpoolStatusTable[i].String);
  667. }
  668. i++;
  669. }
  670. (*Print)("\n");
  671. }
  672. }
  673. VOID
  674. ExtractWSpoolStatus(PNTSD_OUTPUT_ROUTINE Print, DWORD Status)
  675. {
  676. DWORD i = 0;
  677. if ( Status != 0 ) {
  678. (*Print)(" ");
  679. while (i < sizeof(WSpoolStatusTable)/sizeof(WSpoolStatusTable[0])) {
  680. if (Status & WSpoolStatusTable[i].Status) {
  681. (*Print)("%s ", WSpoolStatusTable[i].String);
  682. }
  683. i++;
  684. }
  685. (*Print)("\n");
  686. }
  687. }
  688. VOID
  689. ExtractpIniPortStatus(PNTSD_OUTPUT_ROUTINE Print, DWORD Status)
  690. {
  691. DWORD i = 0;
  692. if ( Status != 0 ) {
  693. (*Print)(" ");
  694. while (i < sizeof(pIniPortStatusTable)/sizeof(pIniPortStatusTable[0])) {
  695. if (Status & pIniPortStatusTable[i].Status) {
  696. (*Print)("%s ", pIniPortStatusTable[i].String);
  697. }
  698. i++;
  699. }
  700. (*Print)("\n");
  701. }
  702. }
  703. VOID
  704. ExtractpIniDriverFlags(PNTSD_OUTPUT_ROUTINE Print, DWORD Flags)
  705. {
  706. DWORD i = 0;
  707. if ( Flags != 0 ) {
  708. (*Print)(" ");
  709. while (i < sizeof(pIniDriverFlagsTable)/sizeof(pIniDriverFlagsTable[0])) {
  710. if (Flags & pIniDriverFlagsTable[i].dwDriverFlag) {
  711. (*Print)("%s ", pIniDriverFlagsTable[i].String);
  712. }
  713. i++;
  714. }
  715. }
  716. (*Print)("\n");
  717. }
  718. // All of the primary spooler structures are identified by an
  719. // "signature" field which is the first DWORD in the structure
  720. // This function examines the signature field in the structure
  721. // and appropriately dumps out the contents of the structure in
  722. // a human-readable format.
  723. BOOL
  724. DbgDumpStructure(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, UINT_PTR pData)
  725. {
  726. INIDRIVER IniDriver;
  727. INIENVIRONMENT IniEnvironment;
  728. INIPRINTER IniPrinter;
  729. INIPRINTPROC IniPrintProc;
  730. ININETPRINT IniNetPrint;
  731. INIMONITOR IniMonitor;
  732. INIPORT IniPort;
  733. WINIPORT WIniPort;
  734. INIFORM IniForm;
  735. INIJOB IniJob;
  736. SPOOL Spool;
  737. WSPOOL WSpool;
  738. SHADOWFILE ShadowFile;
  739. SHADOWFILE_2 ShadowFile2;
  740. PRINTHANDLE PrintHandle;
  741. DWORD Signature;
  742. INISPOOLER IniSpooler;
  743. INIVERSION IniVersion;
  744. WCACHEINIPRINTEREXTRA WCacheIniPrinterExtra;
  745. movestruct(pData,&Signature, DWORD);
  746. switch (Signature) {
  747. case ISP_SIGNATURE: // dump INISPOOLER
  748. movestruct(pData, &IniSpooler, INISPOOLER);
  749. DbgDumpIniSpooler(hCurrentProcess, Print, (PINISPOOLER)&IniSpooler);
  750. break;
  751. case IPP_SIGNATURE: // dump INIPRINTPROC structure
  752. movestruct(pData, &IniPrintProc, INIPRINTPROC);
  753. DbgDumpIniPrintProc(hCurrentProcess, Print, (PINIPRINTPROC)&IniPrintProc);
  754. break;
  755. case ID_SIGNATURE: // dump INIDRIVER structure
  756. movestruct(pData, &IniDriver, INIDRIVER);
  757. DbgDumpIniDriver(hCurrentProcess, Print, (PINIDRIVER)&IniDriver);
  758. break;
  759. case IE_SIGNATURE: // dump INIENVIRONMENT structure
  760. movestruct(pData, &IniEnvironment, INIENVIRONMENT);
  761. DbgDumpIniEnvironment(hCurrentProcess, Print, (PINIENVIRONMENT)&IniEnvironment);
  762. break;
  763. case IV_SIGNATURE: // dump INIVERSION structure
  764. movestruct(pData, &IniVersion, INIVERSION);
  765. DbgDumpIniVersion(hCurrentProcess, Print, (PINIVERSION)&IniVersion);
  766. break;
  767. case IP_SIGNATURE:
  768. movestruct(pData, &IniPrinter, INIPRINTER);
  769. DbgDumpIniPrinter(hCurrentProcess, Print, (PINIPRINTER)&IniPrinter);
  770. break;
  771. case WCIP_SIGNATURE:
  772. movestruct(pData, &WCacheIniPrinterExtra, WCACHEINIPRINTEREXTRA);
  773. DbgDumpWCacheIniPrinter(hCurrentProcess, Print, (PWCACHEINIPRINTEREXTRA)&WCacheIniPrinterExtra);
  774. break;
  775. case IN_SIGNATURE:
  776. movestruct(pData, &IniNetPrint, ININETPRINT);
  777. DbgDumpIniNetPrint(hCurrentProcess, Print, (PININETPRINT)&IniNetPrint);
  778. break;
  779. case IMO_SIGNATURE:
  780. movestruct(pData, &IniMonitor, INIMONITOR);
  781. DbgDumpIniMonitor(hCurrentProcess, Print, (PINIMONITOR)&IniMonitor);
  782. break;
  783. case IPO_SIGNATURE:
  784. movestruct(pData, &IniPort, INIPORT);
  785. DbgDumpIniPort(hCurrentProcess, Print, (PINIPORT)&IniPort);
  786. break;
  787. case WIPO_SIGNATURE:
  788. movestruct(pData, &WIniPort, WINIPORT);
  789. DbgDumpWIniPort(hCurrentProcess, Print, (PWINIPORT)&WIniPort);
  790. break;
  791. case IFO_SIGNATURE:
  792. movestruct(pData, &IniForm, INIFORM);
  793. DbgDumpIniForm(hCurrentProcess, Print, (PINIFORM)&IniForm);
  794. break;
  795. case IJ_SIGNATURE:
  796. movestruct(pData, &IniJob, INIJOB);
  797. DbgDumpIniJob(hCurrentProcess, Print, (PINIJOB)&IniJob);
  798. break;
  799. case SJ_SIGNATURE:
  800. movestruct(pData, &Spool, SPOOL);
  801. DbgDumpSpool(hCurrentProcess, Print, (PSPOOL)&Spool);
  802. break;
  803. case WSJ_SIGNATURE:
  804. movestruct(pData, &WSpool, WSPOOL);
  805. DbgDumpWSpool(hCurrentProcess, Print, (PWSPOOL)&WSpool);
  806. break;
  807. case SF_SIGNATURE:
  808. movestruct(pData, &ShadowFile, SHADOWFILE);
  809. DbgDumpShadowFile(hCurrentProcess, Print, (PSHADOWFILE)&ShadowFile);
  810. break;
  811. case SF_SIGNATURE_2:
  812. movestruct(pData, &ShadowFile2, SHADOWFILE_2);
  813. DbgDumpShadowFile2(hCurrentProcess, Print, (PSHADOWFILE_2)&ShadowFile2);
  814. break;
  815. case PRINTHANDLE_SIGNATURE:
  816. movestruct(pData, &PrintHandle, PRINTHANDLE);
  817. DbgDumpPrintHandle(hCurrentProcess, Print, (PPRINTHANDLE)&PrintHandle);
  818. break;
  819. default:
  820. // Unknown signature -- no data to dump
  821. (*Print)("Warning: Unknown Signature\n");
  822. break;
  823. }
  824. (*Print)("\n");
  825. return TRUE;
  826. }
  827. BOOL
  828. DbgDumpIniEntry(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PINIENTRY pIniEntry)
  829. {
  830. WCHAR Buffer[MAX_PATH+1];
  831. (*Print)("IniEntry\n");
  832. (*Print)("DWORD signature %d\n", pIniEntry->signature);
  833. (*Print)("PINIENTRY pNext %p\n", pIniEntry->pNext);
  834. movestr(pIniEntry->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  835. (*Print)("LPWSTR pName %ws\n", Buffer);
  836. return TRUE;
  837. }
  838. BOOL
  839. DbgDumpIniPrintProc(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PINIPRINTPROC pIniPrintProc)
  840. {
  841. WCHAR Buffer[MAX_PATH+1];
  842. DWORD i = 0;
  843. (*Print)("IniPrintProc\n");
  844. (*Print)("DWORD signature %d\n", pIniPrintProc->signature);
  845. (*Print)("PINIPRINTPROC pNext %x\n", pIniPrintProc->pNext);
  846. (*Print)("DWORD cRef %d\n", pIniPrintProc->cRef);
  847. movestr(pIniPrintProc->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  848. (*Print)("DWORD pName %ws\n", Buffer);
  849. movestr(pIniPrintProc->pDLLName, Buffer, sizeof(WCHAR)*MAX_PATH);
  850. (*Print)("LPWSTR pDLLName %ws\n", Buffer);
  851. (*Print)("LPWSTR cbDatatypes %d\n", pIniPrintProc->cbDatatypes);
  852. (*Print)("LPWSTR cDatatypes %d\n", pIniPrintProc->cDatatypes);
  853. for (i = 0; i < pIniPrintProc->cDatatypes; i++ ) {
  854. (*Print)(" Each of the Strings here \n");
  855. }
  856. (*Print)("HANDLE hLibrary 0x%.8x\n", pIniPrintProc->hLibrary);
  857. (*Print)("FARPROC Install 0x%.8x\n", pIniPrintProc->Install);
  858. (*Print)("FARPROC EnumDatatypes 0x%.8x\n", pIniPrintProc->EnumDatatypes);
  859. (*Print)("FARPROC Open 0x%.8x\n", pIniPrintProc->Open);
  860. (*Print)("FARPROC Print 0x%.8x\n", pIniPrintProc->Print);
  861. (*Print)("FARPROC Close 0x%.8x\n", pIniPrintProc->Close);
  862. (*Print)("FARPROC Control 0x%.8x\n", pIniPrintProc->Control);
  863. (*Print)("CRITICAL_SECTION CriticalSection 0x%.8x\n", pIniPrintProc->CriticalSection);
  864. return TRUE;
  865. }
  866. BOOL
  867. DbgDumpIniDriver(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PINIDRIVER pIniDriver)
  868. {
  869. WCHAR Buffer[MAX_PATH+1];
  870. WCHAR UnKnown[] = L"Not Initialized";
  871. WCHAR Kernel[] = L"Kernel Mode";
  872. WCHAR User[] = L"User Mode";
  873. SYSTEMTIME SystemTime;
  874. (*Print)("IniDriver\n");
  875. (*Print)("DWORD signature %d\n", pIniDriver->signature);
  876. (*Print)("PINIDRIVER pNext %p\n", pIniDriver->pNext);
  877. (*Print)("DWORD cRef %d\n", pIniDriver->cRef);
  878. movestr(pIniDriver->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  879. (*Print)("LPWSTR pName %ws\n", Buffer);
  880. movestr(pIniDriver->pDriverFile, Buffer, sizeof(WCHAR)*MAX_PATH);
  881. (*Print)("LPWSTR pDriverFile %ws\n", Buffer);
  882. movestr(pIniDriver->pConfigFile, Buffer, sizeof(WCHAR)*MAX_PATH);
  883. (*Print)("LPWSTR pConfigFile %ws\n", Buffer);
  884. movestr(pIniDriver->pDataFile, Buffer, sizeof(WCHAR)*MAX_PATH);
  885. (*Print)("LPWSTR pDataFile %ws\n", Buffer);
  886. movestr(pIniDriver->pHelpFile, Buffer, sizeof(WCHAR)*MAX_PATH);
  887. (*Print)("LPWSTR pHelpFile %ws\n", Buffer);
  888. movestr(pIniDriver->pDependentFiles, Buffer, sizeof(WCHAR)*MAX_PATH);
  889. (*Print)("LPWSTR pDependentFiles %ws\n", Buffer);
  890. movestr(pIniDriver->pMonitorName, Buffer, sizeof(WCHAR)*MAX_PATH);
  891. (*Print)("LPWSTR pMonitorName %ws\n", Buffer);
  892. (*Print)("PINIMONITOR pIniLangMonitor %p\n", pIniDriver->pIniLangMonitor);
  893. movestr(pIniDriver->pDefaultDataType, Buffer, sizeof(WCHAR)*MAX_PATH);
  894. (*Print)("LPWSTR pDefaultDataType %ws\n", Buffer);
  895. movestr(pIniDriver->pszzPreviousNames, Buffer, sizeof(WCHAR)*MAX_PATH);
  896. (*Print)("LPWSTR pszzPreviousNames %ws\n", Buffer);
  897. switch (pIniDriver->dwDriverAttributes) {
  898. case 0:
  899. (*Print)("DWORD dwDriverAttributes %ws\n", (LPWSTR)UnKnown);
  900. break;
  901. case 1:
  902. (*Print)("DWORD dwDriverAttributes %ws\n", (LPWSTR)Kernel);
  903. break;
  904. case 2:
  905. (*Print)("DWORD dwDriverAttributes %ws\n", (LPWSTR)User);
  906. break;
  907. }
  908. (*Print)("DWORD cVersion %d\n", pIniDriver->cVersion);
  909. (*Print)("DWORD dwTempDir %d\n", pIniDriver->dwTempDir);
  910. movestr(pIniDriver->pszMfgName, Buffer, sizeof(WCHAR)*MAX_PATH);
  911. (*Print)("LPWSTR Manufacturer %ws\n", Buffer);
  912. movestr(pIniDriver->pszOEMUrl, Buffer, sizeof(WCHAR)*MAX_PATH);
  913. (*Print)("LPWSTR OEM URL %ws\n", Buffer);
  914. movestr(pIniDriver->pszHardwareID, Buffer, sizeof(WCHAR)*MAX_PATH);
  915. (*Print)("LPWSTR HardwareID %ws\n", Buffer);
  916. movestr(pIniDriver->pszProvider, Buffer, sizeof(WCHAR)*MAX_PATH);
  917. (*Print)("LPWSTR Provider %ws\n", Buffer);
  918. (*Print)("DWORDLONG DriverVersion %I64x\n", pIniDriver->dwlDriverVersion);
  919. if (pIniDriver->ftDriverDate.dwHighDateTime &&
  920. pIniDriver->ftDriverDate.dwLowDateTime &&
  921. FileTimeToSystemTime(&pIniDriver->ftDriverDate, &SystemTime))
  922. {
  923. (*Print)("SYSTEMTIME DriverDate %d/%d/%d %d %d:%d:%d.%d\n",SystemTime.wYear,
  924. SystemTime.wMonth,
  925. SystemTime.wDay,
  926. SystemTime.wDayOfWeek,
  927. SystemTime.wHour,
  928. SystemTime.wMinute,
  929. SystemTime.wSecond,
  930. SystemTime.wMilliseconds);
  931. }
  932. else
  933. {
  934. (*Print)("SYSTEMTIME DriverDate Not initialized\n");
  935. }
  936. (*Print)("DWORD dwDriverFlags %08x", pIniDriver->dwDriverFlags);
  937. ExtractpIniDriverFlags(Print, pIniDriver->dwDriverFlags);
  938. return TRUE;
  939. }
  940. BOOL
  941. DbgDumpIniEnvironment(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PINIENVIRONMENT pIniEnvironment)
  942. {
  943. WCHAR Buffer[MAX_PATH+1];
  944. (*Print)("IniEnvironment\n");
  945. (*Print)("DWORD signature %d\n", pIniEnvironment->signature);
  946. (*Print)("struct _INIENVIRONMENT *pNext %p\n", pIniEnvironment->pNext);
  947. (*Print)("DWORD cRef %d\n", pIniEnvironment->cRef);
  948. movestr(pIniEnvironment->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  949. (*Print)("LPWSTR pName %ws\n", Buffer);
  950. movestr(pIniEnvironment->pDirectory, Buffer, sizeof(WCHAR)*MAX_PATH);
  951. (*Print)("LPWSTR pDirectory %ws\n", Buffer);
  952. (*Print)("PINIVERSION pIniVersion %p\n", pIniEnvironment->pIniVersion);
  953. (*Print)("PINIPRINTPROC pIniPrintProc %p\n", pIniEnvironment->pIniPrintProc);
  954. (*Print)("PINISPOOLER pIniSpooler %p\n", pIniEnvironment->pIniSpooler);
  955. return TRUE;
  956. }
  957. BOOL
  958. DbgDumpIniVersion( HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PINIVERSION pIniVersion )
  959. {
  960. WCHAR Buffer[MAX_PATH+1];
  961. (*Print)("IniVersion\n");
  962. (*Print)("DWORD signature %d\n", pIniVersion->signature);
  963. (*Print)("struct _IniVersion *pNext %p\n", pIniVersion->pNext);
  964. movestr(pIniVersion->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  965. (*Print)("LPWSTR pName %ws\n", Buffer);
  966. movestr(pIniVersion->szDirectory, Buffer, sizeof(WCHAR)*MAX_PATH);
  967. (*Print)("LPWSTR szDirectory %ws\n", Buffer);
  968. (*Print)("DWORD cMajorVersion %d\n", pIniVersion->cMajorVersion );
  969. (*Print)("DWORD cMinorVersion %d\n", pIniVersion->cMinorVersion );
  970. (*Print)("PINIDRIVER pIniDriver %p\n", pIniVersion->pIniDriver );
  971. return TRUE;
  972. }
  973. BOOL
  974. DbgDumpWCacheIniPrinter(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PWCACHEINIPRINTEREXTRA pWCacheIniPrinter)
  975. {
  976. WCHAR Buffer[MAX_PATH+1];
  977. (*Print)("WCacheIniPrinterExtra\n");
  978. (*Print)("DWORD signature %d\n", pWCacheIniPrinter->signature);
  979. (*Print)("DWORD cb %d\n", pWCacheIniPrinter->cb);
  980. (*Print)("LPPRINTER_INFO_2 pPI2 %p\n", pWCacheIniPrinter->pPI2);
  981. (*Print)("DWORD cbPI2 %d\n", pWCacheIniPrinter->cbPI2);
  982. DbgDumpPI2( hCurrentProcess, Print, (UINT_PTR)pWCacheIniPrinter->pPI2, 1 );
  983. (*Print)("DWORD cCacheID %d\n", pWCacheIniPrinter->cCacheID );
  984. (*Print)("DWORD cRef %d\n", pWCacheIniPrinter->cRef );
  985. (*Print)("DWORD dwServerVersion %x\n", pWCacheIniPrinter->dwServerVersion );
  986. (*Print)("DWORD dwTickCount %x\n", pWCacheIniPrinter->dwTickCount );
  987. (*Print)("DWORD Status 0x%.8x\n", pWCacheIniPrinter->Status );
  988. ExtractWCachePrinterStatus( Print, pWCacheIniPrinter->Status );
  989. return TRUE;
  990. }
  991. BOOL
  992. DbgDumpIniPrinter(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PINIPRINTER pIniPrinter)
  993. {
  994. WCHAR Buffer[MAX_PATH+1];
  995. (*Print)("IniPrinter\n");
  996. (*Print)("DWORD signature %d\n", pIniPrinter->signature);
  997. (*Print)("PINIPRINTER pNext %p\n", pIniPrinter->pNext);
  998. (*Print)("DWORD cRef %d\n", pIniPrinter->cRef);
  999. movestr(pIniPrinter->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1000. (*Print)("LPWSTR pName %ws\n", Buffer);
  1001. movestr(pIniPrinter->pShareName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1002. (*Print)("LPWSTR pShareName %ws\n", Buffer);
  1003. (*Print)("PINIPRINTPROC pIniPrintProc %p\n", pIniPrinter->pIniPrintProc);
  1004. movestr(pIniPrinter->pDatatype, Buffer, sizeof(WCHAR)*MAX_PATH);
  1005. (*Print)("LPWSTR pDatatype %ws\n", Buffer);
  1006. movestr(pIniPrinter->pParameters, Buffer, sizeof(WCHAR)*MAX_PATH);
  1007. (*Print)("LPWSTR pParameters %ws\n", Buffer);
  1008. movestr(pIniPrinter->pComment, Buffer, sizeof(WCHAR)*MAX_PATH);
  1009. (*Print)("LPWSTR pComment %ws\n", Buffer);
  1010. (*Print)("PINIDRIVER pIniDriver %p\n", pIniPrinter->pIniDriver);
  1011. (*Print)("DWORD cbDevMode %d\n", pIniPrinter->cbDevMode);
  1012. (*Print)("LPDEVMODE pDevMode %p\n", pIniPrinter->pDevMode);
  1013. (*Print)("DWORD Priority %d\n", pIniPrinter->Priority);
  1014. (*Print)("DWORD DefaultPriority %d\n", pIniPrinter->DefaultPriority);
  1015. (*Print)("DWORD StartTime %d\n", pIniPrinter->StartTime);
  1016. (*Print)("DWORD UntilTime %d\n", pIniPrinter->UntilTime);
  1017. movestr(pIniPrinter->pSepFile, Buffer, sizeof(WCHAR)*MAX_PATH);
  1018. (*Print)("LPWSTR pSepFile %ws\n", Buffer);
  1019. (*Print)("DWORD Status 0x%.8x\n", pIniPrinter->Status);
  1020. ExtractPrinterStatus( Print, pIniPrinter->Status );
  1021. movestr(pIniPrinter->pLocation, Buffer, sizeof(WCHAR)*MAX_PATH);
  1022. (*Print)("LPWSTR pLocation %ws\n", Buffer);
  1023. (*Print)("DWORD Attributes 0x%.8x\n",pIniPrinter->Attributes);
  1024. ExtractPrinterAttributes( Print, pIniPrinter->Attributes );
  1025. (*Print)("DWORD cJobs %d\n", pIniPrinter->cJobs);
  1026. (*Print)("DWORD AveragePPM %d\n", pIniPrinter->AveragePPM);
  1027. (*Print)("BOOL GenerateOnClose 0x%.8x\n", pIniPrinter->GenerateOnClose);
  1028. (*Print)("PINIPORT pIniNetPort %p\n", pIniPrinter->pIniNetPort);
  1029. (*Print)("PINIJOB pIniFirstJob %p\n", pIniPrinter->pIniFirstJob);
  1030. (*Print)("PINIJOB pIniLastJob %p\n", pIniPrinter->pIniLastJob);
  1031. (*Print)("PSECURITY_DESCRIPTOR pSecurityDescriptor %p\n", pIniPrinter->pSecurityDescriptor);
  1032. (*Print)("PSPOOL *pSpool %p\n", pIniPrinter->pSpool);
  1033. if ( pIniPrinter->pSpoolDir == NULL ) {
  1034. (*Print)("LPWSTR pSpoolDir %p\n", pIniPrinter->pSpoolDir);
  1035. } else {
  1036. movestr(pIniPrinter->pSpoolDir, Buffer, sizeof(WCHAR)*MAX_PATH);
  1037. (*Print)("LPWSTR pSpoolDir %ws\n", Buffer);
  1038. }
  1039. (*Print)("DWORD cTotalJobs %d\n", pIniPrinter->cTotalJobs);
  1040. (*Print)("DWORD cTotalBytes.LowPart %d\n", pIniPrinter->cTotalBytes.LowPart);
  1041. (*Print)("DWORD cTotalBytes.HighPart %d\n", pIniPrinter->cTotalBytes.HighPart);
  1042. (*Print)("SYSTEMTIME stUpTime %d/%d/%d %d %d:%d:%d.%d\n",pIniPrinter->stUpTime.wYear,
  1043. pIniPrinter->stUpTime.wMonth,
  1044. pIniPrinter->stUpTime.wDay,
  1045. pIniPrinter->stUpTime.wDayOfWeek,
  1046. pIniPrinter->stUpTime.wHour,
  1047. pIniPrinter->stUpTime.wMinute,
  1048. pIniPrinter->stUpTime.wSecond,
  1049. pIniPrinter->stUpTime.wMilliseconds);
  1050. (*Print)("DWORD MaxcRef %d\n", pIniPrinter->MaxcRef);
  1051. (*Print)("DWORD cTotalPagesPrinted %d\n", pIniPrinter->cTotalPagesPrinted);
  1052. (*Print)("DWORD cSpooling %d\n", pIniPrinter->cSpooling);
  1053. (*Print)("DWORD cMaxSpooling %d\n", pIniPrinter->cMaxSpooling);
  1054. (*Print)("DWORD cErrorOutOfPaper %d\n", pIniPrinter->cErrorOutOfPaper);
  1055. (*Print)("DWORD cErrorNotReady %d\n", pIniPrinter->cErrorNotReady);
  1056. (*Print)("DWORD cJobError %d\n", pIniPrinter->cJobError);
  1057. (*Print)("DWORD dwLastError %d\n", pIniPrinter->dwLastError);
  1058. (*Print)("PINISPOOLER pIniSpooler %p\n", pIniPrinter->pIniSpooler);
  1059. (*Print)("DWORD cZombieRef %d\n", pIniPrinter->cZombieRef);
  1060. (*Print)("LPBYTE pExtraData %x\n", pIniPrinter->pExtraData);
  1061. (*Print)("DWORD cChangeID %d\n", pIniPrinter->cChangeID);
  1062. (*Print)("DWORD cPorts %d\n", pIniPrinter->cPorts);
  1063. (*Print)("PINIPORT *ppIniPorts %x\n", pIniPrinter->ppIniPorts);
  1064. (*Print)("DWORD PortStatus %d\n", pIniPrinter->PortStatus);
  1065. (*Print)("DWORD dnsTimeout %d\n", pIniPrinter->dnsTimeout);
  1066. (*Print)("DWORD txTimeout %d\n", pIniPrinter->txTimeout);
  1067. movestr(pIniPrinter->pszObjectGUID, Buffer, sizeof(WCHAR)*MAX_PATH);
  1068. (*Print)("LPWSTR pszObjectGUID %ws\n", Buffer);
  1069. (*Print)("DWORD DsKeyUpdate %x\n", pIniPrinter->DsKeyUpdate);
  1070. (*Print)("DWORD DsKeyUpdateForeground %x\n", pIniPrinter->DsKeyUpdateForeground);
  1071. movestr(pIniPrinter->pszDN, Buffer, sizeof(WCHAR)*MAX_PATH);
  1072. (*Print)("LPWSTR pszDN %ws\n", Buffer);
  1073. movestr(pIniPrinter->pszCN, Buffer, sizeof(WCHAR)*MAX_PATH);
  1074. (*Print)("LPWSTR pszCN %ws\n", Buffer);
  1075. (*Print)("DWORD cRefIC %d\n", pIniPrinter->cRefIC);
  1076. (*Print)("DWORD dwAction %d\n", pIniPrinter->dwAction);
  1077. (*Print)("BOOL bDsPendingDeletion %d\n", pIniPrinter->bDsPendingDeletion);
  1078. return TRUE;
  1079. }
  1080. BOOL
  1081. DbgDumpIniNetPrint(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PININETPRINT pIniNetPrint)
  1082. {
  1083. WCHAR Buffer[MAX_PATH+1];
  1084. (*Print)("IniNetPrint\n");
  1085. (*Print)("DWORD signature %d\n", pIniNetPrint->signature);
  1086. (*Print)("PININETPRINT *pNext %p\n", pIniNetPrint->pNext);
  1087. (*Print)("DWORD TickCount %d\n", pIniNetPrint->TickCount);
  1088. movestr(pIniNetPrint->pDescription, Buffer, sizeof(WCHAR)*MAX_PATH);
  1089. (*Print)("LPWSTR pDescription %ws\n", Buffer);
  1090. movestr(pIniNetPrint->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1091. (*Print)("LPWSTR pName %ws\n", Buffer);
  1092. movestr(pIniNetPrint->pComment, Buffer, sizeof(WCHAR)*MAX_PATH);
  1093. (*Print)("LPWSTR pComment %ws\n", Buffer);
  1094. return TRUE;
  1095. }
  1096. BOOL
  1097. DbgDumpIniMonitor(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PINIMONITOR pIniMonitor)
  1098. {
  1099. WCHAR Buffer[MAX_PATH+1];
  1100. (*Print)("IniMonitor\n");
  1101. (*Print)("DWORD signature %d\n", pIniMonitor->signature);
  1102. (*Print)("PINIMONITOR pNext %p\n", pIniMonitor->pNext);
  1103. (*Print)("DWORD cRef %d\n", pIniMonitor->cRef);
  1104. movestr(pIniMonitor->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1105. (*Print)("LPWSTR pName %ws\n", Buffer);
  1106. movestr(pIniMonitor->pMonitorDll, Buffer, sizeof(WCHAR)*MAX_PATH);
  1107. (*Print)("LPWSTR pMonitorDll %ws\n", Buffer);
  1108. (*Print)("HANDLE hModule %p\n", pIniMonitor->hModule);
  1109. (*Print)("PMONITORINIT pMonitorInit %p\n", pIniMonitor->pMonitorInit);
  1110. (*Print)("HANDLE hMonitor %p\n", pIniMonitor->hMonitor);
  1111. (*Print)("BOOL bUplevel %%.8x\n", pIniMonitor->bUplevel);
  1112. (*Print)("PINISPOOLER pIniSpooler %p\n", pIniMonitor->pIniSpooler);
  1113. return TRUE;
  1114. }
  1115. BOOL
  1116. DbgDumpIniPort(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PINIPORT pIniPort)
  1117. {
  1118. WCHAR Buffer[MAX_PATH+1];
  1119. (*Print)("IniPort\n");
  1120. (*Print)("DWORD signature %d\n", pIniPort->signature);
  1121. (*Print)("struct _INIPORT *pNext %p\n", pIniPort->pNext);
  1122. (*Print)("DWORD cRef 0x%.8x\n", pIniPort->cRef);
  1123. movestr(pIniPort->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1124. (*Print)("LPWSTR pName %ws\n", Buffer);
  1125. (*Print)("HANDLE hProc 0x%.8x\n", pIniPort->hProc);
  1126. (*Print)("DWORD Status 0x%.8x\n", pIniPort->Status);
  1127. ExtractpIniPortStatus( Print, pIniPort->Status);
  1128. ExtractPortStatus( Print, pIniPort->PrinterStatus);
  1129. (*Print)("HANDLE Semaphore 0x%.8x\n", pIniPort->Semaphore);
  1130. (*Print)("PINIJOB pIniJob %p\n", pIniPort->pIniJob);
  1131. (*Print)("DWORD cJobs %d\n", pIniPort->cJobs);
  1132. (*Print)("DWORD cPrinters %d\n", pIniPort->cPrinters);
  1133. (*Print)("PINIPRINTER *ppIniPrinter %p\n", pIniPort->ppIniPrinter);
  1134. (*Print)("PINIMONITOR pIniMonitor %p\n", pIniPort->pIniMonitor);
  1135. (*Print)("PINIMONITOR pIniLangMonitor %p\n", pIniPort->pIniLangMonitor);
  1136. (*Print)("HANDLE hWaitToOpenOrClose 0x%.8x\n", pIniPort->hWaitToOpenOrClose);
  1137. (*Print)("HANDLE hEvent 0x%.8x\n", pIniPort->hEvent);
  1138. (*Print)("HANDLE hPort 0x%.8x\n", pIniPort->hPort);
  1139. (*Print)("HANDLE Ready 0x%.8x\n", pIniPort->Ready);
  1140. (*Print)("HANDLE hPortThread 0x%.8x\n", pIniPort->hPortThread);
  1141. (*Print)("PINISPOOLER pIniSpooler %p\n", pIniPort->pIniSpooler);
  1142. (*Print)("DWORD InCriticalSection %d\n", pIniPort->InCriticalSection);
  1143. return TRUE;
  1144. }
  1145. BOOL
  1146. DbgDumpWIniPort(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PWINIPORT pWIniPort)
  1147. {
  1148. WCHAR Buffer[MAX_PATH+1];
  1149. (*Print)("WIniPort\n");
  1150. (*Print)("DWORD signature %d\n", pWIniPort->signature);
  1151. (*Print)("DWORD cb %d\n", pWIniPort->cb);
  1152. (*Print)("struct _WIniPort *pNext %p\n", pWIniPort->pNext);
  1153. movestr(pWIniPort->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1154. (*Print)("LPWSTR pName %ws\n", Buffer);
  1155. return TRUE;
  1156. }
  1157. BOOL
  1158. DbgDumpIniForm(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PINIFORM pIniForm)
  1159. {
  1160. WCHAR Buffer[MAX_PATH+1];
  1161. (*Print)("IniForm\n");
  1162. (*Print)("DWORD signature %d\n", pIniForm->signature);
  1163. (*Print)("struct _INIFORM *pNext %p\n", pIniForm->pNext);
  1164. (*Print)("DWORD cRef %d\n", pIniForm->cRef);
  1165. movestr(pIniForm->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1166. (*Print)("LPWSTR pName %p %ws\n", pIniForm->pName, Buffer );
  1167. (*Print)("SIZEL Size cx %d cy %d\n", pIniForm->Size.cx, pIniForm->Size.cy);
  1168. (*Print)("RECTL ImageableArea left %d right %d top %d bottom %d\n",
  1169. pIniForm->ImageableArea.left,
  1170. pIniForm->ImageableArea.right,
  1171. pIniForm->ImageableArea.top,
  1172. pIniForm->ImageableArea.bottom);
  1173. (*Print)("DWORD Type 0x%.8x", pIniForm->Type);
  1174. if ( pIniForm->Type & FORM_BUILTIN )
  1175. (*Print)(" FORM_BUILTIN\n");
  1176. else
  1177. (*Print)(" FORM_USERDEFINED\n");
  1178. (*Print)("DWORD cFormOrder %d\n", pIniForm->cFormOrder);
  1179. return TRUE;
  1180. }
  1181. BOOL
  1182. DbgDumpIniSpooler(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PINISPOOLER pIniSpooler)
  1183. {
  1184. WCHAR Buffer[MAX_PATH+1];
  1185. (*Print)("IniSpooler\n" );
  1186. (*Print)("DWORD signature %d\n", pIniSpooler->signature);
  1187. (*Print)("PINISPOOLER pIniNextSpooler %p\n", pIniSpooler->pIniNextSpooler);
  1188. (*Print)("DWORD cRef %d\n", pIniSpooler->cRef);
  1189. movestr(pIniSpooler->pMachineName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1190. (*Print)("LPWSTR pMachineName %ws\n", Buffer);
  1191. (*Print)("DWORD cOtherNames %d\n", pIniSpooler->cOtherNames);
  1192. (*Print)("(LPWSTR *) ppszOtherNames %p\n", pIniSpooler->ppszOtherNames);
  1193. movestr(pIniSpooler->pDir, Buffer, sizeof(WCHAR)*MAX_PATH);
  1194. (*Print)("LPWSTR pDir %ws\n", Buffer);
  1195. (*Print)("PINIPRINTER pIniPrinter %p\n", pIniSpooler->pIniPrinter);
  1196. (*Print)("PINIENVIRONMENT pIniEnvironment %p\n", pIniSpooler->pIniEnvironment);
  1197. (*Print)("PINIMONITOR pIniMonitor %p\n", pIniSpooler->pIniMonitor);
  1198. (*Print)("PINIPORT pIniPort %p\n", pIniSpooler->pIniPort);
  1199. (*Print)("PSHARED pShared %p\n", pIniSpooler->pShared);
  1200. (*Print)("PININETPRINT pIniNetPrint %p\n", pIniSpooler->pIniNetPrint);
  1201. (*Print)("PSPOOL pSpool %p\n", pIniSpooler->pSpool);
  1202. movestr(pIniSpooler->pDefaultSpoolDir, Buffer, sizeof(WCHAR)*MAX_PATH);
  1203. (*Print)("LPWSTR pDefaultSpoolDir %ws\n", Buffer);
  1204. movestr(pIniSpooler->pszRegistryMonitors, Buffer, sizeof(WCHAR)*MAX_PATH);
  1205. (*Print)("LPWSTR pszRegistryMonitors %ws\n", Buffer);
  1206. movestr(pIniSpooler->pszRegistryEnvironments, Buffer, sizeof(WCHAR)*MAX_PATH);
  1207. (*Print)("LPWSTR pszRegistryEnvironments %ws\n", Buffer);
  1208. movestr(pIniSpooler->pszRegistryEventLog, Buffer, sizeof(WCHAR)*MAX_PATH);
  1209. (*Print)("LPWSTR pszRegistryEventLog %ws\n", Buffer);
  1210. movestr(pIniSpooler->pszRegistryProviders, Buffer, sizeof(WCHAR)*MAX_PATH);
  1211. (*Print)("LPWSTR pszRegistryProviders %ws\n", Buffer);
  1212. movestr(pIniSpooler->pszEventLogMsgFile, Buffer, sizeof(WCHAR)*MAX_PATH);
  1213. (*Print)("LPWSTR pszEventLogMsgFile %ws\n", Buffer);
  1214. (*Print)("PSHARE_INFO_2 pDriversShareInfo %p\n", pIniSpooler->pDriversShareInfo);
  1215. movestr(pIniSpooler->pszDriversShare, Buffer, sizeof(WCHAR)*MAX_PATH);
  1216. (*Print)("LPWSTR pszDriversShare %ws\n", Buffer);
  1217. movestr(pIniSpooler->pszRegistryForms, Buffer, sizeof(WCHAR)*MAX_PATH);
  1218. (*Print)("LPWSTR pszRegistryForms %ws\n", Buffer);
  1219. (*Print)("DWORD SpoolerFlags %d\n", pIniSpooler->SpoolerFlags );
  1220. ExtractSpoolerFlags( Print, pIniSpooler->SpoolerFlags );
  1221. (*Print)("FARPROC pfnReadRegistryExtra 0x%.8x\n", pIniSpooler->pfnReadRegistryExtra );
  1222. (*Print)("FARPROC pfnWriteRegistryExtra 0x%.8x\n", pIniSpooler->pfnWriteRegistryExtra );
  1223. (*Print)("FARPROC pfnFreePrinterExtra 0x%.8x\n", pIniSpooler->pfnFreePrinterExtra );
  1224. (*Print)("DWORD cEnumerateNetworkPrinters %d\n", pIniSpooler->cEnumerateNetworkPrinters );
  1225. (*Print)("DWORD cAddNetPrinters %d\n", pIniSpooler->cAddNetPrinters );
  1226. (*Print)("DWORD cFormOrderMax %d\n", pIniSpooler->cFormOrderMax );
  1227. (*Print)("HKEY hckRoot %p\n", pIniSpooler->hckRoot );
  1228. (*Print)("HKEY hckPrinters %p\n", pIniSpooler->hckPrinters );
  1229. (*Print)("DWORD cFullPrintingJobs %d\n", pIniSpooler->cFullPrintingJobs );
  1230. (*Print)("DWORD hEventNoPrintingJobs %p\n", pIniSpooler->hEventNoPrintingJobs );
  1231. (*Print)("HKEY hJobIdMap %p\n", pIniSpooler->hJobIdMap );
  1232. (*Print)("DWORD dwEventLogging %d\n", pIniSpooler->dwEventLogging );
  1233. (*Print)("BOOL bEnableNetPopups %d\n", pIniSpooler->bEnableNetPopups );
  1234. (*Print)("DWORD dwJobCompletionTimeout %d\n", pIniSpooler->dwJobCompletionTimeout );
  1235. (*Print)("DWORD dwBeepEnabled %d\n", pIniSpooler->dwBeepEnabled );
  1236. (*Print)("HKEY bEnableNetPopupToComputer %d\n", pIniSpooler->bEnableNetPopupToComputer );
  1237. (*Print)("HKEY bEnableRetryPopups %d\n", pIniSpooler->bEnableRetryPopups );
  1238. movestr(pIniSpooler->pszClusterGUID, Buffer, sizeof(WCHAR)*MAX_PATH);
  1239. (*Print)("LPWSTR pszClusterGUID %ws\n", Buffer);
  1240. (*Print)("HKEY hClusterToken %p\n", pIniSpooler->hClusterToken );
  1241. (*Print)("DWORD dwRestartJobOnPoolTimeout %p\n", pIniSpooler->dwRestartJobOnPoolTimeout );
  1242. (*Print)("DWORD bRestartJobOnPoolEnabled %p\n", pIniSpooler->bRestartJobOnPoolEnabled );
  1243. (*Print)("DWORD bImmortal %p\n", pIniSpooler->bImmortal );
  1244. movestr(pIniSpooler->pszFullMachineName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1245. (*Print)("LPWSTR pszFullMachineName %ws\n", Buffer);
  1246. return TRUE;
  1247. }
  1248. BOOL
  1249. DbgDumpIniJob(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PINIJOB pIniJob)
  1250. {
  1251. WCHAR Buffer[MAX_PATH+1];
  1252. (*Print)("IniJob\n");
  1253. (*Print)("DWORD signature %d\n", pIniJob->signature);
  1254. (*Print)("PINIJOB pIniNextJob %p\n", pIniJob->pIniNextJob);
  1255. (*Print)("PINIJOB pIniPrevJob %p\n", pIniJob->pIniPrevJob);
  1256. (*Print)("DWORD cRef %d\n", pIniJob->cRef);
  1257. (*Print)("DWORD Status 0x%.8x\n", pIniJob->Status);
  1258. ExtractJobStatus( Print, pIniJob->Status );
  1259. (*Print)("DWORD JobId %d\n", pIniJob->JobId);
  1260. (*Print)("DWORD Priority %d\n", pIniJob->Priority);
  1261. movestr(pIniJob->pNotify, Buffer, sizeof(WCHAR)*MAX_PATH);
  1262. (*Print)("LPWSTR pNotify %ws\n", Buffer);
  1263. movestr(pIniJob->pUser, Buffer, sizeof(WCHAR)*MAX_PATH);
  1264. (*Print)("LPWSTR pUser %ws\n", Buffer);
  1265. movestr(pIniJob->pMachineName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1266. (*Print)("LPWSTR pMachineName %ws\n", Buffer);
  1267. movestr(pIniJob->pDocument, Buffer, sizeof(WCHAR)*MAX_PATH);
  1268. (*Print)("LPWSTR pDocument %ws\n", Buffer);
  1269. movestr(pIniJob->pOutputFile, Buffer, sizeof(WCHAR)*MAX_PATH);
  1270. (*Print)("LPWSTR pOutputFile %ws\n", Buffer);
  1271. (*Print)("PINIPRINTER pIniPrinter %p\n", pIniJob->pIniPrinter);
  1272. (*Print)("PINIDRIVER pIniDriver %p\n", pIniJob->pIniDriver);
  1273. (*Print)("LPDEVMODE pDevMode %p\n", pIniJob->pDevMode);
  1274. (*Print)("PINIPRINTPROC pIniPrintProc %p\n", pIniJob->pIniPrintProc);
  1275. movestr(pIniJob->pDatatype, Buffer, sizeof(WCHAR)*MAX_PATH);
  1276. (*Print)("LPWSTR pDatatype %ws\n", Buffer);
  1277. movestr(pIniJob->pParameters, Buffer, sizeof(WCHAR)*MAX_PATH);
  1278. (*Print)("LPWSTR pParameters %ws\n", Buffer);
  1279. (*Print)("SYSTEMTIME Submitted %d/%d/%d %d %d:%d:%d.%d\n",pIniJob->Submitted.wYear,
  1280. pIniJob->Submitted.wMonth,
  1281. pIniJob->Submitted.wDay,
  1282. pIniJob->Submitted.wDayOfWeek,
  1283. pIniJob->Submitted.wHour,
  1284. pIniJob->Submitted.wMinute,
  1285. pIniJob->Submitted.wSecond,
  1286. pIniJob->Submitted.wMilliseconds);
  1287. // (*Print)("DWORD StartPrintingTickCount %d\n", pIniJob->StartPrintingTickCount );
  1288. (*Print)("DWORD Time %d\n", pIniJob->Time);
  1289. (*Print)("DWORD StartTime %d\n", pIniJob->StartTime);
  1290. (*Print)("DWORD UntilTime %d\n", pIniJob->UntilTime);
  1291. (*Print)("DWORD Size %d\n", pIniJob->Size);
  1292. (*Print)("HANDLE hWriteFile 0x%.8x\n", pIniJob->hWriteFile);
  1293. movestr(pIniJob->pStatus, Buffer, sizeof(WCHAR)*MAX_PATH);
  1294. (*Print)("LPWSTR pStatus %ws\n", Buffer);
  1295. (*Print)("PBOOL pBuffer %p\n", pIniJob->pBuffer);
  1296. (*Print)("DWORD cbBuffer %d\n", pIniJob->cbBuffer);
  1297. (*Print)("HANDLE WaitForRead 0x%.8x\n", pIniJob->WaitForRead);
  1298. (*Print)("HANDLE WaitForWrite 0x%.8x\n", pIniJob->WaitForWrite);
  1299. (*Print)("HANDLE StartDocComplete 0x%.8x\n", pIniJob->StartDocComplete);
  1300. (*Print)("DWORD StartDocError 0x%.8x\n", pIniJob->StartDocError);
  1301. (*Print)("PINIPORT pIniPort %p\n", pIniJob->pIniPort);
  1302. (*Print)("HANDLE hToken 0x%.8x\n", pIniJob->hToken);
  1303. (*Print)("PSECURITY_DESCRIPTOR pSecurityDescriptor %p\n", pIniJob->pSecurityDescriptor);
  1304. (*Print)("DWORD cPagesPrinted %d\n", pIniJob->cPagesPrinted);
  1305. (*Print)("DWORD cPages %d\n", pIniJob->cPages);
  1306. (*Print)("DWORD dwJobNumberOfPagesPerSide %d\n", pIniJob->dwJobNumberOfPagesPerSide);
  1307. (*Print)("DWORD dwDrvNumberOfPagesPerSide %d\n", pIniJob->dwDrvNumberOfPagesPerSide);
  1308. (*Print)("DWORD cLogicalPagesPrinted %d\n", pIniJob->cLogicalPagesPrinted);
  1309. (*Print)("DWORD cLogicalPages %d\n", pIniJob->cLogicalPages);
  1310. (*Print)("BOOL GenerateOnClose 0x%.8x\n", pIniJob->GenerateOnClose);
  1311. (*Print)("DWORD cbPrinted %d\n", pIniJob->cbPrinted);
  1312. (*Print)("DWORD NextJobId %d\n", pIniJob->NextJobId);
  1313. (*Print)("PINIJOB pCurrentIniJob %p\n", pIniJob->pCurrentIniJob);
  1314. (*Print)("DWORD dwJobControlsPending %d\n", pIniJob->dwJobControlsPending);
  1315. (*Print)("DWORD dwReboots %d\n", pIniJob->dwReboots);
  1316. (*Print)("DWORD dwValidSize %d\n", pIniJob->dwValidSize);
  1317. (*Print)("DWORD bWaitForEnd %d\n", pIniJob->bWaitForEnd);
  1318. (*Print)("DWORD WaitForSeek %d\n", pIniJob->WaitForSeek);
  1319. (*Print)("DWORD bWaitForSeek %d\n", pIniJob->bWaitForSeek);
  1320. (*Print)("DWORD dwAlert %d\n", pIniJob->dwAlert);
  1321. movestr(pIniJob->pszSplFileName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1322. (*Print)("LPWSTR pszSplFileName %ws\n", Buffer);
  1323. (*Print)("HANDLE hFileItem 0x%.8x\n", pIniJob->hFileItem);
  1324. (*Print)("DWORD AddJobLevel %d\n", pIniJob->AddJobLevel);
  1325. return TRUE;
  1326. }
  1327. BOOL
  1328. DbgDumpProvidor(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, LPPROVIDOR pProvidor)
  1329. {
  1330. WCHAR Buffer[MAX_PATH+1];
  1331. movestr(pProvidor->lpName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1332. (*Print)("LPWSTR ProvidorName %ws\n", Buffer);
  1333. (*Print)("HANDLE hModule %p\n", pProvidor->hModule);
  1334. return TRUE;
  1335. }
  1336. BOOL
  1337. DbgDumpSpool(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PSPOOL pSpool)
  1338. {
  1339. WCHAR Buffer[MAX_PATH+1];
  1340. (*Print)("Spool - LocalSpl Handle\n");
  1341. (*Print)("DWORD signature %d\n", pSpool->signature);
  1342. (*Print)("struct _SPOOL *pNext %p\n", pSpool->pNext);
  1343. (*Print)("DWORD cRef %d\n", pSpool->cRef);
  1344. movestr(pSpool->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1345. (*Print)("LPWSTR pName %ws\n", Buffer);
  1346. movestr(pSpool->pFullMachineName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1347. (*Print)("LPWSTR pFullMachineName %ws\n", Buffer);
  1348. movestr(pSpool->pDatatype, Buffer, sizeof(WCHAR)*MAX_PATH);
  1349. (*Print)("LPWSTR pDatatype %ws\n", Buffer);
  1350. (*Print)("PINIPRINTPROC pIniPrintProc %p\n", pSpool->pIniPrintProc);
  1351. (*Print)("LPDEVMODE pDevMode %p\n", pSpool->pDevMode);
  1352. (*Print)("PINIPRINTER pIniPrinter %p\n", pSpool->pIniPrinter);
  1353. (*Print)("PINIPORT pIniPort %p\n", pSpool->pIniPort);
  1354. (*Print)("PINIJOB pIniJob %p\n", pSpool->pIniJob);
  1355. (*Print)("DWORD TypeofHandle %d\n", pSpool->TypeofHandle);
  1356. ExtractpSpoolTypeOfHandle( Print, pSpool->TypeofHandle);
  1357. (*Print)("PINIPORT pIniNetPort %p\n", pSpool->pIniNetPort);
  1358. (*Print)("HANDLE hPort %p\n", pSpool->hPort);
  1359. (*Print)("DWORD Status %d\n", pSpool->Status);
  1360. ExtractpSpoolStatus( Print, pSpool->Status);
  1361. (*Print)("ACCESS_MASK GrantedAccess %p\n", (DWORD)pSpool->GrantedAccess);
  1362. (*Print)("DWORD ChangeFlags %p\n", pSpool->ChangeFlags);
  1363. (*Print)("DWORD WaitFlags %x\n", pSpool->WaitFlags);
  1364. (*Print)("PDWORD pChangeFlags %p\n", pSpool->pChangeFlags);
  1365. (*Print)("HANDLE ChangeEvent %d\n", pSpool->ChangeEvent);
  1366. (*Print)("DWORD OpenPortError %x\n", pSpool->OpenPortError);
  1367. (*Print)("HANDLE hNotify %p\n", pSpool->hNotify);
  1368. (*Print)("ESTATUS eStatus %d\n", pSpool->eStatus);
  1369. (*Print)("pIniSpooler pIniSpooler %p\n", pSpool->pIniSpooler);
  1370. (*Print)("PINIXCV pIniXcv %p\n", pSpool->pIniXcv);
  1371. movestr(pSpool->SplClientInfo1.pUserName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1372. (*Print)("LPWSTR pUserName %ws\n", Buffer);
  1373. movestr(pSpool->SplClientInfo1.pMachineName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1374. (*Print)("LPWSTR pMachineName %ws\n", Buffer);
  1375. return TRUE;
  1376. }
  1377. BOOL
  1378. DbgDumpWSpool(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PWSPOOL pWSpool)
  1379. {
  1380. WCHAR Buffer[MAX_PATH+1];
  1381. (*Print)("WSpool - Win32Spl Handle\n");
  1382. (*Print)("DWORD signature %d\n", pWSpool->signature);
  1383. (*Print)("struct _WSPOOL *pNext %p\n", pWSpool->pNext);
  1384. (*Print)("struct _WSPOOL *pPrev %p\n", pWSpool->pPrev);
  1385. (*Print)("DWORD cRef %d\n", pWSpool->cRef);
  1386. Buffer[0] = L'\0';
  1387. movestr(pWSpool->pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1388. (*Print)("LPWSTR pName %ws\n", Buffer);
  1389. Buffer[0] = L'\0';
  1390. (*Print)("DWORD Type %d\n", pWSpool->Type);
  1391. if ( pWSpool->Type == SJ_WIN32HANDLE )
  1392. (*Print)(" SJ_WIN32HANDLE\n");
  1393. if ( pWSpool->Type == LM_HANDLE )
  1394. (*Print)(" LM_HANDLE\n");
  1395. (*Print)("HANDLE RpcHandle %p\n", pWSpool->RpcHandle);
  1396. movestr(pWSpool->pServer, Buffer, sizeof(WCHAR)*MAX_PATH);
  1397. (*Print)("LPWSTR pServer %ws\n", Buffer);
  1398. Buffer[0] = L'\0';
  1399. movestr(pWSpool->pShare, Buffer, sizeof(WCHAR)*MAX_PATH);
  1400. (*Print)("LPWSTR pShare %ws\n", Buffer);
  1401. Buffer[0] = L'\0';
  1402. (*Print)("HANDLE hFile %p\n", pWSpool->hFile);
  1403. (*Print)("DWORD Status %d\n", pWSpool->Status);
  1404. ExtractWSpoolStatus( Print, pWSpool->Status );
  1405. (*Print)("DWORD RpcError %d\n", pWSpool->RpcError);
  1406. (*Print)("LMNOTIFY LMNotify %p %p %p\n", pWSpool->LMNotify.ChangeEvent,
  1407. pWSpool->LMNotify.hNotify,
  1408. pWSpool->LMNotify.fdwChangeFlags );
  1409. (*Print)("HANDLE hIniSpooler %p\n", pWSpool->hIniSpooler );
  1410. (*Print)("HANDLE hSplPrinter %p\n", pWSpool->hSplPrinter );
  1411. (*Print)("HANDLE hToken %p\n", pWSpool->hToken );
  1412. movestr(pWSpool->PrinterDefaults.pDatatype, Buffer, sizeof(WCHAR)*MAX_PATH);
  1413. (*Print)("LPWSTR PrinterDefaults.pDatatype %ws\n", Buffer);
  1414. Buffer[0] = L'\0';
  1415. (*Print)("LPDEVMODE PrinterDefaults.pDevMode %p\n", pWSpool->PrinterDefaults.pDevMode);
  1416. (*Print)("ACCESS_MASK PrinterDefaults.DesiredAccess %x\n", pWSpool->PrinterDefaults.DesiredAccess);
  1417. ExtractPrinterAccess( Print, pWSpool->PrinterDefaults.DesiredAccess);
  1418. (*Print)("HANDLE hWaitValidHandle %p\n", pWSpool->hWaitValidHandle );
  1419. (*Print)("BOOL bNt3xServer %d\n", pWSpool->bNt3xServer);
  1420. return TRUE;
  1421. }
  1422. BOOL
  1423. DbgDumpShadowFile(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PSHADOWFILE pShadowFile)
  1424. {
  1425. WCHAR Buffer[MAX_PATH+1];
  1426. (*Print)("ShadowFile\n");
  1427. (*Print)("DWORD signature %d\n", pShadowFile->signature);
  1428. (*Print)("DWORD Status 0x%.8x\n", pShadowFile->Status);
  1429. (*Print)("DWORD JobId %d\n", pShadowFile->JobId);
  1430. (*Print)("DWORD Priority %d\n", pShadowFile->Priority);
  1431. movestr(pShadowFile->pNotify, Buffer, sizeof(WCHAR)*MAX_PATH);
  1432. (*Print)("LPWSTR pNotify %ws\n", Buffer);
  1433. movestr(pShadowFile->pUser, Buffer, sizeof(WCHAR)*MAX_PATH);
  1434. (*Print)("LPWSTR pUser %ws\n", Buffer);
  1435. movestr(pShadowFile->pDocument, Buffer, sizeof(WCHAR)*MAX_PATH);
  1436. (*Print)("LPWSTR pDocument %ws\n", Buffer);
  1437. movestr(pShadowFile->pPrinterName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1438. (*Print)("LPWSTR pPrinterName %ws\n", Buffer);
  1439. movestr(pShadowFile->pDriverName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1440. (*Print)("LPWSTR pDriverName %ws\n", Buffer);
  1441. (*Print)("LPDEVMODE pDevMode %p\n", pShadowFile->pDevMode);
  1442. movestr(pShadowFile->pPrintProcName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1443. (*Print)("LPWSTR pPrintProcName %ws\n", Buffer);
  1444. movestr(pShadowFile->pDatatype, Buffer, sizeof(WCHAR)*MAX_PATH);
  1445. (*Print)("LPWSTR pDatatype %ws\n", Buffer);
  1446. movestr(pShadowFile->pDatatype, Buffer, sizeof(WCHAR)*MAX_PATH);
  1447. (*Print)("LPWSTR pParameters %ws\n", Buffer);
  1448. //SYSTEMTIME Submitted;
  1449. (*Print)("DWORD StartTime %d\n", pShadowFile->StartTime);
  1450. (*Print)("DWORD UntilTime %d\n", pShadowFile->UntilTime);
  1451. (*Print)("DWORD Size %d\n", pShadowFile->Size);
  1452. (*Print)("DWORD cPages %d\n", pShadowFile->cPages);
  1453. (*Print)("DWORD cbSecurityDescriptor %d\n", pShadowFile->cbSecurityDescriptor);
  1454. (*Print)("PSECURITY_DESCRIPTOR pSecurityDescriptor %p\n", pShadowFile->pSecurityDescriptor);
  1455. return TRUE;
  1456. }
  1457. BOOL
  1458. DbgDumpShadowFile2(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PSHADOWFILE_2 pShadowFile)
  1459. {
  1460. WCHAR Buffer[MAX_PATH+1];
  1461. (*Print)("ShadowFile2\n");
  1462. (*Print)("DWORD signature %x\n", pShadowFile->signature);
  1463. (*Print)("DWORD Status 0x%.8x\n", pShadowFile->Status);
  1464. (*Print)("DWORD JobId %d\n", pShadowFile->JobId);
  1465. (*Print)("DWORD Priority %d\n", pShadowFile->Priority);
  1466. movestr(pShadowFile->pNotify, Buffer, sizeof(WCHAR)*MAX_PATH);
  1467. (*Print)("LPWSTR pNotify %ws\n", Buffer);
  1468. movestr(pShadowFile->pUser, Buffer, sizeof(WCHAR)*MAX_PATH);
  1469. (*Print)("LPWSTR pUser %ws\n", Buffer);
  1470. movestr(pShadowFile->pDocument, Buffer, sizeof(WCHAR)*MAX_PATH);
  1471. (*Print)("LPWSTR pDocument %ws\n", Buffer);
  1472. movestr(pShadowFile->pPrinterName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1473. (*Print)("LPWSTR pPrinterName %ws\n", Buffer);
  1474. movestr(pShadowFile->pDriverName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1475. (*Print)("LPWSTR pDriverName %ws\n", Buffer);
  1476. (*Print)("LPDEVMODE pDevMode %p\n", pShadowFile->pDevMode);
  1477. movestr(pShadowFile->pPrintProcName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1478. (*Print)("LPWSTR pPrintProcName %ws\n", Buffer);
  1479. movestr(pShadowFile->pDatatype, Buffer, sizeof(WCHAR)*MAX_PATH);
  1480. (*Print)("LPWSTR pDatatype %ws\n", Buffer);
  1481. movestr(pShadowFile->pDatatype, Buffer, sizeof(WCHAR)*MAX_PATH);
  1482. (*Print)("LPWSTR pParameters %ws\n", Buffer);
  1483. //SYSTEMTIME Submitted;
  1484. (*Print)("DWORD StartTime %d\n", pShadowFile->StartTime);
  1485. (*Print)("DWORD UntilTime %d\n", pShadowFile->UntilTime);
  1486. (*Print)("DWORD Size %d\n", pShadowFile->Size);
  1487. (*Print)("DWORD cPages %d\n", pShadowFile->cPages);
  1488. (*Print)("DWORD cbSecurityDescriptor %d\n", pShadowFile->cbSecurityDescriptor);
  1489. (*Print)("PSECURITY_DESCRIPTOR pSecurityDescriptor %p\n", pShadowFile->pSecurityDescriptor);
  1490. (*Print)("DWORD Version %d\n", pShadowFile->Version);
  1491. (*Print)("DWORD dwReboots %d\n", pShadowFile->dwReboots);
  1492. return TRUE;
  1493. }
  1494. BOOL
  1495. DbgDumpPrintHandle(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PPRINTHANDLE pPrintHandle)
  1496. {
  1497. NOTIFY Notify;
  1498. (*Print)("PrintHandle\n");
  1499. (*Print)("DWORD signature %d\n", pPrintHandle->signature);
  1500. (*Print)("LPPROVIDOR pProvidor %p\n", pPrintHandle->pProvidor);
  1501. (*Print)("HANDLE hPrinter 0x%.8x\n", pPrintHandle->hPrinter);
  1502. (*Print)("PCHANGE pChange %p\n", pPrintHandle->pChange);
  1503. if (pPrintHandle->pChange) {
  1504. DbgDumpChange(hCurrentProcess, Print, pPrintHandle->pChange);
  1505. }
  1506. (*Print)("PNOTIFY pNotify %p\n", pPrintHandle->pNotify);
  1507. if (pPrintHandle->pNotify) {
  1508. movestruct(pPrintHandle->pNotify, &Notify, NOTIFY);
  1509. DbgDumpNotify(hCurrentProcess, Print, &Notify);
  1510. }
  1511. (*Print)("PPRINTHANDLE pNext %p\n", pPrintHandle->pNext);
  1512. (*Print)("DWORD fdwReplyTypes 0x%.8x\n", pPrintHandle->fdwReplyTypes);
  1513. return TRUE;
  1514. }
  1515. BOOL
  1516. DbgDumpChange(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PCHANGE pChange)
  1517. {
  1518. WCHAR Buffer[MAX_PATH+1];
  1519. CHANGE Change;
  1520. // if we've got no address, then quit now - nothing we can do
  1521. if (!pChange) {
  1522. return(0);
  1523. }
  1524. movestruct(pChange, &Change, CHANGE);
  1525. if (Change.signature != CHANGEHANDLE_SIGNATURE) {
  1526. (*Print)("Warning: Unknown Signature\n");
  1527. return FALSE;
  1528. }
  1529. (*Print)("Change %p\n", pChange);
  1530. (*Print)(" Link %p\n", Change.Link.pNext);
  1531. (*Print)(" signature %d\n", Change.signature);
  1532. (*Print)(" eStatus 0x%x ", Change.eStatus);
  1533. ExtractChangeStatus(Print, Change.eStatus);
  1534. (*Print)(" dwColor %d\n", Change.dwColor);
  1535. (*Print)(" cRef %d\n", Change.cRef);
  1536. movestr(Change.pszLocalMachine, Buffer, sizeof(WCHAR)*MAX_PATH);
  1537. (*Print)(" pszLocalMachine %ws\n", Buffer);
  1538. DbgDumpChangeInfo(hCurrentProcess, Print, &Change.ChangeInfo);
  1539. (*Print)(" dwCount 0x%.8x\n", Change.dwCount);
  1540. (*Print)(" hEvent 0x%.8x\n", Change.hEvent);
  1541. (*Print)(" fdwChangeFlags 0x%.8x\n", Change.fdwChangeFlags);
  1542. (*Print)(" dwPrinterRemote 0x%.8x\n", Change.dwPrinterRemote);
  1543. (*Print)(" hNotifyRemote 0x%.8x\n", Change.hNotifyRemote);
  1544. return TRUE;
  1545. }
  1546. BOOL
  1547. DbgDumpNotify(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PNOTIFY pNotify)
  1548. {
  1549. (*Print)("Notify\n");
  1550. (*Print)(" signature %d\n", pNotify->signature);
  1551. (*Print)(" pPrintHandle %p\n", pNotify->pPrintHandle);
  1552. return TRUE;
  1553. }
  1554. BOOL
  1555. DbgDumpChangeInfo(HANDLE hCurrentProcess, PNTSD_OUTPUT_ROUTINE Print, PCHANGEINFO pChangeInfo)
  1556. {
  1557. (*Print)(" ChangeInfo %x\n", pChangeInfo);
  1558. (*Print)(" Link %p\n", pChangeInfo->Link.pNext);
  1559. (*Print)(" pPrintHandle %p\n", pChangeInfo->pPrintHandle);
  1560. (*Print)(" fdwOptions 0x%.8x\n", pChangeInfo->fdwOptions);
  1561. (*Print)(" fdwFilterFlags 0x%.8x\n", pChangeInfo->fdwFilterFlags);
  1562. (*Print)(" dwStatus 0x%.8x\n", pChangeInfo->fdwStatus);
  1563. (*Print)(" dwPollTime 0x%.8x\n", pChangeInfo->dwPollTime);
  1564. (*Print)(" dwPollTimeLeft 0x%.8x\n", pChangeInfo->dwPollTimeLeft);
  1565. (*Print)(" bResetPollTime 0x%.8x\n", pChangeInfo->bResetPollTime);
  1566. (*Print)(" fdwFlags 0x%.8x\n", pChangeInfo->fdwFlags);
  1567. (*Print)(" pPrinterNotifyInfo %p\n", pChangeInfo->pPrinterNotifyInfo);
  1568. return TRUE;
  1569. }
  1570. BOOL
  1571. DbgDumpLL(
  1572. HANDLE hCurrentProcess,
  1573. PNTSD_OUTPUT_ROUTINE Print,
  1574. UINT_PTR pAddress,
  1575. BOOL bCountOn,
  1576. DWORD dwCount,
  1577. PUINT_PTR pNextAddress
  1578. )
  1579. {
  1580. INIDRIVER IniDriver;
  1581. INIENVIRONMENT IniEnvironment;
  1582. INIPRINTER IniPrinter;
  1583. INIPRINTPROC IniPrintProc;
  1584. ININETPRINT IniNetPrint;
  1585. INIMONITOR IniMonitor;
  1586. INIPORT IniPort;
  1587. WINIPORT WIniPort;
  1588. INIFORM IniForm;
  1589. INIJOB IniJob;
  1590. INISPOOLER IniSpooler;
  1591. SPOOL Spool;
  1592. WSPOOL WSpool;
  1593. SHADOWFILE ShadowFile;
  1594. SHADOWFILE_2 ShadowFile2;
  1595. DWORD Signature;
  1596. UINT_PTR NextAddress;
  1597. PRINTHANDLE PrintHandle;
  1598. INIVERSION IniVersion;
  1599. WCACHEINIPRINTEREXTRA WCacheIniPrinterExtra;
  1600. BOOL bRetval = TRUE;
  1601. DWORD i;
  1602. if (!pAddress) {
  1603. *pNextAddress = 0;
  1604. return FALSE ;
  1605. }
  1606. if (bCountOn && (dwCount == 0)) {
  1607. *pNextAddress = (UINT_PTR)pAddress;
  1608. return FALSE ;
  1609. }
  1610. for (i=0; pAddress && (!bCountOn || i < dwCount); i++)
  1611. {
  1612. movestruct(pAddress,&Signature, DWORD);
  1613. (*Print)("\n%p ",pAddress);
  1614. switch (Signature) {
  1615. case ISP_SIGNATURE: // dump INISPOOLER
  1616. movestruct(pAddress, &IniSpooler, INISPOOLER);
  1617. DbgDumpIniSpooler(hCurrentProcess, Print, (PINISPOOLER)&IniSpooler);
  1618. NextAddress = (UINT_PTR)IniSpooler.pIniNextSpooler;
  1619. break;
  1620. case IPP_SIGNATURE: // dump INIPRINTPROC structure
  1621. movestruct(pAddress, &IniPrintProc, INIPRINTPROC);
  1622. DbgDumpIniPrintProc(hCurrentProcess, Print, (PINIPRINTPROC)&IniPrintProc);
  1623. NextAddress = (UINT_PTR)IniPrintProc.pNext;
  1624. break;
  1625. case ID_SIGNATURE: // dump INIDRIVER structure
  1626. movestruct(pAddress, &IniDriver, INIDRIVER);
  1627. DbgDumpIniDriver(hCurrentProcess, Print, (PINIDRIVER)&IniDriver);
  1628. NextAddress = (UINT_PTR)IniDriver.pNext;
  1629. break;
  1630. case IE_SIGNATURE: // dump INIENVIRONMENT structure
  1631. movestruct(pAddress, &IniEnvironment, INIENVIRONMENT);
  1632. DbgDumpIniEnvironment(hCurrentProcess, Print, (PINIENVIRONMENT)&IniEnvironment);
  1633. NextAddress = (UINT_PTR)IniEnvironment.pNext;
  1634. break;
  1635. case IV_SIGNATURE: // dump INIVERSION structure
  1636. movestruct(pAddress, &IniVersion, INIVERSION);
  1637. DbgDumpIniVersion(hCurrentProcess, Print, (PINIVERSION)&IniVersion);
  1638. NextAddress = (UINT_PTR)IniVersion.pNext;
  1639. break;
  1640. case IP_SIGNATURE:
  1641. movestruct(pAddress, &IniPrinter, INIPRINTER);
  1642. DbgDumpIniPrinter(hCurrentProcess, Print, (PINIPRINTER)&IniPrinter);
  1643. NextAddress = (UINT_PTR)IniPrinter.pNext;
  1644. break;
  1645. case WCIP_SIGNATURE:
  1646. movestruct(pAddress, &WCacheIniPrinterExtra, WCACHEINIPRINTEREXTRA);
  1647. DbgDumpWCacheIniPrinter(hCurrentProcess, Print, (PWCACHEINIPRINTEREXTRA)&WCacheIniPrinterExtra);
  1648. NextAddress = 0;
  1649. break;
  1650. case IN_SIGNATURE:
  1651. movestruct(pAddress, &IniNetPrint, ININETPRINT);
  1652. DbgDumpIniNetPrint(hCurrentProcess, Print, (PININETPRINT)&IniNetPrint);
  1653. NextAddress = (UINT_PTR)IniNetPrint.pNext;
  1654. break;
  1655. case IMO_SIGNATURE:
  1656. movestruct(pAddress, &IniMonitor, INIMONITOR);
  1657. DbgDumpIniMonitor(hCurrentProcess, Print, (PINIMONITOR)&IniMonitor);
  1658. NextAddress = (UINT_PTR)IniMonitor.pNext;
  1659. break;
  1660. case IPO_SIGNATURE:
  1661. movestruct(pAddress, &IniPort, INIPORT);
  1662. DbgDumpIniPort(hCurrentProcess, Print, (PINIPORT)&IniPort);
  1663. NextAddress = (UINT_PTR)IniPort.pNext;
  1664. break;
  1665. case WIPO_SIGNATURE:
  1666. movestruct(pAddress, &WIniPort, WINIPORT);
  1667. DbgDumpWIniPort(hCurrentProcess, Print, (PWINIPORT)&WIniPort);
  1668. NextAddress = (UINT_PTR)WIniPort.pNext;
  1669. break;
  1670. case IFO_SIGNATURE:
  1671. movestruct(pAddress, &IniForm, INIFORM);
  1672. DbgDumpIniForm(hCurrentProcess, Print, (PINIFORM)&IniForm);
  1673. NextAddress = (UINT_PTR)IniForm.pNext;
  1674. break;
  1675. case IJ_SIGNATURE:
  1676. movestruct(pAddress, &IniJob, INIJOB);
  1677. DbgDumpIniJob(hCurrentProcess, Print, (PINIJOB)&IniJob);
  1678. NextAddress = (UINT_PTR)IniJob.pIniNextJob;
  1679. break;
  1680. case SJ_SIGNATURE:
  1681. movestruct(pAddress, &Spool, SPOOL);
  1682. DbgDumpSpool(hCurrentProcess, Print, (PSPOOL)&Spool);
  1683. NextAddress = (UINT_PTR)Spool.pNext;
  1684. break;
  1685. case WSJ_SIGNATURE:
  1686. movestruct(pAddress, &WSpool, WSPOOL);
  1687. DbgDumpWSpool(hCurrentProcess, Print, (PWSPOOL)&WSpool);
  1688. NextAddress = (UINT_PTR)WSpool.pNext;
  1689. break;
  1690. case PRINTHANDLE_SIGNATURE:
  1691. movestruct(pAddress, &PrintHandle, PRINTHANDLE);
  1692. DbgDumpPrintHandle(hCurrentProcess, Print, (PPRINTHANDLE)&PrintHandle);
  1693. NextAddress = 0x00000000;
  1694. break;
  1695. case SF_SIGNATURE:
  1696. movestruct(pAddress, &ShadowFile, SHADOWFILE);
  1697. DbgDumpShadowFile(hCurrentProcess, Print, (PSHADOWFILE)&ShadowFile);
  1698. NextAddress = 0x00000000;
  1699. break;
  1700. case SF_SIGNATURE_2:
  1701. movestruct(pAddress, &ShadowFile2, SHADOWFILE_2);
  1702. DbgDumpShadowFile2(hCurrentProcess, Print, (PSHADOWFILE_2)&ShadowFile2);
  1703. NextAddress = 0x00000000;
  1704. break;
  1705. default:
  1706. // Unknown signature -- no data to dump
  1707. (*Print)("Warning: Unknown Signature\n");
  1708. NextAddress = 0x00000000;
  1709. bRetval = FALSE;
  1710. break;
  1711. }
  1712. pAddress = NextAddress;
  1713. *pNextAddress = NextAddress;
  1714. }
  1715. return bRetval ;
  1716. }
  1717. BOOL DumpDevMode(
  1718. HANDLE hCurrentProcess,
  1719. PNTSD_OUTPUT_ROUTINE Print,
  1720. UINT_PTR lpAddress
  1721. )
  1722. {
  1723. DEVMODEW DevMode;
  1724. DWORD i;
  1725. Print("DevMode\n");
  1726. if (!lpAddress) {
  1727. Print("\n Null DEVMODE Structure lpDevMode = NULL\n");
  1728. return TRUE ;
  1729. }
  1730. movestruct(lpAddress, &DevMode, DEVMODEW);
  1731. Print("TCHAR dmDeviceName[32] %ws\n", DevMode.dmDeviceName);
  1732. Print("WORD dmSpecVersion %d\n", DevMode.dmSpecVersion);
  1733. Print("WORD dmDriverVersion %d\n", DevMode.dmDriverVersion);
  1734. Print("WORD dmSize %d\n", DevMode.dmSize);
  1735. Print("WORD dmDriverExtra %d\n", DevMode.dmDriverExtra);
  1736. Print("DWORD dmFields %d\n", DevMode.dmFields);
  1737. for (i = 0; i < MAX_DEVMODE_FIELDS; i++ ) {
  1738. if (DevMode.dmFields & DevModeFieldsTable[i].dmField) {
  1739. Print("\t %s is ON\n", DevModeFieldsTable[i].String);
  1740. } else {
  1741. Print("\t %s is OFF\n", DevModeFieldsTable[i].String);
  1742. }
  1743. }
  1744. Print("short dmOrientation %d\n", DevMode.dmOrientation);
  1745. Print("short dmPaperSize %d\n", DevMode.dmPaperSize);
  1746. if ((DevMode.dmPaperSize >= 1) && (DevMode.dmPaperSize <= MAX_DEVMODE_PAPERSIZES)) {
  1747. Print("Paper size from dmPaperSize is %s\n", DevModePaperSizes[DevMode.dmPaperSize - 1]);
  1748. } else {
  1749. Print("Paper size from dmPaperSize is out of bounds!!\n");
  1750. }
  1751. Print("short dmPaperLength %d\n", DevMode.dmPaperLength);
  1752. Print("short dmPaperWidth %d\n", DevMode.dmPaperWidth);
  1753. Print("short dmScale %d\n", DevMode.dmScale);
  1754. Print("short dmCopies %d\n", DevMode.dmCopies);
  1755. Print("short dmDefaultSource %d\n", DevMode.dmDefaultSource);
  1756. Print("short dmPrintQuality %d\n", DevMode.dmPrintQuality);
  1757. Print("short dmColor %d\n", DevMode.dmColor);
  1758. Print("short dmDuplex %d\n", DevMode.dmDuplex);
  1759. Print("short dmYResolution %d\n", DevMode.dmYResolution);
  1760. Print("short dmTTOption %d\n", DevMode.dmTTOption);
  1761. Print("short dmCollate %d\n", DevMode.dmCollate);
  1762. Print("TCHAR dmFormName[32] %ws\n", DevMode.dmFormName);
  1763. Print("DWORD dmLogPixels %d\n", DevMode.dmLogPixels);
  1764. Print("USHORT dmBitsPerPel %d\n", DevMode.dmBitsPerPel);
  1765. Print("DWORD dmPelsWidth %d\n", DevMode.dmPelsWidth);
  1766. Print("DWORD dmPelsHeight %d\n", DevMode.dmPelsHeight);
  1767. Print("DWORD dmDisplayFlags %d\n", DevMode.dmDisplayFlags);
  1768. Print("DWORD dmDisplayFrequency %d\n", DevMode.dmDisplayFrequency);
  1769. return TRUE;
  1770. }
  1771. BOOL DbgDumpPI2(
  1772. HANDLE hCurrentProcess,
  1773. PNTSD_OUTPUT_ROUTINE Print,
  1774. UINT_PTR lpAddress,
  1775. DWORD dwCount
  1776. )
  1777. {
  1778. PRINTER_INFO_2 pi2;
  1779. WCHAR Buffer[MAX_PATH+1];
  1780. PPRINTER_INFO_2 pPrinterInfo;
  1781. for ( pPrinterInfo = (PPRINTER_INFO_2)lpAddress;
  1782. pPrinterInfo != NULL && dwCount != 0;
  1783. pPrinterInfo++, dwCount-- ) {
  1784. movestruct( pPrinterInfo, &pi2, PRINTER_INFO_2);
  1785. (*Print)("\nAddress %x\n", pPrinterInfo );
  1786. movestr(pi2.pServerName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1787. (*Print)("LPWSTR pServerName %ws\n", Buffer);
  1788. movestr(pi2.pPrinterName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1789. (*Print)("LPWSTR pPrinterName %ws\n", Buffer);
  1790. movestr(pi2.pShareName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1791. (*Print)("LPWSTR pShareName %ws\n", Buffer);
  1792. movestr(pi2.pPortName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1793. (*Print)("LPWSTR pPortName %ws\n", Buffer);
  1794. movestr(pi2.pDriverName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1795. (*Print)("LPWSTR pDriverName %ws\n", Buffer);
  1796. movestr(pi2.pComment, Buffer, sizeof(WCHAR)*MAX_PATH);
  1797. (*Print)("LPWSTR pComment %ws\n", Buffer);
  1798. movestr(pi2.pLocation, Buffer, sizeof(WCHAR)*MAX_PATH);
  1799. (*Print)("LPWSTR pLocation %ws\n", Buffer);
  1800. (*Print)("LPDEVMODE pDevMode %p\n", pi2.pDevMode);
  1801. movestr(pi2.pSepFile, Buffer, sizeof(WCHAR)*MAX_PATH);
  1802. (*Print)("LPWSTR pSepFile %ws\n", Buffer);
  1803. movestr(pi2.pPrintProcessor, Buffer, sizeof(WCHAR)*MAX_PATH);
  1804. (*Print)("LPWSTR pPrintProcessor %ws\n", Buffer);
  1805. movestr(pi2.pDatatype, Buffer, sizeof(WCHAR)*MAX_PATH);
  1806. (*Print)("LPWSTR pDatatype %ws\n", Buffer);
  1807. movestr(pi2.pParameters, Buffer, sizeof(WCHAR)*MAX_PATH);
  1808. (*Print)("LPWSTR pParameters %ws\n", Buffer);
  1809. (*Print)("PSECURITY_DESCRIPTOR pSecurityDescriptor %p\n", pi2.pSecurityDescriptor);
  1810. (*Print)("DWORD Attributes 0x%.8x\n",pi2.Attributes);
  1811. ExtractPrinterAttributes( Print, pi2.Attributes);
  1812. (*Print)("DWORD Priority %d\n", pi2.Priority);
  1813. (*Print)("DWORD DefaultPriority %d\n", pi2.DefaultPriority);
  1814. (*Print)("DWORD StartTime %d\n", pi2.StartTime);
  1815. (*Print)("DWORD UntilTime %d\n", pi2.UntilTime);
  1816. (*Print)("DWORD Status 0x%.8x\n", pi2.Status);
  1817. ExtractExternalPrinterStatus( Print, pi2.Status );
  1818. (*Print)("DWORD cJobs %d\n", pi2.cJobs);
  1819. (*Print)("DWORD AveragePPM %d\n", pi2.AveragePPM);
  1820. }
  1821. return TRUE;
  1822. }
  1823. BOOL DbgDumpPI0(
  1824. HANDLE hCurrentProcess,
  1825. PNTSD_OUTPUT_ROUTINE Print,
  1826. UINT_PTR lpAddress,
  1827. DWORD dwCount
  1828. )
  1829. {
  1830. PRINTER_INFO_STRESS pi0;
  1831. WCHAR Buffer[MAX_PATH+1];
  1832. PPRINTER_INFO_STRESS pPrinterInfo;
  1833. for ( pPrinterInfo = (PPRINTER_INFO_STRESS)lpAddress;
  1834. pPrinterInfo != NULL && dwCount != 0;
  1835. pPrinterInfo++, dwCount-- ) {
  1836. movestruct( pPrinterInfo, &pi0, PRINTER_INFO_STRESS);
  1837. (*Print)("\nAddress %x\n", pPrinterInfo );
  1838. movestr(pi0.pPrinterName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1839. (*Print)("LPWSTR pPrinterName %ws\n", Buffer);
  1840. movestr(pi0.pServerName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1841. (*Print)("LPWSTR pServerName %ws\n", Buffer);
  1842. (*Print)("DWORD cJobs %d\n", pi0.cJobs);
  1843. (*Print)("DWORD cTotalJobs %d\n", pi0.cTotalJobs);
  1844. (*Print)("DWORD cTotalBytes (LOWER DWORD) %d\n", pi0.cTotalBytes);
  1845. (*Print)("SYSTEMTIME stUpTime %d/%d/%d %d %d:%d:%d.%d\n",pi0.stUpTime.wYear,
  1846. pi0.stUpTime.wMonth,
  1847. pi0.stUpTime.wDay,
  1848. pi0.stUpTime.wDayOfWeek,
  1849. pi0.stUpTime.wHour,
  1850. pi0.stUpTime.wMinute,
  1851. pi0.stUpTime.wSecond,
  1852. pi0.stUpTime.wMilliseconds);
  1853. (*Print)("DWORD MaxcRef %d\n", pi0.MaxcRef);
  1854. (*Print)("DWORD cTotalPagesPrinted %d\n", pi0.cTotalPagesPrinted);
  1855. (*Print)("DWORD dwGetVersion %d\n", pi0.dwGetVersion);
  1856. (*Print)("DWORD fFreeBuild %d\n", pi0.fFreeBuild);
  1857. (*Print)("DWORD cSpooling %d\n", pi0.cSpooling);
  1858. (*Print)("DWORD cMaxSpooling %d\n", pi0.cMaxSpooling);
  1859. (*Print)("DWORD cRef %d\n", pi0.cRef);
  1860. (*Print)("DWORD cErrorOutOfPaper %d\n", pi0.cErrorOutOfPaper);
  1861. (*Print)("DWORD cErrorNotReady %d\n", pi0.cErrorNotReady);
  1862. (*Print)("DWORD cJobError %d\n", pi0.cJobError);
  1863. (*Print)("DWORD dwNumberOfProcessors %d\n", pi0.dwNumberOfProcessors);
  1864. (*Print)("DWORD dwProcessorType %d\n", pi0.dwProcessorType);
  1865. (*Print)("DWORD dwHighPartTotalBytes %d\n", pi0.dwHighPartTotalBytes);
  1866. (*Print)("DWORD cChangeID %d\n", pi0.cChangeID);
  1867. (*Print)("DWORD dwLastError %d\n", pi0.dwLastError);
  1868. (*Print)("DWORD Status 0x%.8x\n", pi0.Status);
  1869. ExtractExternalPrinterStatus( Print, pi0.Status );
  1870. (*Print)("DWORD cEnumerateNetworkPrinters %d\n", pi0.cEnumerateNetworkPrinters);
  1871. (*Print)("DWORD cAddNetPrinters %d\n", pi0.cAddNetPrinters);
  1872. (*Print)("WORD wProcessorArchitecture %d\n", pi0.wProcessorArchitecture);
  1873. (*Print)("WORD wProcessorLevel %d\n", pi0.wProcessorLevel);
  1874. }
  1875. return TRUE;
  1876. }
  1877. BOOL DbgDumpFI1(
  1878. HANDLE hCurrentProcess,
  1879. PNTSD_OUTPUT_ROUTINE Print,
  1880. UINT_PTR lpAddress,
  1881. DWORD dwCount
  1882. )
  1883. {
  1884. FORM_INFO_1 fi1;
  1885. WCHAR Buffer[MAX_PATH+1];
  1886. PFORM_INFO_1 pFORMInfo;
  1887. for ( pFORMInfo = (PFORM_INFO_1)lpAddress;
  1888. pFORMInfo != NULL && dwCount != 0;
  1889. pFORMInfo++, dwCount-- ) {
  1890. movestruct( pFORMInfo, &fi1, FORM_INFO_1);
  1891. (*Print)("\nAddress %p\n", pFORMInfo );
  1892. (*Print)("DWORD Flags %x", fi1.Flags);
  1893. if ( fi1.Flags & FORM_BUILTIN )
  1894. (*Print)(" FORM_BUILTIN\n");
  1895. else
  1896. (*Print)(" FORM_USERDEFINED\n");
  1897. movestr(fi1.pName, Buffer, sizeof(WCHAR)*MAX_PATH);
  1898. (*Print)("LPWSTR pName %ws\n", Buffer);
  1899. (*Print)("SIZEL Size cx %d cy %d\n", fi1.Size.cx, fi1.Size.cy);
  1900. (*Print)("RECTL ImageableArea left %d right %d top %d bottom %d\n",
  1901. fi1.ImageableArea.left,
  1902. fi1.ImageableArea.right,
  1903. fi1.ImageableArea.top,
  1904. fi1.ImageableArea.bottom);
  1905. }
  1906. return TRUE;
  1907. }
  1908. BOOL DbgDumpPDEF(
  1909. HANDLE hCurrentProcess,
  1910. PNTSD_OUTPUT_ROUTINE Print,
  1911. UINT_PTR lpAddress,
  1912. DWORD dwCount
  1913. )
  1914. {
  1915. PRINTER_DEFAULTS PDef;
  1916. WCHAR Buffer[MAX_PATH+1];
  1917. PPRINTER_DEFAULTS pPDef;
  1918. pPDef = ( PPRINTER_DEFAULTS )lpAddress;
  1919. movestruct( pPDef, &PDef, PRINTER_DEFAULTS);
  1920. (*Print)("\nAddress %x\n", pPDef );
  1921. Buffer[0] = L'\0';
  1922. movestr(PDef.pDatatype, Buffer, sizeof(WCHAR)*MAX_PATH);
  1923. (*Print)("LPWSTR PrinterDefaults.pDatatype %p %ws\n", PDef.pDatatype, Buffer);
  1924. (*Print)("LPDEVMODE PrinterDefaults.pDevMode %p\n", PDef.pDevMode);
  1925. (*Print)("ACCESS_MASK PrinterDefaults.DesiredAccess %p\n", PDef.DesiredAccess);
  1926. ExtractPrinterAccess( Print, PDef.DesiredAccess );
  1927. return TRUE;
  1928. }