VirtualBox

Changeset 89953 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jun 29, 2021 1:41:06 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
145411
Message:

Main/{DisplayImpl,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

    r89952 r89953  
    1074210742    }
    1074310743
     10744    if (UuidCopy == COM_IIDOF(IDisplay))
     10745    {
     10746        IDisplay *pIDisplay = pConsole->mDisplay;
     10747        return pIDisplay;
     10748    }
     10749
    1074410750    if (UuidCopy == VMMDEV_OID)
    1074510751        return pConsole->m_pVMMDev;
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r89952 r89953  
    41684168        InsertConfigString(pLunL0, "Driver",               "MainDisplay");
    41694169        InsertConfigNode(pLunL0,   "Config", &pCfg);
    4170         Display *pDisplay = mDisplay;
    4171         InsertConfigInteger(pCfg,  "Object", (uintptr_t)pDisplay);
    41724170    }
    41734171    catch (ConfigError &x)
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r87904 r89953  
    37363736     * Validate configuration.
    37373737     */
    3738     if (!CFGMR3AreValuesValid(pCfg, "Object\0"))
     3738    if (!CFGMR3AreValuesValid(pCfg, ""))
    37393739        return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES;
    37403740    AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER,
     
    37913791     * Get the Display object pointer and update the mpDrv member.
    37923792     */
    3793     void *pv;
    3794     int rc = CFGMR3QueryPtr(pCfg, "Object", &pv);
    3795     if (RT_FAILURE(rc))
    3796     {
    3797         AssertMsgFailed(("Configuration error: No/bad \"Object\" value! rc=%Rrc\n", rc));
    3798         return rc;
    3799     }
    3800     Display *pDisplay = (Display *)pv;      /** @todo Check this cast! */
    3801     pThis->pDisplay = pDisplay;
     3793    com::Guid uuid(COM_IIDOF(IDisplay));
     3794    IDisplay *pIDisplay = (IDisplay *)PDMDrvHlpQueryGenericUserObject(pDrvIns, uuid.raw());
     3795    if (!pIDisplay)
     3796    {
     3797        AssertMsgFailed(("Configuration error: No/bad Keyboard object!\n"));
     3798        return VERR_NOT_FOUND;
     3799    }
     3800    pThis->pDisplay = static_cast<Display *>(pIDisplay);
    38023801    pThis->pDisplay->mpDrv = pThis;
    38033802
     
    38113810    pThis->pUpPort->pfnSetRefreshRate(pThis->pUpPort, 20);
    38123811
    3813     return rc;
     3812    return VINF_SUCCESS;
    38143813}
    38153814
Note: See TracChangeset for help on using the changeset viewer.

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