There have been many questions about how to identify the process’ main thread. A common answer was that there is no “main” thread and all threads are equivalent.
This is an incorrect and highly theoretical answer. The debugger in the Threads window can somehow distinguish the main thread from the others. And I want to know, at DLLs loading time (before WinMain), how the debugger does it. Ultimately, I want to get the ID of this thread.