RtlExitUserThread - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H
#if (PHNT_VERSION >= PHNT_WINXP)

DECLSPEC_NORETURN
NTSYSAPI
VOID
NTAPI
RtlExitUserThread(
    _In_ NTSTATUS ExitStatus
    );

#endif
#endif

View code on GitHub

Gracefully terminates the current thread.

Parameters

Implementation details

The function calls NtQueryInformationThread with the the THREADINFOCLASS value of ThreadAmILastThread (12) and either detaches DLLs and exists the current thread or calls RtlExitUserProcess.

Related Win32 API

See also