主板序列号
代码语言:javascript复制 string str;
str = bios.GetSystemSerialNumber(); //wentai
//str1 = bios.GetSystemECSerialNumber();
//CLogHelp::ITCLog(str1);
LocalSN = str.c_str();
str = bios.GetSystemVersion();
LocalMode = str.c_str();
string str1;
str1 = bios.GetSystemSerialNumber();
CLogHelp::ITCLog(str1);
str1 = bios.GetSystemSKUNumber();
CLogHelp::ITCLog(str1);
str1 = bios.GetSystemECSerialNumber();
CLogHelp::ITCLog(str1);
str1 = bios.GetSystemECVersion();
CLogHelp::ITCLog(str1);
str1 = bios.GetSystemProductName();
CLogHelp::ITCLog(str1);
代码语言:javascript复制void CSMBiosTable::ParseSMBiosStructure( unsigned char * pInBuf, int nInBufLen )
{
int i = 0;
while( i 1 < nInBufLen )
{
unsigned char cType = pInBuf[i];
unsigned char cLength = pInBuf[i 1];
if( i cLength >= nInBufLen )
break;
// BASE_LOG_OUT(( P2SP_LOG, " i cLength = %d nInBufLen-i-cLength=%d begn", i cLength, nInBufLen-i-cLength ));
int end = FindStringRegionEnd( &pInBuf[i cLength], nInBufLen-i-cLength );
// BASE_LOG_OUT(( P2SP_LOG, " i cLength = %d nInBufLen-i-cLength=%dn", i cLength, nInBufLen-i-cLength ));
if( end == -1 )//已经到结尾
{
// BASE_LOG_OUT(( P2SP_LOG, "breakn" ));
break;
}
PSMBiosStructureBuffer structBuffer = GetStructureBuffer( cType );
if( structBuffer != NULL )
{
if( structBuffer->m_pStructureBuffer == NULL )//第一个 buffer 对象已经生成 通过其buffer成员 判断是否被使用
{
structBuffer->m_pStructureBuffer = new unsigned char[cLength end];
memcpy_s( structBuffer->m_pStructureBuffer, cLength end, &pInBuf[i], cLength end );
structBuffer->m_nStructureBufferLen = cLength end;
}
else//接下来的通过成员 m_next 来判断对象是否生成且使用
{
while( structBuffer->m_next != NULL )
structBuffer = structBuffer->m_next;
PSMBiosStructureBuffer tempStructBuffer = new SSMBiosStructureBuffer;
tempStructBuffer->m_cType = cType;
tempStructBuffer->m_pStructureBuffer = new unsigned char[cLength end];
memcpy_s( tempStructBuffer->m_pStructureBuffer, cLength end, &pInBuf[i], cLength end );
tempStructBuffer->m_nStructureBufferLen = cLength end;
structBuffer->m_next = tempStructBuffer;
}
}
// BASE_LOG_OUT(( P2SP_LOG, " i = %dn", i ));
i = i cLength end;
// BASE_LOG_OUT(( P2SP_LOG, " i = %d endn", i ));
}
// BASE_LOG_OUT(( P2SP_LOG, "endn" ));
}
int CSMBiosTable::FindStringRegionEnd( const unsigned char * pBegin, const unsigned int nLen )
{
int nCurPos = 0;
while( nCurPos 1 < nLen )
{
if( pBegin[nCurPos] == '