Update guimisc.c

This commit is contained in:
DavidXanatos 2024-04-14 12:55:05 +02:00
parent b4266103e3
commit fc693736c9
1 changed files with 7 additions and 5 deletions

View File

@ -352,11 +352,11 @@ _FX HWND Gui_SetParent(HWND hWndChild, HWND hWndNewParent)
_FX BOOL Gui_ClipCursor(const RECT *lpRect)
{
if (SbieApi_QueryConfBool(NULL, "BlockInterferenceControl", FALSE) && lpRect)
{
if (SbieApi_QueryConfBool(NULL, "BlockInterferenceControl", FALSE) && lpRect) {
SetLastError(ERROR_ACCESS_DENIED);
return FALSE;
}
if (!Gui_UseProxyService)
return __sys_ClipCursor(lpRect);
@ -519,8 +519,10 @@ _FX BOOL Gui_SetCursorPos(int x, int y)
if (SbieApi_QueryConfBool(NULL, "BlockInterferenceControl", FALSE)) {
return FALSE;
}
if (!Gui_UseProxyService)
return __sys_SetCursorPos(x, y);
GUI_SET_CURSOR_POS_REQ req;
GUI_SET_CURSOR_POS_RPL *rpl;
ULONG error;
@ -554,12 +556,12 @@ _FX BOOL Gui_SetForegroundWindow(HWND hWnd)
{
GUI_SET_FOREGROUND_WINDOW_REQ req;
void *rpl;
if (SbieApi_QueryConfBool(NULL, "BlockInterferenceControl", FALSE))
{
if (SbieApi_QueryConfBool(NULL, "BlockInterferenceControl", FALSE)) {
SetLastError(ERROR_ACCESS_DENIED);
return FALSE;
}
if (__sys_IsWindow(hWnd) || (! hWnd)|| !Gui_UseProxyService) {
if (!Gui_UseProxyService || __sys_IsWindow(hWnd) || (! hWnd)) {
// window is in the same sandbox (or is NULL), no need for GUI Proxy
return __sys_SetForegroundWindow(hWnd);
}