xref: /reactos/sdk/include/psdk/wdbgexts.h (revision c2c66aff)
1 #ifndef _WDBGEXTS_
2 #define _WDBGEXTS_
3 
4 enum
5 {
6     DBGKD_SIMULATION_NONE,
7     DBGKD_SIMULATION_EXDI
8 };
9 
10 #define KD_SECONDARY_VERSION_DEFAULT                    0
11 #define KD_SECONDARY_VERSION_AMD64_OBSOLETE_CONTEXT_1   0
12 #define KD_SECONDARY_VERSION_AMD64_OBSOLETE_CONTEXT_2   1
13 #define KD_SECONDARY_VERSION_AMD64_CONTEXT              2
14 
15 #if defined(_AMD64_)
16 #define CURRENT_KD_SECONDARY_VERSION                    KD_SECONDARY_VERSION_AMD64_CONTEXT
17 #else
18 #define CURRENT_KD_SECONDARY_VERSION                    KD_SECONDARY_VERSION_DEFAULT
19 #endif
20 
21 #define DBGKD_VERS_FLAG_MP                              0x0001
22 #define DBGKD_VERS_FLAG_DATA                            0x0002
23 #define DBGKD_VERS_FLAG_PTR64                           0x0004
24 #define DBGKD_VERS_FLAG_NOMM                            0x0008
25 #define DBGKD_VERS_FLAG_HSS                             0x0010
26 #define DBGKD_VERS_FLAG_PARTITIONS                      0x0020
27 
28 #define KDBG_TAG                                        'GBDK'
29 
30 typedef enum _DBGKD_MAJOR_TYPES
31 {
32     DBGKD_MAJOR_NT,
33     DBGKD_MAJOR_XBOX,
34     DBGKD_MAJOR_BIG,
35     DBGKD_MAJOR_EXDI,
36     DBGKD_MAJOR_NTBD,
37     DBGKD_MAJOR_EFI,
38     DBGKD_MAJOR_TNT,
39     DBGKD_MAJOR_SINGULARITY,
40     DBGKD_MAJOR_HYPERVISOR,
41     DBGKD_MAJOR_MIDORI,
42     DBGKD_MAJOR_COUNT
43 } DBGKD_MAJOR_TYPES;
44 
45 //
46 // The major type is in the high byte
47 //
48 #define DBGKD_MAJOR_TYPE(MajorVersion) \
49     ((DBGKD_MAJOR_TYPES)((MajorVersion) >> 8))
50 
51 typedef struct _DBGKD_GET_VERSION32
52 {
53     USHORT MajorVersion;
54     USHORT MinorVersion;
55     USHORT ProtocolVersion;
56     USHORT Flags;
57     ULONG KernBase;
58     ULONG PsLoadedModuleList;
59     USHORT MachineType;
60     USHORT ThCallbackStack;
61     USHORT NextCallback;
62     USHORT FramePointer;
63     ULONG KiCallUserMode;
64     ULONG KeUserCallbackDispatcher;
65     ULONG BreakpointWithStatus;
66     ULONG DebuggerDataList;
67 } DBGKD_GET_VERSION32, *PDBGKD_GET_VERSION32;
68 
69 typedef struct _DBGKD_DEBUG_DATA_HEADER32
70 {
71     LIST_ENTRY32 List;
72     ULONG OwnerTag;
73     ULONG Size;
74 } DBGKD_DEBUG_DATA_HEADER32, *PDBGKD_DEBUG_DATA_HEADER32;
75 
76 typedef struct _KDDEBUGGER_DATA32
77 {
78     DBGKD_DEBUG_DATA_HEADER32 Header;
79     ULONG KernBase;
80     ULONG BreakpointWithStatus;
81     ULONG SavedContext;
82     USHORT ThCallbackStack;
83     USHORT NextCallback;
84     USHORT FramePointer;
85     USHORT PaeEnabled:1;
86     ULONG KiCallUserMode;
87     ULONG KeUserCallbackDispatcher;
88     ULONG PsLoadedModuleList;
89     ULONG PsActiveProcessHead;
90     ULONG PspCidTable;
91     ULONG ExpSystemResourcesList;
92     ULONG ExpPagedPoolDescriptor;
93     ULONG ExpNumberOfPagedPools;
94     ULONG KeTimeIncrement;
95     ULONG KeBugCheckCallbackListHead;
96     ULONG KiBugcheckData;
97     ULONG IopErrorLogListHead;
98     ULONG ObpRootDirectoryObject;
99     ULONG ObpTypeObjectType;
100     ULONG MmSystemCacheStart;
101     ULONG MmSystemCacheEnd;
102     ULONG MmSystemCacheWs;
103     ULONG MmPfnDatabase;
104     ULONG MmSystemPtesStart;
105     ULONG MmSystemPtesEnd;
106     ULONG MmSubsectionBase;
107     ULONG MmNumberOfPagingFiles;
108     ULONG MmLowestPhysicalPage;
109     ULONG MmHighestPhysicalPage;
110     ULONG MmNumberOfPhysicalPages;
111     ULONG MmMaximumNonPagedPoolInBytes;
112     ULONG MmNonPagedSystemStart;
113     ULONG MmNonPagedPoolStart;
114     ULONG MmNonPagedPoolEnd;
115     ULONG MmPagedPoolStart;
116     ULONG MmPagedPoolEnd;
117     ULONG MmPagedPoolInformation;
118     ULONG MmPageSize;
119     ULONG MmSizeOfPagedPoolInBytes;
120     ULONG MmTotalCommitLimit;
121     ULONG MmTotalCommittedPages;
122     ULONG MmSharedCommit;
123     ULONG MmDriverCommit;
124     ULONG MmProcessCommit;
125     ULONG MmPagedPoolCommit;
126     ULONG MmExtendedCommit;
127     ULONG MmZeroedPageListHead;
128     ULONG MmFreePageListHead;
129     ULONG MmStandbyPageListHead;
130     ULONG MmModifiedPageListHead;
131     ULONG MmModifiedNoWritePageListHead;
132     ULONG MmAvailablePages;
133     ULONG MmResidentAvailablePages;
134     ULONG PoolTrackTable;
135     ULONG NonPagedPoolDescriptor;
136     ULONG MmHighestUserAddress;
137     ULONG MmSystemRangeStart;
138     ULONG MmUserProbeAddress;
139     ULONG KdPrintCircularBuffer;
140     ULONG KdPrintCircularBufferEnd;
141     ULONG KdPrintWritePointer;
142     ULONG KdPrintRolloverCount;
143     ULONG MmLoadedUserImageList;
144 } KDDEBUGGER_DATA32, *PKDDEBUGGER_DATA32;
145 
146 typedef struct _DBGKD_GET_VERSION64
147 {
148     USHORT MajorVersion;
149     USHORT MinorVersion;
150     UCHAR ProtocolVersion;
151     UCHAR KdSecondaryVersion;
152     USHORT Flags;
153     USHORT MachineType;
154     UCHAR MaxPacketType;
155     UCHAR MaxStateChange;
156     UCHAR MaxManipulate;
157     UCHAR Simulation;
158     USHORT Unused[1];
159     ULONG64 KernBase;
160     ULONG64 PsLoadedModuleList;
161     ULONG64 DebuggerDataList;
162 } DBGKD_GET_VERSION64, *PDBGKD_GET_VERSION64;
163 
164 typedef struct _DBGKD_DEBUG_DATA_HEADER64
165 {
166     LIST_ENTRY64 List;
167     ULONG OwnerTag;
168     ULONG Size;
169 } DBGKD_DEBUG_DATA_HEADER64, *PDBGKD_DEBUG_DATA_HEADER64;
170 
171 typedef union _GCC_ULONG64
172 {
173     ULONG_PTR Pointer;
174     ULONG64 RealPointer;
175 } GCC_ULONG64, *PGCC_ULONG64;
176 
177 typedef struct _KDDEBUGGER_DATA64
178 {
179     DBGKD_DEBUG_DATA_HEADER64 Header;
180     ULONG64 KernBase;
181     GCC_ULONG64 BreakpointWithStatus;
182     ULONG64 SavedContext;
183     USHORT ThCallbackStack;
184     USHORT NextCallback;
185     USHORT FramePointer;
186     USHORT PaeEnabled:1;
187     GCC_ULONG64 KiCallUserMode;
188     ULONG64 KeUserCallbackDispatcher;
189     GCC_ULONG64 PsLoadedModuleList;
190     GCC_ULONG64 PsActiveProcessHead;
191     GCC_ULONG64 PspCidTable;
192     GCC_ULONG64 ExpSystemResourcesList;
193     GCC_ULONG64 ExpPagedPoolDescriptor;
194     GCC_ULONG64 ExpNumberOfPagedPools;
195     GCC_ULONG64 KeTimeIncrement;
196     GCC_ULONG64 KeBugCheckCallbackListHead;
197     GCC_ULONG64 KiBugcheckData;
198     GCC_ULONG64 IopErrorLogListHead;
199     GCC_ULONG64 ObpRootDirectoryObject;
200     GCC_ULONG64 ObpTypeObjectType;
201     GCC_ULONG64 MmSystemCacheStart;
202     GCC_ULONG64 MmSystemCacheEnd;
203     GCC_ULONG64 MmSystemCacheWs;
204     GCC_ULONG64 MmPfnDatabase;
205     GCC_ULONG64 MmSystemPtesStart;
206     GCC_ULONG64 MmSystemPtesEnd;
207     GCC_ULONG64 MmSubsectionBase;
208     GCC_ULONG64 MmNumberOfPagingFiles;
209     GCC_ULONG64 MmLowestPhysicalPage;
210     GCC_ULONG64 MmHighestPhysicalPage;
211     GCC_ULONG64 MmNumberOfPhysicalPages;
212     GCC_ULONG64 MmMaximumNonPagedPoolInBytes;
213     GCC_ULONG64 MmNonPagedSystemStart;
214     GCC_ULONG64 MmNonPagedPoolStart;
215     GCC_ULONG64 MmNonPagedPoolEnd;
216     GCC_ULONG64 MmPagedPoolStart;
217     GCC_ULONG64 MmPagedPoolEnd;
218     GCC_ULONG64 MmPagedPoolInformation;
219     ULONG64 MmPageSize;
220     GCC_ULONG64 MmSizeOfPagedPoolInBytes;
221     GCC_ULONG64 MmTotalCommitLimit;
222     GCC_ULONG64 MmTotalCommittedPages;
223     GCC_ULONG64 MmSharedCommit;
224     GCC_ULONG64 MmDriverCommit;
225     GCC_ULONG64 MmProcessCommit;
226     GCC_ULONG64 MmPagedPoolCommit;
227     GCC_ULONG64 MmExtendedCommit;
228     GCC_ULONG64 MmZeroedPageListHead;
229     GCC_ULONG64 MmFreePageListHead;
230     GCC_ULONG64 MmStandbyPageListHead;
231     GCC_ULONG64 MmModifiedPageListHead;
232     GCC_ULONG64 MmModifiedNoWritePageListHead;
233     GCC_ULONG64 MmAvailablePages;
234     GCC_ULONG64 MmResidentAvailablePages;
235     GCC_ULONG64 PoolTrackTable;
236     GCC_ULONG64 NonPagedPoolDescriptor;
237     GCC_ULONG64 MmHighestUserAddress;
238     GCC_ULONG64 MmSystemRangeStart;
239     GCC_ULONG64 MmUserProbeAddress;
240     GCC_ULONG64 KdPrintCircularBuffer;
241     GCC_ULONG64 KdPrintCircularBufferEnd;
242     GCC_ULONG64 KdPrintWritePointer;
243     GCC_ULONG64 KdPrintRolloverCount;
244     GCC_ULONG64 MmLoadedUserImageList;
245     GCC_ULONG64 NtBuildLab;
246     GCC_ULONG64 KiNormalSystemCall;
247     GCC_ULONG64 KiProcessorBlock;
248     GCC_ULONG64 MmUnloadedDrivers;
249     GCC_ULONG64 MmLastUnloadedDriver;
250     GCC_ULONG64 MmTriageActionTaken;
251     GCC_ULONG64 MmSpecialPoolTag;
252     GCC_ULONG64 KernelVerifier;
253     GCC_ULONG64 MmVerifierData;
254     GCC_ULONG64 MmAllocatedNonPagedPool;
255     GCC_ULONG64 MmPeakCommitment;
256     GCC_ULONG64 MmTotalCommitLimitMaximum;
257     GCC_ULONG64 CmNtCSDVersion;
258     GCC_ULONG64 MmPhysicalMemoryBlock;
259     GCC_ULONG64 MmSessionBase;
260     GCC_ULONG64 MmSessionSize;
261     GCC_ULONG64 MmSystemParentTablePage;
262     GCC_ULONG64 MmVirtualTranslationBase;
263     USHORT OffsetKThreadNextProcessor;
264     USHORT OffsetKThreadTeb;
265     USHORT OffsetKThreadKernelStack;
266     USHORT OffsetKThreadInitialStack;
267     USHORT OffsetKThreadApcProcess;
268     USHORT OffsetKThreadState;
269     USHORT OffsetKThreadBStore;
270     USHORT OffsetKThreadBStoreLimit;
271     USHORT SizeEProcess;
272     USHORT OffsetEprocessPeb;
273     USHORT OffsetEprocessParentCID;
274     USHORT OffsetEprocessDirectoryTableBase;
275     USHORT SizePrcb;
276     USHORT OffsetPrcbDpcRoutine;
277     USHORT OffsetPrcbCurrentThread;
278     USHORT OffsetPrcbMhz;
279     USHORT OffsetPrcbCpuType;
280     USHORT OffsetPrcbVendorString;
281     USHORT OffsetPrcbProcStateContext;
282     USHORT OffsetPrcbNumber;
283     USHORT SizeEThread;
284     GCC_ULONG64 KdPrintCircularBufferPtr;
285     GCC_ULONG64 KdPrintBufferSize;
286     GCC_ULONG64 KeLoaderBlock;
287     USHORT SizePcr;
288     USHORT OffsetPcrSelfPcr;
289     USHORT OffsetPcrCurrentPrcb;
290     USHORT OffsetPcrContainedPrcb;
291     USHORT OffsetPcrInitialBStore;
292     USHORT OffsetPcrBStoreLimit;
293     USHORT OffsetPcrInitialStack;
294     USHORT OffsetPcrStackLimit;
295     USHORT OffsetPrcbPcrPage;
296     USHORT OffsetPrcbProcStateSpecialReg;
297     USHORT GdtR0Code;
298     USHORT GdtR0Data;
299     USHORT GdtR0Pcr;
300     USHORT GdtR3Code;
301     USHORT GdtR3Data;
302     USHORT GdtR3Teb;
303     USHORT GdtLdt;
304     USHORT GdtTss;
305     USHORT Gdt64R3CmCode;
306     USHORT Gdt64R3CmTeb;
307     GCC_ULONG64 IopNumTriageDumpDataBlocks;
308     GCC_ULONG64 IopTriageDumpDataBlocks;
309 #if 0 // Longhorn/Vista and later
310     GCC_ULONG64 VfCrashDataBlock;
311     GCC_ULONG64 MmBadPagesDetected;
312     GCC_ULONG64 MmZeroedPageSingleBitErrorsDetected;
313 #endif
314 } KDDEBUGGER_DATA64, *PKDDEBUGGER_DATA64;
315 
316 #endif
317