Cannot open include file 'ntddk.h' -- in a new KMDF project

So, I figured out the problem on my machine. I don't think it's a Visual Studio problem per se.

On my broken machine, I noticed that I had two SDK directories:

C:\Program Files (x86)\Windows Kits
C:\Program Files\Windows Kits

But on my working VM, there was only one:
C:\Program Files (x86)\Windows Kits

On the broken machine: I recalled that I had installed x64 debugging tools, WPT, etc. without using the SDK installer. So, I just kept uninstalling stuff until the C:\Program Files\Windows Kits directory disappeared.

At that point, I installed as follows:

  1. VS 2022 17.13.7 with Windows Driver Kit enabled.
  2. SDK 22621
  3. WDK 22621

At the end of all that, my kernel compile is working again and the C:\Program Files\Windows Kits directory did not reappear.

:man_shrugging: That sucked. :wink:

1 Like