Skip to content

Commit 3fe6ca7

Browse files
author
Rafal Harabien
committed
[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. svn path=/trunk/; revision=51527
1 parent 606747e commit 3fe6ca7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

reactos/subsystems/win32/win32k/ntuser/message.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
12181218
RETURN( FALSE);
12191219
}
12201220

1221-
ObReferenceObject(Win32Thread->pEThread);
1221+
//ObReferenceObject(Win32Thread->pEThread);
12221222
Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc,
12231223
!Window->Unicode,
12241224
hWnd,
@@ -1231,7 +1231,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
12311231
*uResult = Result;
12321232
}
12331233

1234-
ObDereferenceObject(Win32Thread->pEThread);
1234+
//ObDereferenceObject(Win32Thread->pEThread);
12351235

12361236
IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
12371237

@@ -1438,7 +1438,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
14381438

14391439
IntCallWndProc( Window, hWnd, Msg, wParam, lParam);
14401440

1441-
ObReferenceObject(Win32Thread->pEThread);
1441+
//ObReferenceObject(Win32Thread->pEThread);
14421442
Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc,
14431443
!Window->Unicode,
14441444
hWnd,
@@ -1450,7 +1450,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
14501450
{
14511451
*uResult = Result;
14521452
}
1453-
ObDereferenceObject(Win32Thread->pEThread);
1453+
//ObDereferenceObject(Win32Thread->pEThread);
14541454

14551455
IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
14561456

reactos/subsystems/win32/win32k/ntuser/window.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
19951995
hwndInsertAfter = HWND_TOP;
19961996

19971997
UserRefObjectCo(Window, &Ref);
1998+
UserDereferenceObject(Window);
19981999
ObDereferenceObject(WinSta);
19992000

20002001
//// Check for a hook to eliminate overhead. ////
@@ -2260,7 +2261,6 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
22602261
if (Window)
22612262
{
22622263
UserDerefObjectCo(Window);
2263-
UserDereferenceObject(Window);
22642264
}
22652265
if (ParentWindow) UserDerefObjectCo(ParentWindow);
22662266

0 commit comments

Comments
 (0)