VirtualBox

Changeset 94342 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Mar 23, 2022 7:53:21 PM (3 years ago)
Author:
vboxsync
Message:

Main,VMM/PDMUsb,Devices/USB,VRDP: Drop passing pointers through CFGM in favor of using VMM2USERMETHODS::pfnQueryGenericObject, bugref:10053

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMUsb.cpp

    r93115 r94342  
    10191019 * @param   pszBackend          The proxy backend to use.
    10201020 * @param   pszAddress          The address string.
    1021  * @param   pvBackend           Pointer to the backend.
     1021 * @param   pSubTree            The CFGM subtree to incorporate into the settings
     1022 *                              (same restrictions as for CFGMR3InsertSubTree() apply),
     1023 *                              optional.
    10221024 * @param   enmSpeed            The speed the USB device is operating at.
    10231025 * @param   fMaskedIfs          The interfaces to hide from the guest.
    10241026 * @param   pszCaptureFilename  Path to the file for USB traffic capturing, optional.
    10251027 */
    1026 VMMR3DECL(int) PDMR3UsbCreateProxyDevice(PUVM pUVM, PCRTUUID pUuid, const char *pszBackend, const char *pszAddress, void *pvBackend,
     1028VMMR3DECL(int) PDMR3UsbCreateProxyDevice(PUVM pUVM, PCRTUUID pUuid, const char *pszBackend, const char *pszAddress, PCFGMNODE pSubTree,
    10271029                                         VUSBSPEED enmSpeed, uint32_t fMaskedIfs, const char *pszCaptureFilename)
    10281030{
     
    10781080        rc = CFGMR3InsertString(pConfig,  "UUID", szUuid);                      AssertRCBreak(rc);
    10791081        rc = CFGMR3InsertString(pConfig, "Backend", pszBackend);                AssertRCBreak(rc);
    1080         rc = CFGMR3InsertInteger(pConfig, "pvBackend", (uintptr_t)pvBackend);   AssertRCBreak(rc);
    10811082        rc = CFGMR3InsertInteger(pConfig, "MaskedIfs", fMaskedIfs);             AssertRCBreak(rc);
    10821083        rc = CFGMR3InsertInteger(pConfig, "Force11Device", !(pHub->fVersions & iUsbVersion)); AssertRCBreak(rc);
     1084        if (pSubTree)
     1085        {
     1086            rc = CFGMR3InsertSubTree(pConfig, "BackendCfg", pSubTree, NULL /*ppChild*/);
     1087            AssertRCBreak(rc);
     1088        }
    10831089    } while (0); /* break loop */
    10841090    if (RT_FAILURE(rc))
     
    21762182             pUsbIns->pReg->szName, pUsbIns->iInstance, enmReason));
    21772183    return enmReason;
     2184}
     2185
     2186
     2187/** @interface_method_impl{PDMUSBHLP,pfnQueryGenericUserObject} */
     2188static DECLCALLBACK(void *) pdmR3UsbHlp_QueryGenericUserObject(PPDMUSBINS pUsbIns, PCRTUUID pUuid)
     2189{
     2190    PDMUSB_ASSERT_USBINS(pUsbIns);
     2191    PVM  pVM  = pUsbIns->Internal.s.pVM;
     2192    PUVM pUVM = pVM->pUVM;
     2193
     2194    void *pvRet;
     2195    if (pUVM->pVmm2UserMethods->pfnQueryGenericObject)
     2196        pvRet = pUVM->pVmm2UserMethods->pfnQueryGenericObject(pUVM->pVmm2UserMethods, pUVM, pUuid);
     2197    else
     2198        pvRet = NULL;
     2199
     2200    Log(("pdmR3UsbHlp_QueryGenericUserObject: caller='%s'/%d: returns %#p for %RTuuid\n",
     2201         pUsbIns->pReg->szName, pUsbIns->iInstance, pvRet, pUuid));
     2202    return pvRet;
    21782203}
    21792204
     
    23762401    pdmR3UsbHlp_VMGetSuspendReason,
    23772402    pdmR3UsbHlp_VMGetResumeReason,
    2378     NULL,
     2403    pdmR3UsbHlp_QueryGenericUserObject,
    23792404    NULL,
    23802405    NULL,
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