tags:

views:

1016

answers:

3

We are running windows xp pro service pack 3 both 32 bit and 64 bit. We are using WMI to get the BIOS manufacturer and model, but we would really prefer an approach that used either the Win32 API or assembly language or something besides WMI or COM. Code samples are most welcome.

+1  A: 

You can map in the SMBIOS memory and parse it. Most of the information you want is in there. This can be done from any language that has access to system memory mapping primitives.

Also, this document has information about the Win32 functions that can be used to query SMBIOS.

Christopher
Thanks for the SMBIOS links. The Win32 calls in the document appear to not be available on XP Pro 32 bit from what I can see in the MSDN documentation though.
John JJ Curtis
+1  A: 

It's in the registry at HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System

You have SystemBiosVersion, SystemBiosDate, etc.

Also, there is a sub key called BIOS which has yet more information such as BIOSVendor and BIOSVersion.

Depending on who built the system you should also be able to get the BaseBoardManufacturer and other cool info.

UPDATE

You might check out this link. It's VB code. They try to read it from the registry, but failing that fall back to pulling string data out of a memory address. In this case it's &HFE061 for the Version and &HFFFF5 for the date.

Chris Lively
On my vista 32 bit machine this works great, however we run some 32 bit apps on windows xp professional x64 and these keys do not have any information in them.
John JJ Curtis
According to this article from 2002, it's supposed to be there. http://www.pctools.com/guides/registry/detail/830/
Chris Lively
Weird. We also have some server 2003 standard boxes and they don't have the keys populated either...
John JJ Curtis
Interesting. Are you sure your looking at the right key? Another thought is that it's a permissions issue or something. I just checked 3 of our servers. All of the had SystemBiosDate and SystemBiosVersion. under the hardware/description/system key.
Chris Lively
Are you running xp or win 2003 servers?
John JJ Curtis
Looks like because the machine was imaged these settings are not available. However this seems like the easiest solution so I am accepting your answer.
John JJ Curtis
A: 

DmiDecode for Windows can do this.

Josh Kelley
Is there a visual studio C++ project for this? I couldn't find anything.
John JJ Curtis
It's a port of a Linux tool, so probably not.
Josh Kelley