Hi, everyone, I wrote some code like this:
I don't know the Windows build-in drivers will check the pointer of EVENT variable before use, or use it directly.
Is there any problem if I do not call KeWaitForSingleObject and return directly?
Code: Select all
I am worry about if sometime the code is continue executing, but the EVENT variable is no longer valid.KEVENT event;
PIRP irp;
IO_STATUS_BLOCK iosb;
KeInitializeEvent(&event, NotificationEvent, FALSE);
irp = BuildIrp(devObj, ..., &event, &iosb);
status = IoCallDriver(devObj, irp);
if (status == STATUS_PENDING)
{
//Is there any problem if I delete this function call?
//KeWaitForSingleObject(&event, Executive, KernelMode, FALSE, NULL);
status = iosb.Status;
}
return status;
I don't know the Windows build-in drivers will check the pointer of EVENT variable before use, or use it directly.
Is there any problem if I do not call KeWaitForSingleObject and return directly?