|
@@ -1815,6 +1815,8 @@ ErrorCodeEnum ResourceWatcherFSM::ChangeAutoStartupWithExe(bool resetVBS, bool r
|
|
|
{
|
|
|
result = GetEntityBase()->GetFunction()->GetPath("RootVer", exePath);
|
|
|
if (exePath.IsNullOrEmpty() || result != Error_Succeed) {
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA5A09").setAPI("ChangeAutoStartupWithExe")
|
|
|
+ ("Get RootVer path failed: %d", result);
|
|
|
LogWarn(Severity_Middle, Error_Unexpect, LOG_WARN_UPDATE_AUTO_STARTUP_WITH_EXE_FAILED
|
|
|
, CSimpleStringA::Format("Get RootVer path failed: %d", result));
|
|
|
return Error_Unexpect;
|
|
@@ -1825,6 +1827,8 @@ ErrorCodeEnum ResourceWatcherFSM::ChangeAutoStartupWithExe(bool resetVBS, bool r
|
|
|
exePath.Append("\\spexplorerfast.vbs");
|
|
|
|
|
|
if (!ExistsFileA(exePath)) {
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA5A09").setAPI("ChangeAutoStartupWithExe")
|
|
|
+ ("[%s] is not existed!", exePath.GetData());
|
|
|
LogWarn(Severity_Middle, Error_Unexpect, LOG_WARN_UPDATE_AUTO_STARTUP_WITH_EXE_FAILED
|
|
|
, CSimpleStringA::Format("[%s] is not existed!", exePath.GetData()));
|
|
|
return Error_NotExist;
|
|
@@ -1847,6 +1851,8 @@ ErrorCodeEnum ResourceWatcherFSM::ChangeAutoStartupWithExe(bool resetVBS, bool r
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA5A09").setAPI("ChangeAutoStartupWithExe")
|
|
|
+ ("RegSetValueExA for Shell with %s failed: %d", exePath.GetData(), lResult);
|
|
|
LogWarn(Severity_Middle, Error_Unexpect, LOG_WARN_UPDATE_AUTO_STARTUP_WITH_EXE_FAILED
|
|
|
, CSimpleStringA::Format("RegSetValueExA for Shell with %s failed: %d", exePath.GetData(), lResult));
|
|
|
result = Error_Unexpect;
|
|
@@ -1854,6 +1860,8 @@ ErrorCodeEnum ResourceWatcherFSM::ChangeAutoStartupWithExe(bool resetVBS, bool r
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA5A09").setAPI("ChangeAutoStartupWithExe")
|
|
|
+ ("RegOpenKeyEx for write %s failed: %d", exePath.GetData(), lResult);
|
|
|
LogWarn(Severity_Middle, Error_Unexpect, LOG_WARN_UPDATE_AUTO_STARTUP_WITH_EXE_FAILED
|
|
|
, CSimpleStringA::Format("RegOpenKeyEx for write %s failed: %d", exePath.GetData(), lResult));
|
|
|
result = Error_Unexpect;
|
|
@@ -1941,7 +1949,9 @@ void ResourceWatcherFSM::DetectVersionHasChangedAndWarn()
|
|
|
GetEntityBase()->GetFunction()->GetPath("RootVer", rootVerPath);
|
|
|
CSimpleStringA csPath = rootVerPath + "\\active.txt";
|
|
|
if (!ExistsFileA(csPath)) {
|
|
|
- LogWarn(Severity_Low, Error_Debug, LOG_WARN_ACTIVE_FILE_CHANGE, CSimpleStringA::Format("%s: active.txt not exist!", warnInfo.GetData()));
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA5A0A").setAPI("DetectVersionHasChangedAndWarn")
|
|
|
+ ("%s: active.txt not exist!", warnInfo.GetData());
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_WARN_ACTIVE_FILE_CHANGE, CSimpleStringA::Format("%s: active.txt not exist!", warnInfo.GetData()));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1955,7 +1965,9 @@ void ResourceWatcherFSM::DetectVersionHasChangedAndWarn()
|
|
|
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS,
|
|
|
NULL);
|
|
|
if (hFile == INVALID_HANDLE_VALUE) {
|
|
|
- LogWarn(Severity_Low, Error_Debug, LOG_WARN_ACTIVE_FILE_CHANGE, CSimpleStringA::Format("%s: active.txt open failed %u", warnInfo.GetData(), GetLastError()));
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA5A0A").setAPI("DetectVersionHasChangedAndWarn")
|
|
|
+ ("%s: active.txt open failed %u", warnInfo.GetData(), GetLastError());
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_WARN_ACTIVE_FILE_CHANGE, CSimpleStringA::Format("%s: active.txt open failed %u", warnInfo.GetData(), GetLastError()));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1968,7 +1980,9 @@ void ResourceWatcherFSM::DetectVersionHasChangedAndWarn()
|
|
|
GetTimeFormatStr(szFormat2, 128, (FILETIME*)&activeFileInfo.mftAccess);
|
|
|
char szFormat3[128] = { 0 };
|
|
|
GetTimeFormatStr(szFormat3, 128, (FILETIME*)&activeFileInfo.mftModified);
|
|
|
- LogWarn(Severity_Low, Error_Debug, LOG_WARN_ACTIVE_FILE_CHANGE, CSimpleStringA::Format(
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setResultCode("RTA5A0A").setAPI("DetectVersionHasChangedAndWarn")
|
|
|
+ ("%s: active.txt create at %s, access at %s, modified at %s", warnInfo.GetData(), szFormat1, szFormat2, szFormat3);
|
|
|
+ LogWarn(Severity_Middle, Error_Debug, LOG_WARN_ACTIVE_FILE_CHANGE, CSimpleStringA::Format(
|
|
|
"%s: active.txt create at %s, access at %s, modified at %s", warnInfo.GetData(), szFormat1, szFormat2, szFormat3));
|
|
|
}
|
|
|
}
|