From 4b70642b139aa8c01617901eb5e7ea2249f26126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Sun, 12 Oct 2003 09:46:51 +0000 Subject: [PATCH] Store WindowStation in Win32Process data too when setting window station svn path=/trunk/; revision=6290 --- reactos/subsys/win32k/ntuser/winsta.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/reactos/subsys/win32k/ntuser/winsta.c b/reactos/subsys/win32k/ntuser/winsta.c index d14a17c0649..b666cafb142 100644 --- a/reactos/subsys/win32k/ntuser/winsta.c +++ b/reactos/subsys/win32k/ntuser/winsta.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: winsta.c,v 1.37 2003/10/09 06:13:05 gvg Exp $ +/* $Id: winsta.c,v 1.38 2003/10/12 09:46:51 gvg Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -525,6 +525,7 @@ BOOL STDCALL NtUserSetProcessWindowStation(HWINSTA hWindowStation) { PWINSTATION_OBJECT Object; + PW32PROCESS Win32Process; NTSTATUS Status; DPRINT("About to set process window station with handle (0x%X)\n", @@ -540,8 +541,20 @@ NtUserSetProcessWindowStation(HWINSTA hWindowStation) hWindowStation); return FALSE; } - - ObDereferenceObject(Object); + + Win32Process = PsGetWin32Process(); + if (NULL == Win32Process) + { + ObDereferenceObject(Object); + } + else + { + if (NULL != Win32Process->WindowStation) + { + ObDereferenceObject(Win32Process->WindowStation); + } + Win32Process->WindowStation = Object; + } SET_PROCESS_WINDOW_STATION(hWindowStation); DPRINT("IoGetCurrentProcess()->Win32WindowStation 0x%X\n",