Building a NT Native app (device driver or app) using gnu gcc can be done easily (although it took me months to figure it out). Here is the options you need to use: gcc myapp.c -o myapp.exe -lntdll -nostdlib -Wl,--subsystem,native,-e,_NtProcessStartup@4If you are using cygwin you must also use -mno-cygwinIn your C file you must define your entry function as such: void WINAPI NtProcessStartup(PSTARTUP_ARGUMENT Argument); Then you will need some header files such as ntddk.h or ntdll.h which you will have to look around for. cygwin/Mingw have partial files. (very limited) The Wine project may have some header files. (see winternl.h) You may just have to build your own custom header files for what you need. Mingw includes libntdll.a. Try these links for some examples and info:
Notes:
Author : Peter Quiring |