hidclass.sys: Do not manually clean up devices on unload.
We can rely on ntoskrnl to do this for us. Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
dece98fb59
commit
76daa6b70c
|
@ -109,7 +109,6 @@ NTSTATUS WINAPI HID_PNP_Dispatch(DEVICE_OBJECT *device, IRP *irp) DECLSPEC_HIDDE
|
||||||
|
|
||||||
/* Pseudo-Plug and Play support*/
|
/* Pseudo-Plug and Play support*/
|
||||||
NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT* PDO) DECLSPEC_HIDDEN;
|
NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT* PDO) DECLSPEC_HIDDEN;
|
||||||
NTSTATUS PNP_RemoveDevice(minidriver *minidriver, DEVICE_OBJECT* device, IRP* irp) DECLSPEC_HIDDEN;
|
|
||||||
|
|
||||||
/* Parsing HID Report Descriptors into preparsed data */
|
/* Parsing HID Report Descriptors into preparsed data */
|
||||||
WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) DECLSPEC_HIDDEN;
|
WINE_HIDP_PREPARSED_DATA* ParseDescriptor(BYTE *descriptor, unsigned int length) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -48,12 +48,6 @@ static VOID WINAPI UnloadDriver(DRIVER_OBJECT *driver)
|
||||||
md = find_minidriver(driver);
|
md = find_minidriver(driver);
|
||||||
if (md)
|
if (md)
|
||||||
{
|
{
|
||||||
hid_device *device, *next;
|
|
||||||
TRACE("%i devices to unload\n", list_count(&md->device_list));
|
|
||||||
LIST_FOR_EACH_ENTRY_SAFE(device, next, &md->device_list, hid_device, entry)
|
|
||||||
{
|
|
||||||
PNP_RemoveDevice(md, device->device, NULL);
|
|
||||||
}
|
|
||||||
if (md->DriverUnload)
|
if (md->DriverUnload)
|
||||||
md->DriverUnload(md->minidriver.DriverObject);
|
md->DriverUnload(md->minidriver.DriverObject);
|
||||||
list_remove(&md->entry);
|
list_remove(&md->entry);
|
||||||
|
|
|
@ -205,7 +205,7 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS PNP_RemoveDevice(minidriver *minidriver, DEVICE_OBJECT *device, IRP *irp)
|
static NTSTATUS remove_device(minidriver *minidriver, DEVICE_OBJECT *device, IRP *irp)
|
||||||
{
|
{
|
||||||
BASE_DEVICE_EXTENSION *ext = device->DeviceExtension;
|
BASE_DEVICE_EXTENSION *ext = device->DeviceExtension;
|
||||||
hid_device *hiddev;
|
hid_device *hiddev;
|
||||||
|
@ -306,7 +306,7 @@ NTSTATUS WINAPI HID_PNP_Dispatch(DEVICE_OBJECT *device, IRP *irp)
|
||||||
}
|
}
|
||||||
case IRP_MN_REMOVE_DEVICE:
|
case IRP_MN_REMOVE_DEVICE:
|
||||||
{
|
{
|
||||||
return PNP_RemoveDevice(minidriver, device, irp);
|
return remove_device(minidriver, device, irp);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue