VirtualBox

Ignore:
Timestamp:
May 6, 2021 2:24:47 PM (4 years ago)
Author:
vboxsync
Message:

Audio/Dev*: Overhauled the attach/detach code a little, making attach fail if the configured driver doesn't have a PDMIADUIOCONNECTOR interface among other things. [more] bugref:9890

File:
1 edited

Legend:

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

    r88905 r88906  
    28502850
    28512851/**
    2852  * Attach command, internal version.
    2853  *
    2854  * This is called to let the device attach to a driver for a specified LUN
    2855  * during runtime. This is not called during VM construction, the device
    2856  * constructor has to attach to all the available drivers.
     2852 * Worker for sb16Construct() and sb16Attach().
    28572853 *
    28582854 * @returns VBox status code.
    28592855 * @param   pThis       SB16 state.
    28602856 * @param   uLUN        The logical unit which is being detached.
    2861  * @param   fFlags      Flags, combination of the PDMDEVATT_FLAGS_* \#defines.
    28622857 * @param   ppDrv       Attached driver instance on success. Optional.
    28632858 */
    2864 static int sb16AttachInternal(PSB16STATE pThis, unsigned uLUN, uint32_t fFlags, PSB16DRIVER *ppDrv)
    2865 {
    2866     RT_NOREF(fFlags);
    2867 
     2859static int sb16AttachInternal(PSB16STATE pThis, unsigned uLUN, PSB16DRIVER *ppDrv)
     2860{
    28682861    /*
    28692862     * Allocate a new driver structure and try attach the driver.
     
    29032896            if (ppDrv)
    29042897                *ppDrv = pDrv;
    2905             LogFunc(("iLUN=%u, fFlags=0x%x: VINF_SUCCESS\n", uLUN, fFlags));
     2898            LogFunc(("LUN#%u: VINF_SUCCESS\n", uLUN));
    29062899            return VINF_SUCCESS;
    29072900        }
     
    29142907    RTMemFree(pDrv);
    29152908
    2916     LogFunc(("iLUN=%u, fFlags=0x%x: rc=%Rrc\n", uLUN, fFlags, rc));
     2909    LogFunc(("LUN#%u: rc=%Rrc\n", uLUN, rc));
    29172910    return rc;
    29182911}
     
    29242917{
    29252918    PSB16STATE pThis = PDMDEVINS_2_DATA(pDevIns, PSB16STATE);
    2926 
    2927     LogFunc(("iLUN=%u, fFlags=0x%x\n", iLUN, fFlags));
     2919    RT_NOREF(fFlags);
     2920    LogFunc(("iLUN=%u, fFlags=%#x\n", iLUN, fFlags));
    29282921
    29292922    /** @todo r=andy Any locking required here? */
    29302923
    29312924    PSB16DRIVER pDrv;
    2932     int rc = sb16AttachInternal(pThis, iLUN, fFlags, &pDrv);
     2925    int rc = sb16AttachInternal(pThis, iLUN, &pDrv);
    29332926    if (RT_SUCCESS(rc))
    29342927    {
     
    32633256        AssertBreak(iLun < UINT8_MAX);
    32643257        LogFunc(("Trying to attach driver for LUN#%u ...\n", iLun));
    3265         rc = sb16AttachInternal(pThis, iLun, 0 /* fFlags */, NULL /* ppDrv */);
     3258        rc = sb16AttachInternal(pThis, iLun, NULL /* ppDrv */);
    32663259        if (rc == VERR_PDM_NO_ATTACHED_DRIVER)
    32673260        {
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