ReactOS  0.4.14-dev-98-gb0d4763
kdvbox.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: GPL, see COPYING in the top level directory
3  * PROJECT: ReactOS kernel
4  * FILE: drivers/base/kdvm/kdvbox.c
5  * PURPOSE: VBOX data exchange function for kdvbox
6  * PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org)
7  */
8 
9 #include "kdvm.h"
10 
11 typedef struct
12 {
16 
17 typedef struct
18 {
21 
22 VOID
23 NTAPI
25 {
27 }
28 
29 VOID
30 NTAPI
33  _Out_ PULONG ReceiveDataSize)
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
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID NTAPI KdVmPrepareBuffer(VOID)
Definition: kdvbox.c:24
#define _Out_
Definition: no_sal2.h:323
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
unsigned int * PULONG
Definition: retypes.h:1
VOID NTAPI KdVmKdVmExchangeData(_Out_ PVOID *ReceiveData, _Out_ PULONG ReceiveDataSize)
Definition: kdvbox.c:31
unsigned int ULONG
Definition: retypes.h:1
ULONG ReceivedDataSize
Definition: kdvbox.c:19
LONGLONG QuadPart
Definition: typedefs.h:112