Don't use the OldIrql value from fmutex after releasing it.
Modified: trunk/reactos/hal/halx86/generic/fmutex.c
Modified: trunk/reactos/ntoskrnl/ex/fmutex.c

Modified: trunk/reactos/hal/halx86/generic/fmutex.c
--- trunk/reactos/hal/halx86/generic/fmutex.c	2005-11-26 16:08:27 UTC (rev 19640)
+++ trunk/reactos/hal/halx86/generic/fmutex.c	2005-11-26 16:35:23 UTC (rev 19641)
@@ -56,8 +56,11 @@
 FASTCALL
 ExReleaseFastMutex(PFAST_MUTEX FastMutex)
 {
+    KIRQL OldIrql;
+
     /* Erase the owner */
     FastMutex->Owner = (PVOID)1;
+    OldIrql = FastMutex->OldIrql;
 
     /* Increase the count */
     if (InterlockedIncrement(&FastMutex->Count) <= 0)
@@ -67,7 +70,7 @@
     }
 
     /* Lower IRQL back */
-    KfLowerIrql(FastMutex->OldIrql);
+    KfLowerIrql(OldIrql);
 }
 
 BOOLEAN

Modified: trunk/reactos/ntoskrnl/ex/fmutex.c
--- trunk/reactos/ntoskrnl/ex/fmutex.c	2005-11-26 16:08:27 UTC (rev 19640)
+++ trunk/reactos/ntoskrnl/ex/fmutex.c	2005-11-26 16:35:23 UTC (rev 19641)
@@ -106,10 +106,12 @@
 FASTCALL
 ExReleaseFastMutex (PFAST_MUTEX FastMutex)
 {
+    KIRQL oldIrql;
     ASSERT_IRQL(APC_LEVEL);
 
     /* Erase the owner */
     FastMutex->Owner = NULL;
+    OldIrql = FastMutex->OldIrql;
 
     /* Increase the count */
     if (InterlockedIncrement(&FastMutex->Count) <= 0)
@@ -119,7 +121,7 @@
     }
 
     /* Lower IRQL back */
-    KfLowerIrql(FastMutex->OldIrql);
+    KfLowerIrql(OldIrql);
 }
 
 /*