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.

1596 lines
49 KiB

  1. /*******************************************************************
  2. *
  3. * File : dump.cxx
  4. * Author : Eyal Schwartz
  5. * Copyrights : Microsoft Corp (C) 1996
  6. * Date : 7/15/1998
  7. * Description : implentation of dump routines
  8. *
  9. * Revisions : <date> <name> <description>
  10. *******************************************************************/
  11. #ifndef DUMP_CXX
  12. #define DUMP_CXX
  13. // include //
  14. // common
  15. #include "common.h"
  16. #include "util.hxx"
  17. #include <winsock2.h>
  18. #include <winldap.h>
  19. #include <windns.h>
  20. // dns structures
  21. #include "dns.h"
  22. #include "tree.h"
  23. // Ignore zero sized array warnings.
  24. #pragma warning (disable : 4200)
  25. #include "dnsrpc.h"
  26. #include "name.h"
  27. #include "record.h"
  28. #include "update.h"
  29. #include "dpart.h"
  30. #include "EventControl.h"
  31. #include "zone.h"
  32. #include "msginfo.h"
  33. // local
  34. #include "dump.hxx"
  35. // types //
  36. // BUGBUG: RE-DECLARED from lock.c !!
  37. #define MAX_LOCKED_TIME (300) // 5 minutes
  38. #define LOCK_HISTORY_SIZE (256)
  39. typedef struct _LockEntry
  40. {
  41. LONG Count;
  42. DWORD ThreadId;
  43. LPSTR File;
  44. DWORD Line;
  45. }
  46. LOCK_ENTRY, *PLOCK_ENTRY;
  47. typedef struct _LockTable
  48. {
  49. LPSTR pszName;
  50. DWORD FailuresSinceLockFree;
  51. DWORD LastFreeLockTime;
  52. DWORD Index;
  53. LOCK_ENTRY OffenderLock;
  54. LOCK_ENTRY LockHistory[ LOCK_HISTORY_SIZE ];
  55. }
  56. LOCK_TABLE, * PLOCK_TABLE;
  57. //
  58. // Protos for exported functions
  59. //
  60. DECLARE_DUMPFUNCTION( Dump_DNS_MSGINFO );
  61. DECLARE_DUMPFUNCTION( Dump_DS_SEARCH );
  62. DECLARE_DUMPFUNCTION( Dump_Help );
  63. DECLARE_DUMPFUNCTION( Dump_SockAddr );
  64. DECLARE_DUMPFUNCTION( Dump_DB_NODE );
  65. DECLARE_DUMPFUNCTION( Dump_COUNT_NAME );
  66. DECLARE_DUMPFUNCTION( Dump_ZONE_INFO );
  67. DECLARE_DUMPFUNCTION( Dump_DB_RECORD );
  68. DECLARE_DUMPFUNCTION( Dump_IP_ARRAY );
  69. DECLARE_DUMPFUNCTION( Dump_LOCK_TABLE );
  70. DECLARE_DUMPFUNCTION( Dump_LOCK_ENTRY );
  71. DECLARE_DUMPFUNCTION( Dump_UPDATE );
  72. DECLARE_DUMPFUNCTION( Dump_UPDATE_LIST );
  73. DECLARE_DUMPFUNCTION( Dump_DNS_WIRE_QUESTION );
  74. DECLARE_DUMPFUNCTION( Dump_LOOKUP_NAME );
  75. DECLARE_DUMPFUNCTION( Dump_DNS_HEADER );
  76. DECLARE_DUMPFUNCTION( Dump_HEAP_HEADER );
  77. //
  78. // Private protos
  79. //
  80. DECLARE_DUMPFUNCTION( Dump_ADDITIONAL_INFO );
  81. DECLARE_DUMPFUNCTION( Dump_COMPRESSION_INFO );
  82. DECLARE_DUMPFUNCTION( Dump_Record_SOA );
  83. DECLARE_DUMPFUNCTION( Dump_SID );
  84. VOID
  85. DumpBuffer(
  86. PVOID Buffer,
  87. DWORD BufferSize );
  88. //
  89. // Dispatch table
  90. //
  91. DUMPENTRY gfDumpTable[] =
  92. {
  93. "COUNT_NAME" , Dump_COUNT_NAME,
  94. "DB_NODE" , Dump_DB_NODE,
  95. "DB_RECORD" , Dump_DB_RECORD,
  96. "DNS_HEADER" , Dump_DNS_HEADER,
  97. "DNS_WIRE_QUESTION" , Dump_DNS_WIRE_QUESTION,
  98. "DS_SEARCH" , Dump_DS_SEARCH,
  99. "HEAP_HEADER" , Dump_HEAP_HEADER,
  100. "HELP" , Dump_Help,
  101. "IP_ARRAY" , Dump_IP_ARRAY,
  102. "LOCK_TABLE" , Dump_LOCK_TABLE,
  103. "LOCK_ENTRY" , Dump_LOCK_ENTRY,
  104. "LOOKUP_NAME" , Dump_LOOKUP_NAME,
  105. "MSGINFO" , Dump_DNS_MSGINFO,
  106. "SOCKADDR" , Dump_SockAddr,
  107. "UPDATE" , Dump_UPDATE,
  108. "UPDATE_LIST" , Dump_UPDATE_LIST,
  109. "ZONE_INFO" , Dump_ZONE_INFO,
  110. "SID" , Dump_SID
  111. };
  112. const INT gcbDumpTable = (sizeof(gfDumpTable) / sizeof(DUMPENTRY) );
  113. // functions //
  114. /*+++
  115. Function : Dump_Help
  116. Description: print out dump usage
  117. Parameters : none.
  118. Return :
  119. Remarks : none.
  120. ---*/
  121. DECLARE_DUMPFUNCTION( Dump_Help)
  122. {
  123. Printf( "dnsexts.dump <DATATYPE> <ADDRESS>\n <ADDRESS> := any hex debugger valid address\n" );
  124. Printf( " <DATATYPE> :=\n" );
  125. Printf( "\tCOUNT_NAME: Counted name definition.\n" );
  126. Printf( "\tDB_NODE: Tree node definition.\n" );
  127. Printf( "\tDB_RECORD: RR structure.\n" );
  128. Printf( "\tDNS_HEADER: DNS Header.\n" );
  129. Printf( "\tDNS_WIRE_QUESTION: DNS Question.\n" );
  130. Printf( "\tHEAP_HEADER: DNS heap header.\n" );
  131. Printf( "\tHELP: print this screen.\n" );
  132. Printf( "\tIP_ARRAY: IP Address Array type.\n" );
  133. Printf( "\tLOCK_TABLE: Debug lock tracking table.\n" );
  134. Printf( "\tLOCK_ENTRY: Debug lock tracking entry.\n" );
  135. Printf( "\tLOOKUP_NAME: Lookup name definition.\n" );
  136. Printf( "\tMSGINFO: DNS Server Message Info structure.\n" );
  137. Printf( "\tSOCKADDR: Winsock address.\n" );
  138. Printf( "\tUPDATE: Update list entry.\n" );
  139. Printf( "\tUPDATE_LIST: Update list table.\n" );
  140. Printf( "\tZONE_INFO: Zone information type.\n" );
  141. Printf( "\tSID: Dump given SID.\n" );
  142. Printf( "---\n" );
  143. return TRUE;
  144. }
  145. /*+++
  146. Function : Dump_DNS_MSGINFO
  147. Description: dumps out message info
  148. Parameters :
  149. Return :
  150. Remarks : none.
  151. ---*/
  152. DECLARE_DUMPFUNCTION( Dump_DNS_MSGINFO )
  153. {
  154. Printf( "DNS_MSGINFO(0x%p):\n", lpVoid );
  155. if ( !lpVoid )
  156. {
  157. Printf( "Cannot process [%p] pointer\n", lpVoid );
  158. return FALSE;
  159. }
  160. //
  161. // DNS_MSGINFO header
  162. //
  163. PDNS_MSGINFO pMsg = (PDNS_MSGINFO) PushMemory( lpVoid, sizeof(DNS_MSGINFO) );;
  164. Printf( " ListEntry = {Flink=0x%p, Blink=0x%p}\n", pMsg->ListEntry.Flink, pMsg->ListEntry.Blink );
  165. Printf( " Socket = 0x%x\n", (DWORD)pMsg->Socket );
  166. Printf( " RemoteAddressLength = 0x%x (%d)\n", pMsg->RemoteAddressLength, pMsg->RemoteAddressLength );
  167. Printf( " RemoteAddress -- " );
  168. Dump_SockAddr((LPVOID)&(pMsg->RemoteAddress) );
  169. Printf( " BufferLength = 0x%x\n", pMsg->BufferLength );
  170. Printf( " pBufferEnd = 0x%p\n", pMsg->pBufferEnd );
  171. Printf( " pCurrent = 0x%p\n", pMsg->pCurrent );
  172. Printf( " pnodeCurrent = 0x%p\n", pMsg->pnodeCurrent );
  173. Printf( " pzoneCurrent = 0x%p\n", pMsg->pzoneCurrent );
  174. Printf( " pnodeDelegation = 0x%p\n", pMsg->pnodeDelegation );
  175. Printf( " wTypeCurrent = 0x%x\n", pMsg->wTypeCurrent );
  176. Printf( " wOffsetCurrent = 0x%x\n", pMsg->wOffsetCurrent );
  177. Printf( " pNodeQuestion = 0x%p\n", pMsg->pNodeQuestion );
  178. Printf( " pNodeNodeQuestionClosest = 0x%p\n", pMsg->pNodeQuestionClosest );
  179. Printf( " pQuestion = 0x%p\n", pMsg->pQuestion );
  180. Printf( " wQuestionType = 0x%x\n", pMsg->wQuestionType );
  181. Printf( " wQueuingXid = 0x%x\n", pMsg->wQueuingXid );
  182. Printf( " dwQueryTime = 0x%x\n", pMsg->dwQueryTime );
  183. Printf( " dwQueuingTime = 0x%x\n", pMsg->dwQueuingTime );
  184. Printf( " dwExpireTime = 0x%x\n", pMsg->dwExpireTime );
  185. Printf( " pRecurseMsg = 0x%p\n", pMsg->pRecurseMsg );
  186. Printf( " pnodeRecurseRetry = 0x%p\n", pMsg->pnodeRecurseRetry );
  187. Printf( " pNsList = 0x%p\n", pMsg->pNsList );
  188. Printf( " pConnection = 0x%p\n", pMsg->pConnection );
  189. Printf( " pchRecv = 0x%p\n", pMsg->pchRecv );
  190. Printf( " UnionMarker = 0x%x\n", pMsg->UnionMarker );
  191. //
  192. // Union -- should get a union tag
  193. //
  194. {
  195. //
  196. // For now, print both Nbstat & Xfr images
  197. //
  198. Printf( " Union:\n" );
  199. //
  200. // WINS info
  201. //
  202. {
  203. Printf( " (U.Wins):\n" );
  204. Printf( " pWinsRR = 0x%x\n", pMsg->U.Wins.pWinsRR );
  205. Printf( " WinsNameBuffer = 0x%x\n", RELATIVE_ADDRESS(lpVoid, pMsg, pMsg->U.Wins.pWinsRR) );
  206. Printf( " cchWinsName = %d\n", pMsg->U.Wins.cchWinsName );
  207. }
  208. //
  209. // Nbstat info
  210. //
  211. {
  212. Printf( " (U.Nbstat):\n" );
  213. Printf( " pRR = 0x%p\n", pMsg->U.Nbstat.pRR );
  214. Printf( " pNbstat = 0x%p\n", pMsg->U.Nbstat.pNbstat );
  215. Printf( " ipNbstat = 0x%x\n", pMsg->U.Nbstat.ipNbstat );
  216. Printf( " dwNbtInterfaceMask = 0x%x\n", pMsg->U.Nbstat.dwNbtInterfaceMask );
  217. Printf( " fNbstatResponded = %s\n", pMsg->U.Nbstat.fNbstatResponded? "TRUE" : "FALSE" );
  218. }
  219. //
  220. // Xfr
  221. //
  222. {
  223. Printf( " (U.Xfr):\n" );
  224. Printf( " dwMessageNumber = 0x%x\n", pMsg->U.Xfr.dwMessageNumber );
  225. Printf( " dwSecondaryVersion = 0x%x\n", pMsg->U.Xfr.dwSecondaryVersion );
  226. Printf( " dwMasterVersion = 0x%x\n", pMsg->U.Xfr.dwMasterVersion );
  227. Printf( " dwLastSoaVersion = 0x%x\n", pMsg->U.Xfr.dwLastSoaVersion );
  228. Printf( " fReceivedStartSoa = %s\n", pMsg->U.Xfr.fReceivedStartSoa?"TRUE":"FALSE" );
  229. Printf( " fBindTransfer = %s\n", pMsg->U.Xfr.fBindTransfer?"TRUE":"FALSE" );
  230. Printf( " fMsTransfer = %s\n", pMsg->U.Xfr.fMsTransfer?"TRUE":"FALSE" );
  231. Printf( " fLastPassAdd = %s\n", pMsg->U.Xfr.fLastPassAdd?"TRUE":"FALSE" );
  232. }
  233. //
  234. // Forward
  235. //
  236. {
  237. Printf( " (U.Forward):\n" );
  238. Printf( " OriginalSocket = 0x%x\n", pMsg->U.Forward.OriginalSocket );
  239. Printf( " ipOriginal = 0x%x\n", pMsg->U.Forward.ipOriginal );
  240. Printf( " wOriginalPort = 0x%x\n", pMsg->U.Forward.wOriginalPort );
  241. Printf( " wOriginalXid = 0x%x\n", pMsg->U.Forward.wOriginalXid );
  242. }
  243. }
  244. Printf( " pLooknameQuestion = 0x%p\n",pMsg->pLooknameQuestion );
  245. Printf( " FlagMarker = 0x%x\n", pMsg->FlagMarker );
  246. Printf( " fDelete = 0x%x\n", pMsg->fDelete );
  247. Printf( " fTcp = 0x%x\n", pMsg->fTcp );
  248. Printf( " fMessageComplete = 0x%x\n", pMsg->fMessageComplete );
  249. Printf( " Section = %d\n", pMsg->Section );
  250. Printf( " fDoAdditional = 0x%x\n", pMsg->fDoAdditional );
  251. Printf( " fRecurseIfNecessary = 0x%x\n", pMsg->fRecurseIfNecessary );
  252. Printf( " fRecursePacket = 0x%x\n", pMsg->fRecursePacket );
  253. Printf( " fQuestionRecursed = 0x%x\n", pMsg->fQuestionRecursed );
  254. Printf( " fQuestionCompleted = 0x%x\n", pMsg->fQuestionCompleted );
  255. Printf( " fRecurseQuestionSent = 0x%x\n", pMsg->fRecurseQuestionSent );
  256. Printf( " fRecurseTimeoutWait = 0x%x\n", pMsg->fRecurseTimeoutWait );
  257. Printf( " nForwarder = 0x%x\n", pMsg->nForwarder );
  258. Printf( " fReplaceCname = 0x%x\n", pMsg->fReplaceCname );
  259. Printf( " cCnameAnswerCount = %d\n", pMsg->cCnameAnswerCount );
  260. Printf( " fNoCompressionWrite = 0x%x\n", pMsg->fNoCompressionWrite );
  261. Printf( " fWins = 0x%x\n", pMsg->fWins );
  262. Printf( " fQuestionWildcard = 0x%x\n", pMsg->fQuestionWildcard );
  263. Printf( " Additional --\n" );
  264. Dump_ADDITIONAL_INFO( (LPVOID)&pMsg->Additional );
  265. Printf( " Compression --\n" );
  266. Dump_COMPRESSION_INFO( (LPVOID)&pMsg->Compression );
  267. #if DBG
  268. Printf( " DbgListEntry = {Flink=0x%p; Blink=0x%p}\n", pMsg->DbgListEntry.Flink, pMsg->DbgListEntry.Blink );
  269. #endif
  270. Printf( " dwForceAlignment = 0x%x\n", pMsg->dwForceAlignment );
  271. Printf( " BytesToReceive = 0x%x\n", pMsg->BytesToReceive );
  272. Printf( " MessageLength = 0x%x\n", pMsg->MessageLength );
  273. Printf( " Head --\n" );
  274. Dump_DNS_HEADER((LPVOID)&pMsg->Head );
  275. Printf( " MessageBody -- " );
  276. DumpBuffer((LPVOID)RELATIVE_ADDRESS(lpVoid, pMsg, pMsg->MessageBody), pMsg->MessageLength );
  277. PopMemory( (PVOID)pMsg );
  278. return TRUE;
  279. }
  280. /*+++
  281. Function : DumpSockAddr
  282. Description: dumps sockaddr structure
  283. Parameters :
  284. Return :
  285. Remarks : none.
  286. ---*/
  287. DECLARE_DUMPFUNCTION( Dump_SockAddr)
  288. {
  289. Printf( "SockAddr(0x%p):\n", lpVoid );
  290. if( !lpVoid )
  291. {
  292. Printf( "Cannot process [%p] pointer\n", lpVoid );
  293. return FALSE;
  294. }
  295. //
  296. // print sockaddr structure
  297. //
  298. PSOCKADDR_IN paddr = (PSOCKADDR_IN) PushMemory( lpVoid, sizeof(SOCKADDR_IN) );;
  299. Printf(
  300. " family = %d, port = %d, address = [%d:%d:%d:%d]\n",
  301. paddr->sin_family, paddr->sin_port,
  302. paddr->sin_addr.S_un.S_un_b.s_b1,
  303. paddr->sin_addr.S_un.S_un_b.s_b2,
  304. paddr->sin_addr.S_un.S_un_b.s_b3,
  305. paddr->sin_addr.S_un.S_un_b.s_b4 );
  306. PopMemory( (PVOID)paddr );
  307. return TRUE;
  308. }
  309. /*+++
  310. Function : Dump_DB_NODE
  311. Description:
  312. Parameters :
  313. Return :
  314. Remarks : none.
  315. ---*/
  316. DECLARE_DUMPFUNCTION( Dump_DB_NODE)
  317. {
  318. Printf( "DB_NODE(0x%p):\n", lpVoid );
  319. if ( !lpVoid )
  320. {
  321. Printf( "Cannot process [%p] pointer\n", lpVoid );
  322. return FALSE;
  323. }
  324. //
  325. // print node structure
  326. //
  327. PDB_NODE pnode = (PDB_NODE) PushMemory( lpVoid, sizeof(DB_NODE) );;
  328. Printf( " pParent = 0x%p\n", pnode->pParent );
  329. Printf( " pSibUp = 0x%p\n", pnode->pSibUp );
  330. Printf( " pSibLeft = 0x%p\n", pnode->pSibLeft );
  331. Printf( " pSibRight = 0x%p\n", pnode->pSibRight );
  332. Printf( " cChildren = %lu\n", pnode->cChildren );
  333. Printf( " pChildren = 0x%p\n", pnode->pChildren );
  334. Printf( " pZone = 0x%p\n", pnode->pZone );
  335. Printf( " pRRList = 0x%p\n", pnode->pRRList );
  336. Printf( " dwCompare = 0x%x\n", pnode->dwCompare );
  337. Printf( " cReferenceCount = %lu\n", pnode->cReferenceCount );
  338. Printf( " wNodeFlags = 0x%x\n", pnode->wNodeFlags );
  339. Printf( " uchAuthority = 0x%x\n", pnode->uchAuthority );
  340. Printf( " uchAccessbin = %d\n", (INT)pnode->uchAccessBin );
  341. Printf( " cchLabelLength = %d\n", (INT)pnode->cchLabelLength );
  342. Printf( " szLabel -- \n" );
  343. // JBUGBUG: this looks dubious if node bad\broken
  344. DumpBuffer(
  345. (LPVOID)RELATIVE_ADDRESS( lpVoid, pnode, pnode->szLabel ),
  346. ((INT)pnode->cchLabelLength < DNS_MAX_LABEL_LENGTH)
  347. ? (INT)pnode->cchLabelLength
  348. : DNS_MAX_LABEL_LENGTH );
  349. PopMemory( (PVOID)pnode );
  350. return TRUE;
  351. }
  352. /*+++
  353. Function : Dump_COUNT_NAME
  354. Description:
  355. Parameters :
  356. Return :
  357. Remarks : none.
  358. ---*/
  359. DECLARE_DUMPFUNCTION( Dump_COUNT_NAME)
  360. {
  361. Printf( "COUNT_NAME(0x%p):\n", lpVoid );
  362. if ( !lpVoid )
  363. {
  364. Printf( "Cannot process [%p] pointer\n", lpVoid );
  365. return FALSE;
  366. }
  367. //
  368. // print count name
  369. //
  370. PCOUNT_NAME pname = (PCOUNT_NAME) PushMemory( lpVoid, sizeof(COUNT_NAME) );
  371. Printf( " Length = %d\n", pname->Length );
  372. Printf( " LabelCount = %d\n", pname->LabelCount );
  373. Printf( " RawName -- \n" );
  374. DumpBuffer(
  375. (LPVOID)RELATIVE_ADDRESS(lpVoid, pname, pname->RawName),
  376. pname->Length > DNS_MAX_NAME_LENGTH
  377. ? DNS_MAX_NAME_LENGTH
  378. : pname->Length );
  379. PopMemory( (PVOID)pname );
  380. return TRUE;
  381. }
  382. /*+++
  383. Function : Dump_ZONE_INFO
  384. Description:
  385. Parameters :
  386. Return :
  387. Remarks : none.
  388. ---*/
  389. DECLARE_DUMPFUNCTION( Dump_ZONE_INFO )
  390. {
  391. Printf( "ZONE_INFO(0x%p):\n", lpVoid );
  392. if ( !lpVoid )
  393. {
  394. Printf( "Cannot process [%p] pointer\n", lpVoid );
  395. return FALSE;
  396. }
  397. //
  398. // print structure
  399. //
  400. PZONE_INFO pzone = (PZONE_INFO) PushMemory( lpVoid, sizeof(ZONE_INFO) );
  401. Printf( " ListEntry = [Flink=%p, Blink=%p]\n",
  402. pzone->ListEntry.Flink,
  403. pzone->ListEntry.Blink );
  404. Printf( " pszZoneName = %p\n", pzone->pszZoneName );
  405. Printf( " pwsZoneName = %p\n", pzone->pwsZoneName );
  406. Printf( " pCountName = %p\n", pzone->pCountName );
  407. Printf( " pZoneRoot = %p\n", pzone->pZoneRoot );
  408. Printf( " pTreeRoot = %p\n", pzone->pTreeRoot );
  409. Printf( " pZoneTreeLink = %p\n", pzone->pZoneTreeLink );
  410. Printf( " pLoadZoneRoot = %p\n", pzone->pLoadZoneRoot );
  411. Printf( " pLoadTreeRoot = %p\n", pzone->pLoadTreeRoot );
  412. Printf( " pLoadOrigin = %p\n", pzone->pLoadOrigin );
  413. Printf( " pOldTree = %p\n", pzone->pOldTree );
  414. Printf( " ---\n" );
  415. Printf( " pszDataFile = %p\n", pzone->pszDataFile );
  416. Printf( " pwzDataFile = %p\n", pzone->pwsDataFile );
  417. Printf( " pDelayedUpdateList = %p\n", pzone->pDelayedUpdateList );
  418. Printf( " pLockTable = %p\n", pzone->pLockTable );
  419. Printf( " pSoaRR = %p\n", pzone->pSoaRR );
  420. Printf( " pWinsRR = %p\n", pzone->pWinsRR );
  421. Printf( " pLocalWInsRR = %p\n", pzone->pLocalWinsRR );
  422. Printf( " pSD = %p\n", pzone->pSD );
  423. Printf( " ---\n" );
  424. Printf( " fZoneType = %d\n", pzone->fZoneType );
  425. Printf( " fDsIntegrated = %s\n", pzone->fDsIntegrated ? "TRUE" : "FALSE" );
  426. Printf( " fAllowUpdate = %d\n", pzone->fAllowUpdate );
  427. Printf( " iRRCount = %d\n", pzone->iRRCount );
  428. Printf( " ---\n" );
  429. Printf( " ipReverse = 0x%x\n", pzone->ipReverse );
  430. Printf( " ipReverseMask = 0x%x\n", pzone->ipReverseMask );
  431. Printf( " dwSerialNo = %lu\n", pzone->dwSerialNo );
  432. Printf( " dwLoadSerialNo = %lu\n", pzone->dwLoadSerialNo );
  433. Printf( " dwLastXfrSerialNo = %lu\n", pzone->dwLastXfrSerialNo );
  434. Printf( " dwNewSerialNo = %lu\n", pzone->dwNewSerialNo );
  435. Printf( " dwDefaultTtl = 0x%x\n", pzone->dwDefaultTtl );
  436. Printf( " dwDefTtlHostOrder = %lu\n", pzone->dwDefaultTtlHostOrder );
  437. Printf( " ---\n" );
  438. Printf( " Master Info:\n" );
  439. Printf( " aipSecondaries = %p\n", pzone->aipSecondaries );
  440. Printf( " aipNotify = %p\n", pzone->aipNotify );
  441. Printf( " aipNameServers = %p\n", pzone->aipNameServers );
  442. Printf( " ---\n" );
  443. Printf( " Primary Info:\n" );
  444. Printf( " pwzLogFile = %p\n", pzone->pwsLogFile );
  445. Printf( " hfileUpdateLog = 0x%x\n", pzone->hfileUpdateLog );
  446. Printf( " iUpdateLogCount = %d\n", pzone->iUpdateLogCount );
  447. Printf( " bAging = %s\n", pzone->bAging ? "TRUE" : "FALSE" );
  448. Printf( " dwNoRefreshInterval = %lu\n", pzone->dwNoRefreshInterval );
  449. Printf( " dwRefreshInterval = %lu\n", pzone->dwRefreshInterval );
  450. Printf( " dwRefreshTime = %lu\n", pzone->dwRefreshTime );
  451. Printf( " dwAgingEnabledTime = %lu\n", pzone->dwAgingEnabledTime );
  452. Printf( " aipScavengeServers = %p\n", pzone->aipScavengeServers );
  453. Printf( " DS Primary Info:\n" );
  454. Printf( " pwsZoneDN = %p\n", pzone->pwszZoneDN );
  455. // FIXME
  456. Printf( " llSecureUpdateTime = %p\n", pzone->llSecureUpdateTime );
  457. Printf( " fDsRelaod = %s\n", pzone->fDsReload ? "TRUE" : "FALSE" );
  458. Printf( " fInDsWrite = %s\n", pzone->fInDsWrite ? "TRUE" : "FALSE" );
  459. Printf( " ucDsRecordVersion = %d\n", pzone->ucDsRecordVersion );
  460. Printf( " fLogUpdates = %d\n", pzone->fLogUpdates ? "TRUE" : "FALSE" );
  461. Printf( " szLastUsn = %p\n", RELATIVE_ADDRESS(lpVoid, pzone, pzone->szLastUsn) );
  462. Printf( " ---\n" );
  463. Printf( " Secondary Info:\n" );
  464. Printf( " aipMasters = %p\n", pzone->aipMasters );
  465. // Printf( " MasterInfoArray = %p\n", pzone->MasterInfoArray );
  466. Printf( " pszMasterIpString = %p\n", pzone->pszMasterIpString );
  467. Printf( " ipPrimary = 0x%x\n", pzone->ipPrimary );
  468. Printf( " ipNotifier = 0x%x\n", pzone->ipNotifier );
  469. Printf( " ipFreshMaster = 0x%x\n", pzone->ipFreshMaster );
  470. Printf( " ipXfrBind = 0x%x\n", pzone->ipXfrBind );
  471. Printf( " ipLastAxfrMaster = 0x%x\n", pzone->ipLastAxfrMaster );
  472. Printf( " dwLastSoaCheckTime = %d\n", pzone->dwLastSoaCheckTime );
  473. Printf( " dwNextSoaCheckTime = %d\n", pzone->dwNextSoaCheckTime );
  474. Printf( " dwExpireTime = %d\n", pzone->dwExpireTime );
  475. Printf( " dwZoneRecvStartTime = %d\n", pzone->dwZoneRecvStartTime );
  476. Printf( " dwBadMasterCount = %d\n", pzone->dwBadMasterCount );
  477. Printf( " dwNextTranserTime = %d\n", pzone->dwNextTransferTime );
  478. Printf( " fStale = %s\n", pzone->fStale ? "TRUE" : "FALSE" );
  479. Printf( " fNotified = %s\n", pzone->fNotified ? "TRUE" : "FALSE" );
  480. Printf( " fNeedAxfr = %s\n", pzone->fNeedAxfr ? "TRUE" : "FALSE" );
  481. Printf( " fSkipIxfr = %s\n", pzone->fSkipIxfr ? "TRUE" : "FALSE" );
  482. Printf( " fSlowRetry = %s\n", pzone->fSlowRetry ? "TRUE" : "FALSE" );
  483. Printf( " cIxfrAttempts = %d\n", (INT)pzone->cIxfrAttempts );
  484. Printf( " fEmpty = %s\n", pzone->fEmpty ? "TRUE" : "FALSE" );
  485. Printf( " ---\n" );
  486. Printf( " Locking:\n" );
  487. Printf( " dwLockingThreadId = 0x%x\n", pzone->dwLockingThreadId );
  488. Printf( " fLocked = %d\n", (INT)pzone->fLocked );
  489. Printf( " fUpdateLock = %d\n", pzone->fUpdateLock );
  490. Printf( " fXfrRecvLock = %d\n", pzone->fXfrRecvLock );
  491. Printf( " fFileWriteLock = %d\n", pzone->fFileWriteLock );
  492. Printf( " ---\n" );
  493. Printf( " Flags:\n" );
  494. Printf( " cZoneNameLabelCount = %d\n", (INT)pzone->cZoneNameLabelCount );
  495. Printf( " fReverse = %s\n", pzone->fReverse ? "TRUE" : "FALSE" );
  496. Printf( " fAutoCreated = %s\n", pzone->fAutoCreated ? "TRUE" : "FALSE" );
  497. Printf( " fSecureSecondaries = %d\n", pzone->fSecureSecondaries );
  498. Printf( " fNotifyLevel = %d\n", pzone->fNotifyLevel );
  499. Printf( " fPaused = %s\n", pzone->fPaused ? "TRUE" : "FALSE" );
  500. Printf( " fShutdown = %s\n", pzone->fShutdown ? "TRUE" : "FALSE" );
  501. Printf( " fDirty = %s\n", pzone->fDirty ? "TRUE" : "FALSE" );
  502. Printf( " fRootDirty = %s\n", pzone->fRootDirty ? "TRUE" : "FALSE" );
  503. Printf( " fLocalWins = %s\n", pzone->fLocalWins ? "TRUE" : "FALSE" );
  504. Printf( " ---\n" );
  505. Printf( " UpdateList = %p\n", pzone->UpdateList );
  506. PopMemory( (PVOID)pzone );
  507. return TRUE;
  508. }
  509. /*+++
  510. Function : Dump_DB_RECORD
  511. Description:
  512. Parameters :
  513. Return :
  514. Remarks : none.
  515. ---*/
  516. DECLARE_DUMPFUNCTION( Dump_DB_RECORD)
  517. {
  518. Printf( "DB_RECORD(0x%p):\n", lpVoid );
  519. if ( !lpVoid )
  520. {
  521. Printf( "Cannot process [%p] pointer\n", lpVoid );
  522. return FALSE;
  523. }
  524. //
  525. // print record
  526. //
  527. PDB_RECORD prr = (PDB_RECORD) PushMemory( lpVoid, sizeof(DB_RECORD) );
  528. Printf( " pRRNext = 0x%p\n", prr->pRRNext );
  529. Printf( " RecordRank = %d\n", prr->RecordRank );
  530. Printf( " Reserved = 0x%x\n", (BYTE)( prr->Reserved.Source|
  531. prr->Reserved.Reserved|
  532. prr->Reserved.StandardAlloc) );
  533. Printf( " wRRFlags = 0x%x\n", prr->wRRFlags );
  534. Printf( " wType = 0x%x\n", prr->wType );
  535. Printf( " wDataLength = 0x%x\n", prr->wDataLength );
  536. Printf( " dwTtlSeconds = 0x%x\n", prr->dwTtlSeconds );
  537. Printf( " dwTimeStamp = %lu\n", prr->dwTimeStamp );
  538. Printf( " Data ---" );
  539. switch (prr->wType) {
  540. case DNS_TYPE_A:
  541. Printf( " (DNS_TYPE_A):\n" );
  542. Printf( " IpAddr = 0x%x\n", (DWORD)prr->Data.A.ipAddress );
  543. break;
  544. case DNS_TYPE_AAAA:
  545. Printf( " (DNS_TYPE_AAAA):\n" );
  546. Printf( " IP6Addr = [%x:%x:%x:%x;%x;%x;%x;%x]\n",
  547. prr->Data.AAAA.Ip6Addr.IP6Word[0],
  548. prr->Data.AAAA.Ip6Addr.IP6Word[1],
  549. prr->Data.AAAA.Ip6Addr.IP6Word[2],
  550. prr->Data.AAAA.Ip6Addr.IP6Word[3],
  551. prr->Data.AAAA.Ip6Addr.IP6Word[4],
  552. prr->Data.AAAA.Ip6Addr.IP6Word[5],
  553. prr->Data.AAAA.Ip6Addr.IP6Word[6],
  554. prr->Data.AAAA.Ip6Addr.IP6Word[7] );
  555. break;
  556. case DNS_TYPE_SOA:
  557. Printf( " (DNS_TYPE_SOA):\n" );
  558. Dump_Record_SOA( (LPVOID)&(prr->Data.SOA) );
  559. break;
  560. case DNS_TYPE_PTR:
  561. Printf( " (DNS_TYPE_PTR):\n" );
  562. Printf( " nameTarget = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.PTR.nameTarget) );
  563. break;
  564. case DNS_TYPE_NS:
  565. Printf( " (DNS_TYPE_NS):\n" );
  566. Printf( " nameTarget = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.NS.nameTarget) );
  567. break;
  568. case DNS_TYPE_CNAME:
  569. Printf( " (DNS_TYPE_CNAME):\n" );
  570. Printf( " nameTarget = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.CNAME.nameTarget) );
  571. break;
  572. case DNS_TYPE_MB:
  573. Printf( " (DNS_TYPE_MB):\n" );
  574. Printf( " nameTarget = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.MB.nameTarget) );
  575. break;
  576. case DNS_TYPE_MD:
  577. Printf( " (DNS_TYPE_MD):\n" );
  578. Printf( " nameTarget = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.MD.nameTarget) );
  579. break;
  580. case DNS_TYPE_MF:
  581. Printf( " (DNS_TYPE_MF):\n" );
  582. Printf( " nameTarget = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.MF.nameTarget) );
  583. break;
  584. case DNS_TYPE_MG:
  585. Printf( " (DNS_TYPE_MG):\n" );
  586. Printf( " nameTarget = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.MG.nameTarget) );
  587. break;
  588. case DNS_TYPE_MR:
  589. Printf( " (DNS_TYPE_MR):\n" );
  590. Printf( " nameTarget = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.MR.nameTarget) );
  591. break;
  592. case DNS_TYPE_MINFO:
  593. Printf( " (DNS_TYPE_MINFO):\n" );
  594. Printf( " nameMailbox = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.MINFO.nameMailbox) );
  595. break;
  596. case DNS_TYPE_RP:
  597. Printf( " (DNS_TYPE_RP):\n" );
  598. Printf( " nameMailbox = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.RP.nameMailbox) );
  599. break;
  600. case DNS_TYPE_MX:
  601. Printf( " (DNS_TYPE_MX):\n" );
  602. Printf( " wPreference = 0x%x\n", prr->Data.MX.wPreference );
  603. Printf( " nameExchange = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.MX.nameExchange) );
  604. break;
  605. case DNS_TYPE_AFSDB:
  606. Printf( " (DNS_TYPE_AFSDB):\n" );
  607. Printf( " wPreference = 0x%x\n", prr->Data.AFSDB.wPreference );
  608. Printf( " nameExchange = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.AFSDB.nameExchange) );
  609. break;
  610. case DNS_TYPE_RT:
  611. Printf( " (DNS_TYPE_RT):\n" );
  612. Printf( " wPreference = 0x%x\n", prr->Data.RT.wPreference );
  613. Printf( " nameExchange = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.RT.nameExchange) );
  614. break;
  615. case DNS_TYPE_HINFO:
  616. Printf( " (DNS_TYPE_HINFO):\n" );
  617. Printf( " chData = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, prr->Data.HINFO.chData) );
  618. break;
  619. case DNS_TYPE_ISDN:
  620. Printf( " (DNS_TYPE_ISDN):\n" );
  621. Printf( " chData = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, prr->Data.ISDN.chData) );
  622. break;
  623. case DNS_TYPE_TEXT:
  624. Printf( " (DNS_TYPE_TEXT):\n" );
  625. Printf( " chData = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, prr->Data.TXT.chData) );
  626. break;
  627. case DNS_TYPE_NULL:
  628. Printf( " (DNS_TYPE_NULL):\n" );
  629. Printf( " chData = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, prr->Data.Null.chData) );
  630. break;
  631. case DNS_TYPE_WKS:
  632. Printf( " (DNS_TYPE_WKS):\n" );
  633. Printf( " ipAddress = 0x%x\n", prr->Data.WKS.ipAddress );
  634. Printf( " chProtocol = 0x%x\n", prr->Data.WKS.chProtocol );
  635. Printf( " bBitMask = @ 0x%p\n", RELATIVE_ADDRESS(lpVoid, prr, prr->Data.WKS.bBitMask) );
  636. break;
  637. case DNS_TYPE_SIG:
  638. Printf( " (DNS_TYPE_SIG):\n" );
  639. Printf( " nameSigner = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.SIG.nameSigner) );
  640. Printf( " wTypeCovered = 0x%x\n", prr->Data.SIG.wTypeCovered );
  641. Printf( " chAlgorithm = 0x%x\n", prr->Data.SIG.chAlgorithm );
  642. Printf( " chLabelCount = 0x%x\n", prr->Data.SIG.chLabelCount );
  643. Printf( " dwOriginalTtl = 0x%x\n", prr->Data.SIG.dwOriginalTtl );
  644. Printf( " dwSigExpiration = 0x%x\n", prr->Data.SIG.dwSigExpiration );
  645. Printf( " dwSigInception = 0x%x\n", prr->Data.SIG.dwSigInception );
  646. Printf( " wKeyTag = 0x%x\n", prr->Data.SIG.wKeyTag );
  647. Printf( " Signature = 0x%p\n", RELATIVE_ADDRESS(lpVoid, prr,
  648. ( PBYTE ) &prr->Data.SIG.nameSigner +
  649. DBASE_NAME_SIZE( &prr->Data.SIG.nameSigner ) ) );
  650. break;
  651. case DNS_TYPE_KEY:
  652. Printf( " (DNS_TYPE_KEY):\n" );
  653. Printf( " wFlags = 0x%x\n", prr->Data.KEY.wFlags );
  654. Printf( " chProtocol = 0x%x\n", prr->Data.KEY.chProtocol );
  655. Printf( " chAlgorithm = 0x%x\n", prr->Data.KEY.chAlgorithm );
  656. Printf( " Key = 0x%p\n", RELATIVE_ADDRESS(lpVoid, prr, prr->Data.KEY.Key) );
  657. break;
  658. case DNS_TYPE_LOC:
  659. Printf( " (DNS_TYPE_LOC):\n" );
  660. Printf( " wVersion = 0x%x\n", prr->Data.LOC.wVersion );
  661. Printf( " wSize = 0x%x\n", prr->Data.LOC.wSize );
  662. Printf( " wHorPrec = 0x%x\n", prr->Data.LOC.wHorPrec );
  663. Printf( " wVerPrec = 0x%x\n", prr->Data.LOC.wVerPrec );
  664. Printf( " dwLatitude = 0x%x\n", prr->Data.LOC.dwLatitude );
  665. Printf( " dwLongitude = 0x%x\n", prr->Data.LOC.dwLongitude );
  666. Printf( " dwAltitude = 0x%x\n", prr->Data.LOC.dwAltitude );
  667. break;
  668. case DNS_TYPE_NXT:
  669. Printf( " (DNS_TYPE_NXT):\n" );
  670. Printf( " nameNext = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.NXT.nameNext) );
  671. Printf( " bTypeBitMap = @ 0x%p\n", RELATIVE_ADDRESS(lpVoid, prr, prr->Data.NXT.bTypeBitMap) );
  672. break;
  673. case DNS_TYPE_SRV:
  674. Printf( " (DNS_TYPE_SRV):\n" );
  675. Printf( " wPriority = 0x%x\n", prr->Data.SRV.wPriority );
  676. Printf( " wWeight = 0x%x\n", prr->Data.SRV.wWeight );
  677. Printf( " wPort = 0x%x\n", prr->Data.SRV.wPort );
  678. Printf( " nameTarget = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.SRV.nameTarget) );
  679. break;
  680. case DNS_TYPE_TSIG:
  681. Printf( " (DNS_TYPE_TSIG):\n" );
  682. Printf( " dwTimeSigned = 0x%x\n", prr->Data.TSIG.dwTimeSigned );
  683. Printf( " dwTimeExpire = 0x%x\n", prr->Data.TSIG.dwTimeExpire );
  684. Printf( " wSigLength = 0x%x\n", prr->Data.TSIG.wSigLength );
  685. Printf( " bSignature = @ 0x%x\n", RELATIVE_ADDRESS(lpVoid, prr, prr->Data.TSIG.bSignature) );
  686. Printf( " nameAlgorithm = @ 0x%p\n", RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.TSIG.nameAlgorithm) );
  687. break;
  688. case DNS_TYPE_TKEY:
  689. Printf( " (DNS_TYPE_TKEY):\n" );
  690. Printf( " wKeyLength = 0x%x\n", prr->Data.TKEY.wKeyLength );
  691. Printf( " bKey = @ 0x%p\n", RELATIVE_ADDRESS(lpVoid, prr, prr->Data.TKEY.bKey) );
  692. break;
  693. case DNS_TYPE_WINS:
  694. Printf( " (DNS_TYPE_WINS):\n" );
  695. Printf( " dwMappingFlag = 0x%x\n", prr->Data.WINS.dwMappingFlag );
  696. Printf( " dwLookupTimeout = 0x%x\n", prr->Data.WINS.dwLookupTimeout );
  697. Printf( " dwCacheTimeout = 0x%x\n", prr->Data.WINS.dwCacheTimeout );
  698. Printf( " cWinsServerCount = 0x%x\n", prr->Data.WINS.cWinsServerCount );
  699. Printf( " aipWinsServers = 0x%x\n", prr->Data.WINS.aipWinsServers );
  700. break;
  701. case DNS_TYPE_WINSR:
  702. Printf( " (DNS_TYPE_WINSR):\n" );
  703. Printf( " dwMappingFlag = 0x%x\n", prr->Data.WINSR.dwMappingFlag );
  704. Printf( " dwLookupTimeout = 0x%x\n", prr->Data.WINSR.dwLookupTimeout );
  705. Printf( " dwCacheTimeout = 0x%x\n", prr->Data.WINSR.dwCacheTimeout );
  706. Printf( " nameResultDomain = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, prr, &prr->Data.WINSR.nameResultDomain) );
  707. break;
  708. default:
  709. Printf( "\n Error: Unknown wType value (0x%x).\n", prr->wType );
  710. }
  711. PopMemory( (PVOID)prr );
  712. return TRUE;
  713. }
  714. /*+++
  715. Function : Dump_IP_ARRAY
  716. Description:
  717. Parameters :
  718. Return :
  719. Remarks : none.
  720. ---*/
  721. DECLARE_DUMPFUNCTION( Dump_IP_ARRAY)
  722. {
  723. Printf( "IP_ARRAY(0x%p):\n", lpVoid );
  724. if ( !lpVoid )
  725. {
  726. Printf( "Cannot process [%p] pointer\n", lpVoid );
  727. return FALSE;
  728. }
  729. //
  730. // print structure
  731. //
  732. PIP_ARRAY pIp = (PIP_ARRAY) PushMemory( lpVoid, sizeof(IP_ARRAY) );
  733. INT iMax= pIp->AddrCount > MAX_TINY_LIST ? MAX_TINY_LIST : (INT)pIp->AddrCount;
  734. Printf( " AddrCount = 0x%x\n", pIp->AddrCount );
  735. PIP_ADDRESS addr = (PIP_ADDRESS) PushMemory( (LPVOID)RELATIVE_ADDRESS(lpVoid, pIp, pIp->AddrArray), sizeof(IP_ADDRESS)*iMax );
  736. for(INT i=0; i< iMax; i++){
  737. Printf( " AddrArray[%2d] = 0x%x\n", addr[i] );
  738. }
  739. PopMemory( (PVOID)addr );
  740. if(pIp->AddrCount > MAX_TINY_LIST){
  741. Printf( " (truncated)...\n" );
  742. }
  743. PopMemory( (PVOID)pIp );
  744. return TRUE;
  745. }
  746. /*+++
  747. Function : Dump_LOCK_TABLE
  748. Description:
  749. Parameters :
  750. Return :
  751. Remarks : none.
  752. ---*/
  753. DECLARE_DUMPFUNCTION( Dump_LOCK_TABLE)
  754. {
  755. Printf( "LOCK_TABLE(0x%p):\n", lpVoid );
  756. if ( !lpVoid )
  757. {
  758. Printf( "Cannot process [%p] pointer\n", lpVoid );
  759. return FALSE;
  760. }
  761. //
  762. // print structure
  763. //
  764. PLOCK_TABLE ptab = (PLOCK_TABLE) PushMemory( lpVoid, sizeof(LOCK_TABLE) );;
  765. Printf( " pszName = 0x%p\n", ptab );
  766. Printf( " FailuresSinceLockFree = 0x%x\n", ptab->FailuresSinceLockFree );
  767. Printf( " LastFreeLockTime = 0x%x\n", ptab->LastFreeLockTime );
  768. Printf( " Index = 0x%x\n", ptab->Index );
  769. Printf( " OffenderLock = 0x%p\n", ptab->OffenderLock );
  770. Printf( " LockHistory = 0x%p\n", (LPVOID)RELATIVE_ADDRESS(lpVoid, ptab, ptab->LockHistory) );
  771. PopMemory( (PVOID)ptab );
  772. return TRUE;
  773. }
  774. /*+++
  775. Function : Dump_LOCK_ENTRY
  776. Description:
  777. Parameters :
  778. Return :
  779. Remarks : none.
  780. ---*/
  781. DECLARE_DUMPFUNCTION( Dump_LOCK_ENTRY)
  782. {
  783. Printf( "LOCK_ENTRY(0x%p):\n", lpVoid );
  784. if ( !lpVoid )
  785. {
  786. Printf( "Cannot process [%p] pointer\n", lpVoid );
  787. return FALSE;
  788. }
  789. PLOCK_ENTRY pe = (PLOCK_ENTRY) PushMemory( lpVoid, sizeof(LOCK_ENTRY) );
  790. Printf( " Count = %ld\n", pe->Count );
  791. Printf( " ThreadId = 0x%x\n", pe->ThreadId );
  792. Printf( " File = 0x%p\n", pe );
  793. Printf( " Line = %lu\n", pe->Line );
  794. PopMemory( (PVOID)pe );
  795. return TRUE;
  796. }
  797. /*+++
  798. Function : Dump_UPDATE
  799. Description:
  800. Parameters :
  801. Return :
  802. Remarks : none.
  803. ---*/
  804. DECLARE_DUMPFUNCTION( Dump_UPDATE)
  805. {
  806. Printf( "UPDATE(0x%p):\n", lpVoid );
  807. if ( !lpVoid )
  808. {
  809. Printf( "Cannot process [%p] pointer\n", lpVoid );
  810. return FALSE;
  811. }
  812. //
  813. // print structure
  814. //
  815. PUPDATE p = (PUPDATE) PushMemory( lpVoid, sizeof(UPDATE) );
  816. Printf( " pNext = 0x%x\n", p->pNext );
  817. Printf( " pNode = 0x%p\n", p->pNode );
  818. Printf( " pAddRR = 0x%p\n", p->pAddRR );
  819. Printf( " pDeleteRR =0x%p\n", p->pDeleteRR );
  820. Printf( " dwVersion = 0x%x\n", p->dwVersion );
  821. Printf( " wDeleteType = 0x%x\n", p->wDeleteType );
  822. Printf( " wAddType = 0x%x\n", p->wAddType );
  823. PopMemory( (PVOID)p );
  824. return TRUE;
  825. }
  826. /*+++
  827. Function : Dump_UPDATE_LIST
  828. Description:
  829. Parameters :
  830. Return :
  831. Remarks : none.
  832. ---*/
  833. DECLARE_DUMPFUNCTION( Dump_UPDATE_LIST)
  834. {
  835. Printf( "UPDATE_LIST(0x%p):\n", lpVoid );
  836. if ( !lpVoid )
  837. {
  838. Printf( "Cannot process [%p] pointer\n", lpVoid );
  839. return FALSE;
  840. }
  841. PUPDATE_LIST p = (PUPDATE_LIST) PushMemory( lpVoid, sizeof(UPDATE_LIST) );
  842. Printf( " pListHead = 0x%p\n", p->pListHead );
  843. Printf( " pCurrent = 0x%p\n", p->pCurrent );
  844. Printf( " pTempNodeList = 0x%p\n", p->pTempNodeList );
  845. Printf( " pNodeFailed = 0x%p\n", p->pNodeFailed );
  846. Printf( " pMsg = 0x%x\n", p->pMsg );
  847. Printf( " Flag = 0x%x\n", p->Flag );
  848. Printf( " dwCount = 0x%x\n", p->dwCount );
  849. Printf( " dwStartVersion = 0x%x\n", p->dwStartVersion );
  850. Printf( " dwHighDsVersion = 0x%x\n", p->dwHighDsVersion );
  851. PopMemory( (PVOID)p );
  852. return TRUE;
  853. }
  854. /*+++
  855. Function : Dump_DNS_WIRE_QUESTION
  856. Description:
  857. Parameters :
  858. Return :
  859. Remarks : none.
  860. ---*/
  861. DECLARE_DUMPFUNCTION( Dump_DNS_WIRE_QUESTION)
  862. {
  863. Printf( "DNS_WIRE_QUESTION(0x%p):\n", lpVoid );
  864. if ( !lpVoid )
  865. {
  866. Printf( "Cannot process [%p] pointer\n", lpVoid );
  867. return FALSE;
  868. }
  869. PDNS_WIRE_QUESTION p = (PDNS_WIRE_QUESTION) PushMemory( lpVoid, sizeof(DNS_WIRE_QUESTION) );
  870. Printf( " QuestionType = 0x%x\n", p->QuestionType );
  871. Printf( " QuestionClass = 0x%x\n", p->QuestionClass );
  872. PopMemory( (PVOID)p );
  873. return TRUE;
  874. }
  875. /*+++
  876. Function : Dump_DNS_HEADER
  877. Description: dumps sockaddr structure
  878. Parameters :
  879. Return :
  880. Remarks : none.
  881. ---*/
  882. DECLARE_DUMPFUNCTION( Dump_DNS_HEADER)
  883. {
  884. Printf( "DNS_HEADER(0x%p):\n", lpVoid );
  885. if ( !lpVoid )
  886. {
  887. Printf( "Cannot process [%p] pointer\n", lpVoid );
  888. return FALSE;
  889. }
  890. PDNS_HEADER p = (PDNS_HEADER) PushMemory( lpVoid, sizeof(DNS_HEADER) );
  891. Printf( " Xid = 0x%x\n", p->Xid );
  892. Printf( " RecursionDesired = 0x%x\n", p->RecursionDesired );
  893. Printf( " Truncation = 0x%x\n", p->Truncation );
  894. Printf( " Authoritative = 0x%x\n", p->Authoritative );
  895. Printf( " Opcode = 0x%x\n", p->Opcode );
  896. Printf( " IsResponse = 0x%x\n", p->IsResponse );
  897. Printf( " ResponseCode = 0x%x\n", p->ResponseCode );
  898. Printf( " Reserved = 0x%x\n", p->Reserved );
  899. Printf( " RecursionAvailable = 0x%x\n", p->RecursionAvailable );
  900. Printf( " QuestionCount = 0x%x\n", p->QuestionCount );
  901. Printf( " AnswerCount = 0x%x\n", p->AnswerCount );
  902. Printf( " NameServerCount = 0x%x\n", p->NameServerCount );
  903. Printf( " AdditionalCount = 0x%x\n", p->AdditionalCount );
  904. PopMemory( (PVOID)p );
  905. return TRUE;
  906. }
  907. /*+++
  908. Function : HEAP_HEADER
  909. Description: dumps out additional message info
  910. Parameters :
  911. Return :
  912. Remarks : none.
  913. ---*/
  914. DECLARE_DUMPFUNCTION( Dump_HEAP_HEADER)
  915. {
  916. // from heapdbg.h
  917. #define HEAP_HEADER_FILE_SIZE (16)
  918. struct _HEAP_HEADER
  919. {
  920. //
  921. // Note, if move or add fields, MUST update list entry offset below
  922. //
  923. ULONG HeapCodeBegin;
  924. ULONG AllocCount;
  925. ULONG RequestSize;
  926. ULONG AllocSize;
  927. //
  928. // Put LIST_ENTRY in middle of header
  929. // - keep begin code at front
  930. // - less likely to be corrupted
  931. //
  932. LIST_ENTRY ListEntry;
  933. DWORD AllocTime;
  934. DWORD LineNo;
  935. CHAR FileName[ HEAP_HEADER_FILE_SIZE ];
  936. ULONG TotalAlloc;
  937. ULONG CurrentAlloc;
  938. ULONG FreeCount;
  939. ULONG CurrentAllocCount;
  940. ULONG HeapCodeEnd;
  941. };
  942. Printf( "HEAP_HEADER(0x%p):\n", lpVoid );
  943. if ( !lpVoid )
  944. {
  945. Printf( "Cannot process [%p] pointer\n", lpVoid );
  946. return FALSE;
  947. }
  948. _HEAP_HEADER *p = (_HEAP_HEADER*) PushMemory( lpVoid, sizeof(_HEAP_HEADER) );
  949. Printf( " HeapCodeBegin = 0x%x\n", p->HeapCodeBegin );
  950. Printf( " AllocCount = 0x%x\n", p->AllocCount );
  951. Printf( " RequestSize = 0x%x\n", p->RequestSize );
  952. Printf( " AllocSize = 0x%x\n", p->AllocSize );
  953. //
  954. // Put LIST_ENTRY in middle of header
  955. // - keep begin code at front
  956. // - less likely to be corrupted
  957. //
  958. Printf( " ListEntry = 0x%x\n", p->ListEntry );
  959. Printf( " AllocTime = 0x%x\n", p->AllocTime );
  960. Printf( " LineNo = %lu\n", p->LineNo );
  961. Printf( " FileName -- \n", p->FileName );
  962. DumpBuffer((LPVOID)RELATIVE_ADDRESS(lpVoid, p, p->FileName), HEAP_HEADER_FILE_SIZE );
  963. Printf( " TotalAlloc = 0x%x\n", p->TotalAlloc );
  964. Printf( " CurrentAlloc = 0x%x\n", p->CurrentAlloc );
  965. Printf( " FreeCount = 0x%x\n", p->FreeCount );
  966. Printf( " CurrentAllocCount = 0x%x\n", p->CurrentAllocCount );
  967. Printf( " HeapCodeEnd = 0x%x\n", p->HeapCodeEnd );
  968. PopMemory( (PVOID)p );
  969. return TRUE;
  970. }
  971. /*+++
  972. Function : Dump_Record_SOA
  973. Description:
  974. Parameters :
  975. Return :
  976. Remarks : none.
  977. ---*/
  978. DECLARE_DUMPFUNCTION( Dump_LOOKUP_NAME){
  979. Printf( "LOOKUP_NAME(0x%p):\n", lpVoid );
  980. if ( !lpVoid )
  981. {
  982. Printf( "Cannot process [%p] pointer\n", lpVoid );
  983. return FALSE;
  984. }
  985. PLOOKUP_NAME p = (PLOOKUP_NAME) PushMemory( lpVoid, sizeof(LOOKUP_NAME) );
  986. Printf( " cLabelCount = %d\n", p->cLabelCount );
  987. Printf( " cchNameLength = %d\n", p->cchNameLength );
  988. Printf( " pchLabelArray --\n" );
  989. // if cLableCountis bad, forget about it.
  990. INT iMax;
  991. iMax = p->cLabelCount < DNS_MAX_NAME_LABELS ? p->cLabelCount : 0;
  992. INT i;
  993. for(i=0;i<iMax;i++)
  994. {
  995. Printf( " [%d] 0x%p\n", i, p->pchLabelArray[i] );
  996. }
  997. Printf( " cchLabelArray -- \n" );
  998. iMax = p->cchNameLength < DNS_MAX_NAME_LABELS ? p->cchNameLength : DNS_MAX_NAME_LABELS;
  999. DumpBuffer((LPVOID)RELATIVE_ADDRESS(lpVoid, p, p->cchLabelArray), iMax );
  1000. PopMemory( (PVOID)p );
  1001. return TRUE;
  1002. }
  1003. /*+++
  1004. Function : Dump_SID
  1005. Description:
  1006. Parameters :
  1007. Return :
  1008. Remarks : none.
  1009. ---*/
  1010. DECLARE_DUMPFUNCTION( Dump_SID)
  1011. {
  1012. #define MAX_SID_STR_LENGTH 1024
  1013. Printf( "SID(0x%p):\n", lpVoid );
  1014. if ( !lpVoid )
  1015. {
  1016. Printf( "Cannot process [%p] pointer\n", lpVoid );
  1017. return FALSE;
  1018. }
  1019. PSID pSid = (PSID) PushMemory( lpVoid, sizeof(SID) );
  1020. CHAR szSid [ MAX_SID_STR_LENGTH ];
  1021. DWORD cbSid = GetLengthSid(pSid );
  1022. if ( !cbSid ||
  1023. !IsValidSid(pSid) )
  1024. {
  1025. Printf( "Formatting aborted. Invalid SID\n" );
  1026. }
  1027. else
  1028. {
  1029. CHAR buffer[ 1024 ];
  1030. UCHAR authCount = *GetSidSubAuthorityCount(pSid );
  1031. strcpy ( szSid, "S-" );
  1032. for (INT i=0; i<(INT)authCount; i++)
  1033. {
  1034. DWORD dwAuth = *GetSidSubAuthority(pSid,
  1035. i );
  1036. sprintf( buffer, "%X", dwAuth );
  1037. if ( strlen(szSid) + strlen(buffer) > MAX_SID_STR_LENGTH - 5 )
  1038. {
  1039. strcat ( szSid, "..." );
  1040. break;
  1041. }
  1042. strcat ( szSid, buffer );
  1043. if (i < (INT)authCount-1)
  1044. {
  1045. strcat ( szSid, "-" );
  1046. }
  1047. }
  1048. }
  1049. Printf ( "SID = %s\n", szSid );
  1050. PopMemory( (PVOID)pSid );
  1051. return TRUE;
  1052. #undef MAX_SID_STR_LENGTH
  1053. }
  1054. /*+++
  1055. Function : Dump_ADDITIONAL_INFO
  1056. Description: dumps out additional message info
  1057. Parameters :
  1058. Return :
  1059. Remarks : none.
  1060. ---*/
  1061. DECLARE_DUMPFUNCTION( Dump_ADDITIONAL_INFO)
  1062. {
  1063. Printf( "ADDITIONAL_INFO(0x%p):\n", lpVoid );
  1064. if ( !lpVoid )
  1065. {
  1066. Printf( "Cannot process [%p] pointer\n", lpVoid );
  1067. return FALSE;
  1068. }
  1069. if(!lpVoid){
  1070. Printf( "Cannot process [%p] pointer\n", lpVoid );
  1071. return FALSE;
  1072. }
  1073. //
  1074. // print structure
  1075. //
  1076. PADDITIONAL_INFO p = (PADDITIONAL_INFO) PushMemory( lpVoid, sizeof(ADDITIONAL_INFO) );
  1077. INT i=0, iMax=0;
  1078. Printf( " cMaxCount = 0x%x\n", p->cMaxCount );
  1079. Printf( " cCount = 0x%x\n", p->cCount );
  1080. Printf( " iIndex = 0x%x\n", p->iIndex );
  1081. iMax = p->cCount <= MAX_ADDITIONAL_RECORD_COUNT? p->cCount : MAX_ADDITIONAL_RECORD_COUNT;
  1082. PDB_NAME* pnames = (PDB_NAME*) PushMemory(
  1083. (LPVOID) RELATIVE_ADDRESS(lpVoid, p, p->pNameArray),
  1084. sizeof(PDB_NAME)*iMax );
  1085. for(i=0; i<iMax; i++){
  1086. Printf( " pNameArray[%d] = 0x%p\n", i, pnames[i] );
  1087. }
  1088. PopMemory( (PVOID)pnames );
  1089. if(i > MAX_TINY_LIST){
  1090. Printf( " (truncated)...\n" );
  1091. }
  1092. WORD* poffsets = (WORD*) PushMemory(
  1093. (LPVOID)RELATIVE_ADDRESS(lpVoid, p, p->wOffsetArray),
  1094. sizeof(WORD)*iMax );
  1095. for(i=0; i<iMax; i++){
  1096. Printf( " wOffsetArray[%d] = 0x%x\n", i, poffsets[i] );
  1097. }
  1098. PopMemory( (PVOID)poffsets );
  1099. if(i > MAX_ADDITIONAL_RECORD_COUNT){
  1100. Printf( " (truncated)...\n" );
  1101. }
  1102. PopMemory( (PVOID)p );
  1103. return TRUE;
  1104. }
  1105. /*+++
  1106. Function : Dump_COMPRESSION_INFO
  1107. Description: dumps out additional message info
  1108. Parameters :
  1109. Return :
  1110. Remarks : none.
  1111. ---*/
  1112. DECLARE_DUMPFUNCTION( Dump_COMPRESSION_INFO)
  1113. {
  1114. Printf( "COMPRESSION_INFO(0x%p):\n", lpVoid );
  1115. if ( !lpVoid )
  1116. {
  1117. Printf( "Cannot process [%p] pointer\n", lpVoid );
  1118. return FALSE;
  1119. }
  1120. if(!lpVoid){
  1121. Printf( "Cannot process [%p] pointer\n", lpVoid );
  1122. return FALSE;
  1123. }
  1124. //
  1125. // print structure
  1126. //
  1127. PCOMPRESSION_INFO p = (PCOMPRESSION_INFO) PushMemory( lpVoid, sizeof(COMPRESSION_INFO) );
  1128. INT i=0, iMax=0;
  1129. Printf( " cCount = 0x%x\n", p->cCount );
  1130. PDB_NODE* pnodes = (PDB_NODE*) PushMemory( (LPVOID)RELATIVE_ADDRESS(lpVoid, p, p->pNodeArray), sizeof(PDB_NODE)*iMax );
  1131. iMax = p->cCount <= MAX_COMPRESSION_COUNT? p->cCount : MAX_COMPRESSION_COUNT;
  1132. for(i=0; i<iMax; i++){
  1133. Printf( " pNodeArray[%d] = 0x%p\n", i, pnodes[i] );
  1134. }
  1135. PopMemory( (PVOID)pnodes );
  1136. if(i > MAX_COMPRESSION_COUNT){
  1137. Printf( " (truncated)...\n" );
  1138. }
  1139. WORD* poffsets = (WORD*) PushMemory( (LPVOID)RELATIVE_ADDRESS(lpVoid, p, p->wOffsetArray), sizeof(WORD)*iMax );
  1140. for(i=0; i<iMax; i++){
  1141. Printf( " wOffsetArray[%d] = 0x%p\n", i, poffsets[i] );
  1142. }
  1143. PopMemory( (PVOID)poffsets );
  1144. if(i > MAX_COMPRESSION_COUNT){
  1145. Printf( " (truncated)...\n" );
  1146. }
  1147. PopMemory( (PVOID)p );
  1148. return TRUE;
  1149. }
  1150. /*+++
  1151. Function : Dump_DS_SEARCH
  1152. Description:
  1153. Parameters :
  1154. Return :
  1155. Remarks : none.
  1156. ---*/
  1157. DECLARE_DUMPFUNCTION( Dump_DS_SEARCH)
  1158. {
  1159. // from DS.c
  1160. struct _DnsDsEnum
  1161. {
  1162. PLDAPSearch pSearchBlock; // ldap search result on zone
  1163. PLDAPMessage pResultMessage; // current page of message
  1164. PLDAPMessage pNodeMessage; // message for current node
  1165. PZONE_INFO pZone;
  1166. LONGLONG SearchTime;
  1167. LONGLONG TombstoneExpireTime;
  1168. DWORD dwSearchFlag;
  1169. DWORD dwLookupFlag;
  1170. DWORD dwHighestVersion;
  1171. DWORD dwTotalNodes;
  1172. DWORD dwTotalTombstones;
  1173. DWORD dwTotalRecords;
  1174. #if 0
  1175. DWORD dwHighUsnLength;
  1176. CHAR szHighUsn[ MAX_USN_LENGTH ]; // largest USN in enum
  1177. #endif
  1178. CHAR szStartUsn[ MAX_USN_LENGTH ]; // USN at search start
  1179. // node record data
  1180. PLDAP_BERVAL * ppBerval; // the values in the array
  1181. PDB_RECORD pRecords;
  1182. DWORD dwRecordCount;
  1183. DWORD dwNodeVersion;
  1184. DWORD dwTombstoneVersion;
  1185. };
  1186. Printf( "DS_SEARCH(0x%p):\n", lpVoid );
  1187. if ( !lpVoid )
  1188. {
  1189. Printf( "Cannot process [%p] pointer\n", lpVoid );
  1190. return FALSE;
  1191. }
  1192. //
  1193. // print structure
  1194. //
  1195. struct _DnsDsEnum *p = (struct _DnsDsEnum*) PushMemory( lpVoid, sizeof(struct _DnsDsEnum) );
  1196. Printf( " pSearchBlock = 0x%p\n", p->pSearchBlock );
  1197. Printf( " pResultMessage = 0x%p\n", p->pResultMessage );
  1198. Printf( " pNodeMessage = 0x%p\n", p->pNodeMessage );
  1199. Printf( " pZone = 0x%p\n", p->pZone );
  1200. Printf( " SearchTime = 0x%x:0x%x\n", (DWORD)(p->SearchTime>>32), (DWORD)(p->SearchTime & 0x00000000ffffffff) );
  1201. Printf( " TombstoneExpireTime = 0x%x:0x%x\n", (DWORD)(p->TombstoneExpireTime>>32),(DWORD)(p->TombstoneExpireTime & 0x00000000ffffffff) );
  1202. Printf( " dwSearchFlag = 0x%x\n", p->dwSearchFlag );
  1203. Printf( " dwLookupFlag = 0x%x\n", p->dwLookupFlag );
  1204. Printf( " dwHighestVersion = 0x%x\n", p->dwHighestVersion );
  1205. Printf( " dwTotalNodes = 0x%x\n", p->dwTotalNodes );
  1206. Printf( " dwTotalTombstones = 0x%x\n", p->dwTotalTombstones );
  1207. Printf( " dwTotalRecords = 0x%x\n", p->dwTotalRecords );
  1208. #if 0
  1209. Printf( " dwHighUsnLength = 0x%x\n", p->dwHighUsnLength );
  1210. Printf( " szHighUsn = 0x%p\n", RELATIVE_ADDRESS(lpVoid, p, p->szHighUsn) );
  1211. #endif
  1212. Printf( " szStartUsn = 0x%p\n", RELATIVE_ADDRESS(lpVoid, p, p->szStartUsn) );
  1213. // node record data
  1214. Printf( " ppBerval = 0x%p\n", p->ppBerval );
  1215. Printf( " pRecords = 0x%p\n", p->pRecords );
  1216. Printf( " dwRecordCount = 0x%x\n", p->dwRecordCount );
  1217. Printf( " dwNodeVersion = 0x%x\n", p->dwNodeVersion );
  1218. Printf( " dwTombstoneVersion = 0x%x\n", p->dwTombstoneVersion );
  1219. PopMemory( (PVOID)p );
  1220. return TRUE;
  1221. }
  1222. /*+++
  1223. Function : Dump_Record_SOA
  1224. Description:
  1225. Parameters :
  1226. Return :
  1227. Remarks : none.
  1228. ---*/
  1229. DECLARE_DUMPFUNCTION( Dump_Record_SOA)
  1230. {
  1231. struct SOA
  1232. {
  1233. PDB_NODE pnodePrimaryServer;
  1234. PDB_NODE pnodeZoneAdmin;
  1235. DWORD dwSerialNo;
  1236. DWORD dwRefresh;
  1237. DWORD dwRetry;
  1238. DWORD dwExpire;
  1239. DWORD dwMinimumTtl;
  1240. };
  1241. Printf( "DB_RECORD.SOA(0x%p):\n", lpVoid );
  1242. if ( !lpVoid )
  1243. {
  1244. Printf( "Cannot process [%p] pointer\n", lpVoid );
  1245. return FALSE;
  1246. }
  1247. struct SOA *psoa = (struct SOA*) PushMemory( lpVoid, sizeof(struct SOA) );
  1248. Printf( " pnodePrimaryServer = 0x%p\n", psoa->pnodePrimaryServer );
  1249. Printf( " pnodeZoneAdmin = 0x%p\n", psoa->pnodeZoneAdmin );
  1250. Printf( " dwSerialNo = 0x%x\n", psoa->dwSerialNo );
  1251. Printf( " dwRefresh = 0x%x\n", psoa->dwRefresh );
  1252. Printf( " dwRetry = 0x%x\n", psoa->dwRetry );
  1253. Printf( " dwExpire = 0x%x\n", psoa->dwExpire );
  1254. Printf( " dwMinimumTtl = 0x%x\n", psoa->dwMinimumTtl );
  1255. PopMemory( (PVOID)psoa );
  1256. return TRUE;
  1257. }
  1258. /*++
  1259. Routine Description: Dumps the buffer content on to the debugger output.
  1260. Arguments:
  1261. Buffer: buffer pointer.
  1262. BufferSize: size of the buffer.
  1263. Return Value: none
  1264. Author: borrowed from MikeSw
  1265. --*/
  1266. VOID DumpBuffer(PVOID Buffer, DWORD BufferSize){
  1267. #define DUMPBUFFER_NUM_CHARS 16
  1268. DWORD i, limit;
  1269. CHAR TextBuffer[DUMPBUFFER_NUM_CHARS + 1];
  1270. LPBYTE BufferPtr = (LPBYTE) PushMemory( Buffer, BufferSize );
  1271. Printf( "----------------(0x%p)--------------\n", Buffer );
  1272. //
  1273. // Hex dump of the bytes
  1274. //
  1275. limit = ((BufferSize - 1) / DUMPBUFFER_NUM_CHARS + 1) * DUMPBUFFER_NUM_CHARS;
  1276. for (i = 0; i < limit; i++) {
  1277. if (i < BufferSize) {
  1278. Printf( "%02x ", BufferPtr[i] );
  1279. if (BufferPtr[i] < 31 ) {
  1280. TextBuffer[i % DUMPBUFFER_NUM_CHARS] = '.';
  1281. } else if (BufferPtr[i] == '\0') {
  1282. TextBuffer[i % DUMPBUFFER_NUM_CHARS] = ' ';
  1283. } else {
  1284. TextBuffer[i % DUMPBUFFER_NUM_CHARS] = (CHAR) BufferPtr[i];
  1285. }
  1286. } else {
  1287. Printf( " " );
  1288. TextBuffer[i % DUMPBUFFER_NUM_CHARS] = ' ';
  1289. }
  1290. if ((i + 1) % DUMPBUFFER_NUM_CHARS == 0) {
  1291. TextBuffer[DUMPBUFFER_NUM_CHARS] = 0;
  1292. Printf( " %s\n", TextBuffer );
  1293. }
  1294. }
  1295. Printf( "------------------------------------\n" );
  1296. PopMemory( (PVOID)BufferPtr );
  1297. #define DUMPBUFFER_NUM_CHARS 16
  1298. }
  1299. #endif // DUMP_CXX