IRPs and KeWaitForSingleObject

When I pass an IRP to the underlying driver, I’m wondering if it might be
reasonable to set a timeout value on the KeWaitForSingleObject().

What I’ve seen in sample code here on the list and elsewhere is usually
something like:

IoAllocateIrp();
KeInitializeEvent();
// Initialize the Irp, IrpSp
IoSetCompletionRoutine();
IoCallDriver();
KeWaitForSingleObject(&event, Executive, KernelMode, TRUE, 0); // No timeout
value

If I send a timeout value to KeWaitForSingleObject(), and the request
actually times out, how do I handle this situation? I don’t actually own the
IRP anymore do I?

If the above question makes you wonder, “why?”, I’m asking because I find
that my filter code is able to read data from a file object when the
IRP_MJ_CREATE that leads to the read is initiated from the local file
system, but when the IRP_MJ_CREATE that leads to the read is initiated from
a client, the read hangs (srv.sys is involved) the create thread.

What is strange about this is that I successfully retrieved
FILE_STANDARD_INFORMATION from the FileObject a few lines of code earlier.
The code in between uses ZwCreateFile to open a different file. Everything
is successful right up to the call to KeWaitForSingleObject() which never
completes.

Thank you in advance for any information that you might be able to provide.

Brad


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com