Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenwindbgkd.h
Go to the documentation of this file.
00001 #ifndef _WINDBGKD_ 00002 #define _WINDBGKD_ 00003 00004 // 00005 // Dependencies 00006 // 00007 #include "wdbgexts.h" 00008 00009 // 00010 // Conversion Macros 00011 // 00012 #define COPYSE(p64, p32, f) \ 00013 p64->f = (ULONG64)(LONG64)(LONG)p32->f 00014 00015 // 00016 // Packet Size and Control Stream Size 00017 // 00018 #define PACKET_MAX_SIZE 4000 00019 #define DBGKD_MAXSTREAM 16 00020 00021 // 00022 // Magic Packet IDs 00023 // 00024 #define INITIAL_PACKET_ID 0x80800000 00025 #define SYNC_PACKET_ID 0x00000800 00026 00027 // 00028 // Magic Packet bytes 00029 // 00030 #define BREAKIN_PACKET 0x62626262 00031 #define BREAKIN_PACKET_BYTE 0x62 00032 #define PACKET_LEADER 0x30303030 00033 #define PACKET_LEADER_BYTE 0x30 00034 #define CONTROL_PACKET_LEADER 0x69696969 00035 #define CONTROL_PACKET_LEADER_BYTE 0x69 00036 #define PACKET_TRAILING_BYTE 0xAA 00037 00038 // 00039 // Packet Types 00040 // 00041 #define PACKET_TYPE_UNUSED 0 00042 #define PACKET_TYPE_KD_STATE_CHANGE32 1 00043 #define PACKET_TYPE_KD_STATE_MANIPULATE 2 00044 #define PACKET_TYPE_KD_DEBUG_IO 3 00045 #define PACKET_TYPE_KD_ACKNOWLEDGE 4 00046 #define PACKET_TYPE_KD_RESEND 5 00047 #define PACKET_TYPE_KD_RESET 6 00048 #define PACKET_TYPE_KD_STATE_CHANGE64 7 00049 #define PACKET_TYPE_KD_POLL_BREAKIN 8 00050 #define PACKET_TYPE_KD_TRACE_IO 9 00051 #define PACKET_TYPE_KD_CONTROL_REQUEST 10 00052 #define PACKET_TYPE_KD_FILE_IO 11 00053 #define PACKET_TYPE_MAX 12 00054 00055 // 00056 // Wait State Change Types 00057 // 00058 #define DbgKdMinimumStateChange 0x00003030 00059 #define DbgKdExceptionStateChange 0x00003030 00060 #define DbgKdLoadSymbolsStateChange 0x00003031 00061 #define DbgKdCommandStringStateChange 0x00003032 00062 #define DbgKdMaximumStateChange 0x00003033 00063 00064 // 00065 // This is combined with the basic state change code 00066 // if the state is from an alternate source 00067 // 00068 #define DbgKdAlternateStateChange 0x00010000 00069 00070 // 00071 // Manipulate Types 00072 // 00073 #define DbgKdMinimumManipulate 0x00003130 00074 #define DbgKdReadVirtualMemoryApi 0x00003130 00075 #define DbgKdWriteVirtualMemoryApi 0x00003131 00076 #define DbgKdGetContextApi 0x00003132 00077 #define DbgKdSetContextApi 0x00003133 00078 #define DbgKdWriteBreakPointApi 0x00003134 00079 #define DbgKdRestoreBreakPointApi 0x00003135 00080 #define DbgKdContinueApi 0x00003136 00081 #define DbgKdReadControlSpaceApi 0x00003137 00082 #define DbgKdWriteControlSpaceApi 0x00003138 00083 #define DbgKdReadIoSpaceApi 0x00003139 00084 #define DbgKdWriteIoSpaceApi 0x0000313A 00085 #define DbgKdRebootApi 0x0000313B 00086 #define DbgKdContinueApi2 0x0000313C 00087 #define DbgKdReadPhysicalMemoryApi 0x0000313D 00088 #define DbgKdWritePhysicalMemoryApi 0x0000313E 00089 #define DbgKdQuerySpecialCallsApi 0x0000313F 00090 #define DbgKdSetSpecialCallApi 0x00003140 00091 #define DbgKdClearSpecialCallsApi 0x00003141 00092 #define DbgKdSetInternalBreakPointApi 0x00003142 00093 #define DbgKdGetInternalBreakPointApi 0x00003143 00094 #define DbgKdReadIoSpaceExtendedApi 0x00003144 00095 #define DbgKdWriteIoSpaceExtendedApi 0x00003145 00096 #define DbgKdGetVersionApi 0x00003146 00097 #define DbgKdWriteBreakPointExApi 0x00003147 00098 #define DbgKdRestoreBreakPointExApi 0x00003148 00099 #define DbgKdCauseBugCheckApi 0x00003149 00100 #define DbgKdSwitchProcessor 0x00003150 00101 #define DbgKdPageInApi 0x00003151 00102 #define DbgKdReadMachineSpecificRegister 0x00003152 00103 #define DbgKdWriteMachineSpecificRegister 0x00003153 00104 #define OldVlm1 0x00003154 00105 #define OldVlm2 0x00003155 00106 #define DbgKdSearchMemoryApi 0x00003156 00107 #define DbgKdGetBusDataApi 0x00003157 00108 #define DbgKdSetBusDataApi 0x00003158 00109 #define DbgKdCheckLowMemoryApi 0x00003159 00110 #define DbgKdClearAllInternalBreakpointsApi 0x0000315A 00111 #define DbgKdFillMemoryApi 0x0000315B 00112 #define DbgKdQueryMemoryApi 0x0000315C 00113 #define DbgKdSwitchPartition 0x0000315D 00114 #define DbgKdMaximumManipulate 0x0000315E 00115 00116 // 00117 // Debug I/O Types 00118 // 00119 #define DbgKdPrintStringApi 0x00003230 00120 #define DbgKdGetStringApi 0x00003231 00121 00122 // 00123 // Trace I/O Types 00124 // 00125 #define DbgKdPrintTraceApi 0x00003330 00126 00127 // 00128 // Control Request Types 00129 // 00130 #define DbgKdRequestHardwareBp 0x00004300 00131 #define DbgKdReleaseHardwareBp 0x00004301 00132 00133 // 00134 // File I/O Types 00135 // 00136 #define DbgKdCreateFileApi 0x00003430 00137 #define DbgKdReadFileApi 0x00003431 00138 #define DbgKdWriteFileApi 0x00003432 00139 #define DbgKdCloseFileApi 0x00003433 00140 00141 // 00142 // Control Report Flags 00143 // 00144 #define REPORT_INCLUDES_SEGS 0x0001 00145 #define REPORT_STANDARD_CS 0x0002 00146 00147 // 00148 // Protocol Versions 00149 // 00150 #define DBGKD_64BIT_PROTOCOL_VERSION1 5 00151 #define DBGKD_64BIT_PROTOCOL_VERSION2 6 00152 00153 // 00154 // Query Memory Address Spaces 00155 // 00156 #define DBGKD_QUERY_MEMORY_VIRTUAL 0 00157 #define DBGKD_QUERY_MEMORY_PROCESS 0 00158 #define DBGKD_QUERY_MEMORY_SESSION 1 00159 #define DBGKD_QUERY_MEMORY_KERNEL 2 00160 00161 // 00162 // Query Memory Flags 00163 // 00164 #define DBGKD_QUERY_MEMORY_READ 0x01 00165 #define DBGKD_QUERY_MEMORY_WRITE 0x02 00166 #define DBGKD_QUERY_MEMORY_EXECUTE 0x04 00167 #define DBGKD_QUERY_MEMORY_FIXED 0x08 00168 00169 // 00170 // Internal Breakpoint Flags 00171 // 00172 #define DBGKD_INTERNAL_BP_FLAG_COUNTONLY 0x01 00173 #define DBGKD_INTERNAL_BP_FLAG_INVALID 0x02 00174 #define DBGKD_INTERNAL_BP_FLAG_SUSPENDED 0x04 00175 #define DBGKD_INTERNAL_BP_FLAG_DYING 0x08 00176 00177 // 00178 // Fill Memory Flags 00179 // 00180 #define DBGKD_FILL_MEMORY_VIRTUAL 0x01 00181 #define DBGKD_FILL_MEMORY_PHYSICAL 0x02 00182 00183 // 00184 // Physical Memory Caching Flags 00185 // 00186 #define DBGKD_CACHING_DEFAULT 0 00187 #define DBGKD_CACHING_CACHED 1 00188 #define DBGKD_CACHING_UNCACHED 2 00189 #define DBGKD_CACHING_WRITE_COMBINED 3 00190 00191 // 00192 // Partition Switch Flags 00193 // 00194 #define DBGKD_PARTITION_DEFAULT 0x00 00195 #define DBGKD_PARTITION_ALTERNATE 0x01 00196 00197 // 00198 // AMD64 Control Space types 00199 // 00200 #define AMD64_DEBUG_CONTROL_SPACE_KPCR 0 00201 #define AMD64_DEBUG_CONTROL_SPACE_KPRCB 1 00202 #define AMD64_DEBUG_CONTROL_SPACE_KSPECIAL 2 00203 #define AMD64_DEBUG_CONTROL_SPACE_KTHREAD 3 00204 00205 00206 // 00207 // KD Packet Structure 00208 // 00209 typedef struct _KD_PACKET 00210 { 00211 ULONG PacketLeader; 00212 USHORT PacketType; 00213 USHORT ByteCount; 00214 ULONG PacketId; 00215 ULONG Checksum; 00216 } KD_PACKET, *PKD_PACKET; 00217 00218 // 00219 // KD Context 00220 // 00221 typedef struct _KD_CONTEXT 00222 { 00223 ULONG KdpDefaultRetries; 00224 BOOLEAN KdpControlCPending; 00225 } KD_CONTEXT, *PKD_CONTEXT; 00226 00227 // 00228 // Control Sets for Supported Architectures 00229 // 00230 #include <pshpack4.h> 00231 typedef struct _X86_DBGKD_CONTROL_SET 00232 { 00233 ULONG TraceFlag; 00234 ULONG Dr7; 00235 ULONG CurrentSymbolStart; 00236 ULONG CurrentSymbolEnd; 00237 } X86_DBGKD_CONTROL_SET, *PX86_DBGKD_CONTROL_SET; 00238 00239 typedef struct _ALPHA_DBGKD_CONTROL_SET 00240 { 00241 ULONG __padding; 00242 } ALPHA_DBGKD_CONTROL_SET, *PALPHA_DBGKD_CONTROL_SET; 00243 00244 typedef struct _IA64_DBGKD_CONTROL_SET 00245 { 00246 ULONG Continue; 00247 ULONG64 CurrentSymbolStart; 00248 ULONG64 CurrentSymbolEnd; 00249 } IA64_DBGKD_CONTROL_SET, *PIA64_DBGKD_CONTROL_SET; 00250 00251 typedef struct _AMD64_DBGKD_CONTROL_SET 00252 { 00253 ULONG TraceFlag; 00254 ULONG64 Dr7; 00255 ULONG64 CurrentSymbolStart; 00256 ULONG64 CurrentSymbolEnd; 00257 } AMD64_DBGKD_CONTROL_SET, *PAMD64_DBGKD_CONTROL_SET; 00258 00259 typedef struct _ARM_DBGKD_CONTROL_SET 00260 { 00261 ULONG Continue; 00262 ULONG CurrentSymbolStart; 00263 ULONG CurrentSymbolEnd; 00264 } ARM_DBGKD_CONTROL_SET, *PARM_DBGKD_CONTROL_SET; 00265 00266 typedef struct _DBGKD_ANY_CONTROL_SET 00267 { 00268 union 00269 { 00270 X86_DBGKD_CONTROL_SET X86ControlSet; 00271 ALPHA_DBGKD_CONTROL_SET AlphaControlSet; 00272 IA64_DBGKD_CONTROL_SET IA64ControlSet; 00273 AMD64_DBGKD_CONTROL_SET Amd64ControlSet; 00274 ARM_DBGKD_CONTROL_SET ARMControlSet; 00275 }; 00276 } DBGKD_ANY_CONTROL_SET, *PDBGKD_ANY_CONTROL_SET; 00277 #include <poppack.h> 00278 00279 #if defined(_M_IX86) 00280 typedef X86_DBGKD_CONTROL_SET DBGKD_CONTROL_SET, *PDBGKD_CONTROL_SET; 00281 #elif defined(_M_AMD64) 00282 typedef AMD64_DBGKD_CONTROL_SET DBGKD_CONTROL_SET, *PDBGKD_CONTROL_SET; 00283 #elif defined(_M_ARM) 00284 typedef ARM_DBGKD_CONTROL_SET DBGKD_CONTROL_SET, *PDBGKD_CONTROL_SET; 00285 #else 00286 #error Unsupported Architecture 00287 #endif 00288 00289 // 00290 // DBGKM Structure for Exceptions 00291 // 00292 typedef struct _DBGKM_EXCEPTION32 00293 { 00294 EXCEPTION_RECORD32 ExceptionRecord; 00295 ULONG FirstChance; 00296 } DBGKM_EXCEPTION32, *PDBGKM_EXCEPTION32; 00297 00298 typedef struct _DBGKM_EXCEPTION64 00299 { 00300 EXCEPTION_RECORD64 ExceptionRecord; 00301 ULONG FirstChance; 00302 } DBGKM_EXCEPTION64, *PDBGKM_EXCEPTION64; 00303 00304 // 00305 // DBGKD Structure for State Change 00306 // 00307 typedef struct _X86_DBGKD_CONTROL_REPORT 00308 { 00309 ULONG Dr6; 00310 ULONG Dr7; 00311 USHORT InstructionCount; 00312 USHORT ReportFlags; 00313 UCHAR InstructionStream[DBGKD_MAXSTREAM]; 00314 USHORT SegCs; 00315 USHORT SegDs; 00316 USHORT SegEs; 00317 USHORT SegFs; 00318 ULONG EFlags; 00319 } X86_DBGKD_CONTROL_REPORT, *PX86_DBGKD_CONTROL_REPORT; 00320 00321 typedef struct _ALPHA_DBGKD_CONTROL_REPORT 00322 { 00323 ULONG InstructionCount; 00324 UCHAR InstructionStream[DBGKD_MAXSTREAM]; 00325 } ALPHA_DBGKD_CONTROL_REPORT, *PALPHA_DBGKD_CONTROL_REPORT; 00326 00327 typedef struct _IA64_DBGKD_CONTROL_REPORT 00328 { 00329 ULONG InstructionCount; 00330 UCHAR InstructionStream[DBGKD_MAXSTREAM]; 00331 } IA64_DBGKD_CONTROL_REPORT, *PIA64_DBGKD_CONTROL_REPORT; 00332 00333 typedef struct _AMD64_DBGKD_CONTROL_REPORT 00334 { 00335 ULONG64 Dr6; 00336 ULONG64 Dr7; 00337 ULONG EFlags; 00338 USHORT InstructionCount; 00339 USHORT ReportFlags; 00340 UCHAR InstructionStream[DBGKD_MAXSTREAM]; 00341 USHORT SegCs; 00342 USHORT SegDs; 00343 USHORT SegEs; 00344 USHORT SegFs; 00345 } AMD64_DBGKD_CONTROL_REPORT, *PAMD64_DBGKD_CONTROL_REPORT; 00346 00347 typedef struct _ARM_DBGKD_CONTROL_REPORT 00348 { 00349 ULONG Cpsr; 00350 ULONG InstructionCount; 00351 UCHAR InstructionStream[DBGKD_MAXSTREAM]; 00352 } ARM_DBGKD_CONTROL_REPORT, *PARM_DBGKD_CONTROL_REPORT; 00353 00354 typedef struct _DBGKD_ANY_CONTROL_REPORT 00355 { 00356 union 00357 { 00358 X86_DBGKD_CONTROL_REPORT X86ControlReport; 00359 ALPHA_DBGKD_CONTROL_REPORT AlphaControlReport; 00360 IA64_DBGKD_CONTROL_REPORT IA64ControlReport; 00361 AMD64_DBGKD_CONTROL_REPORT Amd64ControlReport; 00362 ARM_DBGKD_CONTROL_REPORT ARMControlReport; 00363 }; 00364 } DBGKD_ANY_CONTROL_REPORT, *PDBGKD_ANY_CONTROL_REPORT; 00365 00366 #if defined(_M_IX86) 00367 typedef X86_DBGKD_CONTROL_REPORT DBGKD_CONTROL_REPORT, *PDBGKD_CONTROL_REPORT; 00368 #elif defined(_M_AMD64) 00369 typedef AMD64_DBGKD_CONTROL_REPORT DBGKD_CONTROL_REPORT, *PDBGKD_CONTROL_REPORT; 00370 #elif defined(_M_ARM) 00371 typedef ARM_DBGKD_CONTROL_REPORT DBGKD_CONTROL_REPORT, *PDBGKD_CONTROL_REPORT; 00372 #else 00373 #error Unsupported Architecture 00374 #endif 00375 00376 // 00377 // DBGKD Structure for Debug I/O Type Print String 00378 // 00379 typedef struct _DBGKD_PRINT_STRING 00380 { 00381 ULONG LengthOfString; 00382 } DBGKD_PRINT_STRING, *PDBGKD_PRINT_STRING; 00383 00384 // 00385 // DBGKD Structure for Debug I/O Type Get String 00386 // 00387 typedef struct _DBGKD_GET_STRING 00388 { 00389 ULONG LengthOfPromptString; 00390 ULONG LengthOfStringRead; 00391 } DBGKD_GET_STRING, *PDBGKD_GET_STRING; 00392 00393 // 00394 // DBGKD Structure for Debug I/O 00395 // 00396 typedef struct _DBGKD_DEBUG_IO 00397 { 00398 ULONG ApiNumber; 00399 USHORT ProcessorLevel; 00400 USHORT Processor; 00401 union 00402 { 00403 DBGKD_PRINT_STRING PrintString; 00404 DBGKD_GET_STRING GetString; 00405 } u; 00406 } DBGKD_DEBUG_IO, *PDBGKD_DEBUG_IO; 00407 00408 // 00409 // DBGkD Structure for Command String 00410 // 00411 typedef struct _DBGKD_COMMAND_STRING 00412 { 00413 ULONG Flags; 00414 ULONG Reserved1; 00415 ULONG64 Reserved2[7]; 00416 } DBGKD_COMMAND_STRING, *PDBGKD_COMMAND_STRING; 00417 00418 // 00419 // DBGKD Structure for Load Symbols 00420 // 00421 typedef struct _DBGKD_LOAD_SYMBOLS32 00422 { 00423 ULONG PathNameLength; 00424 ULONG BaseOfDll; 00425 ULONG ProcessId; 00426 ULONG CheckSum; 00427 ULONG SizeOfImage; 00428 BOOLEAN UnloadSymbols; 00429 } DBGKD_LOAD_SYMBOLS32, *PDBGKD_LOAD_SYMBOLS32; 00430 00431 typedef struct _DBGKD_LOAD_SYMBOLS64 00432 { 00433 ULONG PathNameLength; 00434 ULONG64 BaseOfDll; 00435 ULONG64 ProcessId; 00436 ULONG CheckSum; 00437 ULONG SizeOfImage; 00438 BOOLEAN UnloadSymbols; 00439 } DBGKD_LOAD_SYMBOLS64, *PDBGKD_LOAD_SYMBOLS64; 00440 00441 // 00442 // DBGKD Structure for Wait State Change 00443 // 00444 00445 typedef struct _DBGKD_WAIT_STATE_CHANGE32 00446 { 00447 ULONG NewState; 00448 USHORT ProcessorLevel; 00449 USHORT Processor; 00450 ULONG NumberProcessors; 00451 ULONG Thread; 00452 ULONG ProgramCounter; 00453 union 00454 { 00455 DBGKM_EXCEPTION32 Exception; 00456 DBGKD_LOAD_SYMBOLS32 LoadSymbols; 00457 } u; 00458 } DBGKD_WAIT_STATE_CHANGE32, *PDBGKD_WAIT_STATE_CHANGE32; 00459 00460 typedef struct _DBGKD_WAIT_STATE_CHANGE64 00461 { 00462 ULONG NewState; 00463 USHORT ProcessorLevel; 00464 USHORT Processor; 00465 ULONG NumberProcessors; 00466 ULONG64 Thread; 00467 ULONG64 ProgramCounter; 00468 union 00469 { 00470 DBGKM_EXCEPTION64 Exception; 00471 DBGKD_LOAD_SYMBOLS64 LoadSymbols; 00472 } u; 00473 } DBGKD_WAIT_STATE_CHANGE64, *PDBGKD_WAIT_STATE_CHANGE64; 00474 00475 typedef struct _DBGKD_ANY_WAIT_STATE_CHANGE 00476 { 00477 ULONG NewState; 00478 USHORT ProcessorLevel; 00479 USHORT Processor; 00480 ULONG NumberProcessors; 00481 ULONG64 Thread; 00482 ULONG64 ProgramCounter; 00483 union 00484 { 00485 DBGKM_EXCEPTION64 Exception; 00486 DBGKD_LOAD_SYMBOLS64 LoadSymbols; 00487 DBGKD_COMMAND_STRING CommandString; 00488 } u; 00489 union 00490 { 00491 DBGKD_CONTROL_REPORT ControlReport; 00492 DBGKD_ANY_CONTROL_REPORT AnyControlReport; 00493 }; 00494 } DBGKD_ANY_WAIT_STATE_CHANGE, *PDBGKD_ANY_WAIT_STATE_CHANGE; 00495 00496 // 00497 // DBGKD Manipulate Structures 00498 // 00499 typedef struct _DBGKD_READ_MEMORY32 00500 { 00501 ULONG TargetBaseAddress; 00502 ULONG TransferCount; 00503 ULONG ActualBytesRead; 00504 } DBGKD_READ_MEMORY32, *PDBGKD_READ_MEMORY32; 00505 00506 typedef struct _DBGKD_READ_MEMORY64 00507 { 00508 ULONG64 TargetBaseAddress; 00509 ULONG TransferCount; 00510 ULONG ActualBytesRead; 00511 } DBGKD_READ_MEMORY64, *PDBGKD_READ_MEMORY64; 00512 00513 typedef struct _DBGKD_WRITE_MEMORY32 00514 { 00515 ULONG TargetBaseAddress; 00516 ULONG TransferCount; 00517 ULONG ActualBytesWritten; 00518 } DBGKD_WRITE_MEMORY32, *PDBGKD_WRITE_MEMORY32; 00519 00520 typedef struct _DBGKD_WRITE_MEMORY64 00521 { 00522 ULONG64 TargetBaseAddress; 00523 ULONG TransferCount; 00524 ULONG ActualBytesWritten; 00525 } DBGKD_WRITE_MEMORY64, *PDBGKD_WRITE_MEMORY64; 00526 00527 typedef struct _DBGKD_GET_CONTEXT 00528 { 00529 ULONG Unused; 00530 } DBGKD_GET_CONTEXT, *PDBGKD_GET_CONTEXT; 00531 00532 typedef struct _DBGKD_SET_CONTEXT 00533 { 00534 ULONG ContextFlags; 00535 } DBGKD_SET_CONTEXT, *PDBGKD_SET_CONTEXT; 00536 00537 typedef struct _DBGKD_WRITE_BREAKPOINT32 00538 { 00539 ULONG BreakPointAddress; 00540 ULONG BreakPointHandle; 00541 } DBGKD_WRITE_BREAKPOINT32, *PDBGKD_WRITE_BREAKPOINT32; 00542 00543 typedef struct _DBGKD_WRITE_BREAKPOINT64 00544 { 00545 ULONG64 BreakPointAddress; 00546 ULONG BreakPointHandle; 00547 } DBGKD_WRITE_BREAKPOINT64, *PDBGKD_WRITE_BREAKPOINT64; 00548 00549 typedef struct _DBGKD_RESTORE_BREAKPOINT 00550 { 00551 ULONG BreakPointHandle; 00552 } DBGKD_RESTORE_BREAKPOINT, *PDBGKD_RESTORE_BREAKPOINT; 00553 00554 typedef struct _DBGKD_CONTINUE 00555 { 00556 NTSTATUS ContinueStatus; 00557 } DBGKD_CONTINUE, *PDBGKD_CONTINUE; 00558 00559 #include <pshpack4.h> 00560 typedef struct _DBGKD_CONTINUE2 00561 { 00562 NTSTATUS ContinueStatus; 00563 union 00564 { 00565 DBGKD_CONTROL_SET ControlSet; 00566 DBGKD_ANY_CONTROL_SET AnyControlSet; 00567 }; 00568 } DBGKD_CONTINUE2, *PDBGKD_CONTINUE2; 00569 #include <poppack.h> 00570 00571 typedef struct _DBGKD_READ_WRITE_IO32 00572 { 00573 ULONG IoAddress; 00574 ULONG DataSize; 00575 ULONG DataValue; 00576 } DBGKD_READ_WRITE_IO32, *PDBGKD_READ_WRITE_IO32; 00577 00578 typedef struct _DBGKD_READ_WRITE_IO64 00579 { 00580 ULONG64 IoAddress; 00581 ULONG DataSize; 00582 ULONG DataValue; 00583 } DBGKD_READ_WRITE_IO64, *PDBGKD_READ_WRITE_IO64; 00584 00585 typedef struct _DBGKD_READ_WRITE_IO_EXTENDED32 00586 { 00587 ULONG DataSize; 00588 ULONG InterfaceType; 00589 ULONG BusNumber; 00590 ULONG AddressSpace; 00591 ULONG IoAddress; 00592 ULONG DataValue; 00593 } DBGKD_READ_WRITE_IO_EXTENDED32, *PDBGKD_READ_WRITE_IO_EXTENDED32; 00594 00595 typedef struct _DBGKD_READ_WRITE_IO_EXTENDED64 00596 { 00597 ULONG DataSize; 00598 ULONG InterfaceType; 00599 ULONG BusNumber; 00600 ULONG AddressSpace; 00601 ULONG64 IoAddress; 00602 ULONG DataValue; 00603 } DBGKD_READ_WRITE_IO_EXTENDED64, *PDBGKD_READ_WRITE_IO_EXTENDED64; 00604 00605 typedef struct _DBGKD_READ_WRITE_MSR 00606 { 00607 ULONG Msr; 00608 ULONG DataValueLow; 00609 ULONG DataValueHigh; 00610 } DBGKD_READ_WRITE_MSR, *PDBGKD_READ_WRITE_MSR; 00611 00612 typedef struct _DBGKD_QUERY_SPECIAL_CALLS 00613 { 00614 ULONG NumberOfSpecialCalls; 00615 } DBGKD_QUERY_SPECIAL_CALLS, *PDBGKD_QUERY_SPECIAL_CALLS; 00616 00617 typedef struct _DBGKD_SET_SPECIAL_CALL32 00618 { 00619 ULONG SpecialCall; 00620 } DBGKD_SET_SPECIAL_CALL32, *PDBGKD_SET_SPECIAL_CALL32; 00621 00622 typedef struct _DBGKD_SET_SPECIAL_CALL64 00623 { 00624 ULONG64 SpecialCall; 00625 } DBGKD_SET_SPECIAL_CALL64, *PDBGKD_SET_SPECIAL_CALL64; 00626 00627 typedef struct _DBGKD_SET_INTERNAL_BREAKPOINT32 00628 { 00629 ULONG BreakpointAddress; 00630 ULONG Flags; 00631 } DBGKD_SET_INTERNAL_BREAKPOINT32, *PDBGKD_SET_INTERNAL_BREAKPOINT32; 00632 00633 typedef struct _DBGKD_SET_INTERNAL_BREAKPOINT64 00634 { 00635 ULONG64 BreakpointAddress; 00636 ULONG Flags; 00637 } DBGKD_SET_INTERNAL_BREAKPOINT64, *PDBGKD_SET_INTERNAL_BREAKPOINT64; 00638 00639 typedef struct _DBGKD_GET_INTERNAL_BREAKPOINT32 00640 { 00641 ULONG BreakpointAddress; 00642 ULONG Flags; 00643 ULONG Calls; 00644 ULONG MaxCallsPerPeriod; 00645 ULONG MinInstructions; 00646 ULONG MaxInstructions; 00647 ULONG TotalInstructions; 00648 } DBGKD_GET_INTERNAL_BREAKPOINT32, *PDBGKD_GET_INTERNAL_BREAKPOINT32; 00649 00650 typedef struct _DBGKD_GET_INTERNAL_BREAKPOINT64 00651 { 00652 ULONG64 BreakpointAddress; 00653 ULONG Flags; 00654 ULONG Calls; 00655 ULONG MaxCallsPerPeriod; 00656 ULONG MinInstructions; 00657 ULONG MaxInstructions; 00658 ULONG TotalInstructions; 00659 } DBGKD_GET_INTERNAL_BREAKPOINT64, *PDBGKD_GET_INTERNAL_BREAKPOINT64; 00660 00661 typedef struct _DBGKD_BREAKPOINTEX 00662 { 00663 ULONG BreakPointCount; 00664 NTSTATUS ContinueStatus; 00665 } DBGKD_BREAKPOINTEX, *PDBGKD_BREAKPOINTEX; 00666 00667 typedef struct _DBGKD_SEARCH_MEMORY 00668 { 00669 union 00670 { 00671 ULONG64 SearchAddress; 00672 ULONG64 FoundAddress; 00673 }; 00674 ULONG64 SearchLength; 00675 ULONG PatternLength; 00676 } DBGKD_SEARCH_MEMORY, *PDBGKD_SEARCH_MEMORY; 00677 00678 typedef struct _DBGKD_GET_SET_BUS_DATA 00679 { 00680 ULONG BusDataType; 00681 ULONG BusNumber; 00682 ULONG SlotNumber; 00683 ULONG Offset; 00684 ULONG Length; 00685 } DBGKD_GET_SET_BUS_DATA, *PDBGKD_GET_SET_BUS_DATA; 00686 00687 typedef struct _DBGKD_FILL_MEMORY 00688 { 00689 ULONG64 Address; 00690 ULONG Length; 00691 USHORT Flags; 00692 USHORT PatternLength; 00693 } DBGKD_FILL_MEMORY, *PDBGKD_FILL_MEMORY; 00694 00695 typedef struct _DBGKD_QUERY_MEMORY 00696 { 00697 ULONG64 Address; 00698 ULONG64 Reserved; 00699 ULONG AddressSpace; 00700 ULONG Flags; 00701 } DBGKD_QUERY_MEMORY, *PDBGKD_QUERY_MEMORY; 00702 00703 typedef struct _DBGKD_SWITCH_PARTITION 00704 { 00705 ULONG Partition; 00706 } DBGKD_SWITCH_PARTITION; 00707 00708 // 00709 // DBGKD Structure for Manipulate 00710 // 00711 typedef struct _DBGKD_MANIPULATE_STATE32 00712 { 00713 ULONG ApiNumber; 00714 USHORT ProcessorLevel; 00715 USHORT Processor; 00716 NTSTATUS ReturnStatus; 00717 union 00718 { 00719 DBGKD_READ_MEMORY32 ReadMemory; 00720 DBGKD_WRITE_MEMORY32 WriteMemory; 00721 DBGKD_READ_MEMORY64 ReadMemory64; 00722 DBGKD_WRITE_MEMORY64 WriteMemory64; 00723 DBGKD_GET_CONTEXT GetContext; 00724 DBGKD_SET_CONTEXT SetContext; 00725 DBGKD_WRITE_BREAKPOINT32 WriteBreakPoint; 00726 DBGKD_RESTORE_BREAKPOINT RestoreBreakPoint; 00727 DBGKD_CONTINUE Continue; 00728 DBGKD_CONTINUE2 Continue2; 00729 DBGKD_READ_WRITE_IO32 ReadWriteIo; 00730 DBGKD_READ_WRITE_IO_EXTENDED32 ReadWriteIoExtended; 00731 DBGKD_QUERY_SPECIAL_CALLS QuerySpecialCalls; 00732 DBGKD_SET_SPECIAL_CALL32 SetSpecialCall; 00733 DBGKD_SET_INTERNAL_BREAKPOINT32 SetInternalBreakpoint; 00734 DBGKD_GET_INTERNAL_BREAKPOINT32 GetInternalBreakpoint; 00735 DBGKD_GET_VERSION32 GetVersion32; 00736 DBGKD_BREAKPOINTEX BreakPointEx; 00737 DBGKD_READ_WRITE_MSR ReadWriteMsr; 00738 DBGKD_SEARCH_MEMORY SearchMemory; 00739 DBGKD_GET_SET_BUS_DATA GetSetBusData; 00740 DBGKD_FILL_MEMORY FillMemory; 00741 DBGKD_QUERY_MEMORY QueryMemory; 00742 DBGKD_SWITCH_PARTITION SwitchPartition; 00743 } u; 00744 } DBGKD_MANIPULATE_STATE32, *PDBGKD_MANIPULATE_STATE32; 00745 00746 typedef struct _DBGKD_MANIPULATE_STATE64 00747 { 00748 ULONG ApiNumber; 00749 USHORT ProcessorLevel; 00750 USHORT Processor; 00751 NTSTATUS ReturnStatus; 00752 union 00753 { 00754 DBGKD_READ_MEMORY64 ReadMemory; 00755 DBGKD_WRITE_MEMORY64 WriteMemory; 00756 DBGKD_GET_CONTEXT GetContext; 00757 DBGKD_SET_CONTEXT SetContext; 00758 DBGKD_WRITE_BREAKPOINT64 WriteBreakPoint; 00759 DBGKD_RESTORE_BREAKPOINT RestoreBreakPoint; 00760 DBGKD_CONTINUE Continue; 00761 DBGKD_CONTINUE2 Continue2; 00762 DBGKD_READ_WRITE_IO64 ReadWriteIo; 00763 DBGKD_READ_WRITE_IO_EXTENDED64 ReadWriteIoExtended; 00764 DBGKD_QUERY_SPECIAL_CALLS QuerySpecialCalls; 00765 DBGKD_SET_SPECIAL_CALL64 SetSpecialCall; 00766 DBGKD_SET_INTERNAL_BREAKPOINT64 SetInternalBreakpoint; 00767 DBGKD_GET_INTERNAL_BREAKPOINT64 GetInternalBreakpoint; 00768 DBGKD_GET_VERSION64 GetVersion64; 00769 DBGKD_BREAKPOINTEX BreakPointEx; 00770 DBGKD_READ_WRITE_MSR ReadWriteMsr; 00771 DBGKD_SEARCH_MEMORY SearchMemory; 00772 DBGKD_GET_SET_BUS_DATA GetSetBusData; 00773 DBGKD_FILL_MEMORY FillMemory; 00774 DBGKD_QUERY_MEMORY QueryMemory; 00775 DBGKD_SWITCH_PARTITION SwitchPartition; 00776 } u; 00777 } DBGKD_MANIPULATE_STATE64, *PDBGKD_MANIPULATE_STATE64; 00778 00779 // 00780 // File I/O Structure 00781 // 00782 typedef struct _DBGKD_CREATE_FILE 00783 { 00784 ULONG DesiredAccess; 00785 ULONG FileAttributes; 00786 ULONG ShareAccess; 00787 ULONG CreateDisposition; 00788 ULONG CreateOptions; 00789 ULONG64 Handle; 00790 ULONG64 Length; 00791 } DBGKD_CREATE_FILE, *PDBGKD_CREATE_FILE; 00792 00793 typedef struct _DBGKD_READ_FILE 00794 { 00795 ULONG64 Handle; 00796 ULONG64 Offset; 00797 ULONG Length; 00798 } DBGKD_READ_FILE, *PDBGKD_READ_FILE; 00799 00800 typedef struct _DBGKD_WRITE_FILE 00801 { 00802 ULONG64 Handle; 00803 ULONG64 Offset; 00804 ULONG Length; 00805 } DBGKD_WRITE_FILE, *PDBGKD_WRITE_FILE; 00806 00807 typedef struct _DBGKD_CLOSE_FILE 00808 { 00809 ULONG64 Handle; 00810 } DBGKD_CLOSE_FILE, *PDBGKD_CLOSE_FILE; 00811 00812 typedef struct _DBGKD_FILE_IO 00813 { 00814 ULONG ApiNumber; 00815 ULONG Status; 00816 union 00817 { 00818 ULONG64 ReserveSpace[7]; 00819 DBGKD_CREATE_FILE CreateFile; 00820 DBGKD_READ_FILE ReadFile; 00821 DBGKD_WRITE_FILE WriteFile; 00822 DBGKD_CLOSE_FILE CloseFile; 00823 } u; 00824 } DBGKD_FILE_IO, *PDBGKD_FILE_IO; 00825 00826 00827 // 00828 // Control Request Structure 00829 // 00830 typedef struct _DBGKD_REQUEST_BREAKPOINT 00831 { 00832 ULONG HardwareBreakPointNumber; 00833 ULONG Available; 00834 } DBGKD_REQUEST_BREAKPOINT, *PDBGKD_REQUEST_BREAKPOINT; 00835 00836 typedef struct _DBGKD_RELEASE_BREAKPOINT 00837 { 00838 ULONG HardwareBreakPointNumber; 00839 ULONG Released; 00840 } DBGKD_RELEASE_BREAKPOINT, *PDBGKD_RELEASE_BREAKPOINT; 00841 00842 typedef struct _DBGKD_CONTROL_REQUEST 00843 { 00844 ULONG ApiNumber; 00845 union 00846 { 00847 DBGKD_REQUEST_BREAKPOINT RequestBreakpoint; 00848 DBGKD_RELEASE_BREAKPOINT ReleaseBreakpoint; 00849 } u; 00850 } DBGKD_CONTROL_REQUEST, *PDBGKD_CONTROL_REQUEST; 00851 00852 // 00853 // Trace I/O Structure 00854 // 00855 typedef struct _DBGKD_PRINT_TRACE 00856 { 00857 ULONG LengthOfData; 00858 } DBGKD_PRINT_TRACE, *PDBGKD_PRINT_TRACE; 00859 00860 typedef struct _DBGKD_TRACE_IO 00861 { 00862 ULONG ApiNumber; 00863 USHORT ProcessorLevel; 00864 USHORT Processor; 00865 union 00866 { 00867 ULONG64 ReserveSpace[7]; 00868 DBGKD_PRINT_TRACE PrintTrace; 00869 } u; 00870 } DBGKD_TRACE_IO, *PDBGKD_TRACE_IO; 00871 00872 static 00873 __inline 00874 VOID 00875 NTAPI 00876 ExceptionRecord32To64(IN PEXCEPTION_RECORD32 Ex32, 00877 OUT PEXCEPTION_RECORD64 Ex64) 00878 { 00879 ULONG i; 00880 00881 Ex64->ExceptionCode = Ex32->ExceptionCode; 00882 Ex64->ExceptionFlags = Ex32->ExceptionFlags; 00883 Ex64->ExceptionRecord = Ex32->ExceptionRecord; 00884 COPYSE(Ex64,Ex32,ExceptionAddress); 00885 Ex64->NumberParameters = Ex32->NumberParameters; 00886 00887 for (i = 0; i < EXCEPTION_MAXIMUM_PARAMETERS; i++) 00888 { 00889 COPYSE(Ex64,Ex32,ExceptionInformation[i]); 00890 } 00891 } 00892 00893 #endif Generated on Mon May 28 2012 04:33:11 for ReactOS by
1.7.6.1
|