hidclass.sys: Do not send IRP_MJ_POWER ioctls.
That is the Plug and Play Manager's job. Signed-off-by: Aric Stewart <aric@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3036cfef2f
commit
b16ba45450
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue