/
VBoxDD.cpp
80 lines (74 loc) · 1.71 KB
/
VBoxDD.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// VBoxDD.cpp : Defines the exported functions for the DLL application.
//
#include "stdafx.h"
#include "IOHandlers.h"
#include <new.h>
static int RTCALL kdConstruct(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfgHandle)
{
VirtualKDDevice *pThis = PDMINS_2_DATA(pDevIns, VirtualKDDevice *);
const TCHAR *pVirtualKDPath = _T("c:\\test\\VirtualKD"); //TODO: load VirtualKD path from VirtualBox configuration items
pThis = new(pThis) VirtualKDDevice(pDevIns, pVirtualKDPath);
return pThis->RegisterHandlers();
}
static int RTCALL kdDestruct(PPDMDEVINS pDevIns)
{
VirtualKDDevice *pThis = PDMINS_2_DATA(pDevIns, VirtualKDDevice *);
pThis->~VirtualKDDevice();
return VINF_SUCCESS;
}
static const PDMDEVREG s_VirtualKDDevice =
{
/* u32Version */
PDM_DEVREG_VERSION,
/* szName */
"VirtualKD",
/* szRCMod */
"",
/* szR0Mod */
"",
/* pszDescription */
"Provides fast debugging interface when debugging Windows kernel",
/* fFlags */
PDM_DEVREG_FLAGS_DEFAULT_BITS,
/* fClass */
PDM_DEVREG_CLASS_MISC,
/* cMaxInstances */
1,
/* cbInstance */
sizeof(VirtualKDDevice),
/* pfnConstruct */
kdConstruct,
/* pfnDestruct */
kdDestruct,
/* pfnRelocate */
NULL,
/* pfnIOCtl */
NULL,
/* pfnPowerOn */
NULL,
/* pfnReset */
NULL,
/* pfnSuspend */
NULL,
/* pfnResume */
NULL,
/* pfnAttach */
NULL,
/* pfnDetach */
NULL,
/* pfnQueryInterface */
NULL,
/* pfnInitComplete */
NULL,
/* pfnPowerOff */
NULL,
/* pfnSoftReset */
NULL,
/* u32VersionEnd */
PDM_DEVREG_VERSION
};
extern "C" int VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version)
{
int rc = pCallbacks->pfnRegister(pCallbacks, &s_VirtualKDDevice);
return rc;
}