⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smbiosinformation.h

📁 Windows下Hardware直接读写
💻 H
字号:
#pragma once

#include "SMStdStr.h"
#include <list>
using namespace std;

/*
enum {        BIOS_Information  =  0 ,        System_Information  =  1 ,        Base_Board_Information  =  2 ,        System_Enclosure_or_Chassis  =  3 ,        Processor_Information  =  4 ,        Memory_Controller_Information  =  5 ,        Memory_Module_Information  =  6 ,        Cache_Information  =  7 ,        Port_Connector_Information  =  8 ,        System_Slots  =  9 ,        On_Board_Devices_Information  =  10 ,        OEM_Strings  =  11 ,        System_Configuration_Options  =  12 ,        BIOS_Language_Information  =  13 ,        Group_Associations  =  14 ,        System_Event_Log  =  15 ,        Physical_Memory_Array  =  16 ,        Memory_Device  =  17 ,        Memory_Error_Information_32_bit  =  18 ,        Memory_Array_Mapped_Address  =  19 ,        Memory_Device_Mapped_Address  =  20 ,        Built_in_Pointing_Device  =  21 ,        Portable_Battery  =  22 ,        System_Reset  =  23 ,        Hardware_Security  =  24 ,        System_Power_Controls  =  25 ,        Voltage_Probe  =  26 ,        Cooling_Device  =  27 ,        Temperature_Probe  =  28 ,        Electrical__Current_Probe  =  29 ,        Out_of_Band_Remote_Access  =  30 ,        Boot_Integrity_Services_Entry_Point  =  31 ,        System_Boot_Information  =  32 ,        Memory_Error_Information_64_bit  =  33 ,        Management_Device  =  34 ,        Management_Device_Component  =  35 ,        Management_Device_Threshold  =  36 ,        Memory_Channel  =  37 ,        IPMI_Device_Information  =  38 ,        System_Power_Supply  =  39 ,        Inactive  =  126 ,        Revisions_and_IDs  =  208 ,        Parallel_Port  =  209 ,        Serial_Port  =  210 ,        IR_Port  =  211 ,        End_of_Table  =  127 ,        // vendor proprietary        Dell_Revisions_and_IDs = 0xD0,        Dell_Indexed_Io = 0xD4    };

enum{
	tBYTE = 1,
	tWORD = 2,
	tDWORD =3,
	tSTRING = 4
	};
typedef struct TLV
{
	BYTE smType;
	BYTE length;
	PBYTE pvalue;
	TCHAR strDesp[256];
}TLV, *PTLV;

TLV smiTableTLVType0[256]
{
	//type 0
	{tBYTE, 1,	NULL, "type"},
	{tBYTE, 1,   NULL, "bLength"},
	WORD		wHandle;
	BYTE		bVendor;
	BYTE		bVersion;
	WORD		wStartAddr;
	BYTE		bDate;
	BYTE		bRomsize;
	DWORD		dChars1;
	DWORD		dChars2;
	BYTE		bCharExt1;
	BYTE		bCharExt2;
}*/





typedef struct DMIHEADER
{
	BYTE   bType;
	BYTE   bLength;
	WORD   wHandle;
}DMIHEADER, PDMIHEADER;

typedef struct DMITYPEINFO
{
	DMIHEADER dmiHeader;
	PBYTE startAddr;
	PBYTE endAddr;
	PBYTE pBuffer;
}DMITYPEINFO, PDMITYPEINFO;


class CSMBiosInformation
{
public:
	CSMBiosInformation(void);
	~CSMBiosInformation(void);
	PBYTE m_pStartAddress;

	list <DMITYPEINFO> listDMITypeInfo;
	bool getSMStartAddress(void);
	// get the all the data of type nType, dump to buffer
	int getInfoTypeBytes();
	int getInfoEntryTable(PBYTE pStartAddr , PBYTE pEndAddr, SM_STRUCT_TABLE_ENTRY* pEntryTable);
	int dumpDMIInformation(void);
	int GetSMTypeName(int type, char* typeName);
};

extern CSMBiosInformation m_smBiosInfo;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -