diff --git a/reactos/subsystems/win32/win32k/include/desktop.h b/reactos/subsystems/win32/win32k/include/desktop.h index 17020c9caef..fe7a93fdd81 100644 --- a/reactos/subsystems/win32/win32k/include/desktop.h +++ b/reactos/subsystems/win32/win32k/include/desktop.h @@ -8,6 +8,8 @@ typedef struct _DESKTOP { PDESKTOPINFO pDeskInfo; LIST_ENTRY ListEntry; + /* Pointer to the associated window station. */ + struct _WINSTATION_OBJECT *rpwinstaParent; PWND spwndForeground; PWND spwndTray; PWND spwndMessage; @@ -23,12 +25,8 @@ typedef struct _DESKTOP DWORD dwMouseHoverTime; /* ReactOS */ - CSHORT Type; - CSHORT Size; /* Rectangle of the work area */ RECTL WorkArea; - /* Pointer to the associated window station. */ - struct _WINSTATION_OBJECT *WindowStation; /* Pointer to the active queue. */ PVOID ActiveMessageQueue; /* Handle of the desktop window. */ @@ -130,7 +128,7 @@ VOID co_IntShellHookNotify(WPARAM Message, LPARAM lParam); HDC FASTCALL UserGetDesktopDC(ULONG,BOOL,BOOL); #define IntIsActiveDesktop(Desktop) \ - ((Desktop)->WindowStation->ActiveDesktop == (Desktop)) + ((Desktop)->rpwinstaParent->ActiveDesktop == (Desktop)) #define GET_DESKTOP_NAME(d) \ OBJECT_HEADER_TO_NAME_INFO(OBJECT_TO_OBJECT_HEADER(d)) ? \ @@ -210,10 +208,10 @@ DesktopHeapGetUserDelta(VOID) ULONG_PTR Delta = 0; pti = PsGetCurrentThreadWin32Thread(); - if (!pti->Desktop) + if (!pti->rpdesk) return 0; - pheapDesktop = pti->Desktop->pheapDesktop; + pheapDesktop = pti->rpdesk->pheapDesktop; W32Process = PsGetCurrentProcessWin32Process(); Mapping = W32Process->HeapMappings.Next; diff --git a/reactos/subsystems/win32/win32k/include/win32.h b/reactos/subsystems/win32/win32k/include/win32.h index 369b549021f..ad7938389a1 100644 --- a/reactos/subsystems/win32/win32k/include/win32.h +++ b/reactos/subsystems/win32/win32k/include/win32.h @@ -70,7 +70,7 @@ typedef struct _THREADINFO struct _USER_MESSAGE_QUEUE* MessageQueue; struct _KBL* KeyboardLayout; PCLIENTTHREADINFO pcti; - struct _DESKTOP* Desktop; + struct _DESKTOP* rpdesk; PDESKTOPINFO pDeskInfo; PCLIENTINFO pClientInfo; FLONG TIF_flags; @@ -78,7 +78,7 @@ typedef struct _THREADINFO LONG timeLast; ULONG_PTR idLast; INT exitCode; - HANDLE hDesktop; + HDESK hdesk; UINT cPaintsReady; /* Count of paints pending. */ UINT cTimersReady; /* Count of timers pending. */ DWORD dwExpWinVer; diff --git a/reactos/subsystems/win32/win32k/main/dllmain.c b/reactos/subsystems/win32/win32k/main/dllmain.c index 496f18b7e00..346974a261f 100644 --- a/reactos/subsystems/win32/win32k/main/dllmain.c +++ b/reactos/subsystems/win32/win32k/main/dllmain.c @@ -246,7 +246,7 @@ Win32kThreadCallback(struct _ETHREAD *Thread, if (hDesk != NULL) { PDESKTOP DesktopObject; - Win32Thread->Desktop = NULL; + Win32Thread->rpdesk = NULL; Status = ObReferenceObjectByHandle(hDesk, 0, ExDesktopObjectType, diff --git a/reactos/subsystems/win32/win32k/ntuser/caret.c b/reactos/subsystems/win32/win32k/ntuser/caret.c index b66d31861c7..ee5e33ba565 100644 --- a/reactos/subsystems/win32/win32k/ntuser/caret.c +++ b/reactos/subsystems/win32/win32k/ntuser/caret.c @@ -62,7 +62,7 @@ IntSetCaretBlinkTime(UINT uMSeconds) { /* Don't save the new value to the registry! */ PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PWINSTATION_OBJECT WinStaObject = pti->Desktop->WindowStation; + PWINSTATION_OBJECT WinStaObject = pti->rpdesk->rpwinstaParent; /* windows doesn't do this check */ if((uMSeconds < MIN_CARETBLINKRATE) || (uMSeconds > MAX_CARETBLINKRATE)) @@ -152,7 +152,7 @@ IntGetCaretBlinkTime(VOID) UINT Ret; pti = PsGetCurrentThreadWin32Thread(); - WinStaObject = pti->Desktop->WindowStation; + WinStaObject = pti->rpdesk->rpwinstaParent; Ret = WinStaObject->CaretBlinkRate; if(!Ret) diff --git a/reactos/subsystems/win32/win32k/ntuser/class.c b/reactos/subsystems/win32/win32k/ntuser/class.c index 71da6b97ec0..f1755fecd54 100644 --- a/reactos/subsystems/win32/win32k/ntuser/class.c +++ b/reactos/subsystems/win32/win32k/ntuser/class.c @@ -1265,7 +1265,7 @@ UserRegisterClass(IN CONST WNDCLASSEXW* lpwcx, MenuName, fnID, dwFlags, - pti->Desktop, + pti->rpdesk, pi); if (Class != NULL) diff --git a/reactos/subsystems/win32/win32k/ntuser/clipboard.c b/reactos/subsystems/win32/win32k/ntuser/clipboard.c index 3d1f1af316e..55032c44e61 100644 --- a/reactos/subsystems/win32/win32k/ntuser/clipboard.c +++ b/reactos/subsystems/win32/win32k/ntuser/clipboard.c @@ -1133,7 +1133,7 @@ IntIncrementSequenceNumber(VOID) PWINSTATION_OBJECT WinStaObj; pti = PsGetCurrentThreadWin32Thread(); - WinStaObj = pti->Desktop->WindowStation; + WinStaObj = pti->rpdesk->rpwinstaParent; WinStaObj->Clipboard->ClipboardSequenceNumber++; } diff --git a/reactos/subsystems/win32/win32k/ntuser/desktop.c b/reactos/subsystems/win32/win32k/ntuser/desktop.c index b0567271dcb..0f635d0cb7c 100644 --- a/reactos/subsystems/win32/win32k/ntuser/desktop.c +++ b/reactos/subsystems/win32/win32k/ntuser/desktop.c @@ -144,10 +144,10 @@ IntDesktopObjectParse(IN PVOID ParseObject, /* Initialize shell hook window list and set the parent */ RtlZeroMemory(Desktop, sizeof(DESKTOP)); 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 */ - InsertTailList(&Desktop->WindowStation->DesktopListHead, + InsertTailList(&Desktop->rpwinstaParent->DesktopListHead, &Desktop->ListEntry); /* Set the desktop object and return success */ @@ -572,7 +572,7 @@ HWND FASTCALL IntGetMessageWindow(VOID) HWND FASTCALL IntGetCurrentThreadDesktopWindow(VOID) { PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PDESKTOP pdo = pti->Desktop; + PDESKTOP pdo = pti->rpdesk; if (NULL == pdo) { DPRINT1("Thread doesn't have a desktop\n"); @@ -796,7 +796,7 @@ VOID co_IntShellHookNotify(WPARAM Message, LPARAM lParam) BOOL IntRegisterShellHookWindow(HWND hWnd) { PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PDESKTOP Desktop = pti->Desktop; + PDESKTOP Desktop = pti->rpdesk; PSHELL_HOOK_WINDOW Entry; DPRINT("IntRegisterShellHookWindow\n"); @@ -828,7 +828,7 @@ BOOL IntRegisterShellHookWindow(HWND hWnd) BOOL IntDeRegisterShellHookWindow(HWND hWnd) { PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PDESKTOP Desktop = pti->Desktop; + PDESKTOP Desktop = pti->rpdesk; PSHELL_HOOK_WINDOW Current; LIST_FOR_EACH(Current, &Desktop->ShellHookWindows, SHELL_HOOK_WINDOW, ListEntry) @@ -1103,7 +1103,7 @@ NtUserCreateDesktop( W32Thread = PsGetCurrentThreadWin32Thread(); - if (!W32Thread->Desktop) IntSetThreadDesktop(DesktopObject,FALSE); + if (!W32Thread->rpdesk) IntSetThreadDesktop(DesktopObject,FALSE); /* Based on wine/server/window.c in get_desktop_window. @@ -1447,7 +1447,7 @@ NtUserPaintDesktop(HDC hDC) UINT align_old; int mode_old; PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PWINSTATION_OBJECT WinSta = pti->Desktop->WindowStation; + PWINSTATION_OBJECT WinSta = pti->rpdesk->rpwinstaParent; DECLARE_RETURN(BOOL); UserEnterExclusive(); @@ -1676,7 +1676,7 @@ NtUserSwitchDesktop(HDESK hDesktop) * Don't allow applications switch the desktop if it's locked, unless the caller * is the logon application itself */ - if((DesktopObject->WindowStation->Flags & WSS_LOCKED) && + if((DesktopObject->rpwinstaParent->Flags & WSS_LOCKED) && LogonProcess != NULL && LogonProcess != PsGetCurrentProcessWin32Process()) { ObDereferenceObject(DesktopObject); @@ -1684,7 +1684,7 @@ NtUserSwitchDesktop(HDESK hDesktop) RETURN(FALSE); } - if(DesktopObject->WindowStation != InputWindowStation) + if(DesktopObject->rpwinstaParent != InputWindowStation) { ObDereferenceObject(DesktopObject); 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 in the same context */ - Ret = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hDesktop; + Ret = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hdesk; ObDereferenceObject(Thread); RETURN(Ret); } /* get the desktop handle and the desktop of the thread */ - if(!(hThreadDesktop = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hDesktop) || - !(DesktopObject = ((PTHREADINFO)Thread->Tcb.Win32Thread)->Desktop)) + if(!(hThreadDesktop = ((PTHREADINFO)Thread->Tcb.Win32Thread)->hdesk) || + !(DesktopObject = ((PTHREADINFO)Thread->Tcb.Win32Thread)->rpdesk)) { ObDereferenceObject(Thread); DPRINT1("Desktop information of thread 0x%x broken!?\n", dwThreadId); @@ -1954,9 +1954,9 @@ IntSetThreadDesktop(IN PDESKTOP DesktopObject, MapHeap = (PsGetCurrentProcess() != PsInitialSystemProcess); W32Thread = PsGetCurrentThreadWin32Thread(); - if (W32Thread->Desktop != DesktopObject) + if (W32Thread->rpdesk != DesktopObject) { - OldDesktop = W32Thread->Desktop; + OldDesktop = W32Thread->rpdesk; if (!IsListEmpty(&W32Thread->WindowListHead)) { @@ -1965,7 +1965,7 @@ IntSetThreadDesktop(IN PDESKTOP DesktopObject, return FALSE; } - W32Thread->Desktop = DesktopObject; + W32Thread->rpdesk = DesktopObject; if (MapHeap && DesktopObject != NULL) { diff --git a/reactos/subsystems/win32/win32k/ntuser/hook.c b/reactos/subsystems/win32/win32k/ntuser/hook.c index 080164613fe..a2a46babe54 100644 --- a/reactos/subsystems/win32/win32k/ntuser/hook.c +++ b/reactos/subsystems/win32/win32k/ntuser/hook.c @@ -121,7 +121,7 @@ IntAddHook(PETHREAD Thread, int HookId, BOOLEAN Global, PWINSTATION_OBJECT WinSt W32Thread->pDeskInfo->fsHooks= W32Thread->fsHooks; Hook->head.pti = W32Thread; - Hook->head.rpdesk = W32Thread->Desktop; + Hook->head.rpdesk = W32Thread->rpdesk; } RtlInitUnicodeString(&Hook->ModuleName, NULL); diff --git a/reactos/subsystems/win32/win32k/ntuser/input.c b/reactos/subsystems/win32/win32k/ntuser/input.c index eac51ce5531..f0790e19a7b 100644 --- a/reactos/subsystems/win32/win32k/ntuser/input.c +++ b/reactos/subsystems/win32/win32k/ntuser/input.c @@ -990,7 +990,7 @@ IntBlockInput(PTHREADINFO W32Thread, BOOL BlockIt) PTHREADINFO OldBlock; 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 @@ -1004,14 +1004,14 @@ IntBlockInput(PTHREADINFO W32Thread, BOOL BlockIt) * e.g. services running in the service window station cannot block input */ if(!ThreadHasInputAccess(W32Thread) || - !IntIsActiveDesktop(W32Thread->Desktop)) + !IntIsActiveDesktop(W32Thread->rpdesk)) { SetLastWin32Error(ERROR_ACCESS_DENIED); return FALSE; } - ASSERT(W32Thread->Desktop); - OldBlock = W32Thread->Desktop->BlockInputThread; + ASSERT(W32Thread->rpdesk); + OldBlock = W32Thread->rpdesk->BlockInputThread; if(OldBlock) { if(OldBlock != W32Thread) @@ -1019,11 +1019,11 @@ IntBlockInput(PTHREADINFO W32Thread, BOOL BlockIt) SetLastWin32Error(ERROR_ACCESS_DENIED); return FALSE; } - W32Thread->Desktop->BlockInputThread = (BlockIt ? W32Thread : NULL); + W32Thread->rpdesk->BlockInputThread = (BlockIt ? W32Thread : NULL); return OldBlock == NULL; } - W32Thread->Desktop->BlockInputThread = (BlockIt ? W32Thread : NULL); + W32Thread->rpdesk->BlockInputThread = (BlockIt ? W32Thread : 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. */ if ( pti->TIF_flags & TIF_DONTATTACHQUEUE || ptiTo->TIF_flags & TIF_DONTATTACHQUEUE || - pti->Desktop != ptiTo->Desktop ) + pti->rpdesk != ptiTo->rpdesk ) return FALSE; /* If Attach set, allocate and link. */ @@ -1451,7 +1451,7 @@ NtUserSendInput( W32Thread = PsGetCurrentThreadWin32Thread(); ASSERT(W32Thread); - if(!W32Thread->Desktop) + if(!W32Thread->rpdesk) { RETURN( 0); } @@ -1467,7 +1467,7 @@ NtUserSendInput( * e.g. services running in the service window station cannot block input */ if(!ThreadHasInputAccess(W32Thread) || - !IntIsActiveDesktop(W32Thread->Desktop)) + !IntIsActiveDesktop(W32Thread->rpdesk)) { SetLastWin32Error(ERROR_ACCESS_DENIED); RETURN( 0); diff --git a/reactos/subsystems/win32/win32k/ntuser/misc.c b/reactos/subsystems/win32/win32k/ntuser/misc.c index c00f43d8837..27faa8fc9e3 100644 --- a/reactos/subsystems/win32/win32k/ntuser/misc.c +++ b/reactos/subsystems/win32/win32k/ntuser/misc.c @@ -191,13 +191,13 @@ NtUserGetGUIThreadInfo( SetLastWin32Error(ERROR_ACCESS_DENIED); RETURN( FALSE); } - Desktop = ((PTHREADINFO)Thread->Tcb.Win32Thread)->Desktop; + Desktop = ((PTHREADINFO)Thread->Tcb.Win32Thread)->rpdesk; } else { /* get the foreground thread */ PTHREADINFO W32Thread = (PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread; - Desktop = W32Thread->Desktop; + Desktop = W32Thread->rpdesk; if(Desktop) { MsgQueue = Desktop->ActiveMessageQueue; @@ -474,9 +474,9 @@ GetW32ThreadInfo(VOID) 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 { diff --git a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c index ec866f55029..2b1fedae85a 100644 --- a/reactos/subsystems/win32/win32k/ntuser/msgqueue.c +++ b/reactos/subsystems/win32/win32k/ntuser/msgqueue.c @@ -240,7 +240,7 @@ MsqIsClkLck(LPMSG Msg, BOOL Remove) BOOL Res = FALSE; pti = PsGetCurrentThreadWin32Thread(); - if (pti->Desktop == NULL) + if (pti->rpdesk == NULL) { return FALSE; } @@ -281,7 +281,7 @@ MsqIsDblClk(LPMSG Msg, BOOL Remove) BOOL Res; pti = PsGetCurrentThreadWin32Thread(); - if (pti->Desktop == NULL) + if (pti->rpdesk == NULL) { return FALSE; } diff --git a/reactos/subsystems/win32/win32k/ntuser/painting.c b/reactos/subsystems/win32/win32k/ntuser/painting.c index 18d06668a8d..97b0adbcb33 100644 --- a/reactos/subsystems/win32/win32k/ntuser/painting.c +++ b/reactos/subsystems/win32/win32k/ntuser/painting.c @@ -702,7 +702,7 @@ co_IntFixCaret(PWINDOW_OBJECT Window, RECTL *lprc, UINT flags) ASSERT_REFS_CO(Window); - Desktop = ((PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread)->Desktop; + Desktop = ((PTHREADINFO)PsGetCurrentThread()->Tcb.Win32Thread)->rpdesk; CaretInfo = ((PUSER_MESSAGE_QUEUE)Desktop->ActiveMessageQueue)->CaretInfo; hWndCaret = CaretInfo->hWnd; diff --git a/reactos/subsystems/win32/win32k/ntuser/simplecall.c b/reactos/subsystems/win32/win32k/ntuser/simplecall.c index 072c9846aac..08a8e0d2dbe 100644 --- a/reactos/subsystems/win32/win32k/ntuser/simplecall.c +++ b/reactos/subsystems/win32/win32k/ntuser/simplecall.c @@ -309,7 +309,7 @@ NtUserCallOneParam( BOOL Ret = TRUE; PPOINTL pptl; PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - if (pti->hDesktop != InputDesktopHandle) RETURN(FALSE); + if (pti->hdesk != InputDesktopHandle) RETURN(FALSE); _SEH2_TRY { pptl = (PPOINTL)Param; diff --git a/reactos/subsystems/win32/win32k/ntuser/sysparams.c b/reactos/subsystems/win32/win32k/ntuser/sysparams.c index e2f5da634b1..4768cb0d9a5 100644 --- a/reactos/subsystems/win32/win32k/ntuser/sysparams.c +++ b/reactos/subsystems/win32/win32k/ntuser/sysparams.c @@ -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 { PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PDESKTOP pdesktop = pti->Desktop; + PDESKTOP pdesktop = pti->rpdesk; RECTL rclWorkarea; 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 { PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); - PDESKTOP pdesktop = pti->Desktop; + PDESKTOP pdesktop = pti->rpdesk; RECT rcWorkArea; if(!pdesktop) diff --git a/reactos/subsystems/win32/win32k/ntuser/useratom.c b/reactos/subsystems/win32/win32k/ntuser/useratom.c index 4db15e7adac..61b41648600 100644 --- a/reactos/subsystems/win32/win32k/ntuser/useratom.c +++ b/reactos/subsystems/win32/win32k/ntuser/useratom.c @@ -37,7 +37,7 @@ IntAddAtom(LPWSTR AtomName) RTL_ATOM Atom; pti = PsGetCurrentThreadWin32Thread(); - if (pti->Desktop == NULL) + if (pti->rpdesk == NULL) { SetLastNtError(Status); return (RTL_ATOM)0; @@ -61,7 +61,7 @@ IntGetAtomName(RTL_ATOM nAtom, LPWSTR lpBuffer, ULONG nSize) ULONG Size = nSize; pti = PsGetCurrentThreadWin32Thread(); - if (pti->Desktop == NULL) + if (pti->rpdesk == NULL) { SetLastNtError(Status); return 0; diff --git a/reactos/subsystems/win32/win32k/ntuser/window.c b/reactos/subsystems/win32/win32k/ntuser/window.c index a3c90abb417..22777b266bf 100644 --- a/reactos/subsystems/win32/win32k/ntuser/window.c +++ b/reactos/subsystems/win32/win32k/ntuser/window.c @@ -438,13 +438,13 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window, /* don't remove the WINDOWSTATUS_DESTROYING bit */ /* reset shell window handles */ - if(ThreadData->Desktop) + if(ThreadData->rpdesk) { - if (Window->hSelf == ThreadData->Desktop->WindowStation->ShellWindow) - ThreadData->Desktop->WindowStation->ShellWindow = NULL; + if (Window->hSelf == ThreadData->rpdesk->rpwinstaParent->ShellWindow) + ThreadData->rpdesk->rpwinstaParent->ShellWindow = NULL; - if (Window->hSelf == ThreadData->Desktop->WindowStation->ShellListView) - ThreadData->Desktop->WindowStation->ShellListView = NULL; + if (Window->hSelf == ThreadData->rpdesk->rpwinstaParent->ShellListView) + ThreadData->rpdesk->rpwinstaParent->ShellListView = NULL; } /* Unregister hot keys */ @@ -861,7 +861,7 @@ IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu) { W32Thread = PsGetCurrentThreadWin32Thread(); - if(!W32Thread->Desktop) + if(!W32Thread->rpdesk) return NULL; 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 */ - Menu = UserGetMenuObject(W32Thread->Desktop->WindowStation->SystemMenuTemplate); + Menu = UserGetMenuObject(W32Thread->rpdesk->rpwinstaParent->SystemMenuTemplate); if(!Menu) return NULL; @@ -1703,9 +1703,9 @@ co_IntCreateWindowEx(DWORD dwExStyle, 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. */ 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"); RETURN( (PWND)0); @@ -1792,14 +1792,14 @@ co_IntCreateWindowEx(DWORD dwExStyle, DPRINT("ClassAtom %x\n", ClassAtom); Class = IntReferenceClass(Class, ClassLink, - pti->Desktop); + pti->rpdesk); if (Class == NULL) { DPRINT1("Failed to reference window class!\n"); RETURN(NULL); } - WinSta = pti->Desktop->WindowStation; + WinSta = pti->rpdesk->rpwinstaParent; //FIXME: Reference thread/desktop instead ObReferenceObjectByPointer(WinSta, KernelMode, ExWindowStationObjectType, 0); @@ -1811,7 +1811,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, sizeof(WINDOW_OBJECT)); if (Window) { - Window->Wnd = DesktopHeapAlloc(pti->Desktop, + Window->Wnd = DesktopHeapAlloc(pti->rpdesk, sizeof(WND) + Class->cbwndExtra); if (!Window->Wnd) goto AllocErr; @@ -1822,7 +1822,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, Wnd->fnid = 0; Wnd->head.pti = ti; - Wnd->head.rpdesk = pti->Desktop; + Wnd->head.rpdesk = pti->rpdesk; Wnd->hWndLastActive = hWnd; Wnd->state2 |= WNDS2_WIN40COMPAT; } @@ -1840,11 +1840,11 @@ AllocErr: ObDereferenceObject(WinSta); - if (NULL == pti->Desktop->DesktopWindow) + if (NULL == pti->rpdesk->DesktopWindow) { /* If there is no desktop window yet, we must be creating it */ - pti->Desktop->DesktopWindow = hWnd; - pti->Desktop->pDeskInfo->spwnd = Wnd; + pti->rpdesk->DesktopWindow = hWnd; + pti->rpdesk->pDeskInfo->spwnd = Wnd; } /* @@ -2109,7 +2109,7 @@ AllocErr: PRTL_USER_PROCESS_PARAMETERS ProcessParams; BOOL CalculatedDefPosSize = FALSE; - IntGetDesktopWorkArea(((PTHREADINFO)Window->pti->pEThread->Tcb.Win32Thread)->Desktop, &WorkArea); + IntGetDesktopWorkArea(Window->pti->rpdesk, &WorkArea); rc = WorkArea; 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. */ - WindowStation = Window->pti->Desktop->WindowStation; + WindowStation = Window->pti->rpdesk->rpwinstaParent; if(WindowStation) { if (hWnd == WindowStation->ShellWindow || hWnd == WindowStation->ShellListView) diff --git a/reactos/subsystems/win32/win32k/ntuser/winpos.c b/reactos/subsystems/win32/win32k/ntuser/winpos.c index a3a76ddc00c..4a50e4a2951 100644 --- a/reactos/subsystems/win32/win32k/ntuser/winpos.c +++ b/reactos/subsystems/win32/win32k/ntuser/winpos.c @@ -257,7 +257,7 @@ WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect) { RECTL WorkArea; 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; if(Parent) @@ -405,7 +405,7 @@ WinPosFillMinMaxInfoStruct(PWINDOW_OBJECT Window, MINMAXINFO *Info) UINT XInc, YInc; RECTL WorkArea; 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); diff --git a/reactos/subsystems/win32/win32k/ntuser/winsta.c b/reactos/subsystems/win32/win32k/ntuser/winsta.c index 3036b208a49..a379a2f2655 100644 --- a/reactos/subsystems/win32/win32k/ntuser/winsta.c +++ b/reactos/subsystems/win32/win32k/ntuser/winsta.c @@ -900,7 +900,7 @@ UserGetProcessWindowStation(VOID) { DPRINT1("Should use ObFindHandleForObject\n"); pti = PsGetCurrentThreadWin32Thread(); - Status = ObOpenObjectByPointer(pti->Desktop->WindowStation, + Status = ObOpenObjectByPointer(pti->rpdesk->rpwinstaParent, 0, NULL, WINSTA_ALL_ACCESS, @@ -951,9 +951,9 @@ IntGetWinStaObj(VOID) */ 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); } else if((CurrentProcess = PsGetCurrentProcess()) != CsrProcess)