#ifndef _NTRTL_H
/**
 * The RtlExitUserProcess routine ends the calling process and all its threads.
 *
 * \param ExitStatus The exit status for the process and all threads.
 * \sa https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-exitprocess
 * \remarks This function does not return to the caller. It terminates the process and all threads immediately.
 */
_Analysis_noreturn_
DECLSPEC_NORETURN
NTSYSAPI
VOID
NTAPI
RtlExitUserProcess(
    _In_ NTSTATUS ExitStatus
    );
View code on GitHubGracefully terminates the current process.
ExitStatus - the value to set as the exit status for the process.This function detaches from DLLs, shuts down various ntdll facilities, and uses NtTerminateProcess to perform two-phase termination.