From what I understand of ERESOURCE is that it has the concept of “owning
thread”. That means that a resources is acquired (or owned) by a thread. If
a thread has acquired a ERESOURCE exclusively, and tries to acquire it again
(exclusive OR shared), it will still have exclusive access.
On the other hand, if *another* thread tries to acquire the resource, it
will be failed, or put to wait state (depending on Wait parameter).
In your code it looks like the same thread is trying to acquire the resource
again, and hence succeeds.
If you note, that is where ExReleaseResourceForThreadLite() comes from, and
not just ExReleaseResource().
Also, you must release them as many times as you acquired them.
Hope that helps.
Shweta.
Hello,
I have a simple question about “ExAcquireResourceExclusiveLite”.
I have the following code (that of course makes no sense and is for testing
only):
file://------------------------------
BOOLEAN b;
b = ExAcquireResourceExclusiveLite( &Resource, FALSE );
b = ExAcquireResourceExclusiveLite( &Resource, FALSE );
.
.
.
if (b) ExReleaseResourceLite(&Resource);
.
.
.
file://------------------------------
Two calls of “ExAcquireResourceExclusiveLite” and both return always
“TRUE”!!! Shouldn’t the second call return “FALSE” ???
Besides: When I try to use “ExTryToAcquireResourceExclusiveLite” the Linker
can’t find it!!!
Thanks in advance!
Frank Friemel
You are currently subscribed to ntfsd as: xxxxx@techie.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup