- Don't change the lock's OldIrql value until we actually have the lock because we need this value to unlock correctly

- This should fix bug 4704

svn path=/trunk/; revision=42054
This commit is contained in:
Cameron Gutman 2009-07-18 17:57:38 +00:00
parent ab1fc18975
commit 91f79593a7

View file

@ -34,7 +34,6 @@ SIZE_T RecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex, BOOLEAN ToWrite ) {
if( CurrentIrql <= APC_LEVEL ) {
ExAcquireFastMutex( &RecMutex->Mutex );
RecMutex->OldIrql = CurrentIrql;
while( RecMutex->Locked ) {
ExReleaseFastMutex( &RecMutex->Mutex );
Status = KeWaitForSingleObject( &RecMutex->StateLockedEvent,
@ -44,6 +43,7 @@ SIZE_T RecursiveMutexEnter( PRECURSIVE_MUTEX RecMutex, BOOLEAN ToWrite ) {
NULL );
ExAcquireFastMutex( &RecMutex->Mutex );
}
RecMutex->OldIrql = CurrentIrql;
RecMutex->Locked = TRUE;
RecMutex->Writer = ToWrite;
RecMutex->CurrentThread = CurrentThread;