Commit 0f482023 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winebus.sys: Handle IRP_MN_SURPRISE_REMOVAL and set removed flag.

parent 25155186
...@@ -372,10 +372,6 @@ void bus_unlink_hid_device(DEVICE_OBJECT *device) ...@@ -372,10 +372,6 @@ void bus_unlink_hid_device(DEVICE_OBJECT *device)
EnterCriticalSection(&device_list_cs); EnterCriticalSection(&device_list_cs);
list_remove(&pnp_device->entry); list_remove(&pnp_device->entry);
LeaveCriticalSection(&device_list_cs); LeaveCriticalSection(&device_list_cs);
EnterCriticalSection(&ext->cs);
ext->removed = TRUE;
LeaveCriticalSection(&ext->cs);
} }
void bus_remove_hid_device(DEVICE_OBJECT *device) void bus_remove_hid_device(DEVICE_OBJECT *device)
...@@ -698,13 +694,18 @@ static NTSTATUS pdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp) ...@@ -698,13 +694,18 @@ static NTSTATUS pdo_pnp_dispatch(DEVICE_OBJECT *device, IRP *irp)
status = STATUS_SUCCESS; status = STATUS_SUCCESS;
break; break;
case IRP_MN_SURPRISE_REMOVAL:
EnterCriticalSection(&ext->cs);
remove_pending_irps(device);
ext->removed = TRUE;
LeaveCriticalSection(&ext->cs);
break;
case IRP_MN_REMOVE_DEVICE: case IRP_MN_REMOVE_DEVICE:
{ {
struct pnp_device *pnp_device = ext->pnp_device; struct pnp_device *pnp_device = ext->pnp_device;
EnterCriticalSection(&ext->cs);
remove_pending_irps(device); remove_pending_irps(device);
LeaveCriticalSection(&ext->cs);
ext->vtbl->free_device(device); ext->vtbl->free_device(device);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment