From 9378c725cfdb3951a0dc142288d283c17eb8cc25 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 12 Jan 2009 20:00:41 +0000 Subject: [PATCH] - Fix another wine test for SetWindowPos. svn path=/trunk/; revision=38733 --- reactos/subsystems/win32/win32k/ntuser/window.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reactos/subsystems/win32/win32k/ntuser/window.c b/reactos/subsystems/win32/win32k/ntuser/window.c index 1c34b5b35ba..0f1fe6a169c 100644 --- a/reactos/subsystems/win32/win32k/ntuser/window.c +++ b/reactos/subsystems/win32/win32k/ntuser/window.c @@ -4302,6 +4302,22 @@ NtUserSetWindowPos( RETURN(FALSE); } + /* First make sure that coordinates are valid for WM_WINDOWPOSCHANGING */ + if (!(uFlags & SWP_NOMOVE)) + { + if (X < -32768) X = -32768; + else if (X > 32767) X = 32767; + if (Y < -32768) Y = -32768; + else if (Y > 32767) Y = 32767; + } + if (!(uFlags & SWP_NOSIZE)) + { + if (cx < 0) cx = 0; + else if (cx > 32767) cx = 32767; + if (cy < 0) cy = 0; + else if (cy > 32767) cy = 32767; + } + UserRefObjectCo(Window, &Ref); ret = co_WinPosSetWindowPos(Window, hWndInsertAfter, X, Y, cx, cy, uFlags); UserDerefObjectCo(Window);