From e7986f168f994b7f980f358c7aa9e819b7a05452 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Mon, 28 Mar 2005 17:25:19 +0000 Subject: [PATCH] fix warning on optimized builds svn path=/trunk/; revision=14367 --- reactos/ntoskrnl/ex/mutant.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/reactos/ntoskrnl/ex/mutant.c b/reactos/ntoskrnl/ex/mutant.c index 116fcab87c6..d0dc507e53a 100644 --- a/reactos/ntoskrnl/ex/mutant.c +++ b/reactos/ntoskrnl/ex/mutant.c @@ -294,16 +294,19 @@ NtReleaseMutant(IN HANDLE MutantHandle, IN PLONG PreviousCount OPTIONAL) { PKMUTANT Mutant; - KPROCESSOR_MODE PreviousMode = ExGetPreviousMode(); + KPROCESSOR_MODE PreviousMode; NTSTATUS Status = STATUS_SUCCESS; PAGED_CODE(); + + PreviousMode = ExGetPreviousMode(); + DPRINT("NtReleaseMutant(MutantHandle 0%x PreviousCount 0%x)\n", MutantHandle, PreviousCount); /* Check Output Safety */ - if(PreviousMode == UserMode && PreviousCount) { + if(PreviousMode != KernelMode && PreviousCount) { _SEH_TRY { @@ -330,7 +333,7 @@ NtReleaseMutant(IN HANDLE MutantHandle, /* Check for Success and release if such */ if(NT_SUCCESS(Status)) { - LONG Prev; + LONG Prev = 0; /* release the mutant. doing so might raise an exception which we're required to catch! */