[ros-diffs] [tkreuzer] 36810: 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

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sat Oct 18 21:55:00 CEST 2008


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/include/win32.h?rev=36810&r1=36809&r2=36810&view=diff
==============================================================================
--- 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/main/dllmain.c?rev=36810&r1=36809&r2=36810&view=diff
==============================================================================
--- 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/ntuser/desktop.c?rev=36810&r1=36809&r2=36810&view=diff
==============================================================================
--- 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)



More information about the Ros-diffs mailing list