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

Home NTFSD

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/


WDM Minifilter fails to start service after upgrading to VS 2022 and WDK 11

blangeblange Member Posts: 30

I am currently trying to upgrade to Visual Studio 2022 and the WDK 11. While my current WDM minifilter can still be build and packaged - at least I do not see any errors and warnings - the service can no longer be started.

rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 128 <driver.inf> concludes without error

while

sc start fails with procedure not found (I think it is error 127)

sc query reveals a Windows32 error code of 31 (translates to fails to load driver, if I understand correctly)

When I am using Visual Studio 2019 and WDK 10 the service starts.

Does anybody experience a similar issue or nows how to migrate to the new WDK?
Can someone point me to a direction how to debug such a scenario? (DebugView does not even show the Driver Entry log of my Minifilter)
The updated WDK 11 Windows driver examples are not compiling out of the box with VS 2022 and WDK 11.
So I think Microsoft is still in the state of figuring out how to use their own software ;)

Any hints would be highly appreciated.

Comments

  • Jeremy_HurrenJeremy_Hurren Member - All Emails Posts: 33

    Sounds like the upgrade of VS/WDK/SDK has your binary set up to import a function that doesn't exist on the version of Windows you are loading on. You can manually examine those imports with something like "dumpbin.exe /imports ". You can also enable showing loader snaps in the debugger and load your driver, which might help debug, but it's a LOT of info to dig through.

  • Jeremy_HurrenJeremy_Hurren Member - All Emails Posts: 33

    Fixing it may be as simple as setting the targeted version for your driver project to the minimum version of Windows on which you want it to load.

  • blangeblange Member Posts: 30

    Thank you very much for the hints. I will look into this.
    Indeed, I had to set the Target OS version in Driver Settings to "Windows 10 and above" after upgrading. It was empty before.
    Maybe my driver is using an old Windows 7 function call.

    Will keep you posted.

  • yu_shangyu_shang Member Posts: 40
    edited July 17

    I have similar problem in setting NTDDI_VERSION , which is derived from MSBuild property TargetPlatformVersion , so I tried to add following line in the .vcxproj

    <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    ...
    <TargetPlatformVersion>$(TargetPlatformVersion_FE)</TargetPlatformVersion>
    ...
    </PropertyGroup>
    

    But this does not work for me , so , I add this line instead

    <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    ...
    <NTDDI_VERSION>NTDDI_WIN10_CO</NTDDI_VERSION>
    ...
    </PropertyGroup>
    

    It is not neat (in my understanding NTDDI_VERSION is not intended for end user) , but it works.

  • blangeblange Member Posts: 30

    Thanks, i will try this as well.

  • blangeblange Member Posts: 30

    I was able to start the service again. I indeed had to set the NTDDI_VERSION in Visual Studio to Windows10_19041. The constant NTDDI_WIN10_CO does not exist on my system. The procedure in question seems to be ExAllocatePool2.

  • yu_shangyu_shang Member Posts: 40

    19041 is associated with NTDDI_WIN10_VB.

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!
Kernel Debugging 30 January 2023 Live, Online
Developing Minifilters 20 March 2023 Live, Online
Writing WDF Drivers TBD 2023 Live, Online
Internals & Software Drivers 17 April 2023 Live, Online