From 1335fe7f13b2c97cc2f7c4a00196ecce41191791 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sat, 17 Jan 2009 21:14:52 +0000 Subject: [PATCH] - It is understandable now why certain applications fail when accessing thread information from user mode, it is the wrong information being accessed. svn path=/trunk/; revision=38853 --- .../subsystems/win32/win32k/include/win32.h | 20 ++++++++++--------- reactos/subsystems/win32/win32k/ntuser/misc.c | 2 ++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/reactos/subsystems/win32/win32k/include/win32.h b/reactos/subsystems/win32/win32k/include/win32.h index e19dbcc5694..e33ac6d218d 100644 --- a/reactos/subsystems/win32/win32k/include/win32.h +++ b/reactos/subsystems/win32/win32k/include/win32.h @@ -4,7 +4,7 @@ typedef struct _WIN32HEAP WIN32HEAP, *PWIN32HEAP; #include - +// FIXME! Move to ntuser.h typedef struct _TL { struct _TL* next; @@ -28,17 +28,19 @@ typedef struct _W32THREAD typedef struct _THREADINFO { - W32THREAD W32Thread; - PVOID ppi; // FIXME: use PPROCESSINFO - PDESKTOPINFO pDeskInfo; - PCLIENTINFO pClientInfo; - LIST_ENTRY PtiLink; + W32THREAD W32Thread; + PTL ptl; + PVOID ppi; // FIXME: use PPROCESSINFO + struct _USER_MESSAGE_QUEUE* MessageQueue; + struct _KBL* KeyboardLayout; + PCLIENTTHREADINFO pcti; + struct _DESKTOP* Desktop; + PDESKTOPINFO pDeskInfo; + PCLIENTINFO pClientInfo; + LIST_ENTRY PtiLink; - struct _USER_MESSAGE_QUEUE* MessageQueue; LIST_ENTRY WindowListHead; LIST_ENTRY W32CallbackListHead; - struct _KBL* KeyboardLayout; - struct _DESKTOP* Desktop; HANDLE hDesktop; BOOLEAN IsExiting; SINGLE_LIST_ENTRY ReferencesList; diff --git a/reactos/subsystems/win32/win32k/ntuser/misc.c b/reactos/subsystems/win32/win32k/ntuser/misc.c index a124f0c6af3..d9103b22a8a 100644 --- a/reactos/subsystems/win32/win32k/ntuser/misc.c +++ b/reactos/subsystems/win32/win32k/ntuser/misc.c @@ -505,6 +505,7 @@ GetW32ThreadInfo(VOID) ti->kpi = GetW32ProcessInfo(); ti->pi = UserHeapAddressToUser(ti->kpi); ti->Hooks = W32Thread->Hooks; + W32Thread->pcti = &ti->ClientThreadInfo; if (W32Thread->Desktop != NULL) { ti->Desktop = W32Thread->Desktop->DesktopInfo; @@ -518,6 +519,7 @@ GetW32ThreadInfo(VOID) /* update the TEB */ Teb = NtCurrentTeb(); ci = GetWin32ClientInfo(); + W32Thread->pClientInfo = ci; _SEH2_TRY { ProbeForWrite(Teb,