Commit 3036cfef authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

hidclass.sys: Do not send IRP_MJ_PNP ioctls.

That is the Plug and Play Manager's job. Signed-off-by: 's avatarAric Stewart <aric@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ab3b9bd8
...@@ -75,22 +75,6 @@ static NTSTATUS SendDeviceIRP(DEVICE_OBJECT* device, IRP *irp) ...@@ -75,22 +75,6 @@ static NTSTATUS SendDeviceIRP(DEVICE_OBJECT* device, IRP *irp)
return status; 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) static NTSTATUS PNP_SendPowerIRP(DEVICE_OBJECT *device, DEVICE_POWER_STATE power)
{ {
IO_STATUS_BLOCK irp_status; IO_STATUS_BLOCK irp_status;
...@@ -183,22 +167,12 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) ...@@ -183,22 +167,12 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
return status; 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, status = call_minidriver(IOCTL_HID_GET_DEVICE_ATTRIBUTES, device,
NULL, 0, &attr, sizeof(attr)); NULL, 0, &attr, sizeof(attr));
if (status != STATUS_SUCCESS) if (status != STATUS_SUCCESS)
{ {
ERR("Minidriver failed to get Attributes(%x)\n",status); ERR("Minidriver failed to get Attributes(%x)\n",status);
PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE);
HID_DeleteDevice(&minidriver->minidriver, device); HID_DeleteDevice(&minidriver->minidriver, device);
HeapFree(GetProcessHeap(), 0, PDO_id); HeapFree(GetProcessHeap(), 0, PDO_id);
return status; return status;
...@@ -220,7 +194,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) ...@@ -220,7 +194,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
if (status != STATUS_SUCCESS) if (status != STATUS_SUCCESS)
{ {
ERR("Cannot get Device Descriptor(%x)\n",status); ERR("Cannot get Device Descriptor(%x)\n",status);
PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE);
HID_DeleteDevice(&minidriver->minidriver, device); HID_DeleteDevice(&minidriver->minidriver, device);
HeapFree(GetProcessHeap(), 0, PDO_id); HeapFree(GetProcessHeap(), 0, PDO_id);
return status; return status;
...@@ -232,7 +205,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO) ...@@ -232,7 +205,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
if (i >= descriptor.bNumDescriptors) if (i >= descriptor.bNumDescriptors)
{ {
ERR("No Report Descriptor found in reply\n"); ERR("No Report Descriptor found in reply\n");
PNP_SendPnPIRP(device, IRP_MN_REMOVE_DEVICE);
HID_DeleteDevice(&minidriver->minidriver, device); HID_DeleteDevice(&minidriver->minidriver, device);
HeapFree(GetProcessHeap(), 0, PDO_id); HeapFree(GetProcessHeap(), 0, PDO_id);
return status; return status;
...@@ -296,7 +268,6 @@ void PNP_CleanupPNP(DRIVER_OBJECT *driver) ...@@ -296,7 +268,6 @@ void PNP_CleanupPNP(DRIVER_OBJECT *driver)
{ {
list_remove(&tracked_device->entry); list_remove(&tracked_device->entry);
PNP_SendPowerIRP(tracked_device->FDO, PowerDeviceD3); PNP_SendPowerIRP(tracked_device->FDO, PowerDeviceD3);
PNP_SendPnPIRP(tracked_device->FDO, IRP_MN_REMOVE_DEVICE);
HID_DeleteDevice(tracked_device->minidriver, tracked_device->FDO); HID_DeleteDevice(tracked_device->minidriver, tracked_device->FDO);
HeapFree(GetProcessHeap(), 0, tracked_device); HeapFree(GetProcessHeap(), 0, tracked_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