RtlIsCurrentThreadAttachExempt - NtDoc

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

// rev
/**
 * The RtlIsCurrentThreadAttachExempt routine determines whether the current thread is exempt from attach notifications.
 *
 * \return TRUE if the current thread is attach-exempt; otherwise, FALSE.
 * \remarks Attach-exempt threads do not receive DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications.
 */
NTSYSAPI
BOOLEAN
NTAPI
RtlIsCurrentThreadAttachExempt(
    VOID
    );

#endif

View code on GitHub

NtDoc

Determines whether the current thread is supposed to skip calling DllMain with DLL_THREAD_ATTACH reason on loaded modules.

Implementation details

The function checks for SkipThreadAttach and RanProcessInit flags in TEB.

Related Win32 API

This functionality is not exposed in Win32 API.

See also