VirtualBox

Ignore:
Timestamp:
Jul 13, 2012 9:59:27 AM (12 years ago)
Author:
vboxsync
Message:

PDMDriver: Changed the previous fix to use the top level device registration structure pointer instead of the internal one. That's what we're doing elsewhere.

File:
1 edited

Legend:

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

    r42138 r42140  
    396396     */
    397397    const char *pszDevice = pLun->pDevIns
    398                           ? pLun->pDevIns->Internal.s.pDevR3->pReg->szName
    399                           : pLun->pUsbIns->Internal.s.pUsbDev->pReg->szName;
     398                          ? pLun->pDevIns->pReg->szName
     399                          : pLun->pUsbIns->pReg->szName;
    400400    char        szLun[32];
    401401    RTStrPrintf(szLun, sizeof(szLun), "%u", pLun->iLun);
     
    834834     * The requirement is that the driver/device above has a detach method.
    835835     */
    836     if (pDrvIns->Internal.s.pUp
     836    if (  pDrvIns->Internal.s.pUp
    837837        ? !pDrvIns->Internal.s.pUp->pReg->pfnDetach
    838838        :   pDrvIns->Internal.s.pLun->pDevIns
    839           ? !pDrvIns->Internal.s.pLun->pDevIns->Internal.s.pDevR3->pReg->pfnDetach
    840           : !pDrvIns->Internal.s.pLun->pUsbIns->Internal.s.pUsbDev->pReg->pfnDriverDetach
     839          ? !pDrvIns->Internal.s.pLun->pDevIns->pReg->pfnDetach
     840          : !pDrvIns->Internal.s.pLun->pUsbIns->pReg->pfnDriverDetach
    841841       )
    842842    {
     
    910910                if (pLun->pDevIns)
    911911                {
    912                     if (pLun->pDevIns->Internal.s.pDevR3->pReg->pfnDetach)
     912                    if (pLun->pDevIns->pReg->pfnDetach)
    913913                    {
    914914                        PDMCritSectEnter(pLun->pDevIns->pCritSectRoR3, VERR_IGNORED);
    915                         pLun->pDevIns->Internal.s.pDevR3->pReg->pfnDetach(pLun->pDevIns, pLun->iLun, fFlags);
     915                        pLun->pDevIns->pReg->pfnDetach(pLun->pDevIns, pLun->iLun, fFlags);
    916916                        PDMCritSectLeave(pLun->pDevIns->pCritSectRoR3);
    917917                    }
     
    919919                else
    920920                {
    921                     if (pLun->pUsbIns->Internal.s.pUsbDev->pReg->pfnDriverDetach)
     921                    if (pLun->pUsbIns->pReg->pfnDriverDetach)
    922922                    {
    923923                        /** @todo USB device locking? */
    924924                        /** @todo add flags to pfnDriverDetach. */
    925                         pLun->pUsbIns->Internal.s.pUsbDev->pReg->pfnDriverDetach(pLun->pUsbIns, pLun->iLun);
     925                        pLun->pUsbIns->pReg->pfnDriverDetach(pLun->pUsbIns, pLun->iLun);
    926926                    }
    927927                }
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