A few years ago, I built a Windows Native Application using the Build.exe command of the DDK. The following site gives a better idea for W7 of what I had done: https://prog.world/windows-native-applications-and-acronis-active-restore/ This site also specifies this : "The easiest way to build a native application is to use DDK (Driver Development Kit). We need exactly the ancient seventh version, since later versions have a slightly different approach and work closely with Visual Studio. If we use DDK, then our project needs only Makefile and sources." The following site gives some ideas for building with Visual Studio. https://social.msdn.microsoft.com/Forums/en-US/346c2484-862d-47b4-809b-601546ac7e72/visual-studio-2008-and-compiling-native-code-question?forum=vside2008 I want to build a new application with windows-11-22H2. So I downloaded VS2022, the DDK, and a VSIX addon for the ddk. I use this model :
1>------ Début de la génération : Projet : native_64_1, Configuration : Debug x64 ------
1>Building 'native_64_1' with toolset 'WindowsApplicationForDrivers10.0' and the 'Universal' target platform.
1>Source.cpp
After a lot of errors in the configuration of the project settings, the compilation finishes without errors now. But the linker reports the following errors (i use a translator for the bellow lines):
1>Ongoing library research
1> Current research C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x64\ntdll.lib :
1> Current research C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64\nt.lib :
1> Current research C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x64\onecoreuap.lib :
1> Current research C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\ucrt\x64\ucrtd.lib :
1>End of library search
1>End of the pass 1
1>Source.obj : error LNK2019: external symbol not resolved "__declspec(dllimport) long __cdecl NtTerminateProcess(void *,long)" (__imp_?NtTerminateProcess@@YAJPEAXJ@Z) référencé dans la fonction "void __cdecl NtProcessStartup(void)" (?NtProcessStartup@@YAXXZ)
1>Source.obj : error LNK2019: external symbol not resolved "__declspec(dllimport) long __cdecl NtDisplayString(struct _UNICODE_STRING *)" (__imp_?NtDisplayString@@YAJPEAU_UNICODE_STRING@@@Z) référencé dans la fonction "void __cdecl WriteLn(unsigned short *)" (?WriteLn@@YAXPEAG@Z)
1>Source.obj : error LNK2019: external symbol not resolved "__declspec(dllimport) long __cdecl NtWaitForSingleObject(void *,unsigned char,union _LARGE_INTEGER *)" (__imp_?NtWaitForSingleObject@@YAJPEAXEPEAT_LARGE_INTEGER@@@Z) référencé dans la fonction "void __cdecl NtProcessStartup(void)" (?NtProcessStartup@@YAXXZ)
1>Source.obj : error LNK2019: external symbol not resolved "__declspec(dllimport) long __cdecl NtCreateEvent(void * *,unsigned long,struct _OBJECT_ATTRIBUTES *,enum _EVENT_TYPE,unsigned char)" (__imp_?NtCreateEvent@@YAJPEAPEAXKPEAU_OBJECT_ATTRIBUTES@@W4_EVENT_TYPE@@E@Z) référencé dans la fonction "void __cdecl NtProcessStartup(void)" (?NtProcessStartup@@YAXXZ)
1>nt.lib(startup.obj) : error LNK2019: external symbol not resolved main referenced in the function NtProcessStartup_AfterSecurityCookieInitialized
1>nt.lib(startup.obj) : error LNK2019: external symbol not resolved __security_init_cookie referenced in the function NtProcessStartup
1>Unused libraries :
1> C:\Program Files (x86)\Windows Kits\10\lib\10.0.22621.0\um\x64\onecoreuap.lib
1>C:\MesData\informatique\2022\native_64\native_64_1\x64\Debug\native_64_1.exe : fatal error LNK1120: 6 unresolved external"
I can't explain why these libraries are in the scope : ucrtd.lib, onecoreuap.lib. I add nt.lib because i think it contains the "like CRT" for a Windows Native Application.
My question : Is it possible to get better information to build such an application with VS?