dionysus77
驱动小牛
驱动小牛
  • 注册日期2006-11-15
  • 最后登录2011-12-18
  • 粉丝0
  • 关注0
  • 积分27分
  • 威望392点
  • 贡献值0点
  • 好评度177点
  • 原创分0分
  • 专家分0分
阅读:1071回复:4

我疯了,编译总报错,来看看代码怎么错了

楼主#
更多 发布于:2007-03-15 18:27
代码:
KEVENT waitEvent;
KeInitializeEvent( &waitEvent,
                       NotificationEvent,
                       FALSE );
错误:
mfilter.c(1535) : error C2275: 'KEVENT' : illegal use of this type as an expression
mfilter.c(1535) : error C2146: syntax error : missing ';' before identifier 'waitEvent'
mfilter.c(1535) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
mfilter.c(1535) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>'
mfilter.c(1535) : error C2143: syntax error : missing ';' before 'identifier'
mfilter.c(1535) : error C2065: 'waitEvent' : undeclared identifier
mfilter.c(1537) : error C4133: 'function' : incompatible types - from 'int *' to 'PRKEVENT'
zh002008
驱动牛犊
驱动牛犊
  • 注册日期2004-08-22
  • 最后登录2013-09-06
  • 粉丝1
  • 关注1
  • 积分545分
  • 威望155点
  • 贡献值0点
  • 好评度51点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2007-03-15 22:03
KEVENT需要定义,你包含头文件了吗?可以包含ntifs.h试试。
rayyang2000
管理员
管理员
  • 注册日期2001-03-23
  • 最后登录2012-09-13
  • 粉丝3
  • 关注0
  • 积分1036分
  • 威望925点
  • 贡献值3点
  • 好评度823点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2007-03-16 06:22
可能的原因之一:用的是c文件形式,可是KEVENT waitEvent;并不是放在函数的最前面
天天coding-debugging中----超稀饭memory dump file ======================================================== [b]Windows Device Driver Development and Consulting Service[/b] [color=blue][url]http://www.ybwork.com[/url][/color] ========================================================
a3xx00443
驱动牛犊
驱动牛犊
  • 注册日期2004-09-12
  • 最后登录2010-03-16
  • 粉丝0
  • 关注0
  • 积分255分
  • 威望56点
  • 贡献值0点
  • 好评度25点
  • 原创分0分
  • 专家分0分
地板#
发布于:2007-04-11 15:59
有可能你用的代码是c形式的.
这就需要你在变量声明之前不能调用函数,或赋值变量.

NTSTATUS status = INVALID...;
KEVENT kevent ;
KeIni(...);
改为
NTSTATUS status ;
KEVENT kevent ;

status = INVALID...;
KeIni(...);
试试看.
yandong_8212
驱动小牛
驱动小牛
  • 注册日期2006-07-28
  • 最后登录2011-02-11
  • 粉丝0
  • 关注0
  • 积分1046分
  • 威望464点
  • 贡献值1点
  • 好评度173点
  • 原创分0分
  • 专家分1分
地下室#
发布于:2007-04-11 19:54
引用第3楼a3xx004432007-04-11 15:59发表的“”:
有可能你用的代码是c形式的.
这就需要你在变量声明之前不能调用函数,或赋值变量.

NTSTATUS status = INVALID...;
KEVENT kevent ;
.......


c语言也允许初始化。
商务MSN:YanDong_8212@163.com
游客

返回顶部