2

I have found some questions in this direction, but nothing stating the answer to this question in an obvious way. I am new to developing drivers and am confused by Microsoft's versioning system for their SDKs, WDKs and OSes.

We have a C++ project that includes drivers and has to be built for both Windows Enterprise 2016 and 2019 (both LTSC). That means Windows 10 Build 1607 and 1809. So far so good.

My questions arousing from this are as follows:

  1. From what I've read now I need the exact matching SDKs for both versions and build the project twice, once targeting the 1607 SDK and once targeting the 1809 SDK. Is this correct?
  2. What WDK version should I use? Do I need to have several WDK versions installed side-by-side matching the exact same version numbers as the SDKs or can I just install the most recent WDK (which would enable me to use VS2019 instead of 2017, as the 1809 WDK only supports VS2017)
  3. How does compatability work with SDKs and WDKs and targeted Windows versions? I can't wrap my head around when problems are to be expected and what pairs of SDK + WDK work. I mean, when you install an application for Windows 10 you almost never have to look for what version it's built for - it just works, as long as you have Win10.

Right now, we are using VS2017 with the SDK and WDK for the exact same version (10.0.17763.0). Being limited to VS2017 just because we are using the WDK for the most recent LTSC version of Windows 10 feels weird though.

derdomml
  • 43
  • 7
  • *"I need the exact matching SDKs"* - No. Any SDK can be used to target any platform up to the SDK's version. If you use the latest version, you can use that SDK to target *any* supported OS. – IInspectable Jun 30 '21 at 10:21
  • Use latest tools (Visual Studio 2019) and SDK to *compile* https://stackoverflow.com/questions/39621646/what-does-the-target-platform-version-mean-for-a-vs-c-project but also use defines (like _WIN32_WINNT _WIN32_WINNT_VISTA) to control your maximum *execution* target (eg: Windows version) https://learn.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt – Simon Mourier Jun 30 '21 at 11:06
  • So to summarize: Just install the latest of everything (VS2019 with the newest SDK and newest WDK) and then use project settings and the mentioned defines to specify the versions we want to target? – derdomml Jun 30 '21 at 11:10
  • In a nutshell, yes. Though you can go a step further and compile a single executable that runs on all targets. Discovery of the availability of newer APIs would then need to be done at run time, either by using the linker's delay-load support, or run-time dynamic linking. – IInspectable Jun 30 '21 at 11:38
  • That clears it up for me, thanks. I'm quite new here, can I flag the comments as helpful and close this question? – derdomml Jul 01 '21 at 12:03

0 Answers0