Windows NT 4.0 source code leak
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.

1006 lines
33 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. localspl.cxx
  6. Abstract:
  7. SUR localspl structures.
  8. Author:
  9. Albert Ting (AlbertT) 19-Feb-1995
  10. Revision History:
  11. --*/
  12. #include "precomp.hxx"
  13. #pragma hdrstop
  14. extern "C" {
  15. #include "spltypes.h"
  16. }
  17. /********************************************************************
  18. Localspl structures; mostly defined in localspl\spltypes.h
  19. ********************************************************************/
  20. BOOL
  21. TDebugExt::
  22. bDumpIniSpooler(
  23. PVOID pIniSpooler_,
  24. DWORD dwAddr
  25. )
  26. {
  27. static DEBUG_FLAGS adfSpl[] = {
  28. { "UpdateWinIniDevices", SPL_UPDATE_WININI_DEVICES },
  29. { "PrinterChanges", SPL_PRINTER_CHANGES },
  30. { "LogEvents", SPL_LOG_EVENTS },
  31. { "FormsChange", SPL_FORMS_CHANGE },
  32. { "BroadcastChange", SPL_BROADCAST_CHANGE },
  33. { "SecurityCheck", SPL_SECURITY_CHECK },
  34. { "OpenCreatePorts", SPL_OPEN_CREATE_PORTS },
  35. { NULL, 0 }
  36. };
  37. PINISPOOLER pIniSpooler = (PINISPOOLER)pIniSpooler_;
  38. if( !( pIniSpooler->signature == ISP_SIGNATURE )){
  39. return FALSE;
  40. }
  41. Print( "IniSpooler*\n" );
  42. Print( " pIniNextSpooler %x\n", pIniSpooler->pIniNextSpooler );
  43. Print( " cRef <%d>\n", pIniSpooler->cRef );
  44. Print( " pMachineName " ); vDumpStr( pIniSpooler->pMachineName );
  45. Print( " pDir " ); vDumpStr( pIniSpooler->pDir );
  46. Print( " pIniPrinter %x\n", pIniSpooler->pIniPrinter );
  47. Print( " pIniEnvironment %x\n", pIniSpooler->pIniEnvironment );
  48. Print( " pIniPort %x\n", pIniSpooler->pIniPort );
  49. Print( " pIniForm %x\n", pIniSpooler->pIniForm );
  50. Print( " pIniMonitor %x\n", pIniSpooler->pIniForm );
  51. Print( " pIniNetPrint %x\n", pIniSpooler->pIniNetPrint );
  52. Print( " pSpool %x\n", pIniSpooler->pSpool );
  53. Print( " pDefaultSpoolDir " ); vDumpStr( pIniSpooler->pDefaultSpoolDir );
  54. Print( " hSizeDetectionThread %x\n", pIniSpooler->hSizeDetectionThread );
  55. Print( " pszRegistryRoot " ); vDumpStr( pIniSpooler->pszRegistryRoot );
  56. Print( " pszRegistryPrinters " ); vDumpStr( pIniSpooler->pszRegistryPrinters );
  57. Print( " pszRegistryMonitors " ); vDumpStr( pIniSpooler->pszRegistryMonitors );
  58. Print( "pszRegistryEnvironments " ); vDumpStr( pIniSpooler->pszRegistryEnvironments );
  59. Print( " pszRegistryEventLog " ); vDumpStr( pIniSpooler->pszRegistryEventLog );
  60. Print( " pszRegistryProviders " ); vDumpStr( pIniSpooler->pszRegistryProviders );
  61. Print( " pszEventLogMsgFile " ); vDumpStr( pIniSpooler->pszEventLogMsgFile );
  62. Print( " pDriversShareInfo %x\n", pIniSpooler->pDriversShareInfo );
  63. Print( " pszDriversShare " ); vDumpStr( pIniSpooler->pszDriversShare );
  64. Print( " pszRegistryForms " ); vDumpStr( pIniSpooler->pszRegistryForms );
  65. Print( " SpoolerFlags " );
  66. vDumpFlags( pIniSpooler->SpoolerFlags, adfSpl );
  67. Print( " pfnReadRegistryExtra %x\n", pIniSpooler->pfnReadRegistryExtra );
  68. Print( " pfnWriteRegistryExtra %x\n", pIniSpooler->pfnWriteRegistryExtra );
  69. Print( " pfnFreePrinterExtra %x\n", pIniSpooler->pfnFreePrinterExtra );
  70. Print( " cEnumNetworkPrinters <%d>\n", pIniSpooler->cEnumerateNetworkPrinters );
  71. Print( " cAddNetPrinters <%d>\n", pIniSpooler->cAddNetPrinters );
  72. Print( " cFormOrderMax <%d>\n", pIniSpooler->cFormOrderMax );
  73. return TRUE;
  74. }
  75. BOOL
  76. TDebugExt::
  77. bDumpIniPrintProc(
  78. PVOID pIniPrintProc_,
  79. DWORD dwAddr
  80. )
  81. {
  82. PINIPRINTPROC pIniPrintProc = (PINIPRINTPROC)pIniPrintProc_;
  83. static DEBUG_FLAGS adfSpl[] = {
  84. { "UpdateWinIniDevices", SPL_UPDATE_WININI_DEVICES },
  85. { NULL, 0 }
  86. };
  87. if( !( pIniPrintProc->signature == IPP_SIGNATURE )){
  88. return FALSE;
  89. }
  90. Print( "IniPrintProc*\n" );
  91. Print( " pNext %x\n", pIniPrintProc->pNext );
  92. Print( " cRef <%d>\n", pIniPrintProc->cRef );
  93. Print( " pName " ); vDumpStr( pIniPrintProc->pName );
  94. Print( " pDLLName " ); vDumpStr( pIniPrintProc->pDLLName );
  95. Print( " cbDatatypes %x\n", pIniPrintProc->cbDatatypes );
  96. Print( " cDatatypes %x\n", pIniPrintProc->cDatatypes );
  97. Print( " pDatatypes %x\n", pIniPrintProc->pDatatypes );
  98. Print( " hLibrary %x\n", pIniPrintProc->hLibrary );
  99. Print( " Install %x\n", pIniPrintProc->Install );
  100. Print( " EnumDatatypes %x\n", pIniPrintProc->EnumDatatypes );
  101. Print( " Open %x\n", pIniPrintProc->Open );
  102. Print( " Print %x\n", pIniPrintProc->Print );
  103. Print( " Close %x\n", pIniPrintProc->Close );
  104. Print( " Control %x\n", pIniPrintProc->Control );
  105. Print( " CriticalSection @ %x\n", dwAddr
  106. + OFFSETOF( INIPRINTPROC, CriticalSection ));
  107. Print( "InCriticalSection %x\n", pIniPrintProc->InCriticalSection );
  108. return TRUE;
  109. }
  110. BOOL
  111. TDebugExt::
  112. bDumpIniDriver(
  113. PVOID pIniDriver_,
  114. DWORD dwAddr
  115. )
  116. {
  117. PINIDRIVER pIniDriver = (PINIDRIVER)pIniDriver_;
  118. static DEBUG_FLAGS adfSpl[] = {
  119. { "UpdateWinIniDevices", SPL_UPDATE_WININI_DEVICES },
  120. { NULL, 0 }
  121. };
  122. if( !( pIniDriver->signature == ID_SIGNATURE )){
  123. return FALSE;
  124. }
  125. Print( "IniDriver*\n" );
  126. Print( " pNext %x\n", pIniDriver->pNext );
  127. Print( " cRef <%d>\n", pIniDriver->cRef );
  128. Print( " pName " ); vDumpStr( pIniDriver->pName );
  129. Print( " pDriverFile " ); vDumpStr( pIniDriver->pDriverFile );
  130. Print( " pConfigFile " ); vDumpStr( pIniDriver->pConfigFile );
  131. Print( " pDataFile " ); vDumpStr( pIniDriver->pDataFile );
  132. Print( " pHelpFile " ); vDumpStr( pIniDriver->pHelpFile );
  133. Print( " cchDependentFiles %x\n", pIniDriver->cchDependentFiles );
  134. Print( " pDependentFiles %x\n", pIniDriver->pDependentFiles );
  135. Print( " pMonitorName " ); vDumpStr( pIniDriver->pMonitorName );
  136. Print( " pDefaultDataType " ); vDumpStr( pIniDriver->pDefaultDataType );
  137. Print( " cVersion %x\n", pIniDriver->cVersion );
  138. Print( " pIniLangMonitor %x\n", pIniDriver->pIniLangMonitor );
  139. return TRUE;
  140. }
  141. BOOL
  142. TDebugExt::
  143. bDumpIniVersion(
  144. PVOID pIniVersion_,
  145. DWORD dwAddr
  146. )
  147. {
  148. PINIVERSION pIniVersion = (PINIVERSION)pIniVersion_;
  149. if( !( pIniVersion->signature == IV_SIGNATURE )){
  150. return FALSE;
  151. }
  152. Print( "IniVersion*\n" );
  153. Print( " pNext %x\n", pIniVersion->pNext );
  154. Print( " pName " ); vDumpStr( pIniVersion->pName );
  155. Print( " szDirectory " ); vDumpStr( pIniVersion->szDirectory );
  156. Print( " cMajorVersion %x\n", pIniVersion->cMajorVersion );
  157. Print( " cMinorVersion %x\n", pIniVersion->cMinorVersion );
  158. Print( " pIniDriver %x\n", pIniVersion->pIniDriver );
  159. return TRUE;
  160. }
  161. BOOL
  162. TDebugExt::
  163. bDumpIniEnvironment(
  164. PVOID pIniEnvironment_,
  165. DWORD dwAddr
  166. )
  167. {
  168. PINIENVIRONMENT pIniEnvironment = (PINIENVIRONMENT)pIniEnvironment_;
  169. if( !( pIniEnvironment->signature == IE_SIGNATURE )){
  170. return FALSE;
  171. }
  172. Print( "IniEnvironment*\n" );
  173. Print( " pNext %x\n", pIniEnvironment->pNext );
  174. Print( " cRef <%d>\n", pIniEnvironment->cRef );
  175. Print( " pName " ); vDumpStr( pIniEnvironment->pName );
  176. Print( " pDirectory " ); vDumpStr( pIniEnvironment->pDirectory );
  177. Print( " pIniVersion %x\n", pIniEnvironment->pIniVersion );
  178. Print( " pIniPrintProc %x\n", pIniEnvironment->pIniPrintProc );
  179. Print( " pIniSpooler %x\n", pIniEnvironment->pIniSpooler );
  180. return TRUE;
  181. }
  182. BOOL
  183. TDebugExt::
  184. bDumpIniMonitor(
  185. PVOID pIniMonitor_,
  186. DWORD dwAddr
  187. )
  188. {
  189. PINIMONITOR pIniMonitor = (PINIMONITOR)pIniMonitor_;
  190. if( !( pIniMonitor->signature == IMO_SIGNATURE )){
  191. return FALSE;
  192. }
  193. Print( "IniMonitor*\n" );
  194. Print( " pNext %x\n", pIniMonitor->pNext );
  195. Print( " cRef <%d>\n", pIniMonitor->cRef );
  196. Print( " pName " ); vDumpStr( pIniMonitor->pName );
  197. Print( " pMonitorDll " ); vDumpStr( pIniMonitor->pMonitorDll );
  198. Print( "hMonitorModule %x\n", pIniMonitor->hMonitorModule );
  199. Print( " dwMonitorSize %x\n", pIniMonitor->dwMonitorSize );
  200. Print( " fn @ %x\n", dwAddr + OFFSETOF( INIMONITOR, fn ));
  201. Print( " pIniSpooler %x\n", pIniMonitor->pIniSpooler );
  202. return TRUE;
  203. }
  204. BOOL
  205. TDebugExt::
  206. bDumpIniPort(
  207. PVOID pIniPort_,
  208. DWORD dwAddr
  209. )
  210. {
  211. PINIPORT pIniPort = (PINIPORT)pIniPort_;
  212. if( !( pIniPort->signature == IPO_SIGNATURE )){
  213. return FALSE;
  214. }
  215. Print( "IniPort*\n" );
  216. Print( " pNext %x\n", pIniPort->pNext );
  217. Print( " cRef <%d>\n", pIniPort->cRef );
  218. Print( " pName " ); vDumpStr( pIniPort->pName );
  219. Print( " hProc %x\n", pIniPort->hProc );
  220. Print( " Status %x\n", pIniPort->Status );
  221. Print( " PrinterStatus %x\n", pIniPort->PrinterStatus );
  222. Print( " pszStatus " ); vDumpStr( pIniPort->pszStatus );
  223. Print( " Semaphore %x\n", pIniPort->Semaphore );
  224. Print( " pIniJob %x\n", pIniPort->pIniJob );
  225. Print( " cPrinters <%d>\n", pIniPort->cPrinters );
  226. Print( " ppIniPrinter %x\n", pIniPort->ppIniPrinter );
  227. Print( " pIniMonitor %x\n", pIniPort->pIniMonitor );
  228. Print( " pIniLangMonitor %x\n", pIniPort->pIniLangMonitor );
  229. Print( " pNewDeviceName " ); vDumpStr( pIniPort->pNewDeviceName );
  230. Print( " hEvent %x\n", pIniPort->hEvent );
  231. Print( " hPort %x\n", pIniPort->hPort );
  232. Print( " Ready %x\n", pIniPort->Ready );
  233. Print( " hPortThread %x\n", pIniPort->hPortThread );
  234. Print( " pIniSpooler %x\n", pIniPort->pIniSpooler );
  235. return TRUE;
  236. }
  237. BOOL
  238. TDebugExt::
  239. bDumpIniJob(
  240. PVOID pIniJob_,
  241. DWORD dwAddr
  242. )
  243. {
  244. PINIJOB pIniJob = (PINIJOB)pIniJob_;
  245. if( !( pIniJob->signature == IJ_SIGNATURE )){
  246. return FALSE;
  247. }
  248. Print( "IniJob*\n" );
  249. Print( " pIniNextJob %x\n", pIniJob->pIniNextJob );
  250. Print( " pIniPrevJob %x\n", pIniJob->pIniPrevJob );
  251. Print( " cRef <%d>\n", pIniJob->cRef );
  252. Print( " Status %x\n", pIniJob->Status );
  253. Print( " JobId <%d>\n", pIniJob->JobId );
  254. Print( " Priority <%d>\n", pIniJob->Priority );
  255. Print( " pNotify " ); vDumpStr( pIniJob->pNotify );
  256. Print( " pUser " ); vDumpStr( pIniJob->pUser );
  257. Print( " pMachineName " ); vDumpStr( pIniJob->pMachineName );
  258. Print( " pDocument " ); vDumpStr( pIniJob->pDocument );
  259. Print( " pOutputFile " ); vDumpStr( pIniJob->pOutputFile );
  260. Print( " pIniPrinter %x\n", pIniJob->pIniPrinter );
  261. Print( " pIniDriver %x\n", pIniJob->pIniDriver );
  262. Print( " pDevMode %x\n", pIniJob->pDevMode );
  263. Print( " pIniPrintProc %x\n", pIniJob->pIniPrintProc );
  264. Print( " pDatatype " ); vDumpStr( pIniJob->pDatatype );
  265. Print( " pParameters " ); vDumpStr( pIniJob->pParameters );
  266. Print( " Submitted @ %x\n", dwAddr + OFFSETOF( INIJOB, Submitted ));
  267. Print( " Time %x\n", pIniJob->Time );
  268. Print( " StartTime %x\n", pIniJob->StartTime );
  269. Print( " UntilTime %x\n", pIniJob->UntilTime );
  270. Print( " Size %x\n", pIniJob->Size );
  271. Print( " hWriteFile %x\n", pIniJob->hWriteFile );
  272. Print( " pStatus " ); vDumpStr( pIniJob->pStatus );
  273. Print( " pBuffer %x\n", pIniJob->pBuffer );
  274. Print( " cbBuffer %x\n", pIniJob->cbBuffer );
  275. Print( " WaitForRead %x\n", pIniJob->WaitForRead );
  276. Print( " WaitForWrite %x\n", pIniJob->WaitForWrite );
  277. Print( "StartDocComplete %x\n", pIniJob->StartDocComplete );
  278. Print( " StartDocError %x\n", pIniJob->StartDocError );
  279. Print( " pIniPort %x\n", pIniJob->pIniPort );
  280. Print( " hToken %x\n", pIniJob->hToken );
  281. Print( " pSD %x\n", pIniJob->pSecurityDescriptor );
  282. Print( " cPagesPrinted %x\n", pIniJob->cPagesPrinted );
  283. Print( " cPages %x\n", pIniJob->cPages );
  284. Print( " GenerateOnClose %x\n", pIniJob->GenerateOnClose );
  285. Print( " cbPrinted %x\n", pIniJob->cbPrinted );
  286. Print( " NextJobId %x\n", pIniJob->NextJobId );
  287. Print( " pCurrentIniJob %x\n", pIniJob->pCurrentIniJob );
  288. return TRUE;
  289. }
  290. BOOL
  291. TDebugExt::
  292. bDumpSpool(
  293. PVOID pSpool_,
  294. DWORD dwAddr
  295. )
  296. {
  297. PSPOOL pSpool = (PSPOOL)pSpool_;
  298. if( !( pSpool->signature == SJ_SIGNATURE )){
  299. return FALSE;
  300. }
  301. Print( "Spool*\n" );
  302. Print( " pNext %x\n", pSpool->pNext );
  303. Print( " cRef <%d>\n", pSpool->cRef );
  304. Print( " pName " ); vDumpStr( pSpool->pName );
  305. Print( " pDatatpe " ); vDumpStr( pSpool->pDatatype );
  306. Print( " pIniPrintProc %x\n", pSpool->pIniPrintProc );
  307. Print( " pDevMode %x\n", pSpool->pDevMode );
  308. Print( " pIniPrinter %x\n", pSpool->pIniPrinter );
  309. Print( " pIniPort %x\n", pSpool->pIniPort );
  310. Print( " pIniJob %x\n", pSpool->pIniJob );
  311. Print( " TypeofHandle %x\n", pSpool->TypeofHandle );
  312. Print( " pIniNetPort %x\n", pSpool->pIniNetPort );
  313. Print( " hPort %x\n", pSpool->hPort );
  314. Print( " Status %x\n", pSpool->Status );
  315. Print( " GrantedAccess %x\n", pSpool->GrantedAccess );
  316. Print( " ChangeFlags %x\n", pSpool->ChangeFlags );
  317. Print( " WaitFlags %x\n", pSpool->WaitFlags );
  318. Print( " pChangeFlags %x\n", pSpool->pChangeFlags );
  319. Print( " ChangeEvent %x\n", pSpool->ChangeEvent );
  320. Print( " OpenPortError %x\n", pSpool->OpenPortError );
  321. Print( " hNotify %x\n", pSpool->hNotify );
  322. Print( " eStatus %x\n", pSpool->eStatus );
  323. Print( " pIniSpooler %x\n", pSpool->pIniSpooler );
  324. Print( " GenerateOnClose %x\n", pSpool->GenerateOnClose );
  325. Print( " hFile %x\n", pSpool->hFile );
  326. Print( "adwNotifyVectors @ %x\n", dwAddr
  327. + OFFSETOF( SPOOL, adwNotifyVectors ));
  328. Print( " pUserName " ); vDumpStr( pSpool->pUserName );
  329. Print( " pMachineName " ); vDumpStr( pSpool->pMachineName );
  330. return TRUE;
  331. }
  332. BOOL
  333. TDebugExt::
  334. bDumpIniPrinter(
  335. PVOID pIniPrinter_,
  336. DWORD dwAddr
  337. )
  338. {
  339. PINIPRINTER pIniPrinter = (PINIPRINTER)pIniPrinter_;
  340. static DEBUG_FLAGS adfStatus[] = {
  341. { "Paused", PRINTER_PAUSED },
  342. { "Error", PRINTER_ERROR },
  343. { "Offline", PRINTER_OFFLINE },
  344. { "PaperOut", PRINTER_PAPEROUT },
  345. { "PendingDeletion", PRINTER_PENDING_DELETION },
  346. { "ZombieObject", PRINTER_ZOMBIE_OBJECT },
  347. { "PendingCreation", PRINTER_PENDING_CREATION },
  348. { "Ok", PRINTER_OK },
  349. { "FromReg", PRINTER_FROM_REG },
  350. { "WasShared", PRINTER_WAS_SHARED },
  351. { NULL, 0 }
  352. };
  353. static DEBUG_FLAGS adfAttributes[] = {
  354. { "Queued", PRINTER_ATTRIBUTE_QUEUED },
  355. { "Direct", PRINTER_ATTRIBUTE_DIRECT },
  356. { "Default", PRINTER_ATTRIBUTE_DEFAULT },
  357. { "Shared", PRINTER_ATTRIBUTE_SHARED },
  358. { "Network", PRINTER_ATTRIBUTE_NETWORK },
  359. { "Hidden", PRINTER_ATTRIBUTE_HIDDEN },
  360. { "Local", PRINTER_ATTRIBUTE_LOCAL },
  361. { "DevQ", PRINTER_ATTRIBUTE_ENABLE_DEVQ },
  362. { "KeepPrintedJobs", PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS },
  363. { "DoCompletedFirst", PRINTER_ATTRIBUTE_DO_COMPLETE_FIRST },
  364. { "WorkOffline", PRINTER_ATTRIBUTE_WORK_OFFLINE },
  365. { "EnableBidi", PRINTER_ATTRIBUTE_ENABLE_BIDI },
  366. { NULL, 0 }
  367. };
  368. if( !( pIniPrinter->signature == IP_SIGNATURE )){
  369. return FALSE;
  370. }
  371. Print( "IniPrinter*\n" );
  372. Print( " pNext %x\n", pIniPrinter->pNext );
  373. Print( " cRef %x\n", pIniPrinter->cRef );
  374. Print( " pName " ); vDumpStr( pIniPrinter->pName );
  375. Print( " pShareName " ); vDumpStr( pIniPrinter->pShareName );
  376. Print( " pIniPrintProc %x\n", pIniPrinter->pIniPrintProc );
  377. Print( " pDatatype " ); vDumpStr( pIniPrinter->pDatatype );
  378. Print( " pParameters " ); vDumpStr( pIniPrinter->pParameters );
  379. Print( " pComment " ); vDumpStr( pIniPrinter->pComment );
  380. Print( " pIniDriver %x\n", pIniPrinter->pIniDriver );
  381. Print( " cbDevMode %x\n", pIniPrinter->cbDevMode );
  382. Print( " pDevMode %x\n", pIniPrinter->pDevMode );
  383. Print( " Priority <%d>\n", pIniPrinter->Priority );
  384. Print( " DefaultPriority <%d>\n", pIniPrinter->DefaultPriority );
  385. Print( " StartTime %x\n", pIniPrinter->StartTime );
  386. Print( " UntilTime %x\n", pIniPrinter->UntilTime );
  387. Print( " pSepFile " ); vDumpStr( pIniPrinter->pSepFile );
  388. Print( " Status " );
  389. vDumpFlags( pIniPrinter->Status, adfStatus );
  390. Print( " pLocation " ); vDumpStr( pIniPrinter->pLocation );
  391. Print( " Attributes " );
  392. vDumpFlags( pIniPrinter->Attributes, adfAttributes );
  393. Print( " cJobs <%d>\n", pIniPrinter->cJobs );
  394. Print( " AveragePPM %x\n", pIniPrinter->AveragePPM );
  395. Print( " GenerateOnClose %x\n", pIniPrinter->GenerateOnClose );
  396. Print( " pIniNetPort %x\n", pIniPrinter->pIniNetPort );
  397. Print( " ==== pIniFirstJob %x\n", pIniPrinter->pIniFirstJob );
  398. Print( " pIniLastJob %x\n", pIniPrinter->pIniLastJob );
  399. Print( " pSecurityDescriptor %x\n", pIniPrinter->pSecurityDescriptor );
  400. Print( " pSpool %x\n", pIniPrinter->pSpool );
  401. Print( " pSpoolDir " ); vDumpStr( pIniPrinter->pSpoolDir );
  402. Print( " cTotalJobs %x\n", pIniPrinter->cTotalJobs );
  403. Print( " cTotalBytes %x\n", pIniPrinter->cTotalBytes );
  404. Print( " stUpTime " ); vDumpTime( pIniPrinter->stUpTime );
  405. Print( " MaxcRef %x\n", pIniPrinter->MaxcRef );
  406. Print( " cTotalPagesPrinted %x\n", pIniPrinter->cTotalPagesPrinted );
  407. Print( " cSpooling %x\n", pIniPrinter->cSpooling );
  408. Print( " cMaxSpooling %x\n", pIniPrinter->cMaxSpooling );
  409. Print( " cErrorOutOfPaper %x\n", pIniPrinter->cErrorOutOfPaper );
  410. Print( " cErrorNotReady %x\n", pIniPrinter->cErrorNotReady );
  411. Print( " cJobError %x\n", pIniPrinter->cJobError );
  412. Print( " pIniSpooler %x\n", pIniPrinter->pIniSpooler );
  413. Print( " cZombieRef %x\n", pIniPrinter->cZombieRef );
  414. Print( " dwLastError %x\n", pIniPrinter->dwLastError );
  415. Print( " pExtraData %x\n", pIniPrinter->pExtraData );
  416. Print( " cChangeID %x\n", pIniPrinter->cChangeID );
  417. Print( " hPrinterDataKey %x\n", pIniPrinter->hPrinterDataKey );
  418. Print( " dnsTimeout %x\n", pIniPrinter->dnsTimeout );
  419. Print( " txTimeout %x\n", pIniPrinter->txTimeout );
  420. return TRUE;
  421. }
  422. /********************************************************************
  423. Devmodes
  424. ********************************************************************/
  425. DEBUG_FLAGS gadfDevModeFields[] = {
  426. { "Orientation", DM_ORIENTATION },
  427. { "PaperSize", DM_PAPERSIZE },
  428. { "PaperLength", DM_PAPERLENGTH },
  429. { "PaperWidth", DM_PAPERWIDTH },
  430. { "Scale", DM_SCALE },
  431. { "Copies", DM_COPIES },
  432. { "DefaultSource", DM_DEFAULTSOURCE },
  433. { "PrintQuality", DM_PRINTQUALITY },
  434. { "Color", DM_COLOR },
  435. { "Duplex", DM_DUPLEX },
  436. { "YResolution", DM_YRESOLUTION },
  437. { "TTOption", DM_TTOPTION },
  438. { "Collate", DM_COLLATE },
  439. { "FormName", DM_FORMNAME },
  440. { "LogPixels", DM_LOGPIXELS },
  441. { "BitsPerPel", DM_BITSPERPEL },
  442. { "PelsWidth", DM_PELSWIDTH },
  443. { "PelsHeight", DM_PELSHEIGHT },
  444. { "DisplayFlags", DM_DISPLAYFLAGS },
  445. { "DisplayFrequency", DM_DISPLAYFREQUENCY },
  446. { "ICMMethod", DM_ICMMETHOD },
  447. { "ICMIntent", DM_ICMINTENT },
  448. { "MediaType", DM_MEDIATYPE },
  449. { "DitherType", DM_DITHERTYPE },
  450. { NULL, 0 }
  451. };
  452. DEBUG_VALUES gadvDevModeDefaultSource[] = {
  453. { "Upper/OnlyOne", DMBIN_UPPER },
  454. { "Lower", DMBIN_LOWER },
  455. { "Middle", DMBIN_MIDDLE },
  456. { "Manual", DMBIN_MANUAL },
  457. { "Envelope", DMBIN_ENVELOPE },
  458. { "EnvManual", DMBIN_ENVMANUAL },
  459. { "Auto", DMBIN_AUTO },
  460. { "Tractor", DMBIN_TRACTOR },
  461. { "SmallFmt", DMBIN_SMALLFMT },
  462. { "LargeFmt", DMBIN_LARGEFMT },
  463. { "LargeCapacity", DMBIN_LARGECAPACITY },
  464. { "Cassette", DMBIN_CASSETTE },
  465. { "FormSource", DMBIN_FORMSOURCE },
  466. { NULL, 0 }
  467. };
  468. DEBUG_VALUES gadvDevModePapers[] = {
  469. { "Letter", DMPAPER_LETTER },
  470. { "Legal", DMPAPER_LEGAL },
  471. { "A4", DMPAPER_A4 },
  472. { "CSheet", DMPAPER_CSHEET },
  473. { "DSheet", DMPAPER_DSHEET },
  474. { "ESheet", DMPAPER_ESHEET },
  475. { "LetterSmall", DMPAPER_LETTERSMALL },
  476. { "Tabloid", DMPAPER_TABLOID },
  477. { "Ledger", DMPAPER_LEDGER },
  478. { "Statement", DMPAPER_STATEMENT },
  479. { "Executive", DMPAPER_EXECUTIVE },
  480. { "A3", DMPAPER_A3 },
  481. { "A4Small", DMPAPER_A4SMALL },
  482. { "A5", DMPAPER_A5 },
  483. { "B4", DMPAPER_B4 },
  484. { "B5", DMPAPER_B5 },
  485. { "Folio", DMPAPER_FOLIO },
  486. { "Quarto", DMPAPER_QUARTO },
  487. { "10x14", DMPAPER_10X14 },
  488. { "11x17", DMPAPER_11X17 },
  489. { "Note", DMPAPER_NOTE },
  490. { "Env_9", DMPAPER_ENV_9 },
  491. { "Env_10", DMPAPER_ENV_10 },
  492. { "Env_11", DMPAPER_ENV_11 },
  493. { "Env_12", DMPAPER_ENV_12 },
  494. { "Env_14", DMPAPER_ENV_14 },
  495. { "Env_DL", DMPAPER_ENV_DL },
  496. { "Env_C5", DMPAPER_ENV_C6 },
  497. { "Env_C65", DMPAPER_ENV_C65 },
  498. { "Env_B4", DMPAPER_ENV_B4 },
  499. { "Env_B5", DMPAPER_ENV_B5 },
  500. { "Env_B6", DMPAPER_ENV_B6 },
  501. { "Env_Italy", DMPAPER_ENV_ITALY },
  502. { "Env_Monarch", DMPAPER_ENV_MONARCH },
  503. { "Env_Personal", DMPAPER_ENV_PERSONAL },
  504. { "Fanfold_US", DMPAPER_FANFOLD_US },
  505. { "Fanfold_Std_German", DMPAPER_FANFOLD_STD_GERMAN },
  506. { "Fanfold_Lgl_German", DMPAPER_FANFOLD_LGL_GERMAN },
  507. { NULL, 0 }
  508. };
  509. DEBUG_VALUES gadvDevModePrintQuality[] = {
  510. { "High", (DWORD)DMRES_HIGH },
  511. { "Medium", (DWORD)DMRES_MEDIUM },
  512. { "Low", (DWORD)DMRES_LOW },
  513. { "Draft", (DWORD)DMRES_DRAFT },
  514. { NULL, 0 }
  515. };
  516. DEBUG_VALUES gadvDevModeColor[] = {
  517. { "Color", DMCOLOR_COLOR },
  518. { "Monochrome", DMCOLOR_MONOCHROME },
  519. { NULL, 0 }
  520. };
  521. DEBUG_VALUES gadvDevModeDuplex[] = {
  522. { "Simplex", DMDUP_SIMPLEX },
  523. { "Horizontal", DMDUP_HORIZONTAL },
  524. { "Vertical", DMDUP_VERTICAL },
  525. { NULL, 0 }
  526. };
  527. DEBUG_VALUES gadvDevModeTTOption[] = {
  528. { "Bitmap", DMTT_BITMAP },
  529. { "DownLoad", DMTT_DOWNLOAD },
  530. { "SubDev", DMTT_SUBDEV },
  531. { NULL, 0 }
  532. };
  533. DEBUG_VALUES gadvDevModeCollate[] = {
  534. { "True", DMCOLLATE_TRUE },
  535. { "False", DMCOLLATE_FALSE },
  536. { NULL, 0 }
  537. };
  538. DEBUG_VALUES gadvDevModeICMMethod[] = {
  539. { "None", DMICMMETHOD_NONE },
  540. { "System", DMICMMETHOD_SYSTEM },
  541. { "Driver", DMICMMETHOD_DRIVER },
  542. { "Device", DMICMMETHOD_DEVICE },
  543. { NULL, 0 }
  544. };
  545. DEBUG_VALUES gadvDevModeICMIntent[] = {
  546. { "Saturate", DMICM_SATURATE },
  547. { "Contrast", DMICM_CONTRAST },
  548. { "ColorMetric", DMICM_COLORMETRIC },
  549. { NULL, 0 }
  550. };
  551. DEBUG_VALUES gadvDevModeMediaType[] = {
  552. { "Standard", DMMEDIA_STANDARD },
  553. { "Glossy", DMMEDIA_GLOSSY },
  554. { "Transparency", DMMEDIA_TRANSPARENCY },
  555. { NULL, 0 }
  556. };
  557. DEBUG_VALUES gadvDevModeDitherType[] = {
  558. { "None", DMDITHER_NONE },
  559. { "Coarse", DMDITHER_COARSE },
  560. { "Fine", DMDITHER_FINE },
  561. { "LineArt", DMDITHER_LINEART },
  562. { "GrayScale", DMDITHER_GRAYSCALE },
  563. { NULL, 0 }
  564. };
  565. BOOL
  566. TDebugExt::
  567. bDumpDevMode(
  568. PVOID pDevMode_,
  569. DWORD dwAddr
  570. )
  571. {
  572. PDEVMODE pDevMode = (PDEVMODE)pDevMode_;
  573. DWORD dwTotalSize = pDevMode->dmSize + pDevMode->dmDriverExtra;
  574. Print( "DevMode*\n" );
  575. Print( " dmDeviceName %ws\n", pDevMode->dmDeviceName );
  576. Print( " dmSpecVersion %x\n", pDevMode->dmSpecVersion );
  577. Print( " dmDriverVersion %x\n", pDevMode->dmDriverVersion );
  578. Print( "==== dmSize %x <%d> TotalSize %x <%d>\n",
  579. pDevMode->dmSize,
  580. pDevMode->dmSize,
  581. dwTotalSize, dwTotalSize );
  582. Print( " dmDriverExtra %x <%d>\n",
  583. pDevMode->dmDriverExtra,
  584. pDevMode->dmDriverExtra );
  585. Print( " dmFields " );
  586. vDumpFlags( pDevMode->dmFields, gadfDevModeFields );
  587. Print( " dmOrientation %x\n", pDevMode->dmOrientation );
  588. Print( " dmPaperSize " );
  589. vDumpValue( pDevMode->dmPaperSize, gadvDevModePapers );
  590. Print( " dmPaperLength %x\n", pDevMode->dmPaperLength );
  591. Print( " dmPaperWidth %x\n", pDevMode->dmPaperWidth );
  592. Print( " dmScale %x\n", pDevMode->dmScale );
  593. Print( " dmCopies %x\n", pDevMode->dmCopies );
  594. Print( " dmDefaultSource " );
  595. vDumpValue( pDevMode->dmDefaultSource, gadvDevModeDefaultSource );
  596. Print( " dmPrintQuality " );
  597. vDumpValue( pDevMode->dmPrintQuality, gadvDevModePrintQuality );
  598. Print( " dmColor " );
  599. vDumpValue( pDevMode->dmColor, gadvDevModeColor );
  600. Print( " dmDuplex " );
  601. vDumpValue( pDevMode->dmDuplex, gadvDevModeDuplex );
  602. Print( " dmYResolution %x\n", pDevMode->dmYResolution );
  603. Print( " dmTTOption " );
  604. vDumpValue( pDevMode->dmTTOption, gadvDevModeTTOption );
  605. Print( " dmCollate " );
  606. vDumpValue( pDevMode->dmCollate, gadvDevModeCollate );
  607. Print( "==== dmFormName %ws\n", pDevMode->dmFormName );
  608. Print( " dmLogPixels %x\n", pDevMode->dmLogPixels );
  609. Print( " dmBitsPerPel %x\n", pDevMode->dmBitsPerPel );
  610. Print( " dmPelsWidth %x\n", pDevMode->dmPelsWidth );
  611. Print( " dmPelsHeight %x\n", pDevMode->dmPelsHeight );
  612. Print( " dmDisplayFlags %x\n", pDevMode->dmDisplayFlags );
  613. Print( " dmDisplayFrequency %x\n", pDevMode->dmDisplayFrequency );
  614. Print( "==== dmICMMethod " );
  615. vDumpValue( pDevMode->dmICMMethod, gadvDevModeICMMethod );
  616. Print( " dmICMIntent " );
  617. vDumpValue( pDevMode->dmICMIntent, gadvDevModeICMIntent );
  618. Print( " dmMediaType " );
  619. vDumpValue( pDevMode->dmMediaType, gadvDevModeMediaType );
  620. Print( " dmDitherType " );
  621. vDumpValue( pDevMode->dmDitherType, gadvDevModeDitherType );
  622. Print( " dmICCManufacturer %x\n", pDevMode->dmICCManufacturer );
  623. Print( " dmICCModel %x\n", pDevMode->dmICCModel );
  624. Print( "==== Private at %x\n", dwAddr+pDevMode->dmSize );
  625. return TRUE;
  626. }
  627. BOOL
  628. TDebugExt::
  629. bDumpDevModeA(
  630. PVOID pDevModeA_,
  631. DWORD dwAddr
  632. )
  633. {
  634. PDEVMODEA pDevMode = (PDEVMODEA)pDevModeA_;
  635. DWORD dwTotalSize = pDevMode->dmSize + pDevMode->dmDriverExtra;
  636. Print( "DevModeA*\n" );
  637. Print( " dmDeviceName %hs\n", pDevMode->dmDeviceName );
  638. Print( " dmSpecVersion %x\n", pDevMode->dmSpecVersion );
  639. Print( " dmDriverVersion %x\n", pDevMode->dmDriverVersion );
  640. Print( "==== dmSize %x <%d> TotalSize %x <%d>\n",
  641. pDevMode->dmSize,
  642. pDevMode->dmSize,
  643. dwTotalSize, dwTotalSize );
  644. Print( " dmDriverExtra %x <%d>\n",
  645. pDevMode->dmDriverExtra,
  646. pDevMode->dmDriverExtra );
  647. Print( " dmFields " );
  648. vDumpFlags( pDevMode->dmFields, gadfDevModeFields );
  649. Print( " dmOrientation %x\n", pDevMode->dmOrientation );
  650. Print( " dmPaperSize " );
  651. vDumpValue( pDevMode->dmPaperSize, gadvDevModePapers );
  652. Print( " dmPaperLength %x\n", pDevMode->dmPaperLength );
  653. Print( " dmPaperWidth %x\n", pDevMode->dmPaperWidth );
  654. Print( " dmScale %x\n", pDevMode->dmScale );
  655. Print( " dmCopies %x\n", pDevMode->dmCopies );
  656. Print( " dmDefaultSource " );
  657. vDumpValue( pDevMode->dmDefaultSource, gadvDevModeDefaultSource );
  658. Print( " dmPrintQuality " );
  659. vDumpValue( pDevMode->dmPrintQuality, gadvDevModePrintQuality );
  660. Print( " dmColor " );
  661. vDumpValue( pDevMode->dmColor, gadvDevModeColor );
  662. Print( " dmDuplex " );
  663. vDumpValue( pDevMode->dmDuplex, gadvDevModeDuplex );
  664. Print( " dmYResolution %x\n", pDevMode->dmYResolution );
  665. Print( " dmTTOption " );
  666. vDumpValue( pDevMode->dmTTOption, gadvDevModeTTOption );
  667. Print( " dmCollate " );
  668. vDumpValue( pDevMode->dmCollate, gadvDevModeCollate );
  669. Print( "==== dmFormName %hs\n", pDevMode->dmFormName );
  670. Print( " dmLogPixels %x\n", pDevMode->dmLogPixels );
  671. Print( " dmBitsPerPel %x\n", pDevMode->dmBitsPerPel );
  672. Print( " dmPelsWidth %x\n", pDevMode->dmPelsWidth );
  673. Print( " dmPelsHeight %x\n", pDevMode->dmPelsHeight );
  674. Print( " dmDisplayFlags %x\n", pDevMode->dmDisplayFlags );
  675. Print( " dmDisplayFrequency %x\n", pDevMode->dmDisplayFrequency );
  676. Print( "==== dmICMMethod " );
  677. vDumpValue( pDevMode->dmICMMethod, gadvDevModeICMMethod );
  678. Print( " dmICMIntent " );
  679. vDumpValue( pDevMode->dmICMIntent, gadvDevModeICMIntent );
  680. Print( " dmMediaType " );
  681. vDumpValue( pDevMode->dmMediaType, gadvDevModeMediaType );
  682. Print( " dmDitherType " );
  683. vDumpValue( pDevMode->dmDitherType, gadvDevModeDitherType );
  684. Print( " dmICCManufacturer %x\n", pDevMode->dmICCManufacturer );
  685. Print( " dmICCModel %x\n", pDevMode->dmICCModel );
  686. Print( "==== Private at %x\n", dwAddr+pDevMode->dmSize );
  687. return TRUE;
  688. }
  689. #if 0
  690. BOOL
  691. TDebugExt::
  692. bDumpIniPrinter(
  693. PVOID pIniPrinter_,
  694. DWORD dwAddr
  695. )
  696. {
  697. PIniPrinter pIniPrinter = (PIniPrinter)pIniPrinter_;
  698. static DEBUG_FLAGS adfSpl[] = {
  699. { "UpdateWinIniDevices", SPL_UPDATE_WININI_DEVICES },
  700. { NULL, 0 }
  701. };
  702. if( !( pIniPrinter->signature == ID_SIGNATURE )){
  703. return FALSE;
  704. }
  705. Print( "IniPrinter*\n" );
  706. return TRUE;
  707. }
  708. #endif
  709. /********************************************************************
  710. Extension entrypoints.
  711. ********************************************************************/
  712. DEBUG_EXT_ENTRY( ds, INISPOOLER, bDumpIniSpooler, "&localspl!pLocalIniSpooler", FALSE )
  713. DEBUG_EXT_ENTRY( ddev, DEVMODE, bDumpDevMode, NULL, FALSE )
  714. DEBUG_EXT_ENTRY( ddeva, DEVMODEA, bDumpDevModeA, NULL, FALSE )
  715. DEBUG_EXT_ENTRY( dlcs,
  716. MCritSec,
  717. bDumpCritSec,
  718. "&localspl!hcsSpoolerSection",
  719. TRUE )
  720. DEBUG_EXT_HEAD(lastlog)
  721. {
  722. DEBUG_EXT_SETUP_VARS();
  723. DWORD dwAddress = 0;
  724. //
  725. // Read in localspl's gDbgPointers.
  726. //
  727. DBG_POINTERS DbgPointers;
  728. DWORD ppDbgPointers = 0;
  729. DWORD pDbgPointers = 0;
  730. ppDbgPointers = EvalExpression( "&localspl!gpDbgPointers" );
  731. if( !ppDbgPointers ){
  732. Print( "<Unable to resolve localspl!gpDbgPointers>\n" );
  733. return;
  734. }
  735. move( pDbgPointers, ppDbgPointers );
  736. if( !pDbgPointers ){
  737. Print( "<Unable to read valid localspl!gpDbgPointers>\n" );
  738. return;
  739. }
  740. move( DbgPointers, pDbgPointers );
  741. if( !DbgPointers.pbtTraceLog ){
  742. Print( "<Unable to read valid DbgPointers.pbtTraceLog>\n" );
  743. return;
  744. }
  745. vDumpTraceWithFlags( lpArgumentString, (DWORD)DbgPointers.pbtTraceLog );
  746. }
  747. /********************************************************************
  748. Signature matching dump function.
  749. ********************************************************************/
  750. #define DEBUG_EXT_TRY_SETUP() \
  751. PBYTE var = (PBYTE)EvalExpression( lpArgumentString ); \
  752. PVOID pvData; \
  753. BOOL bDone; \
  754. Print( "%x ", var )
  755. #define DEBUG_EXT_TRY( struct, func ) \
  756. pvData = LocalAlloc( LPTR, sizeof( struct )); \
  757. move2( pvData, var, sizeof( struct )); \
  758. bDone = TDebugExt::func( pvData, (DWORD)var ); \
  759. LocalFree( pvData ); \
  760. \
  761. if( bDone ){ \
  762. return; \
  763. }
  764. #define DEBUG_EXT_TRY_DONE() \
  765. Print( "<No Match %x>\n", var )
  766. DEBUG_EXT_HEAD( d )
  767. {
  768. DEBUG_EXT_SETUP_VARS();
  769. DEBUG_EXT_TRY_SETUP();
  770. DEBUG_EXT_TRY( INISPOOLER, bDumpIniSpooler );
  771. DEBUG_EXT_TRY( INIPRINTER, bDumpIniPrinter );
  772. DEBUG_EXT_TRY( INIPRINTPROC, bDumpIniPrintProc );
  773. DEBUG_EXT_TRY( INIVERSION, bDumpIniVersion );
  774. DEBUG_EXT_TRY( INIDRIVER, bDumpIniDriver );
  775. DEBUG_EXT_TRY( INIENVIRONMENT, bDumpIniEnvironment );
  776. DEBUG_EXT_TRY( INIMONITOR, bDumpIniMonitor );
  777. DEBUG_EXT_TRY( INIJOB, bDumpIniJob );
  778. DEBUG_EXT_TRY( INIPORT, bDumpIniPort );
  779. DEBUG_EXT_TRY( SPOOL, bDumpSpool );
  780. DEBUG_EXT_TRY_DONE();
  781. }