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

Contains guest side of KdXXX() marshalling functions. More...

#include "stdafx.h"
#include "kdxxx.h"
#include "vmwrpc.h"
#include "kdvm.h"
#include "kdrpc.h"
#include "vboxrpc.h"

Include dependency graph for kdvm.cpp:

Go to the source code of this file.

Classes

class  InterlockedIncrementer
 Provides convenient way to mark whether a code block is executing by using an global volatile counter. More...
class  ChannelHelper< DefaultRPCChannel >

Defines

#define CONNECTION_TEST_ROUNDS   100

Typedefs

typedef BufferedRPCChannel
< g_PacketBuffer, sizeof(g_PacketBuffer)> 
VMWareChannel
typedef BufferedVBoxChannel
< g_PacketBuffer, sizeof(g_PacketBuffer)> 
VBoxChannel

Functions

void HalInitSystem (void *, void *)
void __stdcall DllEntryPoint ()
ULONG KdVMGetActiveCallCount ()
NTSTATUS __stdcall KdDebuggerInitialize0 (PVOID lpLoaderParameterBlock)
 Performs initial KD extension DLL initialization.
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.
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.

Variables

static KD_BUFFER s_EmptyBuffer
static KD_CONTEXT s_EmptyKdContext
volatile LONG KdVmActiveCallCount = 0
static bool s_bVBoxDetected = false


Detailed Description

Contains guest side of KdXXX() marshalling functions.

Author:
Ivan Shcherbakov (Bazis)
Id
kdvm.cpp,v 1.11 2009/06/07 10:51:22 Administrator Exp

Definition in file kdvm.cpp.


Define Documentation

#define CONNECTION_TEST_ROUNDS   100

Definition at line 109 of file kdvm.cpp.


Typedef Documentation

typedef BufferedVBoxChannel<g_PacketBuffer, sizeof(g_PacketBuffer)> VBoxChannel

Definition at line 24 of file kdvm.cpp.

typedef BufferedRPCChannel<g_PacketBuffer, sizeof(g_PacketBuffer)> VMWareChannel

Definition at line 23 of file kdvm.cpp.


Function Documentation

void __stdcall DllEntryPoint (  ) 

Definition at line 29 of file kdvm.cpp.

Here is the call graph for this function:

void HalInitSystem ( void *  ,
void *   
)

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:

ULONG KdVMGetActiveCallCount (  ) 

Definition at line 44 of file kdvm.cpp.


Variable Documentation

volatile LONG KdVmActiveCallCount = 0

Definition at line 41 of file kdvm.cpp.

bool s_bVBoxDetected = false [static]

Definition at line 42 of file kdvm.cpp.

Definition at line 38 of file kdvm.cpp.

Definition at line 39 of file kdvm.cpp.