What’s the call stack of the hanging thread? No one can tell you what’s
going on without seeing that.
Calling ZwQueryInformationFile from the paging write path is going to
lead to a deadlock eventually as well.
Why are you even doing this? If you’re writing a minifilter you can just
call FltQueryInformationFile. If you’re not writing a minifilter (which you
should and is another conversation) then you can just build an IRP and send
the query to the FO.
>But I still don’t get why you were saying "Calling ZwQueryInformationFile
from the paging write path is going to lead to >a deadlock eventually"?
Paging I/O is sent either at APC level or in a guarded region (depending on
the O/S release). Both of these disable special kernel APCs from executing,
which the Zw APIs ultimately use to perform I/O completion of asynchronous
I/Os. So, once one of the IRPs generated by your Zw call is pended the
thread will deadlock (it won’t make progress until the APC completes, but
the APC won’t complete because it’s blocked).
wrote in message news:xxxxx@ntfsd… > yes, I built an IRP to do the query and everything is ok now. > > But I still don’t get why you were saying “Calling ZwQueryInformationFile > from the paging write path is going to lead to a deadlock eventually”? >