驱动级无法调用ZwQuerySystemInformation

adu699 2010-11-16 12:50:57
在驱动级调用ZwQuerySystemInformation,总是报C2019号错误Nt的也是同样。
已经三天了,跳楼的心都有了,哪位大牛帮帮忙啊!
...全文
182 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
adu699 2010-11-17
  • 打赏
  • 举报
回复
终于搞定了。
同样的函数,用C和C++编译器得到的符号名不同。我这是在用C++环境下进行的编译,在驱动层应该使用用C的符号连接,函数声名之前加上extern "C",就可以。
还是谢谢楼上各位大侠
adu699 2010-11-16
  • 打赏
  • 举报
回复
我仔细查看了我的DDK里的lib文件,本来就有ntoskrnl.lib,应该不用再加了。
adu699 2010-11-16
  • 打赏
  • 举报
回复
谢谢各位,我先试一下,再过来回
dengqibin 2010-11-16
  • 打赏
  • 举报
回复
加ntoskrnl.lib看下,好像在这导出的
dengqibin 2010-11-16
  • 打赏
  • 举报
回复
这是C2019号错误的说明,其他也帮不上忙了,稍微google了下,ring0下应该只要声明下就好了

Compiler Error C2019
Visual Studio .NET 2003 Other Versions Visual Studio 2010 Visual Studio 2008 Visual Studio 2005
expected preprocessor directive, found 'character'

The character followed a # sign but it is not the first letter of a preprocessor directive. The following sample generates C2019:

Copy// C2019.cpp
#!define TRUE 1 // C2019, remove the ! to resolve the error

int main() {
}

3,881

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧