VirtualBox

Changeset 57164 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Aug 3, 2015 8:41:21 PM (9 years ago)
Author:
vboxsync
Message:

DrvHostDSound.cpp: Don't uninitialize COM if we didn't succeed in the constructor (the destructor is _always_ called, do remember). All drivers and devices MUST check the PDM instance versions before doing anything (TODO: missing in other drivers too it seems).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp

    r57148 r57164  
    15411541static int dsoundConfigQueryStringAlloc(PCFGMNODE pNode, const char *pszName, char **ppszString)
    15421542{
     1543    /** @todo r=bird: What's wrong with CFGMR3QueryStringAlloc ??   */
    15431544    size_t cbString;
    15441545    int rc = CFGMR3QuerySize(pNode, pszName, &cbString);
     
    16021603{
    16031604    PDRVHOSTDSOUND pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTDSOUND);
    1604 
     1605    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
    16051606    LogFlowFuncEnter();
    16061607
    1607     CoUninitialize();
     1608    if (pThis->pDrvIns)
     1609        CoUninitialize();
    16081610
    16091611    LogFlowFuncLeave();
     
    16181620{
    16191621    PDRVHOSTDSOUND pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTDSOUND);
    1620     DSLOGREL(("Audio: Initializing DirectSound audio driver\n"));
     1622    LogRel(("Audio: Initializing DirectSound audio driver\n"));
     1623    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    16211624
    16221625    HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
    16231626    if (FAILED(hr))
    16241627    {
    1625         DSLOGREL(("DSound: COM initialize %Rhrc\n", hr));
     1628        LogRel(("DSound: COM initialize %Rhrc\n", hr));
    16261629        return VERR_NOT_SUPPORTED;
    16271630    }
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