【问题标题】:WDK 10 - Rpcrt4.dll - System Error 2WDK 10 - Rpcrt4.dll - 系统错误 2
【发布时间】:2017-03-08 05:50:16
【问题描述】:

我一直在使用 WDK 10,并且已将 rpcrt4.lib 添加到链接器中。我的驱动程序已成功构建。当我尝试使用命令 net start mydriver 运行驱动程序时。我收到系统错误 2 消息。我尝试使用dependency walker,但没有看到任何dll文件丢失。当我从附加依赖项中删除 rpcrt4.lib 时,我可以毫无问题地运行驱动程序。但是当我添加 rpcrt4.lib 时,它构建成功,但是在编写 net start mydriver 时会出现系统错误 2。我需要 rpcrt4.lib,因为我使用的是 UuidCreate 函数。

过去 1 周我一直在研究这个问题,但没有找到任何东西。

谢谢

【问题讨论】:

    标签: c++ dll driver wdk system-error


    【解决方案1】:

    Rpcrt4.dll 是用户模式 ​​dll,不能在内核空间中使用。当然,您的驱动程序加载失败,代码为 STATUS_OBJECT_NAME_NOT_FOUND(映射到 win32 错误 ERROR_FILE_NOT_FOUND (2)) - 在 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services 下的 Rpcrt4.dll 的系统搜索注册但未找到

    要在内核模式下创建 uuid,您需要使用 ExUuidCreate

    【讨论】:

    • 你能告诉我你是怎么知道 Rpcrt4.dll 是用户模式的 dll。因为我在 msdn 中没有看到任何说 Rpcrt4.dll 是用户模式 ​​dll 的内容。
    • @KaushalKumarSingh - 奇怪的问题.. 它用于用户模式 ​​- 支持 RPC 的特殊设计 - 远程过程调用。 PE 不能同时在用户模式和内核模式下工作。这是异或。然后查看它导入的示例..您可以查看它从ntdll.dllkernel32.dllapi-ms-*kernelbase.dll 导入 - 所以如果假设rpcrt4 在内核中工作 - 所有它的依赖项也必须在核心。所以ntdll 也是内核模式 dll 吗?并在最后阅读Export Drivers
    • Loading an Export Driver Export drivers must be installed in the %Windir%\System32\Drivers directory - rpcrt4.dll - 此处未找到
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-12
    • 2016-09-12
    • 1970-01-01
    • 2019-06-04
    • 1970-01-01
    相关资源
    最近更新 更多