【问题标题】:Call NtQuerySystemInformation in kernel-space在内核空间调用 NtQuerySystemInformation
【发布时间】:2014-02-25 20:49:55
【问题描述】:

我想在内核空间(来自我的非即插即用驱动程序)中获取 SystemBasicInformation、SystemPerformanceInformation、SystemFileCacheInformation。但我不能在内核空间调用 NtQuerySystemInformation,因为它需要用户空间 ntdll.lib。 有人知道内核空间中相同的 NtQuerySystemInformation 吗?

【问题讨论】:

  • 说明您应该包含ntdll.lib 以使用ZwQuerySystemInformation 的文档仅适用于用户模式程序。您是否尝试过简单地忽略这一点? AFAIK,您通常不需要指定库文件来调用内核模式函数。

标签: c++ c windows winapi driver


【解决方案1】:

你在看的可能是ZwQuerySystemInformation

Zw 表示它是用于驱动程序的,因此您可以随时在 Google 上搜索一些带有 Zw 前缀的 API。

另外,你为什么认为ntdll.lib 意味着API 必须从用户空间调用? NtQuerySystemInformation 应该也可以,你试过了吗,还是只是猜测?

【讨论】:

  • 感谢您的回答!我尝试使用包含 ntdll.lib 调用 ZwQuerySystemInformation,但它不起作用,因为 ntdll.lib 是用户空间库。在 WDK 中,ntdll.lib 位于 /um 文件夹中。
猜你喜欢
  • 2015-06-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-11-29
  • 2017-12-10
  • 1970-01-01
  • 2012-06-21
相关资源
最近更新 更多