资源简介
通过SMBIOS操作 获取系统硬件信息 实例 可以获取cpu 内存 主板等详细信息
代码片段和文件信息
/*
+-------------------------------------------------------------------------------+
| |
| File: bios_info |
| ================================================= |
| Dev Platform: WinXP SP2 2.3GHZ 2GB RAM |
| Dev Environment: Visual Studio.NET 2005 |
| Target: Windows Server 2003 R2 (x86x64) |
| Purpose: Display and support functions for table type 0x00 |
| ================================================= |
+-------------------------------------------------------------------------------+
*/
#include “stdafx.h“
#include “windows.h“
#include “smbios_tables.h“
#include “bios_info.h“
extern bool use_file;
extern void p(_TCHAR * ...);
extern bool return_next_table_of_type(supported_tablesvoid*int*bool);
extern void get_string_resource_for_id(int unsigned char * _TCHAR *);
bool show_bios_information()
{
bool result=false;
unsigned char buf[MAX_DATA];
unsigned char* p_buf = buf;
int len=MAX_DATA;
memset(buf0MAX_DATA);
p(_T(“BIOS_INFO_TYPE_0\n“));
//there is only ever one bios info table so...
if (return_next_table_of_type(bios_info&buf&lentrue))
{
//build the table up
bios_info_type_0 t0;
memset(&t00sizeof(bios_info_type_0));
memcpy(&t0.headerbuf4);
get_string_resource_for_id(buf[0x04]p_buft0.vendor);
get_string_resource_for_id(buf[0x05]p_buft0.bios_version);
memcpy(&t0.start_addr_segment&buf[0x06]2);
get_string_resource_for_id(buf[0x08]p_buft0.bios_release_date);
t0.bios_rom_size=buf[0x09];
memcpy(&t0.bios_characteristics&buf[0x0A]4);
//determine optional bytes
int number_of_optional_bytes=buf[0x01]-0x12;
memcpy(&t0.bios_extension1&buf[0x12]number_of_optional_bytes);
//now display what we found out
p(_T(“ vendor:%s\n“)t0.vendor);
p(_T(“ version string:%s\n“)t0.bios_version);
p(_T(“ start segment:0x%04x\n“)t0.start_addr_segment);
p(_T(“ release date:%s\n“)t0.bios_release_date);
p(_T(“ rom size:0x%02x\n“)t0.bios_rom_size);
p(_T(“ characterizations:\n“));
if (t0.bios_characteristics & ISA_SUPPORTED) p(_T(“ isa supported\n“));
if (t0.bios_characteristics & MCS_SUPPORTED) p(_T(“ mcs supported\n“));
if (t0.bios_characteristics & ESIA_SUPPORTED) p(_T(“ eisa supported\n“));
if (t0.bios_characteristics & PCI_SUPPORTED) p(_T(“ pci supported\n“));
if (t0.bios_characteristics & PCMCIA_SUPPORTED) p(_T(“ pccards supported\n“));
if (t0.bios_characteristics & PNP_SUPPORTED) p(_T(“ plug n play supported\n“));
if (t0.bios_characteristics & APM_SUPPORTED) p(_T(“ apm supported\n“));
if (t0.bios_characteristics & BIOS_FLASHABLE) p(_T(“ bios flash upgradable\n“));
if (t0.bios_characteristics & BIOS_SHADOW_SUPPORTED) p(_T(“ bios shadowing supported\n“));
if (t0.bios_characteristics & VL_VESA_SUPPORTED) p(_T(“ vl-vesa supported\n“));
if (t0.bios_characteristics & ESCD_SUPPORTED) p(_T(“ e
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6330 2008-03-24 23:07 SMBIOS\bios_info.cpp
文件 3188 2008-03-24 23:07 SMBIOS\bios_info.h
文件 7421 2008-03-24 23:07 SMBIOS\cache.cpp
文件 2305 2008-03-24 23:07 SMBIOS\cache.h
文件 11219 2008-03-24 23:07 SMBIOS\enclosure.cpp
文件 4980 2008-03-24 23:07 SMBIOS\enclosure.h
文件 2477 2008-03-24 23:07 SMBIOS\mem_array_map.cpp
文件 662 2008-03-24 23:07 SMBIOS\mem_array_map.h
文件 7194 2013-05-02 00:20 SMBIOS\mem_dev.cpp
文件 2816 2013-05-01 20:28 SMBIOS\mem_dev.h
文件 5358 2013-06-13 17:54 SMBIOS\phys_mem_array.cpp
文件 1563 2008-03-24 23:07 SMBIOS\phys_mem_array.h
文件 17727 2013-05-13 08:32 SMBIOS\processor.cpp
文件 6697 2008-03-24 23:07 SMBIOS\processor.h
文件 9829 2008-03-24 23:07 SMBIOS\slots.cpp
文件 3075 2008-03-24 23:07 SMBIOS\slots.h
文件 19215 2013-05-02 17:59 SMBIOS\smbios_p.cpp
文件 14683136 2013-06-14 04:00 SMBIOS\smbios_p.ncb
文件 1565 2013-05-01 20:02 SMBIOS\smbios_p.sln
文件 1564 2008-03-26 07:50 SMBIOS\smbios_p.sln.old
..A..H. 23552 2013-06-14 04:00 SMBIOS\smbios_p.suo
文件 12941 2013-05-01 20:02 SMBIOS\smbios_p.vcproj
文件 12817 2008-03-24 23:07 SMBIOS\smbios_p.vcproj.8.00.old
文件 3835 2013-06-14 04:00 SMBIOS\smbios_p.vcproj.DBC-MINI.Administrator.user
文件 1733 2008-03-24 23:07 SMBIOS\smbios_tables.h
文件 295 2008-03-24 23:07 SMBIOS\stdafx.cpp
文件 516 2008-03-24 23:07 SMBIOS\stdafx.h
文件 3169 2013-05-01 20:23 SMBIOS\sys_boot_info.cpp
文件 849 2008-03-24 23:07 SMBIOS\sys_boot_info.h
文件 2953 2008-03-24 23:07 SMBIOS\sys_info.cpp
............此处省略26个文件信息
- 上一篇:系统集成项目实施指导
- 下一篇:心理学软件Inquisit
评论
共有 条评论