Skip to content

Commit

Permalink
1.12.6
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidXanatos committed Dec 22, 2023
1 parent dd37fc3 commit 8854fdb
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- fixed "The directory name is invalid" when starting a process in a encrypted private box [#3475](https://github.com/sandboxie-plus/Sandboxie/issues/3475)
- fixed symbolic links created inside a sandbox not working properly [#3181](https://github.com/sandboxie-plus/Sandboxie/issues/3181)
- fixed issue with drives mounted to multiple fodlers or a drive lettet and a folder
- fixed issue with file paths when using boxes a with relocated root (e.g. to an ImDisk volume)
- fixed issue with file paths when using boxes a with relocated root (e.g. to an ImDisk volume) [#3506](https://github.com/sandboxie-plus/Sandboxie/issues/3506)
- fixed issue with explorer on windows 11 when usign SysCallLockDown=y [#3516](https://github.com/sandboxie-plus/Sandboxie/issues/3516)
- fixed sandman not showing icons of processes located on a ImDisk volume



Expand Down
3 changes: 3 additions & 0 deletions SandboxiePlus/QSbieAPI/Sandboxie/BoxedProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ bool CBoxedProcess::InitProcessInfo()
SB_STATUS Status = m_pBox->Api()->GetProcessInfo(m_ProcessId, &m_ParendPID, &m_ProcessInfo.Flags, &m_bSuspended,
&m_ImagePath, &m_CommandLine, &m_WorkingDir);

if (m_ImagePath.left(8) == "\\Device\\" && m_ImagePath.left(m_pBox->m_FileRePath.length()).compare(m_pBox->m_FileRePath, Qt::CaseInsensitive) == 0)
m_ImagePath = m_pBox->m_FilePath + m_ImagePath.mid(m_pBox->m_FileRePath.length());

return !Status.IsError();
}

Expand Down
17 changes: 17 additions & 0 deletions SandboxiePlus/QSbieAPI/Sandboxie/SandBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,23 @@ SB_STATUS CSandBox::SetSuspendedAll(bool bSuspended)
return m_pAPI->SetSuspendedAll(m_Name, bSuspended);
}

void CSandBox::OpenBox()
{
HANDLE hFile = CreateFileW((LPCWSTR)m_FilePath.utf16(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
WCHAR targetPath[MAX_PATH];
if(GetFinalPathNameByHandleW(hFile, targetPath, MAX_PATH, FILE_NAME_NORMALIZED | VOLUME_NAME_NT))
m_FileRePath = QString::fromWCharArray(targetPath);
CloseHandle(hFile);
}
}

void CSandBox::CloseBox()
{
m_FileRePath.clear();
}

bool CSandBox::IsEmpty() const
{
return !QFile::exists(m_FilePath);
Expand Down
6 changes: 4 additions & 2 deletions SandboxiePlus/QSbieAPI/Sandboxie/SandBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class QSBIEAPI_EXPORT CSandBox : public CSbieIni
virtual SB_STATUS TerminateAll();
virtual SB_STATUS SetSuspendedAll(bool bSuspended);

virtual void OpenBox() {}
virtual void CloseBox() {}
virtual void OpenBox();
virtual void CloseBox();

virtual bool IsEnabled() const { return m_IsEnabled; }

Expand Down Expand Up @@ -87,6 +87,7 @@ class QSBIEAPI_EXPORT CSandBox : public CSbieIni
class CSbieAPI* Api() { return m_pAPI; }

protected:
friend class CBoxedProcess;
friend class CSbieAPI;

SB_PROGRESS CleanBoxFolders(const QStringList& BoxFolders);
Expand All @@ -96,6 +97,7 @@ class QSBIEAPI_EXPORT CSandBox : public CSbieIni
static void MergeSnapshotAsync(const CSbieProgressPtr& pProgress, const QString& BoxPath, const QString& TargetID, const QString& SourceID, const QPair<const QString, class CSbieAPI*>& params);

QString m_FilePath;
QString m_FileRePath; // reparsed Nt path
QString m_RegPath;
QString m_IpcPath;
QString m_Mount;
Expand Down
8 changes: 4 additions & 4 deletions SandboxiePlus/QSbieAPI/SbieAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1541,11 +1541,11 @@ SB_STATUS CSbieAPI::UpdateBoxPaths(CSandBox* pSandBox)
if (!Status)
return Status;

QString FilePath = Nt2DosPath(QString::fromWCharArray(FileRoot.c_str(), wcslen(FileRoot.c_str())));
QString RegPath = QString::fromWCharArray(KeyRoot.c_str(), wcslen(KeyRoot.c_str()));
QString IpcPath = QString::fromWCharArray(IpcRoot.c_str(), wcslen(IpcRoot.c_str()));
QString FilePath = QString::fromWCharArray(FileRoot.c_str());
QString RegPath = QString::fromWCharArray(KeyRoot.c_str());
QString IpcPath = QString::fromWCharArray(IpcRoot.c_str());

pSandBox->SetBoxPaths(FilePath, RegPath, IpcPath);
pSandBox->SetBoxPaths(Nt2DosPath(FilePath), RegPath, IpcPath);
return SB_OK;
}

Expand Down

0 comments on commit 8854fdb

Please sign in to comment.