Эх сурвалжийг харах

Z991239-6390 #comment 其他宏的标注

80374374 2 сар өмнө
parent
commit
b0e704893d
31 өөрчлөгдсөн 78 нэмэгдсэн , 83 устгасан
  1. 1 1
      Framework/Common/CodeSignVerify.h
  2. 0 6
      Framework/RVCComm/HTTPClient.cpp
  3. 2 2
      Framework/spbase/SpBase.cpp
  4. 18 15
      Framework/spbase/SpEntity.cpp
  5. 2 2
      Framework/spbase/SpFSM.cpp
  6. 1 1
      Framework/spbase/SpSecureClient.cpp
  7. 1 0
      Framework/spbase/sp_cfg.cpp
  8. 1 0
      Framework/spbase/sp_dir.c
  9. 0 1
      Framework/spbase/sp_gui.cpp
  10. 1 0
      Framework/spbase/sp_logwithlink.cpp
  11. 1 1
      Module/include/CommEntityUtil.hpp
  12. 1 5
      Module/include/DevFSMCommBase.hpp
  13. 6 9
      Module/mod_ResourceWatcher/ResourceWatcherFSM.cpp
  14. 0 3
      Module/mod_ResourceWatcher/ResourceWatcherFSM.h
  15. 4 2
      Module/mod_ResourceWatcher/mod_ResourceWatcher.cpp
  16. 9 6
      Module/mod_ResourceWatcher/mod_ResourceWatcher.h
  17. 3 0
      Module/mod_assistantchannel/chan_protocol.h
  18. 2 0
      Module/mod_assistantchannel/mod_assistantchannel.cpp
  19. 1 0
      Module/mod_chromium/CModTools.cpp
  20. 0 2
      Module/mod_chromium/CSocketClient.cpp
  21. 2 0
      Module/mod_chromium/mod_chromium.cpp
  22. 2 0
      Module/mod_counterconnector/ConnectorFSM.cpp
  23. 1 1
      Module/mod_counterconnector/strutil.cpp
  24. 1 1
      Module/mod_guiconsole/mod_guiconsole.cpp
  25. 1 1
      Module/mod_healthmanager/CMakeLists.txt
  26. 2 3
      Module/mod_healthmanager/HealthManagerFSM.cpp
  27. 9 13
      Module/mod_healthmanager/mod_healthmanager.cpp
  28. 1 1
      Module/mod_interactivecontrol/mod_interactivecontrol.cpp
  29. 1 0
      Module/mod_sipphone/mod_sipphone.h
  30. 3 0
      Module/mod_vtmloader/VtmLoaderFSM.cpp
  31. 1 7
      Tool/guardian/guardian.cpp

+ 1 - 1
Framework/Common/CodeSignVerify.h

@@ -33,7 +33,7 @@ struct CSignInfo
 	CSignInfo() :strProgramName(""), strSignCertIssuer(""), strSignCertSubject(""), strSignCertHash(""){}
 };
 
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 
 // verify code signature & get file version
 class CCodeSignVerify

+ 0 - 6
Framework/RVCComm/HTTPClient.cpp

@@ -213,17 +213,11 @@ CHTTPClient::~CHTTPClient()
    }
 
 #if defined(RVC_OS_WIN)
-   DEBUG_LOG("to lock.");
    Lock(INFINITE);
    if (--s_iCurlSession <= 0) {
-       DEBUG_LOG("to clean curl.");
        curl_global_cleanup();
-       DEBUG_LOG("after clean curl.");
    }
    Unlock();
-   DEBUG_LOG("unlock finished");
-#else
-
 #endif //RVC_OS_WIN
 }
 

+ 2 - 2
Framework/spbase/SpBase.cpp

@@ -386,7 +386,7 @@ SPBASE_API void LogAssert(const char* pszMessage, const char* pszFile, const int
 		pModule->LogMessage(Log_Debug, Severity_Middle, 0, 0,
 			CSimpleStringA::Format("assert fail: {%s}, file: {%s}, line: {%d}, stack: {%s}",
 				pszMessage, _GetFileName(pszFile), nLine,
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
                 (const char*)DumpStack(2)
 #else
                  "not implement, TODO:"
@@ -397,7 +397,7 @@ SPBASE_API void LogAssert(const char* pszMessage, const char* pszFile, const int
 	// write a copy in dbg log
 	DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__).setVtmCode(DWORD2Hex(ERR_ENTITY_ASSERT).GetData())("Assert fail: {%s}, file: {%s}, line: {%d}, stack: {%s}",
 		pszMessage, _GetFileName(pszFile), nLine,
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
         (const char*)DumpStack(2)
 #else
          "not implement, TODO:"

+ 18 - 15
Framework/spbase/SpEntity.cpp

@@ -28,7 +28,7 @@
 #include "toolkit.h"
 #include "dbgutil.h"
 #include "def.h"
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 #include "CodeSignVerify.h"
 #include "sp_checkEntity.h"
 #include "sp_firewallControl.h"
@@ -54,7 +54,7 @@ static void var_callback(sp_var_listener_t *listener,
 	ISysVarListener *pListener = (ISysVarListener *)user_data;
 	SpEntity *pEntity = (SpEntity*)sp_var_listener_get_tag(listener);
 
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 	SetthreadGroup(GetCurrentThreadId(), pEntity->get_cfg_ent()->name);
 	getEntityResource()->m_Entity = pEntity;
 #else
@@ -89,7 +89,7 @@ static void bcm_callback(sp_bcm_listener_t *listener,
 	SpEntity *pEntity = (SpEntity*)sp_bcm_listener_get_tag(listener);
 	sp_uid_t uid;
 
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 	SetthreadGroup(GetCurrentThreadId(), pEntity->get_cfg_ent()->name);
 	getEntityResource()->m_Entity = pEntity;
 #else
@@ -172,7 +172,7 @@ static void task_callback(threadpool_t *threadpool, void *arg, param_size_t para
 	ITaskSp *pTask = (ITaskSp*)arg;
 	SpEntity *pEntity = (SpEntity*)param1;
 
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 	SetthreadGroup(GetCurrentThreadId(), pEntity->GetEntityBase()->GetEntityName());
 	try {
 		getEntityResource()->m_Entity = pEntity;
@@ -235,7 +235,7 @@ SpEntity::~SpEntity()
 {
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("run ~SpEntity()");
     if (m_ent != nullptr && m_pEntityBase != nullptr) {
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
         getEntityResource()->m_Entity = NULL;
 #endif //_WIN32
     }
@@ -261,7 +261,7 @@ ErrorCodeEnum SpEntity::Init()
 	threadpool_set_thread_decorator(m_tpool, &SpEntity::__on_thread_init, &SpEntity::__on_thread_term, this);
 	threadpool_start(m_tpool, 0, 64, 5*60*1000, 0);
 
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 	setModuleAliasName(GetEntityBase()->GetEntityName());
 #endif //_WIN32
 
@@ -517,7 +517,7 @@ int SpEntity::on_accept(int epid, int svc_id, int conn_id, iobuffer_t **conn_pkt
 
 void SpEntity::on_thread_init()
 {
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 	SetthreadGroup(GetCurrentThreadId(), this->get_cfg_ent()->name);
 	getEntityResource()->m_Entity = this;
 #else
@@ -527,7 +527,7 @@ void SpEntity::on_thread_init()
 
 void SpEntity::on_thread_term()
 {
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 	SetthreadGroup(GetCurrentThreadId(), this->get_cfg_ent()->name);
 	getEntityResource()->m_Entity = NULL;
 #else
@@ -539,10 +539,11 @@ void SpEntity::__on_thread_init(threadpool_t *, void *arg)
 {
 	SpEntity *pThis = static_cast<SpEntity*>(arg);
 	pThis->on_thread_init();
-#ifndef _WIN32
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("thread init, thread id:%u", GetCurrentThreadIdFromSys());
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("thread init, thread id:%u",
+#ifndef RVC_OS_WIN
+	 GetCurrentThreadIdFromSys());
 #else
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("thread init, thread id:%d", GetCurrentThreadId());
+	 GetCurrentThreadId());
 #endif //NOT _WIN32
 }
 
@@ -550,10 +551,12 @@ void SpEntity::__on_thread_term(threadpool_t *, void *arg)
 {
 	SpEntity *pThis = static_cast<SpEntity*>(arg);
 	pThis->on_thread_term();
+
+	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("thread term, thread id:%d", 
 #if defined(_MSC_VER)
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("thread term, thread id:%d", GetCurrentThreadId());
+		GetCurrentThreadId());
 #else
-	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("thread term, thread id:%u", GetCurrentThreadIdFromSys());
+	GetCurrentThreadIdFromSys());
 #endif //_MSC_VER
 }
 
@@ -1756,7 +1759,7 @@ ErrorCodeEnum SpEntity::SetNewPathToFirewall(CSimpleString &pszPath, int maxWait
 	}
 
 
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 	auto addFirewall_worker = [this](std::string path)
 	{
 		return sp_AddFirewallRuleByPath(path.c_str()) ? Error_Succeed : Error_Bug;
@@ -2046,7 +2049,7 @@ ErrorCodeEnum SpEntity::VerifySignature(const char *pszSignedFile, CSimpleString
 
 ErrorCodeEnum SpEntity::ShowFatalError(const char *pszMsg, SeverityLevelEnum eLevel)
 {
-
+	//TODO:   [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	LogError(Severity_High, Error_Unrecover, 0, pszMsg);
 #endif //RVC_OS_WIN

+ 2 - 2
Framework/spbase/SpFSM.cpp

@@ -43,9 +43,9 @@ static void __fsm_cb(threadpool_t *threadpool, void *arg, param_size_t param1, p
 static void __tmr_cb(sp_tmr_t *timer, int err, void *user_data)
 {
 	FSMTimer *pTimer = static_cast<FSMTimer*>(user_data);
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 	SetThreadGroupByResource(GetCurrentProcessId(), timer);
-#endif //_WIN32
+#endif //RVC_OS_WIN
 	try
 	{
 		if (!err) {

+ 1 - 1
Framework/spbase/SpSecureClient.cpp

@@ -994,7 +994,7 @@ bool SpSecureClient::OnSessionKeySMRet(CConnAuthSMRet* pRet, BYTE* pBuf, int* pB
 
 bool SpSecureClient::OnGetSharedSK(char *pTerminalNo, int *pTerminalNoLen, BYTE *pBuf, int *pBufLen)
 {
-#ifdef _MSC_VER
+#ifdef RVC_OS_WIN
 	ErrorCodeEnum Error = Error_Unexpect;
 	CSystemStaticInfo si;
 	{

+ 1 - 0
Framework/spbase/sp_cfg.cpp

@@ -2047,6 +2047,7 @@ ErrorCodeEnum init_shell_byHttp(sp_dir_t* dir, sp_cfg_shell_ini_t* shell, sp_cfg
 
 	//init entity arr,去除以;开头的实体
 	std::map<std::string, std::string> entityArr = clearUnExistConfig(shellConfig[SHELL_ENTITY_HEAD]);
+	//TODO: CrossPlaform  [Gifur@2025730]
 #ifdef _WIN32
 	CSimpleStringA sectionNameWithType = CSimpleStringA::Format("%s_%s", SHELL_ENTITY_HEAD, root->machine_type);
 #else

+ 1 - 0
Framework/spbase/sp_dir.c

@@ -360,6 +360,7 @@ int sp_dir_inner_get_content(const char* file, char* ver)
 		n = fread(szTemp, 1, 256, pFile);
 		fclose(pFile);
 		memset(ver, 0, SP_MAX_VER_LEN);
+		//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 		strncpy_s(ver, SP_MAX_VER_LEN, szTemp, _TRUNCATE);
 #else

+ 0 - 1
Framework/spbase/sp_gui.cpp

@@ -10,7 +10,6 @@
 #include "resource1.h"
 #include <atlbase.h>
 #include <gdiplus.h>
-#pragma comment(lib,"gdiplus")
 using namespace Gdiplus;
 
 #include "resource1.h"

+ 1 - 0
Framework/spbase/sp_logwithlink.cpp

@@ -614,6 +614,7 @@ SPBASE_API void* create_log_producer_storage(CSimpleStringA entityName, CSimpleS
 {
     WLog_DBG(TAG, "create log producer storage for %s, %s, %s", entityName.GetData(), item.GetData(), filePath.GetData());
     log_producer_config* config = create_log_producer_config();
+    //TODO: CrossPlaform  [Gifur@2025730]
 #ifdef _WIN32
     std::string t_entityName = toLowerCase(entityName.GetData());
 #else

+ 1 - 1
Module/include/CommEntityUtil.hpp

@@ -821,7 +821,7 @@ namespace FileSystem {
 	static DWORD FetchFileSize(const char* filePath)
 	{
 		int fileSize = 0;
-#if defined(RVC_OS_LINUX)
+#ifdef RVC_OS_LINUX
 		struct stat statbuf;
 		ZeroMemory(&statbuf, sizeof(statbuf));
 		stat(filePath, &statbuf);

+ 1 - 5
Module/include/DevFSMCommBase.hpp

@@ -17,14 +17,10 @@
 
 #if defined(_MSC_VER)
 #pragma comment(lib, "Version.lib")
-typedef ErrorCodeEnum(*DevAdaptObjCreateFunc)(DeviceBaseClass*& baseObj);
-typedef ErrorCodeEnum(*DevAdaptObjReleaseFunc)(DeviceBaseClass*& pBaseObj);
-typedef void(*GetPrefixErrMsgFunc)(char* szErrMsg, DWORD* pMsgLen);
-#else //C/C++ Compiler 
+#endif //_MSC_VER
 using DevAdaptObjCreateFunc = ErrorCodeEnum(*)(DeviceBaseClass*& pOutDevAptObj);
 using DevAdaptObjReleaseFunc = ErrorCodeEnum(*)(DeviceBaseClass*& pInDevAptObj);
 using GetPrefixErrMsgFunc = void(*)(char* szErrMsg, DWORD* pMsgLen);
-#endif //_MSC_VER
 typedef ErrorCodeEnum(*GetDevAdapterVersionFunc)(DevSoftVersion& retVersion);
 
 #define HARDWARE_ENTITY_RESET_ENTITYID(ent, entityID)	\

+ 6 - 9
Module/mod_ResourceWatcher/ResourceWatcherFSM.cpp

@@ -53,9 +53,13 @@
 #define PROCESS_ITEM 14 //进程CPU信息读取位置参数
 const int MAX_MAINLINK_CHECK_TIME = 5000;
 const int TIMER_MAINLINK_CHECK = 4;
+#define SECNAME_SFINSTALL "SoftwareInstallDetect%d"
 #else
 const int MILLION = 1048576;
+#define SECNAME_SFINSTALL "SoftwareInstallDetectWIN%d"
+#define ENCODING (X509_ASN_ENCODING | PKCS_7_ASN_ENCODING)
 #endif // RVC_OS_LINUX
+
 static int hardwareCheckTime = 60 * 1000;  //初始化硬件检测间隔
 static int hardwareCheckFlag = 1;
 static int cpuWarnTime = 0;
@@ -66,9 +70,6 @@ static int diskCheckTime = 4 * 60 * 60 * 1000; //初始化硬盘检测间隔
 static int diskCheckFlag = 1;
 
 #define MAX_SOFTWARE_INSTALLED_DETECT_COUNT 50
-#ifndef RVC_OS_LINUX
-#define ENCODING (X509_ASN_ENCODING | PKCS_7_ASN_ENCODING) 
-#endif // !RVC_OS_LINUX
 #define STARTUP_DIR_FULL_PATH "C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp"
 #ifdef DEVOPS_ON_ST /*DevOps流水线编译,ST环境*/
 const char* CMB_LINK_FILE_NAME = "招商银行可视柜台(ST测试).lnk";
@@ -1213,7 +1214,7 @@ ErrorCodeEnum ResourceWatcherFSM::GetBizLinks(
     return ec;
 }
 
-#ifdef _MSC_VER
+#ifdef RVC_OS_WIN
 ErrorCodeEnum ResourceWatcherFSM::CreateLinkFile(const CSimpleStringA& szStartAppPath, const CSimpleStringA& szAddCmdLine,
     const CSimpleStringA& szDestLnkPath, const CSimpleStringA& szIconPath)
 {
@@ -4146,11 +4147,7 @@ void ResourceWatcherFSM::DetectSoftwareInstallStatus()
 	for (int i = 0; i < MAX_SOFTWARE_INSTALLED_DETECT_COUNT; i++) {
 		strSoftwaresNames[i] = "";
 		strSoftwaresVers[i] = "";
-#if defined(RVC_OS_LINUX)
-        CSimpleStringA item = CSimpleStringA::Format("SoftwareInstallDetect%d", i);
-#else
-        CSimpleStringA item = CSimpleStringA::Format("SoftwareInstallDetectWIN%d", i);
-#endif //RVC_OS_LINUX
+        CSimpleStringA item = CSimpleStringA::Format(SECNAME_SFINSTALL, i);
 		CSimpleStringA value(true);
 		spCtSettingConfig->ReadConfigValue(GetEntityBase()->GetEntityName(), item, value);
 		if (value.IsNullOrEmpty()) {

+ 0 - 3
Module/mod_ResourceWatcher/ResourceWatcherFSM.h

@@ -33,11 +33,8 @@
 #include <conio.h>
 #include "mbnapi.h"
 #include <comdef.h>
-#pragma comment(lib, "ws2_32.lib")
-#pragma comment(lib, "mbnapi_uuid.lib")
 #include "ResourceWatcher_UserCode.h"
 #include <time.h>
-#pragma comment(lib, "Gdi32.lib")
 #endif //RVC_OS_LINUX
 
 using namespace std;

+ 4 - 2
Module/mod_ResourceWatcher/mod_ResourceWatcher.cpp

@@ -134,7 +134,7 @@ struct SogouRunVersionInfo
         }
         return installVer;
     }
-
+    //TODO: CrossPlaform  [Gifur@2025730]
     //true: 普通调用版本输入法,false: SDK版本输入法
     bool IsTSFVersion()
     {
@@ -474,6 +474,7 @@ void ResourceWatcherEntity::InstallThirdPartyProgram(SpReqAnsContext<ResourceWat
 
     }
     else if (ctx->Req.type == 2) {//安装花了钱的字体
+        //TODO: 移除  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
         tmpResult = Error_NotSupport;
 #else
@@ -823,6 +824,7 @@ void ResourceWatcherEntity::ChcekDiskFileSpace()
     }
 }
 
+//TODO: CrossPlaform 看是否转移到框架toolkit,太常用了  [Gifur@2025730]
 BOOL ResourceWatcherEntity::KillProcessFromName(const CSimpleStringA& strProcessName)
 {
 
@@ -904,7 +906,7 @@ ErrorCodeEnum ResourceWatcherEntity::GetSogouPkgDirPath(CSimpleStringA& strPkgPa
 }
 #endif //RVC_OS_LINUX
 
-
+//TODO: CrossPlaform  [Gifur@2025730]
 ErrorCodeEnum ResourceWatcherEntity::RunShellScript(LPCTSTR cmdline)
 {
 #if defined(RVC_OS_WIN)

+ 9 - 6
Module/mod_ResourceWatcher/mod_ResourceWatcher.h

@@ -11,7 +11,14 @@ class ResourceWatcherEntity;
 #define ENT_TIMERID_PROCESS_CHECK 66
 #define ENT_TIMERINTERVAL_PROCESS_CHECK 60 * 60 * 1000  //进程检测间隔默认一小时
 
-#define ENCODING (X509_ASN_ENCODING | PKCS_7_ASN_ENCODING)  
+#define ENCODING (X509_ASN_ENCODING | PKCS_7_ASN_ENCODING)
+#if defined(RVC_OS_WIN)
+#define SECNAME_PROCESSDETECT "ProcDetectFlag"
+#else
+#define SECNAME_PROCESSDETECT "ProcDetectFlag4UOS"
+
+	
+#endif //RVC_OS_WIN
 
 const int AbsolutePath = 0;
 const int AudioDefaultPath = 1; 
@@ -111,11 +118,7 @@ public:
 
 		int procFlag = 0;
 		int closeSecCheck = 0;
-#if defined(RVC_OS_WIN)
-		spCtSettingConfig->ReadConfigValueInt("ResourceWatcher", "ProcDetectFlag", procFlag);
-#else
-		spCtSettingConfig->ReadConfigValueInt("ResourceWatcher", "ProcDetectFlag4UOS", procFlag);
-#endif //RVC_OS_WIN
+		spCtSettingConfig->ReadConfigValueInt("ResourceWatcher", SECNAME_PROCESSDETECT, procFlag);
 		if (procFlag > 0)
 		{
 			CheckProcessStatus(); //启动时检测一次进程

+ 3 - 0
Module/mod_assistantchannel/chan_protocol.h

@@ -53,6 +53,7 @@ typedef struct acm_hdr {
 	unsigned char encrypt : 1;
 	unsigned char error : 7;
 	unsigned short sub_type;
+	//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	unsigned long length; // 需要注意的是长度最大为2^16-1,65535
 	unsigned long id; // 包id
@@ -72,6 +73,7 @@ typedef struct proxy_hdr {
 	unsigned int rtp_port; // 视频rtp端口
 	int media_desc; // 媒体描述
 	char client_id[20]; // 用户身份证号码,用与视频面签
+	//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	unsigned long encrypt_keyhash; // 加密key hash code
 #else
@@ -85,6 +87,7 @@ typedef struct proxy_ack_hdr {
 	unsigned int rtp_port; // 视频rtp端口
 	int media_desc; // 媒体描述
 	char client_id[20]; // peer request client_id
+	//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	unsigned long encrypt_keyhash; // 加密key hash code
 #else

+ 2 - 0
Module/mod_assistantchannel/mod_assistantchannel.cpp

@@ -69,6 +69,7 @@ static void __on_destroy(bizchan_t *chan, void *user_data)
 static void __dbg(void *user_data, const char *fmt, va_list arg)
 {
 	//vDbg(fmt, arg);
+	//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	int n = _vscprintf(fmt, arg);
 #else
@@ -82,6 +83,7 @@ static void __dbg(void *user_data, const char *fmt, va_list arg)
 	}
 	else {
 		char strlog[MAX_PATH] = { 0 };
+		//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 		_vsnprintf(strlog, MAX_PATH, fmt, arg);
 #else

+ 1 - 0
Module/mod_chromium/CModTools.cpp

@@ -1150,6 +1150,7 @@ namespace Chromium {
 			CSimpleString runningVer = "";
 			m_pEntity->GetFunction()->GetRunningVersion(runningVer);
 			dstInstallUrl.append("?terminalVersion=").append(runningVer.GetData());
+			//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_LINUX)
 			auto replaceAll = [](std::string& str, const std::string& search, const std::string& replace) {
 				size_t pos = 0;

+ 0 - 2
Module/mod_chromium/CSocketClient.cpp

@@ -12,8 +12,6 @@
 #if defined(RVC_OS_LINUX)
 #include <RestfulFunc.h>
 #endif
-#pragma comment(lib, "libpublicFun.lib")
-
 using boost::asio::ip::tcp;
 
 #define DEFAULT_RCEV_LENGTH 1024*512

+ 2 - 0
Module/mod_chromium/mod_chromium.cpp

@@ -533,6 +533,7 @@ namespace Chromium {
 		LogManager::getInstance().logEntityStageChange("OnPreStart_register", 0, "begin");
 		ErrorCodeEnum Error;
 
+		//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_LINUX)
         Error = GetFunction()->SubscribeLog(m_uuidAllFault, this, Log_Notify, Severity_High, Error_IgnoreAll, -2, NULL, false);
         if (Error_Succeed != Error) {
@@ -790,6 +791,7 @@ namespace Chromium {
 					return false;
 				}
 				path = csHardwareCfg + SPLIT_SLASH_STR + "root.ini";
+				//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 				if (_access(path.GetData(), 0) == 0) {
 #else

+ 2 - 0
Module/mod_counterconnector/ConnectorFSM.cpp

@@ -392,6 +392,7 @@ static int CStringSplit(char* str, char** result, size_t ucount, const char* del
 {
 	char* ptr = NULL;
 	size_t unum = ucount;
+	//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	char* p = strtok_s(str, del, &ptr);
 	while (p != NULL && unum > 0) {
@@ -437,6 +438,7 @@ static int GetCallInfoFromConfig(char* strcallurl, uint32_t ucalllen, char* stra
 #if defined(RVC_OS_LINUX)
 namespace
 {
+	//TODO: CrossPlaform  [Gifur@2025730]
 	char* _ultoa(unsigned long value, char* pstring, int radix)
 	{
 		char tmp[33] = { 0 };

+ 1 - 1
Module/mod_counterconnector/strutil.cpp

@@ -51,7 +51,7 @@ int fifter_string(char*pbuf, size_t usize, const char* psrc, const char cflag)
 
 	return ret;
 }
-
+//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(_MSC_VER)
 #else
 /*无符号长整形转字符型*/

+ 1 - 1
Module/mod_guiconsole/mod_guiconsole.cpp

@@ -1268,7 +1268,7 @@ int CGUIConsoleEntity::sync_OpenLog(const char* entity_name, void* pData)
 		
 
 	// 使用记事本打开文件
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 	// Windows 上使用 ShellExecute 打开文件
 	std::string command = std::string("notepad.exe ") + cur.strLogPath.GetData();
 	openProcess(command);

+ 1 - 1
Module/mod_healthmanager/CMakeLists.txt

@@ -53,7 +53,7 @@ target_link_directories(${MODULE_NAME} PRIVATE
 # 添加实体需要依赖的其他共享库(包括系统库)
 set(${MODULE_PREFIX}_SYSLIBS libpublicFun)
 if(MSVC)
-	list(APPEND ${MODULE_PREFIX}_SYSLIBS Ws2_32 IPHLPAPI)
+	list(APPEND ${MODULE_PREFIX}_SYSLIBS Ws2_32 IPHLPAPI User32 advapi32)
 endif(MSVC)
 set(${MODULE_PREFIX}_LIBS RestfulFunc ${CONAN_PKG_LIBS_JSONCPP})
 target_link_libraries(${MODULE_NAME} ${MODULE_BASE_LIBS} ${${MODULE_PREFIX}_LIBS} ${${MODULE_PREFIX}_SYSLIBS})

+ 2 - 3
Module/mod_healthmanager/HealthManagerFSM.cpp

@@ -12,8 +12,6 @@
 #include <Winsock2.h>
 #include <io.h>
 #include "CSystemStatus.h"
-#pragma comment(lib, "IPHLPAPI.lib")
-#pragma comment(lib, "libpublicFun.lib")
 #else
 #include <unistd.h>
 #include <fcntl.h>
@@ -29,7 +27,7 @@ using namespace std;
 const int MAX_AYSNC_TIMEOUT = 60000;
 const int MAX_IGNORE_TIMEOUT = 100;
 
-
+//TODO: CrossPlaform  [Gifur@2025730]
 unsigned long long GetLastErrorRVC() {
 #if defined(RVC_OS_WIN)
 	return GetLastError();
@@ -848,6 +846,7 @@ bool CHealthManagerFSM::IfInUpgradeProcess()
 	ErrorCodeEnum eErr = GetEntityBase()->GetFunction()->GetPath("RunCfg", csRunCfgPath);
 	csFileName = csRunCfgPath + SPLIT_SLASH_STR + "starttime.dat";
 	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("csFileName:%s", csFileName.GetData());
+	//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	if (_access((const char*)csFileName, 0) == 0) {
 #else

+ 9 - 13
Module/mod_healthmanager/mod_healthmanager.cpp

@@ -9,13 +9,10 @@
 #include <ws2tcpip.h>
 #include <Winsock2.h>
 #include <io.h>
-#pragma comment( lib, "User32.lib" )
-#pragma comment( lib, "advapi32.lib" )
-#pragma comment(lib, "IPHLPAPI.lib")
 #include "..\mod_chromium\Chromium_client_g.h" //启动浏览器接口
 using namespace Chromium;
 #include <WinUser.h>
-
+#define GUARDIAN_FILENAME "GuardianBase.dll"
 #else
 #include <sys/wait.h> 
 #include <unistd.h>
@@ -26,6 +23,7 @@ using namespace Chromium;
 #include <sys/reboot.h>
 #include "../mod_chromium/Chromium_client_g.h" //启动浏览器接口
 using namespace Chromium;
+#define GUARDIAN_FILENAME "libGuardianBase.so"
 #endif //RVC_OS_WIN
 
 #include <vector>
@@ -37,6 +35,7 @@ using namespace Chromium;
 #include "iniutil.h"
 #include "osutil.h"
 
+//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_LINUX)
 #include "EntityBootStruct.h"
 #include <regex.h>
@@ -52,10 +51,6 @@ using namespace std;
 #include "CommEntitySettings.hpp"
 #include "TerminalInfoQueryConn.h"
 
-
-
-
-
 const DWORD HEALTHMANAGER_TIMER_ID = 1;
 const DWORD HEALTHMANAGER_WAIT_MAINPAGE_OPEN_TIMER_ID = 2;
 const DWORD HEALTHMANAGER_SELFCHECK_TIMER_ID = 3;
@@ -816,11 +811,9 @@ bool CHealthManagerEntity::DoRestart()
 		DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("get bin path failed(%s).", SpStrError(err));
 		return false;
 	}
-#if defined(RVC_OS_WIN)
-	deamonBasePath += "\\GuardianBase.dll";
-#else
-	deamonBasePath += "/libGuardianBase.so";
-#endif
+	deamonBasePath += SPLIT_SLASH_STR;
+	deamonBasePath += GUARDIAN_FILENAME;
+
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("to check if in upgrade process");
 	if (m_fsm.IfInUpgradeProcess() && !m_versionEx.IsNullOrEmpty())
 	{
@@ -835,6 +828,7 @@ bool CHealthManagerEntity::DoRestart()
 		}
 		
 	}
+	//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("guardian file path [%s]", deamonBasePath.GetData());
 	HMODULE hDll = LoadLibraryA(deamonBasePath);
@@ -912,6 +906,7 @@ bool CHealthManagerEntity::SaveCurrentVersion()
 		DbgWithLink(LOG_LEVEL_ERROR,LOG_TYPE_SYSTEM)("get runinfo path failed(%s)", SpStrError(eErr));
 		return false;
 	}
+	//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	csBakFile = csRunInfo + "\\runcfg\\version.dat";
 #else
@@ -951,6 +946,7 @@ bool CHealthManagerEntity::SaveFrameStartTimeForUpgrade()
 		DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("get runinfo path failed(%s)", SpStrError(eErr));
 		return false;
 	}
+	//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	csBakFile = csRunInfo + "\\runcfg\\starttime.dat";
 #else

+ 1 - 1
Module/mod_interactivecontrol/mod_interactivecontrol.cpp

@@ -1630,7 +1630,7 @@ void CITCtrlEntity::OnFaceTrackingMsg(const char* pszFaceTrackingMsg)
 	CSimpleStringA strValue;
 	GetFunction()->GetSysVar("ActiveTrackingCamera", strValue); // E or O
 	CSimpleStringA strMsg = CSimpleStringA::Format("[%s] ", strValue.GetData());
-#ifdef _WIN32
+#ifdef RVC_OS_WIN
 	SYSTEMTIME nowTime;                             // 系统时间结构体
 	GetLocalTime(&nowTime);
 	_snprintf(strTime, MAX_PATH, "(%02d:%02d:%02d)", nowTime.wHour, nowTime.wMinute, nowTime.wSecond);

+ 1 - 0
Module/mod_sipphone/mod_sipphone.h

@@ -56,6 +56,7 @@ using namespace AssistantChannel;
 #define RVC_ENTER_HOME_PAGE_TIMER 3
 #endif
 
+//TODO: CrossPlaform  [Gifur@2025730]
 #ifndef rvc_vsnprintf
 #ifdef _WIN32
 #define rvc_vsnprintf _vsnprintf

+ 3 - 0
Module/mod_vtmloader/VtmLoaderFSM.cpp

@@ -1697,6 +1697,7 @@ bool CVtmLoaderFSM::IsRootINIExist(CSimpleStringA& path)
 		return false;
 	}
 	path = csHardwareCfg + SPLIT_SLASH_STR + "root.ini";
+	//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	if (_access(path.GetData(), 0) == 0) {
 #else
@@ -2930,6 +2931,7 @@ bool CVtmLoaderFSM::CheckIfNeedCopyDepFiles()
 		return false;
 	}
 	csPath = csRun + SPLIT_SLASH_STR + "dep" + SPLIT_SLASH_STR + "depver.txt";
+	//TODO: CrossPlaform  [Gifur@2025730]
 #if defined(RVC_OS_WIN)
 	if (_access(csPath.GetData(), 0) == 0) {
 #else
@@ -3064,6 +3066,7 @@ void CVtmLoaderFSM::DoSpecialJobInTestRoom()
 
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("write version [%s] succeed", csSwitchVerTo.GetData());
 
+		//TODO: CrossPlaform 抽成一个宏方便一点  [Gifur@2025730]
 #if defined(RVC_OS_LINUX)
 		if (bSetSucc) {
 			mode_t f_attrib = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH | S_IWOTH;

+ 1 - 7
Tool/guardian/guardian.cpp

@@ -425,13 +425,7 @@ inline static std::vector<std::string> Split(std::string str, char splitElem)
 
 static bool IsSpPathType(const std::string& value)
 {
-
-#if defined(RVC_OS_WIN)
-    const int leastLength = strlen("C:\\version\\1.0.0.0\\");
-#else
-    const int leastLength = strlen("Run/version/1.0.0.0/");
-#endif //RVC_OS_WIN
-
+	const int leastLength = strlen("Run/version/1.0.0.0/");
 	std::string path(value.c_str());
     if (path.empty() || path.size() < leastLength) return false;
 	const std::size_t sionPos = path.find("version");