mirror of
https://github.com/reactos/reactos.git
synced 2026-06-03 01:41:13 +08: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:
@@ -659,6 +659,11 @@ CsrUnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
|
||||
FALSE,
|
||||
&OldValue);
|
||||
}
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("CsrUnhandledExceptionFilter(): RtlAdjustPrivilege(SE_SHUTDOWN_PRIVILEGE) failed, Status = 0x%08lx\n", Status);
|
||||
goto NoPrivilege;
|
||||
}
|
||||
|
||||
/* Initialize our Name String */
|
||||
RtlInitUnicodeString(&ErrorSource, L"Windows SubSystem");
|
||||
@@ -670,14 +675,15 @@ CsrUnhandledExceptionFilter(IN PEXCEPTION_POINTERS ExceptionInfo)
|
||||
ErrorParameters[3] = (ULONG_PTR)ExceptionInfo->ContextRecord;
|
||||
|
||||
/* Bugcheck */
|
||||
Status = NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED,
|
||||
4,
|
||||
1,
|
||||
ErrorParameters,
|
||||
OptionShutdownSystem,
|
||||
&Response);
|
||||
NtRaiseHardError(STATUS_SYSTEM_PROCESS_TERMINATED,
|
||||
4,
|
||||
1,
|
||||
ErrorParameters,
|
||||
OptionShutdownSystem,
|
||||
&Response);
|
||||
}
|
||||
|
||||
NoPrivilege:
|
||||
/* Just terminate us */
|
||||
NtTerminateProcess(NtCurrentProcess(),
|
||||
ExceptionInfo->ExceptionRecord->ExceptionCode);
|
||||
|
||||
Reference in New Issue
Block a user