Author: tkreuzer
Date: Tue Oct 14 16:03:20 2008
New Revision: 36753
URL:
http://svn.reactos.org/svn/reactos?rev=36753&view=rev
Log:
- Update CLIENTTHREADINFO structure
- Rename W32CLIENTINFO to CLIENTINFO and update members
- C_ASERT that CLIENTINFO fits into the TEB
Modified:
trunk/reactos/dll/win32/user32/misc/misc.c
trunk/reactos/dll/win32/user32/windows/hook.c
trunk/reactos/dll/win32/user32/windows/message.c
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/ntuser/callback.c
trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
trunk/reactos/subsystems/win32/win32k/ntuser/message.c
trunk/reactos/subsystems/win32/win32k/ntuser/misc.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/dll/win32/user32/misc/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/misc…
==============================================================================
--- trunk/reactos/dll/win32/user32/misc/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/misc/misc.c [iso-8859-1] Tue Oct 14 16:03:20 2008
@@ -462,12 +462,12 @@
ValidateHwnd(HWND hwnd)
{
PWINDOW Wnd;
- PW32CLIENTINFO ClientInfo = GetWin32ClientInfo();
+ PCLIENTINFO ClientInfo = GetWin32ClientInfo();
ASSERT(ClientInfo != NULL);
/* See if the window is cached */
- if (hwnd == ClientInfo->hWND)
- return ClientInfo->pvWND;
+ if (hwnd == ClientInfo->CallbackWnd.hWnd)
+ return ClientInfo->CallbackWnd.pvWnd;
Wnd = ValidateHandle((HANDLE)hwnd, VALIDATE_TYPE_WIN);
if (Wnd != NULL)
@@ -501,12 +501,12 @@
ValidateHwndNoErr(HWND hwnd)
{
PWINDOW Wnd;
- PW32CLIENTINFO ClientInfo = GetWin32ClientInfo();
+ PCLIENTINFO ClientInfo = GetWin32ClientInfo();
ASSERT(ClientInfo != NULL);
/* See if the window is cached */
- if (hwnd == ClientInfo->hWND)
- return ClientInfo->pvWND;
+ if (hwnd == ClientInfo->CallbackWnd.hWnd)
+ return ClientInfo->CallbackWnd.pvWnd;
Wnd = ValidateHandleNoErr((HANDLE)hwnd, VALIDATE_TYPE_WIN);
if (Wnd != NULL)
Modified: trunk/reactos/dll/win32/user32/windows/hook.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/h…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/hook.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/hook.c [iso-8859-1] Tue Oct 14 16:03:20 2008
@@ -193,7 +193,7 @@
WPARAM wParam,
LPARAM lParam)
{
- PW32CLIENTINFO ClientInfo;
+ PCLIENTINFO ClientInfo;
DWORD Flags, Save;
PHOOK pHook;
LRESULT lResult = 0;
Modified: trunk/reactos/dll/win32/user32/windows/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] Tue Oct 14 16:03:20
2008
@@ -1081,7 +1081,7 @@
STDCALL
InSendMessage(VOID)
{
- PCLIENTTHREADINFO pcti = ((PW32CLIENTINFO)GetWin32ClientInfo())->pClientThreadInfo;
+ PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
// FIXME("ISM %x\n",pcti);
if ( pcti )
{
@@ -1103,7 +1103,7 @@
InSendMessageEx(
LPVOID lpReserved)
{
- PCLIENTTHREADINFO pcti = ((PW32CLIENTINFO)GetWin32ClientInfo())->pClientThreadInfo;
+ PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
// FIXME("ISMEX %x\n",pcti);
if (pcti && !(pcti->CTI_flags & CTI_INSENDMESSAGE)) return
ISMEX_NOSEND;
else
@@ -2336,7 +2336,7 @@
BOOL WINAPI IsInsideMessagePumpHook()
{ // Fixme: Need to fully implement this! FF uses this and polls it when Min/Max
- PCLIENTTHREADINFO pcti =
((PW32CLIENTINFO)GetWin32ClientInfo())->pClientThreadInfo;
+ PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
// FIXME("IIMPH %x\n",pcti);
return (gfMessagePumpHook && pcti && (pcti->dwcPumpHook > 0));
}
Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Tue Oct 14 16:03:20 2008
@@ -297,6 +297,11 @@
typedef struct _CLIENTTHREADINFO
{
DWORD CTI_flags;
+ WORD fsChangeBits;
+ WORD fsWakeBits;
+ WORD fsWakeBitsJournal;
+ WORD fsWakeMask;
+ LONG timeLastRead;
DWORD dwcPumpHook;
} CLIENTTHREADINFO, *PCLIENTTHREADINFO;
@@ -340,34 +345,39 @@
#define CI_CURTHPRHOOK 0x00000010
-typedef struct _W32CLIENTINFO
+typedef struct _CLIENTINFO
{
ULONG CI_flags;
ULONG cSpins;
- ULONG ulWindowsVersion;
- ULONG ulAppCompatFlags;
- ULONG ulAppCompatFlags2;
+ DWORD dwExpWinVer;
+ DWORD dwCompatFlags;
+ DWORD dwCompatFlags2;
DWORD dwTIFlags;
PVOID pDeskInfo;
ULONG_PTR ulClientDelta;
PHOOK phkCurrent;
ULONG fsHooks;
- HWND hWND; // Will be replaced with CALLBACKWND.
- PVOID pvWND; // " "
+ CALLBACKWND CallbackWnd;
ULONG Win32ClientInfo;
DWORD dwHookCurrent;
- ULONG Win32ClientInfo1;
+ INT cInDDEMLCallback;
PCLIENTTHREADINFO pClientThreadInfo;
DWORD dwHookData;
DWORD dwKeyCache;
- ULONG Win32ClientInfo2[7];
+ DWORD afKeyState[2];
+ DWORD dwAsyncKeyCache;
+ DWORD afAsyncKeyState[2];
+ DWORD afAsyncKeyStateRecentDow[2];
+ HKL hKL;
USHORT CodePage;
- USHORT csCF;
- HANDLE hKL;
+ USHORT achDbcsCF;
ULONG Win32ClientInfo3[35];
-} W32CLIENTINFO, *PW32CLIENTINFO;
-
-#define GetWin32ClientInfo() (PW32CLIENTINFO)(NtCurrentTeb()->Win32ClientInfo)
+} CLIENTINFO, *PCLIENTINFO;
+
+/* Make sure it fits exactly into the TEB */
+C_ASSERT(sizeof(CLIENTINFO) == FIELD_OFFSET(TEB, glDispatchTable) - FIELD_OFFSET(TEB,
Win32ClientInfo));
+
+#define GetWin32ClientInfo() ((PCLIENTINFO)(NtCurrentTeb()->Win32ClientInfo))
// Server event activity bits.
#define SRV_EVENT_MENU 0x0001
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/callback.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/callback.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/callback.c [iso-8859-1] Tue Oct 14
16:03:20 2008
@@ -116,22 +116,22 @@
{
HWND hWndS = *hWnd;
PWINDOW_OBJECT Window = UserGetWindowObject(*hWnd);
- PW32CLIENTINFO ClientInfo = GetWin32ClientInfo();
-
- *hWnd = ClientInfo->hWND;
- *pWnd = ClientInfo->pvWND;
-
- ClientInfo->hWND = hWndS;
- ClientInfo->pvWND = DesktopHeapAddressToUser(Window->Wnd);
+ PCLIENTINFO ClientInfo = GetWin32ClientInfo();
+
+ *hWnd = ClientInfo->CallbackWnd.hWnd;
+ *pWnd = ClientInfo->CallbackWnd.pvWnd;
+
+ ClientInfo->CallbackWnd.hWnd = hWndS;
+ ClientInfo->CallbackWnd.pvWnd = DesktopHeapAddressToUser(Window->Wnd);
}
static VOID
IntRestoreTebWndCallback (HWND hWnd, PVOID pWnd)
{
- PW32CLIENTINFO ClientInfo = GetWin32ClientInfo();
-
- ClientInfo->hWND = hWnd;
- ClientInfo->pvWND = pWnd;
+ PCLIENTINFO ClientInfo = GetWin32ClientInfo();
+
+ ClientInfo->CallbackWnd.hWnd = hWnd;
+ ClientInfo->CallbackWnd.pvWnd = pWnd;
}
/* FUNCTIONS *****************************************************************/
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] Tue Oct 14 16:03:20
2008
@@ -296,7 +296,7 @@
{
PHOOK Hook, SaveHook;
PW32THREAD Win32Thread;
- PW32CLIENTINFO ClientInfo;
+ PCLIENTINFO ClientInfo;
PHOOKTABLE Table;
LRESULT Result;
PWINSTATION_OBJECT WinStaObj;
@@ -886,7 +886,7 @@
BOOL Ansi)
{
PHOOK HookObj, NextObj;
- PW32CLIENTINFO ClientInfo;
+ PCLIENTINFO ClientInfo;
PWINSTATION_OBJECT WinStaObj;
NTSTATUS Status;
DECLARE_RETURN(LRESULT);
@@ -962,7 +962,7 @@
BOOL Ansi)
{
PWINSTATION_OBJECT WinStaObj;
- PW32CLIENTINFO ClientInfo;
+ PCLIENTINFO ClientInfo;
BOOLEAN Global;
PETHREAD Thread;
PHOOK Hook;
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] Tue Oct 14
16:03:20 2008
@@ -2110,7 +2110,7 @@
case FNID_CALLWNDPROC:
case FNID_CALLWNDPROCRET:
{
- PW32CLIENTINFO ClientInfo = GetWin32ClientInfo();
+ PCLIENTINFO ClientInfo = GetWin32ClientInfo();
PHOOK NextObj, Hook = ClientInfo->phkCurrent;
if (!ClientInfo || !Hook) break;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/misc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/misc.c [iso-8859-1] Tue Oct 14 16:03:20
2008
@@ -437,7 +437,7 @@
{
PTEB Teb;
PW32THREADINFO ti;
- PW32CLIENTINFO ci;
+ PCLIENTINFO ci;
PW32THREAD W32Thread = PsGetCurrentThreadWin32Thread();
if (W32Thread == NULL)
@@ -477,7 +477,7 @@
W32Thread->ThreadInfo = ti;
/* update the TEB */
Teb = NtCurrentTeb();
- ci = ((PW32CLIENTINFO)Teb->Win32ClientInfo);
+ ci = GetWin32ClientInfo();
_SEH_TRY
{
ProbeForWrite(Teb,
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] Tue Oct 14 16:03:20
2008
@@ -330,13 +330,13 @@
static VOID
UserFreeWindowInfo(PW32THREADINFO ti, PWINDOW_OBJECT WindowObject)
{
- PW32CLIENTINFO ClientInfo = GetWin32ClientInfo();
+ PCLIENTINFO ClientInfo = GetWin32ClientInfo();
PWINDOW Wnd = WindowObject->Wnd;
- if (ClientInfo->pvWND == DesktopHeapAddressToUser(WindowObject->Wnd))
+ if (ClientInfo->CallbackWnd.pvWnd ==
DesktopHeapAddressToUser(WindowObject->Wnd))
{
- ClientInfo->hWND = NULL;
- ClientInfo->pvWND = NULL;
+ ClientInfo->CallbackWnd.hWnd = NULL;
+ ClientInfo->CallbackWnd.pvWnd = NULL;
}
if (Wnd->WindowName.Buffer != NULL)