E:/PROJECTS/cvsed/mixed/VIRTUA~1/kdvm/kdxxx.h File Reference

Contains definitions of functions and structures exported by KD extension libraries Information extracted from KDVM documentation (http://www.nynaeve.net/?p=169). More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _KD_BUFFER
 Represents a buffer used by KdSendPacket()/KdReceivePacket(). More...
struct  _KD_CONTEXT
 Represents the global state of the KD packet layer. More...
struct  _KD_PACKET_HEADER
 Represents a KDCOM packet header in the way it is sent via COM port. More...
struct  SendableKdBuffer
 Contains the KD_BUFFER fields except for buffer pointer. Used for marshalling. More...

Typedefs

typedef enum _KD_RECV_CODE KD_RECV_CODE
 Values returned by KdReceivePacket.
typedef enum _KD_RECV_CODEPKD_RECV_CODE
typedef struct _KD_BUFFER KD_BUFFER
 Represents a buffer used by KdSendPacket()/KdReceivePacket().
typedef struct _KD_BUFFERPKD_BUFFER
typedef struct _KD_CONTEXT KD_CONTEXT
 Represents the global state of the KD packet layer.
typedef struct _KD_CONTEXTPKD_CONTEXT
typedef struct _KD_PACKET_HEADER KD_PACKET_HEADER
 Represents a KDCOM packet header in the way it is sent via COM port.
typedef struct _KD_PACKET_HEADERPKD_PACKET_HEADER
typedef LONG NTSTATUS

Enumerations

enum  _KD_RECV_CODE { KD_RECV_CODE_OK = 0, KD_RECV_CODE_TIMEOUT = 1, KD_RECV_CODE_FAILED = 2 }
 Values returned by KdReceivePacket. More...
enum  {
  KdPacketType3 = 3, KdPacketAcknowledge = 4, KdPacketRetryRequest = 5, KdPacketResynchronize = 6,
  KdPacketType7 = 7, KdCheckForAnyPacket = 8, KdPacketType11 = 11
}
 Possible packet types used by KdSendPacket()/KdReceivePacket(). More...

Functions

KD_RECV_CODE __stdcall KdReceivePacket (__in ULONG PacketType, __inout_opt PKD_BUFFER FirstBuffer, __inout_opt PKD_BUFFER SecondBuffer, __out_opt PULONG PayloadBytes, __inout_opt PKD_CONTEXT KdContext)
 Called by kernel to receive a packet of a specified type.
VOID __stdcall KdSendPacket (__in ULONG PacketType, __in PKD_BUFFER FirstBuffer, __in_opt PKD_BUFFER SecondBuffer, __inout PKD_CONTEXT KdContext)
 Called by kernel to send a debug packet.
NTSTATUS __stdcall KdDebuggerInitialize0 (PVOID lpLoaderParameterBlock)
 Performs initial KD extension DLL initialization.


Detailed Description

Contains definitions of functions and structures exported by KD extension libraries Information extracted from KDVM documentation (http://www.nynaeve.net/?p=169).

Author:
Ivan Shcherbakov (Bazis)
Id
kdxxx.h,v 1.6 2008/12/31 13:11:45 Bazis Exp

Definition in file kdxxx.h.


Typedef Documentation

typedef struct _KD_BUFFER KD_BUFFER

Represents a buffer used by KdSendPacket()/KdReceivePacket().

typedef struct _KD_CONTEXT KD_CONTEXT

Represents the global state of the KD packet layer.

Represents a KDCOM packet header in the way it is sent via COM port.

This structure was extracted from KDCOM.DLL

Values returned by KdReceivePacket.

typedef LONG NTSTATUS

Definition at line 113 of file kdxxx.h.

typedef struct _KD_BUFFER * PKD_BUFFER

typedef struct _KD_CONTEXT * PKD_CONTEXT

typedef enum _KD_RECV_CODE * PKD_RECV_CODE


Enumeration Type Documentation

anonymous enum

Possible packet types used by KdSendPacket()/KdReceivePacket().

Enumerator:
KdPacketType3 
KdPacketAcknowledge  Sent when a data packet was successfully received.
KdPacketRetryRequest  Sent when a corrupted data packet is received (or it cannot be processed now).
KdPacketResynchronize  Sent by WinDBG to resynchronize target and by target to acknowledge resync.
KdPacketType7 
KdCheckForAnyPacket  Not a packet type. When specified to KdReceivePacket(), it checks whether any data is available on COM port.
KdPacketType11 

Definition at line 21 of file kdxxx.h.

Values returned by KdReceivePacket.

Enumerator:
KD_RECV_CODE_OK 
KD_RECV_CODE_TIMEOUT 
KD_RECV_CODE_FAILED 

Definition at line 13 of file kdxxx.h.


Function Documentation

NTSTATUS __stdcall KdDebuggerInitialize0 ( PVOID  lpLoaderParameterBlock  ) 

Performs initial KD extension DLL initialization.

Definition at line 338 of file kdvm.cpp.

Here is the call graph for this function:

KD_RECV_CODE __stdcall KdReceivePacket ( __in ULONG  PacketType,
__inout_opt PKD_BUFFER  FirstBuffer,
__inout_opt PKD_BUFFER  SecondBuffer,
__out_opt PULONG  PayloadBytes,
__inout_opt PKD_CONTEXT  KdContext 
)

Called by kernel to receive a packet of a specified type.

This function is called by Windows kernel to receive a debug packet of a particular type.

Parameters:
PacketType Specifies the type of packet to receive. If KdCheckForAnyPacket is specified, the function checks whether any data is available (was sent by debugger, but not yet received) and returns KD_RECV_CODE_OK or KD_RECV_CODE_TIMEOUT respectively without performing any other action.
FirstBuffer Specifies the buffer where the first KD_BUFFER::MaxLength bytes of a packet are stored
SecondBuffer Specifies the buffer where the rest data of the packet is stored.
PayloadBytes Points to an ULONG value receiving the number of bytes written to SecondBuffer
KdContext Points to a KD_CONTEXT variable storing global packet layer context. If debugger requests stopping the execution, the KD_CONTEXT::BreakInRequested is set to TRUE.

Definition at line 358 of file kdvm.cpp.

Here is the call graph for this function:

VOID __stdcall KdSendPacket ( __in ULONG  PacketType,
__in PKD_BUFFER  FirstBuffer,
__in_opt PKD_BUFFER  SecondBuffer,
__inout PKD_CONTEXT  KdContext 
)

Called by kernel to send a debug packet.

This function is called by Windows kernel to send a debug packet.

Parameters:
PacketType Specifies the packet type to send.
FirstBuffer Specifies the first part of the packet body.
SecondBuffer Specifies the second part of the packet body.
KdContext Points to a KD_CONTEXT variable storing global packet layer context. KD_CONTEXT::RetryCount is used by original KDCOM.DLL implementation.
Remarks:
Note that the packet itself contains no information about sizes of FirstBuffer and SecondBuffer, its body just contains both buffer contens placed one after another.

Definition at line 347 of file kdvm.cpp.

Here is the call graph for this function: