Author: gadamopoulos
Date: Sun Feb 24 21:30:30 2013
New Revision: 58367
URL: http://svn.reactos.org/svn/reactos?rev=58367&view=rev
Log:
[msgina]
- Fix a bug in StartupWindowThread that had as a result to close the desktop handle we get from winlogon. The problem is the wrong usage of SetThreadDesktop as it closes the previous desktop, so keeping OldDesk is totally useless and when the thread exits it will close the handle to the current thread desktop which is Session->WinlogonDesktop from winlogon. To solve this issue we have to duplicate the handle we get from winlogon and let it get closed by win32k when the thread exits
Modified:
trunk/reactos/dll/win32/msgina/gui.c
Modified: trunk/reactos/dll/win32/msgina/gui.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/gui.c?rev…
==============================================================================
--- trunk/reactos/dll/win32/msgina/gui.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msgina/gui.c [iso-8859-1] Sun Feb 24 21:30:30 2013
@@ -59,23 +59,35 @@
static DWORD WINAPI
StartupWindowThread(LPVOID lpParam)
{
- HDESK OldDesk;
+ HDESK hDesk;
PDISPLAYSTATUSMSG msg = (PDISPLAYSTATUSMSG)lpParam;
- OldDesk = GetThreadDesktop(GetCurrentThreadId());
-
- if(!SetThreadDesktop(msg->hDesktop))
+ /* When SetThreadDesktop is called the system closes the desktop handle when needed
+ so we have to create a new handle because this handle may still be in use by winlogon */
+ if (!DuplicateHandle ( GetCurrentProcess(),
+ msg->hDesktop,
+ GetCurrentProcess(),
+ &hDesk,
+ 0,
+ FALSE,
+ DUPLICATE_SAME_ACCESS))
{
HeapFree(GetProcessHeap(), 0, lpParam);
return FALSE;
}
+
+ if(!SetThreadDesktop(hDesk))
+ {
+ HeapFree(GetProcessHeap(), 0, lpParam);
+ return FALSE;
+ }
+
DialogBoxParam(
hDllInstance,
MAKEINTRESOURCE(IDD_STATUSWINDOW_DLG),
GetDesktopWindow(),
StatusMessageWindowProc,
(LPARAM)lpParam);
- SetThreadDesktop(OldDesk);
HeapFree(GetProcessHeap(), 0, lpParam);
return TRUE;
Author: gadamopoulos
Date: Sun Feb 24 20:03:48 2013
New Revision: 58364
URL: http://svn.reactos.org/svn/reactos?rev=58364&view=rev
Log:
[win32k]
- Fix a nasty bug in IntTrackMouseMove that prevented us from stopping the ID_EVENT_SYSTIMER_MOUSEHOVER timer.
- IntKillTimer requires a PWND as first argument but we were passing an HWND and as a result the timer was never stopped
- Fixes the remaining failed tests for TrackMouseEvent (besides queue state tests)
Modified:
trunk/reactos/win32ss/user/ntuser/msgqueue.c
Modified: trunk/reactos/win32ss/user/ntuser/msgqueue.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/msgque…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/msgqueue.c [iso-8859-1] Sun Feb 24 20:03:48 2013
@@ -1352,7 +1352,7 @@
0, 0);
if ( pDesk->dwDTFlags & DF_TME_HOVER )
- IntKillTimer(UserHMGetHandle(pDesk->spwndTrack), ID_EVENT_SYSTIMER_MOUSEHOVER, TRUE);
+ IntKillTimer(pDesk->spwndTrack, ID_EVENT_SYSTIMER_MOUSEHOVER, TRUE);
/* Clear the flags to sign a change. */
pDesk->dwDTFlags &= ~(DF_TME_LEAVE|DF_TME_HOVER);