Use the /DRIVER linker option to build a Windows NT kernel mode driver.
/DRIVER:UPONLY causes the linker to add the IMAGE_FILE_UP_SYSTEM_ONLY bit to the characteristics in the output header to specify that it is a uniprocessor (UP) driver. The operating system will refuse to load a UP driver on a multiprocessor (MP) system.
/DRIVER:WDM causes the linker to set the IMAGE_DLLCHARACTERISTICS_WDM_DRIVER bit in the optional header's DllCharacteristics field.
You can dig more from here https://video2.skills-academy.com/en-us/cpp/build/reference/driver-windows-nt-kernel-mode-driver?view=msvc-160
Hope this resolves your Query!!
----
--If the reply is helpful, please Upvote and Accept it as an answer--