-1

I keep getting this error because of my wdk and sdk versions: "cannot open source file - ntifs.h"

I get these errors when I try to build my project:

cannot open source file: ntifs.h cannot open source file: ntstrsafe.h

I am using Visual Studio 2022 (with SDK and WDW, 21H2).

I watched some tutorials downgraded to vs 2019 and version 2004, but it gave me the error that I needed this version, so I had to upgrade back to 2022, and now I am so lost. I am on Windows 10, and it says that the 21h2 version is for Windows 11. Can somebody please explain to me what SDK and WDW I should download for my vs 2022 with Windows 10?

  • 1
    There is a list of previous WDK versions, with version details, [here](https://learn.microsoft.com/en-us/windows-hardware/drivers/other-wdk-downloads). – molbdnilo May 22 '23 at 15:15
  • @molbdnilo Thanks for responding! I downgraded do VS 2019 once again and downloaded the 2004 version once again how it says but now it gives me this error: A WDK correspounding to target version 10.0.19041.0 was not found. Please install this WDK version before building. When i search for this version i can't find it tho. – dalak mrusen May 22 '23 at 15:52

1 Answers1

0

The problem was that I had to downgrade to VS2019 with WDK and SDK v2004, but I got this error:

A WDK corresponding to target ’10.0.19041.0’ was not found.

I found the solution for the above error here: Hardware development kits for Windows 10, Version 2004

In the properties page for the driver project (Configuration Properties > General), set Windows SDK Version to $(LatestTargetPlatformVersion).

If this option is not available to select, then select the option ‘inherit from parent or project default’

Bruno Rohée
  • 3,436
  • 27
  • 32