xref: /reactos/ntoskrnl/kd64/kddata.c (revision 8a978a17)
1 /*
2  * PROJECT:         ReactOS Kernel
3  * LICENSE:         GPL - See COPYING in the top level directory
4  * FILE:            ntoskrnl/kd64/kddata.c
5  * PURPOSE:         Contains all global variables and settings for KD64
6  * PROGRAMMERS:     Alex Ionescu (alex.ionescu@reactos.org)
7  */
8 
9 /* INCLUDES ******************************************************************/
10 
11 #include <ntoskrnl.h>
12 #define NDEBUG
13 #include <debug.h>
14 #include <mm/ARM3/miarm.h>
15 #undef MmSystemRangeStart
16 
17 VOID NTAPI RtlpBreakWithStatusInstruction(VOID);
18 
19 //
20 // Apply the KIPCR WDK workaround for x86 and AMD64
21 //
22 #if defined(_M_IX86) || defined(_M_AMD64)
23 #define KPCR KIPCR
24 #endif
25 
26 #if defined(_M_IX86)
27 
28 #define KPCR_SELF_PCR_OFFSET           FIELD_OFFSET(KPCR, SelfPcr)
29 #define KPCR_CURRENT_PRCB_OFFSET       FIELD_OFFSET(KPCR, Prcb)
30 #define KPCR_CONTAINED_PRCB_OFFSET     FIELD_OFFSET(KPCR, PrcbData)
31 #define KPCR_INITIAL_STACK_OFFSET      0
32 #define KPCR_STACK_LIMIT_OFFSET        0
33 #define KPRCB_PCR_PAGE_OFFSET          0
34 #define CBSTACK_FRAME_POINTER          Ebp
35 
36 #elif defined(_M_AMD64)
37 
38 #define KPCR_SELF_PCR_OFFSET           FIELD_OFFSET(KPCR, Self)
39 #define KPCR_CURRENT_PRCB_OFFSET       FIELD_OFFSET(KPCR, CurrentPrcb)
40 #define KPCR_CONTAINED_PRCB_OFFSET     FIELD_OFFSET(KPCR, Prcb)
41 #define KPCR_INITIAL_STACK_OFFSET      0
42 #define KPCR_STACK_LIMIT_OFFSET        0
43 #define KPRCB_PCR_PAGE_OFFSET          0
44 #define CBSTACK_FRAME_POINTER          Rbp
45 
46 #elif defined(_M_ARM)
47 
48 #define KPCR_SELF_PCR_OFFSET           0
49 #define KPCR_CURRENT_PRCB_OFFSET       FIELD_OFFSET(KIPCR, Prcb)
50 #define KPCR_CONTAINED_PRCB_OFFSET     0
51 #define KPCR_INITIAL_STACK_OFFSET      FIELD_OFFSET(KPCR, InitialStack)
52 #define KPCR_STACK_LIMIT_OFFSET        FIELD_OFFSET(KPCR, StackLimit)
53 #define KPRCB_PCR_PAGE_OFFSET          FIELD_OFFSET(KPRCB, PcrPage)
54 #define CBSTACK_FRAME_POINTER          DummyFramePointer
55 
56 #else
57 #error Unsupported Architecture
58 #endif
59 
60 /* GLOBALS *******************************************************************/
61 
62 //
63 // Debugger State
64 //
65 KD_CONTEXT KdpContext;
66 BOOLEAN KdpPortLocked;
67 KSPIN_LOCK KdpDebuggerLock;
68 BOOLEAN KdpControlCPressed;
69 BOOLEAN KdpContextSent;
70 
71 //
72 // Debug Trap Handlers
73 //
74 #ifdef _WINKD_
75 PKDEBUG_ROUTINE KiDebugRoutine = KdpStub;
76 PKDEBUG_SWITCH_ROUTINE KiDebugSwitchRoutine;
77 #endif
78 
79 //
80 // Debugger Configuration Settings
81 //
82 #ifdef _WINKD_
83 BOOLEAN KdBreakAfterSymbolLoad;
84 BOOLEAN KdPitchDebugger;
85 BOOLEAN KdDebuggerNotPresent;
86 BOOLEAN KdDebuggerEnabled;
87 BOOLEAN KdAutoEnableOnEvent;
88 BOOLEAN KdBlockEnable;
89 BOOLEAN KdIgnoreUmExceptions;
90 BOOLEAN KdPreviouslyEnabled;
91 BOOLEAN KdpDebuggerStructuresInitialized;
92 BOOLEAN KdEnteredDebugger;
93 ULONG KdDisableCount;
94 LARGE_INTEGER KdPerformanceCounterRate;
95 #endif
96 
97 //
98 // Breakpoint Data
99 //
100 BREAKPOINT_ENTRY KdpBreakpointTable[KD_BREAKPOINT_MAX];
101 KD_BREAKPOINT_TYPE KdpBreakpointInstruction = KD_BREAKPOINT_VALUE;
102 BOOLEAN KdpOweBreakpoint;
103 BOOLEAN BreakpointsSuspended;
104 ULONG KdpNumInternalBreakpoints;
105 
106 //
107 // Symbol Data
108 //
109 ULONG_PTR KdpCurrentSymbolStart, KdpCurrentSymbolEnd;
110 
111 //
112 // Tracepoint Data
113 //
114 ULONG TraceDataBuffer[40];
115 ULONG TraceDataBufferPosition = 1;
116 
117 //
118 // Time Slip Support
119 //
120 KDPC KdpTimeSlipDpc;
121 KTIMER KdpTimeSlipTimer;
122 WORK_QUEUE_ITEM KdpTimeSlipWorkItem;
123 LONG KdpTimeSlipPending = 1;
124 PKEVENT KdpTimeSlipEvent;
125 KSPIN_LOCK KdpTimeSlipEventLock;
126 LARGE_INTEGER KdTimerStop, KdTimerStart, KdTimerDifference;
127 
128 //
129 // Buffers
130 //
131 CHAR KdpMessageBuffer[0x1000];
132 CHAR KdpPathBuffer[0x1000];
133 
134 //
135 // KdPrint Buffers
136 //
137 CHAR KdPrintDefaultCircularBuffer[KD_DEFAULT_LOG_BUFFER_SIZE];
138 PCHAR KdPrintWritePointer = KdPrintDefaultCircularBuffer;
139 ULONG KdPrintRolloverCount;
140 PCHAR KdPrintCircularBuffer = KdPrintDefaultCircularBuffer;
141 ULONG KdPrintBufferSize = sizeof(KdPrintDefaultCircularBuffer);
142 ULONG KdPrintBufferChanges = 0;
143 
144 //
145 // Debug Filter Masks
146 //
147 ULONG Kd_WIN2000_Mask = 1;
148 ULONG Kd_SYSTEM_Mask;
149 ULONG Kd_SMSS_Mask;
150 ULONG Kd_SETUP_Mask;
151 ULONG Kd_NTFS_Mask;
152 ULONG Kd_FSTUB_Mask;
153 ULONG Kd_CRASHDUMP_Mask;
154 ULONG Kd_CDAUDIO_Mask;
155 ULONG Kd_CDROM_Mask;
156 ULONG Kd_CLASSPNP_Mask;
157 ULONG Kd_DISK_Mask;
158 ULONG Kd_REDBOOK_Mask;
159 ULONG Kd_STORPROP_Mask;
160 ULONG Kd_SCSIPORT_Mask;
161 ULONG Kd_SCSIMINIPORT_Mask;
162 ULONG Kd_CONFIG_Mask;
163 ULONG Kd_I8042PRT_Mask;
164 ULONG Kd_SERMOUSE_Mask;
165 ULONG Kd_LSERMOUS_Mask;
166 ULONG Kd_KBDHID_Mask;
167 ULONG Kd_MOUHID_Mask;
168 ULONG Kd_KBDCLASS_Mask;
169 ULONG Kd_MOUCLASS_Mask;
170 ULONG Kd_TWOTRACK_Mask;
171 ULONG Kd_WMILIB_Mask;
172 ULONG Kd_ACPI_Mask;
173 ULONG Kd_AMLI_Mask;
174 ULONG Kd_HALIA64_Mask;
175 ULONG Kd_VIDEO_Mask;
176 ULONG Kd_SVCHOST_Mask;
177 ULONG Kd_VIDEOPRT_Mask;
178 ULONG Kd_TCPIP_Mask;
179 ULONG Kd_DMSYNTH_Mask;
180 ULONG Kd_NTOSPNP_Mask;
181 ULONG Kd_FASTFAT_Mask;
182 ULONG Kd_SAMSS_Mask;
183 ULONG Kd_PNPMGR_Mask;
184 ULONG Kd_NETAPI_Mask;
185 ULONG Kd_SCSERVER_Mask;
186 ULONG Kd_SCCLIENT_Mask;
187 ULONG Kd_SERIAL_Mask;
188 ULONG Kd_SERENUM_Mask;
189 ULONG Kd_UHCD_Mask;
190 ULONG Kd_RPCPROXY_Mask;
191 ULONG Kd_AUTOCHK_Mask;
192 ULONG Kd_DCOMSS_Mask;
193 ULONG Kd_UNIMODEM_Mask;
194 ULONG Kd_SIS_Mask;
195 ULONG Kd_FLTMGR_Mask;
196 ULONG Kd_WMICORE_Mask;
197 ULONG Kd_BURNENG_Mask;
198 ULONG Kd_IMAPI_Mask;
199 ULONG Kd_SXS_Mask;
200 ULONG Kd_FUSION_Mask;
201 ULONG Kd_IDLETASK_Mask;
202 ULONG Kd_SOFTPCI_Mask;
203 ULONG Kd_TAPE_Mask;
204 ULONG Kd_MCHGR_Mask;
205 ULONG Kd_IDEP_Mask;
206 ULONG Kd_PCIIDE_Mask;
207 ULONG Kd_FLOPPY_Mask;
208 ULONG Kd_FDC_Mask;
209 ULONG Kd_TERMSRV_Mask;
210 ULONG Kd_W32TIME_Mask;
211 ULONG Kd_PREFETCHER_Mask;
212 ULONG Kd_RSFILTER_Mask;
213 ULONG Kd_FCPORT_Mask;
214 ULONG Kd_PCI_Mask;
215 ULONG Kd_DMIO_Mask;
216 ULONG Kd_DMCONFIG_Mask;
217 ULONG Kd_DMADMIN_Mask;
218 ULONG Kd_WSOCKTRANSPORT_Mask;
219 ULONG Kd_VSS_Mask;
220 ULONG Kd_PNPMEM_Mask;
221 ULONG Kd_PROCESSOR_Mask;
222 ULONG Kd_DMSERVER_Mask;
223 ULONG Kd_SR_Mask;
224 ULONG Kd_INFINIBAND_Mask;
225 ULONG Kd_IHVDRIVER_Mask;
226 ULONG Kd_IHVVIDEO_Mask;
227 ULONG Kd_IHVAUDIO_Mask;
228 ULONG Kd_IHVNETWORK_Mask;
229 ULONG Kd_IHVSTREAMING_Mask;
230 ULONG Kd_IHVBUS_Mask;
231 ULONG Kd_HPS_Mask;
232 ULONG Kd_RTLTHREADPOOL_Mask;
233 ULONG Kd_LDR_Mask;
234 ULONG Kd_TCPIP6_Mask;
235 ULONG Kd_ISAPNP_Mask;
236 ULONG Kd_SHPC_Mask;
237 ULONG Kd_STORPORT_Mask;
238 ULONG Kd_STORMINIPORT_Mask;
239 ULONG Kd_PRINTSPOOLER_Mask;
240 ULONG Kd_VSSDYNDISK_Mask;
241 ULONG Kd_VERIFIER_Mask;
242 ULONG Kd_VDS_Mask;
243 ULONG Kd_VDSBAS_Mask;
244 ULONG Kd_VDSDYN_Mask;   // Specified in Vista+
245 ULONG Kd_VDSDYNDR_Mask;
246 ULONG Kd_VDSLDR_Mask;   // Specified in Vista+
247 ULONG Kd_VDSUTIL_Mask;
248 ULONG Kd_DFRGIFC_Mask;
249 ULONG Kd_DEFAULT_Mask;
250 ULONG Kd_MM_Mask;
251 ULONG Kd_DFSC_Mask;
252 ULONG Kd_WOW64_Mask;
253 //
254 // Components specified in Vista+, some of which we also use in ReactOS
255 //
256 ULONG Kd_ALPC_Mask;
257 ULONG Kd_WDI_Mask;
258 ULONG Kd_PERFLIB_Mask;
259 ULONG Kd_KTM_Mask;
260 ULONG Kd_IOSTRESS_Mask;
261 ULONG Kd_HEAP_Mask;
262 ULONG Kd_WHEA_Mask;
263 ULONG Kd_USERGDI_Mask;
264 ULONG Kd_MMCSS_Mask;
265 ULONG Kd_TPM_Mask;
266 ULONG Kd_THREADORDER_Mask;
267 ULONG Kd_ENVIRON_Mask;
268 ULONG Kd_EMS_Mask;
269 ULONG Kd_WDT_Mask;
270 ULONG Kd_FVEVOL_Mask;
271 ULONG Kd_NDIS_Mask;
272 ULONG Kd_NVCTRACE_Mask;
273 ULONG Kd_LUAFV_Mask;
274 ULONG Kd_APPCOMPAT_Mask;
275 ULONG Kd_USBSTOR_Mask;
276 ULONG Kd_SBP2PORT_Mask;
277 ULONG Kd_COVERAGE_Mask;
278 ULONG Kd_CACHEMGR_Mask;
279 ULONG Kd_MOUNTMGR_Mask;
280 ULONG Kd_CFR_Mask;
281 ULONG Kd_TXF_Mask;
282 ULONG Kd_KSECDD_Mask;
283 ULONG Kd_FLTREGRESS_Mask;
284 ULONG Kd_MPIO_Mask;
285 ULONG Kd_MSDSM_Mask;
286 ULONG Kd_UDFS_Mask;
287 ULONG Kd_PSHED_Mask;
288 ULONG Kd_STORVSP_Mask;
289 ULONG Kd_LSASS_Mask;
290 ULONG Kd_SSPICLI_Mask;
291 ULONG Kd_CNG_Mask;
292 ULONG Kd_EXFAT_Mask;
293 ULONG Kd_FILETRACE_Mask;
294 ULONG Kd_XSAVE_Mask;
295 ULONG Kd_SE_Mask;
296 ULONG Kd_DRIVEEXTENDER_Mask;
297 //
298 // Components specified in Windows 8
299 //
300 ULONG Kd_POWER_Mask;
301 ULONG Kd_CRASHDUMPXHCI_Mask;
302 ULONG Kd_GPIO_Mask;
303 ULONG Kd_REFS_Mask;
304 ULONG Kd_WER_Mask;
305 //
306 // Components specified in Windows 10
307 //
308 ULONG Kd_CAPIMG_Mask;
309 ULONG Kd_VPCI_Mask;
310 ULONG Kd_STORAGECLASSMEMORY_Mask;
311 ULONG Kd_FSLIB_Mask;
312 // End Mask
313 ULONG Kd_ENDOFTABLE_Mask;
314 
315 //
316 // Debug Filter Component Table
317 //
318 PULONG KdComponentTable[MAX_KD_COMPONENT_TABLE_ENTRIES] =
319 {
320     &Kd_SYSTEM_Mask,
321     &Kd_SMSS_Mask,
322     &Kd_SETUP_Mask,
323     &Kd_NTFS_Mask,
324     &Kd_FSTUB_Mask,
325     &Kd_CRASHDUMP_Mask,
326     &Kd_CDAUDIO_Mask,
327     &Kd_CDROM_Mask,
328     &Kd_CLASSPNP_Mask,
329     &Kd_DISK_Mask,
330     &Kd_REDBOOK_Mask,
331     &Kd_STORPROP_Mask,
332     &Kd_SCSIPORT_Mask,
333     &Kd_SCSIMINIPORT_Mask,
334     &Kd_CONFIG_Mask,
335     &Kd_I8042PRT_Mask,
336     &Kd_SERMOUSE_Mask,
337     &Kd_LSERMOUS_Mask,
338     &Kd_KBDHID_Mask,
339     &Kd_MOUHID_Mask,
340     &Kd_KBDCLASS_Mask,
341     &Kd_MOUCLASS_Mask,
342     &Kd_TWOTRACK_Mask,
343     &Kd_WMILIB_Mask,
344     &Kd_ACPI_Mask,
345     &Kd_AMLI_Mask,
346     &Kd_HALIA64_Mask,
347     &Kd_VIDEO_Mask,
348     &Kd_SVCHOST_Mask,
349     &Kd_VIDEOPRT_Mask,
350     &Kd_TCPIP_Mask,
351     &Kd_DMSYNTH_Mask,
352     &Kd_NTOSPNP_Mask,
353     &Kd_FASTFAT_Mask,
354     &Kd_SAMSS_Mask,
355     &Kd_PNPMGR_Mask,
356     &Kd_NETAPI_Mask,
357     &Kd_SCSERVER_Mask,
358     &Kd_SCCLIENT_Mask,
359     &Kd_SERIAL_Mask,
360     &Kd_SERENUM_Mask,
361     &Kd_UHCD_Mask,
362     &Kd_RPCPROXY_Mask,
363     &Kd_AUTOCHK_Mask,
364     &Kd_DCOMSS_Mask,
365     &Kd_UNIMODEM_Mask,
366     &Kd_SIS_Mask,
367     &Kd_FLTMGR_Mask,
368     &Kd_WMICORE_Mask,
369     &Kd_BURNENG_Mask,
370     &Kd_IMAPI_Mask,
371     &Kd_SXS_Mask,
372     &Kd_FUSION_Mask,
373     &Kd_IDLETASK_Mask,
374     &Kd_SOFTPCI_Mask,
375     &Kd_TAPE_Mask,
376     &Kd_MCHGR_Mask,
377     &Kd_IDEP_Mask,
378     &Kd_PCIIDE_Mask,
379     &Kd_FLOPPY_Mask,
380     &Kd_FDC_Mask,
381     &Kd_TERMSRV_Mask,
382     &Kd_W32TIME_Mask,
383     &Kd_PREFETCHER_Mask,
384     &Kd_RSFILTER_Mask,
385     &Kd_FCPORT_Mask,
386     &Kd_PCI_Mask,
387     &Kd_DMIO_Mask,
388     &Kd_DMCONFIG_Mask,
389     &Kd_DMADMIN_Mask,
390     &Kd_WSOCKTRANSPORT_Mask,
391     &Kd_VSS_Mask,
392     &Kd_PNPMEM_Mask,
393     &Kd_PROCESSOR_Mask,
394     &Kd_DMSERVER_Mask,
395     &Kd_SR_Mask,
396     &Kd_INFINIBAND_Mask,
397     &Kd_IHVDRIVER_Mask,
398     &Kd_IHVVIDEO_Mask,
399     &Kd_IHVAUDIO_Mask,
400     &Kd_IHVNETWORK_Mask,
401     &Kd_IHVSTREAMING_Mask,
402     &Kd_IHVBUS_Mask,
403     &Kd_HPS_Mask,
404     &Kd_RTLTHREADPOOL_Mask,
405     &Kd_LDR_Mask,
406     &Kd_TCPIP6_Mask,
407     &Kd_ISAPNP_Mask,
408     &Kd_SHPC_Mask,
409     &Kd_STORPORT_Mask,
410     &Kd_STORMINIPORT_Mask,
411     &Kd_PRINTSPOOLER_Mask,
412     &Kd_VSSDYNDISK_Mask,
413     &Kd_VERIFIER_Mask,
414     &Kd_VDS_Mask,
415     &Kd_VDSBAS_Mask,
416     &Kd_VDSDYN_Mask,    // Specified in Vista+
417     &Kd_VDSDYNDR_Mask,
418     &Kd_VDSLDR_Mask,    // Specified in Vista+
419     &Kd_VDSUTIL_Mask,
420     &Kd_DFRGIFC_Mask,
421     &Kd_DEFAULT_Mask,
422     &Kd_MM_Mask,
423     &Kd_DFSC_Mask,
424     &Kd_WOW64_Mask,
425 //
426 // Components specified in Vista+, some of which we also use in ReactOS
427 //
428     &Kd_ALPC_Mask,
429     &Kd_WDI_Mask,
430     &Kd_PERFLIB_Mask,
431     &Kd_KTM_Mask,
432     &Kd_IOSTRESS_Mask,
433     &Kd_HEAP_Mask,
434     &Kd_WHEA_Mask,
435     &Kd_USERGDI_Mask,
436     &Kd_MMCSS_Mask,
437     &Kd_TPM_Mask,
438     &Kd_THREADORDER_Mask,
439     &Kd_ENVIRON_Mask,
440     &Kd_EMS_Mask,
441     &Kd_WDT_Mask,
442     &Kd_FVEVOL_Mask,
443     &Kd_NDIS_Mask,
444     &Kd_NVCTRACE_Mask,
445     &Kd_LUAFV_Mask,
446     &Kd_APPCOMPAT_Mask,
447     &Kd_USBSTOR_Mask,
448     &Kd_SBP2PORT_Mask,
449     &Kd_COVERAGE_Mask,
450     &Kd_CACHEMGR_Mask,
451     &Kd_MOUNTMGR_Mask,
452     &Kd_CFR_Mask,
453     &Kd_TXF_Mask,
454     &Kd_KSECDD_Mask,
455     &Kd_FLTREGRESS_Mask,
456     &Kd_MPIO_Mask,
457     &Kd_MSDSM_Mask,
458     &Kd_UDFS_Mask,
459     &Kd_PSHED_Mask,
460     &Kd_STORVSP_Mask,
461     &Kd_LSASS_Mask,
462     &Kd_SSPICLI_Mask,
463     &Kd_CNG_Mask,
464     &Kd_EXFAT_Mask,
465     &Kd_FILETRACE_Mask,
466     &Kd_XSAVE_Mask,
467     &Kd_SE_Mask,
468     &Kd_DRIVEEXTENDER_Mask,
469 //
470 // Components specified in Windows 8
471 //
472     &Kd_POWER_Mask,
473     &Kd_CRASHDUMPXHCI_Mask,
474     &Kd_GPIO_Mask,
475     &Kd_REFS_Mask,
476     &Kd_WER_Mask,
477 //
478 // Components specified in Windows 10
479 //
480     &Kd_CAPIMG_Mask,
481     &Kd_VPCI_Mask,
482     &Kd_STORAGECLASSMEMORY_Mask,
483     &Kd_FSLIB_Mask,
484 // End Mask
485     &Kd_ENDOFTABLE_Mask,
486 };
487 
488 ULONG KdComponentTableSize = RTL_NUMBER_OF(KdComponentTable);
489 
490 //
491 // Debugger Data
492 //
493 LIST_ENTRY KdpDebuggerDataListHead;
494 KSPIN_LOCK KdpDataSpinLock;
495 
496 //
497 // Debugger Version and Data Block
498 //
499 DBGKD_GET_VERSION64 KdVersionBlock =
500 {
501     0,
502     0,
503     DBGKD_64BIT_PROTOCOL_VERSION2,
504     CURRENT_KD_SECONDARY_VERSION,
505 #if defined(_M_AMD64) || defined(_M_ARM64)
506     DBGKD_VERS_FLAG_DATA | DBGKD_VERS_FLAG_PTR64,
507 #else
508     DBGKD_VERS_FLAG_DATA,
509 #endif
510     IMAGE_FILE_MACHINE_NATIVE,
511     PACKET_TYPE_MAX,
512     0,
513     0,
514     DBGKD_SIMULATION_NONE,
515     {0},
516     0,
517     0,
518     0
519 };
520 KDDEBUGGER_DATA64 KdDebuggerDataBlock =
521 {
522     {{0}},
523     0,
524     {(ULONG_PTR)RtlpBreakWithStatusInstruction},
525     0,
526     FIELD_OFFSET(KTHREAD, CallbackStack),
527 #if defined(_M_ARM) || defined(_M_AMD64)
528     0,
529     0,
530 #else
531     FIELD_OFFSET(KCALLOUT_FRAME, CallbackStack),
532     FIELD_OFFSET(KCALLOUT_FRAME, CBSTACK_FRAME_POINTER),
533 #endif
534     FALSE,
535     {(ULONG_PTR)KiCallUserMode},
536     0,
537     {(ULONG_PTR)&PsLoadedModuleList},
538     {(ULONG_PTR)&PsActiveProcessHead},
539     {(ULONG_PTR)&PspCidTable},
540     {(ULONG_PTR)&ExpSystemResourcesList},
541     {(ULONG_PTR)ExpPagedPoolDescriptor},
542     {(ULONG_PTR)&ExpNumberOfPagedPools},
543     {(ULONG_PTR)&KeTimeIncrement},
544     {(ULONG_PTR)&KeBugcheckCallbackListHead},
545     {(ULONG_PTR)KiBugCheckData},
546     {(ULONG_PTR)&IopErrorLogListHead},
547     {(ULONG_PTR)&ObpRootDirectoryObject},
548     {(ULONG_PTR)&ObpTypeObjectType},
549     {(ULONG_PTR)&MmSystemCacheStart},
550     {(ULONG_PTR)&MmSystemCacheEnd},
551     {(ULONG_PTR)&MmSystemCacheWs},
552     {(ULONG_PTR)&MmPfnDatabase},
553     {(ULONG_PTR)MmSystemPtesStart},
554     {(ULONG_PTR)MmSystemPtesEnd},
555     {(ULONG_PTR)&MmSubsectionBase},
556     {(ULONG_PTR)&MmNumberOfPagingFiles},
557     {(ULONG_PTR)&MmLowestPhysicalPage},
558     {(ULONG_PTR)&MmHighestPhysicalPage},
559     {(ULONG_PTR)&MmNumberOfPhysicalPages},
560     {(ULONG_PTR)&MmMaximumNonPagedPoolInBytes},
561     {(ULONG_PTR)&MmNonPagedSystemStart},
562     {(ULONG_PTR)&MmNonPagedPoolStart},
563     {(ULONG_PTR)&MmNonPagedPoolEnd},
564     {(ULONG_PTR)&MmPagedPoolStart},
565     {(ULONG_PTR)&MmPagedPoolEnd},
566     {(ULONG_PTR)&MmPagedPoolInfo},
567     PAGE_SIZE,
568     {(ULONG_PTR)&MmSizeOfPagedPoolInBytes},
569     {(ULONG_PTR)&MmTotalCommitLimit},
570     {(ULONG_PTR)&MmTotalCommittedPages},
571     {(ULONG_PTR)&MmSharedCommit},
572     {(ULONG_PTR)&MmDriverCommit},
573     {(ULONG_PTR)&MmProcessCommit},
574     {(ULONG_PTR)&MmPagedPoolCommit},
575     {0},
576     {(ULONG_PTR)&MmZeroedPageListHead},
577     {(ULONG_PTR)&MmFreePageListHead},
578     {(ULONG_PTR)&MmStandbyPageListHead},
579     {(ULONG_PTR)&MmModifiedPageListHead},
580     {(ULONG_PTR)&MmModifiedNoWritePageListHead},
581     {(ULONG_PTR)&MmAvailablePages},
582     {(ULONG_PTR)&MmResidentAvailablePages},
583     {(ULONG_PTR)&PoolTrackTable},
584     {(ULONG_PTR)&NonPagedPoolDescriptor},
585     {(ULONG_PTR)&MmHighestUserAddress},
586     {(ULONG_PTR)&MmSystemRangeStart},
587     {(ULONG_PTR)&MmUserProbeAddress},
588     {(ULONG_PTR)KdPrintDefaultCircularBuffer},
589     {(ULONG_PTR)KdPrintDefaultCircularBuffer + 1},
590     {(ULONG_PTR)&KdPrintWritePointer},
591     {(ULONG_PTR)&KdPrintRolloverCount},
592     {(ULONG_PTR)&MmLoadedUserImageList},
593     {(ULONG_PTR)&NtBuildLab},
594     {0},
595     {(ULONG_PTR)KiProcessorBlock},
596     {(ULONG_PTR)&MmUnloadedDrivers},
597     {(ULONG_PTR)&MmLastUnloadedDrivers},
598     {(ULONG_PTR)&MmTriageActionTaken},
599     {(ULONG_PTR)&MmSpecialPoolTag},
600     {(ULONG_PTR)&KernelVerifier},
601     {(ULONG_PTR)&MmVerifierData},
602     {(ULONG_PTR)&MmAllocatedNonPagedPool},
603     {(ULONG_PTR)&MmPeakCommitment},
604     {(ULONG_PTR)&MmtotalCommitLimitMaximum},
605     {(ULONG_PTR)&CmNtCSDVersion},
606     {(ULONG_PTR)&MmPhysicalMemoryBlock},
607     {(ULONG_PTR)&MmSessionBase},
608     {(ULONG_PTR)&MmSessionSize},
609     {0},
610     {0},
611     FIELD_OFFSET(KTHREAD, NextProcessor),
612     FIELD_OFFSET(KTHREAD, Teb),
613     FIELD_OFFSET(KTHREAD, KernelStack),
614     FIELD_OFFSET(KTHREAD, InitialStack),
615     FIELD_OFFSET(KTHREAD, ApcState.Process),
616     FIELD_OFFSET(KTHREAD, State),
617     0,
618     0,
619     sizeof(EPROCESS),
620     FIELD_OFFSET(EPROCESS, Peb),
621     FIELD_OFFSET(EPROCESS, InheritedFromUniqueProcessId),
622     FIELD_OFFSET(EPROCESS, Pcb.DirectoryTableBase),
623     sizeof(KPRCB),
624     FIELD_OFFSET(KPRCB, DpcRoutineActive),
625     FIELD_OFFSET(KPRCB, CurrentThread),
626     FIELD_OFFSET(KPRCB, MHz),
627     FIELD_OFFSET(KPRCB, CpuType),
628     FIELD_OFFSET(KPRCB, VendorString),
629     FIELD_OFFSET(KPRCB, ProcessorState.ContextFrame),
630     FIELD_OFFSET(KPRCB, Number),
631     sizeof(ETHREAD),
632     {(ULONG_PTR)KdPrintDefaultCircularBuffer},
633     {(ULONG_PTR)&KdPrintBufferSize},
634     {(ULONG_PTR)&KeLoaderBlock},
635     sizeof(KPCR),
636     KPCR_SELF_PCR_OFFSET,
637     KPCR_CURRENT_PRCB_OFFSET,
638     KPCR_CONTAINED_PRCB_OFFSET,
639     0,
640     0,
641 #if defined(_M_ARM)
642     _WARN("KPCR_INITIAL_STACK_OFFSET, KPCR_STACK_LIMIT_OFFSET and KPRCB_PCR_PAGE_OFFSET not properly defined on ARM")
643     0,
644     0,
645     0,
646 #else
647     KPCR_INITIAL_STACK_OFFSET,
648     KPCR_STACK_LIMIT_OFFSET,
649     KPRCB_PCR_PAGE_OFFSET,
650 #endif
651     FIELD_OFFSET(KPRCB, ProcessorState.SpecialRegisters),
652 #if defined(_M_IX86)
653     //
654     // x86 GDT/LDT/TSS constants
655     //
656     KGDT_R0_CODE,
657     KGDT_R0_DATA,
658     KGDT_R0_PCR,
659     KGDT_R3_CODE,
660     KGDT_R3_DATA,
661     KGDT_R3_TEB,
662     KGDT_LDT,
663     KGDT_TSS,
664     0,
665     0,
666 #elif defined(_M_AMD64)
667     //
668     // AMD64 GDT/LDT/TSS constants
669     //
670     KGDT64_R0_CODE,
671     KGDT64_R3_DATA,
672     KGDT64_R3_DATA,
673     KGDT64_R3_CODE,
674     KGDT64_R3_DATA,
675     KGDT64_R3_DATA,
676     0,
677     KGDT64_SYS_TSS,
678     0,
679     0,
680 #else
681     //
682     // No GDT/LDT/TSS on other architectures
683     //
684     0,
685     0,
686     0,
687     0,
688     0,
689     0,
690     0,
691     0,
692     0,
693     0,
694 #endif
695     {(ULONG_PTR)&IopNumTriageDumpDataBlocks},
696     {(ULONG_PTR)IopTriageDumpDataBlocks},
697 };
698