mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 19:41:40 +00:00
[CSRSRV] CsrUnhandledExceptionFilter: Check RtlAdjustPrivilege() result (#2864)
And remove unused NtRaiseHardError() Status assignment.
Detected by Cppcheck: redundantAssignment.
Related to commit d221bdfb
(r55647).
This commit is contained in:
parent
7094297b7a
commit
b5af1eb44a
1 changed files with 12 additions and 6 deletions
|
@ -659,6 +659,11 @@ CsrUnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
|
||||||
FALSE,
|
FALSE,
|
||||||
&OldValue);
|
&OldValue);
|
||||||
}
|
}
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DPRINT1("CsrUnhandledExceptionFilter(): RtlAdjustPrivilege(SE_SHUTDOWN_PRIVILEGE) failed, Status = 0x%08lx\n", Status);
|
||||||
|
goto NoPrivilege;
|
||||||
|
}
|
||||||
|
|
||||||
/* Initialize our Name String */
|
/* Initialize our Name String */
|
||||||
RtlInitUnicodeString(&ErrorSource, L"Windows SubSystem");
|
RtlInitUnicodeString(&ErrorSource, L"Windows SubSystem");
|
||||||
|
@ -670,14 +675,15 @@ CsrUnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
|
||||||
ErrorParameters[3] = (ULONG_PTR)ExceptionInfo->ContextRecord;
|
ErrorParameters[3] = (ULONG_PTR)ExceptionInfo->ContextRecord;
|
||||||
|
|
||||||
/* Bugcheck */
|
/* Bugcheck */
|
||||||
Status = NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED,
|
NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED,
|
||||||
4,
|
4,
|
||||||
1,
|
1,
|
||||||
ErrorParameters,
|
ErrorParameters,
|
||||||
OptionShutdownSystem,
|
OptionShutdownSystem,
|
||||||
&Response);
|
&Response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NoPrivilege:
|
||||||
/* Just terminate us */
|
/* Just terminate us */
|
||||||
NtTerminateProcess(NtCurrentProcess(),
|
NtTerminateProcess(NtCurrentProcess(),
|
||||||
ExceptionInfo->ExceptionRecord->ExceptionCode);
|
ExceptionInfo->ExceptionRecord->ExceptionCode);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue