From 3036cfef2f8afab6419fa07b78a5dc53052e1f47 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Fri, 12 Aug 2016 08:20:01 -0500 Subject: [PATCH] hidclass.sys: Do not send IRP_MJ_PNP ioctls. That is the Plug and Play Manager's job. Signed-off-by: Aric Stewart Signed-off-by: Alexandre Julliard --- dlls/hidclass.sys/pnp.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index 6ce68e01b93..c537bf6578f 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -75,22 +75,6 @@ static NTSTATUS SendDeviceIRP(DEVICE_OBJECT* device, IRP *irp) return status; } -static NTSTATUS PNP_SendPnPIRP(DEVICE_OBJECT *device, UCHAR minor) -{ - IO_STACK_LOCATION *irpsp; - IO_STATUS_BLOCK irp_status; - - IRP *irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status); - - irpsp = IoGetNextIrpStackLocation(irp); - irpsp->MinorFunction = minor; - - irpsp->Parameters.StartDevice.AllocatedResources = NULL; - irpsp->Parameters.StartDevice.AllocatedResourcesTranslated = NULL; - - return SendDeviceIRP(device, irp); -} - static NTSTATUS PNP_SendPowerIRP(DEVICE_OBJECT *device, DEVICE_POWER_STATE power) { IO_STATUS_BLOCK irp_status; @@ -183,22 +167,12 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) return status; } - status = PNP_SendPnPIRP(device, IRP_MN_START_DEVICE); - if (status != STATUS_SUCCESS) - { - ERR("Minidriver IRP_MN_START_DEVICE failed (%x)\n",status); - HeapFree(GetProcessHeap(), 0, PDO_id); - HID_DeleteDevice(&minidriver->minidriver, device); - return status; - } - status = call_minidriver(IOCTL_HID_GET_DEVICE_ATTRIBUTES, device, NULL, 0, &attr, sizeof(attr)); if (status != STATUS_SUCCESS) { ERR("Minidriver failed to get Attributes(%x)\n",status); - PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); HID_DeleteDevice(&minidriver->minidriver, device); HeapFree(GetProcessHeap(), 0, PDO_id); return status; @@ -220,7 +194,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) if (status != STATUS_SUCCESS) { ERR("Cannot get Device Descriptor(%x)\n",status); - PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); HID_DeleteDevice(&minidriver->minidriver, device); HeapFree(GetProcessHeap(), 0, PDO_id); return status; @@ -232,7 +205,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) if (i >= descriptor.bNumDescriptors) { ERR("No Report Descriptor found in reply\n"); - PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE); HID_DeleteDevice(&minidriver->minidriver, device); HeapFree(GetProcessHeap(), 0, PDO_id); return status; @@ -296,7 +268,6 @@ void PNP_CleanupPNP(DRIVER_OBJECT *driver) { list_remove(&tracked_device->entry); PNP_SendPowerIRP(tracked_device->FDO, PowerDeviceD3); - PNP_SendPnPIRP(tracked_device->FDO, IRP_MN_REMOVE_DEVICE); HID_DeleteDevice(tracked_device->minidriver, tracked_device->FDO); HeapFree(GetProcessHeap(), 0, tracked_device); }