00001 00008 #pragma once 00009 00010 #pragma pack (push, 2) 00011 00013 typedef enum _KD_RECV_CODE 00014 { 00015 KD_RECV_CODE_OK = 0, 00016 KD_RECV_CODE_TIMEOUT = 1, 00017 KD_RECV_CODE_FAILED = 2 00018 } KD_RECV_CODE, * PKD_RECV_CODE; 00019 00021 enum 00022 { 00023 KdPacketType3 = 3, 00025 KdPacketAcknowledge = 4, 00027 KdPacketRetryRequest = 5, 00029 KdPacketResynchronize = 6, 00030 KdPacketType7 = 7, 00032 KdCheckForAnyPacket = 8, 00033 KdPacketType11 = 11, 00034 }; 00035 00037 typedef struct _KD_BUFFER 00038 { 00039 USHORT Length; 00040 USHORT MaxLength; 00041 #ifdef _AMD64_ 00042 ULONG __Padding; 00043 #endif 00044 PUCHAR pData; 00045 } KD_BUFFER, * PKD_BUFFER; 00046 00048 typedef struct _KD_CONTEXT 00049 { 00051 ULONG RetryCount; 00053 BOOLEAN BreakInRequested; 00054 } KD_CONTEXT, * PKD_CONTEXT; 00055 00056 extern "C" 00057 { 00059 00069 KD_RECV_CODE 00070 __stdcall 00071 KdReceivePacket( 00072 __in ULONG PacketType, 00073 __inout_opt PKD_BUFFER FirstBuffer, 00074 __inout_opt PKD_BUFFER SecondBuffer, 00075 __out_opt PULONG PayloadBytes, 00076 __inout_opt PKD_CONTEXT KdContext 00077 ); 00078 00080 00089 VOID 00090 __stdcall 00091 KdSendPacket( 00092 __in ULONG PacketType, 00093 __in PKD_BUFFER FirstBuffer, 00094 __in_opt PKD_BUFFER SecondBuffer, 00095 __inout PKD_CONTEXT KdContext 00096 ); 00097 00098 } 00099 00101 00103 typedef struct _KD_PACKET_HEADER 00104 { 00105 ULONG Signature; 00106 USHORT PacketType; 00107 USHORT TotalDataLength; 00108 ULONG PacketID; 00109 ULONG Checksum; 00110 } KD_PACKET_HEADER, * PKD_PACKET_HEADER; 00111 00112 #ifndef _DDK_ 00113 typedef LONG NTSTATUS; 00114 #endif 00115 00116 extern "C" 00117 { 00119 NTSTATUS __stdcall KdDebuggerInitialize0(PVOID lpLoaderParameterBlock); 00120 } 00121 00123 struct SendableKdBuffer 00124 { 00125 USHORT Length; 00126 USHORT MaxLength; 00127 }; 00128 00129 #pragma pack (pop) 00130