Skip to content

Commit 1b0a38d

Browse files
authored
Update SandMan.cpp
1 parent 291e55b commit 1b0a38d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

SandboxiePlus/SandMan/SandMan.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,12 +1221,13 @@ SB_STATUS CSandMan::ConnectSbieImpl()
12211221
{
12221222
SB_STATUS Status = theAPI->Connect(theConf->GetBool("Options/UseInteractiveQueue", true));
12231223

1224-
if (Status.GetStatus() == 0xC0000038L /*STATUS_DEVICE_ALREADY_ATTACHED*/) {
1225-
OnLogMessage(tr("CAUTION: Another agent (probably SbieCtrl.exe) is already managing this Sandboxie session, please close it first and reconnect to take over."));
1226-
return SB_OK;
1227-
}
1224+
if (Status && !CSbieAPI::IsSbieCtrlRunning()) // don't take over when SbieCtrl is up and running
1225+
Status = theAPI->TakeOver();
12281226

1229-
return Status;
1227+
if (!Status)
1228+
return Status;
1229+
1230+
return SB_OK;
12301231
}
12311232

12321233
SB_STATUS CSandMan::DisconnectSbie()

0 commit comments

Comments
 (0)