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

504 lines
18 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: debug.c
  8. //
  9. //--------------------------------------------------------------------------
  10. //
  11. // This file contains functions that are only used for debugging the ParClass driver.
  12. //
  13. #include "pch.h"
  14. #if (1 == DVRH_PAR_LOGFILE)
  15. #include "stdarg.h"
  16. #include "stdio.h"
  17. #endif
  18. static STRUCTUREOFFSETSTABLE gsotDEVICE_EXTENSION [] = {
  19. {"ExtensionSignature", FIELD_OFFSET(DEVICE_EXTENSION, ExtensionSignature)},
  20. {"DeviceType", FIELD_OFFSET(DEVICE_EXTENSION, DeviceType)},
  21. {"DeviceStateFlags", FIELD_OFFSET(DEVICE_EXTENSION, DeviceStateFlags)},
  22. {"Ieee1284_3DeviceId", FIELD_OFFSET(DEVICE_EXTENSION, Ieee1284_3DeviceId)},
  23. {"IsPdo", FIELD_OFFSET(DEVICE_EXTENSION, IsPdo)},
  24. {"EndOfChain", FIELD_OFFSET(DEVICE_EXTENSION, EndOfChain)},
  25. {"PodoRegForWMI", FIELD_OFFSET(DEVICE_EXTENSION, PodoRegForWMI)},
  26. {"ParClassFdo", FIELD_OFFSET(DEVICE_EXTENSION, ParClassFdo)},
  27. {"ParClassPdo", FIELD_OFFSET(DEVICE_EXTENSION, ParClassPdo)},
  28. {"Next", FIELD_OFFSET(DEVICE_EXTENSION, Next)},
  29. {"DeviceObject", FIELD_OFFSET(DEVICE_EXTENSION, DeviceObject)},
  30. {"PortDeviceObject", FIELD_OFFSET(DEVICE_EXTENSION, PortDeviceObject)},
  31. {"PortDeviceFileObject", FIELD_OFFSET(DEVICE_EXTENSION, PortDeviceFileObject)},
  32. {"PortSymbolicLinkName", FIELD_OFFSET(DEVICE_EXTENSION, PortSymbolicLinkName)},
  33. {"PhysicalDeviceObject", FIELD_OFFSET(DEVICE_EXTENSION, PhysicalDeviceObject)},
  34. {"ParentDeviceObject", FIELD_OFFSET(DEVICE_EXTENSION, ParentDeviceObject)},
  35. {"CurrentOpIrp", FIELD_OFFSET(DEVICE_EXTENSION, CurrentOpIrp)},
  36. {"NotificationHandle", FIELD_OFFSET(DEVICE_EXTENSION, NotificationHandle)},
  37. {"ClassName", FIELD_OFFSET(DEVICE_EXTENSION, ClassName)},
  38. {"SymbolicLinkName", FIELD_OFFSET(DEVICE_EXTENSION, SymbolicLinkName)},
  39. {"TimerStart", FIELD_OFFSET(DEVICE_EXTENSION, TimerStart)},
  40. {"CreatedSymbolicLink", FIELD_OFFSET(DEVICE_EXTENSION, CreatedSymbolicLink)},
  41. {"UsePIWriteLoop", FIELD_OFFSET(DEVICE_EXTENSION, UsePIWriteLoop)},
  42. {"Initialized", FIELD_OFFSET(DEVICE_EXTENSION, Initialized)},
  43. {"Initializing", FIELD_OFFSET(DEVICE_EXTENSION, Initializing)},
  44. {"OpenCloseRefCount", FIELD_OFFSET(DEVICE_EXTENSION, OpenCloseRefCount)},
  45. {"ParPortDeviceGone", FIELD_OFFSET(DEVICE_EXTENSION, ParPortDeviceGone)},
  46. {"RegForPptRemovalRelations", FIELD_OFFSET(DEVICE_EXTENSION, RegForPptRemovalRelations)},
  47. {"spare1", FIELD_OFFSET(DEVICE_EXTENSION, spare1)},
  48. {"IdxForwardProtocol", FIELD_OFFSET(DEVICE_EXTENSION, IdxForwardProtocol)},
  49. {"IdxReverseProtocol", FIELD_OFFSET(DEVICE_EXTENSION, IdxReverseProtocol)},
  50. {"CurrentEvent", FIELD_OFFSET(DEVICE_EXTENSION, CurrentEvent)},
  51. {"CurrentPhase", FIELD_OFFSET(DEVICE_EXTENSION, CurrentPhase)},
  52. {"PortHWMode", FIELD_OFFSET(DEVICE_EXTENSION, PortHWMode)},
  53. {"OpenCloseMutex", FIELD_OFFSET(DEVICE_EXTENSION, OpenCloseMutex)},
  54. {"DevObjListMutex", FIELD_OFFSET(DEVICE_EXTENSION, DevObjListMutex)},
  55. {"WorkQueue", FIELD_OFFSET(DEVICE_EXTENSION, WorkQueue)},
  56. {"ThreadObjectPointer", FIELD_OFFSET(DEVICE_EXTENSION, ThreadObjectPointer)},
  57. {"RequestSemaphore", FIELD_OFFSET(DEVICE_EXTENSION, RequestSemaphore)},
  58. {"OriginalController", FIELD_OFFSET(DEVICE_EXTENSION, OriginalController)},
  59. {"Controller", FIELD_OFFSET(DEVICE_EXTENSION, Controller)},
  60. {"EcrController", FIELD_OFFSET(DEVICE_EXTENSION, EcrController)},
  61. {"SpanOfController", FIELD_OFFSET(DEVICE_EXTENSION, SpanOfController)},
  62. {"TryAllocatePort", FIELD_OFFSET(DEVICE_EXTENSION, TryAllocatePort)},
  63. {"FreePort", FIELD_OFFSET(DEVICE_EXTENSION, FreePort)},
  64. {"QueryNumWaiters", FIELD_OFFSET(DEVICE_EXTENSION, QueryNumWaiters)},
  65. {"PortContext", FIELD_OFFSET(DEVICE_EXTENSION, PortContext)},
  66. {"HardwareCapabilities", FIELD_OFFSET(DEVICE_EXTENSION, HardwareCapabilities)},
  67. {"TrySetChipMode", FIELD_OFFSET(DEVICE_EXTENSION, TrySetChipMode)},
  68. {"ClearChipMode", FIELD_OFFSET(DEVICE_EXTENSION, ClearChipMode)},
  69. {"TrySelectDevice", FIELD_OFFSET(DEVICE_EXTENSION, TrySelectDevice)},
  70. {"DeselectDevice", FIELD_OFFSET(DEVICE_EXTENSION, DeselectDevice)},
  71. {"FifoDepth", FIELD_OFFSET(DEVICE_EXTENSION, FifoDepth)},
  72. {"FifoWidth", FIELD_OFFSET(DEVICE_EXTENSION, FifoWidth)},
  73. {"bAllocated", FIELD_OFFSET(DEVICE_EXTENSION, bAllocated)},
  74. {"BusyDelay", FIELD_OFFSET(DEVICE_EXTENSION, BusyDelay)},
  75. {"BusyDelayDetermined", FIELD_OFFSET(DEVICE_EXTENSION, BusyDelayDetermined)},
  76. {"DeferredWorkItem", FIELD_OFFSET(DEVICE_EXTENSION, DeferredWorkItem)},
  77. {"TimeToTerminateThread", FIELD_OFFSET(DEVICE_EXTENSION, TimeToTerminateThread)},
  78. {"UseNT35Priority", FIELD_OFFSET(DEVICE_EXTENSION, UseNT35Priority)},
  79. {"InitializationTimeout", FIELD_OFFSET(DEVICE_EXTENSION, InitializationTimeout)},
  80. {"AbsoluteOneSecond", FIELD_OFFSET(DEVICE_EXTENSION, AbsoluteOneSecond)},
  81. {"OneSecond", FIELD_OFFSET(DEVICE_EXTENSION, OneSecond)},
  82. {"Connected", FIELD_OFFSET(DEVICE_EXTENSION, Connected)},
  83. {"AllocatedByLockPort", FIELD_OFFSET(DEVICE_EXTENSION, AllocatedByLockPort)},
  84. {"spare4", FIELD_OFFSET(DEVICE_EXTENSION, spare4)},
  85. {"fnRead", FIELD_OFFSET(DEVICE_EXTENSION, fnRead)},
  86. {"fnWrite", FIELD_OFFSET(DEVICE_EXTENSION, fnWrite)},
  87. {"IdleTimeout", FIELD_OFFSET(DEVICE_EXTENSION, IdleTimeout)},
  88. {"ProtocolData", FIELD_OFFSET(DEVICE_EXTENSION, ProtocolData)},
  89. {"ForwardInterfaceAddress", FIELD_OFFSET(DEVICE_EXTENSION, ForwardInterfaceAddress)},
  90. {"ReverseInterfaceAddress", FIELD_OFFSET(DEVICE_EXTENSION, ReverseInterfaceAddress)},
  91. {"SetForwardAddress", FIELD_OFFSET(DEVICE_EXTENSION, SetForwardAddress)},
  92. {"SetReverseAddress", FIELD_OFFSET(DEVICE_EXTENSION, SetReverseAddress)},
  93. {"LockPortMutex", FIELD_OFFSET(DEVICE_EXTENSION, LockPortMutex)},
  94. {"DeviceState", FIELD_OFFSET(DEVICE_EXTENSION, DeviceState)},
  95. {"SystemState", FIELD_OFFSET(DEVICE_EXTENSION, SystemState)},
  96. {"spare2", FIELD_OFFSET(DEVICE_EXTENSION, spare2)},
  97. {"bShadowBuffer", FIELD_OFFSET(DEVICE_EXTENSION, bShadowBuffer)},
  98. {"ShadowBuffer", FIELD_OFFSET(DEVICE_EXTENSION, ShadowBuffer)},
  99. {"spare3", FIELD_OFFSET(DEVICE_EXTENSION, spare3)},
  100. {"bSynchWrites", FIELD_OFFSET(DEVICE_EXTENSION, bSynchWrites)},
  101. {"bFirstByteTimeout", FIELD_OFFSET(DEVICE_EXTENSION, bFirstByteTimeout)},
  102. {"bIsHostRecoverSupported", FIELD_OFFSET(DEVICE_EXTENSION, bIsHostRecoverSupported)},
  103. {"PauseEvent", FIELD_OFFSET(DEVICE_EXTENSION, PauseEvent)},
  104. {"ProtocolModesSupported", FIELD_OFFSET(DEVICE_EXTENSION, ProtocolModesSupported)},
  105. {"BadProtocolModes", FIELD_OFFSET(DEVICE_EXTENSION, BadProtocolModes)},
  106. {"ModeSafety", FIELD_OFFSET(DEVICE_EXTENSION, ModeSafety)},
  107. {"IsIeeeTerminateOk", FIELD_OFFSET(DEVICE_EXTENSION, IsIeeeTerminateOk)},
  108. {"IsCritical", FIELD_OFFSET(DEVICE_EXTENSION, IsCritical)},
  109. {"P12843DL", FIELD_OFFSET(DEVICE_EXTENSION, P12843DL)},
  110. {"log", FIELD_OFFSET(DEVICE_EXTENSION, log)},
  111. {"WmiLibContext", FIELD_OFFSET(DEVICE_EXTENSION, WmiLibContext)},
  112. {"WmiRegistrationCount", FIELD_OFFSET(DEVICE_EXTENSION, WmiRegistrationCount)},
  113. {"DeviceIdString", FIELD_OFFSET(DEVICE_EXTENSION, DeviceIdString)},
  114. {"DeviceDescription", FIELD_OFFSET(DEVICE_EXTENSION, DeviceDescription)},
  115. {"dummy", FIELD_OFFSET(DEVICE_EXTENSION, dummy)},
  116. {"RemoveLock", FIELD_OFFSET(DEVICE_EXTENSION, RemoveLock)},
  117. {"HwProfileChangeNotificationHandle", FIELD_OFFSET(DEVICE_EXTENSION, HwProfileChangeNotificationHandle)},
  118. {"ExtensionSignatureEnd", FIELD_OFFSET(DEVICE_EXTENSION, ExtensionSignatureEnd)},
  119. {NULL, sizeof(DEVICE_EXTENSION)}
  120. };
  121. #if DBG
  122. #if (1 == DVRH_PAR_LOGFILE)
  123. /**************************************************************************
  124. Function: DVRH_LogMessage()
  125. Description:Logs message to configured output
  126. Inputs: Parameter indicated message log level and
  127. Format string and parameters
  128. Outputs: Boolean value indicating success or failure
  129. ***************************************************************************/
  130. BOOLEAN DVRH_LogMessage(PCHAR szFormat, ...)
  131. {
  132. ULONG Length;
  133. char messagebuf[256];
  134. va_list va;
  135. IO_STATUS_BLOCK IoStatus;
  136. OBJECT_ATTRIBUTES objectAttributes;
  137. NTSTATUS status;
  138. HANDLE FileHandle;
  139. UNICODE_STRING fileName;
  140. //format the string
  141. va_start(va,szFormat);
  142. vsprintf(messagebuf,szFormat,va);
  143. va_end(va);
  144. //get a handle to the log file object
  145. fileName.Buffer = NULL;
  146. fileName.Length = 0;
  147. fileName.MaximumLength = sizeof(DEFAULT_LOG_FILE_NAME) + sizeof(UNICODE_NULL);
  148. fileName.Buffer = ExAllocatePool(PagedPool,
  149. fileName.MaximumLength);
  150. if (!fileName.Buffer)
  151. {
  152. ParDump2(PARERRORS, ("LogMessage: FAIL. ExAllocatePool Failed.\n") );
  153. return FALSE;
  154. }
  155. RtlZeroMemory(fileName.Buffer, fileName.MaximumLength);
  156. status = RtlAppendUnicodeToString(&fileName, (PWSTR)DEFAULT_LOG_FILE_NAME);
  157. InitializeObjectAttributes (&objectAttributes,
  158. (PUNICODE_STRING)&fileName,
  159. OBJ_CASE_INSENSITIVE,
  160. NULL,
  161. NULL );
  162. status = ZwCreateFile(&FileHandle,
  163. FILE_APPEND_DATA,
  164. &objectAttributes,
  165. &IoStatus,
  166. 0,
  167. FILE_ATTRIBUTE_NORMAL,
  168. FILE_SHARE_WRITE,
  169. FILE_OPEN_IF,
  170. FILE_SYNCHRONOUS_IO_NONALERT,
  171. NULL,
  172. 0 );
  173. if(NT_SUCCESS(status))
  174. {
  175. CHAR buf[300];
  176. LARGE_INTEGER time;
  177. KeQuerySystemTime(&time);
  178. //put a time stamp on the output message
  179. sprintf(buf,"%10u-%10u %s",time.HighPart,time.LowPart,messagebuf);
  180. //format the string to make sure it appends a newline carrage-return to the
  181. //end of the string.
  182. Length=strlen(buf);
  183. if(buf[Length-1]=='\n')
  184. {
  185. buf[Length-1]='\r';
  186. strcat(buf,"\n");
  187. Length++;
  188. }
  189. else
  190. {
  191. strcat(buf,"\r\n");
  192. Length+=2;
  193. }
  194. ZwWriteFile(FileHandle,
  195. NULL,
  196. NULL,
  197. NULL,
  198. &IoStatus,
  199. buf,
  200. Length,
  201. NULL,
  202. NULL );
  203. ZwClose(FileHandle);
  204. }
  205. if (fileName.Buffer)
  206. ExFreePool (fileName.Buffer);
  207. return STATUS_SUCCESS;
  208. }
  209. /**************************************************************************
  210. Function: DVRH_LogByteData()
  211. Description:Formats byte data to be displayed in the configured output
  212. Inputs: Log level, Whether this is input or output data, a pointer to
  213. the byte data buffer and the size of the buffer
  214. Outputs: Boolean indicated success or failure
  215. ***************************************************************************/
  216. #if 0
  217. BOOLEAN DVRH_LogByteData(BOOLEAN READ,PCHAR szBuff,ULONG dwTransferred)
  218. {
  219. CString cStr;
  220. ULONG MAX_SIZE=80;
  221. UNICODE_STRING UniStr;
  222. ANSI_STRING AnsiStr;
  223. WCHAR wStr[8];
  224. PCHAR szTemp=szBuff;
  225. UCHAR bTemp;
  226. ULONG dwDisplaySize;
  227. UniStr.Length=0;
  228. UniStr.MaximumLength=8;
  229. UniStr.Buffer=wStr;
  230. AnsiStr.Length=0;
  231. AnsiStr.MaximumLength=0;
  232. AnsiStr.Buffer=NULL;
  233. if(READ)
  234. cStr=L"<RCV";
  235. else
  236. cStr=L"SND>";
  237. //make sure the size of the requested string is within the set range
  238. dwDisplaySize=(((dwTransferred*3)+10) > MAX_SIZE)?((MAX_SIZE-10)/3):dwTransferred;
  239. //format byte data
  240. while(dwDisplaySize)
  241. {
  242. bTemp=szTemp[0];
  243. if(bTemp > 0xF)
  244. cStr+=L" ";
  245. else
  246. cStr+=L" 0";
  247. RtlIntegerToUnicodeString(bTemp,16,&UniStr);
  248. cStr+=UniStr.Buffer;
  249. szTemp++;
  250. dwDisplaySize--;
  251. }
  252. cStr.StringToAnsiString(&AnsiStr);
  253. LogMessage("%5u %s",dwTransferred,AnsiStr.Buffer);
  254. RtlFreeAnsiString(&AnsiStr);
  255. return (TRUE);
  256. }
  257. #endif
  258. #endif // (1 == DVRH_PAR_LOGFILE)
  259. VOID
  260. ParInitDebugLevel (
  261. IN PUNICODE_STRING RegistryPath
  262. )
  263. /*++
  264. Routine Description:
  265. Checked Build Only!
  266. Initialize debugging variables from registry; set to default values
  267. if anything fails.
  268. Arguments:
  269. RegistryPath - Root path in registry where we should look
  270. Return Value:
  271. None
  272. --*/
  273. {
  274. NTSTATUS Status;
  275. RTL_QUERY_REGISTRY_TABLE paramTable[4];
  276. PWSTR path;
  277. ULONG defaultDebugLevel = PARDUMP_SILENT;
  278. ULONG defaultBreakOn = PAR_BREAK_ON_NOTHING;
  279. ULONG defaultUseAsserts = 0; // don't use asserts
  280. //
  281. // We were given a counted string, but we need a null terminated string
  282. //
  283. path = ExAllocatePool(PagedPool, RegistryPath->Length+sizeof(WCHAR));
  284. if (!path) {
  285. // can't get a buffer, use defaults and return
  286. ParDebugLevel = defaultDebugLevel;
  287. ParBreakOn = defaultBreakOn;
  288. ParUseAsserts = defaultUseAsserts;
  289. return;
  290. }
  291. RtlMoveMemory(path, RegistryPath->Buffer, RegistryPath->Length);
  292. path[ (RegistryPath->Length) / 2 ] = UNICODE_NULL;
  293. //
  294. // set up table entries for call to RtlQueryRegistryValues
  295. //
  296. RtlZeroMemory(&paramTable[0], sizeof(paramTable));
  297. paramTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
  298. paramTable[0].Name = (PWSTR)L"ParDebugLevel";
  299. paramTable[0].EntryContext = &ParDebugLevel;
  300. paramTable[0].DefaultType = REG_DWORD;
  301. paramTable[0].DefaultData = &defaultDebugLevel;
  302. paramTable[0].DefaultLength = sizeof(ULONG);
  303. paramTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT;
  304. paramTable[1].Name = (PWSTR)L"ParBreakOn";
  305. paramTable[1].EntryContext = &ParBreakOn;
  306. paramTable[1].DefaultType = REG_DWORD;
  307. paramTable[1].DefaultData = &defaultBreakOn;
  308. paramTable[1].DefaultLength = sizeof(ULONG);
  309. paramTable[2].Flags = RTL_QUERY_REGISTRY_DIRECT;
  310. paramTable[2].Name = (PWSTR)L"ParUseAsserts";
  311. paramTable[2].EntryContext = &defaultUseAsserts;
  312. paramTable[2].DefaultType = REG_DWORD;
  313. paramTable[2].DefaultData = &defaultBreakOn;
  314. paramTable[2].DefaultLength = sizeof(ULONG);
  315. //
  316. // leave paramTable[3] as all zeros - this terminates the table
  317. //
  318. Status = RtlQueryRegistryValues( RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL,
  319. path,
  320. &paramTable[0],
  321. NULL,
  322. NULL);
  323. if (!NT_SUCCESS(Status)) {
  324. // registry read failed, use defaults
  325. ParDebugLevel = defaultDebugLevel;
  326. ParBreakOn = defaultBreakOn;
  327. ParUseAsserts = defaultUseAsserts;
  328. }
  329. ExFreePool( path );
  330. ParDumpV( ("ParDebugLevel = %08x , ParBreakOn = %08x\n", ParDebugLevel, ParBreakOn) );
  331. }
  332. #endif // DBG
  333. #if DBG
  334. VOID
  335. ParDumpDeviceObjectList(
  336. PDEVICE_OBJECT ParClassFdo
  337. )
  338. /*++
  339. Routine Description:
  340. This function is a diagnostic routine that is only
  341. available in Checked builds
  342. Dump the list of ParClass ejected Device Objects
  343. Arguments:
  344. FdoDeviceObject - The ParClass Function Device Object
  345. Return Value:
  346. NONE
  347. --*/
  348. {
  349. PDEVICE_EXTENSION FdoExtension = ParClassFdo ->DeviceExtension;
  350. PDEVICE_OBJECT currentDO = FdoExtension->ParClassPdo;
  351. ParDump(PARDUMP_VERBOSE_MAX,
  352. ("PARALLEL: ParDumpDeviceObjectList(...):\n") );
  353. while( currentDO ) {
  354. PDEVICE_EXTENSION currentExt = currentDO->DeviceExtension;
  355. ParDump(PARDUMP_VERBOSE_MAX,
  356. ("PARALLEL: - %x %wZ %wZ\n",
  357. currentDO, &currentExt->ClassName, &currentExt->SymbolicLinkName) );
  358. currentDO = ( (PDEVICE_EXTENSION)(currentDO->DeviceExtension) )->Next;
  359. }
  360. }
  361. #endif
  362. NTSTATUS
  363. ParAcquireRemoveLock(
  364. IN PIO_REMOVE_LOCK RemoveLock,
  365. IN PVOID Tag OPTIONAL
  366. )
  367. {
  368. NTSTATUS status;
  369. ParDump2(PARREMLOCK, ("debug::ParAcquireRemoveLock: RemoveLock= %x , Tag= %x\n", RemoveLock, Tag) );
  370. ParDump2(PARREMLOCK, ("debug::ParAcquireRemoveLock: Count [%x] Removed[%x] - calling IoAcquireRemoveLock\n",
  371. RemoveLock->Common.IoCount, RemoveLock->Common.Removed));
  372. status = IoAcquireRemoveLock(RemoveLock, Tag);
  373. return status;
  374. }
  375. VOID
  376. ParReleaseRemoveLock(
  377. IN PIO_REMOVE_LOCK RemoveLock,
  378. IN PVOID Tag OPTIONAL
  379. )
  380. {
  381. ParDump2(PARREMLOCK, ("debug::ParReleaseRemoveLock: RemoveLock= %x , Tag= %x\n", RemoveLock, Tag) );
  382. ParDump2(PARREMLOCK, ("debug::ParReleaseRemoveLock: Count [%x] Removed[%x] - calling IoReleaseRemoveLock\n",
  383. RemoveLock->Common.IoCount, RemoveLock->Common.Removed));
  384. IoReleaseRemoveLock(RemoveLock, Tag);
  385. }
  386. VOID
  387. ParReleaseRemoveLockAndWait(
  388. IN PIO_REMOVE_LOCK RemoveLock,
  389. IN PVOID Tag
  390. )
  391. {
  392. ParDump2(PARREMLOCK, ("debug::ParReleaseRemoveLockAndWait: RemoveLock= %x , Tag= %x\n", RemoveLock, Tag) );
  393. ParDump2(PARREMLOCK, ("debug::ParReleaseRemoveLock: Count [%x] Removed[%x] - calling IoReleaseRemoveLockAndWait\n",
  394. RemoveLock->Common.IoCount, RemoveLock->Common.Removed));
  395. IoReleaseRemoveLockAndWait(RemoveLock, Tag);
  396. ParDump2(PARREMLOCK, ("debug::ParReleaseRemoveLock: Count [%x] Removed[%x] - post IoReleaseRemoveLockAndWait\n",
  397. RemoveLock->Common.IoCount, RemoveLock->Common.Removed));
  398. }
  399. VOID ParDumpDevObjStructList(
  400. IN PPAR_DEVOBJ_STRUCT DevObjStructHead
  401. )
  402. {
  403. PPAR_DEVOBJ_STRUCT current = DevObjStructHead;
  404. if( DevObjStructHead ) {
  405. ParDump2(PARPNP1, ("debug::ParDumpDevObjStructList - Enter\n") );
  406. } else {
  407. ParDump2(PARPNP1, ("debug::ParDumpDevObjStructList - Enter - Empty list - returning\n") );
  408. return;
  409. }
  410. while( current ) {
  411. ParDump2(PARPNP1, (" Controller = %x\n", current->Controller) );
  412. ParDump2(PARPNP1, (" LegacyPodo = %x\n", current->LegacyPodo) );
  413. ParDump2(PARPNP1, (" EndOfChainPdo = %x\n", current->EndOfChainPdo) );
  414. ParDump2(PARPNP1, (" Dot3Id0Pdo = %x\n", current->Dot3Id0Pdo) );
  415. ParDump2(PARPNP1, (" Dot3Id1Pdo = %x\n", current->Dot3Id1Pdo) );
  416. ParDump2(PARPNP1, (" Dot3Id2Pdo = %x\n", current->Dot3Id2Pdo) );
  417. ParDump2(PARPNP1, (" Dot3Id3Pdo = %x\n", current->Dot3Id3Pdo) );
  418. ParDump2(PARPNP1, (" LegacyZipPdo = %x\n", current->LegacyZipPdo) );
  419. current = current->Next;
  420. }
  421. return;
  422. }
  423. VOID
  424. ParDumpDevExtTable()
  425. {
  426. ULONG i = 0;
  427. while( gsotDEVICE_EXTENSION[i].pszField ) {
  428. DbgPrint("%3x - %s\n", gsotDEVICE_EXTENSION[i].dwOffset, gsotDEVICE_EXTENSION[i].pszField);
  429. ++i;
  430. }
  431. DbgPrint("sizeof(DEVICE_EXTENSION) = %08x\n", gsotDEVICE_EXTENSION[i].dwOffset);
  432. }