- C/C++ code
#include <wdm.h>#include <ntdef.h>VOID UnLoad(PDRIVER_OBJECT DriverObject){ KdPrint("xxxx");}NTSTATUSDriverEntry( IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath ){ /* NTSTATUS status;*/ DriverObject->DriverUnload = UnLoad; return 1;}
source
- C/C++ code
TARGETNAME=wdmTARGETPATH=objTARGETTYPE=DRIVERSOURCES= firstwdm.c
错误
- C/C++ code
E:\DDK>buildpath contains nonexistant c:\program files (x86)\amd app\bin\x86, removingBUILD: Compile and Link for IA64BUILD: Loading e:\winddk\7600.16385.1\build.dat...BUILD: Computing Include file dependencies:BUILD: Start time: Sat Dec 17 20:59:02 2011BUILD: Examining e:\ddk directory for files to compile.BUILD: Saving e:\winddk\7600.16385.1\build.dat...BUILD: Compiling and Linking e:\ddk directoryCompiling - firstwdm.c1>errors in directory e:\ddk1>e:\ddk\firstwdm.c(7) : error C2143: syntax error : missing ';' before 'string'Linking Executable - objchk_win7_ia64\ia64\wdm.sys1>link : error LNK1181: cannot open input file 'e:\ddk\objchk_win7_ia64\ia64\firstwdm.obj'BUILD: Finish time: Sat Dec 17 20:59:03 2011BUILD: Done 3 files compiled - 2 Warnings - 1 Error 1 executable built - 1 ErrorE:\DDK>
初学DDK,理论学了很多,一编译就卡起了。纠结中。。。
------解决方案--------------------
这句有错
KdPrint("xxxx");
应该为
KdPrint(("xxxx"));
看一下KdPrint的宏定义就知道了。