ReactOS  0.4.14-dev-49-gfb4591c
kdvm.h File Reference
#include <ntifs.h>
#include <windbgkd.h>
#include <arc/arc.h>
Include dependency graph for kdvm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _KDVM_MARSHAL_STRING
 
struct  KDVM_CMD_HEADER
 
struct  KDVM_RECEIVE_HEADER
 
struct  _KDVM_CONTEXT
 
struct  KDVM_SENDPACKET_INFO
 
struct  _KDVM_SEND_PKT_REQUEST
 
struct  _KDVM_SEND_PKT_RESULT
 
struct  KDVM_RECV_PKT_REQUEST
 
struct  KDVM_RECV_PKT_RESULT
 

Macros

#define NOEXTAPI
 
#define RtlEqualMemory(a, b, c)   (RtlCompareMemory(a, b, c) != c)
 
#define KDDBGPRINT(...)
 
#define KDRPC_PROTOCOL_VERSION   0x101
 
#define CONNECTION_TEST_ROUNDS   2 /*100*/
 
#define KDVM_BUFFER_SIZE   (131072 + 1024)
 
#define KDRPC_TEST_BUFFER_SIZE   512
 

Typedefs

typedef ULONG(* PFNDBGPRNT) (const char *Format,...)
 
typedef struct _KDVM_MARSHAL_STRING KDVM_MARSHAL_STRING
 
typedef struct KDVM_RECEIVE_HEADERPKDVM_RECEIVE_HEADER
 
typedef struct _KDVM_CONTEXT KDVM_CONTEXT
 
typedef struct _KDVM_CONTEXTPKDVM_CONTEXT
 
typedef struct _KDVM_SEND_PKT_REQUEST KDVM_SEND_PKT_REQUEST
 
typedef struct _KDVM_SEND_PKT_REQUESTPKDVM_SEND_PKT_REQUEST
 
typedef struct _KDVM_SEND_PKT_RESULT KDVM_SEND_PKT_RESULT
 
typedef struct _KDVM_SEND_PKT_RESULTPKDVM_SEND_PKT_RESULT
 
typedef struct KDVM_RECV_PKT_RESULTPKDVM_RECV_PKT_RESULT
 

Enumerations

enum  KDP_STATUS {
  KDP_PACKET_RECEIVED = 0, KDP_PACKET_TIMEOUT = 1, KDP_PACKET_RESEND = 2, KDP_PACKET_RECEIVED = 0,
  KDP_PACKET_TIMEOUT = 1, KDP_PACKET_RESEND = 2
}
 

Functions

VOID NTAPI KdVmDbgDumpBuffer (_In_ PVOID Buffer, _In_ ULONG Size)
 
VOID FASTCALL KdVmExchange (_In_ ULONG_PTR PhysicalAddress, _In_ SIZE_T BufferSize)
 
VOID NTAPI KdVmPrepareBuffer (VOID)
 
VOID NTAPI KdVmKdVmExchangeData (_Out_ PVOID *ReceiveData, _Out_ PULONG ReceiveDataSize)
 

Variables

PFNDBGPRNT KdpDbgPrint
 
UCHAR KdVmDataBuffer [KDVM_BUFFER_SIZE]
 
PHYSICAL_ADDRESS KdVmBufferPhysicalAddress
 
ULONG KdVmBufferPos
 

Macro Definition Documentation

◆ CONNECTION_TEST_ROUNDS

#define CONNECTION_TEST_ROUNDS   2 /*100*/

Definition at line 32 of file kdvm.h.

◆ KDDBGPRINT

#define KDDBGPRINT (   ...)

Definition at line 26 of file kdvm.h.

◆ KDRPC_PROTOCOL_VERSION

#define KDRPC_PROTOCOL_VERSION   0x101

Definition at line 31 of file kdvm.h.

◆ KDRPC_TEST_BUFFER_SIZE

#define KDRPC_TEST_BUFFER_SIZE   512

Definition at line 34 of file kdvm.h.

◆ KDVM_BUFFER_SIZE

#define KDVM_BUFFER_SIZE   (131072 + 1024)

Definition at line 33 of file kdvm.h.

◆ NOEXTAPI

#define NOEXTAPI

Definition at line 12 of file kdvm.h.

◆ RtlEqualMemory

#define RtlEqualMemory (   a,
  b,
  c 
)    (RtlCompareMemory(a, b, c) != c)

Definition at line 18 of file kdvm.h.

Typedef Documentation

◆ KDVM_CONTEXT

◆ KDVM_MARSHAL_STRING

◆ KDVM_SEND_PKT_REQUEST

◆ KDVM_SEND_PKT_RESULT

◆ PFNDBGPRNT

typedef ULONG(* PFNDBGPRNT) (const char *Format,...)

Definition at line 22 of file kdvm.h.

◆ PKDVM_CONTEXT

◆ PKDVM_RECEIVE_HEADER

◆ PKDVM_RECV_PKT_RESULT

◆ PKDVM_SEND_PKT_REQUEST

◆ PKDVM_SEND_PKT_RESULT

Enumeration Type Documentation

◆ KDP_STATUS

Enumerator
KDP_PACKET_RECEIVED 
KDP_PACKET_TIMEOUT 
KDP_PACKET_RESEND 
KDP_PACKET_RECEIVED 
KDP_PACKET_TIMEOUT 
KDP_PACKET_RESEND 

Definition at line 40 of file kdvm.h.

Function Documentation

◆ KdVmDbgDumpBuffer()

VOID NTAPI KdVmDbgDumpBuffer ( _In_ PVOID  Buffer,
_In_ ULONG  Size 
)

Definition at line 43 of file kdvm.c.

46 {
47  PUCHAR CurrentRow;
48  ULONG i;
49 
50  CurrentRow = Buffer;
51  for (i = 0; i < (Size / 16); i++)
52  {
53  KdVmDbgDumpRow(CurrentRow, 16);
54  CurrentRow += 16;
55  }
56  KdVmDbgDumpRow(CurrentRow, (Size % 16));
57 }
unsigned char * PUCHAR
Definition: retypes.h:3
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
static VOID KdVmDbgDumpRow(_In_ PUCHAR Buffer, _In_ ULONG Size)
Definition: kdvm.c:29
unsigned int ULONG
Definition: retypes.h:1
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34

◆ KdVmExchange()

VOID FASTCALL KdVmExchange ( _In_ ULONG_PTR  PhysicalAddress,
_In_ SIZE_T  BufferSize 
)

Referenced by KdVmKdVmExchangeData().

◆ KdVmKdVmExchangeData()

VOID NTAPI KdVmKdVmExchangeData ( _Out_ PVOID ReceiveData,
_Out_ PULONG  ReceiveDataSize 
)

Definition at line 31 of file kdvbox.c.

34 {
35  PKDVBOX_SEND_HEADER SendHeader;
36  PKDVBOX_RECEIVE_HEADER ReceiveHeader;
37 
38  /* Setup the send-header */
39  SendHeader = (PKDVBOX_SEND_HEADER)KdVmDataBuffer;
40  SendHeader->SendSize = KdVmBufferPos - sizeof(KDVBOX_SEND_HEADER);
41  SendHeader->BufferSize = KDVM_BUFFER_SIZE;
42 
43  //KdpDbgPrint("Sending buffer:\n");
44  //KdVmDbgDumpBuffer(KdVmDataBuffer, KdVmBufferPos);
45 
46  /* Do the data exchange */
48 
49  /* Reset the buffer position */
51 
52  /* Get the receive-header and return information about the received data */
53  ReceiveHeader = (PKDVBOX_RECEIVE_HEADER)KdVmDataBuffer;
55  *ReceiveDataSize = ReceiveHeader->ReceivedDataSize;
56 
57  //KdpDbgPrint("got data:\n");
58  //KdVmDbgDumpBuffer(KdVmDataBuffer, *ReceiveDataSize + sizeof(*ReceiveHeader));
59 
60 }
#define KDVM_BUFFER_SIZE
Definition: kdvm.h:33
ULONG BufferSize
Definition: kdvbox.c:14
VOID FASTCALL KdVmExchange(_In_ ULONG_PTR PhysicalAddress, _In_ SIZE_T BufferSize)
ULONG KdVmBufferPos
Definition: kdvm.c:20
uint32_t ULONG_PTR
Definition: typedefs.h:63
static ULONG ReceiveData(PINFO pInfo)
Definition: ntpclient.c:102
ULONG SendSize
Definition: kdvbox.c:13
UCHAR KdVmDataBuffer[KDVM_BUFFER_SIZE]
Definition: kdvm.c:18
struct KDVBOX_RECEIVE_HEADER * PKDVBOX_RECEIVE_HEADER
struct KDVBOX_SEND_HEADER * PKDVBOX_SEND_HEADER
PHYSICAL_ADDRESS KdVmBufferPhysicalAddress
Definition: kdvm.c:19
ULONG ReceivedDataSize
Definition: kdvbox.c:19
LONGLONG QuadPart
Definition: typedefs.h:112

Referenced by KdVmSendReceive().

◆ KdVmPrepareBuffer()

VOID NTAPI KdVmPrepareBuffer ( VOID  )

Definition at line 24 of file kdvbox.c.

25 {
27 }
ULONG KdVmBufferPos
Definition: kdvm.c:20

Referenced by KdReceivePacket(), KdSendPacket(), KdVmNegotiateProtocolVersions(), and TestConnectionOnChannel().

Variable Documentation

◆ KdpDbgPrint

PFNDBGPRNT KdpDbgPrint

Definition at line 22 of file kdvm.c.

Referenced by KdDebuggerInitialize0(), and KdVmDbgDumpRow().

◆ KdVmBufferPhysicalAddress

PHYSICAL_ADDRESS KdVmBufferPhysicalAddress

Definition at line 19 of file kdvm.c.

Referenced by KdDebuggerInitialize0(), and KdVmKdVmExchangeData().

◆ KdVmBufferPos

ULONG KdVmBufferPos

Definition at line 20 of file kdvm.c.

Referenced by KdVmAddToBuffer(), KdVmKdVmExchangeData(), and KdVmPrepareBuffer().

◆ KdVmDataBuffer

UCHAR KdVmDataBuffer[KDVM_BUFFER_SIZE]

Definition at line 18 of file kdvm.c.

Referenced by KdDebuggerInitialize0(), KdVmAddToBuffer(), and KdVmKdVmExchangeData().