Commit 0d406f09 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

hidclass.sys: Pass a KEVENT to IoBuildDeviceIoControlRequest() in call_minidriver().

parent f8c9027d
......@@ -92,34 +92,19 @@ NTSTATUS WINAPI HidRegisterMinidriver(HID_MINIDRIVER_REGISTRATION *registration)
return STATUS_SUCCESS;
}
static NTSTATUS WINAPI internalComplete(DEVICE_OBJECT *deviceObject, IRP *irp,
void *context)
{
HANDLE event = context;
SetEvent(event);
return STATUS_MORE_PROCESSING_REQUIRED;
}
NTSTATUS call_minidriver(ULONG code, DEVICE_OBJECT *device, void *in_buff, ULONG in_size, void *out_buff, ULONG out_size)
{
IRP *irp;
IO_STATUS_BLOCK irp_status;
NTSTATUS status;
HANDLE event = CreateEventA(NULL, FALSE, FALSE, NULL);
IO_STATUS_BLOCK io;
KEVENT event;
irp = IoBuildDeviceIoControlRequest(code, device, in_buff, in_size,
out_buff, out_size, TRUE, NULL, &irp_status);
KeInitializeEvent(&event, NotificationEvent, FALSE);
IoSetCompletionRoutine(irp, internalComplete, event, TRUE, TRUE, TRUE);
status = IoCallDriver(device, irp);
if (status == STATUS_PENDING)
WaitForSingleObject(event, INFINITE);
status = irp->IoStatus.u.Status;
irp = IoBuildDeviceIoControlRequest(code, device, in_buff, in_size,
out_buff, out_size, TRUE, &event, &io);
IoCompleteRequest(irp, IO_NO_INCREMENT );
CloseHandle(event);
if (IoCallDriver(device, irp) == STATUS_PENDING)
KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, NULL);
return status;
return io.u.Status;
}
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