|
@@ -1273,15 +1273,15 @@ bool CAccessAuthEntity::GetTerminalFingerPrint(BYTE *pBuf, int &nBufLen)
|
|
|
#ifdef RVC_OS_WIN
|
|
|
if (!QueryWMIDevice(Processor, "ProcessorId", szTmp, &nTmpBufLen))
|
|
|
#else
|
|
|
- if (!get_cpu_id_by_asm(strTmp))
|
|
|
+ //if (!get_cpu_id_by_asm(strTmp))
|
|
|
+ if (!get_cpu_id_by_system(strTmp))
|
|
|
#endif // RVC_OS_WIN
|
|
|
{
|
|
|
- strErrMsg = CSimpleStringA::Format("query cpu id fail: %d, 请重启设备", GetLastError());
|
|
|
+ strErrMsg = CSimpleStringA::Format("查询CPU ID失败,请重启机器并重新初始化");
|
|
|
SetAuthErrMsg((const char *)strErrMsg);
|
|
|
spFunction->SetSysVar("AuthErrMsg", (const char *)strErrMsg, true);
|
|
|
- //LogError(Severity_Low, Error_Unexpect, ERROR_ACCESSAUTH_GETCPUID, (const char *)strErrMsg);
|
|
|
LogWarn(Severity_Middle, Error_Unexpect, ERR_ACCESSAUTH_GET_TERMINAL_FINGERPRINT,
|
|
|
- GetOutPutStr("%s%s%s%d", "QueryWMIDevice", "False", "Processor", GetLastError()).c_str());
|
|
|
+ GetOutPutStr("%s%s", "Processor", "False").c_str());
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -1298,14 +1298,15 @@ bool CAccessAuthEntity::GetTerminalFingerPrint(BYTE *pBuf, int &nBufLen)
|
|
|
if (!get_board_serial_by_system(strTmp))
|
|
|
#endif // RVC_OS_WIN
|
|
|
{
|
|
|
- strErrMsg = CSimpleStringA::Format("query baseboard sn fail: %d, 请重启设备", GetLastError());
|
|
|
+ strErrMsg = CSimpleStringA::Format("查询主板序列号失败, 请重启机器并重新初始化");
|
|
|
SetAuthErrMsg((const char *)strErrMsg);
|
|
|
spFunction->SetSysVar("AuthErrMsg", (const char *)strErrMsg, true);
|
|
|
- //LogError(Severity_Low, Error_Unexpect, ERROR_ACCESSAUTH_GETBASEBOARDSN, (const char *)strErrMsg);
|
|
|
LogWarn(Severity_Middle, Error_Unexpect, ERR_ACCESSAUTH_GET_TERMINAL_FINGERPRINT,
|
|
|
- GetOutPutStr("%s%s%s%d", "QueryWMIDevice", "False", "BaseBoard", GetLastError()).c_str());
|
|
|
+ GetOutPutStr("%s%s", "BaseBoard", "False").c_str());
|
|
|
return false;
|
|
|
}
|
|
|
+ strRet += "|";
|
|
|
+
|
|
|
#ifdef RVC_OS_WIN
|
|
|
//Dbg("baseboard sn: %s", szTmp);
|
|
|
strRet += szTmp;
|
|
@@ -1313,24 +1314,35 @@ bool CAccessAuthEntity::GetTerminalFingerPrint(BYTE *pBuf, int &nBufLen)
|
|
|
memset(szTmp, 0, sizeof(szTmp));
|
|
|
if (!QueryWMIDevice(DiskDrive, "SerialNumber", szTmp, &nTmpBufLen))
|
|
|
#else
|
|
|
- Dbg("baseboard sn: %s", strTmp.c_str());
|
|
|
+ Dbg("baseboard sn: %s", strTmp.c_str());
|
|
|
strRet += strTmp.c_str();
|
|
|
vector<string> disk;
|
|
|
+
|
|
|
if (!get_disk_serial_by_system(disk))
|
|
|
#endif // RVC_OS_WIN
|
|
|
{
|
|
|
- strErrMsg = CSimpleStringA::Format("query harddisk sn fail: %d, 请重启设备", GetLastError());
|
|
|
- SetAuthErrMsg((const char *)strErrMsg);
|
|
|
- spFunction->SetSysVar("AuthErrMsg", (const char *)strErrMsg, true);
|
|
|
- //LogError(Severity_Low, Error_Unexpect, ERROR_ACCESSAUTH_DISKDRIVESN, (const char *)strErrMsg);
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, ERR_ACCESSAUTH_GET_TERMINAL_FINGERPRINT,
|
|
|
- GetOutPutStr("%s%s%s%d", "QueryWMIDevice", "False", "DiskDrive", GetLastError()).c_str());
|
|
|
+ strErrMsg = CSimpleStringA::Format("查询磁盘序列号失败, 请重启机器并重新初始化");
|
|
|
+ SetAuthErrMsg((const char*)strErrMsg);
|
|
|
+ spFunction->SetSysVar("AuthErrMsg", (const char*)strErrMsg, true);
|
|
|
+ LogWarn(Severity_Middle, Error_Unexpect, ERR_INITIALIZER_GET_DISKDRIVE_ID,
|
|
|
+ GetOutPutStr("%s%s", "DiskDrive", "False").c_str());
|
|
|
return false;
|
|
|
}
|
|
|
- //Dbg("harddisk sn: %s", szTmp);
|
|
|
-
|
|
|
strRet += "|";
|
|
|
+
|
|
|
+#ifdef RVC_OS_WIN
|
|
|
+ //Dbg("harddisk sn: %s", szTmp);
|
|
|
strRet += szTmp;
|
|
|
+#else
|
|
|
+ strTmp = "";
|
|
|
+ vector<string>::iterator it = disk.begin();
|
|
|
+ while (it != disk.end()) {
|
|
|
+ strTmp += *it;
|
|
|
+ it++;
|
|
|
+ }
|
|
|
+ Dbg("harddisk sn: %s", strTmp.c_str());
|
|
|
+ strRet += strTmp.c_str();
|
|
|
+#endif // RVC_OS_WIN
|
|
|
|
|
|
Dbg("device info: [%s]", (const char*)strRet);
|
|
|
|