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