Update guimisc.c

This commit is contained in:
DavidXanatos 2024-04-14 12:57:51 +02:00
parent fc693736c9
commit 17675949c1
1 changed files with 7 additions and 4 deletions

View File

@ -163,6 +163,8 @@ static ULONG Gui_OpenClipboard_seq = -1;
static HANDLE Gui_DummyInputDesktopHandle = NULL;
static BOOLEAN Gui_BlockInterferenceControl = FALSE;
//---------------------------------------------------------------------------
// Gui_InitMisc
@ -173,6 +175,7 @@ _FX BOOLEAN Gui_InitMisc(HMODULE module)
{
if (! Gui_OpenAllWinClasses) {
Gui_BlockInterferenceControl = SbieApi_QueryConfBool(NULL, L"BlockInterferenceControl", FALSE);
SBIEDLL_HOOK_GUI(SetParent);
if (Gui_UseProxyService) {
@ -352,7 +355,7 @@ _FX HWND Gui_SetParent(HWND hWndChild, HWND hWndNewParent)
_FX BOOL Gui_ClipCursor(const RECT *lpRect)
{
if (SbieApi_QueryConfBool(NULL, "BlockInterferenceControl", FALSE) && lpRect) {
if (Gui_BlockInterferenceControl && lpRect) {
SetLastError(ERROR_ACCESS_DENIED);
return FALSE;
}
@ -516,9 +519,8 @@ _FX BOOL Gui_GetIconInfo(HICON hIcon, PICONINFO piconinfo)
_FX BOOL Gui_SetCursorPos(int x, int y)
{
if (SbieApi_QueryConfBool(NULL, "BlockInterferenceControl", FALSE)) {
if (Gui_BlockInterferenceControl)
return FALSE;
}
if (!Gui_UseProxyService)
return __sys_SetCursorPos(x, y);
@ -556,7 +558,8 @@ _FX BOOL Gui_SetForegroundWindow(HWND hWnd)
{
GUI_SET_FOREGROUND_WINDOW_REQ req;
void *rpl;
if (SbieApi_QueryConfBool(NULL, "BlockInterferenceControl", FALSE)) {
if (Gui_BlockInterferenceControl) {
SetLastError(ERROR_ACCESS_DENIED);
return FALSE;
}