Convert WDM to WDF

KeInitializeEvent (&completionEvent, NotificationEvent, FALSE);
irp = IoBuildSynchronousFsdRequest ( write ? IRP_MJ_WRITE : IRP_MJ_READ,
deviceObject,
buffer, length, &offset, &completionEvent, &ioStatusBlock);
if (!irp)
{
Dump(“aqui!\n”);
return STATUS_INSUFFICIENT_RESOURCES;
}

ObReferenceObject (deviceObject);
status = IoCallDriver (deviceObject, irp);

if (status == STATUS_PENDING)
{
status = KeWaitForSingleObject (&completionEvent, Executive, KernelMode,
FALSE, NULL);
if (NT_SUCCESS (status))
status = ioStatusBlock.Status;
}
s,
Thiago Fabre
UNESP / Bauru
(14) 91096114