c++ - 错误 C2220 : warning treated as error-no 'object' file generated in driver development

标签 c++ visual-studio-2012

我正在尝试使用以下代码开发示例驱动程序:

#include <ntddk.h>
#include<wdm.h>
DRIVER_INITIALIZE DriverEntry;

NTSTATUS DriverEntry(__inout PDRIVER_OBJECT  DriverObject,__in PUNICODE_STRING RegistryPath)
{
    NTSTATUS status;
    DbgPrint("Driver has been loaded");
    return(STATUS_SUCCESS);
}

但是它向我显示了一个错误

"error C2220: warning treated as error - no 'object' file generated"

请帮帮我!! 谢谢

最佳答案

  • 删除 DRIVER_INITIALIZE DriverEntry;线路
  • 使用 UNREFERENCED_PARAMETER 取消引用 registerObject
  • 使用FltRegisterFilter注册过滤器见msdn上的定义
  • 使用 RtlInitUnicodeString
  • DbgPrint("驱动输入!!!!!");

应遵循流程 可能是因为未使用 UNREFERENCED_PARAMETER,这会给您带来错误。

关于c++ - 错误 C2220 : warning treated as error-no 'object' file generated in driver development,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29470570/

相关文章:

c++ - GL_LINE_STIPPLE 在 ubuntu 中不起作用

c++ - 如何使用STL实现LFU缓存?

windows-8 - Windows 8 模拟器不工作

c++ - 收集不同类型的类并在 C++ 中调用它们的方法

c++ - 返回模板类型的模板函数

c++ - std::ostringstream 打印 c 字符串的地址而不是其内容

c++ - 手动设置 Visual Studio 2012 的 C++ 语言版本

c# - A 类 DLL 不能转换为 B 类 DLL。 Type A originates.. from in the context LoadFrom

c# - 系统引用未被识别?

c++ - 请求用户输入以命名使用 ofstream C++ MFC 创建的文件