microsoft / Windows-driver-samples

This repo contains driver samples prepared for use with Microsoft Visual Studio and the Windows Driver Kit (WDK). It contains both Universal Windows Driver and desktop-only driver samples.
Microsoft Public License
7k stars 4.94k forks source link

Cannot open wdf.h source file #1210

Open jahnavidubisetty opened 2 months ago

jahnavidubisetty commented 2 months ago

Encountering an error saying that "cannot open wdf.h source file".

v-junyli commented 1 month ago

Hi,

Can you include more info on how to repro the issue? Like what version of Visual Studio and WDK.

saraphinesER commented 1 day ago

Encountering an error saying that "cannot open wdf.h source file".

Not sure if this helps since you didn't mention much detail, so this is just for your information.

When I tried to build Toaster project, I also suffer this error "can't open wdf.h", then I modify the "Windows Driver Kit" checkbox in Visual studio community installer as below. Image

I expect this should help, WDK path should be added into system, somehow it's still failed after update, also I can't not find wdf.h by manually search "C:\Program Files (x86)\Windows Kits\". So I download Windows Driver Kit (WDK) from Microsoft, do installation and add the path of wdf.h into "Include Directories" of Toaster project. Then the error is fixed.