simplify returning the previous count in NtReleaseMutant Modified: trunk/reactos/ntoskrnl/ex/mutant.c _____
Modified: trunk/reactos/ntoskrnl/ex/mutant.c --- trunk/reactos/ntoskrnl/ex/mutant.c 2005-10-27 23:48:22 UTC (rev 18817) +++ trunk/reactos/ntoskrnl/ex/mutant.c 2005-10-28 00:03:01 UTC (rev 18818) @@ -322,14 +322,17 @@
/* Check for Success and release if such */ if(NT_SUCCESS(Status)) {
- LONG Prev = 0; - /* release the mutant. doing so might raise an exception which we're required to catch! */ _SEH_TRY {
- Prev = KeReleaseMutant(Mutant, MUTANT_INCREMENT, FALSE, FALSE); + LONG Prev = KeReleaseMutant(Mutant, MUTANT_INCREMENT, FALSE, FALSE);
+ if(PreviousCount) { + + *PreviousCount = Prev; + } + } _SEH_EXCEPT(_SEH_ExSystemExceptionFilter) {
Status = _SEH_GetExceptionCode(); @@ -337,23 +340,6 @@ } _SEH_END;
ObDereferenceObject(Mutant); - - if(NT_SUCCESS(Status)) { - - /* Return it */ - if(PreviousCount) { - - _SEH_TRY { - - *PreviousCount = Prev; - - } _SEH_EXCEPT(_SEH_ExSystemExceptionFilter) { - - Status = _SEH_GetExceptionCode(); - - } _SEH_END; - } - } }
/* Return Status */