Hello,
I have written a Win2000/XP filter driver based on DDK filespy sample, that
intercepts write attempts to removable media by reparsing IRP_MJ_CREATE.
When redirected file is copied to a quarantine location, my program inspects
it after IRP_MJ_CLEANUP passed through my completion routine. After
inspection, I am impersonating an original thread and copy file using filter’s
system thread to avoid reentrancy.
My quarantine directory is located on a fixed hard drive; removable media is
a USB token.
When my filter creates a file on USB token with ZwCreateFile to perform a
copy, the call never returns. This doesn’t happen during every time but
very often. There is no blue screen, but ZwCreateFile is stuck.
My dispatch routing is receiving a corresponding IRP_MJ_CREATE, created from
that call, ignoring it, and passing down using IoCallDriver(), but control
is never returned to ZwCreateFile() that sits in a system thread.
This problem is reproducible if I copy files to a remote system as well.
I’ve also tried not to use impersonation, but rather, create system thread
using a process that has network access, but problem is still there.
What could be the causing this?
Thank you,
Yury