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

Home NTDEV

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/


Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

What is the HLK test for a simple hello world WDM driver, and how to pass the test?

henrik_meidahenrik_meida Member Posts: 102
edited November 19 in NTDEV

So I'm starting to look into this whole HLK test thing that Microsoft is forcing everyone to pass to support older systems.

But the explanation of MSDN is really vague and confusing, I just want to have a simple answer to these questions:

  1. Lets say i just have a very simple WDM driver that is a file system minifilter (has pre/post callbacks) + have some process creation callbacks, its nothing fancy or hardware related, and i just load it and don't install it, So what is the HLK test for such a driver? Meaning what does this test check, and how can i make sure my simple driver passes this test? What should i look into in my source code? Is there any checklist?

  2. How can i run the test locally on my machine just to check if my driver passes this test or not? Is there any tool like verifier that i just select a select a driver and it does its testings?

I really apologize for asking such a basic question, but i tried to get these answer by reading these articles:

https://docs.microsoft.com/en-us/windows-hardware/test/hlk/user/hck-testing-concepts
https://docs.microsoft.com/en-us/windows-hardware/test/hlk/

But they just seem way too complicated, I guess that's because these cover many types of drivers, mostly hardware based, and mine are very simple WDM drivers..

Comments

  • Mark_RoddyMark_Roddy Member - All Emails Posts: 4,470
    via Email
    Microsoft publishes an HLK vm that is trivial to deploy and use and will
    save you a whole lot of headaches trying to setup the HLK tests manually.
    You can just run thriiugh the process of creating a test submission using
    that VM and your hello world driver. Much easier, in my opinion,
    particularly if you are trying to work out the process.
    Mark Roddy
  • henrik_meidahenrik_meida Member Posts: 102
    edited November 20

    @Mark_Roddy said:
    Microsoft publishes an HLK vm that is trivial to deploy and use and will
    save you a whole lot of headaches trying to setup the HLK tests manually.
    You can just run thriiugh the process of creating a test submission using
    that VM and your hello world driver. Much easier, in my opinion,
    particularly if you are trying to work out the process.
    Mark Roddy

    But there is no pre win10 version included in this article:

    https://docs.microsoft.com/en-us/windows-hardware/test/hlk/

    So I'm confused, which one should i download in order to test my driver for windows 7?

    Should i just straight up use the VHLK and use whatever HLK is installed there, in order for my driver to get loaded in every Windows version?

    Also a side question: How hard is it to pass the tests for a simple WDM driver that has some simple callbacks? Because i remember reading some OSR article that said its impossible to pass this for some kind of drivers?

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

    remember reading some OSR article that said its impossible to pass this for some kind of drivers?

    Most WDF and WDM drivers, that do ordinarily things and run on ordinary systems, can pass the HLKs without too much difficulty (even if after requiring some amount of inconvenience).

    Passing the HLK tests with your ordinary file system Minifilter is, in fact, a best practice. We’ve found running these tests super helpful. For Minifilters specifically, the issue involves Isolation minifilters, or any minifilter that changes the “shape” of the underlying data.

    For example: User writes 5 bytes, and your Minifilter creates a 4K file on the media, and reports that file as 4K long? That will not pass the HLKs.

    But ordinarily file system minifilters? You should typically be able to pass the tests.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • henrik_meidahenrik_meida Member Posts: 102

    @Peter_Viscarola_(OSR) said:

    remember reading some OSR article that said its impossible to pass this for some kind of drivers?

    Most WDF and WDM drivers, that do ordinarily things and run on ordinary systems, can pass the HLKs without too much difficulty (even if after requiring some amount of inconvenience).

    Passing the HLK tests with your ordinary file system Minifilter is, in fact, a best practice. We’ve found running these tests super helpful. For Minifilters specifically, the issue involves Isolation minifilters, or any minifilter that changes the “shape” of the underlying data.

    For example: User writes 5 bytes, and your Minifilter creates a 4K file on the media, and reports that file as 4K long? That will not pass the HLKs.

    But ordinarily file system minifilters? You should typically be able to pass the tests.

    Peter

    So which version of HLK/VHLK should i download in order to support Windows versions 7 and 2008 and above? Because there are 9 different available in MSDN!

    https://www.microsoft.com/en-us/evalcenter/evaluate-virtual-hardware-lab-kit

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

    I don’t know, if I would have already answered you.

    If it was me, I’d attestation sign the drivers and be done with it, as I have said many, many, times in this forum. They’re minifilters, so you can just right-click install them on Win7 with any issue.

    I don’t understand your goal in logo’ing on Win 7. It’s not like any OEM is going to care about this.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • henrik_meidahenrik_meida Member Posts: 102
    edited November 21

    @Peter_Viscarola_(OSR) said:
    I don’t know, if I would have already answered you.

    If it was me, I’d attestation sign the drivers and be done with it, as I have said many, many, times in this forum. They’re minifilters, so you can just right-click install them on Win7 with any issue.

    I don’t understand your goal in logo’ing on Win 7. It’s not like any OEM is going to care about this.

    Peter

    I thought attestation only works on pre 10 if i don't need to install the driver and can just load them!
    So what about these situation:

    1. A file system upper filter driver

    2. An NDIS driver

    3. WFP driver

    In order to properly install these, will Attestation work?

    I also heard that since attestation signing chains back to "Microsoft Root Certificate Authority 2010", instead of the well known “Microsoft Code Verification Root”, it could cause problems because older systems only check to see if the cross chain root is “Microsoft Code Verification Root” when loading drivers, right?

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

    What will work with attestation signing: https://www.osr.com/blog/2021/04/08/lost-cause-no-driver-updates-allowed-except-for-win-10/

    Problems because of certs? Never heard if such a thing. Again, see the above article.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

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 24 January 2022 Live, Online
Internals & Software Drivers 7 February 2022 Live, Online
Kernel Debugging 21 March 2022 Live, Online
Developing Minifilters 23 May 2022 Live, Online