From 5eb32ee9344a6298e5331745e4912bbd59d796f7 Mon Sep 17 00:00:00 2001 From: love-code-yeyixiao <188240888@qq.com> Date: Sat, 1 Jun 2024 10:22:43 +0800 Subject: [PATCH] Fix --- Sandboxie/core/dll/sysinfo.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Sandboxie/core/dll/sysinfo.c b/Sandboxie/core/dll/sysinfo.c index b8d62235..e2255fb4 100644 --- a/Sandboxie/core/dll/sysinfo.c +++ b/Sandboxie/core/dll/sysinfo.c @@ -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; + } } }