ReactOS 0.4.16-dev-251-ga17b6e9
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(dst, src, len)   (RtlCompareMemory((dst), (src), (len)) == (len))
 
#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 (   dst,
  src,
  len 
)    (RtlCompareMemory((dst), (src), (len)) == (len))

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.

41{
KDP_STATUS
Definition: kdvm.h:41
@ KDP_PACKET_TIMEOUT
Definition: kdvm.h:43
@ KDP_PACKET_RESEND
Definition: kdvm.h:44
@ KDP_PACKET_RECEIVED
Definition: kdvm.h:42

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}
Definition: bufpool.h:45
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
static VOID KdVmDbgDumpRow(_In_ PUCHAR Buffer, _In_ ULONG Size)
Definition: kdvm.c:29
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

◆ 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 */
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 */
55 *ReceiveDataSize = ReceiveHeader->ReceivedDataSize;
56
57 //KdpDbgPrint("got data:\n");
58 //KdVmDbgDumpBuffer(KdVmDataBuffer, *ReceiveDataSize + sizeof(*ReceiveHeader));
59
60}
struct KDVBOX_RECEIVE_HEADER * PKDVBOX_RECEIVE_HEADER
struct KDVBOX_SEND_HEADER * PKDVBOX_SEND_HEADER
ULONG KdVmBufferPos
Definition: kdvm.c:20
UCHAR KdVmDataBuffer[KDVM_BUFFER_SIZE]
Definition: kdvm.c:18
PHYSICAL_ADDRESS KdVmBufferPhysicalAddress
Definition: kdvm.c:19
#define KDVM_BUFFER_SIZE
Definition: kdvm.h:33
VOID FASTCALL KdVmExchange(_In_ ULONG_PTR PhysicalAddress, _In_ SIZE_T BufferSize)
static ULONG ReceiveData(PINFO pInfo)
Definition: ntpclient.c:102
ULONG ReceivedDataSize
Definition: kdvbox.c:19
ULONG SendSize
Definition: kdvbox.c:13
ULONG BufferSize
Definition: kdvbox.c:14
uint32_t ULONG_PTR
Definition: typedefs.h:65
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by KdVmSendReceive().

◆ KdVmPrepareBuffer()

VOID NTAPI KdVmPrepareBuffer ( VOID  )

Variable Documentation

◆ KdpDbgPrint

PFNDBGPRNT KdpDbgPrint
extern

Definition at line 22 of file kdvm.c.

Referenced by KdDebuggerInitialize0(), and KdVmDbgDumpRow().

◆ KdVmBufferPhysicalAddress

PHYSICAL_ADDRESS KdVmBufferPhysicalAddress
extern

Definition at line 19 of file kdvm.c.

Referenced by KdDebuggerInitialize0(), and KdVmKdVmExchangeData().

◆ KdVmBufferPos

ULONG KdVmBufferPos
extern

Definition at line 20 of file kdvm.c.

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

◆ KdVmDataBuffer

UCHAR KdVmDataBuffer[KDVM_BUFFER_SIZE]
extern

Definition at line 18 of file kdvm.c.

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