Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

775 lines
23 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. ntiodump.h
  5. Abstract:
  6. This is the include file that defines all constants and types for
  7. accessing memory dump files.
  8. Revision History:
  9. --*/
  10. #ifndef _NTIODUMP_
  11. #define _NTIODUMP_
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif
  15. #ifndef MIDL_PASS
  16. #if _MSC_VER >= 1200
  17. #pragma warning(push)
  18. #endif
  19. #pragma warning( disable : 4200 ) // nonstandard extension used : zero-sized array in struct/union
  20. #endif // MIDL_PASS
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. #define USERMODE_CRASHDUMP_SIGNATURE 'RESU'
  25. #define USERMODE_CRASHDUMP_VALID_DUMP32 'PMUD'
  26. #define USERMODE_CRASHDUMP_VALID_DUMP64 '46UD'
  27. typedef struct _USERMODE_CRASHDUMP_HEADER {
  28. ULONG Signature;
  29. ULONG ValidDump;
  30. ULONG MajorVersion;
  31. ULONG MinorVersion;
  32. ULONG MachineImageType;
  33. ULONG ThreadCount;
  34. ULONG ModuleCount;
  35. ULONG MemoryRegionCount;
  36. ULONG_PTR ThreadOffset;
  37. ULONG_PTR ModuleOffset;
  38. ULONG_PTR DataOffset;
  39. ULONG_PTR MemoryRegionOffset;
  40. ULONG_PTR DebugEventOffset;
  41. ULONG_PTR ThreadStateOffset;
  42. ULONG_PTR VersionInfoOffset;
  43. ULONG_PTR Spare1;
  44. } USERMODE_CRASHDUMP_HEADER, *PUSERMODE_CRASHDUMP_HEADER;
  45. typedef struct _USERMODE_CRASHDUMP_HEADER32 {
  46. ULONG Signature;
  47. ULONG ValidDump;
  48. ULONG MajorVersion;
  49. ULONG MinorVersion;
  50. ULONG MachineImageType;
  51. ULONG ThreadCount;
  52. ULONG ModuleCount;
  53. ULONG MemoryRegionCount;
  54. ULONG ThreadOffset;
  55. ULONG ModuleOffset;
  56. ULONG DataOffset;
  57. ULONG MemoryRegionOffset;
  58. ULONG DebugEventOffset;
  59. ULONG ThreadStateOffset;
  60. ULONG VersionInfoOffset;
  61. ULONG Spare1;
  62. } USERMODE_CRASHDUMP_HEADER32, *PUSERMODE_CRASHDUMP_HEADER32;
  63. typedef struct _USERMODE_CRASHDUMP_HEADER64 {
  64. ULONG Signature;
  65. ULONG ValidDump;
  66. ULONG MajorVersion;
  67. ULONG MinorVersion;
  68. ULONG MachineImageType;
  69. ULONG ThreadCount;
  70. ULONG ModuleCount;
  71. ULONG MemoryRegionCount;
  72. ULONGLONG ThreadOffset;
  73. ULONGLONG ModuleOffset;
  74. ULONGLONG DataOffset;
  75. ULONGLONG MemoryRegionOffset;
  76. ULONGLONG DebugEventOffset;
  77. ULONGLONG ThreadStateOffset;
  78. ULONGLONG VersionInfoOffset;
  79. ULONGLONG Spare1;
  80. } USERMODE_CRASHDUMP_HEADER64, *PUSERMODE_CRASHDUMP_HEADER64;
  81. typedef struct _CRASH_MODULE {
  82. ULONG_PTR BaseOfImage;
  83. ULONG SizeOfImage;
  84. ULONG ImageNameLength;
  85. CHAR ImageName[0];
  86. } CRASH_MODULE, *PCRASH_MODULE;
  87. typedef struct _CRASH_MODULE32 {
  88. ULONG BaseOfImage;
  89. ULONG SizeOfImage;
  90. ULONG ImageNameLength;
  91. CHAR ImageName[0];
  92. } CRASH_MODULE32, *PCRASH_MODULE32;
  93. typedef struct _CRASH_MODULE64 {
  94. ULONGLONG BaseOfImage;
  95. ULONG SizeOfImage;
  96. ULONG ImageNameLength;
  97. CHAR ImageName[0];
  98. } CRASH_MODULE64, *PCRASH_MODULE64;
  99. typedef struct _CRASH_THREAD {
  100. ULONG ThreadId;
  101. ULONG SuspendCount;
  102. ULONG PriorityClass;
  103. ULONG Priority;
  104. ULONG_PTR Teb;
  105. ULONG_PTR Spare0;
  106. ULONG_PTR Spare1;
  107. ULONG_PTR Spare2;
  108. ULONG_PTR Spare3;
  109. ULONG_PTR Spare4;
  110. ULONG_PTR Spare5;
  111. ULONG_PTR Spare6;
  112. } CRASH_THREAD, *PCRASH_THREAD;
  113. typedef struct _CRASH_THREAD32 {
  114. ULONG ThreadId;
  115. ULONG SuspendCount;
  116. ULONG PriorityClass;
  117. ULONG Priority;
  118. ULONG Teb;
  119. ULONG Spare0;
  120. ULONG Spare1;
  121. ULONG Spare2;
  122. ULONG Spare3;
  123. ULONG Spare4;
  124. ULONG Spare5;
  125. ULONG Spare6;
  126. } CRASH_THREAD32, *PCRASH_THREAD32;
  127. typedef struct _CRASH_THREAD64 {
  128. ULONG ThreadId;
  129. ULONG SuspendCount;
  130. ULONG PriorityClass;
  131. ULONG Priority;
  132. ULONGLONG Teb;
  133. ULONGLONG Spare0;
  134. ULONGLONG Spare1;
  135. ULONGLONG Spare2;
  136. ULONGLONG Spare3;
  137. ULONGLONG Spare4;
  138. ULONGLONG Spare5;
  139. ULONGLONG Spare6;
  140. } CRASH_THREAD64, *PCRASH_THREAD64;
  141. typedef struct _CRASHDUMP_VERSION_INFO {
  142. int IgnoreGuardPages; // Whether we should ignore GuardPages or not
  143. ULONG PointerSize; // 32, 64 bit pointers
  144. } CRASHDUMP_VERSION_INFO, *PCRASHDUMP_VERSION_INFO;
  145. //
  146. // usermode crash dump data types
  147. //
  148. #define DMP_EXCEPTION 1 // obsolete
  149. #define DMP_MEMORY_BASIC_INFORMATION 2
  150. #define DMP_THREAD_CONTEXT 3
  151. #define DMP_MODULE 4
  152. #define DMP_MEMORY_DATA 5
  153. #define DMP_DEBUG_EVENT 6
  154. #define DMP_THREAD_STATE 7
  155. #define DMP_DUMP_FILE_HANDLE 8
  156. //
  157. // usermode crashdump callback function
  158. //
  159. typedef int (__stdcall *PDMP_CREATE_DUMP_CALLBACK)(
  160. ULONG DataType,
  161. PVOID* DumpData,
  162. PULONG DumpDataLength,
  163. PVOID UserData
  164. );
  165. //
  166. // Define the information required to process memory dumps.
  167. //
  168. typedef enum _DUMP_TYPES {
  169. DUMP_TYPE_INVALID = -1,
  170. DUMP_TYPE_UNKNOWN = 0,
  171. DUMP_TYPE_FULL = 1,
  172. DUMP_TYPE_SUMMARY = 2,
  173. DUMP_TYPE_HEADER = 3,
  174. DUMP_TYPE_TRIAGE = 4,
  175. } DUMP_TYPE;
  176. //
  177. // Signature and Valid fields.
  178. //
  179. #define DUMP_SIGNATURE32 ('EGAP')
  180. #define DUMP_VALID_DUMP32 ('PMUD')
  181. #define DUMP_SIGNATURE64 ('EGAP')
  182. #define DUMP_VALID_DUMP64 ('46UD')
  183. #define DUMP_SUMMARY_SIGNATURE ('PMDS')
  184. #define DUMP_SUMMARY_VALID ('PMUD')
  185. #define DUMP_SUMMARY_VALID_KERNEL_VA (1)
  186. #define DUMP_SUMMARY_VALID_CURRENT_USER_VA (2)
  187. //
  188. //
  189. // NOTE: The definition of PHYISCAL_MEMORY_RUN and PHYSICAL_MEMORY_DESCRIPTOR
  190. // MUST be the same as in mm.h. The kernel portion of crashdump will
  191. // verify that these structs are the same.
  192. //
  193. typedef struct _PHYSICAL_MEMORY_RUN32 {
  194. ULONG BasePage;
  195. ULONG PageCount;
  196. } PHYSICAL_MEMORY_RUN32, *PPHYSICAL_MEMORY_RUN32;
  197. typedef struct _PHYSICAL_MEMORY_DESCRIPTOR32 {
  198. ULONG NumberOfRuns;
  199. ULONG NumberOfPages;
  200. PHYSICAL_MEMORY_RUN32 Run[1];
  201. } PHYSICAL_MEMORY_DESCRIPTOR32, *PPHYSICAL_MEMORY_DESCRIPTOR32;
  202. typedef struct _PHYSICAL_MEMORY_RUN64 {
  203. ULONG64 BasePage;
  204. ULONG64 PageCount;
  205. } PHYSICAL_MEMORY_RUN64, *PPHYSICAL_MEMORY_RUN64;
  206. typedef struct _PHYSICAL_MEMORY_DESCRIPTOR64 {
  207. ULONG NumberOfRuns;
  208. ULONG64 NumberOfPages;
  209. PHYSICAL_MEMORY_RUN64 Run[1];
  210. } PHYSICAL_MEMORY_DESCRIPTOR64, *PPHYSICAL_MEMORY_DESCRIPTOR64;
  211. typedef struct _UNLOADED_DRIVERS32 {
  212. UNICODE_STRING32 Name;
  213. ULONG StartAddress;
  214. ULONG EndAddress;
  215. LARGE_INTEGER CurrentTime;
  216. } UNLOADED_DRIVERS32, *PUNLOADED_DRIVERS32;
  217. typedef struct _UNLOADED_DRIVERS64 {
  218. UNICODE_STRING64 Name;
  219. ULONG64 StartAddress;
  220. ULONG64 EndAddress;
  221. LARGE_INTEGER CurrentTime;
  222. } UNLOADED_DRIVERS64, *PUNLOADED_DRIVERS64;
  223. #define MAX_UNLOADED_NAME_LENGTH 24
  224. typedef struct _DUMP_UNLOADED_DRIVERS32
  225. {
  226. UNICODE_STRING32 Name;
  227. WCHAR DriverName[MAX_UNLOADED_NAME_LENGTH / sizeof (WCHAR)];
  228. ULONG StartAddress;
  229. ULONG EndAddress;
  230. } DUMP_UNLOADED_DRIVERS32, *PDUMP_UNLOADED_DRIVERS32;
  231. typedef struct _DUMP_UNLOADED_DRIVERS64
  232. {
  233. UNICODE_STRING64 Name;
  234. WCHAR DriverName[MAX_UNLOADED_NAME_LENGTH / sizeof (WCHAR)];
  235. ULONG64 StartAddress;
  236. ULONG64 EndAddress;
  237. } DUMP_UNLOADED_DRIVERS64, *PDUMP_UNLOADED_DRIVERS64;
  238. typedef struct _DUMP_MM_STORAGE32
  239. {
  240. ULONG Version;
  241. ULONG Size;
  242. ULONG MmSpecialPoolTag;
  243. ULONG MiTriageActionTaken;
  244. ULONG MmVerifyDriverLevel;
  245. ULONG KernelVerifier;
  246. ULONG MmMaximumNonPagedPool;
  247. ULONG MmAllocatedNonPagedPool;
  248. ULONG PagedPoolMaximum;
  249. ULONG PagedPoolAllocated;
  250. ULONG CommittedPages;
  251. ULONG CommittedPagesPeak;
  252. ULONG CommitLimitMaximum;
  253. } DUMP_MM_STORAGE32, *PDUMP_MM_STORAGE32;
  254. typedef struct _DUMP_MM_STORAGE64
  255. {
  256. ULONG Version;
  257. ULONG Size;
  258. ULONG MmSpecialPoolTag;
  259. ULONG MiTriageActionTaken;
  260. ULONG MmVerifyDriverLevel;
  261. ULONG KernelVerifier;
  262. ULONG64 MmMaximumNonPagedPool;
  263. ULONG64 MmAllocatedNonPagedPool;
  264. ULONG64 PagedPoolMaximum;
  265. ULONG64 PagedPoolAllocated;
  266. ULONG64 CommittedPages;
  267. ULONG64 CommittedPagesPeak;
  268. ULONG64 CommitLimitMaximum;
  269. } DUMP_MM_STORAGE64, *PDUMP_MM_STORAGE64;
  270. //
  271. // Define the dump header structure. You cannot change these
  272. // defines without breaking the debuggers, so don't.
  273. //
  274. #define DMP_PHYSICAL_MEMORY_BLOCK_SIZE_32 (700)
  275. #define DMP_CONTEXT_RECORD_SIZE_32 (1200)
  276. #define DMP_RESERVED_0_SIZE_32 (1768)
  277. #define DMP_RESERVED_2_SIZE_32 (16)
  278. #define DMP_RESERVED_3_SIZE_32 (56)
  279. #define DMP_PHYSICAL_MEMORY_BLOCK_SIZE_64 (700)
  280. #define DMP_CONTEXT_RECORD_SIZE_64 (3000)
  281. #define DMP_RESERVED_0_SIZE_64 (4020)
  282. #define DMP_HEADER_COMMENT_SIZE (128)
  283. // Unset WriterStatus value from the header fill.
  284. #define DUMP_WRITER_STATUS_UNINITIALIZED DUMP_SIGNATURE32
  285. // WriterStatus codes for the dbgeng.dll dump writers.
  286. enum
  287. {
  288. DUMP_DBGENG_SUCCESS,
  289. DUMP_DBGENG_NO_MODULE_LIST,
  290. DUMP_DBGENG_CORRUPT_MODULE_LIST,
  291. };
  292. //
  293. // The 32-bit memory dump structure requires 4-byte alignment.
  294. //
  295. #include <pshpack4.h>
  296. typedef struct _DUMP_HEADER32 {
  297. ULONG Signature;
  298. ULONG ValidDump;
  299. ULONG MajorVersion;
  300. ULONG MinorVersion;
  301. ULONG DirectoryTableBase;
  302. ULONG PfnDataBase;
  303. ULONG PsLoadedModuleList;
  304. ULONG PsActiveProcessHead;
  305. ULONG MachineImageType;
  306. ULONG NumberProcessors;
  307. ULONG BugCheckCode;
  308. ULONG BugCheckParameter1;
  309. ULONG BugCheckParameter2;
  310. ULONG BugCheckParameter3;
  311. ULONG BugCheckParameter4;
  312. CHAR VersionUser[32];
  313. UCHAR PaeEnabled; // Present only for Win2k and better
  314. UCHAR Spare3[3];
  315. ULONG KdDebuggerDataBlock; // Present only for Win2k SP1 and better.
  316. union {
  317. PHYSICAL_MEMORY_DESCRIPTOR32 PhysicalMemoryBlock;
  318. UCHAR PhysicalMemoryBlockBuffer [ DMP_PHYSICAL_MEMORY_BLOCK_SIZE_32 ];
  319. };
  320. UCHAR ContextRecord [ DMP_CONTEXT_RECORD_SIZE_32 ];
  321. EXCEPTION_RECORD32 Exception;
  322. CHAR Comment [ DMP_HEADER_COMMENT_SIZE ]; // May not be present.
  323. UCHAR _reserved0 [ DMP_RESERVED_0_SIZE_32 ];
  324. ULONG DumpType; // Present for Win2k and better.
  325. ULONG MiniDumpFields;
  326. ULONG SecondaryDataState;
  327. ULONG ProductType;
  328. ULONG SuiteMask;
  329. ULONG WriterStatus;
  330. LARGE_INTEGER RequiredDumpSpace; // Present for Win2k and better.
  331. UCHAR _reserved2 [ DMP_RESERVED_2_SIZE_32 ];
  332. LARGE_INTEGER SystemUpTime; // Present only for Whistler and better.
  333. LARGE_INTEGER SystemTime; // Present only for Win2k and better.
  334. UCHAR _reserved3 [ DMP_RESERVED_3_SIZE_32 ];
  335. } DUMP_HEADER32, *PDUMP_HEADER32;
  336. typedef struct _FULL_DUMP32 {
  337. CHAR Memory [1]; // Variable length to the end of the dump file.
  338. } FULL_DUMP32, *PFULL_DUMP32;
  339. typedef struct _SUMMARY_DUMP32 {
  340. ULONG Signature;
  341. ULONG ValidDump;
  342. ULONG DumpOptions; // Summary Dump Options
  343. ULONG HeaderSize; // Offset to the start of actual memory dump
  344. ULONG BitmapSize; // Total bitmap size (i.e., maximum #bits)
  345. ULONG Pages; // Total bits set in bitmap (i.e., total pages in sdump)
  346. //
  347. // These next three fields essentially form an on-disk RTL_BITMAP structure.
  348. // The RESERVED field is stupidness introduced by the way the data is
  349. // serialized to disk.
  350. //
  351. struct {
  352. ULONG SizeOfBitMap;
  353. ULONG _reserved0;
  354. ULONG Buffer[];
  355. } Bitmap;
  356. } SUMMARY_DUMP32, * PSUMMARY_DUMP32;
  357. typedef struct _TRIAGE_DUMP32 {
  358. ULONG ServicePackBuild; // What service pack of NT was this ?
  359. ULONG SizeOfDump; // Size in bytes of the dump
  360. ULONG ValidOffset; // Offset valid ULONG
  361. ULONG ContextOffset; // Offset of CONTEXT record
  362. ULONG ExceptionOffset; // Offset of EXCEPTION record
  363. ULONG MmOffset; // Offset of Mm information
  364. ULONG UnloadedDriversOffset; // Offset of Unloaded Drivers
  365. ULONG PrcbOffset; // Offset of KPRCB
  366. ULONG ProcessOffset; // Offset of EPROCESS
  367. ULONG ThreadOffset; // Offset of ETHREAD
  368. ULONG CallStackOffset; // Offset of CallStack Pages
  369. ULONG SizeOfCallStack; // Size in bytes of CallStack
  370. ULONG DriverListOffset; // Offset of Driver List
  371. ULONG DriverCount; // Number of Drivers in list
  372. ULONG StringPoolOffset; // Offset to the string pool
  373. ULONG StringPoolSize; // Size of the string pool
  374. ULONG BrokenDriverOffset; // Offset into the driver of the driver that crashed
  375. ULONG TriageOptions; // Triage options in effect at crashtime
  376. ULONG TopOfStack; // The top (highest address) of the call stack
  377. ULONG DataPageAddress;
  378. ULONG DataPageOffset;
  379. ULONG DataPageSize;
  380. ULONG DebuggerDataOffset;
  381. ULONG DebuggerDataSize;
  382. ULONG DataBlocksOffset;
  383. ULONG DataBlocksCount;
  384. } TRIAGE_DUMP32, * PTRIAGE_DUMP32;
  385. typedef struct _MEMORY_DUMP32 {
  386. DUMP_HEADER32 Header;
  387. union {
  388. FULL_DUMP32 Full; // DumpType == DUMP_TYPE_FULL
  389. SUMMARY_DUMP32 Summary; // DumpType == DUMP_TYPE_SUMMARY
  390. TRIAGE_DUMP32 Triage; // DumpType == DUMP_TYPE_TRIAGE
  391. };
  392. } MEMORY_DUMP32, *PMEMORY_DUMP32;
  393. #include <poppack.h>
  394. typedef struct _DUMP_HEADER64 {
  395. ULONG Signature;
  396. ULONG ValidDump;
  397. ULONG MajorVersion;
  398. ULONG MinorVersion;
  399. ULONG64 DirectoryTableBase;
  400. ULONG64 PfnDataBase;
  401. ULONG64 PsLoadedModuleList;
  402. ULONG64 PsActiveProcessHead;
  403. ULONG MachineImageType;
  404. ULONG NumberProcessors;
  405. ULONG BugCheckCode;
  406. ULONG64 BugCheckParameter1;
  407. ULONG64 BugCheckParameter2;
  408. ULONG64 BugCheckParameter3;
  409. ULONG64 BugCheckParameter4;
  410. CHAR VersionUser[32];
  411. ULONG64 KdDebuggerDataBlock;
  412. union {
  413. PHYSICAL_MEMORY_DESCRIPTOR64 PhysicalMemoryBlock;
  414. UCHAR PhysicalMemoryBlockBuffer [ DMP_PHYSICAL_MEMORY_BLOCK_SIZE_64 ];
  415. };
  416. UCHAR ContextRecord [ DMP_CONTEXT_RECORD_SIZE_64 ];
  417. EXCEPTION_RECORD64 Exception;
  418. ULONG DumpType;
  419. LARGE_INTEGER RequiredDumpSpace;
  420. LARGE_INTEGER SystemTime;
  421. CHAR Comment [ DMP_HEADER_COMMENT_SIZE ]; // May not be present.
  422. LARGE_INTEGER SystemUpTime;
  423. ULONG MiniDumpFields;
  424. ULONG SecondaryDataState;
  425. ULONG ProductType;
  426. ULONG SuiteMask;
  427. ULONG WriterStatus;
  428. UCHAR _reserved0[ DMP_RESERVED_0_SIZE_64 ];
  429. } DUMP_HEADER64, *PDUMP_HEADER64;
  430. typedef struct _FULL_DUMP64 {
  431. CHAR Memory[1]; // Variable length to the end of the dump file.
  432. } FULL_DUMP64, *PFULL_DUMP64;
  433. //
  434. // ISSUE - 2000/02/17 - math: NT64 Summary dump.
  435. //
  436. // This is broken. The 64 bit summary dump should have a ULONG64 for
  437. // the BitmapSize to match the size of the PFN_NUMBER.
  438. //
  439. typedef struct _SUMMARY_DUMP64 {
  440. ULONG Signature;
  441. ULONG ValidDump;
  442. ULONG DumpOptions; // Summary Dump Options
  443. ULONG HeaderSize; // Offset to the start of actual memory dump
  444. ULONG BitmapSize; // Total bitmap size (i.e., maximum #bits)
  445. ULONG Pages; // Total bits set in bitmap (i.e., total pages in sdump)
  446. //
  447. // ISSUE - 2000/02/17 - math: Win64
  448. //
  449. // With a 64-bit PFN, we should not have a 32-bit bitmap.
  450. //
  451. //
  452. // These next three fields essentially form an on-disk RTL_BITMAP structure.
  453. // The RESERVED field is stupidness introduced by the way the data is
  454. // serialized to disk.
  455. //
  456. struct {
  457. ULONG SizeOfBitMap;
  458. ULONG64 _reserved0;
  459. ULONG Buffer[];
  460. } Bitmap;
  461. } SUMMARY_DUMP64, * PSUMMARY_DUMP64;
  462. typedef struct _TRIAGE_DUMP64 {
  463. ULONG ServicePackBuild; // What service pack of NT was this ?
  464. ULONG SizeOfDump; // Size in bytes of the dump
  465. ULONG ValidOffset; // Offset valid ULONG
  466. ULONG ContextOffset; // Offset of CONTEXT record
  467. ULONG ExceptionOffset; // Offset of EXCEPTION record
  468. ULONG MmOffset; // Offset of Mm information
  469. ULONG UnloadedDriversOffset; // Offset of Unloaded Drivers
  470. ULONG PrcbOffset; // Offset of KPRCB
  471. ULONG ProcessOffset; // Offset of EPROCESS
  472. ULONG ThreadOffset; // Offset of ETHREAD
  473. ULONG CallStackOffset; // Offset of CallStack Pages
  474. ULONG SizeOfCallStack; // Size in bytes of CallStack
  475. ULONG DriverListOffset; // Offset of Driver List
  476. ULONG DriverCount; // Number of Drivers in list
  477. ULONG StringPoolOffset; // Offset to the string pool
  478. ULONG StringPoolSize; // Size of the string pool
  479. ULONG BrokenDriverOffset; // Offset into the driver of the driver that crashed
  480. ULONG TriageOptions; // Triage options in effect at crashtime
  481. ULONG64 TopOfStack; // The top (highest address) of the callstack
  482. //
  483. // Architecture Specific fields.
  484. //
  485. union {
  486. //
  487. // For IA64 we need to store the BStore as well.
  488. //
  489. struct {
  490. ULONG BStoreOffset; // Offset of BStore region.
  491. ULONG SizeOfBStore; // The size of the BStore region.
  492. ULONG64 LimitOfBStore; // The limit (highest memory address)
  493. } Ia64; // of the BStore region.
  494. } ArchitectureSpecific;
  495. ULONG64 DataPageAddress;
  496. ULONG DataPageOffset;
  497. ULONG DataPageSize;
  498. ULONG DebuggerDataOffset;
  499. ULONG DebuggerDataSize;
  500. ULONG DataBlocksOffset;
  501. ULONG DataBlocksCount;
  502. } TRIAGE_DUMP64, * PTRIAGE_DUMP64;
  503. typedef struct _MEMORY_DUMP64 {
  504. DUMP_HEADER64 Header;
  505. union {
  506. FULL_DUMP64 Full; // DumpType == DUMP_TYPE_FULL
  507. SUMMARY_DUMP64 Summary; // DumpType == DUMP_TYPE_SUMMARY
  508. TRIAGE_DUMP64 Triage; // DumpType == DUMP_TYPE_TRIAGE
  509. };
  510. } MEMORY_DUMP64, *PMEMORY_DUMP64;
  511. typedef struct _TRIAGE_DATA_BLOCK {
  512. ULONG64 Address;
  513. ULONG Offset;
  514. ULONG Size;
  515. } TRIAGE_DATA_BLOCK, *PTRIAGE_DATA_BLOCK;
  516. //
  517. // In the triage dump ValidFields field what portions of the triage-dump have
  518. // been turned on.
  519. //
  520. #define TRIAGE_DUMP_CONTEXT (0x0001)
  521. #define TRIAGE_DUMP_EXCEPTION (0x0002)
  522. #define TRIAGE_DUMP_PRCB (0x0004)
  523. #define TRIAGE_DUMP_PROCESS (0x0008)
  524. #define TRIAGE_DUMP_THREAD (0x0010)
  525. #define TRIAGE_DUMP_STACK (0x0020)
  526. #define TRIAGE_DUMP_DRIVER_LIST (0x0040)
  527. #define TRIAGE_DUMP_BROKEN_DRIVER (0x0080)
  528. #define TRIAGE_DUMP_BASIC_INFO (0x00FF)
  529. #define TRIAGE_DUMP_MMINFO (0x0100)
  530. #define TRIAGE_DUMP_DATAPAGE (0x0200)
  531. #define TRIAGE_DUMP_DEBUGGER_DATA (0x0400)
  532. #define TRIAGE_DUMP_DATA_BLOCKS (0x0800)
  533. #define TRIAGE_OPTION_OVERFLOWED (0x0100)
  534. #define TRIAGE_DUMP_VALID ( 'DGRT' )
  535. #define TRIAGE_DUMP_SIZE32 ( 0x1000 * 16 )
  536. #define TRIAGE_DUMP_SIZE64 ( 0x2000 * 16 )
  537. #ifdef _NTLDRAPI_
  538. typedef struct _DUMP_DRIVER_ENTRY32 {
  539. ULONG DriverNameOffset;
  540. KLDR_DATA_TABLE_ENTRY32 LdrEntry;
  541. } DUMP_DRIVER_ENTRY32, * PDUMP_DRIVER_ENTRY32;
  542. typedef struct _DUMP_DRIVER_ENTRY64 {
  543. ULONG DriverNameOffset;
  544. ULONG __alignment;
  545. KLDR_DATA_TABLE_ENTRY64 LdrEntry;
  546. } DUMP_DRIVER_ENTRY64, * PDUMP_DRIVER_ENTRY64;
  547. #endif // _NTLDRAPI
  548. //
  549. // The DUMP_STRING is guaranteed to be both NULL terminated and length prefixed
  550. // (prefix does not include the NULL).
  551. //
  552. typedef struct _DUMP_STRING {
  553. ULONG Length; // Length IN BYTES of the string.
  554. WCHAR Buffer [0]; // Buffer.
  555. } DUMP_STRING, * PDUMP_STRING;
  556. //
  557. // Secondary dumps can be generated at bugcheck time after
  558. // the primary dump has been generated. The data in these
  559. // dumps is arbitrary and not interpretable, so the file
  560. // format is just a sequence of tagged blobs.
  561. //
  562. // Each blob header is aligned on an eight-byte boundary
  563. // and the data immediately follows it. Padding
  564. // may precede and/or follow the data for alignment purposes.
  565. //
  566. // Blobs are streamed into the file so there is no overall count.
  567. //
  568. #define DUMP_BLOB_SIGNATURE1 'pmuD'
  569. #define DUMP_BLOB_SIGNATURE2 'bolB'
  570. typedef struct _DUMP_BLOB_FILE_HEADER {
  571. ULONG Signature1;
  572. ULONG Signature2;
  573. ULONG HeaderSize;
  574. ULONG BuildNumber;
  575. } DUMP_BLOB_FILE_HEADER, *PDUMP_BLOB_FILE_HEADER;
  576. typedef struct _DUMP_BLOB_HEADER {
  577. ULONG HeaderSize;
  578. GUID Tag;
  579. ULONG DataSize;
  580. ULONG PrePad;
  581. ULONG PostPad;
  582. } DUMP_BLOB_HEADER, *PDUMP_BLOB_HEADER;
  583. #ifdef __cplusplus
  584. }
  585. #endif
  586. //
  587. // These defines should be used only by components
  588. // that know the architecture of the dump matches
  589. // the architecture of the machine they are on; i.e.,
  590. // the kernel and savedump. In particular, the debugger
  591. // should always explicitly use either the 32 or
  592. // 64 bit versions of the headers.
  593. //
  594. #ifndef __NTSDP_HPP__
  595. #if defined (_WIN64)
  596. typedef DUMP_HEADER64 DUMP_HEADER;
  597. typedef PDUMP_HEADER64 PDUMP_HEADER;
  598. typedef MEMORY_DUMP64 MEMORY_DUMP;
  599. typedef PMEMORY_DUMP64 PMEMORY_DUMP;
  600. typedef SUMMARY_DUMP64 SUMMARY_DUMP;
  601. typedef PSUMMARY_DUMP64 PSUMMARY_DUMP;
  602. typedef TRIAGE_DUMP64 TRIAGE_DUMP;
  603. typedef PTRIAGE_DUMP64 PTRIAGE_DUMP;
  604. #ifdef _NTLDRAPI_
  605. typedef DUMP_DRIVER_ENTRY64 DUMP_DRIVER_ENTRY;
  606. typedef PDUMP_DRIVER_ENTRY64 PDUMP_DRIVER_ENTRY;
  607. #endif
  608. #define DUMP_SIGNATURE DUMP_SIGNATURE64
  609. #define DUMP_VALID_DUMP DUMP_VALID_DUMP64
  610. #define TRIAGE_DUMP_SIZE TRIAGE_DUMP_SIZE64
  611. typedef PPHYSICAL_MEMORY_RUN64 PPHYSICAL_MEMORYRUN;
  612. typedef PPHYSICAL_MEMORY_DESCRIPTOR64 PPHYSICAL_MEMORYDESCRIPTOR;
  613. #else
  614. typedef DUMP_HEADER32 DUMP_HEADER;
  615. typedef PDUMP_HEADER32 PDUMP_HEADER;
  616. typedef MEMORY_DUMP32 MEMORY_DUMP;
  617. typedef PMEMORY_DUMP32 PMEMORY_DUMP;
  618. typedef SUMMARY_DUMP32 SUMMARY_DUMP;
  619. typedef PSUMMARY_DUMP32 PSUMMARY_DUMP;
  620. typedef TRIAGE_DUMP32 TRIAGE_DUMP;
  621. typedef PTRIAGE_DUMP32 PTRIAGE_DUMP;
  622. #ifdef _NTLDRAPI_
  623. typedef DUMP_DRIVER_ENTRY32 DUMP_DRIVER_ENTRY;
  624. typedef PDUMP_DRIVER_ENTRY32 PDUMP_DRIVER_ENTRY;
  625. #endif
  626. #define DUMP_SIGNATURE DUMP_SIGNATURE32
  627. #define DUMP_VALID_DUMP DUMP_VALID_DUMP32
  628. #define TRIAGE_DUMP_SIZE TRIAGE_DUMP_SIZE32
  629. typedef PPHYSICAL_MEMORY_RUN32 PPHYSICAL_MEMORYRUN;
  630. typedef PPHYSICAL_MEMORY_DESCRIPTOR32 PPHYSICAL_MEMORYDESCRIPTOR;
  631. #endif
  632. #endif
  633. #ifndef MIDL_PASS
  634. #if _MSC_VER >= 1200
  635. #pragma warning(pop)
  636. #else
  637. #pragma warning( default : 4200 ) // nonstandard extension used : zero-sized array in struct/union
  638. #endif
  639. #endif // MIDL_PASS
  640. #endif // _NTIODUMP_