Aric Stewart : hidclass.sys: Do not send IRP_MJ_POWER ioctls.
Alexandre Julliard
julliard at winehq.org
Wed Aug 17 10:24:24 CDT 2016
Module: wine
Branch: master
Commit: b16ba45450a9e00df28652a6183fcb6e35bb4354
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b16ba45450a9e00df28652a6183fcb6e35bb4354
Author: Aric Stewart <aric at codeweavers.com>
Date: Fri Aug 12 08:20:11 2016 -0500
hidclass.sys: Do not send IRP_MJ_POWER ioctls.
That is the Plug and Play Manager's job.
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/hidclass.sys/pnp.c | 40 ----------------------------------------
1 file changed, 40 deletions(-)
diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c
index c537bf6..8fd5c17 100644
--- a/dlls/hidclass.sys/pnp.c
+++ b/dlls/hidclass.sys/pnp.c
@@ -53,44 +53,6 @@ static NTSTATUS WINAPI internalComplete(DEVICE_OBJECT *deviceObject, IRP *irp,
return STATUS_MORE_PROCESSING_REQUIRED;
}
-static NTSTATUS SendDeviceIRP(DEVICE_OBJECT* device, IRP *irp)
-{
- NTSTATUS status;
- IO_STACK_LOCATION *irpsp;
- HANDLE event = CreateEventA(NULL, FALSE, FALSE, NULL);
-
- irp->UserEvent = event;
- irpsp = IoGetNextIrpStackLocation(irp);
- irpsp->CompletionRoutine = internalComplete;
- irpsp->Control = SL_INVOKE_ON_SUCCESS | SL_INVOKE_ON_ERROR;
-
- IoCallDriver(device, irp);
-
- if (irp->IoStatus.u.Status == STATUS_PENDING)
- WaitForSingleObject(event, INFINITE);
-
- status = irp->IoStatus.u.Status;
- IoCompleteRequest(irp, IO_NO_INCREMENT );
- CloseHandle(event);
- return status;
-}
-
-static NTSTATUS PNP_SendPowerIRP(DEVICE_OBJECT *device, DEVICE_POWER_STATE power)
-{
- IO_STATUS_BLOCK irp_status;
- IO_STACK_LOCATION *irpsp;
-
- IRP *irp = IoBuildSynchronousFsdRequest(IRP_MJ_POWER, device, NULL, 0, NULL, NULL, &irp_status);
-
- irpsp = IoGetNextIrpStackLocation(irp);
- irpsp->MinorFunction = IRP_MN_SET_POWER;
-
- irpsp->Parameters.Power.Type = DevicePowerState;
- irpsp->Parameters.Power.State.DeviceState = power;
-
- return SendDeviceIRP(device, irp);
-}
-
static NTSTATUS get_device_id(DEVICE_OBJECT *device, BUS_QUERY_ID_TYPE type, WCHAR **id)
{
NTSTATUS status;
@@ -252,7 +214,6 @@ NTSTATUS WINAPI PNP_AddDevice(DRIVER_OBJECT *driver, DEVICE_OBJECT *PDO)
ext->ring_buffer = RingBuffer_Create(sizeof(HID_XFER_PACKET) + ext->preparseData->caps.InputReportByteLength);
HID_StartDeviceThread(device);
- PNP_SendPowerIRP(device, PowerDeviceD0);
return STATUS_SUCCESS;
}
@@ -267,7 +228,6 @@ void PNP_CleanupPNP(DRIVER_OBJECT *driver)
if (tracked_device->minidriver->DriverObject == driver)
{
list_remove(&tracked_device->entry);
- PNP_SendPowerIRP(tracked_device->FDO, PowerDeviceD3);
HID_DeleteDevice(tracked_device->minidriver, tracked_device->FDO);
HeapFree(GetProcessHeap(), 0, tracked_device);
}
More information about the wine-cvs
mailing list