2014-02-25 37 views
0

我想在内核空间(从我的nonPnP驱动程序)中获取SystemBasicInformation,SystemPerformanceInformation,SystemFileCacheInformation。但是我不能在内核空间中调用NtQuerySystemInformation,因为它需要用户空间ntdll.lib。 有没有人知道内核空间中的NtQuerySystemInformation?在内核空间调用NtQuerySystemInformation

+0

说你应该包含'ntdll.lib'以使用'ZwQuerySystemInformation'的文档仅适用于用户模式程序。你尝试过忽略这个吗? AFAIK你通常不需要指定库文件来调用内核模式函数。 –

回答

2

你要找可能是ZwQuerySystemInformation

Zw表明,它是驱动程序,让您可以随时谷歌一些API与Zw前缀。

此外,为什么你认为ntdll.lib意味着API必须从用户空间调用? NtQuerySystemInformation应该可以工作,你有没有尝试过,或只是猜测?

+0

感谢您的回答!我尝试使用include ntdll.lib调用ZwQuerySystemInformation,但它不起作用,因为ntdll.lib是用户空间库。在WDK中,ntdll.lib位于/ um文件夹中。 – user2983766

+0

+1。这个答案是有效的。什么不适合你? – user2120666