From fb5087e80cf3ccd44fb0e1c3002c88ce1df4150e Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Fri, 16 Apr 2004 21:50:26 +0000 Subject: [PATCH] fixed missing window dereferences and a minor thread-safety bug svn path=/trunk/; revision=9167 --- reactos/subsys/win32k/ntuser/prop.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/reactos/subsys/win32k/ntuser/prop.c b/reactos/subsys/win32k/ntuser/prop.c index fe7c5b0f686..0d76d267571 100644 --- a/reactos/subsys/win32k/ntuser/prop.c +++ b/reactos/subsys/win32k/ntuser/prop.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: prop.c,v 1.9 2004/02/24 13:27:03 weiden Exp $ +/* $Id: prop.c,v 1.10 2004/04/16 21:50:26 weiden Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -193,12 +193,12 @@ NtUserGetProp(HWND hWnd, ATOM Atom) IntLockWindowProperties(WindowObject); Prop = IntGetProp(WindowObject, Atom); - IntUnLockWindowProperties(WindowObject); if (Prop != NULL) { Data = Prop->Data; } - + IntUnLockWindowProperties(WindowObject); + IntReleaseWindowObject(WindowObject); return(Data); } @@ -229,19 +229,20 @@ IntSetProp(PWINDOW_OBJECT Wnd, ATOM Atom, HANDLE Data) BOOL STDCALL NtUserSetProp(HWND hWnd, ATOM Atom, HANDLE Data) { - PWINDOW_OBJECT Wnd; + PWINDOW_OBJECT WindowObject; BOOL ret; - if (!(Wnd = IntGetWindowObject(hWnd))) + if (!(WindowObject = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); return FALSE; } - IntLockWindowProperties(Wnd); - ret = IntSetProp(Wnd, Atom, Data); - IntUnLockWindowProperties(Wnd); + IntLockWindowProperties(WindowObject); + ret = IntSetProp(WindowObject, Atom, Data); + IntUnLockWindowProperties(WindowObject); + IntReleaseWindowObject(WindowObject); return ret; }