阅读:2236回复:2
第一次写WDK,出现错误,帮帮我!
编译出现错误:
OACR monitor running already D:\WinDDK\7600.16385.0>cd d:\wdk\first D:\wdk\first>build BUILD: Compile and Link for x86 BUILD: Loading d:\winddk\7600.16385.0\build.dat... BUILD: Computing Include file dependencies: BUILD: Start time: Sat Jan 23 13:33:32 2010 BUILD: Examining d:\wdk\first directory for files to compile. BUILD: Saving d:\winddk\7600.16385.0\build.dat... BUILD: Compiling and Linking d:\wdk\first directory Configuring OACR for 'root:x86chk' - <OACR on> _NT_TARGET_VERSION SET TO WINXP Compiling - first.c 1>errors in directory d:\wdk\first 1>d:\wdk\first\first.c(3) : error C2146: syntax error : missing ')' before ident ifier 'driver' 1>d:\wdk\first\first.c(3) : error C2061: syntax error : identifier 'driver' 1>d:\wdk\first\first.c(3) : error C2059: syntax error : ';' 1>d:\wdk\first\first.c(3) : error C2059: syntax error : ')' 1>d:\wdk\first\first.c(4) : error C2449: found '{' at file scope (missing functi on header?) 1>d:\wdk\first\first.c(6) : error C2059: syntax error : '}' Linking Executable - objchk_wxp_x86\i386\first.sys 1>link : error LNK1181: cannot open input file 'd:\wdk\first\objchk_wxp_x86\i386 \first.obj' BUILD: Finish time: Sat Jan 23 13:33:34 2010 BUILD: Done 3 files compiled - 6 Errors 1 executable built - 1 Error 检查了几遍不知道是哪错了,下面是我的first.c的源代码: #include<ntddk.h> VOID DriverUnload(PDRIVER_OJECT driver) { DbgPrint("first:unloading\r\n"); } NTSTATUS DriverEntry(PDRIVER_OBJECT driver,PUNICODE_STRING reg_path) { DbgPrint("first:hello"); driver->DriverUnload=DriverUnload; return STATUS_SUCCESS; } 我是看着寒江独钓书上写的。哪里出错了?请大家帮忙看看。急啊 |
|
沙发#
发布于:2010-01-24 17:05
VOID DriverUnload(PDRIVER_OJECT driver)
PDRIVER_OBJECT |
|
|
板凳#
发布于:2010-01-27 19:33
楼上的正解。对楼主的学习热情有所质疑啊!
|
|