Any time a thread “hangs” the obvious thing to ask is “for what event is
this thread waiting?” And then, once you figure that out, the next question
is “which thread is responsible for signaling that event?” In other words,
look at the “hung” thread in the debugger. For what is it waiting? Odds
are, it is waiting for a lock of some sort. In that case, the question is
why the owner of the lock has not released it.
Of course, locks are not the ONLY reason this can happen. Other reasons:
* You are using fast mutexes. Using a fast mutex around a Zw* API call is
prohibited because it will raise IRQL above PASSIVE_LEVEL and this will in
turn block the delivery of APCs which are essential to correct I/O
completion. The DDK clearly documents that Zw I/O calls may only be used at
PASSIVE_LEVEL (and for good reason.)
* You are breaking a file with an oplock but the oplock break cannot proceed
because the oplock APC is enqueued to the current thread.
No doubt there are others, but those are the two that come quickly to mind.
I hope this helps.
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: xxxxx@excite.com [mailto:xxxxx@excite.com]
Sent: Saturday, June 24, 2000 8:00 PM
To: File Systems Developers
Subject: [ntfsd] File filter hangs on IRP_MJ_CLEANUP .ZwCreate/ZwRead
flags
Hi
I develop a file filter driver and in my Create(IRP_MJ_CREATE) entry point
I do the following for testing(of course I use synchronization with my own
create requests):
{
HANDLE q;
ZwCreateFile(&q,(GENERIC_READ |
SYNCHRONIZE),&oa,&iosbl,NULL,FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ,
FILE_OPEN , FILE_SYNCHRONOUS_IO_NONALERT|FILE_NON_DIRECTORY_FILE,
NULL, 0 );
…
ZwReadFile(q,0,0, 0,&iosbl,buff,howmuch,NULL,0);
…//DbgPrint buff
ZwClose(q);
}
The file filter work fine ,but when I open certain files the ring3(GUI)
process from which I request the open for that files hangs.In my debugger I
see that this happened when I receive IRP_MJ_CLEANUP.
Now the other GUI applications open files fine until they try to open that
files again.
My question is what happened?
Could be the ZwCreate/ZwRead flags?
Thanks
You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)