Training
Module
Learn how the semantic kernel SDK connects native code to large language models to create smart applications.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
If you are writing drivers for different versions of Windows, the following section provides some guidelines about how you should build those drivers using the Windows Driver Kit (WDK), Visual Studio, and MSBuild.
If you are targeting Windows 7, Windows 8, or Windows 8.1, set TargetVersion using the Configuration Manager or manually in the .vcxproj file, for example <TargetVersion>Windows7</TargetVersion>
.
If you are targeting Windows 10 or Windows 11, set both TargetVersion and _NT_TARGET_VERSION, for example <TargetVersion>Windows10</TargetVersion> <_NT_TARGET_VERSION>0xA000006</_NT_TARGET_VERSION>
.
_NT_TARGET_VERSION values are listed in the Sdkddkver.h header file in the form NTDDI_WIN10_*
, for example #define NTDDI_WIN10_RS5 0x0A000006
.
If you want your kernel-mode driver to run on multiple versions of Windows and dynamically determine the features that are available to the driver, build the driver using the build configuration for the most recent version of the operating system. For example, if you want your driver to support all versions of Windows starting with Windows 8.1, but to use certain features that were first available in Windows 10 when your driver is running on Windows 10 or later versions of the operating system, specify Windows 10 (Win10) as the target configuration.
Use the RtlIsNtDdiVersionAvailable and RtlIsServicePackVersionInstalled functions to determine the version of Windows that is available to your driver at run time. For more information, see Writing drivers for different versions of Windows.
Create prototypes for pointers to functions that your driver must call conditionally.
If you have a WDM driver, or a non-KMDF kernel-mode driver, and you are targeting Windows 8.1 or Windows 8 but also want to run on earlier versions of Windows, you need to override the linker $(KernelBufferOverflowLib) option. When you select Windows 8 or Windows 8.1 configurations, the driver is linked with BufferOverflowFastFailK.lib, which is not available in earlier Windows versions. For Windows 7 and Vista, you must link with BufferOverflowK.lib instead.
There are two ways to override the $(KernelBufferOverflowLib) linker option, using either MSBuild or Visual Studio.
Using MSBuild:
msbuild /p:KernelBufferOverflowLib="C:\Program Files (x86)\Windows Kits\8.1\Lib\win8\km\x64\BufferOverflowK.lib" /p:platform=x64 /p:Configuration="Win8 Release" myDriver.sln
Using Visual Studio:
Using Notepad, or another text editor, open the driver project file (*.vcxproj). In the project file, locate the <PropertyGroup> for the configurations your driver supports, and add the following line to override the default linker option:
XML |
---|
|
For example, if your driver supports Windows 8.1 and Windows 8 debug and release builds, those configuration sections would look like the following:
XML |
---|
|
The <KernelBufferOverflowLib> elements must appear in the driver project file before the element that imports Microsoft.Cpp.props, which imports the tool set.
After you modify and save the driver project file, you can open the project file in Visual Studio and build the driver.
Training
Module
Learn how the semantic kernel SDK connects native code to large language models to create smart applications.
Documentation
Building a Driver with the WDK - Windows drivers
This topic describes how to build a driver with the Windows Driver Kit (WDK).
WDK Known Issues - Windows drivers
List of known issues for released versions of the Windows Driver Kit (WDK)
Driver Model Settings Properties for Driver Projects - Windows drivers
Sets the basic properties for a kernel-mode or user-mode driver, including the WDF library version and preprocessor definitions.