VirtualBox

Ignore:
Timestamp:
Dec 10, 2024 12:40:08 PM (5 weeks ago)
Author:
vboxsync
Message:

PDMUsb: bugref:10810 Introduced PDMR3UsbQueryDeviceLun needed by Console::i_onNetworkAdapterChange

File:
1 edited

Legend:

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

    r106061 r107276  
    15441544    RTCritSectRwLeaveExcl(&pVM->pdm.s.CoreListCritSectRw);
    15451545    LogFlow(("PDMR3UsbDriverDetach: returns %Rrc\n", rc));
     1546    return rc;
     1547}
     1548
     1549
     1550/**
     1551 * Queries the base interface of a device LUN.
     1552 *
     1553 * This differs from PDMR3UsbQueryLun by that it returns the interface on the
     1554 * device and not the top level driver.
     1555 *
     1556 * @returns VBox status code.
     1557 * @param   pUVM            The user mode VM handle.
     1558 * @param   pszDevice       Device name.
     1559 * @param   iInstance       Device instance.
     1560 * @param   iLun            The Logical Unit to obtain the interface of.
     1561 * @param   ppBase          Where to store the base interface pointer.
     1562 */
     1563VMMR3DECL(int) PDMR3UsbQueryDeviceLun(PUVM pUVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMIBASE *ppBase)
     1564{
     1565    LogFlow(("PDMR3UsbQueryDeviceLun: pszDevice=%p:{%s} iInstance=%u iLun=%u ppBase=%p\n",
     1566             pszDevice, pszDevice, iInstance, iLun, ppBase));
     1567    *ppBase = NULL;
     1568    UVM_ASSERT_VALID_EXT_RETURN(pUVM, VERR_INVALID_VM_HANDLE);
     1569    PVM pVM = pUVM->pVM;
     1570    VM_ASSERT_VALID_EXT_RETURN(pVM, VERR_INVALID_VM_HANDLE);
     1571
     1572    /*
     1573     * Find the LUN.
     1574     */
     1575    RTCritSectRwEnterShared(&pVM->pdm.s.CoreListCritSectRw);
     1576
     1577    PPDMLUN pLun;
     1578    int rc = pdmR3UsbFindLun(pVM, pszDevice, iInstance, iLun, &pLun);
     1579    if (RT_SUCCESS(rc))
     1580    {
     1581        *ppBase = pLun->pBase;
     1582
     1583        RTCritSectRwLeaveShared(&pVM->pdm.s.CoreListCritSectRw);
     1584        LogFlow(("PDMR3UsbQueryDeviceLun: return %Rrc and *ppBase=%p\n", VINF_SUCCESS, *ppBase));
     1585        return VINF_SUCCESS;
     1586    }
     1587
     1588    RTCritSectRwLeaveShared(&pVM->pdm.s.CoreListCritSectRw);
     1589    LogFlow(("PDMR3UsbQueryDeviceLun: returns %Rrc\n", rc));
    15461590    return rc;
    15471591}
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