VirtualBox

Ignore:
Timestamp:
Mar 31, 2015 10:29:00 PM (10 years ago)
Author:
vboxsync
Message:

VBoxUSB: fixed BSOD on host computer at system waking up

Location:
trunk/src/VBox/HostDrivers/VBoxUSB/win/dev
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbDev.h

    r49137 r55058  
    190190}
    191191
    192 static DECLHIDDEN(VOID) vboxUsbDdiStateWaitOtherCompleted(PVBOXUSBDEV_EXT pDevExt)
    193 {
    194     /* Earlier we assumed that 1 request will be pending while we service
    195        Device Power IRP which was leading to host hang when USB is connected
    196        to VM.
    197        With debugging found that at the point when host goes to sleep
    198        state and USB is connected to VM,  two Power IRP requests are pending :
    199        One for SYSTEM and other for DEVICE.
    200     */
    201     VBoxDrvToolRefWaitEqual(&pDevExt->DdiState.Ref, 3);
    202 }
    203 
    204192#endif /* #ifndef ___VBoxUsbDev_h___ */
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbPnP.cpp

    r36968 r55058  
    7070    ENMVBOXUSB_PNPSTATE enmState = vboxUsbPnPStateGet(pDevExt);
    7171    NTSTATUS Status = STATUS_SUCCESS;
    72     if (enmState == ENMVBOXUSB_PNPSTATE_STOP_PENDING)
    73     {
    74         IoCopyCurrentIrpStackLocationToNext(pIrp);
    75         Status = VBoxDrvToolIoPostSync(pDevExt->pLowerDO, pIrp);
    76         if (NT_SUCCESS(Status))
    77         {
    78             vboxUsbPnPStateRestore(pDevExt);
    79         }
    80     }
    81     else
    82     {
    83         Assert(0);
    84         Assert(enmState == ENMVBOXUSB_PNPSTATE_STARTED);
    85     }
    86 
     72   
     73    IoCopyCurrentIrpStackLocationToNext(pIrp);
     74    Status = VBoxDrvToolIoPostSync(pDevExt->pLowerDO, pIrp);
     75    if (NT_SUCCESS(Status) && enmState == ENMVBOXUSB_PNPSTATE_STOP_PENDING)
     76    {
     77        vboxUsbPnPStateRestore(pDevExt);
     78    }
     79   
     80    Status = STATUS_SUCCESS;
    8781    VBoxDrvToolIoComplete(pIrp, Status, 0);
    8882    vboxUsbDdiStateRelease(pDevExt);
     
    144138    ENMVBOXUSB_PNPSTATE enmState = vboxUsbPnPStateGet(pDevExt);
    145139    NTSTATUS Status = STATUS_SUCCESS;
    146     if (enmState == ENMVBOXUSB_PNPSTATE_REMOVE_PENDING)
    147     {
    148         IoCopyCurrentIrpStackLocationToNext(pIrp);
    149         Status = VBoxDrvToolIoPostSync(pDevExt->pLowerDO, pIrp);
    150         if (NT_SUCCESS(Status))
    151         {
    152             vboxUsbPnPStateRestore(pDevExt);
    153         }
    154     }
    155     else
    156     {
    157         Assert(0);
    158         Assert(enmState == ENMVBOXUSB_PNPSTATE_STARTED);
    159     }
    160 
     140    IoCopyCurrentIrpStackLocationToNext(pIrp);
     141   
     142    Status = VBoxDrvToolIoPostSync(pDevExt->pLowerDO, pIrp);
     143
     144    if (NT_SUCCESS(Status) &&
     145        enmState == ENMVBOXUSB_PNPSTATE_REMOVE_PENDING)
     146    {
     147        vboxUsbPnPStateRestore(pDevExt);
     148    }
     149   
     150    Status = STATUS_SUCCESS;
    161151    VBoxDrvToolIoComplete(pIrp, Status, 0);
    162152    vboxUsbDdiStateRelease(pDevExt);
  • trunk/src/VBox/HostDrivers/VBoxUSB/win/dev/VBoxUsbPwr.cpp

    r36968 r55058  
    210210    PIRP pIrp = pCtx->pIrp;
    211211
    212     vboxUsbDdiStateWaitOtherCompleted(pDevExt);
    213 
    214212    vboxUsbPwrIoPostDev(pDevExt, pIrp);
    215213
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