From 7c06816a545a1904491aba3d84711ec7af44f4c3 Mon Sep 17 00:00:00 2001 From: DavidXanatos <3890945+DavidXanatos@users.noreply.github.com> Date: Sun, 3 Mar 2024 13:52:04 +0100 Subject: [PATCH] 1.13.2 --- Sandboxie/core/dll/gui.c | 6 ++---- Sandboxie/core/dll/guimisc.c | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Sandboxie/core/dll/gui.c b/Sandboxie/core/dll/gui.c index d9555ed7..640531ce 100644 --- a/Sandboxie/core/dll/gui.c +++ b/Sandboxie/core/dll/gui.c @@ -1605,9 +1605,8 @@ _FX LRESULT Gui_WindowProcW( if (uMsg == WM_QUERYENDSESSION) { - if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE)) { + if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE)) return TRUE; - } } wndproc = __sys_GetPropW(hWnd, (LPCWSTR)Gui_WindowProcOldW_Atom); @@ -1669,9 +1668,8 @@ _FX LRESULT Gui_WindowProcA( Gui_ProtectScreen(hWnd); if (uMsg == WM_QUERYENDSESSION) { - if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE)) { + if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE)) return TRUE; - } } wndproc = __sys_GetPropW(hWnd, (LPCWSTR)Gui_WindowProcOldA_Atom); lResult = __sys_CallWindowProcA(wndproc, hWnd, uMsg, wParam, new_lParam); diff --git a/Sandboxie/core/dll/guimisc.c b/Sandboxie/core/dll/guimisc.c index 617260ce..ce29a9b9 100644 --- a/Sandboxie/core/dll/guimisc.c +++ b/Sandboxie/core/dll/guimisc.c @@ -1584,24 +1584,32 @@ _FX BOOL Gui_PrintWindow(HWND hwnd, HDC hdcBlt, UINT nFlags) return __sys_PrintWindow(hwnd, hdcBlt, nFlags); } + //--------------------------------------------------------------------------- // Gui_ShutdownBlockReasonCreate //--------------------------------------------------------------------------- -_FX BOOL Gui_ShutdownBlockReasonCreate( - HWND hWnd, - LPCWSTR pwszReason -) { + +_FX BOOL Gui_ShutdownBlockReasonCreate(HWND hWnd, LPCWSTR pwszReason) +{ if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE)) { + SetLastError(ERROR_ACCESS_DENIED); return 0; } return __sys_ShutdownBlockReasonCreate(hWnd, pwszReason); } -_FX EXECUTION_STATE Gui_SetThreadExecutionState( - EXECUTION_STATE esFlags -) { + + +//--------------------------------------------------------------------------- +// Gui_SetThreadExecutionState +//--------------------------------------------------------------------------- + + +_FX EXECUTION_STATE Gui_SetThreadExecutionState(EXECUTION_STATE esFlags) +{ if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE)) { + SetLastError(ERROR_ACCESS_DENIED); return 0; }