Regarding the possible problem I mentioned some time ago. The
following might happen:
- Many forget to handle STATUS_PENDING. This won’t make problems on
NT/2K as it rarely happens. It would crash XP as soon as the logon
screen comes up. - If files are found by the FSD, but you filter all of them out,
recall the driver - DON’T return zero in the information field. - Don’t use Irp->UserBuffer in the completion routine - it is run in
arbitrary context, and the pointer is likely to be invalid - Don’t return STATUS_PENDING for IRP_MJ_DIRECTORY_CONTROL and do
processing in the worker thread. Same reason as last one. - Since you need to handle STATUS_PENDING, you must have a
completion routine and wait for it in the dispatch. - Remember to update the Irp->IoStatus.Status filed accordingly!
It’s likely that FSD returns STATUS_NO_MORE_FILES. In a special case it
is required to set the status to STATUS_NO_SUCH_FILE (only if the call
had SL_RESTART flag, and all files are filtered out!) - Don’t return STATUS_NO_SUCH_FILE, if more files might be
available! This is the most common mistake.
I’ll be happy to answer any specific questions about this, as I have
spent quite some time on directory filtering, and it takes about 40% of
my driver code:-)
Also, feel free to add additional tips and comment above ones.
This seems lame for old timers, but I was a victim of STATUS_PENDING
in early version of my driver, and I have found that many people make
the above errors.
(BTW, I made this post because I had many people contacting me via
e-mail about directory filtering)
–
Kind regards, Dejan M. CEO Alfa Co. www.alfasp.com
E-mail: xxxxx@alfasp.com
ICQ#: 56570367
Alfa File Monitor - File monitoring system for Win32 developers.
Alfa File Protector - File protection and hiding system for Win32
developers.
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