- Timestamp:
- Sep 10, 2013 10:28:34 PM (11 years ago)
- Location:
- trunk/src/VBox/ExtPacks/BusMouseSample
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ExtPacks/BusMouseSample/BusMouse.cpp
r48418 r48419 34 34 #define LOG_GROUP LOG_GROUP_DEV_KBD 35 35 #include <VBox/vmm/pdmdev.h> 36 #include <VBox/version.h> 36 37 #include <iprt/assert.h> 37 38 #include <iprt/uuid.h> 38 39 39 40 40 /** @page pg_busmouse DevBusMouse - Microsoft Bus Mouse Emulation … … 876 876 }; 877 877 878 #ifdef VBOX_IN_EXTPACK_R3 879 /** 880 * @callback_method_impl{FNPDMVBOXDEVICESREGISTER} 881 */ 882 extern "C" DECLEXPORT(int) VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version) 883 { 884 AssertLogRelMsgReturn(u32Version >= VBOX_VERSION, 885 ("u32Version=%#x VBOX_VERSION=%#x\n", u32Version, VBOX_VERSION), 886 VERR_EXTPACK_VBOX_VERSION_MISMATCH); 887 AssertLogRelMsgReturn(pCallbacks->u32Version == PDM_DEVREG_CB_VERSION, 888 ("pCallbacks->u32Version=%#x PDM_DEVREG_CB_VERSION=%#x\n", pCallbacks->u32Version, PDM_DEVREG_CB_VERSION), 889 VERR_VERSION_MISMATCH); 890 891 return pCallbacks->pfnRegister(pCallbacks, &g_DeviceBusMouse); 892 } 893 #endif /* VBOX_IN_EXTPACK_R3 */ 894 878 895 # endif /* IN_RING3 */ 879 896 #endif /* !VBOX_DEVICE_STRUCT_TESTCASE */ -
trunk/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp
r44446 r48419 73 73 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, IMachine *pMachine); 74 74 // 75 // /** 76 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMConfigureVMM} 77 // */ 78 // static DECLCALLBACK(int) vboxSkeletonExtPack_VMConfigureVMM(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM); 79 // 75 76 /** 77 * @interface_method_impl{VBOXEXTPACKREG,pfnVMConfigureVMM 78 */ 79 static DECLCALLBACK(int) vboxBusMouseExtPack_VMConfigureVMM(PCVBOXEXTPACKREG pThis, IConsole *pConsole, PVM pVM) 80 { 81 /* 82 * Find the bus mouse module and tell PDM to load it. 83 * ASSUME /PDM/Devices exists. 84 */ 85 char szPath[RTPATH_MAX]; 86 int rc = g_pHlp->pfnFindModule(g_pHlp, "VBoxBusMouseR3", NULL, VBOXEXTPACKMODKIND_R3, szPath, sizeof(szPath), NULL); 87 if (RT_FAILURE(rc)) 88 return rc; 89 90 PCFGMNODE pCfgRoot = CFGMR3GetRoot(pVM); 91 AssertReturn(pCfgRoot, VERR_INTERNAL_ERROR_3); 92 93 PCFGMNODE pCfgDevices = CFGMR3GetChild(pCfgRoot, "PDM/Devices"); 94 AssertReturn(pCfgDevices, VERR_INTERNAL_ERROR_3); 95 96 PCFGMNODE pCfgMine; 97 rc = CFGMR3InsertNode(pCfgDevices, "VBoxBusMouse", &pCfgMine); 98 AssertRCReturn(rc, rc); 99 rc = CFGMR3InsertString(pCfgMine, "Path", szPath); 100 AssertRCReturn(rc, rc); 101 102 /* 103 * Tell PDM where to find the R0 and RC modules for the bus mouse device. 104 */ 105 #ifdef VBOX_WITH_RAW_MODE 106 rc = g_pHlp->pfnFindModule(g_pHlp, "VBoxBusMouseRC", NULL, VBOXEXTPACKMODKIND_RC, szPath, sizeof(szPath), NULL); 107 AssertRCReturn(rc, rc); 108 RTPathStripFilename(szPath); 109 rc = CFGMR3InsertString(pCfgMine, "RCSearchPath", szPath); 110 AssertRCReturn(rc, rc); 111 #endif 112 113 rc = g_pHlp->pfnFindModule(g_pHlp, "VBoxBusMouseR0", NULL, VBOXEXTPACKMODKIND_R0, szPath, sizeof(szPath), NULL); 114 AssertRCReturn(rc, rc); 115 RTPathStripFilename(szPath); 116 rc = CFGMR3InsertString(pCfgMine, "R0SearchPath", szPath); 117 AssertRCReturn(rc, rc); 118 119 return VINF_SUCCESS; 120 } 121 80 122 // /** 81 123 // * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOn} … … 92 134 93 135 94 static const VBOXEXTPACKREG g_vbox SkeletonExtPackReg =136 static const VBOXEXTPACKREG g_vboxBusMouseExtPackReg = 95 137 { 96 138 VBOXEXTPACKREG_VERSION, … … 101 143 /* .pfnUnload = */ NULL, 102 144 /* .pfnVMCreated = */ NULL, 103 /* .pfnVMConfigureVMM = */ NULL,145 /* .pfnVMConfigureVMM = */ vboxBusMouseExtPack_VMConfigureVMM, 104 146 /* .pfnVMPowerOn = */ NULL, 105 147 /* .pfnVMPowerOff = */ NULL, … … 131 173 */ 132 174 g_pHlp = pHlp; 133 *ppReg = &g_vbox SkeletonExtPackReg;175 *ppReg = &g_vboxBusMouseExtPackReg; 134 176 135 177 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.