VirtualBox

Changeset 89952 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Jun 29, 2021 1:36:53 PM (4 years ago)
Author:
vboxsync
Message:

Main/{VMMDevInterface,ConsoleImpl): Drop passing pointers through CFGM in favor of using VMM2USERMETHODS::pfnQueryGenericObject, bugref:10053

Location:
trunk/src/VBox/Main/src-client
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r89951 r89952  
    1074210742    }
    1074310743
     10744    if (UuidCopy == VMMDEV_OID)
     10745        return pConsole->m_pVMMDev;
     10746
    1074410747    if (UuidCopy == COM_IIDOF(ISnapshot))
    1074510748        return ((MYVMM2USERMETHODS *)pThis)->pISnapshot;
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r89951 r89952  
    29582958        InsertConfigString(pLunL0, "Driver",               "HGCM");
    29592959        InsertConfigNode(pLunL0,   "Config", &pCfg);
    2960         InsertConfigInteger(pCfg,  "Object", (uintptr_t)pVMMDev);
    29612960
    29622961        /*
  • trunk/src/VBox/Main/src-client/VMMDevInterface.cpp

    r85309 r89952  
    10551055     * Validate configuration.
    10561056     */
    1057     if (!CFGMR3AreValuesValid(pCfgHandle, "Object\0"))
     1057    if (!CFGMR3AreValuesValid(pCfgHandle, ""))
    10581058        return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
    10591059    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
     
    11071107     * Get the Console object pointer and update the mpDrv member.
    11081108     */
    1109     void *pv;
    1110     int rc = CFGMR3QueryPtr(pCfgHandle, "Object", &pv);
    1111     if (RT_FAILURE(rc))
    1112     {
    1113         AssertMsgFailed(("Configuration error: No/bad \"Object\" value! rc=%Rrc\n", rc));
    1114         return rc;
    1115     }
    1116 
    1117     pThis->pVMMDev = (VMMDev*)pv;        /** @todo Check this cast! */
     1109    com::Guid uuid(VMMDEV_OID);
     1110    pThis->pVMMDev = (VMMDev*)PDMDrvHlpQueryGenericUserObject(pDrvIns, uuid.raw());
     1111    if (!pThis->pVMMDev)
     1112    {
     1113        AssertMsgFailed(("Configuration error: No/bad VMMDev object!\n"));
     1114        return VERR_NOT_FOUND;
     1115    }
    11181116    pThis->pVMMDev->mpDrv = pThis;
    11191117
     1118    int rc = VINF_SUCCESS;
    11201119#ifdef VBOX_WITH_HGCM
    11211120    /*
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