THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTPSAPI_H
//
// User processes and threads
//
#if (PHNT_MODE != PHNT_MODE_KERNEL)
// begin_rev

#define THREAD_CREATE_FLAGS_SKIP_THREAD_ATTACH 0x00000002 // NtCreateThreadEx only

// end_rev
#endif
#endif

View code on GitHub

This flags indicates that the new thread should not call any DllMain callbacks with DLL_THREAD_ATTACH reason on loaded modules. Keep in mind that this flags might introduce compatibility issues because threads started with it have some of their state not initialized. See this blog post for more details.

Applicable to

Implementation details

Using this flag sets the SkipThreadAttach flag in the TEB of the new thread.

Related flags

See also