From: James Tabor Date: Sun, 6 Sep 2009 22:20:34 +0000 (+0000) Subject: Patch by johnyadams@hotmail.com: Some applications try to set a child as a parent... X-Git-Tag: ReactOS-0.3.11~898 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=f5617658a31329924e105d20ff98795ba47795aa Patch by johnyadams@hotmail.com: Some applications try to set a child as a parent. See bug 4789. svn path=/trunk/; revision=43009 --- diff --git a/reactos/subsystems/win32/win32k/ntuser/window.c b/reactos/subsystems/win32/win32k/ntuser/window.c index e062f78c7c5..bdbbc1619c5 100644 --- a/reactos/subsystems/win32/win32k/ntuser/window.c +++ b/reactos/subsystems/win32/win32k/ntuser/window.c @@ -1022,6 +1022,13 @@ co_IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent) // hWnd = Wnd->hSelf; // hWndNewParent = WndNewParent->hSelf; + /* Some applications try to set a child as a parent */ + if (IntIsChildWindow(Wnd, WndNewParent)) + { + SetLastWin32Error( ERROR_INVALID_PARAMETER ); + return 0; + } + /* * Windows hides the window first, then shows it again * including the WM_SHOWWINDOW messages and all