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

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 :wink:

Any hints would be highly appreciated.

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.

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.

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.

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.

Thanks, i will try this as well.

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.

19041 is associated with NTDDI_WIN10_VB.