lkdsgrjra
驱动牛犊
驱动牛犊
  • 注册日期2010-01-23
  • 最后登录2016-01-09
  • 粉丝0
  • 关注0
  • 积分7分
  • 威望41点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:2134回复:2

第一次写WDK,出现错误,帮帮我!

楼主#
更多 发布于:2010-01-23 13:35
编译出现错误:


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;
}

我是看着寒江独钓书上写的。哪里出错了?请大家帮忙看看。急啊

zapline
驱动牛犊
驱动牛犊
  • 注册日期2009-01-09
  • 最后登录2011-10-27
  • 粉丝0
  • 关注0
  • 积分7分
  • 威望71点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2010-01-24 17:05
VOID DriverUnload(PDRIVER_OJECT driver)

PDRIVER_OBJECT
毕竟回忆是远了暗了的暮霭,希望才是近了亮了的晨光!
guenli
驱动牛犊
驱动牛犊
  • 注册日期2009-12-18
  • 最后登录2010-02-19
  • 粉丝0
  • 关注0
  • 积分61分
  • 威望611点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2010-01-27 19:33
楼上的正解。对楼主的学习热情有所质疑啊!
游客

返回顶部