我正在尝试使用以下代码开发示例驱动程序:
#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/