PNDIS_GENERIC_OBJECT 错误 C2061
声明 PNDIS_GENERIC_OBJECT
变量后,我收到编译器错误。为什么会发生这种情况,我该如何避免?
#include <ntddk.h>
#include <ndis.h>
PNDIS_GENERIC_OBJECT gNdisGenericObj;
VOID DriverUnload(IN PDRIVER_OBJECT driverObject){
UNREFERENCED_PARAMETER(driverObject);
}
NTSTATUS DriverEntry( IN PDRIVER_OBJECT driverObject,
IN PUNICODE_STRING registryPath)
{
NTSTATUS status = STATUS_SUCCESS;
if (driverObject != NULL)
driverObject->DriverUnload = DriverUnload;
return status;
}
错误 C2061:语法错误:标识符“gNdisGenericObj”
错误 C2059:语法错误:';'
I get compiler errors after declaring the PNDIS_GENERIC_OBJECT
variable. Why does this happen, and how can I avoid it?
#include <ntddk.h>
#include <ndis.h>
PNDIS_GENERIC_OBJECT gNdisGenericObj;
VOID DriverUnload(IN PDRIVER_OBJECT driverObject){
UNREFERENCED_PARAMETER(driverObject);
}
NTSTATUS DriverEntry( IN PDRIVER_OBJECT driverObject,
IN PUNICODE_STRING registryPath)
{
NTSTATUS status = STATUS_SUCCESS;
if (driverObject != NULL)
driverObject->DriverUnload = DriverUnload;
return status;
}
error C2061: syntax error : identifier 'gNdisGenericObj'
error C2059: syntax error : ';'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用适当的 NDIS 版本定义来编译代码。我将引用 Windows 开发人员预览版中 NDIS.H 的顶部内容:
因此,总而言之,使用
-DNDIS60=1
等标志进行编译,然后就可以开始了。You must compile your code with the appropriate NDIS version definition. I'll quote from the top of NDIS.H in the Windows Developer Preview version:
So in summary, compile with a flag like
-DNDIS60=1
, and you should be good to go.