How does CreateProcess () know that a new process is going through a subsystem?

When we build a project, we can determine under which subsystem we want to run our program in windows. But how will this affect the exe output file. Or, in other words, when we call the CreateProcess () API, we simply pass the exe file to it. So, what is the header inside the exe file, it checks which subsystem will process this process? Or is he using some other method to achieve it?

+4
source share
2 answers

The primary header of the executable file contains this information. Since you are talking about .exe (or rather binary), the linker step is executed. Linker is part of the OS, and each OS has a code number through which it is recognized as its binary file.

As with windows and CreateProcess (), consider reading this

0
source

Source: https://habr.com/ru/post/1501983/


All Articles