none
What does "Target OS Version" in the setting of Kernel Mode Driver mean? RRS feed

  • Question

  • I have a Kernel Mode Driver project, and I want to build the driver for each OS, such as WIN XP, WIN7, WIN8, WIN8.1 and WIN10 for both x86 and x64.

    I use WDK10 and Visual Studio 2015.

    I know I must build driver for x86 and x64 separately, and I should use WDK 7.1 to build the driver for XP.

    Does it mean the driver I built only working at WIN7 if I set [Properties->Driver Setting->General->Target OS Version] to Windows 7 for x64 configuration?

    Therefore, if I want to build x64 driver for WIN8, WIN8.1 and WIN10, I should set [Properties->Driver Setting->General->Target OS Version] to WIN8, WIN8.1 and WIN10 separately and build other 3 versions of driver?

    Friday, December 25, 2015 2:51 AM

Answers

  • If your driver is well designed it need only be built for the earliest OS that you are targeting, and the binary will work on the later OS'es.  What is the challenge these days is that you will need to sign the driver package for the correct OS.  So that means multiple packages, but they can all contain the same binary for the driver.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Friday, December 25, 2015 1:16 PM
  • Actually, you can build a Win7 32-bit, a Win7 64-bit (which with SHA2 signing will work on Win7, Win8 and Win8.1) and a driver signed for Windows 10.  The driver for Windows 10, can be the Windows 7 binary, or you can build the driver for Windows 10.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, December 28, 2015 2:06 AM
  • There is no list of the changed functions, Microsoft has been very dynamic on this.   There is typically no performance impact or security concerns if you use the earlier API's.   While you can get function addresses for kernel API's, I typically don't recommend using that approach, for two reasons.  At least once in the past, the MmGetSystemRoutineAddress function did not work right, and also it creates situations where you have additional code paths to check.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, October 4, 2017 11:17 AM

All replies

  • If your driver is well designed it need only be built for the earliest OS that you are targeting, and the binary will work on the later OS'es.  What is the challenge these days is that you will need to sign the driver package for the correct OS.  So that means multiple packages, but they can all contain the same binary for the driver.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Friday, December 25, 2015 1:16 PM
  • So, I can build the x86 driver set [Properties->Driver Setting->General->Target OS Version] to WIN7, and the driver can work on the later OS'es.

    If I want to build the x64 driver, I should set [Properties->Driver Setting->General->Target OS Version] to WIN7, WIN8, WIN8.1 and WIN10, build those 4 versions of driver, and sign each driver package separately. Therefore I can't use the x64 signed driver set [Properties->Driver Setting->General->Target OS Version] to WIN7 to WIN8 or later OS'es.

    Does it right to understand the answer?

    It seems I should package all signed driver packages to one installer, and install the driver corresponding to the OS user used.


    If I use the command
    inf2cat.exe /driver:D:\driver\x64\Release\ /os:XP_X64,Server2003_X64,Vista_X64,Server2008_X64,7_X64,Server2008R2_X64,8_X64,6_3_X64,10_X64
    to generate the .cat file for all x64 OS'es and sign this .cat and .sys set [Properties->Driver Setting->General->Target OS Version] to WIN7. Does it work at WIN8 or later OS'es?
    • Edited by kuotech Monday, December 28, 2015 1:50 AM
    Monday, December 28, 2015 1:37 AM
  • Actually, you can build a Win7 32-bit, a Win7 64-bit (which with SHA2 signing will work on Win7, Win8 and Win8.1) and a driver signed for Windows 10.  The driver for Windows 10, can be the Windows 7 binary, or you can build the driver for Windows 10.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Monday, December 28, 2015 2:06 AM
  • Hi Don,

    I have query similar to this, I have driver that already built  with TARGET OS Windows 10, and now we want to build OS Windows 7, what are things needs to be checked as performance impact or any other side effects. May be performance, security effects may addressed in Windows 10 build.

    Thanks,

    Sachin

    Wednesday, October 4, 2017 9:13 AM
  • One solution create dynamic function pointers for OS specific platforms but, helpful if you provide direction regarding listing changed functions/breaking.  
    Wednesday, October 4, 2017 9:59 AM
  • There is no list of the changed functions, Microsoft has been very dynamic on this.   There is typically no performance impact or security concerns if you use the earlier API's.   While you can get function addresses for kernel API's, I typically don't recommend using that approach, for two reasons.  At least once in the past, the MmGetSystemRoutineAddress function did not work right, and also it creates situations where you have additional code paths to check.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Wednesday, October 4, 2017 11:17 AM
  • Thanks Don for your suggestion
    • Edited by Shinde_Sachin Thursday, October 26, 2017 5:38 AM typo mistake
    Thursday, October 26, 2017 5:37 AM
  • Are these guidelines provided are also applicable for KMDF driver built using WDK10.

    https://docs.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/platforms-and-driver-versions


    Thursday, October 26, 2017 7:05 AM
  • Yes the document https://docs.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/platforms-and-driver-versions is still accurate.  Most of what it discusses has been covered in the questions here.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    • Proposed as answer by Shinde_Sachin Friday, October 27, 2017 9:30 AM
    Thursday, October 26, 2017 11:26 AM
  • Thanks Don for your reply.
    Friday, October 27, 2017 9:33 AM