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.

764 lines
22 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_1_SIZE_32 (4)
  278. #define DMP_RESERVED_2_SIZE_32 (16)
  279. #define DMP_RESERVED_3_SIZE_32 (56)
  280. #define DMP_PHYSICAL_MEMORY_BLOCK_SIZE_64 (700)
  281. #define DMP_CONTEXT_RECORD_SIZE_64 (3000)
  282. #define DMP_RESERVED_0_SIZE_64 (4024)
  283. #define DMP_HEADER_COMMENT_SIZE (128)
  284. //
  285. // The 32-bit memory dump structure requires 4-byte alignment.
  286. //
  287. #include <pshpack4.h>
  288. typedef struct _DUMP_HEADER32 {
  289. ULONG Signature;
  290. ULONG ValidDump;
  291. ULONG MajorVersion;
  292. ULONG MinorVersion;
  293. ULONG DirectoryTableBase;
  294. ULONG PfnDataBase;
  295. ULONG PsLoadedModuleList;
  296. ULONG PsActiveProcessHead;
  297. ULONG MachineImageType;
  298. ULONG NumberProcessors;
  299. ULONG BugCheckCode;
  300. ULONG BugCheckParameter1;
  301. ULONG BugCheckParameter2;
  302. ULONG BugCheckParameter3;
  303. ULONG BugCheckParameter4;
  304. CHAR VersionUser[32];
  305. UCHAR PaeEnabled; // Present only for Win2k and better
  306. UCHAR Spare3[3];
  307. ULONG KdDebuggerDataBlock; // Present only for Win2k SP1 and better.
  308. union {
  309. PHYSICAL_MEMORY_DESCRIPTOR32 PhysicalMemoryBlock;
  310. UCHAR PhysicalMemoryBlockBuffer [ DMP_PHYSICAL_MEMORY_BLOCK_SIZE_32 ];
  311. };
  312. UCHAR ContextRecord [ DMP_CONTEXT_RECORD_SIZE_32 ];
  313. EXCEPTION_RECORD32 Exception;
  314. CHAR Comment [ DMP_HEADER_COMMENT_SIZE ]; // May not be present.
  315. UCHAR _reserved0 [ DMP_RESERVED_0_SIZE_32 ];
  316. ULONG DumpType; // Present for Win2k and better.
  317. ULONG MiniDumpFields;
  318. ULONG SecondaryDataState;
  319. ULONG ProductType;
  320. ULONG SuiteMask;
  321. UCHAR _reserved1 [ DMP_RESERVED_1_SIZE_32 ];
  322. LARGE_INTEGER RequiredDumpSpace; // Present for Win2k and better.
  323. UCHAR _reserved2 [ DMP_RESERVED_2_SIZE_32 ];
  324. LARGE_INTEGER SystemUpTime; // Present only for Whistler and better.
  325. LARGE_INTEGER SystemTime; // Present only for Win2k and better.
  326. UCHAR _reserved3 [ DMP_RESERVED_3_SIZE_32 ];
  327. } DUMP_HEADER32, *PDUMP_HEADER32;
  328. typedef struct _FULL_DUMP32 {
  329. CHAR Memory [1]; // Variable length to the end of the dump file.
  330. } FULL_DUMP32, *PFULL_DUMP32;
  331. typedef struct _SUMMARY_DUMP32 {
  332. ULONG Signature;
  333. ULONG ValidDump;
  334. ULONG DumpOptions; // Summary Dump Options
  335. ULONG HeaderSize; // Offset to the start of actual memory dump
  336. ULONG BitmapSize; // Total bitmap size (i.e., maximum #bits)
  337. ULONG Pages; // Total bits set in bitmap (i.e., total pages in sdump)
  338. //
  339. // These next three fields essentially form an on-disk RTL_BITMAP structure.
  340. // The RESERVED field is stupidness introduced by the way the data is
  341. // serialized to disk.
  342. //
  343. struct {
  344. ULONG SizeOfBitMap;
  345. ULONG _reserved0;
  346. ULONG Buffer[];
  347. } Bitmap;
  348. } SUMMARY_DUMP32, * PSUMMARY_DUMP32;
  349. typedef struct _TRIAGE_DUMP32 {
  350. ULONG ServicePackBuild; // What service pack of NT was this ?
  351. ULONG SizeOfDump; // Size in bytes of the dump
  352. ULONG ValidOffset; // Offset valid ULONG
  353. ULONG ContextOffset; // Offset of CONTEXT record
  354. ULONG ExceptionOffset; // Offset of EXCEPTION record
  355. ULONG MmOffset; // Offset of Mm information
  356. ULONG UnloadedDriversOffset; // Offset of Unloaded Drivers
  357. ULONG PrcbOffset; // Offset of KPRCB
  358. ULONG ProcessOffset; // Offset of EPROCESS
  359. ULONG ThreadOffset; // Offset of ETHREAD
  360. ULONG CallStackOffset; // Offset of CallStack Pages
  361. ULONG SizeOfCallStack; // Size in bytes of CallStack
  362. ULONG DriverListOffset; // Offset of Driver List
  363. ULONG DriverCount; // Number of Drivers in list
  364. ULONG StringPoolOffset; // Offset to the string pool
  365. ULONG StringPoolSize; // Size of the string pool
  366. ULONG BrokenDriverOffset; // Offset into the driver of the driver that crashed
  367. ULONG TriageOptions; // Triage options in effect at crashtime
  368. ULONG TopOfStack; // The top (highest address) of the call stack
  369. ULONG DataPageAddress;
  370. ULONG DataPageOffset;
  371. ULONG DataPageSize;
  372. ULONG DebuggerDataOffset;
  373. ULONG DebuggerDataSize;
  374. ULONG DataBlocksOffset;
  375. ULONG DataBlocksCount;
  376. } TRIAGE_DUMP32, * PTRIAGE_DUMP32;
  377. typedef struct _MEMORY_DUMP32 {
  378. DUMP_HEADER32 Header;
  379. union {
  380. FULL_DUMP32 Full; // DumpType == DUMP_TYPE_FULL
  381. SUMMARY_DUMP32 Summary; // DumpType == DUMP_TYPE_SUMMARY
  382. TRIAGE_DUMP32 Triage; // DumpType == DUMP_TYPE_TRIAGE
  383. };
  384. } MEMORY_DUMP32, *PMEMORY_DUMP32;
  385. #include <poppack.h>
  386. typedef struct _DUMP_HEADER64 {
  387. ULONG Signature;
  388. ULONG ValidDump;
  389. ULONG MajorVersion;
  390. ULONG MinorVersion;
  391. ULONG64 DirectoryTableBase;
  392. ULONG64 PfnDataBase;
  393. ULONG64 PsLoadedModuleList;
  394. ULONG64 PsActiveProcessHead;
  395. ULONG MachineImageType;
  396. ULONG NumberProcessors;
  397. ULONG BugCheckCode;
  398. ULONG64 BugCheckParameter1;
  399. ULONG64 BugCheckParameter2;
  400. ULONG64 BugCheckParameter3;
  401. ULONG64 BugCheckParameter4;
  402. CHAR VersionUser[32];
  403. ULONG64 KdDebuggerDataBlock;
  404. union {
  405. PHYSICAL_MEMORY_DESCRIPTOR64 PhysicalMemoryBlock;
  406. UCHAR PhysicalMemoryBlockBuffer [ DMP_PHYSICAL_MEMORY_BLOCK_SIZE_64 ];
  407. };
  408. UCHAR ContextRecord [ DMP_CONTEXT_RECORD_SIZE_64 ];
  409. EXCEPTION_RECORD64 Exception;
  410. ULONG DumpType;
  411. LARGE_INTEGER RequiredDumpSpace;
  412. LARGE_INTEGER SystemTime;
  413. CHAR Comment [ DMP_HEADER_COMMENT_SIZE ]; // May not be present.
  414. LARGE_INTEGER SystemUpTime;
  415. ULONG MiniDumpFields;
  416. ULONG SecondaryDataState;
  417. ULONG ProductType;
  418. ULONG SuiteMask;
  419. UCHAR _reserved0[ DMP_RESERVED_0_SIZE_64 ];
  420. } DUMP_HEADER64, *PDUMP_HEADER64;
  421. typedef struct _FULL_DUMP64 {
  422. CHAR Memory[1]; // Variable length to the end of the dump file.
  423. } FULL_DUMP64, *PFULL_DUMP64;
  424. //
  425. // ISSUE - 2000/02/17 - math: NT64 Summary dump.
  426. //
  427. // This is broken. The 64 bit summary dump should have a ULONG64 for
  428. // the BitmapSize to match the size of the PFN_NUMBER.
  429. //
  430. typedef struct _SUMMARY_DUMP64 {
  431. ULONG Signature;
  432. ULONG ValidDump;
  433. ULONG DumpOptions; // Summary Dump Options
  434. ULONG HeaderSize; // Offset to the start of actual memory dump
  435. ULONG BitmapSize; // Total bitmap size (i.e., maximum #bits)
  436. ULONG Pages; // Total bits set in bitmap (i.e., total pages in sdump)
  437. //
  438. // ISSUE - 2000/02/17 - math: Win64
  439. //
  440. // With a 64-bit PFN, we should not have a 32-bit bitmap.
  441. //
  442. //
  443. // These next three fields essentially form an on-disk RTL_BITMAP structure.
  444. // The RESERVED field is stupidness introduced by the way the data is
  445. // serialized to disk.
  446. //
  447. struct {
  448. ULONG SizeOfBitMap;
  449. ULONG64 _reserved0;
  450. ULONG Buffer[];
  451. } Bitmap;
  452. } SUMMARY_DUMP64, * PSUMMARY_DUMP64;
  453. typedef struct _TRIAGE_DUMP64 {
  454. ULONG ServicePackBuild; // What service pack of NT was this ?
  455. ULONG SizeOfDump; // Size in bytes of the dump
  456. ULONG ValidOffset; // Offset valid ULONG
  457. ULONG ContextOffset; // Offset of CONTEXT record
  458. ULONG ExceptionOffset; // Offset of EXCEPTION record
  459. ULONG MmOffset; // Offset of Mm information
  460. ULONG UnloadedDriversOffset; // Offset of Unloaded Drivers
  461. ULONG PrcbOffset; // Offset of KPRCB
  462. ULONG ProcessOffset; // Offset of EPROCESS
  463. ULONG ThreadOffset; // Offset of ETHREAD
  464. ULONG CallStackOffset; // Offset of CallStack Pages
  465. ULONG SizeOfCallStack; // Size in bytes of CallStack
  466. ULONG DriverListOffset; // Offset of Driver List
  467. ULONG DriverCount; // Number of Drivers in list
  468. ULONG StringPoolOffset; // Offset to the string pool
  469. ULONG StringPoolSize; // Size of the string pool
  470. ULONG BrokenDriverOffset; // Offset into the driver of the driver that crashed
  471. ULONG TriageOptions; // Triage options in effect at crashtime
  472. ULONG64 TopOfStack; // The top (highest address) of the callstack
  473. //
  474. // Architecture Specific fields.
  475. //
  476. union {
  477. //
  478. // For IA64 we need to store the BStore as well.
  479. //
  480. struct {
  481. ULONG BStoreOffset; // Offset of BStore region.
  482. ULONG SizeOfBStore; // The size of the BStore region.
  483. ULONG64 LimitOfBStore; // The limit (highest memory address)
  484. } Ia64; // of the BStore region.
  485. } ArchitectureSpecific;
  486. ULONG64 DataPageAddress;
  487. ULONG DataPageOffset;
  488. ULONG DataPageSize;
  489. ULONG DebuggerDataOffset;
  490. ULONG DebuggerDataSize;
  491. ULONG DataBlocksOffset;
  492. ULONG DataBlocksCount;
  493. } TRIAGE_DUMP64, * PTRIAGE_DUMP64;
  494. typedef struct _MEMORY_DUMP64 {
  495. DUMP_HEADER64 Header;
  496. union {
  497. FULL_DUMP64 Full; // DumpType == DUMP_TYPE_FULL
  498. SUMMARY_DUMP64 Summary; // DumpType == DUMP_TYPE_SUMMARY
  499. TRIAGE_DUMP64 Triage; // DumpType == DUMP_TYPE_TRIAGE
  500. };
  501. } MEMORY_DUMP64, *PMEMORY_DUMP64;
  502. typedef struct _TRIAGE_DATA_BLOCK {
  503. ULONG64 Address;
  504. ULONG Offset;
  505. ULONG Size;
  506. } TRIAGE_DATA_BLOCK, *PTRIAGE_DATA_BLOCK;
  507. //
  508. // In the triage dump ValidFields field what portions of the triage-dump have
  509. // been turned on.
  510. //
  511. #define TRIAGE_DUMP_CONTEXT (0x0001)
  512. #define TRIAGE_DUMP_EXCEPTION (0x0002)
  513. #define TRIAGE_DUMP_PRCB (0x0004)
  514. #define TRIAGE_DUMP_PROCESS (0x0008)
  515. #define TRIAGE_DUMP_THREAD (0x0010)
  516. #define TRIAGE_DUMP_STACK (0x0020)
  517. #define TRIAGE_DUMP_DRIVER_LIST (0x0040)
  518. #define TRIAGE_DUMP_BROKEN_DRIVER (0x0080)
  519. #define TRIAGE_DUMP_BASIC_INFO (0x00FF)
  520. #define TRIAGE_DUMP_MMINFO (0x0100)
  521. #define TRIAGE_DUMP_DATAPAGE (0x0200)
  522. #define TRIAGE_DUMP_DEBUGGER_DATA (0x0400)
  523. #define TRIAGE_DUMP_DATA_BLOCKS (0x0800)
  524. #define TRIAGE_OPTION_OVERFLOWED (0x0100)
  525. #define TRIAGE_DUMP_VALID ( 'DGRT' )
  526. #define TRIAGE_DUMP_SIZE32 ( 0x1000 * 16 )
  527. #define TRIAGE_DUMP_SIZE64 ( 0x2000 * 16 )
  528. #ifdef _NTLDRAPI_
  529. typedef struct _DUMP_DRIVER_ENTRY32 {
  530. ULONG DriverNameOffset;
  531. KLDR_DATA_TABLE_ENTRY32 LdrEntry;
  532. } DUMP_DRIVER_ENTRY32, * PDUMP_DRIVER_ENTRY32;
  533. typedef struct _DUMP_DRIVER_ENTRY64 {
  534. ULONG DriverNameOffset;
  535. ULONG __alignment;
  536. KLDR_DATA_TABLE_ENTRY64 LdrEntry;
  537. } DUMP_DRIVER_ENTRY64, * PDUMP_DRIVER_ENTRY64;
  538. #endif // _NTLDRAPI
  539. //
  540. // The DUMP_STRING is guaranteed to be both NULL terminated and length prefixed
  541. // (prefix does not include the NULL).
  542. //
  543. typedef struct _DUMP_STRING {
  544. ULONG Length; // Length IN BYTES of the string.
  545. WCHAR Buffer [0]; // Buffer.
  546. } DUMP_STRING, * PDUMP_STRING;
  547. //
  548. // Secondary dumps can be generated at bugcheck time after
  549. // the primary dump has been generated. The data in these
  550. // dumps is arbitrary and not interpretable, so the file
  551. // format is just a sequence of tagged blobs.
  552. //
  553. // Each blob header is aligned on an eight-byte boundary
  554. // and the data immediately follows it. Padding
  555. // may precede and/or follow the data for alignment purposes.
  556. //
  557. // Blobs are streamed into the file so there is no overall count.
  558. //
  559. #define DUMP_BLOB_SIGNATURE1 'pmuD'
  560. #define DUMP_BLOB_SIGNATURE2 'bolB'
  561. typedef struct _DUMP_BLOB_FILE_HEADER {
  562. ULONG Signature1;
  563. ULONG Signature2;
  564. ULONG HeaderSize;
  565. ULONG BuildNumber;
  566. } DUMP_BLOB_FILE_HEADER, *PDUMP_BLOB_FILE_HEADER;
  567. typedef struct _DUMP_BLOB_HEADER {
  568. ULONG HeaderSize;
  569. GUID Tag;
  570. ULONG DataSize;
  571. ULONG PrePad;
  572. ULONG PostPad;
  573. } DUMP_BLOB_HEADER, *PDUMP_BLOB_HEADER;
  574. #ifdef __cplusplus
  575. }
  576. #endif
  577. //
  578. // These defines should be used only by components
  579. // that know the architecture of the dump matches
  580. // the architecture of the machine they are on; i.e.,
  581. // the kernel and savedump. In particular, the debugger
  582. // should always explicitly use either the 32 or
  583. // 64 bit versions of the headers.
  584. //
  585. #ifndef __NTSDP_HPP__
  586. #if defined (_WIN64)
  587. typedef DUMP_HEADER64 DUMP_HEADER;
  588. typedef PDUMP_HEADER64 PDUMP_HEADER;
  589. typedef MEMORY_DUMP64 MEMORY_DUMP;
  590. typedef PMEMORY_DUMP64 PMEMORY_DUMP;
  591. typedef SUMMARY_DUMP64 SUMMARY_DUMP;
  592. typedef PSUMMARY_DUMP64 PSUMMARY_DUMP;
  593. typedef TRIAGE_DUMP64 TRIAGE_DUMP;
  594. typedef PTRIAGE_DUMP64 PTRIAGE_DUMP;
  595. #ifdef _NTLDRAPI_
  596. typedef DUMP_DRIVER_ENTRY64 DUMP_DRIVER_ENTRY;
  597. typedef PDUMP_DRIVER_ENTRY64 PDUMP_DRIVER_ENTRY;
  598. #endif
  599. #define DUMP_SIGNATURE DUMP_SIGNATURE64
  600. #define DUMP_VALID_DUMP DUMP_VALID_DUMP64
  601. #define TRIAGE_DUMP_SIZE TRIAGE_DUMP_SIZE64
  602. typedef PPHYSICAL_MEMORY_RUN64 PPHYSICAL_MEMORYRUN;
  603. typedef PPHYSICAL_MEMORY_DESCRIPTOR64 PPHYSICAL_MEMORYDESCRIPTOR;
  604. #else
  605. typedef DUMP_HEADER32 DUMP_HEADER;
  606. typedef PDUMP_HEADER32 PDUMP_HEADER;
  607. typedef MEMORY_DUMP32 MEMORY_DUMP;
  608. typedef PMEMORY_DUMP32 PMEMORY_DUMP;
  609. typedef SUMMARY_DUMP32 SUMMARY_DUMP;
  610. typedef PSUMMARY_DUMP32 PSUMMARY_DUMP;
  611. typedef TRIAGE_DUMP32 TRIAGE_DUMP;
  612. typedef PTRIAGE_DUMP32 PTRIAGE_DUMP;
  613. #ifdef _NTLDRAPI_
  614. typedef DUMP_DRIVER_ENTRY32 DUMP_DRIVER_ENTRY;
  615. typedef PDUMP_DRIVER_ENTRY32 PDUMP_DRIVER_ENTRY;
  616. #endif
  617. #define DUMP_SIGNATURE DUMP_SIGNATURE32
  618. #define DUMP_VALID_DUMP DUMP_VALID_DUMP32
  619. #define TRIAGE_DUMP_SIZE TRIAGE_DUMP_SIZE32
  620. typedef PPHYSICAL_MEMORY_RUN32 PPHYSICAL_MEMORYRUN;
  621. typedef PPHYSICAL_MEMORY_DESCRIPTOR32 PPHYSICAL_MEMORYDESCRIPTOR;
  622. #endif
  623. #endif
  624. #ifndef MIDL_PASS
  625. #if _MSC_VER >= 1200
  626. #pragma warning(pop)
  627. #else
  628. #pragma warning( default : 4200 ) // nonstandard extension used : zero-sized array in struct/union
  629. #endif
  630. #endif // MIDL_PASS
  631. #endif // _NTIODUMP_