From 2641edd5cf54a932cdbe93c4ad5b01608c6d852b Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Mon, 24 Jul 2023 19:08:26 +0200 Subject: [PATCH] 1.10.1a --- CHANGELOG.md | 10 ++++++ Sandboxie/common/my_version.h | 4 +-- Sandboxie/core/dll/file_dir.c | 2 +- Sandboxie/core/dll/gui.c | 2 ++ Sandboxie/core/dll/gui_p.h | 6 ++++ Sandboxie/core/dll/guimisc.c | 36 ++++++++++++++++++- SandboxiePlus/SandMan/SbiePlusAPI.cpp | 1 + SandboxiePlus/SandMan/SbiePlusAPI.h | 1 + SandboxiePlus/SandMan/Views/SbieView.cpp | 9 ++++- SandboxiePlus/SandMan/Views/TraceView.cpp | 1 + .../SandMan/Windows/OptionsGeneral.cpp | 2 +- SandboxiePlus/version.h | 2 +- 12 files changed, 69 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9e16484..9b62c76d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ This project adheres to [Semantic Versioning](http://semver.org/). +## [1.10.2 / 5.65.2] - 2023-07-24 + +### Changed +- "OpenClipboard=n" now also denyes write to clipboard [#1367](https://github.com/sandboxie-plus/Sandboxie/issues/1367) + +### Fixed +- fixed issue with cross renaming of directories +- fixed issue with auto scroll not working +- fixed issue with link argumetn handling [#2969](https://github.com/sandboxie-plus/Sandboxie/issues/2969) + diff --git a/Sandboxie/common/my_version.h b/Sandboxie/common/my_version.h index 97e4f581..a7254fda 100644 --- a/Sandboxie/common/my_version.h +++ b/Sandboxie/common/my_version.h @@ -21,8 +21,8 @@ #ifndef _MY_VERSION_H #define _MY_VERSION_H -#define MY_VERSION_BINARY 5,65,1 -#define MY_VERSION_STRING "5.65.1" +#define MY_VERSION_BINARY 5,65,2 +#define MY_VERSION_STRING "5.65.2" #define MY_ABI_VERSION 0x56000 // These #defines are used by either Resource Compiler or NSIS installer diff --git a/Sandboxie/core/dll/file_dir.c b/Sandboxie/core/dll/file_dir.c index 05f1af5e..79e0e092 100644 --- a/Sandboxie/core/dll/file_dir.c +++ b/Sandboxie/core/dll/file_dir.c @@ -614,7 +614,7 @@ _FX NTSTATUS File_OpenForMerge( // WCHAR* OldTruePath = File_ResolveTruePath(TruePath, NULL, &TruePathFlags); - if (FILE_PATH_DELETED(TruePathFlags)) + if (FILE_PATH_DELETED(TruePathFlags) && !FILE_PATH_RELOCATED(TruePathFlags)) TruePathDeleted = TRUE; else if (OldTruePath) { diff --git a/Sandboxie/core/dll/gui.c b/Sandboxie/core/dll/gui.c index 839433ca..89579605 100644 --- a/Sandboxie/core/dll/gui.c +++ b/Sandboxie/core/dll/gui.c @@ -414,7 +414,9 @@ _FX BOOLEAN Gui_Init(HMODULE module) GUI_IMPORT___(GetClipboardSequenceNumber); GUI_IMPORT_AW(GetClipboardFormatName); GUI_IMPORT_AW(RegisterClipboardFormat); + GUI_IMPORT___(SetClipboardData); GUI_IMPORT___(GetClipboardData); + GUI_IMPORT___(EmptyClipboard); GUI_IMPORT___(GetRawInputDeviceInfoA); GUI_IMPORT___(GetRawInputDeviceInfoW); diff --git a/Sandboxie/core/dll/gui_p.h b/Sandboxie/core/dll/gui_p.h index f94336c9..b9f13907 100644 --- a/Sandboxie/core/dll/gui_p.h +++ b/Sandboxie/core/dll/gui_p.h @@ -103,8 +103,12 @@ typedef HWND (*P_GetOpenClipboardWindow)(void); typedef DWORD (*P_GetClipboardSequenceNumber)(void); +typedef HANDLE (*P_SetClipboardData)(UINT uFormat, HANDLE hMem); + typedef HANDLE (*P_GetClipboardData)(UINT uFormat); +typedef BOOL (*P_EmptyClipboard)(); + typedef int (*P_GetClipboardFormatName)( UINT format, void *lpszFormatName, int cchMaxCount); @@ -577,7 +581,9 @@ GUI_SYS_VAR(SendInput) GUI_SYS_VAR(OpenClipboard) GUI_SYS_VAR(CloseClipboard) +GUI_SYS_VAR(SetClipboardData); GUI_SYS_VAR(GetClipboardData); +GUI_SYS_VAR(EmptyClipboard); GUI_SYS_VAR(GetClipboardOwner); GUI_SYS_VAR(GetOpenClipboardWindow); GUI_SYS_VAR(GetClipboardSequenceNumber); diff --git a/Sandboxie/core/dll/guimisc.c b/Sandboxie/core/dll/guimisc.c index e4b5b3c6..de1f62b3 100644 --- a/Sandboxie/core/dll/guimisc.c +++ b/Sandboxie/core/dll/guimisc.c @@ -70,6 +70,8 @@ static BOOL Gui_OpenClipboard(HWND hwnd); static BOOL Gui_CloseClipboard(void); +static HANDLE Gui_SetClipboardData(UINT uFormat, HANDLE hMem); + static HANDLE Gui_GetClipboardData(UINT uFormat); static void Gui_GetClipboardData_BMP(void *buf, ULONG fmt); @@ -78,6 +80,8 @@ static void Gui_GetClipboardData_MF(void *buf, ULONG sz, ULONG fmt); static void Gui_GetClipboardData_EnhMF(void *buf, ULONG sz, ULONG fmt); +static BOOL Gui_EmptyClipboard(); + static LONG Gui_ChangeDisplaySettingsExA( void *lpszDeviceName, void *lpDevMode, HWND hwnd, DWORD dwflags, void *lParam); @@ -192,7 +196,9 @@ _FX BOOLEAN Gui_InitMisc(HMODULE module) SBIEDLL_HOOK_GUI(OpenClipboard); SBIEDLL_HOOK_GUI(CloseClipboard); + SBIEDLL_HOOK_GUI(SetClipboardData); SBIEDLL_HOOK_GUI(GetClipboardData); + SBIEDLL_HOOK_GUI(EmptyClipboard); // // Chinese instant messenger QQ.exe (aka TM.exe) uses OpenInputDesktop, @@ -204,7 +210,7 @@ _FX BOOLEAN Gui_InitMisc(HMODULE module) // to check if the desktop is locked, and other programs might as well // - if (1) { + if (!Dll_CompartmentMode) { typedef HDESK (*P_OpenInputDesktop)( DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess); @@ -762,6 +768,34 @@ _FX BOOL Gui_CloseClipboard(void) } +//--------------------------------------------------------------------------- +// Gui_SetClipboardData +//--------------------------------------------------------------------------- + + +_FX HANDLE Gui_SetClipboardData(UINT uFormat, HANDLE hMem) +{ + if (!SbieApi_QueryConfBool(NULL, L"OpenClipboard", TRUE)) + return NULL; + + return __sys_SetClipboardData(uFormat, hMem); +} + + +//--------------------------------------------------------------------------- +// Gui_EmptyClipboard +//--------------------------------------------------------------------------- + + +_FX BOOL Gui_EmptyClipboard() +{ + if (!SbieApi_QueryConfBool(NULL, L"OpenClipboard", TRUE)) + return NULL; + + return __sys_EmptyClipboard(); +} + + //--------------------------------------------------------------------------- // Gui_GetClipboardData //--------------------------------------------------------------------------- diff --git a/SandboxiePlus/SandMan/SbiePlusAPI.cpp b/SandboxiePlus/SandMan/SbiePlusAPI.cpp index da9c8814..3512b9c0 100644 --- a/SandboxiePlus/SandMan/SbiePlusAPI.cpp +++ b/SandboxiePlus/SandMan/SbiePlusAPI.cpp @@ -516,6 +516,7 @@ void CSandBoxPlus::ScanStartMenu() if(!pLink->Target.isEmpty() && pLink->Target != Link["Path"].toString()) bChanged = true; pLink->Target = Link["Path"].toString(); + pLink->Arguments = Link["Arguments"].toString(); pLink->Icon = Link["IconPath"].toString(); pLink->IconIndex = Link["IconIndex"].toInt(); pLink->WorkDir = Link["WorkingDir"].toString(); diff --git a/SandboxiePlus/SandMan/SbiePlusAPI.h b/SandboxiePlus/SandMan/SbiePlusAPI.h index 6d190d55..ccc6bf25 100644 --- a/SandboxiePlus/SandMan/SbiePlusAPI.h +++ b/SandboxiePlus/SandMan/SbiePlusAPI.h @@ -166,6 +166,7 @@ public: QString Folder; QString Name; QString Target; + QString Arguments; QString Icon; int IconIndex; QString WorkDir; diff --git a/SandboxiePlus/SandMan/Views/SbieView.cpp b/SandboxiePlus/SandMan/Views/SbieView.cpp index d763d422..2bf2ef53 100644 --- a/SandboxiePlus/SandMan/Views/SbieView.cpp +++ b/SandboxiePlus/SandMan/Views/SbieView.cpp @@ -1856,7 +1856,14 @@ void CSbieView::UpdateStartMenu(CSandBoxPlus* pBoxEx) QIcon Icon = LoadWindowsIcon(Link.Icon, Link.IconIndex); if(Icon.isNull()) Icon = m_IconProvider.icon(QFileInfo(Link.Target)); pAction->setIcon(Icon); - pAction->setData(Link.Target); + QString Command; + if(Link.Target.contains(" ")) + Command = "\"" + Link.Target + "\""; + else + Command = Link.Target; + if(!Link.Arguments.isEmpty()) + Command += " " + Link.Arguments; + pAction->setData(Command); pAction->setProperty("Icon", Link.Icon); pAction->setProperty("IconIndex", Link.IconIndex); pAction->setProperty("WorkingDir", Link.WorkDir); diff --git a/SandboxiePlus/SandMan/Views/TraceView.cpp b/SandboxiePlus/SandMan/Views/TraceView.cpp index cde11ed0..fea0e814 100644 --- a/SandboxiePlus/SandMan/Views/TraceView.cpp +++ b/SandboxiePlus/SandMan/Views/TraceView.cpp @@ -328,6 +328,7 @@ CTraceView::CTraceView(bool bStandAlone, QWidget* parent) : QWidget(parent) m_pTrace->m_pTraceModel->SetTree(m_pTraceTree->isChecked()); m_pTrace->m_pAutoScroll = new QAction(tr("Auto Scroll")); + m_pTrace->m_pAutoScroll->setCheckable(true); m_pTrace->m_pAutoScroll->setChecked(theConf->GetBool("Options/TraceAutoScroll")); m_pTrace->GetMenu()->insertAction(m_pTrace->GetMenu()->actions()[0], m_pTrace->m_pAutoScroll); diff --git a/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp b/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp index a2cf071e..fd67a2a4 100644 --- a/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp +++ b/SandboxiePlus/SandMan/Windows/OptionsGeneral.cpp @@ -728,7 +728,7 @@ void COptionsWindow::OnGeneralChanged() ui.chkCopyPrompt->setEnabled(ui.chkCopyLimit->isChecked()); ui.chkNoCopyWarn->setEnabled(ui.chkCopyLimit->isChecked() && !ui.chkCopyPrompt->isChecked()); - ui.chkAutoEmpty->setEnabled(!ui.chkProtectBox->isChecked()); + ui.chkAutoEmpty->setEnabled(ui.chkProtectBox->checkState() != Qt::Checked); ui.chkOpenSpooler->setEnabled(!ui.chkBlockSpooler->isChecked() && !ui.chkNoSecurityIsolation->isChecked()); ui.chkPrintToFile->setEnabled(!ui.chkBlockSpooler->isChecked() && !ui.chkNoSecurityFiltering->isChecked()); diff --git a/SandboxiePlus/version.h b/SandboxiePlus/version.h index efb4ce68..a4ce4896 100644 --- a/SandboxiePlus/version.h +++ b/SandboxiePlus/version.h @@ -3,7 +3,7 @@ #define VERSION_MJR 1 #define VERSION_MIN 10 #define VERSION_REV 1 -#define VERSION_UPD 0 +#define VERSION_UPD 1 #ifndef STR #define STR2(X) #X