Access Motherboard information without using WMI

半腔热情 提交于 2019-12-01 07:03:41

问题


I need to access motheroard identification (serial, manufacture, etc) in my application on multiple processes. I have been able to successfully query this using WMI, but I'm looking for an alternative.

If you care to know situation:

I have some application behavior that is different depending on the hardware configuration, or if a particular environment variable is set (for testing purposes).

bool IsVideoCardDisplay = ( getenv("Z_VI_DISPLAY") || !QueryWmiForSpecialBoard() ) ? false : true;

When the environment variable is set the WMI query isn't necessary--the application runs fine. However, when the environment variable is not present some of the components of my app fail to launch when is necessary to make the the WMI queries. I suspect that there may be some side effects of the WMI calls (which only a maximum of happen once per processes. This is why I'm seeking an alternative way.


回答1:


In Vista+ you can use GetSystemFirmwareTable API to access SMBIOS tables and parse them out to obtain [possibly available] serial numbers and other identification strings and values.

In particular you can access motherboard data, including vendor and S/N:

            Intel Corporation
            DZ77BH-55K
            AAG39018-400
            BQBH206600DT



回答2:


Apparently there is no way to do this, which is unfortunate.




回答3:


That information is provided by the CPUID instruction. The following link provides you with a program that uses this instruction to expose the results of executing the instruction.

cpuid GNU program



来源:https://stackoverflow.com/questions/1262404/access-motherboard-information-without-using-wmi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!