From bfc8890eee709f4a97d2e697290cc0ea186b0215 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Tue, 20 Nov 2007 23:15:49 +0000 Subject: [PATCH] Optimize GetDesktopWindow() to read the information from the shared heap svn path=/trunk/; revision=30609 --- reactos/dll/win32/user32/windows/window.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/user32/windows/window.c b/reactos/dll/win32/user32/windows/window.c index bab712cbb91..5bd206eb531 100644 --- a/reactos/dll/win32/user32/windows/window.c +++ b/reactos/dll/win32/user32/windows/window.c @@ -529,7 +529,22 @@ EndDeferWindowPos(HDWP hWinPosInfo) HWND STDCALL GetDesktopWindow(VOID) { - return NtUserGetDesktopWindow(); + PWINDOW Wnd; + HWND Ret = NULL; + + _SEH_TRY + { + Wnd = GetThreadDesktopWnd(); + if (Wnd != NULL) + Ret = UserHMGetHandle(Wnd); + } + _SEH_HANDLE + { + /* Do nothing */ + } + _SEH_END; + + return Ret; } @@ -1096,7 +1111,7 @@ GetWindowModuleFileNameW(HWND hwnd, */ BOOL STDCALL GetWindowPlacement(HWND hWnd, - WINDOWPLACEMENT *lpwndpl) + WINDOWPLACEMENT *lpwndpl) { return (BOOL)NtUserGetWindowPlacement(hWnd, lpwndpl); }