Hello to everybody,
I’m writing a simple minifilter driver which intercepts IRP_MJ_CREATE to files
with specific reparse point tags and sends this information to a user-space
application.
I’m using the Filter Manager API FltSendMessage() to communicate with
user-space but I have a little problem with the timeout parameter. The OS is
Windows XP Service Pack 2.
The code looks roughly like this:
LARGE_INTEGER Timeout;
Timeout.QuadPart = (LONGLONG)seconds_to_wait * 10 * 1000 * 1000;
FltSendMessage(FilterHandle, ClientPort, Message, MessageLength, Reply,
ReplyLenght, &Timeout);
The problem is that FltSendMessage() returns STATUS_TIMEOUT immediatelly
regardless of the value of the Timeout variable. I even tried with larger
values, but the result is always the same - FltSendMessage() returns with
STATUS_TIMEOUT strightaway.
The problem here is that I must wait for a reply from user-space, or a
timeout, in which case I must fail the operation.
On the other side, if I pass a NULL pointer as the timeout, FltSendMessage()
blocks indefinitely just as documented.
I’m not sure if I’m doing something wrong or if this is a bug in
FltSendMessage(), but any help on this issue would be really appreciated.
Thank you in advance.
Regards,
Mitja Horvat