Author: jimtabor
Date: Sun Aug 16 23:44:59 2009
New Revision: 42746
URL:
http://svn.reactos.org/svn/reactos?rev=42746&view=rev
Log:
- [Win32k] Removed W32THREADINFO.
- Tested AbiWord, User32 wine tests. Yes, of course, this needs more testing.
Modified:
trunk/reactos/dll/win32/user32/include/user32.h
trunk/reactos/dll/win32/user32/include/user32p.h
trunk/reactos/dll/win32/user32/misc/dllmain.c
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/dll/win32/user32/windows/window.c
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/include/object.h
trunk/reactos/subsystems/win32/win32k/include/win32.h
trunk/reactos/subsystems/win32/win32k/include/window.h
trunk/reactos/subsystems/win32/win32k/main/dllmain.c
trunk/reactos/subsystems/win32/win32k/ntuser/class.c
trunk/reactos/subsystems/win32/win32k/ntuser/desktop.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/simplecall.c
trunk/reactos/subsystems/win32/win32k/ntuser/timer.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/dll/win32/user32/include/user32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
==============================================================================
--- trunk/reactos/dll/win32/user32/include/user32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/include/user32.h [iso-8859-1] Sun Aug 16 23:44:59 2009
@@ -100,7 +100,7 @@
static __inline PDESKTOPINFO
GetThreadDesktopInfo(VOID)
{
- PW32THREADINFO ti;
+ PTHREADINFO ti;
PDESKTOPINFO di = NULL;
ti = GetW32ThreadInfo();
Modified: trunk/reactos/dll/win32/user32/include/user32p.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
==============================================================================
--- trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/include/user32p.h [iso-8859-1] Sun Aug 16 23:44:59
2009
@@ -199,7 +199,7 @@
union
{
PVOID pi;
- PW32THREADINFO pti; // pointer to Win32ThreadInfo
+ PTHREADINFO pti; // pointer to Win32ThreadInfo
PPROCESSINFO ppi; // pointer to W32ProcessInfo
};
unsigned short type; /* object type (0 if free) */
Modified: trunk/reactos/dll/win32/user32/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/dllm…
==============================================================================
--- trunk/reactos/dll/win32/user32/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/misc/dllmain.c [iso-8859-1] Sun Aug 16 23:44:59 2009
@@ -335,7 +335,7 @@
USERCONNECT UserCon;
// ERR("GetConnected\n");
- if ((PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo == NULL)
+ if ((PTHREADINFO)NtCurrentTeb()->Win32ThreadInfo == NULL)
NtUserGetThreadState(THREADSTATE_GETTHREADINFO);
if (gpsi && g_ppi) return;
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] Sun Aug 16 23:44:59 2009
@@ -104,17 +104,17 @@
return NtUserUpdatePerUserSystemParameters(dwReserved, bEnable);
}
-PW32THREADINFO
+PTHREADINFO
GetW32ThreadInfo(VOID)
{
- PW32THREADINFO ti;
-
- ti = (PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo;
+ PTHREADINFO ti;
+
+ ti = (PTHREADINFO)NtCurrentTeb()->Win32ThreadInfo;
if (ti == NULL)
{
- /* create the W32THREADINFO structure */
+ /* create the THREADINFO structure */
NtUserGetThreadState(THREADSTATE_GETTHREADINFO);
- ti = (PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo;
+ ti = (PTHREADINFO)NtCurrentTeb()->Win32ThreadInfo;
}
return ti;
@@ -250,13 +250,13 @@
IsGUIThread(
BOOL bConvert)
{
- PW32THREADINFO ti = (PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo;
+ PTHREADINFO ti = (PTHREADINFO)NtCurrentTeb()->Win32ThreadInfo;
if (ti == NULL)
{
if(bConvert)
{
NtUserGetThreadState(THREADSTATE_GETTHREADINFO);
- if ((PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo) return TRUE;
+ if ((PTHREADINFO)NtCurrentTeb()->Win32ThreadInfo) return TRUE;
else
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
}
@@ -270,7 +270,7 @@
FASTCALL
TestWindowProcess(PWND Wnd)
{
- if (Wnd->head.pti == (PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo)
+ if (Wnd->head.pti == (PTHREADINFO)NtCurrentTeb()->Win32ThreadInfo)
return TRUE;
else
return (NtUserQueryWindow(Wnd->head.h, QUERY_WINDOW_UNIQUE_PROCESS_ID) ==
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] Sun Aug 16 23:44:59 2009
@@ -369,7 +369,7 @@
IsWinEventHookInstalled(
DWORD event)
{
- if ((PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo)
+ if ((PTHREADINFO)NtCurrentTeb()->Win32ThreadInfo)
{
return (gpsi->dwInstalledEventHooks & GetMaskFromEvent(event)) != 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] Sun Aug 16 23:44:59
2009
@@ -1333,7 +1333,7 @@
if (lpmsg->hwnd != NULL)
{
Wnd = ValidateHwnd(lpmsg->hwnd);
- if (!Wnd || SharedPtrToUser(Wnd->head.pti) != GetW32ThreadInfo())
+ if (!Wnd || Wnd->head.pti != GetW32ThreadInfo())
return 0;
}
else
@@ -1394,7 +1394,7 @@
if (lpmsg->hwnd != NULL)
{
Wnd = ValidateHwnd(lpmsg->hwnd);
- if (!Wnd || SharedPtrToUser(Wnd->head.pti) != GetW32ThreadInfo())
+ if (!Wnd || Wnd->head.pti != GetW32ThreadInfo())
return 0;
}
else
@@ -1791,10 +1791,10 @@
if (Wnd != HWND_BROADCAST && (Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST))
{
PWND Window;
- PW32THREADINFO ti = GetW32ThreadInfo();
+ PTHREADINFO ti = GetW32ThreadInfo();
Window = ValidateHwnd(Wnd);
- if (Window != NULL && SharedPtrToUser(Window->head.pti) == ti &&
!IsThreadHooked(GetWin32ClientInfo()))
+ if (Window != NULL && Window->head.pti == ti &&
!IsThreadHooked(GetWin32ClientInfo()))
{
/* NOTE: We can directly send messages to the window procedure
if *all* the following conditions are met:
@@ -1855,10 +1855,10 @@
if (Wnd != HWND_BROADCAST && (Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST))
{
PWND Window;
- PW32THREADINFO ti = GetW32ThreadInfo();
+ PTHREADINFO ti = GetW32ThreadInfo();
Window = ValidateHwnd(Wnd);
- if (Window != NULL && SharedPtrToUser(Window->head.pti) == ti &&
!IsThreadHooked(GetWin32ClientInfo()))
+ if (Window != NULL && Window->head.pti == ti &&
!IsThreadHooked(GetWin32ClientInfo()))
{
/* NOTE: We can directly send messages to the window procedure
if *all* the following conditions are met:
Modified: trunk/reactos/dll/win32/user32/windows/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/w…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Sun Aug 16 23:44:59 2009
@@ -1316,12 +1316,12 @@
LPDWORD lpdwProcessId)
{
DWORD Ret = 0;
- PW32THREADINFO ti;
+ PTHREADINFO ti;
PWND pWnd = ValidateHwnd(hWnd);
if (!pWnd) return Ret;
- ti = SharedPtrToUser(pWnd->head.pti);
+ ti = pWnd->head.pti;
if (ti)
{
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] Sun Aug 16 23:44:59 2009
@@ -2,6 +2,7 @@
#define __WIN32K_NTUSER_H
typedef struct _PROCESSINFO *PPROCESSINFO;
+typedef struct _THREADINFO *PTHREADINFO;
struct _DESKTOP;
struct _WND;
@@ -72,13 +73,6 @@
DWORD dwcPumpHook;
} CLIENTTHREADINFO, *PCLIENTTHREADINFO;
-typedef struct _W32THREADINFO
-{
- PPROCESSINFO ppi; /* [KERNEL] */
- PDESKTOPINFO pDeskInfo;
- ULONG fsHooks;
-} W32THREADINFO, *PW32THREADINFO;
-
typedef struct _HEAD
{
HANDLE h;
@@ -88,7 +82,7 @@
typedef struct _THROBJHEAD
{
HEAD;
- PW32THREADINFO pti;
+ PTHREADINFO pti;
} THROBJHEAD, *PTHROBJHEAD;
typedef struct _THRDESKHEAD
@@ -701,7 +695,7 @@
LUID luid;
} BROADCASTPARM, *PBROADCASTPARM;
-PW32THREADINFO GetW32ThreadInfo(VOID);
+PTHREADINFO GetW32ThreadInfo(VOID);
PPROCESSINFO GetW32ProcessInfo(VOID);
typedef struct _WNDMSG
Modified: trunk/reactos/subsystems/win32/win32k/include/object.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/object.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/object.h [iso-8859-1] Sun Aug 16
23:44:59 2009
@@ -22,7 +22,7 @@
union
{
PVOID pi;
- PW32THREADINFO pti; // pointer to Win32ThreadInfo
+ PTHREADINFO pti; // pointer to Win32ThreadInfo
PPROCESSINFO ppi; // pointer to W32ProcessInfo
};
unsigned short type; /* object type (0 if free) */
Modified: trunk/reactos/subsystems/win32/win32k/include/win32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/win32.h [iso-8859-1] Sun Aug 16 23:44:59
2009
@@ -88,8 +88,7 @@
LIST_ENTRY W32CallbackListHead;
BOOLEAN IsExiting;
SINGLE_LIST_ENTRY ReferencesList;
- PW32THREADINFO ThreadInfo;
-} THREADINFO, *PTHREADINFO;
+} THREADINFO;
#include <poppack.h>
Modified: trunk/reactos/subsystems/win32/win32k/include/window.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] Sun Aug 16
23:44:59 2009
@@ -26,7 +26,7 @@
PWND Wnd;
/* Pointer to the thread information */
- PW32THREADINFO ti;
+ PTHREADINFO ti;
/* Pointer to the desktop */
PDESKTOPINFO Desktop;
/* system menu handle. */
Modified: trunk/reactos/subsystems/win32/win32k/main/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ma…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/main/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/main/dllmain.c [iso-8859-1] Sun Aug 16 23:44:59
2009
@@ -306,12 +306,6 @@
IntSetThreadDesktop(NULL,
TRUE);
- if (Win32Thread->ThreadInfo != NULL)
- {
- UserHeapFree(Win32Thread->ThreadInfo);
- Win32Thread->ThreadInfo = NULL;
- }
-
PsSetThreadWin32Thread(Thread, NULL);
}
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/class.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/class.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/class.c [iso-8859-1] Sun Aug 16 23:44:59
2009
@@ -1171,7 +1171,6 @@
IN DWORD dwFlags)
{
PTHREADINFO pti;
- PW32THREADINFO ti;
PPROCESSINFO pi;
PCLS Class;
RTL_ATOM ClassAtom;
@@ -1179,15 +1178,14 @@
/* NOTE: Accessing the buffers in ClassName and MenuName may raise exceptions! */
- pti = PsGetCurrentThreadWin32Thread();
- ti = GetW32ThreadInfo();
- if (ti == NULL || !RegisteredSysClasses)
+ pti = GetW32ThreadInfo();
+ if (pti == NULL || !RegisteredSysClasses)
{
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return (RTL_ATOM)0;
}
- pi = ti->ppi;
+ pi = pti->ppi;
/* try to find a previously registered class */
ClassAtom = IntGetClassAtom(ClassName,
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Sun Aug 16
23:44:59 2009
@@ -1846,7 +1846,7 @@
static NTSTATUS
IntUnmapDesktopView(IN PDESKTOP DesktopObject)
{
- PW32THREADINFO ti;
+ PTHREADINFO ti;
PPROCESSINFO CurrentWin32Process;
PW32HEAP_USER_MAPPING HeapMapping, *PrevLink;
NTSTATUS Status = STATUS_SUCCESS;
@@ -1883,10 +1883,6 @@
ti = GetW32ThreadInfo();
if (ti != NULL)
{
- if (ti->pDeskInfo == DesktopObject->DesktopInfo)
- {
- ti->pDeskInfo = NULL;
- }
GetWin32ClientInfo()->pDeskInfo = NULL;
}
GetWin32ClientInfo()->ulClientDelta = 0;
@@ -1897,7 +1893,7 @@
static NTSTATUS
IntMapDesktopView(IN PDESKTOP DesktopObject)
{
- PW32THREADINFO ti;
+ PTHREADINFO ti;
PPROCESSINFO CurrentWin32Process;
PW32HEAP_USER_MAPPING HeapMapping, *PrevLink;
PVOID UserBase = NULL;
@@ -1965,11 +1961,11 @@
GetWin32ClientInfo()->ulClientDelta = DesktopHeapGetUserDelta();
if (ti != NULL)
{
- if (ti->pDeskInfo == NULL)
+ if (GetWin32ClientInfo()->pDeskInfo == NULL)
{
- ti->pDeskInfo = DesktopObject->DesktopInfo;
GetWin32ClientInfo()->pDeskInfo =
- (PVOID)((ULONG_PTR)ti->pDeskInfo -
GetWin32ClientInfo()->ulClientDelta);
+ (PVOID)((ULONG_PTR)DesktopObject->DesktopInfo -
+ GetWin32ClientInfo()->ulClientDelta);
}
}
@@ -2009,15 +2005,6 @@
{
SetLastNtError(Status);
return FALSE;
- }
- }
-
- if (W32Thread->Desktop == NULL)
- {
- PW32THREADINFO ti = GetW32ThreadInfo();
- if (ti != NULL)
- {
- ti->pDeskInfo = NULL;
}
}
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] Sun Aug 16 23:44:59
2009
@@ -117,9 +117,6 @@
W32Thread->fsHooks |= HOOKID_TO_FLAG(HookId);
GetWin32ClientInfo()->fsHooks = W32Thread->fsHooks;
-
- if (W32Thread->ThreadInfo != NULL)
- W32Thread->ThreadInfo->fsHooks = W32Thread->fsHooks;
}
RtlInitUnicodeString(&Hook->ModuleName, NULL);
@@ -242,9 +239,6 @@
W32Thread->fsHooks &= ~HOOKID_TO_FLAG(Hook->HookId);
GetWin32ClientInfo()->fsHooks = W32Thread->fsHooks;
-
- if (W32Thread->ThreadInfo != NULL)
- W32Thread->ThreadInfo->fsHooks = W32Thread->fsHooks;
if (0 != Table->Counts[HOOKID_TO_INDEX(Hook->HookId)])
{
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 Aug 16
23:44:59 2009
@@ -1,21 +1,3 @@
-/*
- * ReactOS W32 Subsystem
- * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -307,7 +289,7 @@
{
BOOL SameThread = FALSE;
- if (Window->ti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread())->ThreadInfo)
+ if (Window->ti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
SameThread = TRUE;
if ((!SameThread && (Window->ti->fsHooks &
HOOKID_TO_FLAG(WH_CALLWNDPROC))) ||
@@ -329,7 +311,7 @@
{
BOOL SameThread = FALSE;
- if (Window->ti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread())->ThreadInfo)
+ if (Window->ti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
SameThread = TRUE;
if ((!SameThread && (Window->ti->fsHooks &
HOOKID_TO_FLAG(WH_CALLWNDPROCRET))) ||
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] Sun Aug 16 23:44:59
2009
@@ -451,11 +451,10 @@
return (PPROCESSINFO)PsGetCurrentProcessWin32Process();
}
-PW32THREADINFO
+PTHREADINFO
GetW32ThreadInfo(VOID)
{
PTEB Teb;
- PW32THREADINFO ti;
PPROCESSINFO ppi;
PCLIENTINFO pci;
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
@@ -465,67 +464,49 @@
/* FIXME - temporary hack for system threads... */
return NULL;
}
-
- /* allocate a THREADINFO structure if neccessary */
- if (pti->ThreadInfo == NULL)
+ /* initialize it */
+ pti->ppi = ppi = GetW32ProcessInfo();
+
+ pti->pcti = &pti->cti; // FIXME Need to set it in desktop.c!
+
+ if (pti->Desktop != NULL)
{
- ti = UserHeapAlloc(sizeof(W32THREADINFO));
- if (ti != NULL)
+ pti->pDeskInfo = pti->Desktop->DesktopInfo;
+ }
+ else
+ {
+ pti->pDeskInfo = NULL;
+ }
+ /* update the TEB */
+ Teb = NtCurrentTeb();
+ pci = GetWin32ClientInfo();
+ pti->pClientInfo = pci;
+ _SEH2_TRY
+ {
+ ProbeForWrite( Teb,
+ sizeof(TEB),
+ sizeof(ULONG));
+
+ Teb->Win32ThreadInfo = (PW32THREAD) pti;
+
+ pci->pClientThreadInfo = NULL; // FIXME Need to set it in desktop.c!
+ pci->ppi = ppi;
+ pci->fsHooks = pti->fsHooks;
+ /* CI may not have been initialized. */
+ if (!pci->pDeskInfo && pti->pDeskInfo)
{
- RtlZeroMemory(ti,
- sizeof(W32THREADINFO));
-
- /* initialize it */
- ti->ppi = ppi = GetW32ProcessInfo();
- ti->fsHooks = pti->fsHooks;
- pti->pcti = &pti->cti; // FIXME Need to set it in desktop.c!
- if (pti->Desktop != NULL)
- {
- pti->pDeskInfo = ti->pDeskInfo = pti->Desktop->DesktopInfo;
- }
- else
- {
- pti->pDeskInfo = ti->pDeskInfo = NULL;
- }
-
- pti->ThreadInfo = ti;
- /* update the TEB */
- Teb = NtCurrentTeb();
- pci = GetWin32ClientInfo();
- pti->pClientInfo = pci;
- _SEH2_TRY
- {
- ProbeForWrite(Teb,
- sizeof(TEB),
- sizeof(ULONG));
-
- Teb->Win32ThreadInfo = UserHeapAddressToUser(pti->ThreadInfo);
-
- pci->pClientThreadInfo = NULL; // FIXME Need to set it in desktop.c!
- pci->ppi = ppi;
- pci->fsHooks = pti->fsHooks;
- /* CI may not have been initialized. */
- if (!pci->pDeskInfo && pti->pDeskInfo)
- {
- if (!pci->ulClientDelta) pci->ulClientDelta =
DesktopHeapGetUserDelta();
-
- pci->pDeskInfo =
- (PVOID)((ULONG_PTR)pti->pDeskInfo -
pci->ulClientDelta);
- }
- }
- _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
- {
- SetLastNtError(_SEH2_GetExceptionCode());
- }
- _SEH2_END;
- }
- else
- {
- SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
+ if (!pci->ulClientDelta) pci->ulClientDelta =
DesktopHeapGetUserDelta();
+
+ pci->pDeskInfo = (PVOID)((ULONG_PTR)pti->pDeskInfo -
pci->ulClientDelta);
}
}
-
- return pti->ThreadInfo;
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ SetLastNtError(_SEH2_GetExceptionCode());
+ }
+ _SEH2_END;
+
+ return pti;
}
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] Sun Aug 16
23:44:59 2009
@@ -164,7 +164,7 @@
case ONEPARAM_ROUTINE_GETDESKTOPMAPPING:
{
- PW32THREADINFO ti;
+ PTHREADINFO ti;
ti = GetW32ThreadInfo();
if (ti != NULL)
{
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/timer.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/timer.c [iso-8859-1] Sun Aug 16 23:44:59
2009
@@ -1,21 +1,3 @@
-/*
- * ReactOS W32 Subsystem
- * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
@@ -162,7 +144,8 @@
{
if ( (lParam == (LPARAM)pTmr->pfn) &&
(pTmr->flags & (TMRF_SYSTEM|TMRF_RIT)) &&
- (pTmr->pti->ThreadInfo->ppi == pti->ThreadInfo->ppi) )
+// (pTmr->head.pti->ppi == pti->ppi) )
+ (pTmr->pti->ppi == pti->ppi) )
break;
pTmr = (PTIMER)pTmr->ptmrList.Flink;
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 Aug 16 23:44:59
2009
@@ -103,7 +103,7 @@
/* temp hack */
PWINDOW_OBJECT FASTCALL UserGetWindowObject(HWND hWnd)
{
- PW32THREADINFO ti;
+ PTHREADINFO ti;
PWINDOW_OBJECT Window;
if (PsGetCurrentProcess() != PsInitialSystemProcess)
@@ -314,7 +314,7 @@
}
static VOID
-UserFreeWindowInfo(PW32THREADINFO ti, PWINDOW_OBJECT WindowObject)
+UserFreeWindowInfo(PTHREADINFO ti, PWINDOW_OBJECT WindowObject)
{
PCLIENTINFO ClientInfo = GetWin32ClientInfo();
PWND Wnd = WindowObject->Wnd;
@@ -1551,7 +1551,7 @@
HWND hWnd;
POINT Pos;
SIZE Size;
- PW32THREADINFO ti = NULL;
+ PTHREADINFO ti = NULL;
#if 0
POINT MaxSize, MaxPos, MinTrack, MaxTrack;
@@ -3311,7 +3311,7 @@
DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
NTSTATUS Status;
- PW32THREADINFO ti;
+ PTHREADINFO ti;
DPRINT("Enter NtUserSetShellWindowEx\n");
UserEnterExclusive();