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 // End Mask 298 ULONG Kd_ENDOFTABLE_Mask; 299 300 // 301 // Debug Filter Component Table 302 // 303 PULONG KdComponentTable[MAX_KD_COMPONENT_TABLE_ENTRIES] = 304 { 305 &Kd_SYSTEM_Mask, 306 &Kd_SMSS_Mask, 307 &Kd_SETUP_Mask, 308 &Kd_NTFS_Mask, 309 &Kd_FSTUB_Mask, 310 &Kd_CRASHDUMP_Mask, 311 &Kd_CDAUDIO_Mask, 312 &Kd_CDROM_Mask, 313 &Kd_CLASSPNP_Mask, 314 &Kd_DISK_Mask, 315 &Kd_REDBOOK_Mask, 316 &Kd_STORPROP_Mask, 317 &Kd_SCSIPORT_Mask, 318 &Kd_SCSIMINIPORT_Mask, 319 &Kd_CONFIG_Mask, 320 &Kd_I8042PRT_Mask, 321 &Kd_SERMOUSE_Mask, 322 &Kd_LSERMOUS_Mask, 323 &Kd_KBDHID_Mask, 324 &Kd_MOUHID_Mask, 325 &Kd_KBDCLASS_Mask, 326 &Kd_MOUCLASS_Mask, 327 &Kd_TWOTRACK_Mask, 328 &Kd_WMILIB_Mask, 329 &Kd_ACPI_Mask, 330 &Kd_AMLI_Mask, 331 &Kd_HALIA64_Mask, 332 &Kd_VIDEO_Mask, 333 &Kd_SVCHOST_Mask, 334 &Kd_VIDEOPRT_Mask, 335 &Kd_TCPIP_Mask, 336 &Kd_DMSYNTH_Mask, 337 &Kd_NTOSPNP_Mask, 338 &Kd_FASTFAT_Mask, 339 &Kd_SAMSS_Mask, 340 &Kd_PNPMGR_Mask, 341 &Kd_NETAPI_Mask, 342 &Kd_SCSERVER_Mask, 343 &Kd_SCCLIENT_Mask, 344 &Kd_SERIAL_Mask, 345 &Kd_SERENUM_Mask, 346 &Kd_UHCD_Mask, 347 &Kd_RPCPROXY_Mask, 348 &Kd_AUTOCHK_Mask, 349 &Kd_DCOMSS_Mask, 350 &Kd_UNIMODEM_Mask, 351 &Kd_SIS_Mask, 352 &Kd_FLTMGR_Mask, 353 &Kd_WMICORE_Mask, 354 &Kd_BURNENG_Mask, 355 &Kd_IMAPI_Mask, 356 &Kd_SXS_Mask, 357 &Kd_FUSION_Mask, 358 &Kd_IDLETASK_Mask, 359 &Kd_SOFTPCI_Mask, 360 &Kd_TAPE_Mask, 361 &Kd_MCHGR_Mask, 362 &Kd_IDEP_Mask, 363 &Kd_PCIIDE_Mask, 364 &Kd_FLOPPY_Mask, 365 &Kd_FDC_Mask, 366 &Kd_TERMSRV_Mask, 367 &Kd_W32TIME_Mask, 368 &Kd_PREFETCHER_Mask, 369 &Kd_RSFILTER_Mask, 370 &Kd_FCPORT_Mask, 371 &Kd_PCI_Mask, 372 &Kd_DMIO_Mask, 373 &Kd_DMCONFIG_Mask, 374 &Kd_DMADMIN_Mask, 375 &Kd_WSOCKTRANSPORT_Mask, 376 &Kd_VSS_Mask, 377 &Kd_PNPMEM_Mask, 378 &Kd_PROCESSOR_Mask, 379 &Kd_DMSERVER_Mask, 380 &Kd_SR_Mask, 381 &Kd_INFINIBAND_Mask, 382 &Kd_IHVDRIVER_Mask, 383 &Kd_IHVVIDEO_Mask, 384 &Kd_IHVAUDIO_Mask, 385 &Kd_IHVNETWORK_Mask, 386 &Kd_IHVSTREAMING_Mask, 387 &Kd_IHVBUS_Mask, 388 &Kd_HPS_Mask, 389 &Kd_RTLTHREADPOOL_Mask, 390 &Kd_LDR_Mask, 391 &Kd_TCPIP6_Mask, 392 &Kd_ISAPNP_Mask, 393 &Kd_SHPC_Mask, 394 &Kd_STORPORT_Mask, 395 &Kd_STORMINIPORT_Mask, 396 &Kd_PRINTSPOOLER_Mask, 397 &Kd_VSSDYNDISK_Mask, 398 &Kd_VERIFIER_Mask, 399 &Kd_VDS_Mask, 400 &Kd_VDSBAS_Mask, 401 &Kd_VDSDYN_Mask, // Specified in Vista+ 402 &Kd_VDSDYNDR_Mask, 403 &Kd_VDSLDR_Mask, // Specified in Vista+ 404 &Kd_VDSUTIL_Mask, 405 &Kd_DFRGIFC_Mask, 406 &Kd_DEFAULT_Mask, 407 &Kd_MM_Mask, 408 &Kd_DFSC_Mask, 409 &Kd_WOW64_Mask, 410 411 // 412 // Components specified in Vista+, some of which we also use in ReactOS 413 // 414 &Kd_ALPC_Mask, 415 &Kd_WDI_Mask, 416 &Kd_PERFLIB_Mask, 417 &Kd_KTM_Mask, 418 &Kd_IOSTRESS_Mask, 419 &Kd_HEAP_Mask, 420 &Kd_WHEA_Mask, 421 &Kd_USERGDI_Mask, 422 &Kd_MMCSS_Mask, 423 &Kd_TPM_Mask, 424 &Kd_THREADORDER_Mask, 425 &Kd_ENVIRON_Mask, 426 &Kd_EMS_Mask, 427 &Kd_WDT_Mask, 428 &Kd_FVEVOL_Mask, 429 &Kd_NDIS_Mask, 430 &Kd_NVCTRACE_Mask, 431 &Kd_LUAFV_Mask, 432 &Kd_APPCOMPAT_Mask, 433 &Kd_USBSTOR_Mask, 434 &Kd_SBP2PORT_Mask, 435 &Kd_COVERAGE_Mask, 436 &Kd_CACHEMGR_Mask, 437 &Kd_MOUNTMGR_Mask, 438 &Kd_CFR_Mask, 439 &Kd_TXF_Mask, 440 &Kd_KSECDD_Mask, 441 &Kd_FLTREGRESS_Mask, 442 &Kd_MPIO_Mask, 443 &Kd_MSDSM_Mask, 444 &Kd_UDFS_Mask, 445 &Kd_PSHED_Mask, 446 &Kd_STORVSP_Mask, 447 &Kd_LSASS_Mask, 448 &Kd_SSPICLI_Mask, 449 &Kd_CNG_Mask, 450 &Kd_EXFAT_Mask, 451 &Kd_FILETRACE_Mask, 452 &Kd_XSAVE_Mask, 453 &Kd_SE_Mask, 454 &Kd_DRIVEEXTENDER_Mask, 455 // End Mask 456 &Kd_ENDOFTABLE_Mask, 457 }; 458 459 ULONG KdComponentTableSize = sizeof(KdComponentTable) / sizeof(KdComponentTable[0]); 460 461 // 462 // Debugger Data 463 // 464 LIST_ENTRY KdpDebuggerDataListHead; 465 KSPIN_LOCK KdpDataSpinLock; 466 467 // 468 // Debugger Version and Data Block 469 // 470 DBGKD_GET_VERSION64 KdVersionBlock = 471 { 472 0, 473 0, 474 DBGKD_64BIT_PROTOCOL_VERSION2, 475 CURRENT_KD_SECONDARY_VERSION, 476 #if defined(_M_AMD64) || defined(_M_ARM64) 477 DBGKD_VERS_FLAG_DATA | DBGKD_VERS_FLAG_PTR64, 478 #else 479 DBGKD_VERS_FLAG_DATA, 480 #endif 481 IMAGE_FILE_MACHINE_NATIVE, 482 PACKET_TYPE_MAX, 483 0, 484 0, 485 DBGKD_SIMULATION_NONE, 486 {0}, 487 0, 488 0, 489 0 490 }; 491 KDDEBUGGER_DATA64 KdDebuggerDataBlock = 492 { 493 {{0}}, 494 0, 495 {(ULONG_PTR)RtlpBreakWithStatusInstruction}, 496 0, 497 FIELD_OFFSET(KTHREAD, CallbackStack), 498 #if defined(_M_ARM) || defined(_M_AMD64) 499 0, 500 0, 501 #else 502 FIELD_OFFSET(KCALLOUT_FRAME, CallbackStack), 503 FIELD_OFFSET(KCALLOUT_FRAME, CBSTACK_FRAME_POINTER), 504 #endif 505 FALSE, 506 {(ULONG_PTR)KiCallUserMode}, 507 0, 508 {(ULONG_PTR)&PsLoadedModuleList}, 509 {(ULONG_PTR)&PsActiveProcessHead}, 510 {(ULONG_PTR)&PspCidTable}, 511 {(ULONG_PTR)&ExpSystemResourcesList}, 512 {(ULONG_PTR)ExpPagedPoolDescriptor}, 513 {(ULONG_PTR)&ExpNumberOfPagedPools}, 514 {(ULONG_PTR)&KeTimeIncrement}, 515 {(ULONG_PTR)&KeBugcheckCallbackListHead}, 516 {(ULONG_PTR)KiBugCheckData}, 517 {(ULONG_PTR)&IopErrorLogListHead}, 518 {(ULONG_PTR)&ObpRootDirectoryObject}, 519 {(ULONG_PTR)&ObpTypeObjectType}, 520 {(ULONG_PTR)&MmSystemCacheStart}, 521 {(ULONG_PTR)&MmSystemCacheEnd}, 522 {(ULONG_PTR)&MmSystemCacheWs}, 523 {(ULONG_PTR)&MmPfnDatabase}, 524 {(ULONG_PTR)MmSystemPtesStart}, 525 {(ULONG_PTR)MmSystemPtesEnd}, 526 {(ULONG_PTR)&MmSubsectionBase}, 527 {(ULONG_PTR)&MmNumberOfPagingFiles}, 528 {(ULONG_PTR)&MmLowestPhysicalPage}, 529 {(ULONG_PTR)&MmHighestPhysicalPage}, 530 {(ULONG_PTR)&MmNumberOfPhysicalPages}, 531 {(ULONG_PTR)&MmMaximumNonPagedPoolInBytes}, 532 {(ULONG_PTR)&MmNonPagedSystemStart}, 533 {(ULONG_PTR)&MmNonPagedPoolStart}, 534 {(ULONG_PTR)&MmNonPagedPoolEnd}, 535 {(ULONG_PTR)&MmPagedPoolStart}, 536 {(ULONG_PTR)&MmPagedPoolEnd}, 537 {(ULONG_PTR)&MmPagedPoolInfo}, 538 PAGE_SIZE, 539 {(ULONG_PTR)&MmSizeOfPagedPoolInBytes}, 540 {(ULONG_PTR)&MmTotalCommitLimit}, 541 {(ULONG_PTR)&MmTotalCommittedPages}, 542 {(ULONG_PTR)&MmSharedCommit}, 543 {(ULONG_PTR)&MmDriverCommit}, 544 {(ULONG_PTR)&MmProcessCommit}, 545 {(ULONG_PTR)&MmPagedPoolCommit}, 546 {0}, 547 {(ULONG_PTR)&MmZeroedPageListHead}, 548 {(ULONG_PTR)&MmFreePageListHead}, 549 {(ULONG_PTR)&MmStandbyPageListHead}, 550 {(ULONG_PTR)&MmModifiedPageListHead}, 551 {(ULONG_PTR)&MmModifiedNoWritePageListHead}, 552 {(ULONG_PTR)&MmAvailablePages}, 553 {(ULONG_PTR)&MmResidentAvailablePages}, 554 {(ULONG_PTR)&PoolTrackTable}, 555 {(ULONG_PTR)&NonPagedPoolDescriptor}, 556 {(ULONG_PTR)&MmHighestUserAddress}, 557 {(ULONG_PTR)&MmSystemRangeStart}, 558 {(ULONG_PTR)&MmUserProbeAddress}, 559 {(ULONG_PTR)KdPrintDefaultCircularBuffer}, 560 {(ULONG_PTR)KdPrintDefaultCircularBuffer + 1}, 561 {(ULONG_PTR)&KdPrintWritePointer}, 562 {(ULONG_PTR)&KdPrintRolloverCount}, 563 {(ULONG_PTR)&MmLoadedUserImageList}, 564 {(ULONG_PTR)&NtBuildLab}, 565 {0}, 566 {(ULONG_PTR)KiProcessorBlock}, 567 {(ULONG_PTR)&MmUnloadedDrivers}, 568 {(ULONG_PTR)&MmLastUnloadedDrivers}, 569 {(ULONG_PTR)&MmTriageActionTaken}, 570 {(ULONG_PTR)&MmSpecialPoolTag}, 571 {(ULONG_PTR)&KernelVerifier}, 572 {(ULONG_PTR)&MmVerifierData}, 573 {(ULONG_PTR)&MmAllocatedNonPagedPool}, 574 {(ULONG_PTR)&MmPeakCommitment}, 575 {(ULONG_PTR)&MmtotalCommitLimitMaximum}, 576 {(ULONG_PTR)&CmNtCSDVersion}, 577 {(ULONG_PTR)&MmPhysicalMemoryBlock}, 578 {(ULONG_PTR)&MmSessionBase}, 579 {(ULONG_PTR)&MmSessionSize}, 580 {0}, 581 {0}, 582 FIELD_OFFSET(KTHREAD, NextProcessor), 583 FIELD_OFFSET(KTHREAD, Teb), 584 FIELD_OFFSET(KTHREAD, KernelStack), 585 FIELD_OFFSET(KTHREAD, InitialStack), 586 FIELD_OFFSET(KTHREAD, ApcState.Process), 587 FIELD_OFFSET(KTHREAD, State), 588 0, 589 0, 590 sizeof(EPROCESS), 591 FIELD_OFFSET(EPROCESS, Peb), 592 FIELD_OFFSET(EPROCESS, InheritedFromUniqueProcessId), 593 FIELD_OFFSET(EPROCESS, Pcb.DirectoryTableBase), 594 sizeof(KPRCB), 595 FIELD_OFFSET(KPRCB, DpcRoutineActive), 596 FIELD_OFFSET(KPRCB, CurrentThread), 597 FIELD_OFFSET(KPRCB, MHz), 598 FIELD_OFFSET(KPRCB, CpuType), 599 FIELD_OFFSET(KPRCB, VendorString), 600 FIELD_OFFSET(KPRCB, ProcessorState.ContextFrame), 601 FIELD_OFFSET(KPRCB, Number), 602 sizeof(ETHREAD), 603 {(ULONG_PTR)KdPrintDefaultCircularBuffer}, 604 {(ULONG_PTR)&KdPrintBufferSize}, 605 {(ULONG_PTR)&KeLoaderBlock}, 606 sizeof(KPCR), 607 KPCR_SELF_PCR_OFFSET, 608 KPCR_CURRENT_PRCB_OFFSET, 609 KPCR_CONTAINED_PRCB_OFFSET, 610 0, 611 0, 612 #if defined(_M_ARM) 613 _WARN("KPCR_INITIAL_STACK_OFFSET, KPCR_STACK_LIMIT_OFFSET and KPRCB_PCR_PAGE_OFFSET not properly defined on ARM") 614 0, 615 0, 616 0, 617 #else 618 KPCR_INITIAL_STACK_OFFSET, 619 KPCR_STACK_LIMIT_OFFSET, 620 KPRCB_PCR_PAGE_OFFSET, 621 #endif 622 FIELD_OFFSET(KPRCB, ProcessorState.SpecialRegisters), 623 #if defined(_M_IX86) 624 // 625 // x86 GDT/LDT/TSS constants 626 // 627 KGDT_R0_CODE, 628 KGDT_R0_DATA, 629 KGDT_R0_PCR, 630 KGDT_R3_CODE, 631 KGDT_R3_DATA, 632 KGDT_R3_TEB, 633 KGDT_LDT, 634 KGDT_TSS, 635 0, 636 0, 637 #elif defined(_M_AMD64) 638 // 639 // AMD64 GDT/LDT/TSS constants 640 // 641 KGDT64_R0_CODE, 642 KGDT64_R3_DATA, 643 KGDT64_R3_DATA, 644 KGDT64_R3_CODE, 645 KGDT64_R3_DATA, 646 KGDT64_R3_DATA, 647 0, 648 KGDT64_SYS_TSS, 649 0, 650 0, 651 #else 652 // 653 // No GDT/LDT/TSS on other architectures 654 // 655 0, 656 0, 657 0, 658 0, 659 0, 660 0, 661 0, 662 0, 663 0, 664 0, 665 #endif 666 {(ULONG_PTR)&IopNumTriageDumpDataBlocks}, 667 {(ULONG_PTR)IopTriageDumpDataBlocks}, 668 }; 669