Changeset 94327 in vbox
- Timestamp:
- Mar 22, 2022 3:56:55 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r93444 r94327 114 114 int AudioVRDE::configureDriver(PCFGMNODE pLunCfg, PCVMMR3VTABLE pVMM) 115 115 { 116 int rc = pVMM->pfnCFGMR3InsertInteger(pLunCfg, "Object", (uintptr_t)this);117 AssertRCReturn(rc, rc);118 119 rc = pVMM->pfnCFGMR3InsertInteger(pLunCfg, "ObjectVRDPServer", (uintptr_t)mpConsole->i_consoleVRDPServer());120 AssertRCReturn(rc, rc);121 122 116 return AudioDriver::configureDriver(pLunCfg, pVMM); 123 117 } … … 713 707 */ 714 708 pThis->pDrvIns = pDrvIns; 709 pThis->cClients = 0; 715 710 /* IBase */ 716 711 pDrvIns->IBase.pfnQueryInterface = drvAudioVrdeQueryInterface; … … 744 739 AssertPtrReturn(pThis->pIHostAudioPort, VERR_PDM_MISSING_INTERFACE_ABOVE); 745 740 746 /* 747 * Get the ConsoleVRDPServer object pointer.748 */749 void *pvUser;750 int rc = pDrvIns->pHlpR3->pfnCFGMQueryPtr(pCfg, "ObjectVRDPServer", &pvUser); /** @todo r=andy Get rid of this hack and use IHostAudio::SetCallback. */751 Assert MsgRCReturn(rc, ("Confguration error: No/bad \"ObjectVRDPServer\" value, rc=%Rrc\n", rc), rc);752 753 /* CFGM tree saves the pointer to ConsoleVRDPServer in the Object node of AudioVRDE. */754 pThis->pConsoleVRDPServer = (ConsoleVRDPServer *)pvUser;741 /* Get the Console object pointer. */ 742 com::Guid ConsoleUuid(COM_IIDOF(IConsole)); 743 IConsole *pIConsole = (IConsole *)PDMDrvHlpQueryGenericUserObject(pDrvIns, ConsoleUuid.raw()); 744 AssertLogRelReturn(pIConsole, VERR_INTERNAL_ERROR_3); 745 Console *pConsole = static_cast<Console *>(pIConsole); 746 AssertLogRelReturn(pConsole, VERR_INTERNAL_ERROR_3); 747 748 /* Get the console VRDP object pointer. */ 749 pThis->pConsoleVRDPServer = pConsole->i_consoleVRDPServer(); 755 750 AssertLogRelMsgReturn(RT_VALID_PTR(pThis->pConsoleVRDPServer) || !pThis->pConsoleVRDPServer, 756 751 ("pConsoleVRDPServer=%p\n", pThis->pConsoleVRDPServer), VERR_INVALID_POINTER); 757 pThis->cClients = 0; 758 759 /* 760 * Get the AudioVRDE object pointer. 761 */ 762 pvUser = NULL; 763 rc = pDrvIns->pHlpR3->pfnCFGMQueryPtr(pCfg, "Object", &pvUser); /** @todo r=andy Get rid of this hack and use IHostAudio::SetCallback. */ 764 AssertMsgRCReturn(rc, ("Confguration error: No/bad \"Object\" value, rc=%Rrc\n", rc), rc); 765 766 pThis->pAudioVRDE = (AudioVRDE *)pvUser; 752 753 /* Get the AudioVRDE object pointer. */ 754 pThis->pAudioVRDE = pConsole->i_getAudioVRDE(); 767 755 AssertLogRelMsgReturn(RT_VALID_PTR(pThis->pAudioVRDE), ("pAudioVRDE=%p\n", pThis->pAudioVRDE), VERR_INVALID_POINTER); 768 756 RTCritSectEnter(&pThis->pAudioVRDE->mCritSect);
Note:
See TracChangeset
for help on using the changeset viewer.