Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV
Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Finding the installed KMDF/WDF version

AlbertAlbert Member - All Emails Posts: 449

Is there a way to programmatically find the supported version of KMDF for an OS? Before dropping in a driver via the installer, i want to ensure that the installed framework is compatible.
This needs to work all the way back till vista, win7 and server 2008.

Comments

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,090

    It doesn’t work that way.

    You need to write your driver to use the newest version of the Framework that’s supported by the oldest OS you need to support.. OR... write your driver to dynamically look for newer functions and use down-level equivalents if they’re not available.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • AlbertAlbert Member - All Emails Posts: 449
    I am not sure I follow.

    Win7 shipped with 1.9 was upgradable to 1.11.

    If I build my driver with kmdf major =1 and kmdf minor = 11 then it won't load on an umpatched win7.

    How do I determine that before hand?
  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,090

    You ship your driver with the KMDF co-installer, which will install the necessary version of KMDF a,one with your driver.

    That’s what the co-installer section is for.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • AlbertAlbert Member - All Emails Posts: 449
    1. if the coinstaller isn't shipped with, will it will pick up the already installed one? Or is it mandatory to ship the coinstaller?
    2. If I build the driver with the lowest possible coinstaller, say 1.9, then it should be automatically compatible with win10 as well, which ships 1.15?
  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,090
    1. Yes... if you do not ship a co-installer your driver will use whatever version of the Framework that’s installed on the machine

    2. Yes. And, as I said before, you can do run-time checks (if you want) to detect the presence of up-level functionality, so you can use it when it’s available.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • AlbertAlbert Member - All Emails Posts: 449

    Thanks!

    What would be the gotcha's of using this:

    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Wdf01000\Parameters]
    "MajorVersion"=dword:00000001
    "MinorVersion"=dword:0000001f
    "BuildNumber"=dword:00000000

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,627

    Don't do that. Is it really that hard to follow the rules? Remember, 1.31 is only available in Windows 10 build 2004. Your driver wouldn't work any previous release.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • Ehsan_TaheriEhsan_Taheri Member Posts: 188

    @Peter_Viscarola_(OSR) said:
    You ship your driver with the KMDF co-installer, which will install the necessary version of KMDF a,one with your driver.

    That’s what the co-installer section is for.

    Peter

    Well if the OP got his answer may I ask if one can install the latest version of KMDF(like 1.31) on the lower OS(like win 7)?
    or there are limitations to this

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 8,090

    There are limitations. See the whole list here.

    KMDF 1.11 is somewhat famous, as it’s the latest version that works back to Win 7... which many of us still have to support. Grudgingly.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • AlbertAlbert Member - All Emails Posts: 449

    @Tim_Roberts said:
    Don't do that. Is it really that hard to follow the rules? Remember, 1.31 is only available in Windows 10 build 2004. Your driver wouldn't work any previous release.

    I didn't mean it like that Tim. My plan was (since I need to support win 7) to build my driver with 1.11, yes there are some win 7's which didn't upgrade to 1.11, hence the registry check to see the compatibility. Since 1.11 is old, that same binary should work all the way to win10 as well.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,627

    Well if the OP got his answer may I ask if one can install the latest version of KMDF(like 1.31) on the lower OS(like win 7)?

    This used to be possible. In fact, at the beginning, it was the standard recommended procedure to include the coinstaller in your driver package.

    That ended with 1.11. Starting with 1.13, that is no longer possible nor necessary. Each version only runs on those systems where it is pre-installed.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Internals & Software Drivers 25 Jan 2021 LIVE ONLINE
Developing Minifilters 8 March 2021 LIVE ONLINE