mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
simplify returning the previous count in NtReleaseMutant
svn path=/trunk/; revision=18818
This commit is contained in:
parent
4a3213bf1a
commit
14db8e6026
1 changed files with 6 additions and 20 deletions
|
@ -322,13 +322,16 @@ NtReleaseMutant(IN HANDLE MutantHandle,
|
|||
/* 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) {
|
||||
|
||||
|
@ -337,23 +340,6 @@ NtReleaseMutant(IN HANDLE MutantHandle,
|
|||
} _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 */
|
||||
|
|
Loading…
Reference in a new issue