简体   繁体   English

ntdll.dll是windows xp和windows vista的标准配置吗?

[英]Does ntdll.dll come standard with windows xp and windows vista?

Does ntdll.dll come standard with windows XP and Windows Vista? ntdll.dll是Windows XP和Windows Vista的标准配置吗? I know that I have it on my windows XP machine, but am not sure that is standard with every machine. 我知道我的Windows XP机器上有它,但我不确定这是每台机器的标准配置。

The reason I am curious is for the NTQuerySystemInformation function to get CPU usage of a windows XP and/or Windows Vista system. 我很好奇的原因是NTQuerySystemInformation函数可以获得Windows XP和/或Windows Vista系统的CPU使用率。

Yes, but the function you want to use doesn't might not. 是的,但你要使用的功能 没有 可能不会。 According to MSDN, NTQuerySystemInformation may be altered or unavailable in future versions of Windows. 根据MSDN,在未来版本的Windows中, NTQuerySystemInformation可能会被更改或不可用。 You should use GetSystemInfo instead, which is in Kernel32.dll and available from Windows 2000 and up. 您应该使用GetSystemInfo ,它位于Kernel32.dll中,可从Windows 2000及更高版本获得。

You really should learn to check MSDN regarding API calls before you use them. 在使用API​​调用之前,您确实应该学会检查有关API调用的MSDN And, if you did so, you should learn to listen, as once it's deprecated MS is free to remove it from future NTDLL files in updates (although they don't typically do so). 并且,如果你这样做,你应该学会倾听,因为一旦它被弃用,MS可以免费将其从更新中的未来NTDLL文件中删除(尽管它们通常不会这样做)。 Choosing to intentionally use a deprecated function when there is a viable and supported alternative is always a bad idea. 选择在有可行且受支持的替代方案时故意使用已弃用的功能总是一个坏主意。

Why use undocumented ntdll.dll functions? 为什么要使用未记录的ntdll.dll函数? You can use WMI to get the CPU usage. 您可以使用WMI来获取CPU使用率。 For example using Win32_Process should be able to help. 例如,使用Win32_Process应该可以提供帮助。

According to the site below, "this is a file required by Windows and deleting the file will cause errors with Windows." 根据以下网站,“这是Windows所需的文件,删除该文件将导致Windows出错。” With that said, I think it's safe to assume all machines will have it. 话虽如此,我认为假设所有机器都有它是安全的。

http://www.computerhope.com/issues/ch000960.htm http://www.computerhope.com/issues/ch000960.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM