VirtualBox

Changeset 48419 in vbox for trunk/src


Ignore:
Timestamp:
Sep 10, 2013 10:28:34 PM (11 years ago)
Author:
vboxsync
Message:

Filled in a few blanks.

Location:
trunk/src/VBox/ExtPacks/BusMouseSample
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ExtPacks/BusMouseSample/BusMouse.cpp

    r48418 r48419  
    3434#define LOG_GROUP LOG_GROUP_DEV_KBD
    3535#include <VBox/vmm/pdmdev.h>
     36#include <VBox/version.h>
    3637#include <iprt/assert.h>
    3738#include <iprt/uuid.h>
    38 
    3939
    4040/** @page pg_busmouse DevBusMouse - Microsoft Bus Mouse Emulation
     
    876876};
    877877
     878#ifdef VBOX_IN_EXTPACK_R3
     879/**
     880 * @callback_method_impl{FNPDMVBOXDEVICESREGISTER}
     881 */
     882extern "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
    878895# endif /* IN_RING3 */
    879896#endif /* !VBOX_DEVICE_STRUCT_TESTCASE */
  • trunk/src/VBox/ExtPacks/BusMouseSample/VBoxBusMouseMain.cpp

    r44446 r48419  
    7373// static DECLCALLBACK(int)  vboxSkeletonExtPack_VMCreated(PCVBOXEXTPACKREG pThis, VBOXEXTPACK_IF_CS(IVirtualBox) *pVirtualBox, IMachine *pMachine);
    7474//
    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 */
     79static 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
    80122// /**
    81123//  * @interface_method_impl{VBOXEXTPACKREG,pfnVMPowerOn}
     
    92134
    93135
    94 static const VBOXEXTPACKREG g_vboxSkeletonExtPackReg =
     136static const VBOXEXTPACKREG g_vboxBusMouseExtPackReg =
    95137{
    96138    VBOXEXTPACKREG_VERSION,
     
    101143    /* .pfnUnload =         */  NULL,
    102144    /* .pfnVMCreated =      */  NULL,
    103     /* .pfnVMConfigureVMM = */  NULL,
     145    /* .pfnVMConfigureVMM = */  vboxBusMouseExtPack_VMConfigureVMM,
    104146    /* .pfnVMPowerOn =      */  NULL,
    105147    /* .pfnVMPowerOff =     */  NULL,
     
    131173     */
    132174    g_pHlp = pHlp;
    133     *ppReg = &g_vboxSkeletonExtPackReg;
     175    *ppReg = &g_vboxBusMouseExtPackReg;
    134176
    135177    return VINF_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette