Fix NULL pointer dereference when clicking on desktop window.
Modified: branches/win32k rewrite attempt/win32k/ntuser/focus.c
_____
Modified: branches/win32k rewrite attempt/win32k/ntuser/focus.c
--- branches/win32k rewrite attempt/win32k/ntuser/focus.c
2005-08-07 14:01:17 UTC (rev 17167)
+++ branches/win32k rewrite attempt/win32k/ntuser/focus.c
2005-08-07 15:16:52 UTC (rev 17168)
@@ -236,19 +236,8 @@
}
TopWnd = UserGetAncestor(Window, GA_ROOT);
- // if (TopWindow != Window->Self)
- // {
- // TopWindow = IntGetWindowObject(Top);
- // if (TopWindow == NULL)
- // {
- // SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
- // return FALSE;
- // }
- // }
- // else
- // {
- // TopWindow = Window;
- // }
+ if (TopWnd == NULL)
+ TopWnd = UserGetDesktopWindow();
/* TMN: Check return value from this function? */
IntSetForegroundAndFocusWindow(TopWnd, Window, TRUE);