Changeset 42138 in vbox
- Timestamp:
- Jul 13, 2012 9:49:48 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMR3/PDMDriver.cpp
r41965 r42138 395 395 * Gather the attributes used in the matching process. 396 396 */ 397 const char *pszDevice = pLun->pDevIns->Internal.s.pDevR3->pReg->szName; 397 const char *pszDevice = pLun->pDevIns 398 ? pLun->pDevIns->Internal.s.pDevR3->pReg->szName 399 : pLun->pUsbIns->Internal.s.pUsbDev->pReg->szName; 398 400 char szLun[32]; 399 401 RTStrPrintf(szLun, sizeof(szLun), "%u", pLun->iLun); … … 834 836 if (pDrvIns->Internal.s.pUp 835 837 ? !pDrvIns->Internal.s.pUp->pReg->pfnDetach 836 : !pDrvIns->Internal.s.pLun->pDevIns->pReg->pfnDetach) 838 : 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 841 ) 837 842 { 838 843 AssertMsgFailed(("Cannot detach driver instance because the driver/device above doesn't support it!\n")); … … 901 906 Assert(pLun->pTop == pCur); 902 907 pLun->pTop = NULL; 903 if (!(fFlags & PDM_TACH_FLAGS_NO_CALLBACKS) && pLun->pDevIns->pReg->pfnDetach)908 if (!(fFlags & PDM_TACH_FLAGS_NO_CALLBACKS)) 904 909 { 905 PDMCritSectEnter(pLun->pDevIns->pCritSectRoR3, VERR_IGNORED); 906 pLun->pDevIns->pReg->pfnDetach(pLun->pDevIns, pLun->iLun, fFlags); 907 PDMCritSectLeave(pLun->pDevIns->pCritSectRoR3); 910 if (pLun->pDevIns) 911 { 912 if (pLun->pDevIns->Internal.s.pDevR3->pReg->pfnDetach) 913 { 914 PDMCritSectEnter(pLun->pDevIns->pCritSectRoR3, VERR_IGNORED); 915 pLun->pDevIns->Internal.s.pDevR3->pReg->pfnDetach(pLun->pDevIns, pLun->iLun, fFlags); 916 PDMCritSectLeave(pLun->pDevIns->pCritSectRoR3); 917 } 918 } 919 else 920 { 921 if (pLun->pUsbIns->Internal.s.pUsbDev->pReg->pfnDriverDetach) 922 { 923 /** @todo USB device locking? */ 924 /** @todo add flags to pfnDriverDetach. */ 925 pLun->pUsbIns->Internal.s.pUsbDev->pReg->pfnDriverDetach(pLun->pUsbIns, pLun->iLun); 926 } 927 } 908 928 } 909 929 }
Note:
See TracChangeset
for help on using the changeset viewer.