- Updated headers and related files.

svn path=/trunk/; revision=45070
This commit is contained in:
James Tabor 2010-01-14 02:52:12 +00:00
parent 058c21696d
commit 1e2a5d67cd
18 changed files with 74 additions and 76 deletions

View file

@ -8,6 +8,8 @@ typedef struct _DESKTOP
{ {
PDESKTOPINFO pDeskInfo; PDESKTOPINFO pDeskInfo;
LIST_ENTRY ListEntry; LIST_ENTRY ListEntry;
/* Pointer to the associated window station. */
struct _WINSTATION_OBJECT *rpwinstaParent;
PWND spwndForeground; PWND spwndForeground;
PWND spwndTray; PWND spwndTray;
PWND spwndMessage; PWND spwndMessage;
@ -23,12 +25,8 @@ typedef struct _DESKTOP
DWORD dwMouseHoverTime; DWORD dwMouseHoverTime;
/* ReactOS */ /* ReactOS */
CSHORT Type;
CSHORT Size;
/* Rectangle of the work area */ /* Rectangle of the work area */
RECTL WorkArea; RECTL WorkArea;
/* Pointer to the associated window station. */
struct _WINSTATION_OBJECT *WindowStation;
/* Pointer to the active queue. */ /* Pointer to the active queue. */
PVOID ActiveMessageQueue; PVOID ActiveMessageQueue;
/* Handle of the desktop window. */ /* Handle of the desktop window. */
@ -130,7 +128,7 @@ VOID co_IntShellHookNotify(WPARAM Message, LPARAM lParam);
HDC FASTCALL UserGetDesktopDC(ULONG,BOOL,BOOL); HDC FASTCALL UserGetDesktopDC(ULONG,BOOL,BOOL);
#define IntIsActiveDesktop(Desktop) \ #define IntIsActiveDesktop(Desktop) \
((Desktop)->WindowStation->ActiveDesktop == (Desktop)) ((Desktop)->rpwinstaParent->ActiveDesktop == (Desktop))
#define GET_DESKTOP_NAME(d) \ #define GET_DESKTOP_NAME(d) \
OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(d)) ? \ OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(d)) ? \
@ -210,10 +208,10 @@ DesktopHeapGetUserDelta(VOID)
ULONG_PTR Delta = 0; ULONG_PTR Delta = 0;
pti = PsGetCurrentThreadWin32Thread(); pti = PsGetCurrentThreadWin32Thread();
if (!pti->Desktop) if (!pti->rpdesk)
return 0; return 0;
pheapDesktop = pti->Desktop->pheapDesktop; pheapDesktop = pti->rpdesk->pheapDesktop;
W32Process = PsGetCurrentProcessWin32Process(); W32Process = PsGetCurrentProcessWin32Process();
Mapping = W32Process->HeapMappings.Next; Mapping = W32Process->HeapMappings.Next;

View file

@ -70,7 +70,7 @@ typedef struct _THREADINFO
struct _USER_MESSAGE_QUEUE* MessageQueue; struct _USER_MESSAGE_QUEUE* MessageQueue;
struct _KBL* KeyboardLayout; struct _KBL* KeyboardLayout;
PCLIENTTHREADINFO pcti; PCLIENTTHREADINFO pcti;
struct _DESKTOP* Desktop; struct _DESKTOP* rpdesk;
PDESKTOPINFO pDeskInfo; PDESKTOPINFO pDeskInfo;
PCLIENTINFO pClientInfo; PCLIENTINFO pClientInfo;
FLONG TIF_flags; FLONG TIF_flags;
@ -78,7 +78,7 @@ typedef struct _THREADINFO
LONG timeLast; LONG timeLast;
ULONG_PTR idLast; ULONG_PTR idLast;
INT exitCode; INT exitCode;
HANDLE hDesktop; HDESK hdesk;
UINT cPaintsReady; /* Count of paints pending. */ UINT cPaintsReady; /* Count of paints pending. */
UINT cTimersReady; /* Count of timers pending. */ UINT cTimersReady; /* Count of timers pending. */
DWORD dwExpWinVer; DWORD dwExpWinVer;

View file

@ -246,7 +246,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread,
if (hDesk != NULL) if (hDesk != NULL)
{ {
PDESKTOP DesktopObject; PDESKTOP DesktopObject;
Win32Thread->Desktop = NULL; Win32Thread->rpdesk = NULL;
Status = ObReferenceObjectByHandle(hDesk, Status = ObReferenceObjectByHandle(hDesk,
0, 0,
ExDesktopObjectType, ExDesktopObjectType,

View file

@ -62,7 +62,7 @@ IntSetCaretBlinkTime(UINT uMSeconds)
{ {
/* Don't save the new value to the registry! */ /* Don't save the new value to the registry! */
PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PWINSTATION_OBJECT WinStaObject = pti->Desktop->WindowStation; PWINSTATION_OBJECT WinStaObject = pti->rpdesk->rpwinstaParent;
/* windows doesn't do this check */ /* windows doesn't do this check */
if((uMSeconds < MIN_CARETBLINKRATE) || (uMSeconds > MAX_CARETBLINKRATE)) if((uMSeconds < MIN_CARETBLINKRATE) || (uMSeconds > MAX_CARETBLINKRATE))
@ -152,7 +152,7 @@ IntGetCaretBlinkTime(VOID)
UINT Ret; UINT Ret;
pti = PsGetCurrentThreadWin32Thread(); pti = PsGetCurrentThreadWin32Thread();
WinStaObject = pti->Desktop->WindowStation; WinStaObject = pti->rpdesk->rpwinstaParent;
Ret = WinStaObject->CaretBlinkRate; Ret = WinStaObject->CaretBlinkRate;
if(!Ret) if(!Ret)

View file

@ -1265,7 +1265,7 @@ UserRegisterClass(IN CONST WNDCLASSEXW* lpwcx,
MenuName, MenuName,
fnID, fnID,
dwFlags, dwFlags,
pti->Desktop, pti->rpdesk,
pi); pi);
if (Class != NULL) if (Class != NULL)

View file

@ -1133,7 +1133,7 @@ IntIncrementSequenceNumber(VOID)
PWINSTATION_OBJECT WinStaObj; PWINSTATION_OBJECT WinStaObj;
pti = PsGetCurrentThreadWin32Thread(); pti = PsGetCurrentThreadWin32Thread();
WinStaObj = pti->Desktop->WindowStation; WinStaObj = pti->rpdesk->rpwinstaParent;
WinStaObj->Clipboard->ClipboardSequenceNumber++; WinStaObj->Clipboard->ClipboardSequenceNumber++;
} }

View file

@ -144,10 +144,10 @@ IntDesktopObjectParse(IN PVOID ParseObject,
/* Initialize shell hook window list and set the parent */ /* Initialize shell hook window list and set the parent */
RtlZeroMemory(Desktop, sizeof(DESKTOP)); RtlZeroMemory(Desktop, sizeof(DESKTOP));
InitializeListHead(&Desktop->ShellHookWindows); InitializeListHead(&Desktop->ShellHookWindows);
Desktop->WindowStation = (PWINSTATION_OBJECT)ParseObject; Desktop->rpwinstaParent = (PWINSTATION_OBJECT)ParseObject;
/* Put the desktop on the window station's list of associated desktops */ /* Put the desktop on the window station's list of associated desktops */
InsertTailList(&Desktop->WindowStation->DesktopListHead, InsertTailList(&Desktop->rpwinstaParent->DesktopListHead,
&Desktop->ListEntry); &Desktop->ListEntry);
/* Set the desktop object and return success */ /* Set the desktop object and return success */
@ -572,7 +572,7 @@ HWND FASTCALL IntGetMessageWindow(VOID)
HWND FASTCALL IntGetCurrentThreadDesktopWindow(VOID) HWND FASTCALL IntGetCurrentThreadDesktopWindow(VOID)
{ {
PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PDESKTOP pdo = pti->Desktop; PDESKTOP pdo = pti->rpdesk;
if (NULL == pdo) if (NULL == pdo)
{ {
DPRINT1("Thread doesn't have a desktop\n"); DPRINT1("Thread doesn't have a desktop\n");
@ -796,7 +796,7 @@ VOID co_IntShellHookNotify(WPARAM Message, LPARAM lParam)
BOOL IntRegisterShellHookWindow(HWND hWnd) BOOL IntRegisterShellHookWindow(HWND hWnd)
{ {
PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PDESKTOP Desktop = pti->Desktop; PDESKTOP Desktop = pti->rpdesk;
PSHELL_HOOK_WINDOW Entry; PSHELL_HOOK_WINDOW Entry;
DPRINT("IntRegisterShellHookWindow\n"); DPRINT("IntRegisterShellHookWindow\n");
@ -828,7 +828,7 @@ BOOL IntRegisterShellHookWindow(HWND hWnd)
BOOL IntDeRegisterShellHookWindow(HWND hWnd) BOOL IntDeRegisterShellHookWindow(HWND hWnd)
{ {
PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PDESKTOP Desktop = pti->Desktop; PDESKTOP Desktop = pti->rpdesk;
PSHELL_HOOK_WINDOW Current; PSHELL_HOOK_WINDOW Current;
LIST_FOR_EACH(Current, &Desktop->ShellHookWindows, SHELL_HOOK_WINDOW, ListEntry) LIST_FOR_EACH(Current, &Desktop->ShellHookWindows, SHELL_HOOK_WINDOW, ListEntry)
@ -1103,7 +1103,7 @@ NtUserCreateDesktop(
W32Thread = PsGetCurrentThreadWin32Thread(); W32Thread = PsGetCurrentThreadWin32Thread();
if (!W32Thread->Desktop) IntSetThreadDesktop(DesktopObject,FALSE); if (!W32Thread->rpdesk) IntSetThreadDesktop(DesktopObject,FALSE);
/* /*
Based on wine/server/window.c in get_desktop_window. Based on wine/server/window.c in get_desktop_window.
@ -1447,7 +1447,7 @@ NtUserPaintDesktop(HDC hDC)
UINT align_old; UINT align_old;
int mode_old; int mode_old;
PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PWINSTATION_OBJECT WinSta = pti->Desktop->WindowStation; PWINSTATION_OBJECT WinSta = pti->rpdesk->rpwinstaParent;
DECLARE_RETURN(BOOL); DECLARE_RETURN(BOOL);
UserEnterExclusive(); UserEnterExclusive();
@ -1676,7 +1676,7 @@ NtUserSwitchDesktop(HDESK hDesktop)
* Don't allow applications switch the desktop if it's locked, unless the caller * Don't allow applications switch the desktop if it's locked, unless the caller
* is the logon application itself * is the logon application itself
*/ */
if((DesktopObject->WindowStation->Flags & WSS_LOCKED) && if((DesktopObject->rpwinstaParent->Flags & WSS_LOCKED) &&
LogonProcess != NULL && LogonProcess != PsGetCurrentProcessWin32Process()) LogonProcess != NULL && LogonProcess != PsGetCurrentProcessWin32Process())
{ {
ObDereferenceObject(DesktopObject); ObDereferenceObject(DesktopObject);
@ -1684,7 +1684,7 @@ NtUserSwitchDesktop(HDESK hDesktop)
RETURN(FALSE); RETURN(FALSE);
} }
if(DesktopObject->WindowStation != InputWindowStation) if(DesktopObject->rpwinstaParent != InputWindowStation)
{ {
ObDereferenceObject(DesktopObject); ObDereferenceObject(DesktopObject);
DPRINT1("Switching desktop 0x%x denied because desktop doesn't belong to the interactive winsta!\n", hDesktop); DPRINT1("Switching desktop 0x%x denied because desktop doesn't belong to the interactive winsta!\n", hDesktop);
@ -1763,14 +1763,14 @@ NtUserGetThreadDesktop(DWORD dwThreadId, DWORD Unknown1)
{ {
/* just return the handle, we queried the desktop handle of a thread running /* just return the handle, we queried the desktop handle of a thread running
in the same context */ in the same context */
Ret = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hDesktop; Ret = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hdesk;
ObDereferenceObject(Thread); ObDereferenceObject(Thread);
RETURN(Ret); RETURN(Ret);
} }
/* get the desktop handle and the desktop of the thread */ /* get the desktop handle and the desktop of the thread */
if(!(hThreadDesktop = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hDesktop) || if(!(hThreadDesktop = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hdesk) ||
!(DesktopObject = ((PTHREADINFO)Thread->Tcb.Win32Thread)->Desktop)) !(DesktopObject = ((PTHREADINFO)Thread->Tcb.Win32Thread)->rpdesk))
{ {
ObDereferenceObject(Thread); ObDereferenceObject(Thread);
DPRINT1("Desktop information of thread 0x%x broken!?\n", dwThreadId); DPRINT1("Desktop information of thread 0x%x broken!?\n", dwThreadId);
@ -1954,9 +1954,9 @@ IntSetThreadDesktop(IN PDESKTOP DesktopObject,
MapHeap = (PsGetCurrentProcess() != PsInitialSystemProcess); MapHeap = (PsGetCurrentProcess() != PsInitialSystemProcess);
W32Thread = PsGetCurrentThreadWin32Thread(); W32Thread = PsGetCurrentThreadWin32Thread();
if (W32Thread->Desktop != DesktopObject) if (W32Thread->rpdesk != DesktopObject)
{ {
OldDesktop = W32Thread->Desktop; OldDesktop = W32Thread->rpdesk;
if (!IsListEmpty(&W32Thread->WindowListHead)) if (!IsListEmpty(&W32Thread->WindowListHead))
{ {
@ -1965,7 +1965,7 @@ IntSetThreadDesktop(IN PDESKTOP DesktopObject,
return FALSE; return FALSE;
} }
W32Thread->Desktop = DesktopObject; W32Thread->rpdesk = DesktopObject;
if (MapHeap && DesktopObject != NULL) if (MapHeap && DesktopObject != NULL)
{ {

View file

@ -121,7 +121,7 @@ IntAddHook(PETHREAD Thread, int HookId, BOOLEAN Global, PWINSTATION_OBJECT WinSt
W32Thread->pDeskInfo->fsHooks= W32Thread->fsHooks; W32Thread->pDeskInfo->fsHooks= W32Thread->fsHooks;
Hook->head.pti = W32Thread; Hook->head.pti = W32Thread;
Hook->head.rpdesk = W32Thread->Desktop; Hook->head.rpdesk = W32Thread->rpdesk;
} }
RtlInitUnicodeString(&Hook->ModuleName, NULL); RtlInitUnicodeString(&Hook->ModuleName, NULL);

View file

@ -990,7 +990,7 @@ IntBlockInput(PTHREADINFO W32Thread, BOOL BlockIt)
PTHREADINFO OldBlock; PTHREADINFO OldBlock;
ASSERT(W32Thread); ASSERT(W32Thread);
if(!W32Thread->Desktop || ((W32Thread->TIF_flags & TIF_INCLEANUP) && BlockIt)) if(!W32Thread->rpdesk || ((W32Thread->TIF_flags & TIF_INCLEANUP) && BlockIt))
{ {
/* /*
* fail blocking if exiting the thread * fail blocking if exiting the thread
@ -1004,14 +1004,14 @@ IntBlockInput(PTHREADINFO W32Thread, BOOL BlockIt)
* e.g. services running in the service window station cannot block input * e.g. services running in the service window station cannot block input
*/ */
if(!ThreadHasInputAccess(W32Thread) || if(!ThreadHasInputAccess(W32Thread) ||
!IntIsActiveDesktop(W32Thread->Desktop)) !IntIsActiveDesktop(W32Thread->rpdesk))
{ {
SetLastWin32Error(ERROR_ACCESS_DENIED); SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE; return FALSE;
} }
ASSERT(W32Thread->Desktop); ASSERT(W32Thread->rpdesk);
OldBlock = W32Thread->Desktop->BlockInputThread; OldBlock = W32Thread->rpdesk->BlockInputThread;
if(OldBlock) if(OldBlock)
{ {
if(OldBlock != W32Thread) if(OldBlock != W32Thread)
@ -1019,11 +1019,11 @@ IntBlockInput(PTHREADINFO W32Thread, BOOL BlockIt)
SetLastWin32Error(ERROR_ACCESS_DENIED); SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE; return FALSE;
} }
W32Thread->Desktop->BlockInputThread = (BlockIt ? W32Thread : NULL); W32Thread->rpdesk->BlockInputThread = (BlockIt ? W32Thread : NULL);
return OldBlock == NULL; return OldBlock == NULL;
} }
W32Thread->Desktop->BlockInputThread = (BlockIt ? W32Thread : NULL); W32Thread->rpdesk->BlockInputThread = (BlockIt ? W32Thread : NULL);
return OldBlock == NULL; return OldBlock == NULL;
} }
@ -1394,7 +1394,7 @@ UserAttachThreadInput( PTHREADINFO pti, PTHREADINFO ptiTo, BOOL fAttach)
/* Do not attach to system threads or between different desktops. */ /* Do not attach to system threads or between different desktops. */
if ( pti->TIF_flags & TIF_DONTATTACHQUEUE || if ( pti->TIF_flags & TIF_DONTATTACHQUEUE ||
ptiTo->TIF_flags & TIF_DONTATTACHQUEUE || ptiTo->TIF_flags & TIF_DONTATTACHQUEUE ||
pti->Desktop != ptiTo->Desktop ) pti->rpdesk != ptiTo->rpdesk )
return FALSE; return FALSE;
/* If Attach set, allocate and link. */ /* If Attach set, allocate and link. */
@ -1451,7 +1451,7 @@ NtUserSendInput(
W32Thread = PsGetCurrentThreadWin32Thread(); W32Thread = PsGetCurrentThreadWin32Thread();
ASSERT(W32Thread); ASSERT(W32Thread);
if(!W32Thread->Desktop) if(!W32Thread->rpdesk)
{ {
RETURN( 0); RETURN( 0);
} }
@ -1467,7 +1467,7 @@ NtUserSendInput(
* e.g. services running in the service window station cannot block input * e.g. services running in the service window station cannot block input
*/ */
if(!ThreadHasInputAccess(W32Thread) || if(!ThreadHasInputAccess(W32Thread) ||
!IntIsActiveDesktop(W32Thread->Desktop)) !IntIsActiveDesktop(W32Thread->rpdesk))
{ {
SetLastWin32Error(ERROR_ACCESS_DENIED); SetLastWin32Error(ERROR_ACCESS_DENIED);
RETURN( 0); RETURN( 0);

View file

@ -191,13 +191,13 @@ NtUserGetGUIThreadInfo(
SetLastWin32Error(ERROR_ACCESS_DENIED); SetLastWin32Error(ERROR_ACCESS_DENIED);
RETURN( FALSE); RETURN( FALSE);
} }
Desktop = ((PTHREADINFO)Thread->Tcb.Win32Thread)->Desktop; Desktop = ((PTHREADINFO)Thread->Tcb.Win32Thread)->rpdesk;
} }
else else
{ {
/* get the foreground thread */ /* get the foreground thread */
PTHREADINFO W32Thread = (PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread; PTHREADINFO W32Thread = (PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread;
Desktop = W32Thread->Desktop; Desktop = W32Thread->rpdesk;
if(Desktop) if(Desktop)
{ {
MsgQueue = Desktop->ActiveMessageQueue; MsgQueue = Desktop->ActiveMessageQueue;
@ -474,9 +474,9 @@ GetW32ThreadInfo(VOID)
pti->pcti = &pti->cti; // FIXME Need to set it in desktop.c! pti->pcti = &pti->cti; // FIXME Need to set it in desktop.c!
if (pti->Desktop != NULL) if (pti->rpdesk != NULL)
{ {
pti->pDeskInfo = pti->Desktop->pDeskInfo; pti->pDeskInfo = pti->rpdesk->pDeskInfo;
} }
else else
{ {

View file

@ -240,7 +240,7 @@ MsqIsClkLck(LPMSG Msg, BOOL Remove)
BOOL Res = FALSE; BOOL Res = FALSE;
pti = PsGetCurrentThreadWin32Thread(); pti = PsGetCurrentThreadWin32Thread();
if (pti->Desktop == NULL) if (pti->rpdesk == NULL)
{ {
return FALSE; return FALSE;
} }
@ -281,7 +281,7 @@ MsqIsDblClk(LPMSG Msg, BOOL Remove)
BOOL Res; BOOL Res;
pti = PsGetCurrentThreadWin32Thread(); pti = PsGetCurrentThreadWin32Thread();
if (pti->Desktop == NULL) if (pti->rpdesk == NULL)
{ {
return FALSE; return FALSE;
} }

View file

@ -702,7 +702,7 @@ co_IntFixCaret(PWINDOW_OBJECT Window, RECTL *lprc, UINT flags)
ASSERT_REFS_CO(Window); ASSERT_REFS_CO(Window);
Desktop = ((PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread)->Desktop; Desktop = ((PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread)->rpdesk;
CaretInfo = ((PUSER_MESSAGE_QUEUE)Desktop->ActiveMessageQueue)->CaretInfo; CaretInfo = ((PUSER_MESSAGE_QUEUE)Desktop->ActiveMessageQueue)->CaretInfo;
hWndCaret = CaretInfo->hWnd; hWndCaret = CaretInfo->hWnd;

View file

@ -309,7 +309,7 @@ NtUserCallOneParam(
BOOL Ret = TRUE; BOOL Ret = TRUE;
PPOINTL pptl; PPOINTL pptl;
PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
if (pti->hDesktop != InputDesktopHandle) RETURN(FALSE); if (pti->hdesk != InputDesktopHandle) RETURN(FALSE);
_SEH2_TRY _SEH2_TRY
{ {
pptl = (PPOINTL)Param; pptl = (PPOINTL)Param;

View file

@ -898,7 +898,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
case SPI_GETWORKAREA: // FIXME: the workarea should be part of the MONITOR case SPI_GETWORKAREA: // FIXME: the workarea should be part of the MONITOR
{ {
PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PDESKTOP pdesktop = pti->Desktop; PDESKTOP pdesktop = pti->rpdesk;
RECTL rclWorkarea; RECTL rclWorkarea;
if(!pdesktop) if(!pdesktop)
@ -911,7 +911,7 @@ SpiGetSet(UINT uiAction, UINT uiParam, PVOID pvParam, FLONG fl)
case SPI_SETWORKAREA: // FIXME: the workarea should be part of the MONITOR case SPI_SETWORKAREA: // FIXME: the workarea should be part of the MONITOR
{ {
PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PDESKTOP pdesktop = pti->Desktop; PDESKTOP pdesktop = pti->rpdesk;
RECT rcWorkArea; RECT rcWorkArea;
if(!pdesktop) if(!pdesktop)

View file

@ -37,7 +37,7 @@ IntAddAtom(LPWSTR AtomName)
RTL_ATOM Atom; RTL_ATOM Atom;
pti = PsGetCurrentThreadWin32Thread(); pti = PsGetCurrentThreadWin32Thread();
if (pti->Desktop == NULL) if (pti->rpdesk == NULL)
{ {
SetLastNtError(Status); SetLastNtError(Status);
return (RTL_ATOM)0; return (RTL_ATOM)0;
@ -61,7 +61,7 @@ IntGetAtomName(RTL_ATOM nAtom, LPWSTR lpBuffer, ULONG nSize)
ULONG Size = nSize; ULONG Size = nSize;
pti = PsGetCurrentThreadWin32Thread(); pti = PsGetCurrentThreadWin32Thread();
if (pti->Desktop == NULL) if (pti->rpdesk == NULL)
{ {
SetLastNtError(Status); SetLastNtError(Status);
return 0; return 0;

View file

@ -438,13 +438,13 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
/* don't remove the WINDOWSTATUS_DESTROYING bit */ /* don't remove the WINDOWSTATUS_DESTROYING bit */
/* reset shell window handles */ /* reset shell window handles */
if(ThreadData->Desktop) if(ThreadData->rpdesk)
{ {
if (Window->hSelf == ThreadData->Desktop->WindowStation->ShellWindow) if (Window->hSelf == ThreadData->rpdesk->rpwinstaParent->ShellWindow)
ThreadData->Desktop->WindowStation->ShellWindow = NULL; ThreadData->rpdesk->rpwinstaParent->ShellWindow = NULL;
if (Window->hSelf == ThreadData->Desktop->WindowStation->ShellListView) if (Window->hSelf == ThreadData->rpdesk->rpwinstaParent->ShellListView)
ThreadData->Desktop->WindowStation->ShellListView = NULL; ThreadData->rpdesk->rpwinstaParent->ShellListView = NULL;
} }
/* Unregister hot keys */ /* Unregister hot keys */
@ -861,7 +861,7 @@ IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu)
{ {
W32Thread = PsGetCurrentThreadWin32Thread(); W32Thread = PsGetCurrentThreadWin32Thread();
if(!W32Thread->Desktop) if(!W32Thread->rpdesk)
return NULL; return NULL;
if(Window->SystemMenu) if(Window->SystemMenu)
@ -874,10 +874,10 @@ IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu)
} }
} }
if(W32Thread->Desktop->WindowStation->SystemMenuTemplate) if(W32Thread->rpdesk->rpwinstaParent->SystemMenuTemplate)
{ {
/* clone system menu */ /* clone system menu */
Menu = UserGetMenuObject(W32Thread->Desktop->WindowStation->SystemMenuTemplate); Menu = UserGetMenuObject(W32Thread->rpdesk->rpwinstaParent->SystemMenuTemplate);
if(!Menu) if(!Menu)
return NULL; return NULL;
@ -1703,9 +1703,9 @@ co_IntCreateWindowEx(DWORD dwExStyle,
pti = PsGetCurrentThreadWin32Thread(); pti = PsGetCurrentThreadWin32Thread();
if (pti->Desktop) if (pti->rpdesk)
{ {
ParentWindowHandle = pti->Desktop->DesktopWindow; ParentWindowHandle = pti->rpdesk->DesktopWindow;
} }
@ -1759,7 +1759,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
/* Check the window station. */ /* Check the window station. */
ti = GetW32ThreadInfo(); ti = GetW32ThreadInfo();
if (ti == NULL || pti->Desktop == NULL) if (ti == NULL || pti->rpdesk == NULL)
{ {
DPRINT1("Thread is not attached to a desktop! Cannot create window!\n"); DPRINT1("Thread is not attached to a desktop! Cannot create window!\n");
RETURN( (PWND)0); RETURN( (PWND)0);
@ -1792,14 +1792,14 @@ co_IntCreateWindowEx(DWORD dwExStyle,
DPRINT("ClassAtom %x\n", ClassAtom); DPRINT("ClassAtom %x\n", ClassAtom);
Class = IntReferenceClass(Class, Class = IntReferenceClass(Class,
ClassLink, ClassLink,
pti->Desktop); pti->rpdesk);
if (Class == NULL) if (Class == NULL)
{ {
DPRINT1("Failed to reference window class!\n"); DPRINT1("Failed to reference window class!\n");
RETURN(NULL); RETURN(NULL);
} }
WinSta = pti->Desktop->WindowStation; WinSta = pti->rpdesk->rpwinstaParent;
//FIXME: Reference thread/desktop instead //FIXME: Reference thread/desktop instead
ObReferenceObjectByPointer(WinSta, KernelMode, ExWindowStationObjectType, 0); ObReferenceObjectByPointer(WinSta, KernelMode, ExWindowStationObjectType, 0);
@ -1811,7 +1811,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
sizeof(WINDOW_OBJECT)); sizeof(WINDOW_OBJECT));
if (Window) if (Window)
{ {
Window->Wnd = DesktopHeapAlloc(pti->Desktop, Window->Wnd = DesktopHeapAlloc(pti->rpdesk,
sizeof(WND) + Class->cbwndExtra); sizeof(WND) + Class->cbwndExtra);
if (!Window->Wnd) if (!Window->Wnd)
goto AllocErr; goto AllocErr;
@ -1822,7 +1822,7 @@ co_IntCreateWindowEx(DWORD dwExStyle,
Wnd->fnid = 0; Wnd->fnid = 0;
Wnd->head.pti = ti; Wnd->head.pti = ti;
Wnd->head.rpdesk = pti->Desktop; Wnd->head.rpdesk = pti->rpdesk;
Wnd->hWndLastActive = hWnd; Wnd->hWndLastActive = hWnd;
Wnd->state2 |= WNDS2_WIN40COMPAT; Wnd->state2 |= WNDS2_WIN40COMPAT;
} }
@ -1840,11 +1840,11 @@ AllocErr:
ObDereferenceObject(WinSta); ObDereferenceObject(WinSta);
if (NULL == pti->Desktop->DesktopWindow) if (NULL == pti->rpdesk->DesktopWindow)
{ {
/* If there is no desktop window yet, we must be creating it */ /* If there is no desktop window yet, we must be creating it */
pti->Desktop->DesktopWindow = hWnd; pti->rpdesk->DesktopWindow = hWnd;
pti->Desktop->pDeskInfo->spwnd = Wnd; pti->rpdesk->pDeskInfo->spwnd = Wnd;
} }
/* /*
@ -2109,7 +2109,7 @@ AllocErr:
PRTL_USER_PROCESS_PARAMETERS ProcessParams; PRTL_USER_PROCESS_PARAMETERS ProcessParams;
BOOL CalculatedDefPosSize = FALSE; BOOL CalculatedDefPosSize = FALSE;
IntGetDesktopWorkArea(((PTHREADINFO)Window->pti->pEThread->Tcb.Win32Thread)->Desktop, &WorkArea); IntGetDesktopWorkArea(Window->pti->rpdesk, &WorkArea);
rc = WorkArea; rc = WorkArea;
ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters; ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters;
@ -3888,7 +3888,7 @@ co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
/* /*
* Remove extended window style bit WS_EX_TOPMOST for shell windows. * Remove extended window style bit WS_EX_TOPMOST for shell windows.
*/ */
WindowStation = Window->pti->Desktop->WindowStation; WindowStation = Window->pti->rpdesk->rpwinstaParent;
if(WindowStation) if(WindowStation)
{ {
if (hWnd == WindowStation->ShellWindow || hWnd == WindowStation->ShellListView) if (hWnd == WindowStation->ShellWindow || hWnd == WindowStation->ShellListView)

View file

@ -257,7 +257,7 @@ WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect)
{ {
RECTL WorkArea; RECTL WorkArea;
PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PDESKTOP Desktop = pti->Desktop; /* Or rather get it from the window? */ PDESKTOP Desktop = pti->rpdesk; /* Or rather get it from the window? */
Parent = Window->spwndParent; Parent = Window->spwndParent;
if(Parent) if(Parent)
@ -405,7 +405,7 @@ WinPosFillMinMaxInfoStruct(PWINDOW_OBJECT Window, MINMAXINFO *Info)
UINT XInc, YInc; UINT XInc, YInc;
RECTL WorkArea; RECTL WorkArea;
PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
PDESKTOP Desktop = pti->Desktop; /* Or rather get it from the window? */ PDESKTOP Desktop = pti->rpdesk; /* Or rather get it from the window? */
IntGetDesktopWorkArea(Desktop, &WorkArea); IntGetDesktopWorkArea(Desktop, &WorkArea);

View file

@ -900,7 +900,7 @@ UserGetProcessWindowStation(VOID)
{ {
DPRINT1("Should use ObFindHandleForObject\n"); DPRINT1("Should use ObFindHandleForObject\n");
pti = PsGetCurrentThreadWin32Thread(); pti = PsGetCurrentThreadWin32Thread();
Status = ObOpenObjectByPointer(pti->Desktop->WindowStation, Status = ObOpenObjectByPointer(pti->rpdesk->rpwinstaParent,
0, 0,
NULL, NULL,
WINSTA_ALL_ACCESS, WINSTA_ALL_ACCESS,
@ -951,9 +951,9 @@ IntGetWinStaObj(VOID)
*/ */
Win32Thread = PsGetCurrentThreadWin32Thread(); Win32Thread = PsGetCurrentThreadWin32Thread();
if(Win32Thread != NULL && Win32Thread->Desktop != NULL) if(Win32Thread != NULL && Win32Thread->rpdesk != NULL)
{ {
WinStaObj = Win32Thread->Desktop->WindowStation; WinStaObj = Win32Thread->rpdesk->rpwinstaParent;
ObReferenceObjectByPointer(WinStaObj, KernelMode, ExWindowStationObjectType, 0); ObReferenceObjectByPointer(WinStaObj, KernelMode, ExWindowStationObjectType, 0);
} }
else if((CurrentProcess = PsGetCurrentProcess()) != CsrProcess) else if((CurrentProcess = PsGetCurrentProcess()) != CsrProcess)