Author: tkreuzer
Date: Sat Oct 18 14:54:59 2008
New Revision: 36810
URL:
http://svn.reactos.org/svn/reactos?rev=36810&view=rev
Log:
Win32 structure cleanup (WIP):
- Add ppi to THREADINFO and initialize it
- Initialize THREADINFO.PtiLink and DESKTOP.PtiList and link the thread to it's
desktop
Modified:
trunk/reactos/subsystems/win32/win32k/include/win32.h
trunk/reactos/subsystems/win32/win32k/main/dllmain.c
trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
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] Sat Oct 18 14:54:59
2008
@@ -27,6 +27,7 @@
typedef struct _THREADINFO
{
W32THREAD W32Thread;
+ PVOID ppi; // FIXME: use PPROCESSINFO
PDESKTOPINFO pDeskInfo;
PCLIENTINFO pClientInfo;
LIST_ENTRY PtiLink;
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] Sat Oct 18 14:54:59
2008
@@ -212,6 +212,7 @@
InitializeListHead(&Win32Thread->WindowListHead);
InitializeListHead(&Win32Thread->W32CallbackListHead);
+ InitializeListHead(&Win32Thread->PtiLink);
/*
* inherit the thread desktop and process window station (if not yet inherited)
from the process startup
@@ -268,6 +269,7 @@
}
Win32Thread->IsExiting = FALSE;
co_IntDestroyCaret(Win32Thread);
+ Win32Thread->ppi = PsGetCurrentProcessWin32Process();
Win32Thread->MessageQueue = MsqCreateMessageQueue(Thread);
Win32Thread->KeyboardLayout = W32kGetDefaultKeyLayout();
if (Win32Thread->ThreadInfo)
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] Sat Oct 18
14:54:59 2008
@@ -1022,6 +1022,7 @@
IntGetDesktopWorkArea(DesktopObject, NULL);
/* Initialize some local (to win32k) desktop state. */
+ InitializeListHead(&DesktopObject->PtiList);
DesktopObject->ActiveMessageQueue = NULL;
ExFreePoolWithTag(DesktopName.Buffer, TAG_STRING);
@@ -1918,9 +1919,14 @@
return FALSE;
}
+ /* Remove the thread from the old desktop's list */
+ RemoveEntryList(&W32Thread->PtiLink);
+
if (DesktopObject != NULL)
{
ObReferenceObject(DesktopObject);
+ /* Insert into new desktop's list */
+ InsertTailList(&DesktopObject->PtiList, &W32Thread->PtiLink);
}
if (OldDesktop != NULL)