2014-02-25 86 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