Cannot open include file: 'wdf.h'

Hello all.

I’m having trouble building, what seems to be, the most bare bones driver possible. I’m new to driver development so I’m trying to keep it simple, but I get a build error when I try to include wdf.h. It seems weird to me because it doesn’t complain about the ntddk.h include even though they are in the same include folder. I would appreciate any help.

Thank you.

I get one error:
1>c:\testdrv\pathtest\test.c(1) : error C1083: Cannot open include file: ‘wdf.h’: No such file or directory

The full path of these two .h files is:
C:\WinDDK\7600.16385.1\inc\ddk\ntddk.h
C:\WinDDK\7600.16385.1\inc\wdf\kmdf\1.9\wdf.h

Here is my source (test.c):

#include <ntddk.h><br>#include <wdf.h><br><br>NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) <br>{<br> return STATUS_SUCCESS;<br>}<br>```<br><br>Here is my sources file:<br>```<br>TARGETNAME = test<br>TARGETPATH = obj<br>TARGETTYPE = DRIVER<br><br>INCLUDES = %BUILD%\inc<br><br>LIBS = %BUILD%\lib<br><br>SOURCES = test.c <br>```</wdf.h></ntddk.h>

Add

KMDF_VERSION=1

To your sources file.

d

sent from a phpne with no keynoard

-----Original Message-----
From: xxxxx@hotmail.com
Sent: May 17, 2010 7:10 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Cannot open include file: ‘wdf.h’

Hello all.

I’m having trouble building, what seems to be, the most bare bones driver possible. I’m new to driver development so I’m trying to keep it simple, but I get a build error when I try to include wdf.h. It seems weird to me because it doesn’t complain about the ntddk.h include even though they are in the same include folder. I would appreciate any help.

Thank you.

I get one error:
1>c:\testdrv\pathtest\test.c(1) : error C1083: Cannot open include file: ‘wdf.h’: No such file or directory

The full path of these two .h files is:
C:\WinDDK\7600.16385.1\inc\ddk\ntddk.h
C:\WinDDK\7600.16385.1\inc\wdf\kmdf\1.9\wdf.h

Here is my source (test.c):
<br>#include <ntddk.h><br>#include <wdf.h><br><br>NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)<br>{<br> return STATUS_SUCCESS;<br>}<br>

Here is my sources file:
<br>TARGETNAME = test<br>TARGETPATH = obj<br>TARGETTYPE = DRIVER<br><br>INCLUDES = %BUILD%\inc<br><br>LIBS = %BUILD%\lib<br><br>SOURCES = test.c<br>


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</wdf.h></ntddk.h>

That did the trick. Thank you so much.

I just realized that although adding the KMDF version to the sources file fixed my build errors, now when I try to start the service on my virtual PC using OSR Driver Loader I get an error that says “The system cannot find the file specified.”

Any thoughts as to why this might be happening? Is there something I should install on my virtual PC? My virtual PC is running Windows XP SP2. I am building using the Windows XP x86 Checked Build Environment.

In most cases a KMDF driver is a PnP driver, and cannot be loaded with
API’s the driver loader. In the case of the non-pnp there is still the
need to load the correct KMDF co-installer which AFAIK the OSR driver
loader does not support.

Use an INF file and devcon to load your driver.

Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

-----Original Message-----
From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com]
Posted At: Tuesday, May 18, 2010 10:08 AM
Posted To: ntdev
Conversation: Cannot open include file: ‘wdf.h’
Subject: RE: Cannot open include file: ‘wdf.h’

I just realized that although adding the KMDF version to the sources
file
fixed my build errors, now when I try to start the service on my
virtual PC
using OSR Driver Loader I get an error that says “The system cannot
find the
file specified.”

Any thoughts as to why this might be happening? Is there something I
should
install on my virtual PC? My virtual PC is running Windows XP SP2. I
am
building using the Windows XP x86 Checked Build Environment.

__________ Information from ESET Smart Security, version of virus
signature
database 5124 (20100518) __________

The message was checked by ESET Smart Security.

http://www.eset.com

Have you checked the registry entrys for your driver and verified that the
SYS file is indeed where the ImagePath entry says it is? As to the image
path: I’ve recently noted that instead of \systemroot\system32.…,
ImagePath may be set to ??\C:\Windows\system32.… and that can indeed
confuse the heck out of .kdfiles which may be set to C:.… . If you are not
using .kdfiles then that may not be an issue but you do indeed need to know
WHERE your driver is on disk and if ImagePath is pointing to it correctly.

Gary G. Little
H (952) 223-1349
C (952) 454-4629
xxxxx@comcast.net

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@hotmail.com
Sent: Tuesday, May 18, 2010 9:08 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Cannot open include file: ‘wdf.h’

I just realized that although adding the KMDF version to the sources file
fixed my build errors, now when I try to start the service on my virtual PC
using OSR Driver Loader I get an error that says “The system cannot find the
file specified.”

Any thoughts as to why this might be happening? Is there something I should
install on my virtual PC? My virtual PC is running Windows XP SP2. I am
building using the Windows XP x86 Checked Build Environment.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

__________ Information from ESET Smart Security, version of virus signature
database 5124 (20100518) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature
database 5124 (20100518) __________

The message was checked by ESET Smart Security.

http://www.eset.com

xxxxx@hotmail.com wrote:

I just realized that although adding the KMDF version to the sources file fixed my build errors, now when I try to start the service on my virtual PC using OSR Driver Loader I get an error that says “The system cannot find the file specified.”

Any thoughts as to why this might be happening? Is there something I should install on my virtual PC? My virtual PC is running Windows XP SP2. I am building using the Windows XP x86 Checked Build Environment.

Are you installing KMDF? XP does not include it. If there are no other
KMDF drivers, then you are responsible for installing the KMDF runtime.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.