- Updated headers and related files.
svn path=/trunk/; revision=45070
{
PDESKTOPINFO pDeskInfo;
LIST_ENTRY ListEntry;
+ /* Pointer to the associated window station. */
+ struct _WINSTATION_OBJECT *rpwinstaParent;
PWND spwndForeground;
PWND spwndTray;
PWND spwndMessage;
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. */
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)) ? \
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;
struct _USER_MESSAGE_QUEUE* MessageQueue;
struct _KBL* KeyboardLayout;
PCLIENTTHREADINFO pcti;
- struct _DESKTOP* Desktop;
+ struct _DESKTOP* rpdesk;
PDESKTOPINFO pDeskInfo;
PCLIENTINFO pClientInfo;
FLONG TIF_flags;
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;
if (hDesk != NULL)
{
PDESKTOP DesktopObject;
- Win32Thread->Desktop = NULL;
+ Win32Thread->rpdesk = NULL;
Status = ObReferenceObjectByHandle(hDesk,
0,
ExDesktopObjectType,
{
/* 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))
UINT Ret;
pti = PsGetCurrentThreadWin32Thread();
- WinStaObject = pti->Desktop->WindowStation;
+ WinStaObject = pti->rpdesk->rpwinstaParent;
Ret = WinStaObject->CaretBlinkRate;
if(!Ret)
MenuName,
fnID,
dwFlags,
- pti->Desktop,
+ pti->rpdesk,
pi);
if (Class != NULL)
PWINSTATION_OBJECT WinStaObj;
pti = PsGetCurrentThreadWin32Thread();
- WinStaObj = pti->Desktop->WindowStation;
+ WinStaObj = pti->rpdesk->rpwinstaParent;
WinStaObj->Clipboard->ClipboardSequenceNumber++;
}
/* 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 */
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");
BOOL IntRegisterShellHookWindow(HWND hWnd)
{
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
- PDESKTOP Desktop = pti->Desktop;
+ PDESKTOP Desktop = pti->rpdesk;
PSHELL_HOOK_WINDOW Entry;
DPRINT("IntRegisterShellHookWindow\n");
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)
W32Thread = PsGetCurrentThreadWin32Thread();
- if (!W32Thread->Desktop) IntSetThreadDesktop(DesktopObject,FALSE);
+ if (!W32Thread->rpdesk) IntSetThreadDesktop(DesktopObject,FALSE);
/*
Based on wine/server/window.c in get_desktop_window.
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();
* 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);
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);
{
/* 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);
MapHeap = (PsGetCurrentProcess() != PsInitialSystemProcess);
W32Thread = PsGetCurrentThreadWin32Thread();
- if (W32Thread->Desktop != DesktopObject)
+ if (W32Thread->rpdesk != DesktopObject)
{
- OldDesktop = W32Thread->Desktop;
+ OldDesktop = W32Thread->rpdesk;
if (!IsListEmpty(&W32Thread->WindowListHead))
{
return FALSE;
}
- W32Thread->Desktop = DesktopObject;
+ W32Thread->rpdesk = DesktopObject;
if (MapHeap && DesktopObject != NULL)
{
W32Thread->pDeskInfo->fsHooks= W32Thread->fsHooks;
Hook->head.pti = W32Thread;
- Hook->head.rpdesk = W32Thread->Desktop;
+ Hook->head.rpdesk = W32Thread->rpdesk;
}
RtlInitUnicodeString(&Hook->ModuleName, NULL);
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
* 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)
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;
}
/* 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. */
W32Thread = PsGetCurrentThreadWin32Thread();
ASSERT(W32Thread);
- if(!W32Thread->Desktop)
+ if(!W32Thread->rpdesk)
{
RETURN( 0);
}
* 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);
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;
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
{
BOOL Res = FALSE;
pti = PsGetCurrentThreadWin32Thread();
- if (pti->Desktop == NULL)
+ if (pti->rpdesk == NULL)
{
return FALSE;
}
BOOL Res;
pti = PsGetCurrentThreadWin32Thread();
- if (pti->Desktop == NULL)
+ if (pti->rpdesk == NULL)
{
return FALSE;
}
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;
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;
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)
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)
RTL_ATOM Atom;
pti = PsGetCurrentThreadWin32Thread();
- if (pti->Desktop == NULL)
+ if (pti->rpdesk == NULL)
{
SetLastNtError(Status);
return (RTL_ATOM)0;
ULONG Size = nSize;
pti = PsGetCurrentThreadWin32Thread();
- if (pti->Desktop == NULL)
+ if (pti->rpdesk == NULL)
{
SetLastNtError(Status);
return 0;
/* 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 */
{
W32Thread = PsGetCurrentThreadWin32Thread();
- if(!W32Thread->Desktop)
+ if(!W32Thread->rpdesk)
return NULL;
if(Window->SystemMenu)
}
}
- 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;
pti = PsGetCurrentThreadWin32Thread();
- if (pti->Desktop)
+ if (pti->rpdesk)
{
- ParentWindowHandle = pti->Desktop->DesktopWindow;
+ ParentWindowHandle = pti->rpdesk->DesktopWindow;
}
/* 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);
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);
sizeof(WINDOW_OBJECT));
if (Window)
{
- Window->Wnd = DesktopHeapAlloc(pti->Desktop,
+ Window->Wnd = DesktopHeapAlloc(pti->rpdesk,
sizeof(WND) + Class->cbwndExtra);
if (!Window->Wnd)
goto AllocErr;
Wnd->fnid = 0;
Wnd->head.pti = ti;
- Wnd->head.rpdesk = pti->Desktop;
+ Wnd->head.rpdesk = pti->rpdesk;
Wnd->hWndLastActive = hWnd;
Wnd->state2 |= WNDS2_WIN40COMPAT;
}
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;
}
/*
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;
/*
* 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)
{
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)
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);
{
DPRINT1("Should use ObFindHandleForObject\n");
pti = PsGetCurrentThreadWin32Thread();
- Status = ObOpenObjectByPointer(pti->Desktop->WindowStation,
+ Status = ObOpenObjectByPointer(pti->rpdesk->rpwinstaParent,
0,
NULL,
WINSTA_ALL_ACCESS,
*/
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)