Windows 驱动程序 C1083 错误

发布于 2025-01-02 17:35:06 字数 930 浏览 1 评论 0原文

我创建了简单的“Hello world”Windows 驱动程序。

hello.c

#include <ntddk.h> 

NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) 
{
    DbgPrint("Hello, World\n");
    return STATUS_SUCCESS; 
}

ma​​kefile

!INCLUDE $(NTMAKEENV)\makefile.def

TARGETNAME = hello
TARGETPATH = obj
TARGETTYPE = DRIVER

INCLUDES   = %BUILD%\inc
LIBS       = %BUILD%\lib

SOURCES    = hello.c

如果我通过检查构建环境构建驱动程序,我会得到:

错误 C1083:无法打开包含文件:'codeanalysis\sourceannotations.h':没有这样的文件或目录

C:\WinDDK\7600.16385.1\inc\crt< 中不包含此类文件或目录 sourceannotations.h /code> 和 C:\Program Files\Microsoft Visual Studio 10.0\VC\include\CodeAnalysis,但我只能使用 Winddk 中的包含文件目录。

你有什么建议我应该做什么吗?

I created simple "Hello world" windows driver.

hello.c

#include <ntddk.h> 

NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) 
{
    DbgPrint("Hello, World\n");
    return STATUS_SUCCESS; 
}

makefile

!INCLUDE $(NTMAKEENV)\makefile.def

sources

TARGETNAME = hello
TARGETPATH = obj
TARGETTYPE = DRIVER

INCLUDES   = %BUILD%\inc
LIBS       = %BUILD%\lib

SOURCES    = hello.c

If I build driver by Checked Build Environment, I get:

error C1083: Cannot open include file: 'codeanalysis\sourceannotations.h': No such file or directory

sourceannotations.h is included in C:\WinDDK\7600.16385.1\inc\crt and C:\Program Files\Microsoft Visual Studio 10.0\VC\include\CodeAnalysis, but I can only use included files from Winddk directory.

Do you have any suggestion what should I do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

Spring初心 2025-01-09 17:35:06

也许我错误地安装了DDK,因为重新安装DDK后我编译文件没有问题。

Maybe I incorrectly installed the DDK, because after reinstalling DDK I compiled files without problems.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文