Leaked source code of windows server 2003
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.

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