mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 15:23:03 +00:00
-W32k/NtUser separation
-cleanup -misc svn path=/trunk/; revision=5409
This commit is contained in:
parent
92bab0c786
commit
878bd7b8e1
13 changed files with 380 additions and 249 deletions
|
@ -554,3 +554,6 @@ NtUserGetDesktopWindow 0
|
||||||
NtUserAcquireOrReleaseInputOwnership 1
|
NtUserAcquireOrReleaseInputOwnership 1
|
||||||
NtUserGetWindowThreadProcessId 2
|
NtUserGetWindowThreadProcessId 2
|
||||||
NtUserGetQueueStatus 1
|
NtUserGetQueueStatus 1
|
||||||
|
NtUserGetParent 1
|
||||||
|
NtUserGetWindow 2
|
||||||
|
NtUserGetLastActivePopup 1
|
||||||
|
|
|
@ -319,14 +319,14 @@ NtUserDdeSetQualityOfService(
|
||||||
DWORD Unknown1,
|
DWORD Unknown1,
|
||||||
DWORD Unknown2);
|
DWORD Unknown2);
|
||||||
|
|
||||||
DWORD STDCALL
|
HDWP STDCALL
|
||||||
NtUserDeferWindowPos(HDWP WinPosInfo,
|
NtUserDeferWindowPos(HDWP WinPosInfo,
|
||||||
HWND Wnd,
|
HWND Wnd,
|
||||||
HWND WndInsertAfter,
|
HWND WndInsertAfter,
|
||||||
LONG x,
|
int x,
|
||||||
LONG y,
|
int y,
|
||||||
LONG cx,
|
int cx,
|
||||||
LONG cy,
|
int cy,
|
||||||
UINT Flags);
|
UINT Flags);
|
||||||
DWORD
|
DWORD
|
||||||
STDCALL
|
STDCALL
|
||||||
|
@ -364,12 +364,12 @@ LRESULT
|
||||||
STDCALL
|
STDCALL
|
||||||
NtUserDispatchMessage(CONST MSG* lpmsg);
|
NtUserDispatchMessage(CONST MSG* lpmsg);
|
||||||
|
|
||||||
DWORD
|
BOOL
|
||||||
STDCALL
|
STDCALL
|
||||||
NtUserDragDetect(
|
NtUserDragDetect(
|
||||||
DWORD Unknown0,
|
HWND hWnd,
|
||||||
DWORD Unknown1,
|
LONG x,
|
||||||
DWORD Unknown2);
|
LONG y);
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
STDCALL
|
STDCALL
|
||||||
|
@ -1261,11 +1261,7 @@ NtUserGetCapture(VOID);
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
STDCALL
|
STDCALL
|
||||||
NtUserSetClassLong(
|
NtUserSetClassLong(HWND hWnd, int Index, LONG NewValue, DWORD unk);
|
||||||
DWORD Unknown0,
|
|
||||||
DWORD Unknown1,
|
|
||||||
DWORD Unknown2,
|
|
||||||
DWORD Unknown3);
|
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
STDCALL
|
STDCALL
|
||||||
|
@ -1542,12 +1538,8 @@ NtUserSetWindowStationUser(
|
||||||
DWORD Unknown2,
|
DWORD Unknown2,
|
||||||
DWORD Unknown3);
|
DWORD Unknown3);
|
||||||
|
|
||||||
DWORD
|
WORD STDCALL
|
||||||
STDCALL
|
NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewVal);
|
||||||
NtUserSetWindowWord(
|
|
||||||
DWORD Unknown0,
|
|
||||||
DWORD Unknown1,
|
|
||||||
DWORD Unknown2);
|
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
STDCALL
|
STDCALL
|
||||||
|
@ -1784,6 +1776,15 @@ NtUserGetWindowThreadProcessId(HWND hWnd, LPDWORD UnsafePid);
|
||||||
DWORD STDCALL
|
DWORD STDCALL
|
||||||
NtUserGetQueueStatus(BOOL ClearChanges);
|
NtUserGetQueueStatus(BOOL ClearChanges);
|
||||||
|
|
||||||
|
HWND STDCALL
|
||||||
|
NtUserGetParent(HWND hWnd);
|
||||||
|
|
||||||
|
HWND STDCALL
|
||||||
|
NtUserGetWindow(HWND hWnd, UINT Relationship);
|
||||||
|
|
||||||
|
HWND STDCALL
|
||||||
|
NtUserGetLastActivePopup(HWND hWnd);
|
||||||
|
|
||||||
#endif /* __WIN32K_NTUSER_H */
|
#endif /* __WIN32K_NTUSER_H */
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
HWND STDCALL
|
HWND STDCALL
|
||||||
PaintingFindWinToRepaint(HWND hWnd, PW32THREAD Thread);
|
PaintingFindWinToRepaint(HWND hWnd, PW32THREAD Thread);
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
PaintRedrawWindow(HWND hWnd, const RECT* UpdateRect, HRGN UpdateRgn,
|
PaintRedrawWindow(PWINDOW_OBJECT Wnd, const RECT* UpdateRect, HRGN UpdateRgn,
|
||||||
ULONG Flags, ULONG ExFlags);
|
ULONG Flags, ULONG ExFlags);
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
PaintHaveToDelayNCPaint(PWINDOW_OBJECT Window, ULONG Flags);
|
PaintHaveToDelayNCPaint(PWINDOW_OBJECT Window, ULONG Flags);
|
||||||
|
|
|
@ -65,14 +65,19 @@ typedef struct _WINDOW_OBJECT
|
||||||
UINT IDMenu;
|
UINT IDMenu;
|
||||||
/* Handle of region of the window to be updated. */
|
/* Handle of region of the window to be updated. */
|
||||||
HANDLE UpdateRegion;
|
HANDLE UpdateRegion;
|
||||||
/* Pointer to the message queue associated with the window. */
|
/* Pointer to the owning thread's message queue. */
|
||||||
PUSER_MESSAGE_QUEUE MessageQueue;
|
PUSER_MESSAGE_QUEUE MessageQueue;
|
||||||
/* Head of the list of child windows. */
|
/* Head of the list of child windows. */
|
||||||
LIST_ENTRY ChildrenListHead;
|
LIST_ENTRY ChildrenListHead;
|
||||||
|
struct _WINDOW_OBJECT* FirstChild;
|
||||||
|
struct _WINDOW_OBJECT* LastChild;
|
||||||
|
|
||||||
/* Lock for the list of child windows. */
|
/* Lock for the list of child windows. */
|
||||||
FAST_MUTEX ChildrenListLock;
|
FAST_MUTEX ChildrenListLock;
|
||||||
/* Entry in the parent's list of child windows. */
|
/* Entry in the parent's list of child windows. */
|
||||||
LIST_ENTRY SiblingListEntry;
|
LIST_ENTRY SiblingListEntry;
|
||||||
|
struct _WINDOW_OBJECT* NextSibling;
|
||||||
|
struct _WINDOW_OBJECT* PrevSibling;
|
||||||
/* Entry in the list of thread windows. */
|
/* Entry in the list of thread windows. */
|
||||||
LIST_ENTRY ThreadListEntry;
|
LIST_ENTRY ThreadListEntry;
|
||||||
/* Pointer to the parent window. */
|
/* Pointer to the parent window. */
|
||||||
|
@ -88,6 +93,8 @@ typedef struct _WINDOW_OBJECT
|
||||||
LONG UserData;
|
LONG UserData;
|
||||||
WNDPROC WndProc;
|
WNDPROC WndProc;
|
||||||
PETHREAD OwnerThread;
|
PETHREAD OwnerThread;
|
||||||
|
HWND hWndOwner; /* handle to the owner window (why not use pointer to window? wine doesn't...)*/
|
||||||
|
HWND hWndLastPopup; /* handle to last active popup window (why not use pointer to window? wine doesn't...)*/
|
||||||
} WINDOW_OBJECT, *PWINDOW_OBJECT;
|
} WINDOW_OBJECT, *PWINDOW_OBJECT;
|
||||||
|
|
||||||
/* Window flags. */
|
/* Window flags. */
|
||||||
|
@ -154,6 +161,12 @@ UserHasDlgFrameStyle(ULONG Style, ULONG ExStyle);
|
||||||
ULONG
|
ULONG
|
||||||
UserHasThickFrameStyle(ULONG Style, ULONG ExStyle);
|
UserHasThickFrameStyle(ULONG Style, ULONG ExStyle);
|
||||||
|
|
||||||
|
PWINDOW_OBJECT FASTCALL
|
||||||
|
W32kGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
|
||||||
|
|
||||||
|
PWINDOW_OBJECT FASTCALL
|
||||||
|
W32kGetParent(PWINDOW_OBJECT Wnd);
|
||||||
|
|
||||||
#endif /* __WIN32K_WINDOW_H */
|
#endif /* __WIN32K_WINDOW_H */
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -7,6 +7,15 @@
|
||||||
#include <internal/ps.h>
|
#include <internal/ps.h>
|
||||||
#include "msgqueue.h"
|
#include "msgqueue.h"
|
||||||
|
|
||||||
|
typedef enum _WINSTA_LOCK_TYPE
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
Any,
|
||||||
|
Exclusive
|
||||||
|
} WINSTA_LOCK_TYPE;
|
||||||
|
|
||||||
|
#define ASSERT_WINSTA_LOCK(a) (ASSERT(W32kVerifyWinStaLock(a)))
|
||||||
|
|
||||||
#define PROCESS_WINDOW_STATION() \
|
#define PROCESS_WINDOW_STATION() \
|
||||||
((HWINSTA)(IoGetCurrentProcess()->Win32WindowStation))
|
((HWINSTA)(IoGetCurrentProcess()->Win32WindowStation))
|
||||||
|
|
||||||
|
@ -55,6 +64,7 @@ W32kSetCaptureWindow(struct _WINDOW_OBJECT* Window);
|
||||||
inline VOID W32kAcquireWinStaLockShared();
|
inline VOID W32kAcquireWinStaLockShared();
|
||||||
inline VOID W32kAcquireWinStaLockExclusive();
|
inline VOID W32kAcquireWinStaLockExclusive();
|
||||||
inline VOID W32kReleaseWinStaLock();
|
inline VOID W32kReleaseWinStaLock();
|
||||||
|
BOOL FASTCALL W32kVerifyWinStaLock(WINSTA_LOCK_TYPE Type);
|
||||||
|
|
||||||
#endif /* __WIN32K_WINSTA_H */
|
#endif /* __WIN32K_WINSTA_H */
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: class.c,v 1.20 2003/07/27 21:35:50 dwelch Exp $
|
/* $Id: class.c,v 1.21 2003/08/04 16:54:54 gdalsnes Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -286,7 +286,7 @@ NtUserRegisterClassExWOW(LPWNDCLASSEXW lpwcx,
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG FASTCALL
|
ULONG FASTCALL
|
||||||
W32kGetClassLong(struct _WINDOW_OBJECT *WindowObject, ULONG Offset)
|
W32kGetClassLong(PWINDOW_OBJECT WindowObject, ULONG Offset)
|
||||||
{
|
{
|
||||||
LONG Ret;
|
LONG Ret;
|
||||||
switch (Offset)
|
switch (Offset)
|
||||||
|
@ -330,10 +330,7 @@ NtUserGetClassLong(HWND hWnd, DWORD Offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD STDCALL
|
DWORD STDCALL
|
||||||
NtUserSetClassLong(DWORD Unknown0,
|
NtUserSetClassLong(HWND hWnd, int Index, LONG NewValue, DWORD unk)
|
||||||
DWORD Unknown1,
|
|
||||||
DWORD Unknown2,
|
|
||||||
DWORD Unknown3)
|
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED;
|
UNIMPLEMENTED;
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: input.c,v 1.9 2003/07/29 23:03:01 jimtabor Exp $
|
/* $Id: input.c,v 1.10 2003/08/04 16:54:54 gdalsnes Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -288,4 +288,16 @@ CleanupInputImp(VOID)
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
STDCALL
|
||||||
|
NtUserDragDetect(
|
||||||
|
HWND hWnd,
|
||||||
|
LONG x,
|
||||||
|
LONG y)
|
||||||
|
{
|
||||||
|
UNIMPLEMENTED
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: painting.c,v 1.21 2003/08/02 19:56:19 dwelch Exp $
|
/* $Id: painting.c,v 1.22 2003/08/04 16:54:54 gdalsnes Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -63,7 +63,7 @@ PaintDoPaint(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags, ULONG ExFlags)
|
||||||
HDC hDC;
|
HDC hDC;
|
||||||
HWND hWnd = Window->Self;
|
HWND hWnd = Window->Self;
|
||||||
BOOL bIcon = (0 != (Window->Style & WS_MINIMIZE)) &&
|
BOOL bIcon = (0 != (Window->Style & WS_MINIMIZE)) &&
|
||||||
(0 != NtUserGetClassLong(hWnd, GCL_HICON));
|
(0 != W32kGetClassLong(Window, GCL_HICON));
|
||||||
|
|
||||||
if (0 != (ExFlags & RDW_EX_DELAY_NCPAINT) ||
|
if (0 != (ExFlags & RDW_EX_DELAY_NCPAINT) ||
|
||||||
PaintHaveToDelayNCPaint(Window, 0))
|
PaintHaveToDelayNCPaint(Window, 0))
|
||||||
|
@ -457,21 +457,22 @@ PaintUpdateRgns(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags,
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
PaintRedrawWindow(HWND hWnd, const RECT* UpdateRect, HRGN UpdateRgn,
|
PaintRedrawWindow(
|
||||||
ULONG Flags, ULONG ExFlags)
|
PWINDOW_OBJECT Window,
|
||||||
|
const RECT* UpdateRect,
|
||||||
|
HRGN UpdateRgn,
|
||||||
|
ULONG Flags,
|
||||||
|
ULONG ExFlags)
|
||||||
{
|
{
|
||||||
PWINDOW_OBJECT Window;
|
|
||||||
RECT Rect, Rect2;
|
RECT Rect, Rect2;
|
||||||
POINT Pt;
|
POINT Pt;
|
||||||
HRGN hRgn = NULL;
|
HRGN hRgn = NULL;
|
||||||
|
|
||||||
/* FIXME: Return if this is for a desktop. */
|
/* Return if this is for a desktop. */
|
||||||
|
if (W32kIsDesktopWindow(Window))
|
||||||
Window = W32kGetWindowObject(hWnd);
|
{
|
||||||
if (Window == NULL)
|
return FALSE;
|
||||||
{
|
}
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((RDW_INVALIDATE | RDW_FRAME) == (Flags & (RDW_INVALIDATE | RDW_FRAME)) ||
|
if ((RDW_INVALIDATE | RDW_FRAME) == (Flags & (RDW_INVALIDATE | RDW_FRAME)) ||
|
||||||
(RDW_VALIDATE | RDW_NOFRAME) == (Flags & (RDW_VALIDATE | RDW_NOFRAME)))
|
(RDW_VALIDATE | RDW_NOFRAME) == (Flags & (RDW_VALIDATE | RDW_NOFRAME)))
|
||||||
|
@ -512,7 +513,7 @@ PaintRedrawWindow(HWND hWnd, const RECT* UpdateRect, HRGN UpdateRgn,
|
||||||
{
|
{
|
||||||
if (! W32kIntersectRect(&Rect2, &Rect, UpdateRect))
|
if (! W32kIntersectRect(&Rect2, &Rect, UpdateRect))
|
||||||
{
|
{
|
||||||
W32kReleaseWindowObject(Window);
|
|
||||||
if ((HRGN) 1 < hRgn && hRgn != UpdateRgn)
|
if ((HRGN) 1 < hRgn && hRgn != UpdateRgn)
|
||||||
{
|
{
|
||||||
W32kDeleteObject(hRgn);
|
W32kDeleteObject(hRgn);
|
||||||
|
@ -565,7 +566,7 @@ PaintRedrawWindow(HWND hWnd, const RECT* UpdateRect, HRGN UpdateRgn,
|
||||||
UnsafeW32kGetRgnBox(hRgn, &Rect2);
|
UnsafeW32kGetRgnBox(hRgn, &Rect2);
|
||||||
if (W32kIsEmptyRect(&Rect2))
|
if (W32kIsEmptyRect(&Rect2))
|
||||||
{
|
{
|
||||||
W32kReleaseWindowObject(Window);
|
|
||||||
if ((HRGN) 1 < hRgn && hRgn != UpdateRgn)
|
if ((HRGN) 1 < hRgn && hRgn != UpdateRgn)
|
||||||
{
|
{
|
||||||
W32kDeleteObject(hRgn);
|
W32kDeleteObject(hRgn);
|
||||||
|
@ -577,7 +578,7 @@ PaintRedrawWindow(HWND hWnd, const RECT* UpdateRect, HRGN UpdateRgn,
|
||||||
{
|
{
|
||||||
if (! W32kIntersectRect(&Rect2, &Rect, UpdateRect))
|
if (! W32kIntersectRect(&Rect2, &Rect, UpdateRect))
|
||||||
{
|
{
|
||||||
W32kReleaseWindowObject(Window);
|
|
||||||
if ((HRGN) 1 < hRgn && hRgn != UpdateRgn)
|
if ((HRGN) 1 < hRgn && hRgn != UpdateRgn)
|
||||||
{
|
{
|
||||||
W32kDeleteObject(hRgn);
|
W32kDeleteObject(hRgn);
|
||||||
|
@ -613,7 +614,7 @@ PaintRedrawWindow(HWND hWnd, const RECT* UpdateRect, HRGN UpdateRgn,
|
||||||
{
|
{
|
||||||
W32kDeleteObject(hRgn);
|
W32kDeleteObject(hRgn);
|
||||||
}
|
}
|
||||||
W32kReleaseWindowObject(Window);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -875,40 +876,40 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* lPs)
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
INT DcxFlags;
|
INT DcxFlags;
|
||||||
|
|
||||||
Status =
|
if (!(Window = W32kGetWindowObject(hWnd)))
|
||||||
ObmReferenceObjectByHandle(PsGetWin32Process()->WindowStation->HandleTable,
|
{
|
||||||
hWnd,
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
otWindow,
|
return NULL;
|
||||||
(PVOID*)&Window);
|
}
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
IsIcon = Window->Style & WS_MINIMIZE &&
|
|
||||||
NtUserGetClassLong(Window->Self, GCL_HICON);
|
|
||||||
|
|
||||||
/* Send WM_NCPAINT */
|
/* Send WM_NCPAINT */
|
||||||
PaintUpdateNCRegion(Window, 0, UNC_UPDATE | UNC_IN_BEGINPAINT);
|
PaintUpdateNCRegion(Window, 0, UNC_UPDATE | UNC_IN_BEGINPAINT);
|
||||||
|
|
||||||
/* FIXME: Check the window is still valid. */
|
/* Check ifthe window is still valid. */
|
||||||
|
if (!W32kGetWindowObject(hWnd))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* retrieve update region */
|
||||||
UpdateRegion = Window->UpdateRegion;
|
UpdateRegion = Window->UpdateRegion;
|
||||||
Window->UpdateRegion = 0;
|
Window->UpdateRegion = 0;
|
||||||
if (UpdateRegion != NULL ||
|
if (UpdateRegion != NULL || (Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT))
|
||||||
(Window->Flags & WINDOWOBJECT_NEED_INTERNALPAINT))
|
|
||||||
{
|
{
|
||||||
MsqDecPaintCountQueue(Window->MessageQueue);
|
MsqDecPaintCountQueue(Window->MessageQueue);
|
||||||
}
|
}
|
||||||
Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
|
Window->Flags &= ~WINDOWOBJECT_NEED_INTERNALPAINT;
|
||||||
|
|
||||||
/* FIXME: Hide claret. */
|
/* FIXME: Hide caret. */
|
||||||
|
|
||||||
|
IsIcon = (Window->Style & WS_MINIMIZE) && W32kGetClassLong(Window, GCL_HICON);
|
||||||
|
|
||||||
DcxFlags = DCX_INTERSECTRGN | DCX_WINDOWPAINT | DCX_USESTYLE;
|
DcxFlags = DCX_INTERSECTRGN | DCX_WINDOWPAINT | DCX_USESTYLE;
|
||||||
if (IsIcon)
|
if (IsIcon)
|
||||||
{
|
{
|
||||||
DcxFlags |= DCX_WINDOW;
|
DcxFlags |= DCX_WINDOW;
|
||||||
}
|
}
|
||||||
if (NtUserGetClassLong(Window->Self, GCL_STYLE) & CS_PARENTDC)
|
if (W32kGetClassLong(Window, GCL_STYLE) & CS_PARENTDC)
|
||||||
{
|
{
|
||||||
/* Don't clip the output to the update region for CS_PARENTDC window */
|
/* Don't clip the output to the update region for CS_PARENTDC window */
|
||||||
if ((HRGN) 1 < UpdateRegion)
|
if ((HRGN) 1 < UpdateRegion)
|
||||||
|
@ -962,21 +963,21 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* lPs)
|
||||||
DWORD
|
DWORD
|
||||||
STDCALL
|
STDCALL
|
||||||
NtUserInvalidateRect(
|
NtUserInvalidateRect(
|
||||||
HWND Wnd,
|
HWND hWnd,
|
||||||
CONST RECT *Rect,
|
CONST RECT *Rect,
|
||||||
WINBOOL Erase)
|
WINBOOL Erase)
|
||||||
{
|
{
|
||||||
return PaintRedrawWindow(Wnd, Rect, 0, RDW_INVALIDATE | (Erase ? RDW_ERASE : 0), 0);
|
return NtUserRedrawWindow(hWnd, Rect, 0, RDW_INVALIDATE | (Erase ? RDW_ERASE : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
STDCALL
|
STDCALL
|
||||||
NtUserInvalidateRgn(
|
NtUserInvalidateRgn(
|
||||||
HWND Wnd,
|
HWND hWnd,
|
||||||
HRGN Rgn,
|
HRGN Rgn,
|
||||||
WINBOOL Erase)
|
WINBOOL Erase)
|
||||||
{
|
{
|
||||||
return PaintRedrawWindow(Wnd, NULL, Rgn, RDW_INVALIDATE | (Erase ? RDW_ERASE : 0), 0);
|
return NtUserRedrawWindow(hWnd, NULL, Rgn, RDW_INVALIDATE | (Erase ? RDW_ERASE : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
|
@ -985,7 +986,7 @@ NtUserValidateRgn(
|
||||||
HWND hWnd,
|
HWND hWnd,
|
||||||
HRGN hRgn)
|
HRGN hRgn)
|
||||||
{
|
{
|
||||||
return PaintRedrawWindow(hWnd, NULL, hRgn, RDW_VALIDATE | RDW_NOCHILDREN, 0);
|
return NtUserRedrawWindow(hWnd, NULL, hRgn, RDW_VALIDATE | RDW_NOCHILDREN);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -998,11 +999,11 @@ NtUserGetUpdateRgn(
|
||||||
PWINDOW_OBJECT Window;
|
PWINDOW_OBJECT Window;
|
||||||
int RegionType;
|
int RegionType;
|
||||||
|
|
||||||
Window = W32kGetWindowObject(hWnd);
|
if (!(Window = W32kGetWindowObject(hWnd)))
|
||||||
if (NULL == Window)
|
{
|
||||||
{
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == Window->UpdateRegion)
|
if (NULL == Window->UpdateRegion)
|
||||||
{
|
{
|
||||||
|
@ -1023,13 +1024,13 @@ NtUserGetUpdateRgn(
|
||||||
Window->WindowRect.top - Window->ClientRect.top );
|
Window->WindowRect.top - Window->ClientRect.top );
|
||||||
}
|
}
|
||||||
|
|
||||||
W32kReleaseWindowObject(Window);
|
|
||||||
|
|
||||||
if (bErase &&
|
if (bErase &&
|
||||||
(SIMPLEREGION == RegionType || COMPLEXREGION == RegionType))
|
(SIMPLEREGION == RegionType || COMPLEXREGION == RegionType))
|
||||||
{
|
{
|
||||||
PaintRedrawWindow(hWnd, NULL, NULL, RDW_ERASENOW | RDW_NOCHILDREN, 0);
|
PaintRedrawWindow(Window, NULL, NULL, RDW_ERASENOW | RDW_NOCHILDREN, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
W32kReleaseWindowObject(Window);
|
||||||
|
|
||||||
return RegionType;
|
return RegionType;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: stubs.c,v 1.21 2003/08/01 14:38:51 dwelch Exp $
|
/* $Id: stubs.c,v 1.22 2003/08/04 16:54:54 gdalsnes Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -331,17 +331,6 @@ NtUserDestroyAcceleratorTable(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD
|
|
||||||
STDCALL
|
|
||||||
NtUserDragDetect(
|
|
||||||
DWORD Unknown0,
|
|
||||||
DWORD Unknown1,
|
|
||||||
DWORD Unknown2)
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
STDCALL
|
STDCALL
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*
|
*
|
||||||
* $Id: vis.c,v 1.3 2003/08/02 19:56:19 dwelch Exp $
|
* $Id: vis.c,v 1.4 2003/08/04 16:54:54 gdalsnes Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -209,6 +209,7 @@ VIS_RepaintDesktop(HWND Desktop, HRGN RepaintRgn)
|
||||||
NtUserReleaseDC(Desktop, dc);
|
NtUserReleaseDC(Desktop, dc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VOID FASTCALL
|
VOID FASTCALL
|
||||||
VIS_WindowLayoutChanged(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
|
VIS_WindowLayoutChanged(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
|
||||||
|
@ -232,7 +233,7 @@ VIS_WindowLayoutChanged(PDESKTOP_OBJECT Desktop, PWINDOW_OBJECT Window,
|
||||||
{
|
{
|
||||||
Covered = UnsafeW32kCreateRectRgnIndirect(&Child->WindowRect);
|
Covered = UnsafeW32kCreateRectRgnIndirect(&Child->WindowRect);
|
||||||
W32kCombineRgn(Uncovered, Uncovered, Covered, RGN_DIFF);
|
W32kCombineRgn(Uncovered, Uncovered, Covered, RGN_DIFF);
|
||||||
PaintRedrawWindow(Child->Self, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE, 0);
|
PaintRedrawWindow(Child, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE, 0);
|
||||||
W32kDeleteObject(Covered);
|
W32kDeleteObject(Covered);
|
||||||
}
|
}
|
||||||
CurrentEntry = CurrentEntry->Flink;
|
CurrentEntry = CurrentEntry->Flink;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: window.c,v 1.74 2003/08/01 20:24:54 dwelch Exp $
|
/* $Id: window.c,v 1.75 2003/08/04 16:54:54 gdalsnes Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -66,57 +66,94 @@ static LIST_ENTRY RegisteredMessageListHead;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
HWND STDCALL
|
PWINDOW_OBJECT FASTCALL
|
||||||
NtUserGetAncestor(HWND hWnd, UINT Flags)
|
W32kGetAncestor(PWINDOW_OBJECT Wnd, UINT Type)
|
||||||
{
|
{
|
||||||
PWINDOW_OBJECT WindowObject;
|
if (W32kIsDesktopWindow(Wnd)) return NULL;
|
||||||
WindowObject = W32kGetWindowObject(hWnd);
|
|
||||||
if (WindowObject == NULL)
|
|
||||||
{
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
if (W32kIsDesktopWindow(WindowObject))
|
|
||||||
{
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
if (Flags & GA_PARENT)
|
|
||||||
{
|
|
||||||
HWND hParent;
|
|
||||||
|
|
||||||
if (WindowObject->Parent == NULL)
|
switch (Type)
|
||||||
{
|
|
||||||
W32kReleaseWindowObject(WindowObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
hParent = WindowObject->Parent->Self;
|
|
||||||
|
|
||||||
W32kReleaseWindowObject(WindowObject);
|
|
||||||
|
|
||||||
return(hParent);
|
|
||||||
}
|
|
||||||
else if (Flags & GA_ROOT)
|
|
||||||
{
|
{
|
||||||
PWINDOW_OBJECT pChainEnumerator;
|
case GA_PARENT:
|
||||||
HWND hRoot;
|
return Wnd->Parent;
|
||||||
|
|
||||||
pChainEnumerator = WindowObject;
|
case GA_ROOT:
|
||||||
while(!W32kIsDesktopWindow(pChainEnumerator->Parent))
|
while(!W32kIsDesktopWindow(Wnd->Parent))
|
||||||
{
|
{
|
||||||
pChainEnumerator = pChainEnumerator->Parent;
|
Wnd = Wnd->Parent;
|
||||||
}
|
}
|
||||||
|
return Wnd;
|
||||||
|
|
||||||
|
case GA_ROOTOWNER:
|
||||||
|
while ((Wnd = W32kGetParent(Wnd)));
|
||||||
|
return Wnd;
|
||||||
|
}
|
||||||
|
|
||||||
hRoot = pChainEnumerator->Self;
|
return NULL;
|
||||||
W32kReleaseWindowObject(WindowObject);
|
|
||||||
|
|
||||||
return(hRoot);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UNIMPLEMENTED;
|
|
||||||
return(NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HWND STDCALL
|
||||||
|
NtUserGetAncestor(HWND hWnd, UINT Type)
|
||||||
|
{
|
||||||
|
PWINDOW_OBJECT Wnd, WndAncestor;
|
||||||
|
HWND hWndAncestor = NULL;
|
||||||
|
|
||||||
|
W32kAcquireWinStaLockShared();
|
||||||
|
|
||||||
|
if (!(Wnd = W32kGetWindowObject(hWnd)))
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
WndAncestor = W32kGetAncestor(Wnd, Type);
|
||||||
|
if (WndAncestor) hWndAncestor = WndAncestor->Self;
|
||||||
|
|
||||||
|
W32kReleaseWinStaLock();
|
||||||
|
|
||||||
|
return hWndAncestor;
|
||||||
|
}
|
||||||
|
|
||||||
|
PWINDOW_OBJECT FASTCALL
|
||||||
|
W32kGetParent(PWINDOW_OBJECT Wnd)
|
||||||
|
{
|
||||||
|
if (Wnd->Style & WS_POPUP)
|
||||||
|
{
|
||||||
|
return W32kGetWindowObject(Wnd->hWndOwner); /* wine use HWND for owner window (unknown reason) */
|
||||||
|
}
|
||||||
|
else if (Wnd->Style & WS_CHILD)
|
||||||
|
{
|
||||||
|
return Wnd->Parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HWND STDCALL
|
||||||
|
NtUserGetParent(HWND hWnd)
|
||||||
|
{
|
||||||
|
PWINDOW_OBJECT Wnd, WndParent;
|
||||||
|
HWND hWndParent = NULL;
|
||||||
|
|
||||||
|
W32kAcquireWinStaLockShared();
|
||||||
|
|
||||||
|
if (!(Wnd = W32kGetWindowObject(hWnd)))
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
WndParent = W32kGetParent(Wnd);
|
||||||
|
if (WndParent) hWndParent = WndParent->Self;
|
||||||
|
|
||||||
|
W32kReleaseWinStaLock();
|
||||||
|
|
||||||
|
return hWndParent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
HWND FASTCALL
|
HWND FASTCALL
|
||||||
W32kSetFocusWindow(HWND hWnd)
|
W32kSetFocusWindow(HWND hWnd)
|
||||||
{
|
{
|
||||||
|
@ -232,11 +269,6 @@ HWND FASTCALL W32kGetDesktopWindow(VOID)
|
||||||
return W32kGetActiveDesktop()->DesktopWindow;
|
return W32kGetActiveDesktop()->DesktopWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWND FASTCALL W32kGetParentWindow(HWND hWnd)
|
|
||||||
{
|
|
||||||
return W32kGetWindowObject(hWnd)->ParentHandle;
|
|
||||||
}
|
|
||||||
|
|
||||||
PWINDOW_OBJECT FASTCALL
|
PWINDOW_OBJECT FASTCALL
|
||||||
W32kGetWindowObject(HWND hWnd)
|
W32kGetWindowObject(HWND hWnd)
|
||||||
{
|
{
|
||||||
|
@ -279,27 +311,6 @@ W32kGetClientRect(PWINDOW_OBJECT WindowObject, PRECT Rect)
|
||||||
WindowObject->ClientRect.bottom - WindowObject->ClientRect.top;
|
WindowObject->ClientRect.bottom - WindowObject->ClientRect.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
* Internal Function.
|
|
||||||
* Return the dimension of the window in the screen coordinates.
|
|
||||||
*/
|
|
||||||
BOOL STDCALL
|
|
||||||
W32kGetWindowRect(HWND hWnd, LPRECT Rect)
|
|
||||||
{
|
|
||||||
PWINDOW_OBJECT WindowObject;
|
|
||||||
|
|
||||||
ASSERT(NULL != Rect);
|
|
||||||
|
|
||||||
WindowObject = W32kGetWindowObject(hWnd);
|
|
||||||
if (WindowObject == NULL)
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
*Rect = WindowObject->WindowRect;
|
|
||||||
W32kReleaseWindowObject(WindowObject);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Return the dimension of the window in the screen coordinates.
|
* Return the dimension of the window in the screen coordinates.
|
||||||
|
@ -309,16 +320,26 @@ W32kGetWindowRect(HWND hWnd, LPRECT Rect)
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
NtUserGetWindowRect(HWND hWnd, LPRECT Rect)
|
NtUserGetWindowRect(HWND hWnd, LPRECT Rect)
|
||||||
{
|
{
|
||||||
|
PWINDOW_OBJECT Wnd;
|
||||||
RECT SafeRect;
|
RECT SafeRect;
|
||||||
BOOL bRet;
|
|
||||||
|
|
||||||
bRet = W32kGetWindowRect(hWnd, &SafeRect);
|
W32kAcquireWinStaLockShared();
|
||||||
|
if (!(Wnd = W32kGetWindowObject(hWnd)))
|
||||||
|
{
|
||||||
|
W32kReleaseWinStaLock();
|
||||||
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
SafeRect = Wnd->WindowRect;
|
||||||
|
W32kReleaseWinStaLock();
|
||||||
|
|
||||||
if (! NT_SUCCESS(MmCopyToCaller(Rect, &SafeRect, sizeof(RECT))))
|
if (! NT_SUCCESS(MmCopyToCaller(Rect, &SafeRect, sizeof(RECT))))
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bRet;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -334,19 +355,22 @@ NtUserGetClientRect(HWND hWnd, LPRECT Rect)
|
||||||
PWINDOW_OBJECT WindowObject;
|
PWINDOW_OBJECT WindowObject;
|
||||||
RECT SafeRect;
|
RECT SafeRect;
|
||||||
|
|
||||||
WindowObject = W32kGetWindowObject(hWnd);
|
W32kAcquireWinStaLockShared();
|
||||||
if (WindowObject == NULL)
|
if (!(WindowObject = W32kGetWindowObject(hWnd)))
|
||||||
{
|
{
|
||||||
return(FALSE);
|
W32kReleaseWinStaLock();
|
||||||
}
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
W32kGetClientRect(WindowObject, &SafeRect);
|
return FALSE;
|
||||||
if (! NT_SUCCESS(MmCopyToCaller(Rect, &SafeRect, sizeof(RECT))))
|
}
|
||||||
{
|
|
||||||
W32kReleaseWindowObject(WindowObject);
|
W32kGetClientRect(WindowObject, &SafeRect);
|
||||||
return(FALSE);
|
W32kReleaseWinStaLock();
|
||||||
}
|
|
||||||
|
if (! NT_SUCCESS(MmCopyToCaller(Rect, &SafeRect, sizeof(RECT))))
|
||||||
|
{
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
W32kReleaseWindowObject(WindowObject);
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,21 +407,6 @@ W32kGetFocusWindow(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WNDPROC FASTCALL
|
|
||||||
W32kGetWindowProc(HWND Wnd)
|
|
||||||
{
|
|
||||||
PWINDOW_OBJECT WindowObject;
|
|
||||||
WNDPROC WndProc;
|
|
||||||
|
|
||||||
WindowObject = W32kGetWindowObject(Wnd);
|
|
||||||
if( !WindowObject )
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
WndProc = WindowObject->WndProc;
|
|
||||||
W32kReleaseWindowObject(WindowObject);
|
|
||||||
return(WndProc);
|
|
||||||
}
|
|
||||||
|
|
||||||
NTSTATUS FASTCALL
|
NTSTATUS FASTCALL
|
||||||
InitWindowImpl(VOID)
|
InitWindowImpl(VOID)
|
||||||
{
|
{
|
||||||
|
@ -589,7 +598,9 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
||||||
/* Create the window object. */
|
/* Create the window object. */
|
||||||
WindowObject = (PWINDOW_OBJECT)
|
WindowObject = (PWINDOW_OBJECT)
|
||||||
ObmCreateObject(PsGetWin32Process()->WindowStation->HandleTable, &Handle,
|
ObmCreateObject(PsGetWin32Process()->WindowStation->HandleTable, &Handle,
|
||||||
otWindow, sizeof(WINDOW_OBJECT));
|
otWindow, sizeof(WINDOW_OBJECT) + ClassObject->Class.cbWndExtra
|
||||||
|
);
|
||||||
|
|
||||||
DPRINT("Created object with handle %X\n", Handle);
|
DPRINT("Created object with handle %X\n", Handle);
|
||||||
if (!WindowObject)
|
if (!WindowObject)
|
||||||
{
|
{
|
||||||
|
@ -623,6 +634,19 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
||||||
WindowObject->WndProc = ClassObject->Class.lpfnWndProc;
|
WindowObject->WndProc = ClassObject->Class.lpfnWndProc;
|
||||||
WindowObject->OwnerThread = PsGetCurrentThread();
|
WindowObject->OwnerThread = PsGetCurrentThread();
|
||||||
|
|
||||||
|
/* extra window data */
|
||||||
|
if (ClassObject->Class.cbWndExtra != 0)
|
||||||
|
{
|
||||||
|
WindowObject->ExtraData = (PULONG)(WindowObject + 1);
|
||||||
|
WindowObject->ExtraDataSize = ClassObject->Class.cbWndExtra;
|
||||||
|
RtlZeroMemory(WindowObject->ExtraData, WindowObject->ExtraDataSize);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WindowObject->ExtraData = NULL;
|
||||||
|
WindowObject->ExtraDataSize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
ExAcquireFastMutexUnsafe(&ParentWindow->ChildrenListLock);
|
ExAcquireFastMutexUnsafe(&ParentWindow->ChildrenListLock);
|
||||||
InsertHeadList(&ParentWindow->ChildrenListHead,
|
InsertHeadList(&ParentWindow->ChildrenListHead,
|
||||||
&WindowObject->SiblingListEntry);
|
&WindowObject->SiblingListEntry);
|
||||||
|
@ -635,18 +659,6 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
||||||
RtlInitUnicodeString(&WindowObject->WindowName, WindowName.Buffer);
|
RtlInitUnicodeString(&WindowObject->WindowName, WindowName.Buffer);
|
||||||
RtlFreeUnicodeString(&WindowName);
|
RtlFreeUnicodeString(&WindowName);
|
||||||
|
|
||||||
if (ClassObject->Class.cbWndExtra != 0)
|
|
||||||
{
|
|
||||||
WindowObject->ExtraData =
|
|
||||||
ExAllocatePool(PagedPool,
|
|
||||||
ClassObject->Class.cbWndExtra);
|
|
||||||
WindowObject->ExtraDataSize = ClassObject->Class.cbWndExtra;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
WindowObject->ExtraData = NULL;
|
|
||||||
WindowObject->ExtraDataSize = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Correct the window style. */
|
/* Correct the window style. */
|
||||||
if (!(dwStyle & WS_CHILD))
|
if (!(dwStyle & WS_CHILD))
|
||||||
|
@ -659,7 +671,7 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Insert the window into the process's window list. */
|
/* Insert the window into the thread's window list. */
|
||||||
ExAcquireFastMutexUnsafe (&PsGetWin32Thread()->WindowListLock);
|
ExAcquireFastMutexUnsafe (&PsGetWin32Thread()->WindowListLock);
|
||||||
InsertTailList (&PsGetWin32Thread()->WindowListHead,
|
InsertTailList (&PsGetWin32Thread()->WindowListHead,
|
||||||
&WindowObject->ThreadListEntry);
|
&WindowObject->ThreadListEntry);
|
||||||
|
@ -825,14 +837,14 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
||||||
return((HWND)Handle);
|
return((HWND)Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD STDCALL
|
HDWP STDCALL
|
||||||
NtUserDeferWindowPos(HDWP WinPosInfo,
|
NtUserDeferWindowPos(HDWP WinPosInfo,
|
||||||
HWND Wnd,
|
HWND Wnd,
|
||||||
HWND WndInsertAfter,
|
HWND WndInsertAfter,
|
||||||
LONG x,
|
int x,
|
||||||
LONG y,
|
int y,
|
||||||
LONG cx,
|
int cx,
|
||||||
LONG cy,
|
int cy,
|
||||||
UINT Flags)
|
UINT Flags)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
UNIMPLEMENTED
|
||||||
|
@ -893,25 +905,12 @@ static void W32kSendDestroyMsg(HWND Wnd)
|
||||||
|
|
||||||
static BOOLEAN W32kWndBelongsToThread(PWINDOW_OBJECT Window, PW32THREAD ThreadData)
|
static BOOLEAN W32kWndBelongsToThread(PWINDOW_OBJECT Window, PW32THREAD ThreadData)
|
||||||
{
|
{
|
||||||
PLIST_ENTRY Current;
|
if (Window->OwnerThread && Window->OwnerThread->Win32Thread)
|
||||||
PWINDOW_OBJECT ThreadWindow;
|
{
|
||||||
BOOLEAN Belongs = FALSE;
|
return (Window->OwnerThread->Win32Thread == ThreadData);
|
||||||
|
}
|
||||||
|
|
||||||
ExAcquireFastMutexUnsafe(&ThreadData->WindowListLock);
|
return FALSE;
|
||||||
/* If there's no win32k thread data then this thread hasn't created any windows */
|
|
||||||
if (NULL != ThreadData)
|
|
||||||
{
|
|
||||||
Current = ThreadData->WindowListHead.Flink;
|
|
||||||
while (! Belongs && Current != &ThreadData->WindowListHead)
|
|
||||||
{
|
|
||||||
ThreadWindow = CONTAINING_RECORD(Current, WINDOW_OBJECT, ThreadListEntry);
|
|
||||||
Belongs = (Window == ThreadWindow);
|
|
||||||
Current = Current->Flink;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ExReleaseFastMutexUnsafe(&ThreadData->WindowListLock);
|
|
||||||
|
|
||||||
return Belongs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOL BuildChildWindowArray(PWINDOW_OBJECT Window, HWND **Children, unsigned *NumChildren)
|
static BOOL BuildChildWindowArray(PWINDOW_OBJECT Window, HWND **Children, unsigned *NumChildren)
|
||||||
|
@ -1009,7 +1008,7 @@ static LRESULT W32kDestroyWindow(PWINDOW_OBJECT Window,
|
||||||
* Clear the update region to make sure no WM_PAINT messages will be
|
* Clear the update region to make sure no WM_PAINT messages will be
|
||||||
* generated for this window while processing the WM_NCDESTROY.
|
* generated for this window while processing the WM_NCDESTROY.
|
||||||
*/
|
*/
|
||||||
PaintRedrawWindow(Window->Self, NULL, 0,
|
PaintRedrawWindow(Window, NULL, 0,
|
||||||
RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_NOCHILDREN,
|
RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_NOCHILDREN,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
|
@ -1507,6 +1506,13 @@ NtUserRedrawWindow
|
||||||
{
|
{
|
||||||
RECT SafeUpdateRect;
|
RECT SafeUpdateRect;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
PWINDOW_OBJECT Wnd;
|
||||||
|
|
||||||
|
if (!(Wnd = W32kGetWindowObject(hWnd)))
|
||||||
|
{
|
||||||
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if(NULL != lprcUpdate)
|
if(NULL != lprcUpdate)
|
||||||
{
|
{
|
||||||
|
@ -1518,10 +1524,10 @@ NtUserRedrawWindow
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = PaintRedrawWindow
|
Status = PaintRedrawWindow
|
||||||
(
|
(
|
||||||
hWnd,
|
Wnd,
|
||||||
NULL == lprcUpdate ? NULL : &SafeUpdateRect,
|
NULL == lprcUpdate ? NULL : &SafeUpdateRect,
|
||||||
hrgnUpdate,
|
hrgnUpdate,
|
||||||
flags,
|
flags,
|
||||||
|
@ -1873,16 +1879,15 @@ NtUserSetWindowRgn(DWORD Unknown0,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD STDCALL
|
|
||||||
NtUserSetWindowWord(DWORD Unknown0,
|
WORD STDCALL
|
||||||
DWORD Unknown1,
|
NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewVal)
|
||||||
DWORD Unknown2)
|
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
UNIMPLEMENTED
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOL STDCALL
|
BOOL STDCALL
|
||||||
NtUserShowWindow(HWND hWnd,
|
NtUserShowWindow(HWND hWnd,
|
||||||
LONG nCmdShow)
|
LONG nCmdShow)
|
||||||
|
@ -2006,17 +2011,17 @@ NtUserGetWindowThreadProcessId(HWND hWnd, LPDWORD UnsafePid)
|
||||||
PWINDOW_OBJECT Wnd;
|
PWINDOW_OBJECT Wnd;
|
||||||
DWORD tid, pid;
|
DWORD tid, pid;
|
||||||
|
|
||||||
//W32kAcquireWindowsLockShared();
|
W32kAcquireWinStaLockShared();
|
||||||
|
|
||||||
if (!(Wnd = W32kGetWindowObject(hWnd)))
|
if (!(Wnd = W32kGetWindowObject(hWnd)))
|
||||||
{
|
{
|
||||||
|
W32kReleaseWinStaLock();
|
||||||
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
tid = W32kGetWindowThreadProcessId(Wnd, &pid);
|
tid = W32kGetWindowThreadProcessId(Wnd, &pid);
|
||||||
W32kReleaseWindowObject(Wnd);
|
W32kReleaseWinStaLock();
|
||||||
//W32kReleaseWindowsLock();
|
|
||||||
|
|
||||||
if (UnsafePid) MmCopyToCaller(UnsafePid, &pid, sizeof(DWORD));
|
if (UnsafePid) MmCopyToCaller(UnsafePid, &pid, sizeof(DWORD));
|
||||||
|
|
||||||
|
@ -2162,9 +2167,9 @@ NtUserBuildHwndList(
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID STDCALL
|
VOID STDCALL
|
||||||
NtUserValidateRect(HWND Wnd, const RECT* Rect)
|
NtUserValidateRect(HWND hWnd, const RECT* Rect)
|
||||||
{
|
{
|
||||||
(VOID)PaintRedrawWindow(Wnd, Rect, 0, RDW_VALIDATE | RDW_NOCHILDREN, 0);
|
(VOID)NtUserRedrawWindow(hWnd, Rect, 0, RDW_VALIDATE | RDW_NOCHILDREN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2183,4 +2188,86 @@ NtUserDrawMenuBarTemp(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HWND STDCALL
|
||||||
|
NtUserGetWindow(HWND hWnd, UINT Relationship)
|
||||||
|
{
|
||||||
|
PWINDOW_OBJECT Wnd;
|
||||||
|
HWND hWndResult = NULL;
|
||||||
|
|
||||||
|
W32kAcquireWinStaLockShared();
|
||||||
|
|
||||||
|
if (!(Wnd = W32kGetWindowObject(hWnd)))
|
||||||
|
{
|
||||||
|
W32kReleaseWinStaLock();
|
||||||
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (Relationship)
|
||||||
|
{
|
||||||
|
case GW_HWNDFIRST:
|
||||||
|
if (Wnd->Parent && Wnd->Parent->FirstChild)
|
||||||
|
{
|
||||||
|
hWndResult = Wnd->Parent->FirstChild->Self;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GW_HWNDLAST:
|
||||||
|
if (Wnd->Parent && Wnd->Parent->LastChild)
|
||||||
|
{
|
||||||
|
hWndResult = Wnd->Parent->LastChild->Self;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GW_HWNDNEXT:
|
||||||
|
if (Wnd->NextSibling)
|
||||||
|
{
|
||||||
|
hWndResult = Wnd->NextSibling->Self;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GW_HWNDPREV:
|
||||||
|
if (Wnd->PrevSibling)
|
||||||
|
{
|
||||||
|
hWndResult = Wnd->PrevSibling->Self;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GW_OWNER:
|
||||||
|
hWndResult = Wnd->hWndOwner;
|
||||||
|
break;
|
||||||
|
case GW_CHILD:
|
||||||
|
if (Wnd->FirstChild)
|
||||||
|
{
|
||||||
|
hWndResult = Wnd->FirstChild->Self;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
W32kReleaseWinStaLock();
|
||||||
|
|
||||||
|
return hWndResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HWND STDCALL
|
||||||
|
NtUserGetLastActivePopup(HWND hWnd)
|
||||||
|
{
|
||||||
|
PWINDOW_OBJECT Wnd;
|
||||||
|
HWND hWndLastPopup;
|
||||||
|
|
||||||
|
W32kAcquireWinStaLockShared();
|
||||||
|
|
||||||
|
if (!(Wnd = W32kGetWindowObject(hWnd)))
|
||||||
|
{
|
||||||
|
W32kReleaseWinStaLock();
|
||||||
|
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
hWndLastPopup = Wnd->hWndLastPopup;
|
||||||
|
|
||||||
|
W32kReleaseWinStaLock();
|
||||||
|
|
||||||
|
return hWndLastPopup;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: winpos.c,v 1.20 2003/08/02 19:56:19 dwelch Exp $
|
/* $Id: winpos.c,v 1.21 2003/08/04 16:54:54 gdalsnes Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -486,7 +486,7 @@ WinPosDoSimpleFrameChanged( PWINDOW_OBJECT wndPtr, RECT* pOldClientRect, WORD sw
|
||||||
if( i )
|
if( i )
|
||||||
{
|
{
|
||||||
redraw:
|
redraw:
|
||||||
PaintRedrawWindow( wndPtr->Self, &rect, hrgn, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE |
|
PaintRedrawWindow( wndPtr, &rect, hrgn, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE |
|
||||||
RDW_ERASENOW | RDW_ALLCHILDREN, RDW_EX_TOPFRAME | RDW_EX_USEHRGN );
|
RDW_ERASENOW | RDW_ALLCHILDREN, RDW_EX_TOPFRAME | RDW_EX_USEHRGN );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -872,9 +872,9 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
||||||
{
|
{
|
||||||
if (!(WinPos.flags & SWP_NOREDRAW))
|
if (!(WinPos.flags & SWP_NOREDRAW))
|
||||||
{
|
{
|
||||||
if (FlagsEx & SWP_EX_PAINTSELF)
|
if (FlagsEx & SWP_EX_PAINTSELF)
|
||||||
{
|
{
|
||||||
PaintRedrawWindow(Window->Self, NULL,
|
PaintRedrawWindow(Window, NULL,
|
||||||
(VisRgn == (HRGN) 1) ? 0 : VisRgn,
|
(VisRgn == (HRGN) 1) ? 0 : VisRgn,
|
||||||
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE |
|
RDW_ERASE | RDW_FRAME | RDW_INVALIDATE |
|
||||||
RDW_ALLCHILDREN | RDW_ERASENOW,
|
RDW_ALLCHILDREN | RDW_ERASENOW,
|
||||||
|
@ -882,7 +882,7 @@ WinPosSetWindowPos(HWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PaintRedrawWindow(Window->Parent->Self, NULL,
|
PaintRedrawWindow(Window->Parent, NULL,
|
||||||
(VisRgn == (HRGN) 1) ? 0 : VisRgn,
|
(VisRgn == (HRGN) 1) ? 0 : VisRgn,
|
||||||
RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN |
|
RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN |
|
||||||
RDW_ERASENOW,
|
RDW_ERASENOW,
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: winsta.c,v 1.21 2003/08/02 16:32:18 gdalsnes Exp $
|
/* $Id: winsta.c,v 1.22 2003/08/04 16:54:54 gdalsnes Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -68,6 +68,23 @@ static HDC ScreenDeviceContext = NULL;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
BOOL FASTCALL W32kVerifyWinStaLock(WINSTA_LOCK_TYPE Type)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch (Type)
|
||||||
|
{
|
||||||
|
case None:
|
||||||
|
return !ExIsResourceAcquiredSharedLite(&(PsGetWin32Process()->WindowStation->Resource));
|
||||||
|
case Any: /* exclusive lock is subset of shared lock */
|
||||||
|
return ExIsResourceAcquiredSharedLite(&(PsGetWin32Process()->WindowStation->Resource));
|
||||||
|
case Exclusive:
|
||||||
|
return ExIsResourceAcquiredExclusiveLite(&(PsGetWin32Process()->WindowStation->Resource));
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
inline VOID W32kAcquireWinStaLockShared()
|
inline VOID W32kAcquireWinStaLockShared()
|
||||||
{
|
{
|
||||||
ExAcquireResourceExclusiveLite(&(PsGetWin32Process()->WindowStation->Resource),
|
ExAcquireResourceExclusiveLite(&(PsGetWin32Process()->WindowStation->Resource),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue