Author: rharabien
Date: Sun May 1 13:15:30 2011
New Revision: 51527
URL:
http://svn.reactos.org/svn/reactos?rev=51527&view=rev
Log:
[WIN32K]
* Do not reference current thread before sending message to it. It was causing thread to
be a ghost if ExitThread was called in WndProc.
* Hold only UserRefObjectCo reference on windows when sending messages to them.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c [iso-8859-1] Sun May 1
13:15:30 2011
@@ -1218,7 +1218,7 @@
RETURN( FALSE);
}
- ObReferenceObject(Win32Thread->pEThread);
+ //ObReferenceObject(Win32Thread->pEThread);
Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc,
!Window->Unicode,
hWnd,
@@ -1231,7 +1231,7 @@
*uResult = Result;
}
- ObDereferenceObject(Win32Thread->pEThread);
+ //ObDereferenceObject(Win32Thread->pEThread);
IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
@@ -1438,7 +1438,7 @@
IntCallWndProc( Window, hWnd, Msg, wParam, lParam);
- ObReferenceObject(Win32Thread->pEThread);
+ //ObReferenceObject(Win32Thread->pEThread);
Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc,
!Window->Unicode,
hWnd,
@@ -1450,7 +1450,7 @@
{
*uResult = Result;
}
- ObDereferenceObject(Win32Thread->pEThread);
+ //ObDereferenceObject(Win32Thread->pEThread);
IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Sun May 1 13:15:30
2011
@@ -1995,6 +1995,7 @@
hwndInsertAfter = HWND_TOP;
UserRefObjectCo(Window, &Ref);
+ UserDereferenceObject(Window);
ObDereferenceObject(WinSta);
//// Check for a hook to eliminate overhead. ////
@@ -2260,7 +2261,6 @@
if (Window)
{
UserDerefObjectCo(Window);
- UserDereferenceObject(Window);
}
if (ParentWindow) UserDerefObjectCo(ParentWindow);