From d6fcbd94e960c4a07346e3d84b6898386727e186 Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Mon, 13 Mar 2023 20:49:27 +0100 Subject: [PATCH] 1.8.1 --- SandboxiePlus/SandMan/Models/SbieModel.cpp | 8 +++++++- SandboxiePlus/SandMan/SbieProcess.cpp | 15 ++------------- SandboxiePlus/SandMan/SbieProcess.h | 1 - 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/SandboxiePlus/SandMan/Models/SbieModel.cpp b/SandboxiePlus/SandMan/Models/SbieModel.cpp index 4cb806cd..619fcaad 100644 --- a/SandboxiePlus/SandMan/Models/SbieModel.cpp +++ b/SandboxiePlus/SandMan/Models/SbieModel.cpp @@ -404,7 +404,13 @@ bool CSbieModel::Sync(const CSandBoxPtr& pBox, const QList& Path, cons QVariant Value; switch (section) { - case eName: Value = pProcess->GetProcessName(); break; + case eName: { + QString Name = pProcess->GetProcessName(); + if (pProcess->IsWoW64()) + Name += " *32"; + Value = Name; + break; + } case eProcessId: Value = pProcess->GetProcessId(); break; case eStatus: Value = pProcess->GetStatusStr(); break; case eTitle: Value = theAPI->GetProcessTitle(pProcess->GetProcessId()); break; diff --git a/SandboxiePlus/SandMan/SbieProcess.cpp b/SandboxiePlus/SandMan/SbieProcess.cpp index 0d23c466..1afe1801 100644 --- a/SandboxiePlus/SandMan/SbieProcess.cpp +++ b/SandboxiePlus/SandMan/SbieProcess.cpp @@ -91,15 +91,6 @@ QString CSbieProcess::ImageTypeToStr(quint32 type) } } - -QString CSbieProcess::GetProcessName() const -{ - QString Name = CBoxedProcess::GetProcessName(); - if (m_bIsWoW64) - Name += " *32"; - return Name; -} - QString CSbieProcess::GetStatusStr() const { QString Status; @@ -138,11 +129,9 @@ void CSbieProcess::InitProcessInfoImpl(void* ProcessHandle) { CBoxedProcess::InitProcessInfoImpl(ProcessHandle); - HANDLE TokenHandle = NULL; - if(m_pBox->GetBool("NoSecurityIsolation") || m_pBox->GetBool("OriginalToken")) + HANDLE TokenHandle = (HANDLE)m_pBox->Api()->QueryProcessInfo(m_ProcessId, 'ptok'); + if (!TokenHandle) NtOpenProcessToken(ProcessHandle, TOKEN_QUERY, &TokenHandle); - else - TokenHandle = (HANDLE)m_pBox->Api()->QueryProcessInfo(m_ProcessId, 'ptok'); if (TokenHandle) { ULONG returnLength; diff --git a/SandboxiePlus/SandMan/SbieProcess.h b/SandboxiePlus/SandMan/SbieProcess.h index 96907324..ac45cc76 100644 --- a/SandboxiePlus/SandMan/SbieProcess.h +++ b/SandboxiePlus/SandMan/SbieProcess.h @@ -8,7 +8,6 @@ class CSbieProcess : public CBoxedProcess public: CSbieProcess(quint32 ProcessId, class CSandBox* pBox); - virtual QString GetProcessName() const; virtual QString GetStatusStr() const; virtual void BlockProgram() { GetBox()->BlockProgram(m_ImageName); }