Skip to content

Commit

Permalink
Update BoxedProcess.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Nov 26, 2023
1 parent 4f8086d commit 20217b7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ SB_STATUS CBoxedProcess::SetSuspend(bool bSet)

bool CBoxedProcess::TestSuspended()
{
bool isSuspended = true;
int iSuspended = 0;
int iRunning = 0;

for (HANDLE hThread = NULL;;)
{
Expand All @@ -379,15 +380,14 @@ bool CBoxedProcess::TestSuspended()
SuspendCount = SuspendThread(hThread);
ResumeThread(hThread);
}
if (SuspendCount == 0) {
isSuspended = false;
NtClose(hThread);
break;
}
if (SuspendCount > 0)
iSuspended++;
else
iRunning++;
}

m_bSuspended = isSuspended;
return isSuspended;
m_bSuspended = iSuspended > 0 && iRunning == 0;
return m_bSuspended;
}

void CBoxedProcess::ResolveSymbols(const QVector<quint64>& Addresses)
Expand Down

0 comments on commit 20217b7

Please sign in to comment.