Don't use the OldIrql value from fmutex after releasing it.

svn path=/trunk/; revision=19641
This commit is contained in:
Hartmut Birr 2005-11-26 16:35:23 +00:00
parent 6a8246e478
commit 405f0b60f1
2 changed files with 7 additions and 2 deletions

View file

@ -56,8 +56,11 @@ VOID
FASTCALL FASTCALL
ExReleaseFastMutex(PFAST_MUTEX FastMutex) ExReleaseFastMutex(PFAST_MUTEX FastMutex)
{ {
KIRQL OldIrql;
/* Erase the owner */ /* Erase the owner */
FastMutex->Owner = (PVOID)1; FastMutex->Owner = (PVOID)1;
OldIrql = FastMutex->OldIrql;
/* Increase the count */ /* Increase the count */
if (InterlockedIncrement(&FastMutex->Count) <= 0) if (InterlockedIncrement(&FastMutex->Count) <= 0)
@ -67,7 +70,7 @@ ExReleaseFastMutex(PFAST_MUTEX FastMutex)
} }
/* Lower IRQL back */ /* Lower IRQL back */
KfLowerIrql(FastMutex->OldIrql); KfLowerIrql(OldIrql);
} }
BOOLEAN BOOLEAN

View file

@ -106,10 +106,12 @@ VOID
FASTCALL FASTCALL
ExReleaseFastMutex (PFAST_MUTEX FastMutex) ExReleaseFastMutex (PFAST_MUTEX FastMutex)
{ {
KIRQL oldIrql;
ASSERT_IRQL(APC_LEVEL); ASSERT_IRQL(APC_LEVEL);
/* Erase the owner */ /* Erase the owner */
FastMutex->Owner = NULL; FastMutex->Owner = NULL;
OldIrql = FastMutex->OldIrql;
/* Increase the count */ /* Increase the count */
if (InterlockedIncrement(&FastMutex->Count) <= 0) if (InterlockedIncrement(&FastMutex->Count) <= 0)
@ -119,7 +121,7 @@ ExReleaseFastMutex (PFAST_MUTEX FastMutex)
} }
/* Lower IRQL back */ /* Lower IRQL back */
KfLowerIrql(FastMutex->OldIrql); KfLowerIrql(OldIrql);
} }
/* /*