DllMain in an exe?

后端 未结 3 584
庸人自扰
庸人自扰 2021-01-21 08:22

Is it possible to receive DllMain like notifications about thread attach/detach in stand-alone exe without using any extra dlls?

Edit: This is just a th

3条回答
  •  春和景丽
    2021-01-21 08:31

    There is no external code that runs on the thread and loads the executable, hence no thread attach/detach notifications [1]. The code in the executable usualy control the threading [2].

    If you describe your scenario, people might be able to give you some ideas how to achieve it.


    [1] Well, most of the time. It is possible to load an executable in another process, but people don't do it usually.
    [2] There are certain exceptions where the threading model and the threads are created by the OS, instead of the executable code. These are mostly related to COM/RPC.

提交回复
热议问题