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

svn path=/trunk/; revision=36810
This commit is contained in:
Timo Kreuzer 2008-10-18 19:54:59 +00:00
parent ab0284e40d
commit a0cd996949
3 changed files with 9 additions and 0 deletions

View file

@ -27,6 +27,7 @@ typedef struct _W32THREAD
typedef struct _THREADINFO
{
W32THREAD W32Thread;
PVOID ppi; // FIXME: use PPROCESSINFO
PDESKTOPINFO pDeskInfo;
PCLIENTINFO pClientInfo;
LIST_ENTRY PtiLink;

View file

@ -212,6 +212,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread,
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 @@ Win32kThreadCallback(struct _ETHREAD *Thread,
}
Win32Thread->IsExiting = FALSE;
co_IntDestroyCaret(Win32Thread);
Win32Thread->ppi = PsGetCurrentProcessWin32Process();
Win32Thread->MessageQueue = MsqCreateMessageQueue(Thread);
Win32Thread->KeyboardLayout = W32kGetDefaultKeyLayout();
if (Win32Thread->ThreadInfo)

View file

@ -1022,6 +1022,7 @@ NtUserCreateDesktop(
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 @@ IntSetThreadDesktop(IN PDESKTOP DesktopObject,
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)