WDK错误(包括ndis.h) [英] WDK Error (Including ndis.h)

查看:237
本文介绍了WDK错误(包括ndis.h)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


这些天,我正在写驱动程序.我已经下载了WDK版本7.1.0
从Microsoft下载中心下载,在我的源代码中,我包含ndis.h,但是在编译时,这些消息已显示:

------ Build started: Project: sys_test, Configuration: Debug Win32 ------
Compiling...
source.cpp
e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SHIFT'' : undeclared identifier
e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier
e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier
e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier
e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SHIFT'' : undeclared identifier



为什么说未声明"PAGE_SHIFT"和"PAGE_SIZE"?是否需要包含另一个头文件?

谢谢

------------------------------------
我做了您说的解决方案,但是这次编译器无法检测到我的CPU体系结构.我得到这些:

ClCompile:
  source.cpp
d:\winddk\7600.16385.1\inc\ddk\wdm.h(14198): fatal error C1189: #error :  "No target architecture defined"
Build FAILED.



但是我知道我的CPU体系结构是x86.缺少的环境变量,通常由其他文件设置:
http://mcdermottcybersecurity.com/articles/64-bit-device-driver-development [ ^ ]


您是否包含wdm.h?
这些常量在那定义.

为什么到ndis.h的路径显示e:\ wdk \ ndis.h?
在我的机器上是C:\ WinDDK \ 7600.16385.0 \ inc \ ddk \ ndis.h.

如果您已将标题复制到文件夹,则这样做是错误的方法.
您必须在项目配置中设置安装路径.


Hi
These days I''m working on writing driver. I''ve downloaded WDK version 7.1.0
from Microsoft download center and in my source code I include ndis.h but when I compile it these messages have been shown:

------ Build started: Project: sys_test, Configuration: Debug Win32 ------
Compiling...
source.cpp
e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SHIFT'' : undeclared identifier
e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier
e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier
e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier
e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SHIFT'' : undeclared identifier



Why does it say ''PAGE_SHIFT'' and ''PAGE_SIZE'' are undeclared? Is it necessary to include another header files?

Thanks

------------------------------------
I did the solution you said but this time the compiler couldn''t detect my CPU architecture. I got these:

ClCompile:
  source.cpp
d:\winddk\7600.16385.1\inc\ddk\wdm.h(14198): fatal error C1189: #error :  "No target architecture defined"
Build FAILED.



But I know that my CPU architecture is x86.

解决方案

Again, here''s a decent article on why the "No target architecture defined" error comes up, there''s environment variables missing that are usually set up by other files:
http://mcdermottcybersecurity.com/articles/64-bit-device-driver-development[^]


Did you include wdm.h?
These constants are defined in that.

Why is the path to ndis.h showing e:\wdk\ndis.h?
On my machine it is C:\WinDDK\7600.16385.0\inc\ddk\ndis.h.

If you have copied the headers to the folder, it is the wrong way to do it.
You have to set the installed path in your project configuration.


这篇关于WDK错误(包括ndis.h)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆