This commit is contained in:
DavidXanatos 2024-03-03 13:52:04 +01:00
parent a7f0944039
commit 7c06816a54
2 changed files with 17 additions and 11 deletions

View File

@ -1605,9 +1605,8 @@ _FX LRESULT Gui_WindowProcW(
if (uMsg == WM_QUERYENDSESSION) if (uMsg == WM_QUERYENDSESSION)
{ {
if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE)) { if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE))
return TRUE; return TRUE;
}
} }
wndproc = __sys_GetPropW(hWnd, (LPCWSTR)Gui_WindowProcOldW_Atom); wndproc = __sys_GetPropW(hWnd, (LPCWSTR)Gui_WindowProcOldW_Atom);
@ -1669,9 +1668,8 @@ _FX LRESULT Gui_WindowProcA(
Gui_ProtectScreen(hWnd); Gui_ProtectScreen(hWnd);
if (uMsg == WM_QUERYENDSESSION) if (uMsg == WM_QUERYENDSESSION)
{ {
if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE)) { if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE))
return TRUE; return TRUE;
}
} }
wndproc = __sys_GetPropW(hWnd, (LPCWSTR)Gui_WindowProcOldA_Atom); wndproc = __sys_GetPropW(hWnd, (LPCWSTR)Gui_WindowProcOldA_Atom);
lResult = __sys_CallWindowProcA(wndproc, hWnd, uMsg, wParam, new_lParam); lResult = __sys_CallWindowProcA(wndproc, hWnd, uMsg, wParam, new_lParam);

View File

@ -1584,24 +1584,32 @@ _FX BOOL Gui_PrintWindow(HWND hwnd, HDC hdcBlt, UINT nFlags)
return __sys_PrintWindow(hwnd, hdcBlt, nFlags); return __sys_PrintWindow(hwnd, hdcBlt, nFlags);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Gui_ShutdownBlockReasonCreate // Gui_ShutdownBlockReasonCreate
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
_FX BOOL Gui_ShutdownBlockReasonCreate(
HWND hWnd, _FX BOOL Gui_ShutdownBlockReasonCreate(HWND hWnd, LPCWSTR pwszReason)
LPCWSTR pwszReason {
) {
if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE)) { if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE)) {
SetLastError(ERROR_ACCESS_DENIED); SetLastError(ERROR_ACCESS_DENIED);
return 0; return 0;
} }
return __sys_ShutdownBlockReasonCreate(hWnd, pwszReason); 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)) { if (SbieApi_QueryConfBool(NULL, "BlockInterferePower", FALSE)) {
SetLastError(ERROR_ACCESS_DENIED); SetLastError(ERROR_ACCESS_DENIED);
return 0; return 0;
} }