This commit is contained in:
love-code-yeyixiao 2024-06-01 10:22:43 +08:00
parent af4f3e7216
commit 5eb32ee934
1 changed files with 7 additions and 8 deletions

View File

@ -335,11 +335,8 @@ _FX void SysInfo_DiscardProcesses(SYSTEM_PROCESS_INFORMATION *buf)
if (next == curr)
break;
SbieApi_QueryProcess(next->UniqueProcessId, boxname, NULL, tempSid, &tempSession);
DWORD currentSession = tempSession;
HANDLE token1;
Terminal_WTSQueryUserToken(currentSession, &token1);
BOOL hideProcess = FALSE;
if(!Sysinfo_IsTokenAnySid(token1, L"S-1-5-18")&& !Sysinfo_IsTokenAnySid(token1, L"S-1-5-80")&& !Sysinfo_IsTokenAnySid(token1, L"S-1-5-20")&& !Sysinfo_IsTokenAnySid(token1, L"S-1-5-6")&& SbieApi_QueryConfBool(NULL, L"HideNonSystemProcess", FALSE)) {
if(_wcsicmp(tempSid, L"S-1-5-18") != 0 && _wcsicmp(tempSid, L"S-1-5-80") != 0 && _wcsicmp(tempSid, L"S-1-5-20") != 0 && !_wcsicmp(tempSid, L"S-1-5-6") == 0 && SbieApi_QueryConfBool(NULL, L"HideNonSystemProcess", FALSE)) {
hideProcess = TRUE;
}
else
@ -357,10 +354,12 @@ _FX void SysInfo_DiscardProcesses(SYSTEM_PROCESS_INFORMATION *buf)
break;
}
}
}else
if (_wcsnicmp(imagename, L"Sandboxie", 9) == 0 || _wcsnicmp(imagename, L"Sbie", 4) == 0) {
if (SbieApi_QueryConfBool(NULL, L"HideSbieProcess", FALSE))
hideProcess = TRUE;
}
if (!hideProcess) {
if (_wcsnicmp(imagename, L"Sandboxie", 9) == 0 || _wcsnicmp(imagename, L"Sbie", 4) == 0) {
if (SbieApi_QueryConfBool(NULL, L"HideSbieProcess", FALSE))
hideProcess = TRUE;
}
}
}