[Win32k|User32]

- Move to the new window structure. Window Object served us well.

svn path=/trunk/; revision=49109
This commit is contained in:
James Tabor
2010-10-11 03:41:41 +00:00
parent f6c0e1acf0
commit 11291ff204
52 changed files with 1695 additions and 1990 deletions
+3 -33
View File
@@ -304,7 +304,7 @@ GetUser32Handle(HANDLE handle)
static const BOOL g_ObjectHeapTypeShared[VALIDATE_TYPE_EVENT + 1] =
{
FALSE, /* VALIDATE_TYPE_FREE (not used) */
TRUE, /* VALIDATE_TYPE_WIN FALSE */
FALSE, /* VALIDATE_TYPE_WIN FALSE */
TRUE, /* VALIDATE_TYPE_MENU FALSE */
TRUE, /* VALIDATE_TYPE_CURSOR */
TRUE, /* VALIDATE_TYPE_MWPOS */
@@ -427,12 +427,6 @@ ValidateCallProc(HANDLE hCallProc)
return NULL;
}
// HACK HACK HACK!
typedef struct _WNDX
{
THRDESKHEAD head;
PWND pWnd;
} WNDX, *PWNDX;
//
// Validate a window handle and return the pointer to the object.
@@ -447,24 +441,12 @@ ValidateHwnd(HWND hwnd)
/* See if the window is cached */
if (hwnd == ClientInfo->CallbackWnd.hWnd)
return ClientInfo->CallbackWnd.pvWnd;
return ClientInfo->CallbackWnd.pWnd;
Wnd = ValidateHandle((HANDLE)hwnd, VALIDATE_TYPE_WIN);
if (Wnd != NULL)
{
#if 0
return Wnd;
#else
/* HACK HACK HACK! This needs to be done until WINDOW_OBJECT is completely
superseded by the WINDOW structure. We *ASSUME* a pointer to the WINDOW
structure to be at the beginning of the WINDOW_OBJECT structure!!!
!!! REMOVE AS SOON AS WINDOW_OBJECT NO LONGER EXISTS !!!
*/
if ( ((PWNDX)Wnd)->pWnd != NULL)
return DesktopPtrToUser( ((PWNDX)Wnd)->pWnd );
#endif
}
return NULL;
@@ -483,24 +465,12 @@ ValidateHwndNoErr(HWND hwnd)
/* See if the window is cached */
if (hwnd == ClientInfo->CallbackWnd.hWnd)
return ClientInfo->CallbackWnd.pvWnd;
return ClientInfo->CallbackWnd.pWnd;
Wnd = ValidateHandleNoErr((HANDLE)hwnd, VALIDATE_TYPE_WIN);
if (Wnd != NULL)
{
#if 0
return Wnd;
#else
/* HACK HACK HACK! This needs to be done until WINDOW_OBJECT is completely
superseded by the WINDOW structure. We *ASSUME* a pointer to the WINDOW
structure to be at the beginning of the WINDOW_OBJECT structure!!!
!!! REMOVE AS SOON AS WINDOW_OBJECT NO LONGER EXISTS !!!
*/
if ( ((PWNDX)Wnd)->pWnd != NULL)
return DesktopPtrToUser( ((PWNDX)Wnd)->pWnd );
#endif
}
return NULL;
+13 -4
View File
@@ -32,8 +32,11 @@ GetClassInfoExA(
IS_ATOM(lpszClass) ? lpszClass : 0,
lpwcx);
//HACKHACK: This is ROS-specific and should go away
lpwcx->cbSize = sizeof(*lpwcx);
if (!lpwcx)
{
SetLastError( ERROR_NOACCESS );
return FALSE;
}
if (hInstance == User32Instance)
{
@@ -105,8 +108,14 @@ GetClassInfoExW(
IS_ATOM(lpszClass) ? lpszClass : 0,
lpwcx);
//HACKHACK: This is ROS-specific and should go away
lpwcx->cbSize = sizeof(*lpwcx);
/* From wine, for speed only, ReactOS supports the correct return in
* Win32k. cbSize is ignored.
*/
if (!lpwcx)
{
SetLastError( ERROR_NOACCESS );
return FALSE;
}
if (hInstance == User32Instance)
{
+19 -28
View File
@@ -270,7 +270,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
else
{
info->className = (LPCWSTR)p;
p += wcslen( info->className ) + 1;
p += strlenW( info->className ) + 1;
}
if (GET_WORD(p) == 0xffff) /* Is it an integer id? */
@@ -292,7 +292,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
{
info->windowName = (LPCWSTR)p;
info->windowNameFree = FALSE;
p += wcslen( info->windowName ) + 1;
p += strlenW( info->windowName ) + 1;
}
if (GET_WORD(p))
@@ -431,7 +431,8 @@ static HWND DIALOG_FindMsgDestination( HWND hwndDlg )
if (!IsWindow(hParent)) break;
pWnd = ValidateHwnd(hParent);
if (!pWnd) break;
// FIXME: Use pWnd->fnid == FNID_DESKTOP
if (!pWnd || hParent == GetDesktopWindow()) break;
if (!(pWnd->state & WNDS_DIALOGWINDOW))
{
@@ -473,8 +474,7 @@ static BOOL DIALOG_IsAccelerator( HWND hwnd, HWND hwndDlg, WPARAM wParam )
while (p != NULL && p[1] == '&');
/* and check if it's the one we're looking for */
/* FIXME: usage of towupper correct? */
if (p != NULL && towupper( p[1] ) == towupper( wParam ) )
if (p != NULL && toupperW( p[1] ) == toupperW( wParam ) )
{
if ((dlgCode & DLGC_STATIC) || (style & 0x0f) == BS_GROUPBOX )
{
@@ -623,7 +623,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
break;
default:
result->menuName = (LPCWSTR)p;
p += wcslen( result->menuName ) + 1;
p += strlenW( result->menuName ) + 1;
break;
}
@@ -641,14 +641,14 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
break;
default:
result->className = (LPCWSTR)p;
p += wcslen( result->className ) + 1;
p += strlenW( result->className ) + 1;
break;
}
/* Get the window caption */
result->caption = (LPCWSTR)p;
p += wcslen( result->caption ) + 1;
p += strlenW( result->caption ) + 1;
/* Get the font name */
@@ -682,7 +682,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
result->italic = LOBYTE(GET_WORD(p)); p++;
}
result->faceName = (LPCWSTR)p;
p += wcslen( result->faceName ) + 1;
p += strlenW( result->faceName ) + 1;
}
}
@@ -956,7 +956,6 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
dlgInfo->yBaseUnit = yBaseUnit;
dlgInfo->idResult = IDOK;
dlgInfo->flags = flags;
/* dlgInfo->hDialogHeap = 0; */
if (template.helpId) SetWindowContextHelpId( hwnd, template.helpId );
@@ -1134,12 +1133,6 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
//// ReactOS
if ((dlgInfo = (DIALOGINFO *)SetWindowLongPtrW( hwnd, DWLP_ROS_DIALOGINFO, 0 )))
{
/* Free dialog heap (if created) */
/*if (dlgInfo->hDialogHeap)
{
GlobalUnlock16(dlgInfo->hDialogHeap);
GlobalFree16(dlgInfo->hDialogHeap);
}*/
if (dlgInfo->hUserFont) DeleteObject( dlgInfo->hUserFont );
if (dlgInfo->hMenu) DestroyMenu( dlgInfo->hMenu );
HeapFree( GetProcessHeap(), 0, dlgInfo );
@@ -2327,14 +2320,12 @@ IsDialogMessageW(
HWND hDlg,
LPMSG lpMsg)
{
INT dlgCode = 0;
INT dlgCode = 0;
// FIXME: hooks
if (CallMsgFilterW( lpMsg, MSGF_DIALOGBOX )) return TRUE;
if ((hDlg != lpMsg->hwnd) && !IsChild( hDlg, lpMsg->hwnd )) return FALSE;
if (CallMsgFilterW( lpMsg, MSGF_DIALOGBOX )) return TRUE;
if (hDlg == GetDesktopWindow()) return FALSE;
if ((hDlg != lpMsg->hwnd) && !IsChild( hDlg, lpMsg->hwnd )) return FALSE;
hDlg = DIALOG_FindMsgDestination(hDlg);
@@ -2380,7 +2371,7 @@ IsDialogMessageW(
{
INT length;
SendMessageW (hwndNext, WM_GETTEXT, maxlen, (LPARAM) buffer);
length = wcslen (buffer);
length = strlenW (buffer);
HeapFree (GetProcessHeap(), 0, buffer);
SendMessageW (hwndNext, EM_SETSEL, 0, length);
}
@@ -2425,11 +2416,8 @@ IsDialogMessageW(
else if (DC_HASDEFID == HIWORD(dw = SendMessageW (hDlg, DM_GETDEFID, 0, 0)))
{
HWND hwndDef = GetDlgItem(hDlg, LOWORD(dw));
if (!hwndDef || !IsWindowEnabled(hwndDef))
return TRUE;
SendMessageW( hDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ),
(LPARAM)GetDlgItem(hDlg, LOWORD(dw)));
if (hwndDef ? IsWindowEnabled(hwndDef) : LOWORD(dw)==IDOK)
SendMessageW( hDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ), (LPARAM)hwndDef);
}
else
{
@@ -2442,6 +2430,9 @@ IsDialogMessageW(
break;
case WM_CHAR:
/* FIXME Under what circumstances does WM_GETDLGCODE get sent?
* It does NOT get sent in the test program I have
*/
dlgCode = SendMessageW( lpMsg->hwnd, WM_GETDLGCODE, lpMsg->wParam, (LPARAM)lpMsg );
if (dlgCode & (DLGC_WANTCHARS|DLGC_WANTMESSAGE)) break;
if (lpMsg->wParam == '\t' && (dlgCode & DLGC_WANTTAB)) break;
@@ -2454,7 +2445,7 @@ IsDialogMessageW(
return TRUE;
}
break;
//// ReactOS
case WM_SYSKEYDOWN:
/* If the ALT key is being pressed display the keyboard cues */
if (lpMsg->lParam & (1 << 29))
+1 -1
View File
@@ -2624,7 +2624,7 @@ User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength)
}
if (pci->CallbackWnd.hWnd == UMMsg.hwnd)
pWnd = pci->CallbackWnd.pvWnd;
pWnd = pci->CallbackWnd.pWnd;
CallbackArgs->Result = IntCallWindowProcW( CallbackArgs->IsAnsiProc,
CallbackArgs->Proc,
+15 -5
View File
@@ -173,7 +173,7 @@ typedef struct tagHOOK
typedef struct _CALLBACKWND
{
HWND hWnd;
PVOID pvWnd;
struct _WND *pWnd;
} CALLBACKWND, *PCALLBACKWND;
#define CI_TRANSACTION 0x00000001
@@ -384,6 +384,12 @@ typedef struct _CLS
} CLS, *PCLS;
typedef struct _SBINFOEX
{
SCROLLBARINFO ScrollBarInfo;
SCROLLINFO ScrollInfo;
} SBINFOEX, *PSBINFOEX;
// State Flags !Not Implemented!
#define WNDS_HASMENU 0X00000001
#define WNDS_HASVERTICALSCROOLLBAR 0X00000002
@@ -526,6 +532,7 @@ typedef struct _WND
struct _WND *spwndClipboardListener;
DWORD ExStyle2;
/* ReactOS */
struct
{
RECT NormalRect;
@@ -538,6 +545,11 @@ typedef struct _WND
UINT InternalPosInitialized : 1;
UINT HideFocus : 1; // WS_EX_UISTATEFOCUSRECTHIDDEN ?
UINT HideAccel : 1; // WS_EX_UISTATEKBACCELHIDDEN ?
/* Scrollbar info */
PSBINFOEX pSBInfoex; // convert to PSBINFO
/* Entry in the list of thread windows. */
LIST_ENTRY ThreadListEntry;
} WND, *PWND;
typedef struct _PFNCLIENT
@@ -1013,13 +1025,13 @@ NtUserSetSystemMenu(
HWND hWnd,
HMENU hMenu);
DWORD
BOOL
NTAPI
NtUserThunkedMenuInfo(
HMENU hMenu,
LPCMENUINFO lpcmi);
DWORD
BOOL
NTAPI
NtUserThunkedMenuItemInfo(
HMENU hMenu,
@@ -3231,8 +3243,6 @@ NtUserMenuInfo(
BOOL fsog
);
typedef struct tagROSMENUITEMINFO
{
/* ----------- MENUITEMINFOW ----------- */
+11 -11
View File
@@ -71,13 +71,13 @@ IntEngWndCallChangeProc(
}
/*
* Fills the CLIPOBJ and client rect of the WNDOBJ with the data from the given WINDOW_OBJECT
* Fills the CLIPOBJ and client rect of the WNDOBJ with the data from the given WND
*/
BOOLEAN
FASTCALL
IntEngWndUpdateClipObj(
WNDGDI *WndObjInt,
PWINDOW_OBJECT Window)
PWND Window)
{
HRGN hVisRgn;
PROSRGNDATA visRgn;
@@ -89,7 +89,7 @@ IntEngWndUpdateClipObj(
hVisRgn = VIS_ComputeVisibleRegion(Window, TRUE, TRUE, TRUE);
if (hVisRgn != NULL)
{
NtGdiOffsetRgn(hVisRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
NtGdiOffsetRgn(hVisRgn, Window->rcClient.left, Window->rcClient.top);
visRgn = RGNOBJAPI_Lock(hVisRgn, NULL);
if (visRgn != NULL)
{
@@ -127,8 +127,8 @@ IntEngWndUpdateClipObj(
if (ClipObj == NULL)
{
/* Fall back to client rect */
ClipObj = IntEngCreateClipRegion(1, &Window->Wnd->rcClient,
&Window->Wnd->rcClient);
ClipObj = IntEngCreateClipRegion(1, &Window->rcClient,
&Window->rcClient);
}
if (ClipObj == NULL)
@@ -138,7 +138,7 @@ IntEngWndUpdateClipObj(
}
RtlCopyMemory(&WndObjInt->WndObj.coClient, ClipObj, sizeof (CLIPOBJ));
RtlCopyMemory(&WndObjInt->WndObj.rclClient, &Window->Wnd->rcClient, sizeof (RECT));
RtlCopyMemory(&WndObjInt->WndObj.rclClient, &Window->rcClient, sizeof (RECT));
OldClipObj = InterlockedExchangePointer((PVOID*)&WndObjInt->ClientClipObj, ClipObj);
if (OldClipObj != NULL)
IntEngDeleteClipRegion(OldClipObj);
@@ -147,12 +147,12 @@ IntEngWndUpdateClipObj(
}
/*
* Updates all WNDOBJs of the given WINDOW_OBJECT and calls the change-procs.
* Updates all WNDOBJs of the given WND and calls the change-procs.
*/
VOID
FASTCALL
IntEngWindowChanged(
PWINDOW_OBJECT Window,
PWND Window,
FLONG flChanged)
{
WNDGDI *Current;
@@ -160,7 +160,7 @@ IntEngWindowChanged(
ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL);
hWnd = Window->hSelf; // pWnd->head.h;
hWnd = Window->head.h;
Current = (WNDGDI *)IntGetProp(Window, AtomWndObj);
if ( gcountPWO &&
@@ -206,7 +206,7 @@ EngCreateWnd(
{
WNDGDI *WndObjInt = NULL;
WNDOBJ *WndObjUser = NULL;
PWINDOW_OBJECT Window;
PWND Window;
BOOL calledFromUser;
DECLARE_RETURN(WNDOBJ*);
@@ -279,7 +279,7 @@ EngDeleteWnd(
IN WNDOBJ *pwo)
{
WNDGDI *WndObjInt = ObjToGDI(pwo, WND);
PWINDOW_OBJECT Window;
PWND Window;
BOOL calledFromUser;
DPRINT("EngDeleteWnd: pwo = 0x%x\n", pwo);
@@ -17,8 +17,8 @@ co_IntSetCaretPos(int X, int Y);
BOOL FASTCALL
IntSwitchCaretShowing(PVOID Info);
BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT WindowObject);
BOOL FASTCALL co_UserShowCaret(PWND WindowObject);
BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT WindowObject);
BOOL FASTCALL co_UserHideCaret(PWND WindowObject);
/* EOF */
@@ -7,7 +7,7 @@ VOID FASTCALL IntIncrementSequenceNumber(VOID);
typedef struct _ClipboardChainElement
{
PWINDOW_OBJECT window;
PWND window;
struct _ClipboardChainElement *next;
} CLIPBOARDCHAINELEMENT, *PCLIPBOARDCHAINELEMENT;
@@ -23,9 +23,9 @@ typedef struct _CLIPBOARDSYSTEM
{
PTHREADINFO ClipboardThread;
PTHREADINFO ClipboardOwnerThread;
PWINDOW_OBJECT ClipboardWindow;
PWINDOW_OBJECT ClipboardViewerWindow;
PWINDOW_OBJECT ClipboardOwnerWindow;
PWND ClipboardWindow;
PWND ClipboardViewerWindow;
PWND ClipboardOwnerWindow;
BOOL sendDrawClipboardMsg;
BOOL recentlySetClipboard;
BOOL delayedRender;
@@ -41,7 +41,7 @@ typedef struct _CLIPBOARDSYSTEM
} CLIPBOARDSYSTEM, *PCLIPBOARDSYSTEM;
VOID FASTCALL
IntClipboardFreeWindow(PWINDOW_OBJECT window);
IntClipboardFreeWindow(PWND window);
UINT APIENTRY IntEnumClipboardFormats(UINT format);
@@ -50,7 +50,7 @@ typedef struct tagDCE
#define DCX_INDESTROY 0x00400000
BOOL FASTCALL DCE_Cleanup(PDCE pDce);
PDCE FASTCALL DceAllocDCE(PWINDOW_OBJECT Window, DCE_TYPE Type);
PDCE FASTCALL DceAllocDCE(PWND Window, DCE_TYPE Type);
PDCE FASTCALL DCE_FreeDCE(PDCE dce);
VOID FASTCALL DCE_FreeWindowDCE(HWND);
INT FASTCALL DCE_ExcludeRgn(HDC, HWND, HRGN);
@@ -58,8 +58,8 @@ BOOL FASTCALL DCE_InvalidateDCE(HWND, const PRECTL);
HWND FASTCALL IntWindowFromDC(HDC hDc);
PDCE FASTCALL DceFreeDCE(PDCE dce, BOOLEAN Force);
void FASTCALL DceEmptyCache(void);
VOID FASTCALL DceResetActiveDCEs(PWINDOW_OBJECT Window);
VOID FASTCALL DceResetActiveDCEs(PWND Window);
void FASTCALL DceFreeClassDCE(HDC);
HWND FASTCALL UserGethWnd(HDC,PWNDOBJ*);
void FASTCALL DceFreeWindowDCE(PWINDOW_OBJECT);
void FASTCALL DceFreeWindowDCE(PWND);
void FASTCALL DceFreeThreadDCE(PTHREADINFO);
@@ -76,7 +76,7 @@ IntGetScreenDC(VOID);
HWND FASTCALL
IntGetDesktopWindow (VOID);
PWINDOW_OBJECT FASTCALL
PWND FASTCALL
UserGetDesktopWindow(VOID);
HWND FASTCALL
@@ -15,7 +15,7 @@ IntEngMaskBlt(SURFOBJ *psoDest,
VOID FASTCALL
IntEngWindowChanged(
PWINDOW_OBJECT Window,
PWND Window,
FLONG flChanged);
VOID FASTCALL IntGdiAcquireSemaphore ( HSEMAPHORE hsem );
@@ -17,8 +17,8 @@ HWND APIENTRY IntGetCapture(VOID);
HWND FASTCALL UserGetActiveWindow(VOID);
BOOL FASTCALL
co_IntMouseActivateWindow(PWINDOW_OBJECT Window);
co_IntMouseActivateWindow(PWND Window);
BOOL FASTCALL
co_IntSetForegroundWindow(PWINDOW_OBJECT Window);
co_IntSetForegroundWindow(PWND Window);
HWND FASTCALL
co_IntSetActiveWindow(PWINDOW_OBJECT Window);
co_IntSetActiveWindow(PWND Window);
@@ -27,7 +27,7 @@ GetHotKey (UINT fsModifiers,
int *id);
VOID FASTCALL
UnregisterWindowHotKeys(PWINDOW_OBJECT Window);
UnregisterWindowHotKeys(PWND Window);
VOID FASTCALL
UnregisterThreadHotKeys(struct _ETHREAD *Thread);
@@ -94,7 +94,7 @@ IntCheckMenuItem(PMENU_OBJECT MenuObject, UINT uIDCheckItem, UINT uCheck);
BOOL FASTCALL
IntSetMenuItemRect(PMENU_OBJECT MenuObject, UINT Item, BOOL fByPos, RECTL *rcRect);
DWORD APIENTRY UserInsertMenuItem(HMENU hMenu, UINT uItem, BOOL fByPosition, LPCMENUITEMINFOW lpmii);
DWORD FASTCALL UserInsertMenuItem(PMENU_OBJECT Menu, UINT uItem, BOOL fByPosition, LPCMENUITEMINFOW lpmii);
BOOL FASTCALL
IntCleanupMenus(struct _EPROCESS *Process, PPROCESSINFO Win32Process);
@@ -128,7 +128,7 @@ BOOLEAN APIENTRY
co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
IN BOOLEAN Hardware,
IN BOOLEAN Remove,
IN PWINDOW_OBJECT Window,
IN PWND Window,
IN UINT MsgFilterLow,
IN UINT MsgFilterHigh,
OUT PUSER_MESSAGE* Message);
@@ -147,7 +147,7 @@ MsqInitializeImpl(VOID);
BOOLEAN FASTCALL
co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue);
NTSTATUS FASTCALL
co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT WndFilter,
co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter,
UINT MsgFilterMin, UINT MsgFilterMax);
VOID FASTCALL
MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue,
@@ -5,11 +5,11 @@
#include <include/window.h>
BOOL FASTCALL
co_UserRedrawWindow(PWINDOW_OBJECT Wnd, const RECTL* UpdateRect, HRGN UpdateRgn, ULONG Flags);
co_UserRedrawWindow(PWND Wnd, const RECTL* UpdateRect, HRGN UpdateRgn, ULONG Flags);
VOID FASTCALL
IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags);
IntInvalidateWindows(PWND Window, HRGN hRgn, ULONG Flags);
BOOL FASTCALL
IntGetPaintMessage(PWINDOW_OBJECT Window, UINT MsgFilterMin, UINT MsgFilterMax, PTHREADINFO Thread,
IntGetPaintMessage(PWND Window, UINT MsgFilterMin, UINT MsgFilterMax, PTHREADINFO Thread,
MSG *Message, BOOL Remove);
INT FASTCALL UserRealizePalette(HDC);
INT FASTCALL co_UserGetUpdateRgn(PWINDOW_OBJECT, HRGN, BOOL);
INT FASTCALL co_UserGetUpdateRgn(PWND, HRGN, BOOL);
@@ -1,5 +1,5 @@
#pragma once
PPROPERTY FASTCALL IntGetProp(PWINDOW_OBJECT,ATOM);
BOOL FASTCALL IntRemoveProp(PWINDOW_OBJECT,ATOM);
BOOL FASTCALL IntSetProp(PWINDOW_OBJECT, ATOM, HANDLE);
PPROPERTY FASTCALL IntGetProp(PWND,ATOM);
BOOL FASTCALL IntRemoveProp(PWND,ATOM);
BOOL FASTCALL IntSetProp(PWND, ATOM, HANDLE);
@@ -43,21 +43,21 @@ typedef struct tagSBTRACK
PSBCALC pSBCalc;
} SBTRACK, *PSBTRACK;
/*
typedef struct _SBINFOEX
{
SCROLLBARINFO ScrollBarInfo;
SCROLLINFO ScrollInfo;
} SBINFOEX, *PSBINFOEX;
*/
#define IntGetScrollbarInfoFromWindow(Window, i) \
((PSCROLLBARINFO)(&((Window)->pSBInfo + i)->ScrollBarInfo))
((PSCROLLBARINFO)(&((Window)->pSBInfoex + i)->ScrollBarInfo))
#define IntGetScrollInfoFromWindow(Window, i) \
((LPSCROLLINFO)(&((Window)->pSBInfo + i)->ScrollInfo))
((LPSCROLLINFO)(&((Window)->pSBInfoex + i)->ScrollInfo))
#define SBOBJ_TO_SBID(Obj) ((Obj) - OBJID_HSCROLL)
#define SBID_IS_VALID(id) (id == SB_HORZ || id == SB_VERT || id == SB_CTL)
BOOL FASTCALL co_IntCreateScrollBars(PWINDOW_OBJECT Window);
BOOL FASTCALL IntDestroyScrollBars(PWINDOW_OBJECT Window);
BOOL FASTCALL co_IntCreateScrollBars(PWND Window);
BOOL FASTCALL IntDestroyScrollBars(PWND Window);
@@ -5,7 +5,7 @@ typedef struct _TIMER
HEAD head;
LIST_ENTRY ptmrList;
PTHREADINFO pti;
PWINDOW_OBJECT pWnd; // hWnd
PWND pWnd; // hWnd
UINT_PTR nID; // Specifies a nonzero timer identifier.
INT cmsCountdown; // uElapse
INT cmsRate; // uElapse
@@ -28,13 +28,13 @@ extern PKTIMER MasterTimer;
NTSTATUS FASTCALL InitTimerImpl(VOID);
BOOL FASTCALL DestroyTimersForThread(PTHREADINFO pti);
BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWINDOW_OBJECT Window);
BOOL FASTCALL IntKillTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, BOOL SystemTimer);
UINT_PTR FASTCALL IntSetTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type);
BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWND Window);
BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer);
UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type);
PTIMER FASTCALL FindSystemTimer(PMSG);
BOOL FASTCALL ValidateTimerCallback(PTHREADINFO,LPARAM);
VOID CALLBACK SystemTimerProc(HWND,UINT,UINT_PTR,DWORD);
UINT_PTR FASTCALL SystemTimerSet(PWINDOW_OBJECT,UINT_PTR,UINT,TIMERPROC);
BOOL FASTCALL PostTimerMessages(PWINDOW_OBJECT);
UINT_PTR FASTCALL SystemTimerSet(PWND,UINT_PTR,UINT,TIMERPROC);
BOOL FASTCALL PostTimerMessages(PWND);
VOID FASTCALL ProcessTimers(VOID);
VOID FASTCALL StartTheTimers(VOID);
@@ -35,7 +35,7 @@ PMENU_OBJECT FASTCALL UserGetMenuObject(HMENU hMenu);
#define DUMP_REFS(obj) DPRINT1("obj 0x%x, refs %i\n",obj, ((PHEAD)obj)->cLockObj)
PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd);
PWND FASTCALL IntGetWindowObject(HWND hWnd);
/*************** WINSTA.C ***************/
@@ -44,7 +44,7 @@ HWINSTA FASTCALL UserGetProcessWindowStation(VOID);
/*************** WINPOS.C ***************/
BOOL FASTCALL
UserGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point);
UserGetClientOrigin(PWND Window, LPPOINT Point);
/*************** FOCUS.C ***************/
@@ -52,18 +52,18 @@ HWND FASTCALL UserGetActiveWindow(VOID);
HWND FASTCALL UserGetForegroundWindow(VOID);
HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window);
HWND FASTCALL co_UserSetFocus(PWND Window);
/*************** WINDC.C ***************/
INT FASTCALL
UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint);
UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint);
HDC FASTCALL
UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
HDC FASTCALL
UserGetWindowDC(PWINDOW_OBJECT Wnd);
UserGetWindowDC(PWND Wnd);
/*************** SESSION.C ***************/
@@ -110,12 +110,12 @@ UserPostMessage(HWND Wnd,
/*************** PAINTING.C ***************/
BOOL FASTCALL co_UserValidateRgn(PWINDOW_OBJECT Window, HRGN hRgn);
BOOL FASTCALL co_UserValidateRgn(PWND Window, HRGN hRgn);
/*************** WINDOW.C ***************/
PWINDOW_OBJECT FASTCALL UserGetWindowObject(HWND hWnd);
PWND FASTCALL UserGetWindowObject(HWND hWnd);
VOID FASTCALL
co_DestroyThreadWindows(struct _ETHREAD *Thread);
@@ -123,11 +123,11 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread);
HWND FASTCALL UserGetShellWindow(VOID);
HDC FASTCALL
UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Wnd);
BOOLEAN FASTCALL co_UserDestroyWindow(PWND Wnd);
PWINDOW_OBJECT FASTCALL UserGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
PWND FASTCALL UserGetAncestor(PWND Wnd, UINT Type);
/*************** MENU.C ***************/
@@ -148,6 +148,6 @@ BOOL FASTCALL UserDestroyMenu(HMENU hMenu);
/*************** SCROLLBAR.C ***************/
DWORD FASTCALL
co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow);
co_UserShowScrollBar(PWND Window, int wBar, DWORD bShow);
/* EOF */
@@ -13,10 +13,10 @@
#include <include/window.h>
HRGN FASTCALL
VIS_ComputeVisibleRegion(PWINDOW_OBJECT Window, BOOLEAN ClientArea,
VIS_ComputeVisibleRegion(PWND Window, BOOLEAN ClientArea,
BOOLEAN ClipChildren, BOOLEAN ClipSiblings);
VOID FASTCALL
co_VIS_WindowLayoutChanged(PWINDOW_OBJECT Window, HRGN UncoveredRgn);
co_VIS_WindowLayoutChanged(PWND Window, HRGN UncoveredRgn);
/* EOF */
@@ -17,44 +17,6 @@ extern ATOM AtomWndObj; /* WNDOBJ list */
BOOL FASTCALL UserUpdateUiState(PWND Wnd, WPARAM wParam);
typedef struct _WINDOW_OBJECT
{
THRDESKHEAD head;
PWND Wnd;
/* Pointer to the thread information */
PTHREADINFO pti; // Use Wnd->head.pti
/* system menu handle. */
HMENU SystemMenu;
/* Handle for the window. */
HWND hSelf; // Use Wnd->head.h
/* Window flags. */
ULONG state;
/* Handle of region of the window to be updated. */
HANDLE hrgnUpdate;
/* Handle of the window region. */
HANDLE hrgnClip;
struct _WINDOW_OBJECT* spwndChild;
struct _WINDOW_OBJECT* spwndNext;
struct _WINDOW_OBJECT* spwndPrev;
struct _WINDOW_OBJECT* spwndParent;
struct _WINDOW_OBJECT* spwndOwner;
/* Scrollbar info */
PSBINFOEX pSBInfo; // convert to PSBINFO
/* Entry in the list of thread windows. */
LIST_ENTRY ThreadListEntry;
} WINDOW_OBJECT; /* PWINDOW_OBJECT already declared at top of file */
/* Window flags. */
#define WINDOWOBJECT_NEED_SIZE WNDS_SENDSIZEMOVEMSGS
#define WINDOWOBJECT_NEED_ERASEBKGND WNDS_ERASEBACKGROUND
#define WINDOWOBJECT_NEED_NCPAINT WNDS_SENDNCPAINT
#define WINDOWOBJECT_RESTOREMAX (0x00000020) // Set/Clr WS_MAXIMIZE && Clr/Set WS_EX2_VERTICALLYMAXIMIZEDLEFT/RIGHT
#define WINDOWSTATUS_DESTROYING WNDS2_INDESTROY
#define WINDOWSTATUS_DESTROYED WNDS_DESTROYED
#define HAS_DLGFRAME(Style, ExStyle) \
(((ExStyle) & WS_EX_DLGMODALFRAME) || \
(((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
@@ -74,23 +36,19 @@ typedef struct _WINDOW_OBJECT
#define IntWndBelongsToThread(WndObj, W32Thread) \
(((WndObj->pti->pEThread && WndObj->pti->pEThread->Tcb.Win32Thread)) && \
(WndObj->pti->pEThread->Tcb.Win32Thread == W32Thread))
// ((WndObj->head.pti) && (WndObj->head.pti == W32Thread))
((WndObj->head.pti) && (WndObj->head.pti == W32Thread))
#define IntGetWndThreadId(WndObj) \
WndObj->pti->pEThread->Cid.UniqueThread
// WndObj->head.pti->pEThread->Cid.UniqueThread
WndObj->head.pti->pEThread->Cid.UniqueThread
#define IntGetWndProcessId(WndObj) \
WndObj->pti->pEThread->ThreadsProcess->UniqueProcessId
// WndObj->head.pti->pEThread->ThreadsProcess->UniqueProcessId
WndObj->head.pti->pEThread->ThreadsProcess->UniqueProcessId
BOOL FASTCALL
IntIsWindow(HWND hWnd);
HWND* FASTCALL
IntWinListChildren(PWINDOW_OBJECT Window);
IntWinListChildren(PWND Window);
NTSTATUS FASTCALL
InitWindowImpl (VOID);
@@ -99,52 +57,52 @@ NTSTATUS FASTCALL
CleanupWindowImpl (VOID);
VOID FASTCALL
IntGetClientRect (PWINDOW_OBJECT WindowObject, RECTL *Rect);
IntGetClientRect (PWND WindowObject, RECTL *Rect);
HWND FASTCALL
IntGetActiveWindow (VOID);
BOOL FASTCALL
IntIsWindowVisible (PWINDOW_OBJECT Window);
IntIsWindowVisible (PWND Window);
BOOL FASTCALL
IntIsChildWindow (PWINDOW_OBJECT Parent, PWINDOW_OBJECT Child);
IntIsChildWindow (PWND Parent, PWND Child);
VOID FASTCALL
IntUnlinkWindow(PWINDOW_OBJECT Wnd);
IntUnlinkWindow(PWND Wnd);
VOID FASTCALL
IntLinkWindow(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndPrevSibling);
IntLinkWindow(PWND Wnd, PWND WndPrevSibling);
VOID FASTCALL
IntLinkHwnd(PWINDOW_OBJECT Wnd, HWND hWndPrev);
IntLinkHwnd(PWND Wnd, HWND hWndPrev);
PWINDOW_OBJECT FASTCALL
IntGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
PWND FASTCALL
IntGetAncestor(PWND Wnd, UINT Type);
PWINDOW_OBJECT FASTCALL
IntGetParent(PWINDOW_OBJECT Wnd);
PWND FASTCALL
IntGetParent(PWND Wnd);
INT FASTCALL
IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn);
IntGetWindowRgn(PWND Window, HRGN hRgn);
INT FASTCALL
IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECTL *Rect);
IntGetWindowRgnBox(PWND Window, RECTL *Rect);
BOOL FASTCALL
IntGetWindowInfo(PWINDOW_OBJECT WindowObject, PWINDOWINFO pwi);
IntGetWindowInfo(PWND WindowObject, PWINDOWINFO pwi);
VOID FASTCALL
IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, UINT *cx, UINT *cy);
IntGetWindowBorderMeasures(PWND WindowObject, UINT *cx, UINT *cy);
BOOL FASTCALL
IntIsWindowInDestroy(PWINDOW_OBJECT Window);
IntIsWindowInDestroy(PWND Window);
BOOL FASTCALL
IntShowOwnedPopups( PWINDOW_OBJECT owner, BOOL fShow );
IntShowOwnedPopups( PWND owner, BOOL fShow );
LRESULT FASTCALL
IntDefWindowProc( PWINDOW_OBJECT Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi);
IntDefWindowProc( PWND Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi);
VOID FASTCALL IntNotifyWinEvent(DWORD, PWND, LONG, LONG);
@@ -1,36 +1,36 @@
#pragma once
#define IntPtInWindow(WndObject,x,y) \
((x) >= (WndObject)->Wnd->rcWindow.left && \
(x) < (WndObject)->Wnd->rcWindow.right && \
(y) >= (WndObject)->Wnd->rcWindow.top && \
(y) < (WndObject)->Wnd->rcWindow.bottom && \
(!(WndObject)->hrgnClip || ((WndObject)->Wnd->style & WS_MINIMIZE) || \
NtGdiPtInRegion((WndObject)->hrgnClip, (INT)((x) - (WndObject)->Wnd->rcWindow.left), \
(INT)((y) - (WndObject)->Wnd->rcWindow.top))))
((x) >= (WndObject)->rcWindow.left && \
(x) < (WndObject)->rcWindow.right && \
(y) >= (WndObject)->rcWindow.top && \
(y) < (WndObject)->rcWindow.bottom && \
(!(WndObject)->hrgnClip || ((WndObject)->style & WS_MINIMIZE) || \
NtGdiPtInRegion((WndObject)->hrgnClip, (INT)((x) - (WndObject)->rcWindow.left), \
(INT)((y) - (WndObject)->rcWindow.top))))
UINT
FASTCALL co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent);
FASTCALL co_WinPosArrangeIconicWindows(PWND parent);
BOOL FASTCALL
IntGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point);
IntGetClientOrigin(PWND Window, LPPOINT Point);
LRESULT FASTCALL
co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECTL* WindowRect, RECTL* ClientRect);
co_WinPosGetNonClientSize(PWND Window, RECTL* WindowRect, RECTL* ClientRect);
UINT FASTCALL
co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
co_WinPosGetMinMaxInfo(PWND Window, POINT* MaxSize, POINT* MaxPos,
POINT* MinTrack, POINT* MaxTrack);
UINT FASTCALL
co_WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECTL* NewPos);
co_WinPosMinMaximize(PWND WindowObject, UINT ShowFlag, RECTL* NewPos);
BOOLEAN FASTCALL
co_WinPosSetWindowPos(PWINDOW_OBJECT Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
co_WinPosSetWindowPos(PWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
INT cy, UINT flags);
BOOLEAN FASTCALL
co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd);
co_WinPosShowWindow(PWND Window, INT Cmd);
void FASTCALL
co_WinPosSendSizeMove(PWINDOW_OBJECT Window);
co_WinPosSendSizeMove(PWND Window);
USHORT FASTCALL
co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
PWINDOW_OBJECT* Window);
VOID FASTCALL co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window);
co_WinPosWindowFromPoint(PWND ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
PWND* Window);
VOID FASTCALL co_WinPosActivateOtherWindow(PWND Window);
VOID FASTCALL WinPosInitInternalPos(PWINDOW_OBJECT WindowObject,
VOID FASTCALL WinPosInitInternalPos(PWND WindowObject,
POINT *pt, RECTL *RestoreRect);
@@ -95,7 +95,7 @@ PACCELERATOR_TABLE FASTCALL UserGetAccelObject(HACCEL hAccel)
static
BOOLEAN FASTCALL
co_IntTranslateAccelerator(
PWINDOW_OBJECT Window,
PWND Window,
UINT message,
WPARAM wParam,
LPARAM lParam,
@@ -108,7 +108,7 @@ co_IntTranslateAccelerator(
ASSERT_REFS_CO(Window);
DPRINT("IntTranslateAccelerator(hwnd %x, message %x, wParam %x, lParam %x, fVirt %d, key %x, cmd %x)\n",
Window->hSelf, message, wParam, lParam, fVirt, key, cmd);
Window->head.h, message, wParam, lParam, fVirt, key, cmd);
if (wParam != key)
{
@@ -162,7 +162,7 @@ co_IntTranslateAccelerator(
}
DPRINT("IntTranslateAccelerator(hwnd %x, message %x, wParam %x, lParam %x, fVirt %d, key %x, cmd %x) = FALSE\n",
Window->hSelf, message, wParam, lParam, fVirt, key, cmd);
Window->head.h, message, wParam, lParam, fVirt, key, cmd);
return FALSE;
@@ -250,12 +250,12 @@ found:
if (mesg == WM_COMMAND)
{
DPRINT(", sending WM_COMMAND, wParam=%0x\n", 0x10000 | cmd);
co_IntSendMessage(Window->hSelf, mesg, 0x10000 | cmd, 0L);
co_IntSendMessage(Window->head.h, mesg, 0x10000 | cmd, 0L);
}
else if (mesg == WM_SYSCOMMAND)
{
DPRINT(", sending WM_SYSCOMMAND, wParam=%0x\n", cmd);
co_IntSendMessage(Window->hSelf, mesg, cmd, 0x00010000L);
co_IntSendMessage(Window->head.h, mesg, cmd, 0x00010000L);
}
else
{
@@ -276,7 +276,7 @@ found:
}
DPRINT("IntTranslateAccelerator(hWnd %x, message %x, wParam %x, lParam %x, fVirt %d, key %x, cmd %x) = TRUE\n",
Window->hSelf, message, wParam, lParam, fVirt, key, cmd);
Window->head.h, message, wParam, lParam, fVirt, key, cmd);
return TRUE;
}
@@ -458,7 +458,7 @@ NtUserTranslateAccelerator(
HACCEL hAccel,
LPMSG Message)
{
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
PACCELERATOR_TABLE Accel = NULL;
ULONG i;
USER_REFERENCE_ENTRY AccelRef, WindowRef;
@@ -93,26 +93,26 @@ IntCleanupThreadCallbacks(PTHREADINFO W32Thread)
// This will help user space programs speed up read access with the window object.
//
static VOID
IntSetTebWndCallback (HWND * hWnd, PVOID * pWnd)
IntSetTebWndCallback (HWND * hWnd, PWND * pWnd)
{
HWND hWndS = *hWnd;
PWINDOW_OBJECT Window = UserGetWindowObject(*hWnd);
PWND Window = UserGetWindowObject(*hWnd);
PCLIENTINFO ClientInfo = GetWin32ClientInfo();
*hWnd = ClientInfo->CallbackWnd.hWnd;
*pWnd = ClientInfo->CallbackWnd.pvWnd;
*pWnd = ClientInfo->CallbackWnd.pWnd;
ClientInfo->CallbackWnd.hWnd = hWndS;
ClientInfo->CallbackWnd.pvWnd = DesktopHeapAddressToUser(Window->Wnd);
ClientInfo->CallbackWnd.pWnd = DesktopHeapAddressToUser(Window);
}
static VOID
IntRestoreTebWndCallback (HWND hWnd, PVOID pWnd)
IntRestoreTebWndCallback (HWND hWnd, PWND pWnd)
{
PCLIENTINFO ClientInfo = GetWin32ClientInfo();
ClientInfo->CallbackWnd.hWnd = hWnd;
ClientInfo->CallbackWnd.pvWnd = pWnd;
ClientInfo->CallbackWnd.pWnd = pWnd;
}
/* FUNCTIONS *****************************************************************/
@@ -125,7 +125,8 @@ co_IntCallSentMessageCallback(SENDASYNCPROC CompletionCallback,
LRESULT Result)
{
SENDASYNCPROC_CALLBACK_ARGUMENTS Arguments;
PVOID ResultPointer, pWnd;
PVOID ResultPointer;
PWND pWnd;
ULONG ResultLength;
NTSTATUS Status;
@@ -168,7 +169,8 @@ co_IntCallWindowProc(WNDPROC Proc,
WINDOWPROC_CALLBACK_ARGUMENTS StackArguments;
PWINDOWPROC_CALLBACK_ARGUMENTS Arguments;
NTSTATUS Status;
PVOID ResultPointer, pWnd;
PVOID ResultPointer;
PWND pWnd;
ULONG ResultLength;
ULONG ArgumentLength;
LRESULT Result;
@@ -193,16 +193,14 @@ NtUserGetCPD(
GETCPD Flags,
ULONG_PTR ProcIn)
{
PWINDOW_OBJECT Window;
PWND Wnd;
ULONG_PTR Result = 0;
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
if (!(Wnd = UserGetWindowObject(hWnd)))
{
goto Cleanup;
}
Wnd = Window->Wnd;
// Processing Window only from User space.
if ((Flags & ~(UserGetCPDU2A|UserGetCPDA2U)) != UserGetCPDClass)
+10 -10
View File
@@ -239,14 +239,14 @@ co_IntDrawCaret(HWND hWnd)
BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT Window OPTIONAL)
BOOL FASTCALL co_UserHideCaret(PWND Window OPTIONAL)
{
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
if (Window) ASSERT_REFS_CO(Window);
if(Window && Window->pti->pEThread != PsGetCurrentThread())
if(Window && Window->head.pti->pEThread != PsGetCurrentThread())
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE;
@@ -255,7 +255,7 @@ BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT Window OPTIONAL)
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
if(Window && ThreadQueue->CaretInfo->hWnd != Window->hSelf)
if(Window && ThreadQueue->CaretInfo->hWnd != Window->head.h)
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE;
@@ -274,14 +274,14 @@ BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT Window OPTIONAL)
}
BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT Window OPTIONAL)
BOOL FASTCALL co_UserShowCaret(PWND Window OPTIONAL)
{
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
if (Window) ASSERT_REFS_CO(Window);
if(Window && Window->pti->pEThread != PsGetCurrentThread())
if(Window && Window->head.pti->pEThread != PsGetCurrentThread())
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE;
@@ -290,7 +290,7 @@ BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT Window OPTIONAL)
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
if(Window && ThreadQueue->CaretInfo->hWnd != Window->hSelf)
if(Window && ThreadQueue->CaretInfo->hWnd != Window->head.h)
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
return FALSE;
@@ -320,7 +320,7 @@ NtUserCreateCaret(
int nWidth,
int nHeight)
{
PWINDOW_OBJECT Window;
PWND Window;
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
DECLARE_RETURN(BOOL);
@@ -333,7 +333,7 @@ NtUserCreateCaret(
RETURN(FALSE);
}
if(Window->pti->pEThread != PsGetCurrentThread())
if(Window->head.pti->pEThread != PsGetCurrentThread())
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
RETURN(FALSE);
@@ -431,7 +431,7 @@ BOOL
APIENTRY
NtUserShowCaret(HWND hWnd OPTIONAL)
{
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(BOOL);
BOOL ret;
@@ -462,7 +462,7 @@ BOOL
APIENTRY
NtUserHideCaret(HWND hWnd OPTIONAL)
{
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(BOOL);
BOOL ret;
+12 -16
View File
@@ -2102,7 +2102,7 @@ NtUserSetClassLong(HWND hWnd,
BOOL Ansi)
{
PPROCESSINFO pi;
PWINDOW_OBJECT Window;
PWND Window;
ULONG_PTR Ret = 0;
UserEnterExclusive();
@@ -2112,7 +2112,7 @@ NtUserSetClassLong(HWND hWnd,
Window = UserGetWindowObject(hWnd);
if (Window != NULL)
{
if (Window->pti->ppi != pi)
if (Window->head.pti->ppi != pi)
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
goto Cleanup;
@@ -2154,7 +2154,7 @@ InvalidParameter:
dwNewLong = (ULONG_PTR)&Value;
}
Ret = UserSetClassLongPtr(Window->Wnd->pcls,
Ret = UserSetClassLongPtr(Window->pcls,
Offset,
dwNewLong,
Ansi);
@@ -2274,7 +2274,9 @@ NtUserGetClassInfo(
if (CapturedClassName.Length & 1)
{
goto InvalidParameter;
SetLastWin32Error(ERROR_INVALID_PARAMETER);
Ret = FALSE;
_SEH2_LEAVE;
}
if (CapturedClassName.Length != 0)
@@ -2297,7 +2299,9 @@ NtUserGetClassInfo(
if (!IS_ATOM(CapturedClassName.Buffer))
{
ERR("NtUserGetClassInfo() got ClassName instead of Atom!\n");
goto InvalidParameter;
SetLastWin32Error(ERROR_INVALID_PARAMETER);
Ret = FALSE;
_SEH2_LEAVE;
}
SafeClassName.Buffer = CapturedClassName.Buffer;
@@ -2305,21 +2309,13 @@ NtUserGetClassInfo(
SafeClassName.MaximumLength = 0;
}
if (ProbeForReadUint(&lpWndClassEx->cbSize) != sizeof(WNDCLASSEXW))
{
InvalidParameter:
SetLastWin32Error(ERROR_INVALID_PARAMETER);
Ret = FALSE;
_SEH2_LEAVE;
}
ProbeForWrite( lpWndClassEx, sizeof(WNDCLASSEXW), sizeof(ULONG));
RtlCopyMemory( &Safewcexw, lpWndClassEx, sizeof(WNDCLASSEXW));
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
SetLastWin32Error(ERROR_CLASS_DOES_NOT_EXIST);
SetLastNtError(_SEH2_GetExceptionCode());
Ret = FALSE;
}
_SEH2_END;
@@ -2383,7 +2379,7 @@ NtUserGetClassName (IN HWND hWnd,
OUT PUNICODE_STRING ClassName,
IN BOOL Ansi)
{
PWINDOW_OBJECT Window;
PWND Window;
UNICODE_STRING CapturedClassName;
INT Ret = 0;
@@ -2398,7 +2394,7 @@ NtUserGetClassName (IN HWND hWnd,
CapturedClassName = *ClassName;
/* get the class name */
Ret = UserGetClassName(Window->Wnd->pcls,
Ret = UserGetClassName(Window->pcls,
&CapturedClassName,
Ansi);
@@ -17,9 +17,9 @@
PTHREADINFO ClipboardThread;
PTHREADINFO ClipboardOwnerThread;
PWINDOW_OBJECT ClipboardWindow;
PWINDOW_OBJECT ClipboardViewerWindow;
PWINDOW_OBJECT ClipboardOwnerWindow;
PWND ClipboardWindow;
PWND ClipboardViewerWindow;
PWND ClipboardOwnerWindow;
BOOL sendDrawClipboardMsg;
BOOL recentlySetClipboard;
BOOL delayedRender;
@@ -38,7 +38,7 @@ DWORD synthesizedDataSize;
/* return the pointer to the prev window of the finded window,
if NULL does not exists in the chain */
PCLIPBOARDCHAINELEMENT FASTCALL
IntIsWindowInChain(PWINDOW_OBJECT window)
IntIsWindowInChain(PWND window)
{
PCLIPBOARDCHAINELEMENT wce = WindowsChain;
@@ -60,14 +60,14 @@ VOID FASTCALL printChain(VOID)
PCLIPBOARDCHAINELEMENT wce2 = WindowsChain;
while (wce2)
{
DPRINT1("chain: %p\n", wce2->window->hSelf);
DPRINT1("chain: %p\n", wce2->window->head.h);
wce2 = wce2->next;
}
}
/* the new window always have to be the first in the chain */
PCLIPBOARDCHAINELEMENT FASTCALL
IntAddWindowToChain(PWINDOW_OBJECT window)
IntAddWindowToChain(PWND window)
{
PCLIPBOARDCHAINELEMENT wce = NULL;
@@ -96,7 +96,7 @@ exit_addChain:
}
PCLIPBOARDCHAINELEMENT FASTCALL
IntRemoveWindowFromChain(PWINDOW_OBJECT window)
IntRemoveWindowFromChain(PWND window)
{
PCLIPBOARDCHAINELEMENT wce = WindowsChain;
PCLIPBOARDCHAINELEMENT *link = &WindowsChain;
@@ -345,7 +345,7 @@ intIsClipboardOpenByMe(VOID)
/* IntClipboardFreeWindow it's called when a window was destroyed */
VOID FASTCALL
IntClipboardFreeWindow(PWINDOW_OBJECT window)
IntClipboardFreeWindow(PWND window)
{
/* called from co_UserFreeWindow in window.c */
/* check if clipboard is not locked by this window, if yes, unlock it */
@@ -377,7 +377,7 @@ BOOL APIENTRY
NtUserOpenClipboard(HWND hWnd, DWORD Unknown1)
{
PWINDOW_OBJECT Window;
PWND Window;
BOOL ret = FALSE;
UserEnterExclusive();
@@ -392,7 +392,7 @@ NtUserOpenClipboard(HWND hWnd, DWORD Unknown1)
{
if (ClipboardOwnerWindow)
{
if (ClipboardOwnerWindow->hSelf == hWnd)
if (ClipboardOwnerWindow->head.h == hWnd)
{
ret = TRUE;
}
@@ -485,7 +485,7 @@ NtUserGetOpenClipboardWindow(VOID)
if (ClipboardWindow)
{
ret = ClipboardWindow->hSelf;
ret = ClipboardWindow->head.h;
}
UserLeave();
@@ -498,7 +498,7 @@ NtUserChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext)
{
BOOL ret = FALSE;
PCLIPBOARDCHAINELEMENT w = NULL;
PWINDOW_OBJECT removeWindow;
PWND removeWindow;
UserEnterExclusive();
removeWindow = UserGetWindowObject(hWndRemove);
@@ -521,9 +521,9 @@ NtUserChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext)
// then they do the chain
/* WindowsChain->window may be NULL */
LPARAM lparam = WindowsChain->window == NULL ? 0 : (LPARAM)WindowsChain->window->hSelf;
DPRINT1("Message: WM_CHANGECBCHAIN to %p", WindowsChain->window->hSelf);
co_IntSendMessage(WindowsChain->window->hSelf, WM_CHANGECBCHAIN, (WPARAM)hWndRemove, lparam);
LPARAM lparam = WindowsChain->window == NULL ? 0 : (LPARAM)WindowsChain->window->head.h;
DPRINT1("Message: WM_CHANGECBCHAIN to %p", WindowsChain->window->head.h);
co_IntSendMessage(WindowsChain->window->head.h, WM_CHANGECBCHAIN, (WPARAM)hWndRemove, lparam);
}
UserLeave();
@@ -572,8 +572,8 @@ NtUserEmptyClipboard(VOID)
if (ret && ClipboardOwnerWindow)
{
DPRINT("Clipboard: WM_DESTROYCLIPBOARD to %p", ClipboardOwnerWindow->hSelf);
co_IntSendMessage( ClipboardOwnerWindow->hSelf, WM_DESTROYCLIPBOARD, 0, 0);
DPRINT("Clipboard: WM_DESTROYCLIPBOARD to %p", ClipboardOwnerWindow->head.h);
co_IntSendMessage( ClipboardOwnerWindow->head.h, WM_DESTROYCLIPBOARD, 0, 0);
}
UserLeave();
@@ -603,8 +603,8 @@ NtUserGetClipboardData(UINT uFormat, PVOID pBuffer)
/* tell owner what data needs to be rendered */
if (ClipboardOwnerWindow)
{
ASSERT(ClipboardOwnerWindow->hSelf);
co_IntSendMessage(ClipboardOwnerWindow->hSelf, WM_RENDERFORMAT, (WPARAM)uFormat, 0);
ASSERT(ClipboardOwnerWindow->head.h);
co_IntSendMessage(ClipboardOwnerWindow->head.h, WM_RENDERFORMAT, (WPARAM)uFormat, 0);
data = intIsFormatAvailable(uFormat);
ASSERT(data->size);
ret = (HANDLE)(ULONG_PTR)data->size;
@@ -754,7 +754,7 @@ NtUserGetClipboardOwner(VOID)
if (ClipboardOwnerWindow)
{
ret = ClipboardOwnerWindow->hSelf;
ret = ClipboardOwnerWindow->head.h;
}
UserLeave();
@@ -771,7 +771,7 @@ NtUserGetClipboardViewer(VOID)
if (WindowsChain)
{
ret = WindowsChain->window->hSelf;
ret = WindowsChain->window->head.h;
}
UserLeave();
@@ -1037,7 +1037,7 @@ NtUserSetClipboardViewer(HWND hWndNewViewer)
{
HWND ret = NULL;
PCLIPBOARDCHAINELEMENT newWC = NULL;
PWINDOW_OBJECT window;
PWND window;
UserEnterExclusive();
@@ -1053,7 +1053,7 @@ NtUserSetClipboardViewer(HWND hWndNewViewer)
if (newWC->next)
{
// return the next HWND available window in the chain
ret = newWC->next->window->hSelf;
ret = newWC->next->window->head.h;
}
}
}
@@ -176,7 +176,7 @@ UserSetCursor(
BOOL UserSetCursorPos( INT x, INT y, BOOL SendMouseMoveMsg)
{
PWINDOW_OBJECT DesktopWindow;
PWND DesktopWindow;
PSYSTEM_CURSORINFO CurInfo;
HDC hDC;
MSG Msg;
@@ -197,7 +197,7 @@ BOOL UserSetCursorPos( INT x, INT y, BOOL SendMouseMoveMsg)
/* Clip cursor position */
if (!CurInfo->bClipped)
rcClip = DesktopWindow->Wnd->rcClient;
rcClip = DesktopWindow->rcClient;
else
rcClip = CurInfo->rcClip;
@@ -704,7 +704,7 @@ NtUserClipCursor(
/* FIXME - check if process has WINSTA_WRITEATTRIBUTES */
PSYSTEM_CURSORINFO CurInfo;
RECTL Rect;
PWINDOW_OBJECT DesktopWindow = NULL;
PWND DesktopWindow = NULL;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserClipCursor\n");
@@ -725,7 +725,7 @@ NtUserClipCursor(
{
CurInfo->bClipped = TRUE;
RECTL_bIntersectRect(&CurInfo->rcClip, &Rect, &DesktopWindow->Wnd->rcWindow);
RECTL_bIntersectRect(&CurInfo->rcClip, &Rect, &DesktopWindow->rcWindow);
UserSetCursorPos(gpsi->ptCursor.x, gpsi->ptCursor.y, FALSE);
RETURN(TRUE);
+16 -20
View File
@@ -27,7 +27,7 @@
static
LRESULT FASTCALL
IntClientShutdown(
PWINDOW_OBJECT pWindow,
PWND pWindow,
WPARAM wParam,
LPARAM lParam
)
@@ -49,14 +49,14 @@ IntClientShutdown(
{
for (i = 0; List[i]; i++)
{
PWINDOW_OBJECT WndChild;
PWND WndChild;
if (!(WndChild = UserGetWindowObject(List[i])) || !WndChild->Wnd)
if (!(WndChild = UserGetWindowObject(List[i])))
continue;
if (wParam & MCS_QUERYENDSESSION)
{
if (!co_IntSendMessage(WndChild->hSelf, WM_QUERYENDSESSION, 0, lParams))
if (!co_IntSendMessage(WndChild->head.h, WM_QUERYENDSESSION, 0, lParams))
{
lResult = MCSR_DONOTSHUTDOWN;
break;
@@ -64,10 +64,10 @@ IntClientShutdown(
}
else
{
co_IntSendMessage(WndChild->hSelf, WM_ENDSESSION, KillTimers, lParams);
co_IntSendMessage(WndChild->head.h, WM_ENDSESSION, KillTimers, lParams);
if (KillTimers)
{
DestroyTimersForWindow(WndChild->pti, WndChild);
DestroyTimersForWindow(WndChild->head.pti, WndChild);
}
lResult = MCSR_SHUTDOWNFINISHED;
}
@@ -80,17 +80,17 @@ IntClientShutdown(
*/
if (wParam & MCS_QUERYENDSESSION)
{
if (!co_IntSendMessage(pWindow->hSelf, WM_QUERYENDSESSION, 0, lParams))
if (!co_IntSendMessage(pWindow->head.h, WM_QUERYENDSESSION, 0, lParams))
{
lResult = MCSR_DONOTSHUTDOWN;
}
}
else
{
co_IntSendMessage(pWindow->hSelf, WM_ENDSESSION, KillTimers, lParams);
co_IntSendMessage(pWindow->head.h, WM_ENDSESSION, KillTimers, lParams);
if (KillTimers)
{
DestroyTimersForWindow(pWindow->pti, pWindow);
DestroyTimersForWindow(pWindow->head.pti, pWindow);
}
lResult = MCSR_SHUTDOWNFINISHED;
}
@@ -102,25 +102,21 @@ IntClientShutdown(
*/
LRESULT FASTCALL
IntDefWindowProc(
PWINDOW_OBJECT Window,
PWND Wnd,
UINT Msg,
WPARAM wParam,
LPARAM lParam,
BOOL Ansi)
{
PWND Wnd;
LRESULT lResult = 0;
if (Msg > WM_USER) return 0;
Wnd = Window->Wnd;
if (!Wnd) return 0;
switch (Msg)
{
case WM_SYSCOMMAND:
{
DPRINT1("hwnd %p WM_SYSCOMMAND %lx %lx\n", Window->hSelf, wParam, lParam );
DPRINT1("hwnd %p WM_SYSCOMMAND %lx %lx\n", Wnd->head.h, wParam, lParam );
if (!ISITHOOKED(WH_CBT)) break;
lResult = co_HOOK_CallHooks(WH_CBT, HCBT_SYSCOMMAND, wParam, lParam);
break;
@@ -129,7 +125,7 @@ IntDefWindowProc(
{
if ((Wnd->style & WS_VISIBLE) && wParam) break;
if (!(Wnd->style & WS_VISIBLE) && !wParam) break;
if (!Window->spwndOwner) break;
if (!Wnd->spwndOwner) break;
if (LOWORD(lParam))
{
if (wParam)
@@ -140,12 +136,12 @@ IntDefWindowProc(
else
Wnd->state |= WNDS_HIDDENPOPUP;
co_WinPosShowWindow(Window, wParam ? SW_SHOWNOACTIVATE : SW_HIDE);
co_WinPosShowWindow(Wnd, wParam ? SW_SHOWNOACTIVATE : SW_HIDE);
}
}
break;
case WM_CLIENTSHUTDOWN:
return IntClientShutdown(Window, wParam, lParam);
return IntClientShutdown(Wnd, wParam, lParam);
case WM_CBT:
{
@@ -176,8 +172,8 @@ IntDefWindowProc(
_SEH2_END;
}
if (!lResult)
lResult = co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)Window->hSelf, lParam ? (LPARAM)&rt : 0);
}
lResult = co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)Wnd->head.h, lParam ? (LPARAM)&rt : 0);
}
break;
}
break;
@@ -515,7 +515,7 @@ HWND FASTCALL IntGetDesktopWindow(VOID)
return pdo->DesktopWindow;
}
PWINDOW_OBJECT FASTCALL UserGetDesktopWindow(VOID)
PWND FASTCALL UserGetDesktopWindow(VOID)
{
PDESKTOP pdo = IntGetActiveDesktop();
@@ -593,7 +593,7 @@ BOOL FASTCALL IntDesktopUpdatePerUserSettings(BOOL bEnable)
HDC FASTCALL
UserGetDesktopDC(ULONG DcType, BOOL EmptyDC, BOOL ValidatehWnd)
{
PWINDOW_OBJECT DesktopObject = 0;
PWND DesktopObject = 0;
HDC DesktopHDC = 0;
if (DcType == DC_TYPE_DIRECT)
@@ -614,7 +614,7 @@ UserGetDesktopDC(ULONG DcType, BOOL EmptyDC, BOOL ValidatehWnd)
VOID APIENTRY
UserRedrawDesktop()
{
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
UserEnterExclusive();
@@ -656,15 +656,13 @@ IntHideDesktop(PDESKTOP Desktop)
return NotifyCsrss(&Request, &Reply);
#else
PWINDOW_OBJECT DesktopWindow;
PWND DesktopWnd;
DesktopWindow = IntGetWindowObject(Desktop->DesktopWindow);
if (! DesktopWindow)
DesktopWnd = IntGetWindowObject(Desktop->DesktopWindow);
if (! DesktopWnd)
{
return ERROR_INVALID_WINDOW_HANDLE;
}
DesktopWnd = DesktopWindow->Wnd;
DesktopWnd->style &= ~WS_VISIBLE;
return STATUS_SUCCESS;
@@ -1401,7 +1399,7 @@ NtUserPaintDesktop(HDC hDC)
HBRUSH DesktopBrush, PreviousBrush;
HWND hWndDesktop;
BOOL doPatBlt = TRUE;
PWINDOW_OBJECT WndDesktop;
PWND WndDesktop;
int len;
COLORREF color_old;
UINT align_old;
@@ -1423,7 +1421,7 @@ NtUserPaintDesktop(HDC hDC)
RETURN(FALSE);
}
DesktopBrush = (HBRUSH)WndDesktop->Wnd->pcls->hbrBackground;
DesktopBrush = (HBRUSH)WndDesktop->pcls->hbrBackground;
/*
@@ -1432,7 +1430,7 @@ NtUserPaintDesktop(HDC hDC)
if (WinSta->hbmWallpaper != NULL)
{
PWINDOW_OBJECT DeskWin;
PWND DeskWin;
DeskWin = UserGetWindowObject(hWndDesktop);
@@ -1442,8 +1440,8 @@ NtUserPaintDesktop(HDC hDC)
int x, y;
HDC hWallpaperDC;
sz.cx = DeskWin->Wnd->rcWindow.right - DeskWin->Wnd->rcWindow.left;
sz.cy = DeskWin->Wnd->rcWindow.bottom - DeskWin->Wnd->rcWindow.top;
sz.cx = DeskWin->rcWindow.right - DeskWin->rcWindow.left;
sz.cy = DeskWin->rcWindow.bottom - DeskWin->rcWindow.top;
if (WinSta->WallpaperMode == wmStretch ||
WinSta->WallpaperMode == wmTile)
@@ -241,7 +241,7 @@ NtUserNotifyWinEvent(
LONG idObject,
LONG idChild)
{
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
@@ -255,7 +255,7 @@ NtUserNotifyWinEvent(
if (gpsi->dwInstalledEventHooks & GetMaskFromEvent(Event))
{
UserRefObjectCo(Window, &Ref);
IntNotifyWinEvent( Event, Window->Wnd, idObject, idChild);
IntNotifyWinEvent( Event, Window, idObject, idChild);
UserDerefObjectCo(Window);
}
UserLeave();
+62 -71
View File
@@ -51,13 +51,13 @@ IntGetThreadFocusWindow(VOID)
VOID FASTCALL
co_IntSendDeactivateMessages(HWND hWndPrev, HWND hWnd)
{
PWINDOW_OBJECT WndPrev ;
PWND WndPrev ;
if (hWndPrev && (WndPrev = UserGetWindowObject(hWndPrev)))
{
co_IntSendMessageNoWait(hWndPrev, WM_NCACTIVATE, FALSE, 0);
co_IntSendMessageNoWait(hWndPrev, WM_ACTIVATE,
MAKEWPARAM(WA_INACTIVE, WndPrev->Wnd->style & WS_MINIMIZE),
MAKEWPARAM(WA_INACTIVE, WndPrev->style & WS_MINIMIZE),
(LPARAM)hWnd);
}
}
@@ -66,7 +66,7 @@ VOID FASTCALL
co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
{
USER_REFERENCE_ENTRY Ref, RefPrev;
PWINDOW_OBJECT Window, WindowPrev = NULL;
PWND Window, WindowPrev = NULL;
if ((Window = UserGetWindowObject(hWnd)))
{
@@ -94,26 +94,26 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
co_IntShellHookNotify(HSHELL_WINDOWACTIVATED, (LPARAM) hWnd);
}
if (Window->Wnd)
if (Window)
{ // Set last active for window and it's owner.
Window->Wnd->hWndLastActive = hWnd;
if (Window->Wnd->spwndOwner)
Window->Wnd->spwndOwner->hWndLastActive = hWnd;
Window->Wnd->state |= WNDS_ACTIVEFRAME;
Window->hWndLastActive = hWnd;
if (Window->spwndOwner)
Window->spwndOwner->hWndLastActive = hWnd;
Window->state |= WNDS_ACTIVEFRAME;
}
if (WindowPrev && WindowPrev->Wnd)
WindowPrev->Wnd->state &= ~WNDS_ACTIVEFRAME;
if (WindowPrev)
WindowPrev->state &= ~WNDS_ACTIVEFRAME;
if (Window && WindowPrev)
{
PWINDOW_OBJECT cWindow;
PWND cWindow;
HWND *List, *phWnd;
HANDLE OldTID = IntGetWndThreadId(WindowPrev);
HANDLE NewTID = IntGetWndThreadId(Window);
DPRINT("SendActiveMessage Old -> %x, New -> %x\n", OldTID, NewTID);
if (Window->Wnd->style & WS_MINIMIZE)
if (Window->style & WS_MINIMIZE)
{
DPRINT("Widow was minimized\n");
}
@@ -155,7 +155,7 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
/* FIXME: WA_CLICKACTIVE */
co_IntSendMessageNoWait(hWnd, WM_ACTIVATE,
MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE,
Window->Wnd->style & WS_MINIMIZE),
Window->style & WS_MINIMIZE),
(LPARAM)hWndPrev);
}
}
@@ -179,10 +179,10 @@ co_IntSendSetFocusMessages(HWND hWndPrev, HWND hWnd)
}
HWND FASTCALL
IntFindChildWindowToOwner(PWINDOW_OBJECT Root, PWINDOW_OBJECT Owner)
IntFindChildWindowToOwner(PWND Root, PWND Owner)
{
HWND Ret;
PWINDOW_OBJECT Child, OwnerWnd;
PWND Child, OwnerWnd;
for(Child = Root->spwndChild; Child; Child = Child->spwndNext)
{
@@ -192,7 +192,7 @@ IntFindChildWindowToOwner(PWINDOW_OBJECT Root, PWINDOW_OBJECT Owner)
if(OwnerWnd == Owner)
{
Ret = Child->hSelf;
Ret = Child->head.h;
return Ret;
}
}
@@ -201,21 +201,18 @@ IntFindChildWindowToOwner(PWINDOW_OBJECT Root, PWINDOW_OBJECT Owner)
}
static BOOL FASTCALL
co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWindow, BOOL MouseActivate)
co_IntSetForegroundAndFocusWindow(PWND Wnd, PWND FocusWindow, BOOL MouseActivate)
{
HWND hWnd = Window->hSelf;
HWND hWnd = Wnd->head.h;
HWND hWndPrev = NULL;
HWND hWndFocus = FocusWindow->hSelf;
HWND hWndFocus = FocusWindow->head.h;
HWND hWndFocusPrev = NULL;
PUSER_MESSAGE_QUEUE PrevForegroundQueue;
PWND Wnd;
ASSERT_REFS_CO(Window);
ASSERT_REFS_CO(Wnd);
DPRINT("IntSetForegroundAndFocusWindow(%x, %x, %s)\n", hWnd, hWndFocus, MouseActivate ? "TRUE" : "FALSE");
Wnd = Window->Wnd;
if ((Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{
DPRINT("Failed - Child\n");
@@ -223,7 +220,7 @@ co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWin
}
if (0 == (Wnd->style & WS_VISIBLE) &&
Window->pti->pEThread->ThreadsProcess != CsrProcess)
Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess)
{
DPRINT("Failed - Invisible\n");
return FALSE;
@@ -248,19 +245,19 @@ co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWin
co_IntSendKillFocusMessages(hWndFocusPrev, hWndFocus);
IntSetFocusMessageQueue(Window->pti->MessageQueue);
IntSetFocusMessageQueue(Wnd->head.pti->MessageQueue);
if (Window->pti->MessageQueue)
if (Wnd->head.pti->MessageQueue)
{
Window->pti->MessageQueue->ActiveWindow = hWnd;
Wnd->head.pti->MessageQueue->ActiveWindow = hWnd;
}
if (FocusWindow->pti->MessageQueue)
if (FocusWindow->head.pti->MessageQueue)
{
FocusWindow->pti->MessageQueue->FocusWindow = hWndFocus;
FocusWindow->head.pti->MessageQueue->FocusWindow = hWndFocus;
}
if (PrevForegroundQueue != Window->pti->MessageQueue)
if (PrevForegroundQueue != Wnd->head.pti->MessageQueue)
{
/* FIXME: Send WM_ACTIVATEAPP to all thread windows. */
}
@@ -272,7 +269,7 @@ co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWin
}
BOOL FASTCALL
co_IntSetForegroundWindow(PWINDOW_OBJECT Window)//FIXME: can Window be NULL??
co_IntSetForegroundWindow(PWND Window)//FIXME: can Window be NULL??
{
/*if (Window)*/ ASSERT_REFS_CO(Window);
@@ -280,24 +277,22 @@ co_IntSetForegroundWindow(PWINDOW_OBJECT Window)//FIXME: can Window be NULL??
}
BOOL FASTCALL
co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
co_IntMouseActivateWindow(PWND Wnd)
{
HWND Top;
PWINDOW_OBJECT TopWindow;
PWND TopWindow;
USER_REFERENCE_ENTRY Ref;
PWND Wnd;
ASSERT_REFS_CO(Window);
ASSERT_REFS_CO(Wnd);
Wnd = Window->Wnd;
if(Wnd->style & WS_DISABLED)
{
BOOL Ret;
PWINDOW_OBJECT TopWnd;
PWINDOW_OBJECT DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
PWND TopWnd;
PWND DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
if(DesktopWindow)
{
Top = IntFindChildWindowToOwner(DesktopWindow, Window);
Top = IntFindChildWindowToOwner(DesktopWindow, Wnd);
if((TopWnd = UserGetWindowObject(Top)))
{
UserRefObjectCo(TopWnd, &Ref);
@@ -311,13 +306,13 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
}
TopWindow = UserGetAncestor(Window, GA_ROOT);
TopWindow = UserGetAncestor(Wnd, GA_ROOT);
if (!TopWindow) return FALSE;
/* TMN: Check return valud from this function? */
UserRefObjectCo(TopWindow, &Ref);
co_IntSetForegroundAndFocusWindow(TopWindow, Window, TRUE);
co_IntSetForegroundAndFocusWindow(TopWindow, Wnd, TRUE);
UserDerefObjectCo(TopWindow);
@@ -325,32 +320,30 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
}
HWND FASTCALL
co_IntSetActiveWindow(PWINDOW_OBJECT Window OPTIONAL)
co_IntSetActiveWindow(PWND Wnd OPTIONAL)
{
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
HWND hWndPrev;
HWND hWnd = 0;
PWND Wnd;
CBTACTIVATESTRUCT cbt;
if (Window)
ASSERT_REFS_CO(Window);
if (Wnd)
ASSERT_REFS_CO(Wnd);
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
ASSERT(ThreadQueue != 0);
if (Window != 0)
if (Wnd != 0)
{
Wnd = Window->Wnd;
if ((!(Wnd->style & WS_VISIBLE) &&
Window->pti->pEThread->ThreadsProcess != CsrProcess) ||
Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess) ||
(Wnd->style & (WS_POPUP | WS_CHILD)) == WS_CHILD)
{
return ThreadQueue ? 0 : ThreadQueue->ActiveWindow;
}
hWnd = Window->hSelf;
hWnd = Wnd->head.h;
}
hWndPrev = ThreadQueue->ActiveWindow;
@@ -377,7 +370,7 @@ co_IntSetActiveWindow(PWINDOW_OBJECT Window OPTIONAL)
static
HWND FASTCALL
co_IntSetFocusWindow(PWINDOW_OBJECT Window OPTIONAL)
co_IntSetFocusWindow(PWND Window OPTIONAL)
{
HWND hWndPrev = 0;
PTHREADINFO pti;
@@ -394,18 +387,18 @@ co_IntSetFocusWindow(PWINDOW_OBJECT Window OPTIONAL)
if (Window != 0)
{
if (hWndPrev == Window->hSelf)
if (hWndPrev == Window->head.h)
{
return hWndPrev;
}
if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)Window->hSelf, (LPARAM)hWndPrev))
if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)Window->head.h, (LPARAM)hWndPrev))
return 0;
ThreadQueue->FocusWindow = Window->hSelf;
ThreadQueue->FocusWindow = Window->head.h;
co_IntSendKillFocusMessages(hWndPrev, Window->hSelf);
co_IntSendSetFocusMessages(hWndPrev, Window->hSelf);
co_IntSendKillFocusMessages(hWndPrev, Window->head.h);
co_IntSendSetFocusMessages(hWndPrev, Window->head.h);
}
else
{
@@ -475,7 +468,7 @@ NtUserSetActiveWindow(HWND hWnd)
if (hWnd)
{
PWINDOW_OBJECT Window;
PWND Window;
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
HWND hWndPrev;
@@ -488,7 +481,7 @@ NtUserSetActiveWindow(HWND hWnd)
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
if (Window->pti->MessageQueue != ThreadQueue)
if (Window->head.pti->MessageQueue != ThreadQueue)
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
RETURN( 0);
@@ -540,7 +533,7 @@ NtUserSetCapture(HWND hWnd)
{
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
PWINDOW_OBJECT Window;
PWND Window;
HWND hWndPrev;
DECLARE_RETURN(HWND);
@@ -552,7 +545,7 @@ NtUserSetCapture(HWND hWnd)
if((Window = UserGetWindowObject(hWnd)))
{
if(Window->pti->MessageQueue != ThreadQueue)
if(Window->head.pti->MessageQueue != ThreadQueue)
{
RETURN(NULL);
}
@@ -580,44 +573,42 @@ CLEANUP:
HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window OPTIONAL)
HWND FASTCALL co_UserSetFocus(PWND Wnd OPTIONAL)
{
if (Window)
if (Wnd)
{
PTHREADINFO pti;
PUSER_MESSAGE_QUEUE ThreadQueue;
HWND hWndPrev;
PWINDOW_OBJECT TopWnd;
PWND TopWnd;
USER_REFERENCE_ENTRY Ref;
PWND Wnd;
ASSERT_REFS_CO(Window);
ASSERT_REFS_CO(Wnd);
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
Wnd = Window->Wnd;
if (Wnd->style & (WS_MINIMIZE | WS_DISABLED))
{
return( (ThreadQueue ? ThreadQueue->FocusWindow : 0));
}
if (Window->pti->MessageQueue != ThreadQueue)
if (Wnd->head.pti->MessageQueue != ThreadQueue)
{
SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
return( 0);
}
TopWnd = UserGetAncestor(Window, GA_ROOT);
if (TopWnd && TopWnd->hSelf != UserGetActiveWindow())
TopWnd = UserGetAncestor(Wnd, GA_ROOT);
if (TopWnd && TopWnd->head.h != UserGetActiveWindow())
{
// PWINDOW_OBJECT WndTops = UserGetWindowObject(hWndTop);
// PWND WndTops = UserGetWindowObject(hWndTop);
UserRefObjectCo(TopWnd, &Ref);
co_IntSetActiveWindow(TopWnd);
UserDerefObjectCo(TopWnd);
}
hWndPrev = co_IntSetFocusWindow(Window);
hWndPrev = co_IntSetFocusWindow(Wnd);
return( hWndPrev);
}
@@ -635,7 +626,7 @@ HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window OPTIONAL)
HWND APIENTRY
NtUserSetFocus(HWND hWnd)
{
PWINDOW_OBJECT Window;
PWND Window;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(HWND);
HWND ret;
@@ -102,13 +102,13 @@ GetHotKey (UINT fsModifiers,
VOID FASTCALL
UnregisterWindowHotKeys(PWINDOW_OBJECT Window)
UnregisterWindowHotKeys(PWND Window)
{
PHOT_KEY_ITEM HotKeyItem, tmp;
LIST_FOR_EACH_SAFE(HotKeyItem, tmp, &gHotkeyList, HOT_KEY_ITEM, ListEntry)
{
if (HotKeyItem->hWnd == Window->hSelf)
if (HotKeyItem->hWnd == Window->head.h)
{
RemoveEntryList (&HotKeyItem->ListEntry);
ExFreePool (HotKeyItem);
@@ -164,7 +164,7 @@ NtUserRegisterHotKey(HWND hWnd,
UINT vk)
{
PHOT_KEY_ITEM HotKeyItem;
PWINDOW_OBJECT Window;
PWND Window;
PETHREAD HotKeyThread;
DECLARE_RETURN(BOOL);
@@ -181,7 +181,7 @@ NtUserRegisterHotKey(HWND hWnd,
{
RETURN( FALSE);
}
HotKeyThread = Window->pti->pEThread;
HotKeyThread = Window->head.pti->pEThread;
}
/* Check for existing hotkey */
@@ -217,7 +217,7 @@ BOOL APIENTRY
NtUserUnregisterHotKey(HWND hWnd, int id)
{
PHOT_KEY_ITEM HotKeyItem;
PWINDOW_OBJECT Window;
PWND Window;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserUnregisterHotKey\n");
@@ -453,7 +453,7 @@ IntKeyboardUpdateLeds(HANDLE KeyboardDeviceHandle,
static VOID APIENTRY
IntKeyboardSendWinKeyMsg()
{
PWINDOW_OBJECT Window;
PWND Window;
MSG Mesg;
if (!(Window = UserGetWindowObject(InputWindowStation->ShellWindow)))
@@ -468,7 +468,7 @@ IntKeyboardSendWinKeyMsg()
Mesg.lParam = 0;
/* The QS_HOTKEY is just a guess */
MsqPostMessage(Window->pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
MsqPostMessage(Window->head.pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
}
static VOID APIENTRY
+375 -371
View File
@@ -15,7 +15,7 @@
#include <debug.h>
PMENU_OBJECT FASTCALL
IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu);
IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu);
@@ -253,7 +253,7 @@ IntDestroyMenuObject(PMENU_OBJECT Menu,
{
if(Menu)
{
PWINDOW_OBJECT Window;
PWND Window;
PWINSTATION_OBJECT WindowStation;
NTSTATUS Status;
@@ -279,7 +279,7 @@ IntDestroyMenuObject(PMENU_OBJECT Menu,
Window = UserGetWindowObject(Menu->MenuInfo.Wnd);
if (Window)
{
Window->Wnd->IDMenu = 0;
Window->IDMenu = 0;
}
}
// UserDereferenceObject(Menu);
@@ -1079,7 +1079,7 @@ IntCheckMenuItem(PMENU_OBJECT MenuObject, UINT uIDCheckItem, UINT uCheck)
}
BOOL FASTCALL
IntHiliteMenuItem(PWINDOW_OBJECT WindowObject, PMENU_OBJECT MenuObject,
IntHiliteMenuItem(PWND WindowObject, PMENU_OBJECT MenuObject,
UINT uItemHilite, UINT uHilite)
{
PMENU_ITEM MenuItem;
@@ -1207,39 +1207,39 @@ IntGetMenuDefaultItem(PMENU_OBJECT MenuObject, UINT fByPos, UINT gmdiFlags,
}
VOID FASTCALL
co_IntInitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup,
co_IntInitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
UINT Flags)
{
/* FIXME - hide caret */
if(!(Flags & TPM_NONOTIFY))
co_IntSendMessage(Window->hSelf, WM_SETCURSOR, (WPARAM)Window->hSelf, HTCAPTION);
co_IntSendMessage(Window->head.h, WM_SETCURSOR, (WPARAM)Window->head.h, HTCAPTION);
/* FIXME - send WM_SETCURSOR message */
if(!(Flags & TPM_NONOTIFY))
co_IntSendMessage(Window->hSelf, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0);
co_IntSendMessage(Window->head.h, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0);
}
VOID FASTCALL
co_IntExitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup,
co_IntExitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
UINT Flags)
{
if(!(Flags & TPM_NONOTIFY))
co_IntSendMessage(Window->hSelf, WM_EXITMENULOOP, 0 /* FIXME */, 0);
co_IntSendMessage(Window->head.h, WM_EXITMENULOOP, 0 /* FIXME */, 0);
/* FIXME - Show caret again */
}
INT FASTCALL
IntTrackMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window, INT x, INT y,
IntTrackMenu(PMENU_OBJECT Menu, PWND Window, INT x, INT y,
RECTL lprect)
{
return 0;
}
BOOL FASTCALL
co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window,
co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWND Window,
UINT Flags, POINT *Pos, UINT MenuPos, RECTL *ExcludeRect)
{
co_IntInitTracking(Window, Menu, TRUE, Flags);
@@ -1295,7 +1295,7 @@ IntCleanupMenus(struct _EPROCESS *Process, PPROCESSINFO Win32Process)
}
BOOLEAN APIENTRY
intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
intGetTitleBarInfo(PWND pWindowObject, PTITLEBARINFO bti)
{
DWORD dwStyle = 0;
@@ -1308,13 +1308,13 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
bti->rgstate[0] = STATE_SYSTEM_FOCUSABLE;
dwStyle = pWindowObject->Wnd->style;
dwExStyle = pWindowObject->Wnd->ExStyle;
dwStyle = pWindowObject->style;
dwExStyle = pWindowObject->ExStyle;
bti->rcTitleBar.top = 0;
bti->rcTitleBar.left = 0;
bti->rcTitleBar.right = pWindowObject->Wnd->rcWindow.right - pWindowObject->Wnd->rcWindow.left;
bti->rcTitleBar.bottom = pWindowObject->Wnd->rcWindow.bottom - pWindowObject->Wnd->rcWindow.top;
bti->rcTitleBar.right = pWindowObject->rcWindow.right - pWindowObject->rcWindow.left;
bti->rcTitleBar.bottom = pWindowObject->rcWindow.bottom - pWindowObject->rcWindow.top;
/* is it iconiced ? */
if ((dwStyle & WS_ICONIC)!=WS_ICONIC)
@@ -1355,9 +1355,9 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
}
}
bti->rcTitleBar.top += pWindowObject->Wnd->rcWindow.top;
bti->rcTitleBar.left += pWindowObject->Wnd->rcWindow.left;
bti->rcTitleBar.right += pWindowObject->Wnd->rcWindow.left;
bti->rcTitleBar.top += pWindowObject->rcWindow.top;
bti->rcTitleBar.left += pWindowObject->rcWindow.left;
bti->rcTitleBar.right += pWindowObject->rcWindow.left;
bti->rcTitleBar.bottom = bti->rcTitleBar.top;
if (dwExStyle & WS_EX_TOOLWINDOW)
@@ -1398,7 +1398,7 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
{
bti->rgstate[4] = STATE_SYSTEM_INVISIBLE;
}
if (pWindowObject->Wnd->pcls->style & CS_NOCLOSE)
if (pWindowObject->pcls->style & CS_NOCLOSE)
{
bti->rgstate[5] = STATE_SYSTEM_UNAVAILABLE;
}
@@ -1425,50 +1425,49 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
return retValue;
}
/* FUNCTIONS *****************************************************************/
/*
* @implemented
*/
DWORD
APIENTRY
NtUserBuildMenuItemList(
HMENU hMenu,
VOID* Buffer,
ULONG nBufSize,
DWORD Reserved)
DWORD FASTCALL
UserInsertMenuItem(
PMENU_OBJECT Menu,
UINT uItem,
BOOL fByPosition,
LPCMENUITEMINFOW UnsafeItemInfo)
{
DWORD res = -1;
PMENU_OBJECT Menu;
DECLARE_RETURN(DWORD);
NTSTATUS Status;
ROSMENUITEMINFO ItemInfo;
DPRINT("Enter NtUserBuildMenuItemList\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
/* Try to copy the whole MENUITEMINFOW structure */
Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, sizeof(MENUITEMINFOW));
if (NT_SUCCESS(Status))
{
RETURN( (DWORD)-1);
if (sizeof(MENUITEMINFOW) != ItemInfo.cbSize
&& FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
return IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo);
}
if(Buffer)
/* Try to copy without last field (not present in older versions) */
Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, FIELD_OFFSET(MENUITEMINFOW, hbmpItem));
if (NT_SUCCESS(Status))
{
res = IntBuildMenuItemList(Menu, Buffer, nBufSize);
}
else
{
res = Menu->MenuInfo.MenuItemCount;
if (FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
ItemInfo.hbmpItem = (HBITMAP)0;
return IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo);
}
RETURN( res);
CLEANUP:
DPRINT("Leave NtUserBuildMenuItemList, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
SetLastNtError(Status);
return FALSE;
}
/* FUNCTIONS *****************************************************************/
/*
* @implemented
*/
@@ -1497,7 +1496,6 @@ CLEANUP:
END_CLEANUP;
}
HMENU FASTCALL UserCreateMenu(BOOL PopupMenu)
{
PWINSTATION_OBJECT WinStaObject;
@@ -1537,7 +1535,6 @@ HMENU FASTCALL UserCreateMenu(BOOL PopupMenu)
return (HMENU)Handle;
}
/*
* @implemented
*/
@@ -1574,7 +1571,7 @@ NtUserGetTitleBarInfo(
HWND hwnd,
PTITLEBARINFO bti)
{
PWINDOW_OBJECT WindowObject;
PWND WindowObject;
TITLEBARINFO bartitleinfo;
DECLARE_RETURN(BOOLEAN);
BOOLEAN retValue = TRUE;
@@ -1633,8 +1630,6 @@ CLEANUP:
END_CLEANUP;
}
/*
* @implemented
*/
@@ -1688,7 +1683,6 @@ CLEANUP:
END_CLEANUP;
}
/*
* @implemented
*/
@@ -1717,66 +1711,6 @@ CLEANUP:
END_CLEANUP;
}
/*
* @implemented
*/
DWORD APIENTRY
UserInsertMenuItem(
HMENU hMenu,
UINT uItem,
BOOL fByPosition,
LPCMENUITEMINFOW UnsafeItemInfo)
{
PMENU_OBJECT Menu;
NTSTATUS Status;
ROSMENUITEMINFO ItemInfo;
DECLARE_RETURN(DWORD);
DPRINT("Enter UserInsertMenuItem\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN( FALSE);
}
/* Try to copy the whole MENUITEMINFOW structure */
Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, sizeof(MENUITEMINFOW));
if (NT_SUCCESS(Status))
{
if (sizeof(MENUITEMINFOW) != ItemInfo.cbSize
&& FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
RETURN( FALSE);
}
RETURN( IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo));
}
/* Try to copy without last field (not present in older versions) */
Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, FIELD_OFFSET(MENUITEMINFOW, hbmpItem));
if (NT_SUCCESS(Status))
{
if (FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
{
SetLastWin32Error(ERROR_INVALID_PARAMETER);
RETURN( FALSE);
}
ItemInfo.hbmpItem = (HBITMAP)0;
RETURN( IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo));
}
SetLastNtError(Status);
RETURN( FALSE);
CLEANUP:
DPRINT("Leave UserInsertMenuItem, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @unimplemented
*/
@@ -1788,37 +1722,6 @@ NtUserEndMenu(VOID)
return 0;
}
/*
* @implemented
*/
UINT APIENTRY
NtUserGetMenuDefaultItem(
HMENU hMenu,
UINT fByPos,
UINT gmdiFlags)
{
PMENU_OBJECT Menu;
DWORD gismc = 0;
DECLARE_RETURN(UINT);
DPRINT("Enter NtUserGetMenuDefaultItem\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN(-1);
}
RETURN( IntGetMenuDefaultItem(Menu, fByPos, gmdiFlags, &gismc));
CLEANUP:
DPRINT("Leave NtUserGetMenuDefaultItem, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
@@ -1832,7 +1735,7 @@ NtUserGetMenuBarInfo(
BOOL Res = TRUE;
PMENU_OBJECT MenuObject;
PMENU_ITEM mi;
PWINDOW_OBJECT WindowObject;
PWND WindowObject;
HMENU hMenu;
POINT Offset;
RECTL Rect;
@@ -1848,7 +1751,7 @@ NtUserGetMenuBarInfo(
RETURN(FALSE);
}
hMenu = (HMENU)(DWORD_PTR)WindowObject->Wnd->IDMenu;
hMenu = (HMENU)(DWORD_PTR)WindowObject->IDMenu;
if (!(MenuObject = UserGetMenuObject(hMenu)))
{
@@ -1934,7 +1837,7 @@ NtUserGetMenuBarInfo(
}
else
{
PWINDOW_OBJECT SubWinObj;
PWND SubWinObj;
if (!(SubWinObj = UserGetWindowObject(SubMenuObject->MenuInfo.Wnd)))
{
Res = FALSE;
@@ -1984,7 +1887,7 @@ NtUserGetMenuBarInfo(
}
else
{
PWINDOW_OBJECT SysWinObj;
PWND SysWinObj;
if (!(SysWinObj = UserGetWindowObject(SysMenuObject->MenuInfo.Wnd)))
{
Res = FALSE;
@@ -2080,7 +1983,7 @@ NtUserGetMenuItemRect(
PRECTL lprcItem)
{
ROSMENUINFO mi;
PWINDOW_OBJECT ReferenceWnd;
PWND ReferenceWnd;
LONG XMove, YMove;
RECTL Rect;
NTSTATUS Status;
@@ -2115,13 +2018,13 @@ NtUserGetMenuItemRect(
if(MenuItem->fType & MF_POPUP)
{
XMove = ReferenceWnd->Wnd->rcClient.left;
YMove = ReferenceWnd->Wnd->rcClient.top;
XMove = ReferenceWnd->rcClient.left;
YMove = ReferenceWnd->rcClient.top;
}
else
{
XMove = ReferenceWnd->Wnd->rcWindow.left;
YMove = ReferenceWnd->Wnd->rcWindow.top;
XMove = ReferenceWnd->rcWindow.left;
YMove = ReferenceWnd->rcWindow.top;
}
Rect.left += XMove;
@@ -2143,7 +2046,6 @@ CLEANUP:
END_CLEANUP;
}
/*
* @implemented
*/
@@ -2155,7 +2057,7 @@ NtUserHiliteMenuItem(
UINT uHilite)
{
PMENU_OBJECT Menu;
PWINDOW_OBJECT Window;
PWND Window;
DECLARE_RETURN(BOOLEAN);
DPRINT("Enter NtUserHiliteMenuItem\n");
@@ -2171,7 +2073,7 @@ NtUserHiliteMenuItem(
RETURN(FALSE);
}
if(Window->Wnd->IDMenu == (UINT)(UINT_PTR)hMenu)
if(Window->IDMenu == (UINT)(UINT_PTR)hMenu)
{
RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite));
}
@@ -2184,7 +2086,6 @@ CLEANUP:
END_CLEANUP;
}
static
BOOL FASTCALL
UserMenuInfo(
@@ -2238,37 +2139,6 @@ UserMenuInfo(
return( Res);
}
/*
* @implemented
*/
BOOL
APIENTRY
NtUserMenuInfo(
HMENU hMenu,
PROSMENUINFO UnsafeMenuInfo,
BOOL SetOrGet)
{
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserMenuInfo\n");
UserEnterShared();
if (!(Menu = UserGetMenuObject(hMenu)))
{
RETURN(FALSE);
}
RETURN(UserMenuInfo(Menu, UnsafeMenuInfo, SetOrGet));
CLEANUP:
DPRINT("Leave NtUserMenuInfo, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
@@ -2280,7 +2150,7 @@ NtUserMenuItemFromPoint(
DWORD Y)
{
PMENU_OBJECT Menu;
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
PMENU_ITEM mi;
int i;
DECLARE_RETURN(int);
@@ -2298,8 +2168,8 @@ NtUserMenuItemFromPoint(
RETURN( -1);
}
X -= Window->Wnd->rcWindow.left;
Y -= Window->Wnd->rcWindow.top;
X -= Window->rcWindow.left;
Y -= Window->rcWindow.top;
mi = Menu->MenuItemList;
for (i = 0; NULL != mi; i++)
@@ -2319,8 +2189,6 @@ CLEANUP:
END_CLEANUP;
}
static
BOOL FASTCALL
UserMenuItemInfo(
@@ -2393,7 +2261,315 @@ UserMenuItemInfo(
return( Ret);
}
/*
* @implemented
*/
BOOL APIENTRY
NtUserRemoveMenu(
HMENU hMenu,
UINT uPosition,
UINT uFlags)
{
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserRemoveMenu\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN( FALSE);
}
RETURN(IntRemoveMenuItem(Menu, uPosition, uFlags, FALSE));
CLEANUP:
DPRINT("Leave NtUserRemoveMenu, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
BOOL APIENTRY
NtUserSetMenuContextHelpId(
HMENU hMenu,
DWORD dwContextHelpId)
{
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserSetMenuContextHelpId\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN( FALSE);
}
RETURN(IntSetMenuContextHelpId(Menu, dwContextHelpId));
CLEANUP:
DPRINT("Leave NtUserSetMenuContextHelpId, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
BOOL APIENTRY
NtUserSetMenuDefaultItem(
HMENU hMenu,
UINT uItem,
UINT fByPos)
{
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserSetMenuDefaultItem\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN( FALSE);
}
RETURN( UserSetMenuDefaultItem(Menu, uItem, fByPos));
CLEANUP:
DPRINT("Leave NtUserSetMenuDefaultItem, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
BOOL APIENTRY
NtUserSetMenuFlagRtoL(
HMENU hMenu)
{
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserSetMenuFlagRtoL\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN( FALSE);
}
RETURN(IntSetMenuFlagRtoL(Menu));
CLEANUP:
DPRINT("Leave NtUserSetMenuFlagRtoL, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
BOOL APIENTRY
NtUserThunkedMenuInfo(
HMENU hMenu,
LPCMENUINFO lpcmi)
{
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserThunkedMenuInfo\n");
UserEnterExclusive();
if (!(Menu = UserGetMenuObject(hMenu)))
{
RETURN(FALSE);
}
RETURN(UserMenuInfo(Menu, (PROSMENUINFO)lpcmi, TRUE));
CLEANUP:
DPRINT("Leave NtUserThunkedMenuInfo, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
BOOL APIENTRY
NtUserThunkedMenuItemInfo(
HMENU hMenu,
UINT uItem,
BOOL fByPosition,
BOOL bInsert,
LPMENUITEMINFOW lpmii,
PUNICODE_STRING lpszCaption)
{
PMENU_OBJECT Menu;
NTSTATUS Status;
UNICODE_STRING lstrCaption;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserThunkedMenuItemInfo\n");
UserEnterExclusive();
/* lpszCaption may be NULL, check for it and call RtlInitUnicodeString()
if bInsert == TRUE call UserInsertMenuItem() else UserSetMenuItemInfo() */
if (!(Menu = UserGetMenuObject(hMenu)))
{
RETURN(FALSE);
}
lstrCaption.Buffer = NULL;
/* Check if we got a Caption */
if (lpszCaption)
{
/* Copy the string to kernel mode */
Status = ProbeAndCaptureUnicodeString( &lstrCaption,
UserMode,
lpszCaption);
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to capture MenuItem Caption (status 0x%08x)\n",Status);
SetLastNtError(Status);
RETURN(FALSE);
}
}
if (bInsert) RETURN( UserInsertMenuItem(Menu, uItem, fByPosition, lpmii));
RETURN( UserMenuItemInfo(Menu, uItem, fByPosition, (PROSMENUITEMINFO)lpmii, TRUE));
CLEANUP:
DPRINT("Leave NtUserThunkedMenuItemInfo, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
/* NOTE: unused function */
BOOL APIENTRY
NtUserTrackPopupMenuEx(
HMENU hMenu,
UINT fuFlags,
int x,
int y,
HWND hWnd,
LPTPMPARAMS lptpm)
{
UNIMPLEMENTED
return FALSE;
}
////// ReactOS NtUserBad
/*
* @implemented
*/
DWORD
APIENTRY
NtUserBuildMenuItemList(
HMENU hMenu,
VOID* Buffer,
ULONG nBufSize,
DWORD Reserved)
{
DWORD res = -1;
PMENU_OBJECT Menu;
DECLARE_RETURN(DWORD);
DPRINT("Enter NtUserBuildMenuItemList\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN( (DWORD)-1);
}
if(Buffer)
{
res = IntBuildMenuItemList(Menu, Buffer, nBufSize);
}
else
{
res = Menu->MenuInfo.MenuItemCount;
}
RETURN( res);
CLEANUP:
DPRINT("Leave NtUserBuildMenuItemList, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
UINT APIENTRY
NtUserGetMenuDefaultItem(
HMENU hMenu,
UINT fByPos,
UINT gmdiFlags)
{
PMENU_OBJECT Menu;
DWORD gismc = 0;
DECLARE_RETURN(UINT);
DPRINT("Enter NtUserGetMenuDefaultItem\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN(-1);
}
RETURN( IntGetMenuDefaultItem(Menu, fByPos, gmdiFlags, &gismc));
CLEANUP:
DPRINT("Leave NtUserGetMenuDefaultItem, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
BOOL
APIENTRY
NtUserMenuInfo(
HMENU hMenu,
PROSMENUINFO UnsafeMenuInfo,
BOOL SetOrGet)
{
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserMenuInfo\n");
UserEnterShared();
if (!(Menu = UserGetMenuObject(hMenu)))
{
RETURN(FALSE);
}
RETURN(UserMenuInfo(Menu, UnsafeMenuInfo, SetOrGet));
CLEANUP:
DPRINT("Leave NtUserMenuInfo, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
@@ -2427,176 +2603,4 @@ CLEANUP:
}
/*
* @implemented
*/
BOOL APIENTRY
NtUserRemoveMenu(
HMENU hMenu,
UINT uPosition,
UINT uFlags)
{
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserRemoveMenu\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN( FALSE);
}
RETURN(IntRemoveMenuItem(Menu, uPosition, uFlags, FALSE));
CLEANUP:
DPRINT("Leave NtUserRemoveMenu, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
BOOL APIENTRY
NtUserSetMenuContextHelpId(
HMENU hMenu,
DWORD dwContextHelpId)
{
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserSetMenuContextHelpId\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN( FALSE);
}
RETURN(IntSetMenuContextHelpId(Menu, dwContextHelpId));
CLEANUP:
DPRINT("Leave NtUserSetMenuContextHelpId, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
BOOL APIENTRY
NtUserSetMenuDefaultItem(
HMENU hMenu,
UINT uItem,
UINT fByPos)
{
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserSetMenuDefaultItem\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN( FALSE);
}
RETURN( UserSetMenuDefaultItem(Menu, uItem, fByPos));
CLEANUP:
DPRINT("Leave NtUserSetMenuDefaultItem, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @implemented
*/
BOOL APIENTRY
NtUserSetMenuFlagRtoL(
HMENU hMenu)
{
PMENU_OBJECT Menu;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserSetMenuFlagRtoL\n");
UserEnterExclusive();
if(!(Menu = UserGetMenuObject(hMenu)))
{
RETURN( FALSE);
}
RETURN(IntSetMenuFlagRtoL(Menu));
CLEANUP:
DPRINT("Leave NtUserSetMenuFlagRtoL, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
/*
* @unimplemented
*/
DWORD APIENTRY
NtUserThunkedMenuInfo(
HMENU hMenu,
LPCMENUINFO lpcmi)
{
UNIMPLEMENTED
/* This function seems just to call SetMenuInfo() */
return 0;
}
/*
* @unimplemented
*/
DWORD APIENTRY
NtUserThunkedMenuItemInfo(
HMENU hMenu,
UINT uItem,
BOOL fByPosition,
BOOL bInsert,
LPMENUITEMINFOW lpmii,
PUNICODE_STRING lpszCaption)
{
/* lpszCaption may be NULL, check for it and call RtlInitUnicodeString()
if bInsert == TRUE call NtUserInsertMenuItem() else NtUserSetMenuItemInfo() */
if (bInsert) return UserInsertMenuItem(hMenu, uItem, fByPosition, lpmii);
UNIMPLEMENTED
return 0;
}
/*
* @implemented
*/
/* NOTE: unused function */
BOOL APIENTRY
NtUserTrackPopupMenuEx(
HMENU hMenu,
UINT fuFlags,
int x,
int y,
HWND hWnd,
LPTPMPARAMS lptpm)
{
UNIMPLEMENTED
return FALSE;
}
/* EOF */
@@ -327,14 +327,14 @@ static
VOID
FASTCALL
IntCallWndProc
( PWINDOW_OBJECT Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
BOOL SameThread = FALSE;
if (Window->pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
if (Window->head.pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
SameThread = TRUE;
if ((!SameThread && (Window->pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROC))) ||
if ((!SameThread && (Window->head.pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROC))) ||
(SameThread && ISITHOOKED(WH_CALLWNDPROC)) )
{
CWPSTRUCT CWP;
@@ -350,14 +350,14 @@ static
VOID
FASTCALL
IntCallWndProcRet
( PWINDOW_OBJECT Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *uResult)
( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *uResult)
{
BOOL SameThread = FALSE;
if (Window->pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
if (Window->head.pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
SameThread = TRUE;
if ((!SameThread && (Window->pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROCRET))) ||
if ((!SameThread && (Window->head.pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROCRET))) ||
(SameThread && ISITHOOKED(WH_CALLWNDPROCRET)) )
{
CWPRETSTRUCT CWPR;
@@ -380,12 +380,12 @@ IntDispatchMessage(PMSG pMsg)
PMSGMEMORY MsgMemoryEntry;
INT lParamBufferSize;
LPARAM lParamPacked;
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
if (pMsg->hwnd)
{
Window = UserGetWindowObject(pMsg->hwnd);
if (!Window || !Window->Wnd) return 0;
if (!Window) return 0;
}
if (((pMsg->message == WM_SYSTIMER) ||
@@ -421,7 +421,7 @@ IntDispatchMessage(PMSG pMsg)
}
}
// Need a window!
if ( !Window || !Window->Wnd ) return 0;
if ( !Window ) return 0;
/* See if this message type is present in the table */
MsgMemoryEntry = FindMsgMemory(pMsg->message);
@@ -440,8 +440,8 @@ IntDispatchMessage(PMSG pMsg)
return 0;
}
retval = co_IntCallWindowProc( Window->Wnd->lpfnWndProc,
!Window->Wnd->Unicode,
retval = co_IntCallWindowProc( Window->lpfnWndProc,
!Window->Unicode,
pMsg->hwnd,
pMsg->message,
pMsg->wParam,
@@ -522,11 +522,11 @@ BOOL FASTCALL
co_IntActivateWindowMouse(
PUSER_MESSAGE_QUEUE ThreadQueue,
LPMSG Msg,
PWINDOW_OBJECT MsgWindow,
PWND MsgWindow,
USHORT *HitTest)
{
ULONG Result;
PWINDOW_OBJECT Parent;
PWND Parent;
ASSERT_REFS_CO(MsgWindow);
@@ -539,9 +539,9 @@ co_IntActivateWindowMouse(
Parent = IntGetParent(MsgWindow);//fixme: deref retval?
/* If no parent window, pass MsgWindows HWND as wParam. Fixes bug #3111 */
Result = co_IntSendMessage(MsgWindow->hSelf,
Result = co_IntSendMessage(MsgWindow->head.h,
WM_MOUSEACTIVATE,
(WPARAM) (Parent ? Parent->hSelf : MsgWindow->hSelf),
(WPARAM) (Parent ? Parent->head.h : MsgWindow->head.h),
(LPARAM)MAKELONG(*HitTest, Msg->message)
);
@@ -570,7 +570,7 @@ co_IntTranslateMouseMessage(
USHORT *HitTest,
BOOL Remove)
{
PWINDOW_OBJECT Window;
PWND Window;
USER_REFERENCE_ENTRY Ref, DesktopRef;
if(!(Window = UserGetWindowObject(Msg->hwnd)))
@@ -583,38 +583,38 @@ co_IntTranslateMouseMessage(
UserRefObjectCo(Window, &Ref);
if ( ThreadQueue == Window->pti->MessageQueue &&
ThreadQueue->CaptureWindow != Window->hSelf)
if ( ThreadQueue == Window->head.pti->MessageQueue &&
ThreadQueue->CaptureWindow != Window->head.h)
{
/* only send WM_NCHITTEST messages if we're not capturing the window! */
if (Remove )
{
*HitTest = co_IntSendMessage(Window->hSelf, WM_NCHITTEST, 0,
*HitTest = co_IntSendMessage(Window->head.h, WM_NCHITTEST, 0,
MAKELONG(Msg->pt.x, Msg->pt.y));
}
/* else we are going to see this message again, but then with Remove == TRUE */
if (*HitTest == (USHORT)HTTRANSPARENT)
{
PWINDOW_OBJECT DesktopWindow;
PWND DesktopWindow;
HWND hDesktop = IntGetDesktopWindow();
if ((DesktopWindow = UserGetWindowObject(hDesktop)))
{
PWINDOW_OBJECT Wnd;
PWND Wnd;
UserRefObjectCo(DesktopWindow, &DesktopRef);
co_WinPosWindowFromPoint(DesktopWindow, Window->pti->MessageQueue, &Msg->pt, &Wnd);
co_WinPosWindowFromPoint(DesktopWindow, Window->head.pti->MessageQueue, &Msg->pt, &Wnd);
if (Wnd)
{
if (Wnd != Window)
{
/* post the message to the other window */
Msg->hwnd = Wnd->hSelf;
if(!(Wnd->state & WINDOWSTATUS_DESTROYING))
Msg->hwnd = Wnd->head.h;
if(!(Wnd->state & WNDS_DESTROYED))
{
MsqPostMessage(Wnd->pti->MessageQueue, Msg, FALSE,
MsqPostMessage(Wnd->head.pti->MessageQueue, Msg, FALSE,
Msg->message == WM_MOUSEMOVE ? QS_MOUSEMOVE :
QS_MOUSEBUTTON);
}
@@ -648,7 +648,7 @@ co_IntTranslateMouseMessage(
{
/* generate double click messages, if necessary */
if ((((*HitTest) != HTCLIENT) ||
(Window->Wnd->pcls->style & CS_DBLCLKS)) &&
(Window->pcls->style & CS_DBLCLKS)) &&
MsqIsDblClk(Msg, Remove))
{
Msg->message += WM_LBUTTONDBLCLK - WM_LBUTTONDOWN;
@@ -665,7 +665,7 @@ co_IntTranslateMouseMessage(
(((*HitTest) == HTCAPTION) || ((*HitTest) == HTSYSMENU)) )
{
Msg->message = WM_CONTEXTMENU;
Msg->wParam = (WPARAM)Window->hSelf;
Msg->wParam = (WPARAM)Window->head.h;
}
else
{
@@ -678,8 +678,8 @@ co_IntTranslateMouseMessage(
{
/* NOTE: Msg->pt should remain in screen coordinates. -- FiN */
Msg->lParam = MAKELONG(
Msg->pt.x - (WORD)Window->Wnd->rcClient.left,
Msg->pt.y - (WORD)Window->Wnd->rcClient.top);
Msg->pt.x - (WORD)Window->rcClient.left,
Msg->pt.y - (WORD)Window->rcClient.top);
}
}
@@ -760,7 +760,7 @@ BOOL ProcessKeyboardMessage(MSG* Msg, UINT RemoveMsg)
*/
BOOL FASTCALL
co_IntPeekMessage( PUSER_MESSAGE Msg,
PWINDOW_OBJECT Window,
PWND Window,
UINT MsgFilterMin,
UINT MsgFilterMax,
UINT RemoveMsg )
@@ -893,7 +893,7 @@ MessageFound:
if(RemoveMessages)
{
PWINDOW_OBJECT MsgWindow = NULL;
PWND MsgWindow = NULL;
/* Mouse message process */
@@ -1088,7 +1088,7 @@ CopyMsgToUserMem(MSG *UserModeMsg, MSG *KernelModeMsg)
}
static BOOL FASTCALL
co_IntWaitMessage( PWINDOW_OBJECT Window,
co_IntWaitMessage( PWND Window,
UINT MsgFilterMin,
UINT MsgFilterMax )
{
@@ -1137,7 +1137,7 @@ co_IntGetPeekMessage( PMSG pMsg,
BOOL bGMSG )
{
BOOL Present;
PWINDOW_OBJECT Window;
PWND Window;
USER_MESSAGE Msg;
if ( hWnd == HWND_TOPMOST ||
@@ -1157,7 +1157,7 @@ co_IntGetPeekMessage( PMSG pMsg,
}
else
{
Window = (PWINDOW_OBJECT)hWnd;
Window = (PWND)hWnd;
}
if (MsgFilterMax < MsgFilterMin)
@@ -1281,7 +1281,7 @@ UserPostMessage( HWND Wnd,
if (Wnd == HWND_BROADCAST)
{
HWND *List;
PWINDOW_OBJECT DesktopWindow;
PWND DesktopWindow;
ULONG i;
DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
@@ -1296,22 +1296,22 @@ UserPostMessage( HWND Wnd,
}
else
{
PWINDOW_OBJECT Window;
PWND Window;
Window = UserGetWindowObject(Wnd);
if ( !Window || !Window->Wnd )
if ( !Window )
{
return FALSE;
}
pti = Window->Wnd->head.pti;
pti = Window->head.pti;
if ( pti->TIF_flags & TIF_INCLEANUP )
{
DPRINT1("Attempted to post message to window 0x%x when the thread is in cleanup!\n", Wnd);
return FALSE;
}
if ( Window->state & WINDOWSTATUS_DESTROYING )
if ( Window->state & WNDS_DESTROYED )
{
DPRINT1("Attempted to post message to window 0x%x that is being destroyed!\n", Wnd);
/* FIXME - last error code? */
@@ -1320,7 +1320,7 @@ UserPostMessage( HWND Wnd,
if (WM_QUIT == Msg)
{
MsqPostQuitMessage(Window->pti->MessageQueue, wParam);
MsqPostQuitMessage(Window->head.pti->MessageQueue, wParam);
}
else
{
@@ -1331,7 +1331,7 @@ UserPostMessage( HWND Wnd,
Message.pt = gpsi->ptCursor;
KeQueryTickCount(&LargeTickCount);
pti->timeLast = Message.time = MsqCalculateMessageTime(&LargeTickCount);
MsqPostMessage(Window->pti->MessageQueue, &Message, FALSE, QS_POSTMESSAGE);
MsqPostMessage(Window->head.pti->MessageQueue, &Message, FALSE, QS_POSTMESSAGE);
}
}
return TRUE;
@@ -1364,7 +1364,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
{
ULONG_PTR Result;
NTSTATUS Status;
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
PMSGMEMORY MsgMemoryEntry;
INT lParamBufferSize;
LPARAM lParamPacked;
@@ -1384,7 +1384,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
IntCallWndProc( Window, hWnd, Msg, wParam, lParam);
if ( NULL != Win32Thread &&
Window->pti->MessageQueue == Win32Thread->MessageQueue)
Window->head.pti->MessageQueue == Win32Thread->MessageQueue)
{
if (Win32Thread->TIF_flags & TIF_INCLEANUP)
{
@@ -1409,8 +1409,8 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
RETURN( FALSE);
}
Result = (ULONG_PTR)co_IntCallWindowProc( Window->Wnd->lpfnWndProc,
!Window->Wnd->Unicode,
Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc,
!Window->Unicode,
hWnd,
Msg,
wParam,
@@ -1432,13 +1432,13 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
RETURN( TRUE);
}
if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->pti->MessageQueue))
if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->head.pti->MessageQueue))
{
/* FIXME - Set a LastError? */
RETURN( FALSE);
}
if (Window->state & WINDOWSTATUS_DESTROYING)
if (Window->state & WNDS_DESTROYED)
{
/* FIXME - last error? */
DPRINT1("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
@@ -1447,7 +1447,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
do
{
Status = co_MsqSendMessage( Window->pti->MessageQueue,
Status = co_MsqSendMessage( Window->head.pti->MessageQueue,
hWnd,
Msg,
wParam,
@@ -1459,7 +1459,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
}
while ((STATUS_TIMEOUT == Status) &&
(uFlags & SMTO_NOTIMEOUTIFNOTHUNG) &&
!MsqIsHung(Window->pti->MessageQueue));
!MsqIsHung(Window->head.pti->MessageQueue));
IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
@@ -1498,7 +1498,7 @@ co_IntSendMessageTimeout( HWND hWnd,
UINT uTimeout,
ULONG_PTR *uResult )
{
PWINDOW_OBJECT DesktopWindow;
PWND DesktopWindow;
HWND *Children;
HWND *Child;
@@ -1556,7 +1556,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
ULONG_PTR *uResult)
{
ULONG_PTR Result;
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
PMSGMEMORY MsgMemoryEntry;
INT lParamBufferSize;
LPARAM lParamPacked;
@@ -1572,7 +1572,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
UserRefObjectCo(Window, &Ref);
if (Window->state & WINDOWSTATUS_DESTROYING)
if (Window->state & WNDS_DESTROYED)
{
/* FIXME - last error? */
DPRINT1("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
@@ -1606,18 +1606,18 @@ co_IntSendMessageWithCallBack( HWND hWnd,
lParamBufferSize = MsgMemorySize(MsgMemoryEntry, wParam, lParam);
}
if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, Window->pti->MessageQueue != Win32Thread->MessageQueue)))
if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, Window->head.pti->MessageQueue != Win32Thread->MessageQueue)))
{
DPRINT1("Failed to pack message parameters\n");
RETURN( FALSE);
}
/* If this is not a callback and it can be sent now, then send it. */
if ((Window->pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
if ((Window->head.pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
{
Result = (ULONG_PTR)co_IntCallWindowProc( Window->Wnd->lpfnWndProc,
!Window->Wnd->Unicode,
Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc,
!Window->Unicode,
hWnd,
Msg,
wParam,
@@ -1631,7 +1631,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
if ((Window->pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
if ((Window->head.pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
{
if (! NT_SUCCESS(UnpackParam(lParamPacked, Msg, wParam, lParam, FALSE)))
{
@@ -1654,14 +1654,14 @@ co_IntSendMessageWithCallBack( HWND hWnd,
Message->Result = 0;
Message->SenderQueue = NULL; //Win32Thread->MessageQueue;
IntReferenceMessageQueue(Window->pti->MessageQueue);
IntReferenceMessageQueue(Window->head.pti->MessageQueue);
Message->CompletionCallback = CompletionCallback;
Message->CompletionCallbackContext = CompletionCallbackContext;
Message->HookMessage = MSQ_NORMAL | MSQ_SENTNOWAIT;
Message->HasPackedLParam = (lParamBufferSize > 0);
InsertTailList(&Window->pti->MessageQueue->SentMessagesListHead, &Message->ListEntry);
IntDereferenceMessageQueue(Window->pti->MessageQueue);
InsertTailList(&Window->head.pti->MessageQueue->SentMessagesListHead, &Message->ListEntry);
IntDereferenceMessageQueue(Window->head.pti->MessageQueue);
RETURN(TRUE);
@@ -1681,7 +1681,7 @@ co_IntPostOrSendMessage( HWND hWnd,
{
ULONG_PTR Result;
PTHREADINFO pti;
PWINDOW_OBJECT Window;
PWND Window;
if ( hWnd == HWND_BROADCAST )
{
@@ -1695,7 +1695,7 @@ co_IntPostOrSendMessage( HWND hWnd,
pti = PsGetCurrentThreadWin32Thread();
if ( Window->pti->MessageQueue != pti->MessageQueue &&
if ( Window->head.pti->MessageQueue != pti->MessageQueue &&
FindMsgMemory(Msg) == 0 )
{
Result = UserPostMessage(hWnd, Msg, wParam, lParam);
@@ -1722,7 +1722,7 @@ co_IntDoSendMessage( HWND hWnd,
PTHREADINFO pti;
LRESULT Result = TRUE;
NTSTATUS Status;
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
NTUSERSENDMESSAGEINFO Info;
MSG UserModeMsg;
MSG KernelModeMsg;
@@ -1734,7 +1734,7 @@ co_IntDoSendMessage( HWND hWnd,
if (HWND_BROADCAST != hWnd)
{
Window = UserGetWindowObject(hWnd);
if ( !Window || !Window->Wnd )
if ( !Window )
{
/* Tell usermode to not touch this one */
Info.HandledByKernel = TRUE;
@@ -1744,7 +1744,7 @@ co_IntDoSendMessage( HWND hWnd,
}
/* Check for an exiting window. */
if (Window && Window->state & WINDOWSTATUS_DESTROYING)
if (Window && Window->state & WNDS_DESTROYED)
{
DPRINT1("co_IntDoSendMessage Window Exiting!\n");
}
@@ -1755,7 +1755,7 @@ co_IntDoSendMessage( HWND hWnd,
// This is checked in user mode!!!!!!!
if ( HWND_BROADCAST != hWnd &&
NULL != pti &&
Window->pti->MessageQueue == pti->MessageQueue &&
Window->head.pti->MessageQueue == pti->MessageQueue &&
!ISITHOOKED(WH_CALLWNDPROC) &&
!ISITHOOKED(WH_CALLWNDPROCRET) &&
( Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST ) )
@@ -1767,11 +1767,11 @@ co_IntDoSendMessage( HWND hWnd,
sizeof(BOOL));
if (! NT_SUCCESS(Status))
{
Info.Ansi = ! Window->Wnd->Unicode;
Info.Ansi = ! Window->Unicode;
}
Info.Ansi = !Window->Wnd->Unicode;
Info.Proc = Window->Wnd->lpfnWndProc;
Info.Ansi = !Window->Unicode;
Info.Proc = Window->lpfnWndProc;
}
else
{
@@ -1850,7 +1850,7 @@ UserSendNotifyMessage( HWND hWnd,
if (hWnd == HWND_BROADCAST) //Handle Broadcast
{
HWND *List;
PWINDOW_OBJECT DesktopWindow;
PWND DesktopWindow;
ULONG i;
DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
@@ -1869,13 +1869,13 @@ UserSendNotifyMessage( HWND hWnd,
{
ULONG_PTR PResult;
PTHREADINFO pti;
PWINDOW_OBJECT Window;
PWND Window;
if ( !(Window = UserGetWindowObject(hWnd)) ) return FALSE;
pti = PsGetCurrentThreadWin32Thread();
if (Window->pti->MessageQueue != pti->MessageQueue)
if (Window->head.pti->MessageQueue != pti->MessageQueue)
{ // Send message w/o waiting for it.
Result = UserPostMessage(hWnd, Msg, wParam, lParam);
}
@@ -2096,7 +2096,7 @@ NtUserGetMessage( PNTUSERGETMESSAGEINFO UnsafeInfo,
NTUSERGETMESSAGEINFO Info;
NTSTATUS Status;
/* FIXME: if initialization is removed, gcc complains that this may be used before initialization. Please review */
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
PMSGMEMORY MsgMemoryEntry;
PVOID UserMem;
UINT Size;
@@ -2247,7 +2247,7 @@ NtUserPeekMessage(PNTUSERGETMESSAGEINFO UnsafeInfo,
NTSTATUS Status;
BOOL Present;
NTUSERGETMESSAGEINFO Info;
PWINDOW_OBJECT Window;
PWND Window;
PMSGMEMORY MsgMemoryEntry;
PVOID UserMem;
UINT Size;
@@ -2270,7 +2270,7 @@ NtUserPeekMessage(PNTUSERGETMESSAGEINFO UnsafeInfo,
}
else
{
Window = (PWINDOW_OBJECT)hWnd;
Window = (PWND)hWnd;
}
if (MsgFilterMax < MsgFilterMin)
@@ -2521,7 +2521,7 @@ NtUserMessageCall(
LRESULT lResult = 0;
BOOL Ret = FALSE;
BOOL BadChk = FALSE;
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
@@ -885,7 +885,7 @@ NtUserMonitorFromWindow(
IN HWND hWnd,
IN DWORD dwFlags)
{
PWINDOW_OBJECT Window;
PWND Window;
HMONITOR hMonitor = NULL;
RECTL Rect;
DECLARE_RETURN(HMONITOR);
@@ -903,11 +903,8 @@ NtUserMonitorFromWindow(
RETURN(hMonitor);
}
if (!Window->Wnd)
RETURN(hMonitor);
Rect.left = Rect.right = Window->Wnd->rcWindow.left;
Rect.top = Rect.bottom = Window->Wnd->rcWindow.bottom;
Rect.left = Rect.right = Window->rcWindow.left;
Rect.top = Rect.bottom = Window->rcWindow.bottom;
IntGetMonitorsFromRect(&Rect, &hMonitor, NULL, 1, dwFlags);
@@ -69,16 +69,16 @@ static VOID FASTCALL
IdlePing(VOID)
{
HWND hWnd;
PWINDOW_OBJECT Window;
PWND Window;
PPROCESSINFO W32d = PsGetCurrentProcessWin32Process();
hWnd = UserGetForegroundWindow();
Window = UserGetWindowObject(hWnd);
if (Window && Window->pti)
if (Window && Window->head.pti)
{
if (Window->pti->fsHooks & HOOKID_TO_FLAG(WH_FOREGROUNDIDLE))
if (Window->head.pti->fsHooks & HOOKID_TO_FLAG(WH_FOREGROUNDIDLE))
{
co_HOOK_CallHooks(WH_FOREGROUNDIDLE,HC_ACTION,0,0);
}
@@ -342,12 +342,12 @@ MsqIsDblClk(LPMSG Msg, BOOL Remove)
}
static BOOL APIENTRY
co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Window, UINT FilterLow, UINT FilterHigh,
co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWND Window, UINT FilterLow, UINT FilterHigh,
PUSER_MESSAGE Message, BOOL Remove, PBOOL Freed,
PWINDOW_OBJECT ScopeWin, PPOINT ScreenPoint, BOOL FromGlobalQueue, PLIST_ENTRY *Next)
PWND ScopeWin, PPOINT ScreenPoint, BOOL FromGlobalQueue, PLIST_ENTRY *Next)
{
USHORT Msg = Message->Msg.message;
PWINDOW_OBJECT CaptureWindow = NULL;
PWND CaptureWindow = NULL;
HWND hCaptureWin;
/* FIXME: Mouse message can be sent before the Desktop is up and running in which case ScopeWin (Desktop) is 0.
@@ -411,7 +411,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
return(FALSE);
}
if (CaptureWindow->pti->MessageQueue != MessageQueue)
if (CaptureWindow->head.pti->MessageQueue != MessageQueue)
{
if (! FromGlobalQueue)
{
@@ -434,34 +434,34 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
/* lock the destination message queue, so we don't get in trouble with other
threads, messing with it at the same time */
IntLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
InsertTailList(&CaptureWindow->pti->MessageQueue->HardwareMessagesListHead,
IntLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
InsertTailList(&CaptureWindow->head.pti->MessageQueue->HardwareMessagesListHead,
&Message->ListEntry);
if(Message->Msg.message == WM_MOUSEMOVE)
{
if(CaptureWindow->pti->MessageQueue->MouseMoveMsg)
if(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg)
{
/* remove the old WM_MOUSEMOVE message, we're processing a more recent
one */
RemoveEntryList(&CaptureWindow->pti->MessageQueue->MouseMoveMsg->ListEntry);
ExFreePool(CaptureWindow->pti->MessageQueue->MouseMoveMsg);
RemoveEntryList(&CaptureWindow->head.pti->MessageQueue->MouseMoveMsg->ListEntry);
ExFreePool(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg);
}
/* save the pointer to the WM_MOUSEMOVE message in the new queue */
CaptureWindow->pti->MessageQueue->MouseMoveMsg = Message;
CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = Message;
CaptureWindow->pti->MessageQueue->QueueBits |= QS_MOUSEMOVE;
CaptureWindow->pti->MessageQueue->ChangedBits |= QS_MOUSEMOVE;
if (CaptureWindow->pti->MessageQueue->WakeMask & QS_MOUSEMOVE)
KeSetEvent(CaptureWindow->pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
CaptureWindow->head.pti->MessageQueue->QueueBits |= QS_MOUSEMOVE;
CaptureWindow->head.pti->MessageQueue->ChangedBits |= QS_MOUSEMOVE;
if (CaptureWindow->head.pti->MessageQueue->WakeMask & QS_MOUSEMOVE)
KeSetEvent(CaptureWindow->head.pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
}
else
{
CaptureWindow->pti->MessageQueue->QueueBits |= QS_MOUSEBUTTON;
CaptureWindow->pti->MessageQueue->ChangedBits |= QS_MOUSEBUTTON;
if (CaptureWindow->pti->MessageQueue->WakeMask & QS_MOUSEBUTTON)
KeSetEvent(CaptureWindow->pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
CaptureWindow->head.pti->MessageQueue->QueueBits |= QS_MOUSEBUTTON;
CaptureWindow->head.pti->MessageQueue->ChangedBits |= QS_MOUSEBUTTON;
if (CaptureWindow->head.pti->MessageQueue->WakeMask & QS_MOUSEBUTTON)
KeSetEvent(CaptureWindow->head.pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
}
IntUnLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
IntUnLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
*Freed = FALSE;
UserDereferenceObject(CaptureWindow);
@@ -472,7 +472,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
*ScreenPoint = Message->Msg.pt;
if((Window != NULL && PtrToInt(Window) != 1 && CaptureWindow->hSelf != Window->hSelf) ||
if((Window != NULL && PtrToInt(Window) != 1 && CaptureWindow->head.h != Window->head.h) ||
((FilterLow != 0 || FilterHigh != 0) && (Msg < FilterLow || Msg > FilterHigh)))
{
/* Reject the message because it doesn't match the filter */
@@ -482,21 +482,21 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
/* Lock the message queue so no other thread can mess with it.
Our own message queue is not locked while fetching from the global
queue, so we have to make sure nothing interferes! */
IntLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
IntLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
/* if we're from the global queue, we need to add our message to our
private queue so we don't loose it! */
InsertTailList(&CaptureWindow->pti->MessageQueue->HardwareMessagesListHead,
InsertTailList(&CaptureWindow->head.pti->MessageQueue->HardwareMessagesListHead,
&Message->ListEntry);
}
if (Message->Msg.message == WM_MOUSEMOVE)
{
if(CaptureWindow->pti->MessageQueue->MouseMoveMsg &&
(CaptureWindow->pti->MessageQueue->MouseMoveMsg != Message))
if(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg &&
(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg != Message))
{
/* delete the old message */
RemoveEntryList(&CaptureWindow->pti->MessageQueue->MouseMoveMsg->ListEntry);
ExFreePool(CaptureWindow->pti->MessageQueue->MouseMoveMsg);
RemoveEntryList(&CaptureWindow->head.pti->MessageQueue->MouseMoveMsg->ListEntry);
ExFreePool(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg);
if (!FromGlobalQueue)
{
// We might have deleted the next one in our queue, so fix next
@@ -505,11 +505,11 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
}
/* always save a pointer to this WM_MOUSEMOVE message here because we're
sure that the message is in the private queue */
CaptureWindow->pti->MessageQueue->MouseMoveMsg = Message;
CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = Message;
}
if(FromGlobalQueue)
{
IntUnLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
IntUnLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
}
UserDereferenceObject(CaptureWindow);
@@ -518,7 +518,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
}
/* FIXME - only assign if removing? */
Message->Msg.hwnd = CaptureWindow->hSelf;
Message->Msg.hwnd = CaptureWindow->head.h;
Message->Msg.message = Msg;
Message->Msg.lParam = MAKELONG(Message->Msg.pt.x, Message->Msg.pt.y);
@@ -532,22 +532,22 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
/* Lock the message queue so no other thread can mess with it.
Our own message queue is not locked while fetching from the global
queue, so we have to make sure nothing interferes! */
IntLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
if(CaptureWindow->pti->MessageQueue->MouseMoveMsg)
IntLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
if(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg)
{
/* delete the WM_(NC)MOUSEMOVE message in the private queue, we're dealing
with one that's been sent later */
RemoveEntryList(&CaptureWindow->pti->MessageQueue->MouseMoveMsg->ListEntry);
ExFreePool(CaptureWindow->pti->MessageQueue->MouseMoveMsg);
RemoveEntryList(&CaptureWindow->head.pti->MessageQueue->MouseMoveMsg->ListEntry);
ExFreePool(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg);
/* our message is not in the private queue so we can remove the pointer
instead of setting it to the current message we're processing */
CaptureWindow->pti->MessageQueue->MouseMoveMsg = NULL;
CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = NULL;
}
IntUnLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
IntUnLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
}
else if (CaptureWindow->pti->MessageQueue->MouseMoveMsg == Message)
else if (CaptureWindow->head.pti->MessageQueue->MouseMoveMsg == Message)
{
CaptureWindow->pti->MessageQueue->MouseMoveMsg = NULL;
CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = NULL;
}
}
@@ -557,7 +557,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
}
BOOL APIENTRY
co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Window,
co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWND Window,
UINT FilterLow, UINT FilterHigh, BOOL Remove,
PUSER_MESSAGE* Message)
{
@@ -565,7 +565,7 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Windo
POINT ScreenPoint;
BOOL Accept, Freed;
PLIST_ENTRY CurrentEntry;
PWINDOW_OBJECT DesktopWindow = NULL;
PWND DesktopWindow = NULL;
PVOID WaitObjects[2];
NTSTATUS WaitStatus;
DECLARE_RETURN(BOOL);
@@ -592,7 +592,7 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Windo
if (DesktopWindow)
{
UserRefObjectCo(DesktopWindow, &Ref);//can DesktopWindow be NULL?
Desk = DesktopWindow->pti->pDeskInfo;
Desk = DesktopWindow->head.pti->pDeskInfo;
}
/* Process messages in the message queue itself. */
@@ -822,7 +822,7 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
VOID FASTCALL
MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam)
{
PWINDOW_OBJECT Window;
PWND Window;
PTHREADINFO Win32Thread;
MSG Mesg;
LARGE_INTEGER LargeTickCount;
@@ -856,7 +856,7 @@ MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam)
KeQueryTickCount(&LargeTickCount);
Mesg.time = MsqCalculateMessageTime(&LargeTickCount);
Mesg.pt = gpsi->ptCursor;
MsqPostMessage(Window->pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
MsqPostMessage(Window->head.pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
UserDereferenceObject(Window);
ObDereferenceObject (Thread);
@@ -1023,11 +1023,11 @@ MsqRemoveWindowMessagesFromQueue(PVOID pWindow)
PUSER_MESSAGE PostedMessage;
PUSER_MESSAGE_QUEUE MessageQueue;
PLIST_ENTRY CurrentEntry, ListHead;
PWINDOW_OBJECT Window = pWindow;
PWND Window = pWindow;
ASSERT(Window);
MessageQueue = Window->pti->MessageQueue;
MessageQueue = Window->head.pti->MessageQueue;
ASSERT(MessageQueue);
/* remove the posted messages for this window */
@@ -1037,7 +1037,7 @@ MsqRemoveWindowMessagesFromQueue(PVOID pWindow)
{
PostedMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE,
ListEntry);
if (PostedMessage->Msg.hwnd == Window->hSelf)
if (PostedMessage->Msg.hwnd == Window->head.h)
{
RemoveEntryList(&PostedMessage->ListEntry);
MsqDestroyMessage(PostedMessage);
@@ -1056,7 +1056,7 @@ MsqRemoveWindowMessagesFromQueue(PVOID pWindow)
{
SentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE,
ListEntry);
if(SentMessage->Msg.hwnd == Window->hSelf)
if(SentMessage->Msg.hwnd == Window->head.h)
{
DPRINT("Notify the sender and remove a message from the queue that had not been dispatched\n");
@@ -1334,7 +1334,7 @@ BOOLEAN APIENTRY
co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
IN BOOLEAN Hardware,
IN BOOLEAN Remove,
IN PWINDOW_OBJECT Window,
IN PWND Window,
IN UINT MsgFilterLow,
IN UINT MsgFilterHigh,
OUT PUSER_MESSAGE* Message)
@@ -1361,7 +1361,7 @@ co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
ListEntry);
if ( ( !Window ||
PtrToInt(Window) == 1 ||
Window->hSelf == CurrentMessage->Msg.hwnd ) &&
Window->head.h == CurrentMessage->Msg.hwnd ) &&
( (MsgFilterLow == 0 && MsgFilterHigh == 0) ||
( MsgFilterLow <= CurrentMessage->Msg.message &&
MsgFilterHigh >= CurrentMessage->Msg.message ) ) )
@@ -1381,7 +1381,7 @@ co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
}
NTSTATUS FASTCALL
co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT WndFilter,
co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter,
UINT MsgFilterMin, UINT MsgFilterMax)
{
PVOID WaitObjects[2] = {MessageQueue->NewMessages, &HardwareMessageEvent};
@@ -328,7 +328,7 @@ UserCreateObject( PUSER_HANDLE_TABLE ht,
switch (type)
{
// case otWindow:
case otWindow:
// case otMenu:
// case otHook:
// case otCallProc:
@@ -418,7 +418,7 @@ UserDereferenceObject(PVOID object)
switch (type)
{
// case otWindow:
case otWindow:
// case otMenu:
// case otHook:
// case otCallProc:
+148 -179
View File
@@ -36,15 +36,13 @@
*/
BOOL FASTCALL
IntIntersectWithParents(PWINDOW_OBJECT Child, RECTL *WindowRect)
IntIntersectWithParents(PWND Child, RECTL *WindowRect)
{
PWINDOW_OBJECT ParentWindow;
PWND ParentWnd;
ParentWindow = Child->spwndParent;
while (ParentWindow != NULL)
ParentWnd = Child->spwndParent;
while (ParentWnd != NULL)
{
ParentWnd = ParentWindow->Wnd;
if (!(ParentWnd->style & WS_VISIBLE) ||
(ParentWnd->style & WS_MINIMIZE))
{
@@ -58,35 +56,33 @@ IntIntersectWithParents(PWINDOW_OBJECT Child, RECTL *WindowRect)
/* FIXME: Layered windows. */
ParentWindow = ParentWindow->spwndParent;
ParentWnd = ParentWnd->spwndParent;
}
return TRUE;
}
BOOL FASTCALL
IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse)
IntValidateParent(PWND Child, HRGN hValidateRgn, BOOL Recurse)
{
PWINDOW_OBJECT ParentWindow = Child->spwndParent;
PWND ParentWnd;
PWND ParentWnd = Child->spwndParent;
while (ParentWindow)
while (ParentWnd)
{
ParentWnd = ParentWindow->Wnd;
if (ParentWnd->style & WS_CLIPCHILDREN)
break;
if (ParentWindow->hrgnUpdate != 0)
if (ParentWnd->hrgnUpdate != 0)
{
if (Recurse)
return FALSE;
IntInvalidateWindows( ParentWindow,
IntInvalidateWindows( ParentWnd,
hValidateRgn,
RDW_VALIDATE | RDW_NOCHILDREN);
}
ParentWindow = ParentWindow->spwndParent;
ParentWnd = ParentWnd->spwndParent;
}
return TRUE;
@@ -99,23 +95,21 @@ IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse)
*/
HRGN FASTCALL
IntCalcWindowRgn(PWINDOW_OBJECT Window, BOOL Client)
IntCalcWindowRgn(PWND Wnd, BOOL Client)
{
PWND Wnd;
HRGN hRgnWindow;
Wnd = Window->Wnd;
if (Client)
hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
else
hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
if (Window->hrgnClip != NULL && !(Wnd->style & WS_MINIMIZE))
if (Wnd->hrgnClip != NULL && !(Wnd->style & WS_MINIMIZE))
{
NtGdiOffsetRgn(hRgnWindow,
-Wnd->rcWindow.left,
-Wnd->rcWindow.top);
NtGdiCombineRgn(hRgnWindow, hRgnWindow, Window->hrgnClip, RGN_AND);
NtGdiCombineRgn(hRgnWindow, hRgnWindow, Wnd->hrgnClip, RGN_AND);
NtGdiOffsetRgn(hRgnWindow,
Wnd->rcWindow.left,
Wnd->rcWindow.top);
@@ -140,7 +134,7 @@ IntCalcWindowRgn(PWINDOW_OBJECT Window, BOOL Client)
*/
HRGN FASTCALL
IntGetNCUpdateRgn(PWINDOW_OBJECT Window, BOOL Validate)
IntGetNCUpdateRgn(PWND Window, BOOL Validate)
{
HRGN hRgnNonClient;
HRGN hRgnWindow;
@@ -195,8 +189,8 @@ IntGetNCUpdateRgn(PWINDOW_OBJECT Window, BOOL Validate)
IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
REGION_FreeRgnByHandle(Window->hrgnUpdate);
Window->hrgnUpdate = NULL;
if (!(Window->Wnd->state & WNDS_INTERNALPAINT))
MsqDecPaintCountQueue(Window->pti->MessageQueue);
if (!(Window->state & WNDS_INTERNALPAINT))
MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
}
}
@@ -217,26 +211,23 @@ IntGetNCUpdateRgn(PWINDOW_OBJECT Window, BOOL Validate)
*/
VOID FASTCALL
co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
{
HDC hDC;
HWND hWnd = Window->hSelf;
HWND hWnd = Wnd->head.h;
HRGN TempRegion;
PWND Wnd;
Wnd = Window->Wnd;
if (Flags & (RDW_ERASENOW | RDW_UPDATENOW))
{
if (Window->hrgnUpdate)
if (Wnd->hrgnUpdate)
{
if (!IntValidateParent(Window, Window->hrgnUpdate, Recurse))
if (!IntValidateParent(Wnd, Wnd->hrgnUpdate, Recurse))
return;
}
if (Flags & RDW_UPDATENOW)
{
if (Window->hrgnUpdate != NULL ||
if (Wnd->hrgnUpdate != NULL ||
Wnd->state & WNDS_INTERNALPAINT)
{
co_IntSendMessage(hWnd, WM_PAINT, 0, 0);
@@ -244,11 +235,11 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
}
else
{
if (Window->state & WINDOWOBJECT_NEED_NCPAINT)
if (Wnd->state & WNDS_SENDNCPAINT)
{
TempRegion = IntGetNCUpdateRgn(Window, TRUE);
Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
MsqDecPaintCountQueue(Window->pti->MessageQueue);
TempRegion = IntGetNCUpdateRgn(Wnd, TRUE);
Wnd->state &= ~WNDS_SENDNCPAINT;
MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue);
co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)TempRegion, 0);
if ( (HANDLE) 1 != TempRegion &&
@@ -259,19 +250,19 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
}
}
if (Window->state & WINDOWOBJECT_NEED_ERASEBKGND)
if (Wnd->state & WNDS_ERASEBACKGROUND)
{
if (Window->hrgnUpdate)
if (Wnd->hrgnUpdate)
{
hDC = UserGetDCEx( Window,
Window->hrgnUpdate,
hDC = UserGetDCEx( Wnd,
Wnd->hrgnUpdate,
DCX_CACHE|DCX_USESTYLE|DCX_INTERSECTRGN|DCX_KEEPCLIPRGN);
if (co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)hDC, 0))
{
Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
Wnd->state &= ~WNDS_ERASEBACKGROUND;
}
UserReleaseDC(Window, hDC, FALSE);
UserReleaseDC(Wnd, hDC, FALSE);
}
}
}
@@ -294,19 +285,18 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
{
HWND *List, *phWnd;
if ((List = IntWinListChildren(Window)))
if ((List = IntWinListChildren(Wnd)))
{
/* FIXME: Handle WS_EX_TRANSPARENT */
for (phWnd = List; *phWnd; ++phWnd)
{
Window = UserGetWindowObject(*phWnd);
Wnd = Window->Wnd;
if (Window && (Wnd->style & WS_VISIBLE))
Wnd = UserGetWindowObject(*phWnd);
if (Wnd && (Wnd->style & WS_VISIBLE))
{
USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(Window, &Ref);
co_IntPaintWindows(Window, Flags, TRUE);
UserDerefObjectCo(Window);
UserRefObjectCo(Wnd, &Ref);
co_IntPaintWindows(Wnd, Flags, TRUE);
UserDerefObjectCo(Wnd);
}
}
ExFreePool(List);
@@ -321,14 +311,12 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
*/
VOID FASTCALL
IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
IntInvalidateWindows(PWND Wnd, HRGN hRgn, ULONG Flags)
{
INT RgnType;
PWND Wnd;
BOOL HadPaintMessage, HadNCPaintMessage;
BOOL HasPaintMessage, HasNCPaintMessage;
Wnd = Window->Wnd;
DPRINT("IntInvalidateWindows start\n");
/*
* If the nonclient is not to be redrawn, clip the region to the client
@@ -338,7 +326,7 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
{
HRGN hRgnClient;
hRgnClient = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
hRgnClient = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnClient, RGN_AND);
REGION_FreeRgnByHandle(hRgnClient);
}
@@ -347,11 +335,11 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
* Clip the given region with window rectangle (or region)
*/
if (!Window->hrgnClip || (Wnd->style & WS_MINIMIZE))
if (!Wnd->hrgnClip || (Wnd->style & WS_MINIMIZE))
{
HRGN hRgnWindow;
hRgnWindow = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnWindow, RGN_AND);
REGION_FreeRgnByHandle(hRgnWindow);
}
@@ -360,7 +348,7 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
NtGdiOffsetRgn( hRgn,
-Wnd->rcWindow.left,
-Wnd->rcWindow.top);
RgnType = NtGdiCombineRgn(hRgn, hRgn, Window->hrgnClip, RGN_AND);
RgnType = NtGdiCombineRgn(hRgn, hRgn, Wnd->hrgnClip, RGN_AND);
NtGdiOffsetRgn( hRgn,
Wnd->rcWindow.left,
Wnd->rcWindow.top);
@@ -370,9 +358,9 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
* Save current state of pending updates
*/
HadPaintMessage = Window->hrgnUpdate != NULL ||
HadPaintMessage = Wnd->hrgnUpdate != NULL ||
Wnd->state & WNDS_INTERNALPAINT;
HadNCPaintMessage = Window->state & WINDOWOBJECT_NEED_NCPAINT;
HadNCPaintMessage = Wnd->state & WNDS_SENDNCPAINT;
/*
* Update the region and flags
@@ -380,47 +368,47 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
if (Flags & RDW_INVALIDATE && RgnType != NULLREGION)
{
if (Window->hrgnUpdate == NULL)
if (Wnd->hrgnUpdate == NULL)
{
Window->hrgnUpdate = IntSysCreateRectRgn(0, 0, 0, 0);
IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_PUBLIC);
Wnd->hrgnUpdate = IntSysCreateRectRgn(0, 0, 0, 0);
IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_PUBLIC);
}
if (NtGdiCombineRgn(Window->hrgnUpdate, Window->hrgnUpdate,
if (NtGdiCombineRgn(Wnd->hrgnUpdate, Wnd->hrgnUpdate,
hRgn, RGN_OR) == NULLREGION)
{
IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
REGION_FreeRgnByHandle(Window->hrgnUpdate);
Window->hrgnUpdate = NULL;
IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
REGION_FreeRgnByHandle(Wnd->hrgnUpdate);
Wnd->hrgnUpdate = NULL;
}
if (Flags & RDW_FRAME)
Window->state |= WINDOWOBJECT_NEED_NCPAINT;
Wnd->state |= WNDS_SENDNCPAINT;
if (Flags & RDW_ERASE)
Window->state |= WINDOWOBJECT_NEED_ERASEBKGND;
Wnd->state |= WNDS_ERASEBACKGROUND;
Flags |= RDW_FRAME;
}
if (Flags & RDW_VALIDATE && RgnType != NULLREGION)
{
if (Window->hrgnUpdate != NULL)
if (Wnd->hrgnUpdate != NULL)
{
if (NtGdiCombineRgn(Window->hrgnUpdate, Window->hrgnUpdate,
if (NtGdiCombineRgn(Wnd->hrgnUpdate, Wnd->hrgnUpdate,
hRgn, RGN_DIFF) == NULLREGION)
{
IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
REGION_FreeRgnByHandle(Window->hrgnUpdate);
Window->hrgnUpdate = NULL;
IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
REGION_FreeRgnByHandle(Wnd->hrgnUpdate);
Wnd->hrgnUpdate = NULL;
}
}
if (Window->hrgnUpdate == NULL)
Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
if (Wnd->hrgnUpdate == NULL)
Wnd->state &= ~WNDS_ERASEBACKGROUND;
if (Flags & RDW_NOFRAME)
Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
Wnd->state &= ~WNDS_SENDNCPAINT;
if (Flags & RDW_NOERASE)
Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
Wnd->state &= ~WNDS_ERASEBACKGROUND;
}
if (Flags & RDW_INTERNALPAINT)
@@ -440,11 +428,11 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
if (!(Flags & RDW_NOCHILDREN) && !(Wnd->style & WS_MINIMIZE) &&
((Flags & RDW_ALLCHILDREN) || !(Wnd->style & WS_CLIPCHILDREN)))
{
PWINDOW_OBJECT Child;
PWND Child;
for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
for (Child = Wnd->spwndChild; Child; Child = Child->spwndNext)
{
if (Child->Wnd->style & WS_VISIBLE)
if (Child->style & WS_VISIBLE)
{
/*
* Recursive call to update children hrgnUpdate
@@ -462,24 +450,24 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
* Fake post paint messages to window message queue if needed
*/
HasPaintMessage = Window->hrgnUpdate != NULL ||
HasPaintMessage = Wnd->hrgnUpdate != NULL ||
Wnd->state & WNDS_INTERNALPAINT;
HasNCPaintMessage = Window->state & WINDOWOBJECT_NEED_NCPAINT;
HasNCPaintMessage = Wnd->state & WNDS_SENDNCPAINT;
if (HasPaintMessage != HadPaintMessage)
{
if (HadPaintMessage)
MsqDecPaintCountQueue(Window->pti->MessageQueue);
MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue);
else
MsqIncPaintCountQueue(Window->pti->MessageQueue);
MsqIncPaintCountQueue(Wnd->head.pti->MessageQueue);
}
if (HasNCPaintMessage != HadNCPaintMessage)
{
if (HadNCPaintMessage)
MsqDecPaintCountQueue(Window->pti->MessageQueue);
MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue);
else
MsqIncPaintCountQueue(Window->pti->MessageQueue);
MsqIncPaintCountQueue(Wnd->head.pti->MessageQueue);
}
DPRINT("IntInvalidateWindows exit\n");
}
@@ -493,19 +481,17 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
*/
BOOL FASTCALL
IntIsWindowDrawable(PWINDOW_OBJECT Window)
IntIsWindowDrawable(PWND Wnd)
{
PWINDOW_OBJECT WndObject;
PWND Wnd;
PWND WndObject;
for (WndObject = Window; WndObject != NULL; WndObject = WndObject->spwndParent)
for (WndObject = Wnd; WndObject != NULL; WndObject = WndObject->spwndParent)
{
Wnd = WndObject->Wnd;
if ( Window->state & WINDOWSTATUS_DESTROYING || // state2
Window->state & WINDOWSTATUS_DESTROYED ||
!Wnd ||
!(Wnd->style & WS_VISIBLE) ||
((Wnd->style & WS_MINIMIZE) && (WndObject != Window)))
if ( WndObject->state2 & WNDS2_INDESTROY ||
WndObject->state & WNDS_DESTROYED ||
!WndObject ||
!(WndObject->style & WS_VISIBLE) ||
((WndObject->style & WS_MINIMIZE) && (WndObject != Wnd)))
{
return FALSE;
}
@@ -517,13 +503,13 @@ IntIsWindowDrawable(PWINDOW_OBJECT Window)
/*
* IntRedrawWindow
*
* Internal version of NtUserRedrawWindow that takes WINDOW_OBJECT as
* Internal version of NtUserRedrawWindow that takes WND as
* first parameter.
*/
BOOL FASTCALL
co_UserRedrawWindow(
PWINDOW_OBJECT Window,
PWND Window,
const RECTL* UpdateRect,
HRGN UpdateRgn,
ULONG Flags)
@@ -558,26 +544,26 @@ co_UserRedrawWindow(
hRgn = NULL;
}
else
NtGdiOffsetRgn(hRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
NtGdiOffsetRgn(hRgn, Window->rcClient.left, Window->rcClient.top);
}
else if (UpdateRect != NULL)
{
if (!RECTL_bIsEmptyRect(UpdateRect))
{
hRgn = IntSysCreateRectRgnIndirect((RECTL *)UpdateRect);
NtGdiOffsetRgn(hRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
NtGdiOffsetRgn(hRgn, Window->rcClient.left, Window->rcClient.top);
}
}
else if ((Flags & (RDW_INVALIDATE | RDW_FRAME)) == (RDW_INVALIDATE | RDW_FRAME) ||
(Flags & (RDW_VALIDATE | RDW_NOFRAME)) == (RDW_VALIDATE | RDW_NOFRAME))
{
if (!RECTL_bIsEmptyRect(&Window->Wnd->rcWindow))
hRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
if (!RECTL_bIsEmptyRect(&Window->rcWindow))
hRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow);
}
else
{
if (!RECTL_bIsEmptyRect(&Window->Wnd->rcClient))
hRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
if (!RECTL_bIsEmptyRect(&Window->rcClient))
hRgn = IntSysCreateRectRgnIndirect(&Window->rcClient);
}
}
@@ -617,45 +603,41 @@ co_UserRedrawWindow(
}
BOOL FASTCALL
IntIsWindowDirty(PWINDOW_OBJECT Window)
IntIsWindowDirty(PWND Wnd)
{
PWND Wnd = Window->Wnd;
return (Wnd->style & WS_VISIBLE) &&
((Window->hrgnUpdate != NULL) ||
((Wnd->hrgnUpdate != NULL) ||
(Wnd->state & WNDS_INTERNALPAINT) ||
(Window->state & WINDOWOBJECT_NEED_NCPAINT));
(Wnd->state & WNDS_SENDNCPAINT));
}
HWND FASTCALL
IntFindWindowToRepaint(PWINDOW_OBJECT Window, PTHREADINFO Thread)
IntFindWindowToRepaint(PWND Window, PTHREADINFO Thread)
{
HWND hChild;
PWINDOW_OBJECT TempWindow;
PWND Wnd, TempWnd;
PWND TempWindow;
for (; Window != NULL; Window = Window->spwndNext)
{
Wnd = Window->Wnd;
if (IntWndBelongsToThread(Window, Thread) &&
IntIsWindowDirty(Window))
{
/* Make sure all non-transparent siblings are already drawn. */
if (Wnd->ExStyle & WS_EX_TRANSPARENT)
if (Window->ExStyle & WS_EX_TRANSPARENT)
{
for (TempWindow = Window->spwndNext; TempWindow != NULL;
TempWindow = TempWindow->spwndNext)
{
TempWnd = TempWindow->Wnd;
if (!(TempWnd->ExStyle & WS_EX_TRANSPARENT) &&
if (!(TempWindow->ExStyle & WS_EX_TRANSPARENT) &&
IntWndBelongsToThread(TempWindow, Thread) &&
IntIsWindowDirty(TempWindow))
{
return TempWindow->hSelf;
return TempWindow->head.h;
}
}
}
return Window->hSelf;
return Window->head.h;
}
if (Window->spwndChild)
@@ -671,7 +653,7 @@ IntFindWindowToRepaint(PWINDOW_OBJECT Window, PTHREADINFO Thread)
BOOL FASTCALL
IntGetPaintMessage(
PWINDOW_OBJECT Window,
PWND Window,
UINT MsgFilterMin,
UINT MsgFilterMax,
PTHREADINFO Thread,
@@ -697,7 +679,7 @@ IntGetPaintMessage(
return FALSE;
}
if (Window != NULL && Message->hwnd != Window->hSelf)
if (Window != NULL && Message->hwnd != Window->head.h)
return FALSE;
Message->message = WM_PAINT;
@@ -708,12 +690,12 @@ IntGetPaintMessage(
static
HWND FASTCALL
co_IntFixCaret(PWINDOW_OBJECT Window, RECTL *lprc, UINT flags)
co_IntFixCaret(PWND Window, RECTL *lprc, UINT flags)
{
PDESKTOP Desktop;
PTHRDCARETINFO CaretInfo;
HWND hWndCaret;
PWINDOW_OBJECT WndCaret;
PWND WndCaret;
ASSERT_REFS_CO(Window);
@@ -753,19 +735,13 @@ co_IntFixCaret(PWINDOW_OBJECT Window, RECTL *lprc, UINT flags)
BOOL
FASTCALL
IntPrintWindow(
PWINDOW_OBJECT Window,
PWND pwnd,
HDC hdcBlt,
UINT nFlags)
{
PWND pwnd;
HDC hdcSrc;
INT cx, cy, xSrc, ySrc;
pwnd = Window->Wnd;
if (!pwnd)
return FALSE;
if ( nFlags & PW_CLIENTONLY)
{
cx = pwnd->rcClient.right - pwnd->rcClient.left;
@@ -785,9 +761,9 @@ IntPrintWindow(
return FALSE;
/* Update the window just incase. */
co_IntPaintWindows( Window, RDW_ERASENOW|RDW_UPDATENOW, FALSE);
co_IntPaintWindows( pwnd, RDW_ERASENOW|RDW_UPDATENOW, FALSE);
hdcSrc = UserGetDCEx( Window, NULL, DCX_CACHE|DCX_WINDOW);
hdcSrc = UserGetDCEx( pwnd, NULL, DCX_CACHE|DCX_WINDOW);
/* Print window to printer context. */
NtGdiBitBlt( hdcBlt,
0,
@@ -801,7 +777,7 @@ IntPrintWindow(
0,
0);
UserReleaseDC( Window, hdcSrc, FALSE);
UserReleaseDC( pwnd, hdcSrc, FALSE);
// TODO: Release Redirection from Print.
@@ -820,12 +796,11 @@ IntPrintWindow(
HDC APIENTRY
NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
{
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
PAINTSTRUCT Ps;
NTSTATUS Status;
DECLARE_RETURN(HDC);
USER_REFERENCE_ENTRY Ref;
PWND Wnd;
DPRINT("Enter NtUserBeginPaint\n");
UserEnterExclusive();
@@ -837,17 +812,15 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
UserRefObjectCo(Window, &Ref);
Wnd = Window->Wnd;
co_UserHideCaret(Window);
if (Window->state & WINDOWOBJECT_NEED_NCPAINT)
if (Window->state & WNDS_SENDNCPAINT)
{
HRGN hRgn;
hRgn = IntGetNCUpdateRgn(Window, FALSE);
Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
MsqDecPaintCountQueue(Window->pti->MessageQueue);
Window->state &= ~WNDS_SENDNCPAINT;
MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)hRgn, 0);
if (hRgn != (HANDLE)1 && hRgn != NULL)
{
@@ -868,7 +841,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
if (Window->hrgnUpdate != NULL)
{
MsqDecPaintCountQueue(Window->pti->MessageQueue);
MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
GdiGetClipBox(Ps.hdc, &Ps.rcPaint);
IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
/* The region is part of the dc now and belongs to the process! */
@@ -876,17 +849,17 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
}
else
{
if (Wnd->state & WNDS_INTERNALPAINT)
MsqDecPaintCountQueue(Window->pti->MessageQueue);
if (Window->state & WNDS_INTERNALPAINT)
MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
IntGetClientRect(Window, &Ps.rcPaint);
}
Wnd->state &= ~WNDS_INTERNALPAINT;
Window->state &= ~WNDS_INTERNALPAINT;
if (Window->state & WINDOWOBJECT_NEED_ERASEBKGND)
if (Window->state & WNDS_ERASEBACKGROUND)
{
Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
Window->state &= ~WNDS_ERASEBACKGROUND;
Ps.fErase = !co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)Ps.hdc, 0);
}
else
@@ -895,9 +868,9 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
}
if (Window->hrgnUpdate)
{
if (!(Wnd->style & WS_CLIPCHILDREN))
if (!(Window->style & WS_CLIPCHILDREN))
{
PWINDOW_OBJECT Child;
PWND Child;
for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
{
IntInvalidateWindows(Child, Window->hrgnUpdate, RDW_FRAME | RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
@@ -934,7 +907,7 @@ BOOL APIENTRY
NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* pUnsafePs)
{
NTSTATUS Status = STATUS_SUCCESS;
PWINDOW_OBJECT Window;
PWND Window;
DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
HDC hdc = NULL;
@@ -978,7 +951,7 @@ CLEANUP:
INT FASTCALL
co_UserGetUpdateRgn(PWINDOW_OBJECT Window, HRGN hRgn, BOOL bErase)
co_UserGetUpdateRgn(PWND Window, HRGN hRgn, BOOL bErase)
{
int RegionType;
RECTL Rect;
@@ -991,11 +964,11 @@ co_UserGetUpdateRgn(PWINDOW_OBJECT Window, HRGN hRgn, BOOL bErase)
}
else
{
Rect = Window->Wnd->rcClient;
Rect = Window->rcClient;
IntIntersectWithParents(Window, &Rect);
NtGdiSetRectRgn(hRgn, Rect.left, Rect.top, Rect.right, Rect.bottom);
RegionType = NtGdiCombineRgn(hRgn, hRgn, Window->hrgnUpdate, RGN_AND);
NtGdiOffsetRgn(hRgn, -Window->Wnd->rcClient.left, -Window->Wnd->rcClient.top);
NtGdiOffsetRgn(hRgn, -Window->rcClient.left, -Window->rcClient.top);
}
if (bErase && RegionType != NULLREGION && RegionType != ERROR)
@@ -1017,7 +990,7 @@ INT APIENTRY
NtUserGetUpdateRgn(HWND hWnd, HRGN hRgn, BOOL bErase)
{
DECLARE_RETURN(INT);
PWINDOW_OBJECT Window;
PWND Window;
INT ret;
USER_REFERENCE_ENTRY Ref;
@@ -1051,7 +1024,7 @@ CLEANUP:
BOOL APIENTRY
NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
{
PWINDOW_OBJECT Window;
PWND Window;
RECTL Rect;
INT RegionType;
PROSRGNDATA RgnData;
@@ -1075,7 +1048,7 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
/* Get the update region bounding box. */
if (Window->hrgnUpdate == (HRGN)1)
{
Rect = Window->Wnd->rcClient;
Rect = Window->rcClient;
}
else
{
@@ -1085,14 +1058,14 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
RGNOBJAPI_Unlock(RgnData);
if (RegionType != ERROR && RegionType != NULLREGION)
RECTL_bIntersectRect(&Rect, &Rect, &Window->Wnd->rcClient);
RECTL_bIntersectRect(&Rect, &Rect, &Window->rcClient);
}
if (IntIntersectWithParents(Window, &Rect))
{
RECTL_vOffsetRect(&Rect,
-Window->Wnd->rcClient.left,
-Window->Wnd->rcClient.top);
-Window->rcClient.left,
-Window->rcClient.top);
} else
{
Rect.left = Rect.top = Rect.right = Rect.bottom = 0;
@@ -1140,7 +1113,7 @@ NtUserRedrawWindow(
UINT flags)
{
RECTL SafeUpdateRect;
PWINDOW_OBJECT Wnd;
PWND Wnd;
BOOL Ret;
USER_REFERENCE_ENTRY Ref;
NTSTATUS Status = STATUS_SUCCESS;
@@ -1422,7 +1395,7 @@ NtUserScrollWindowEx(
{
RECTL rcScroll, rcClip, rcCaret, rcUpdate;
INT Result;
PWINDOW_OBJECT Window = NULL, CaretWnd;
PWND Window = NULL, CaretWnd;
HDC hDC;
HRGN hrgnOwn = NULL, hrgnTemp;
HWND hwndCaret;
@@ -1520,7 +1493,7 @@ NtUserScrollWindowEx(
if (flags & SW_SCROLLCHILDREN)
{
PWINDOW_OBJECT Child;
PWND Child;
RECTL rcChild;
POINT ClientOrigin;
USER_REFERENCE_ENTRY WndRef;
@@ -1529,7 +1502,7 @@ NtUserScrollWindowEx(
IntGetClientOrigin(Window, &ClientOrigin);
for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
{
rcChild = Child->Wnd->rcWindow;
rcChild = Child->rcWindow;
rcChild.left -= ClientOrigin.x;
rcChild.top -= ClientOrigin.y;
rcChild.right -= ClientOrigin.x;
@@ -1603,7 +1576,7 @@ CLEANUP:
BOOL
UserDrawSysMenuButton(
PWINDOW_OBJECT pWnd,
PWND pWnd,
HDC hDc,
RECTL *lpRc,
BOOL Down)
@@ -1615,12 +1588,12 @@ UserDrawSysMenuButton(
/* Get the icon to draw. We don't care about WM_GETICON here. */
hIcon = pWnd->Wnd->pcls->hIconSm;
hIcon = pWnd->pcls->hIconSm;
if(!hIcon)
{
DPRINT("Wnd class has no small icon.\n");
hIcon = pWnd->Wnd->pcls->hIcon;
hIcon = pWnd->pcls->hIcon;
}
if(!hIcon)
@@ -1709,7 +1682,7 @@ UserDrawCaptionText(
}
BOOL UserDrawCaption(
PWINDOW_OBJECT pWnd,
PWND pWnd,
HDC hDc,
RECTL *lpRc,
HFONT hFont,
@@ -1726,13 +1699,9 @@ BOOL UserDrawCaption(
RECTL r = *lpRc;
LONG ButtonWidth, IconWidth;
BOOL HasIcon;
PWND Wnd = NULL;
//ASSERT(pWnd != NULL);
if (pWnd)
Wnd = pWnd->Wnd;
RECTL_vMakeWellOrdered(lpRc);
hMemBmp = NtGdiCreateCompatibleBitmap(hDc,
lpRc->right - lpRc->left,
@@ -1762,11 +1731,11 @@ BOOL UserDrawCaption(
VCenter = (lpRc->bottom - lpRc->top) / 2;
Padding = VCenter - (Height / 2);
if ((!hIcon) && (Wnd != NULL))
if ((!hIcon) && (pWnd != NULL))
{
HasIcon = (uFlags & DC_ICON) && (Wnd->style & WS_SYSMENU)
&& !(uFlags & DC_SMALLCAP) && !(Wnd->ExStyle & WS_EX_DLGMODALFRAME)
&& !(Wnd->ExStyle & WS_EX_TOOLWINDOW);
HasIcon = (uFlags & DC_ICON) && (pWnd->style & WS_SYSMENU)
&& !(uFlags & DC_SMALLCAP) && !(pWnd->ExStyle & WS_EX_DLGMODALFRAME)
&& !(pWnd->ExStyle & WS_EX_TOOLWINDOW);
}
else
HasIcon = (hIcon != 0);
@@ -1840,14 +1809,14 @@ BOOL UserDrawCaption(
TRIVERTEX vert[2];
COLORREF Colors[2];
if (Wnd != NULL)
if (pWnd != NULL)
{
if(Wnd->style & WS_SYSMENU)
if(pWnd->style & WS_SYSMENU)
{
r.right -= 3 + ButtonWidth;
if(!(uFlags & DC_SMALLCAP))
{
if(Wnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
if(pWnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
r.right -= 2 + 2 * ButtonWidth;
else r.right -= 2;
r.right -= 2;
@@ -1927,12 +1896,12 @@ BOOL UserDrawCaption(
ButtonWidth = UserGetSystemMetrics(SM_CXSMSIZE) - 2;
else ButtonWidth = UserGetSystemMetrics(SM_CXSIZE) - 2;
if ((Wnd != NULL) && (Wnd->style & WS_SYSMENU))
if ((pWnd != NULL) && (pWnd->style & WS_SYSMENU))
{
r.right -= 3 + ButtonWidth;
if(! (uFlags & DC_SMALLCAP))
{
if(Wnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
if(pWnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
r.right -= 2 + 2 * ButtonWidth;
else r.right -= 2;
r.right -= 2;
@@ -1946,9 +1915,9 @@ BOOL UserDrawCaption(
else if (pWnd != NULL)
{
UNICODE_STRING ustr;
ustr.Buffer = pWnd->Wnd->strName.Buffer;
ustr.Length = pWnd->Wnd->strName.Length;
ustr.MaximumLength = pWnd->Wnd->strName.MaximumLength;
ustr.Buffer = pWnd->strName.Buffer;
ustr.Length = pWnd->strName.Length;
ustr.MaximumLength = pWnd->strName.MaximumLength;
UserDrawCaptionText(hMemDc, &ustr, &r, uFlags);
}
}
@@ -2002,7 +1971,7 @@ NtUserDrawCaptionTemp(
const PUNICODE_STRING str,
UINT uFlags)
{
PWINDOW_OBJECT pWnd = NULL;
PWND pWnd = NULL;
UNICODE_STRING SafeStr = {0};
NTSTATUS Status = STATUS_SUCCESS;
RECTL SafeRect;
@@ -2093,7 +2062,7 @@ NtUserPrintWindow(
HDC hdcBlt,
UINT nFlags)
{
PWINDOW_OBJECT Window;
PWND Window;
BOOL Ret = FALSE;
UserEnterExclusive();
+15 -15
View File
@@ -35,13 +35,13 @@
/* STATIC FUNCTIONS **********************************************************/
PPROPERTY FASTCALL
IntGetProp(PWINDOW_OBJECT Window, ATOM Atom)
IntGetProp(PWND Window, ATOM Atom)
{
PLIST_ENTRY ListEntry;
PPROPERTY Property;
ListEntry = Window->Wnd->PropListHead.Flink;
while (ListEntry != &Window->Wnd->PropListHead)
ListEntry = Window->PropListHead.Flink;
while (ListEntry != &Window->PropListHead)
{
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
if (Property->Atom == Atom)
@@ -54,7 +54,7 @@ IntGetProp(PWINDOW_OBJECT Window, ATOM Atom)
}
BOOL FASTCALL
IntRemoveProp(PWINDOW_OBJECT Window, ATOM Atom)
IntRemoveProp(PWND Window, ATOM Atom)
{
PPROPERTY Prop;
Prop = IntGetProp(Window, Atom);
@@ -65,12 +65,12 @@ IntRemoveProp(PWINDOW_OBJECT Window, ATOM Atom)
}
RemoveEntryList(&Prop->PropListEntry);
UserHeapFree(Prop);
Window->Wnd->PropListItems--;
Window->PropListItems--;
return TRUE;
}
BOOL FASTCALL
IntSetProp(PWINDOW_OBJECT pWnd, ATOM Atom, HANDLE Data)
IntSetProp(PWND pWnd, ATOM Atom, HANDLE Data)
{
PPROPERTY Prop;
@@ -84,8 +84,8 @@ IntSetProp(PWINDOW_OBJECT pWnd, ATOM Atom, HANDLE Data)
return FALSE;
}
Prop->Atom = Atom;
InsertTailList(&pWnd->Wnd->PropListHead, &Prop->PropListEntry);
pWnd->Wnd->PropListItems++;
InsertTailList(&pWnd->PropListHead, &Prop->PropListEntry);
pWnd->PropListItems++;
}
Prop->Data = Data;
@@ -100,7 +100,7 @@ NtUserBuildPropList(HWND hWnd,
DWORD BufferSize,
DWORD *Count)
{
PWINDOW_OBJECT Window;
PWND Window;
PPROPERTY Property;
PLIST_ENTRY ListEntry;
PROPLISTITEM listitem, *li;
@@ -125,8 +125,8 @@ NtUserBuildPropList(HWND hWnd,
/* copy list */
li = (PROPLISTITEM *)Buffer;
ListEntry = Window->Wnd->PropListHead.Flink;
while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &Window->Wnd->PropListHead))
ListEntry = Window->PropListHead.Flink;
while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &Window->PropListHead))
{
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
listitem.Atom = Property->Atom;
@@ -147,7 +147,7 @@ NtUserBuildPropList(HWND hWnd,
}
else
{
Cnt = Window->Wnd->PropListItems * sizeof(PROPLISTITEM);
Cnt = Window->PropListItems * sizeof(PROPLISTITEM);
}
if(Count)
@@ -170,7 +170,7 @@ CLEANUP:
HANDLE APIENTRY
NtUserRemoveProp(HWND hWnd, ATOM Atom)
{
PWINDOW_OBJECT Window;
PWND Window;
PPROPERTY Prop;
HANDLE Data;
DECLARE_RETURN(HANDLE);
@@ -192,7 +192,7 @@ NtUserRemoveProp(HWND hWnd, ATOM Atom)
Data = Prop->Data;
RemoveEntryList(&Prop->PropListEntry);
UserHeapFree(Prop);
Window->Wnd->PropListItems--;
Window->PropListItems--;
RETURN(Data);
@@ -205,7 +205,7 @@ CLEANUP:
BOOL APIENTRY
NtUserSetProp(HWND hWnd, ATOM Atom, HANDLE Data)
{
PWINDOW_OBJECT Window;
PWND Window;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserSetProp\n");
@@ -38,12 +38,11 @@
* the top. Return TRUE if the scrollbar is vertical, FALSE if horizontal.
*/
BOOL FASTCALL
IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, RECTL *lprect)
IntGetScrollBarRect (PWND Wnd, INT nBar, RECTL *lprect)
{
BOOL vertical;
PWND Wnd = Window->Wnd;
RECTL ClientRect = Window->Wnd->rcClient;
RECTL WindowRect = Window->Wnd->rcWindow;
RECTL ClientRect = Wnd->rcClient;
RECTL WindowRect = Wnd->rcWindow;
switch (nBar)
{
@@ -72,7 +71,7 @@ IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, RECTL *lprect)
break;
case SB_CTL:
IntGetClientRect (Window, lprect);
IntGetClientRect (Wnd, lprect);
vertical = ((Wnd->style & SBS_VERT) != 0);
break;
@@ -84,9 +83,8 @@ IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, RECTL *lprect)
}
BOOL FASTCALL
IntCalculateThumb(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi, LPSCROLLINFO psi)
IntCalculateThumb(PWND Wnd, LONG idObject, PSCROLLBARINFO psbi, LPSCROLLINFO psi)
{
PWND Wnd = Window->Wnd;
INT Thumb, ThumbBox, ThumbPos, cxy, mx;
RECTL ClientRect;
@@ -101,7 +99,7 @@ IntCalculateThumb(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi, LPS
cxy = psbi->rcScrollBar.bottom - psbi->rcScrollBar.top;
break;
case SB_CTL:
IntGetClientRect(Window, &ClientRect);
IntGetClientRect(Wnd, &ClientRect);
if(Wnd->style & SBS_VERT)
{
Thumb = UserGetSystemMetrics(SM_CYVSCROLL);
@@ -161,13 +159,13 @@ IntCalculateThumb(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi, LPS
}
static VOID FASTCALL
IntUpdateSBInfo(PWINDOW_OBJECT Window, int wBar)
IntUpdateSBInfo(PWND Window, int wBar)
{
PSCROLLBARINFO sbi;
LPSCROLLINFO psi;
ASSERT(Window);
ASSERT(Window->pSBInfo);
ASSERT(Window->pSBInfoex);
sbi = IntGetScrollbarInfoFromWindow(Window, wBar);
psi = IntGetScrollInfoFromWindow(Window, wBar);
@@ -176,7 +174,7 @@ IntUpdateSBInfo(PWINDOW_OBJECT Window, int wBar)
}
static BOOL FASTCALL
co_IntGetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPSCROLLINFO lpsi)
co_IntGetScrollInfo(PWND Window, INT nBar, LPSCROLLINFO lpsi)
{
UINT Mask;
LPSCROLLINFO psi;
@@ -278,7 +276,7 @@ NEWco_IntGetScrollInfo(
}
static DWORD FASTCALL
co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
{
/*
* Update the scrollbar state and set action flags according to
@@ -420,10 +418,10 @@ co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bR
if (bRedraw)
{
RECTL UpdateRect = psbi->rcScrollBar;
UpdateRect.left -= Window->Wnd->rcClient.left - Window->Wnd->rcWindow.left;
UpdateRect.right -= Window->Wnd->rcClient.left - Window->Wnd->rcWindow.left;
UpdateRect.top -= Window->Wnd->rcClient.top - Window->Wnd->rcWindow.top;
UpdateRect.bottom -= Window->Wnd->rcClient.top - Window->Wnd->rcWindow.top;
UpdateRect.left -= Window->rcClient.left - Window->rcWindow.left;
UpdateRect.right -= Window->rcClient.left - Window->rcWindow.left;
UpdateRect.top -= Window->rcClient.top - Window->rcWindow.top;
UpdateRect.bottom -= Window->rcClient.top - Window->rcWindow.top;
co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME);
}
@@ -432,7 +430,7 @@ co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bR
}
BOOL FASTCALL
co_IntGetScrollBarInfo(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi)
co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
{
INT Bar;
PSCROLLBARINFO sbi;
@@ -466,7 +464,7 @@ co_IntGetScrollBarInfo(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi
}
BOOL FASTCALL
co_IntCreateScrollBars(PWINDOW_OBJECT Window)
co_IntCreateScrollBars(PWND Window)
{
PSCROLLBARINFO psbi;
LPSCROLLINFO psi;
@@ -475,7 +473,7 @@ co_IntCreateScrollBars(PWINDOW_OBJECT Window)
ASSERT_REFS_CO(Window);
if(Window->pSBInfo)
if(Window->pSBInfoex)
{
/* no need to create it anymore */
return TRUE;
@@ -483,17 +481,17 @@ co_IntCreateScrollBars(PWINDOW_OBJECT Window)
/* allocate memory for all scrollbars (HORZ, VERT, CONTROL) */
Size = 3 * (sizeof(SBINFOEX));
if(!(Window->pSBInfo = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO)))
if(!(Window->pSBInfoex = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO)))
{
DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window->hSelf);
DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window->head.h);
return FALSE;
}
RtlZeroMemory(Window->pSBInfo, Size);
RtlZeroMemory(Window->pSBInfoex, Size);
co_WinPosGetNonClientSize(Window,
&Window->Wnd->rcWindow,
&Window->Wnd->rcClient);
&Window->rcWindow,
&Window->rcClient);
for(s = SB_HORZ; s <= SB_VERT; s++)
{
@@ -514,12 +512,12 @@ co_IntCreateScrollBars(PWINDOW_OBJECT Window)
}
BOOL FASTCALL
IntDestroyScrollBars(PWINDOW_OBJECT Window)
IntDestroyScrollBars(PWND Window)
{
if(Window->pSBInfo)
if(Window->pSBInfoex)
{
ExFreePool(Window->pSBInfo);
Window->pSBInfo = NULL;
ExFreePool(Window->pSBInfoex);
Window->pSBInfoex = NULL;
return TRUE;
}
return FALSE;
@@ -570,7 +568,7 @@ NtUserGetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
{
NTSTATUS Status;
SCROLLBARINFO sbi;
PWINDOW_OBJECT Window;
PWND Window;
BOOL Ret;
DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
@@ -620,7 +618,7 @@ NtUserSBGetParms(
LPSCROLLINFO lpsi)
{
NTSTATUS Status;
PWINDOW_OBJECT Window;
PWND Window;
SCROLLINFO psi;
DWORD sz;
BOOL Ret;
@@ -677,7 +675,7 @@ NtUserEnableScrollBar(
UINT wSBflags,
UINT wArrows)
{
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
PSCROLLBARINFO InfoV = NULL, InfoH = NULL;
BOOL Chg = FALSE;
DECLARE_RETURN(BOOL);
@@ -757,7 +755,7 @@ NtUserSetScrollBarInfo(
LONG idObject,
SETSCROLLBARINFO *info)
{
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
SETSCROLLBARINFO Safeinfo;
PSCROLLBARINFO sbi;
LPSCROLLINFO psi;
@@ -821,7 +819,7 @@ NtUserSetScrollInfo(
LPCSCROLLINFO lpsi,
BOOL bRedraw)
{
PWINDOW_OBJECT Window = NULL;
PWND Window = NULL;
NTSTATUS Status;
SCROLLINFO ScrollInfo;
DECLARE_RETURN(DWORD);
@@ -857,14 +855,11 @@ CLEANUP:
/* Ported from WINE20020904 (SCROLL_ShowScrollBar) */
DWORD FASTCALL
co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow)
co_UserShowScrollBar(PWND Wnd, int wBar, DWORD bShow)
{
DWORD Style, OldStyle;
PWND Wnd;
ASSERT_REFS_CO(Window);
Wnd = Window->Wnd;
ASSERT_REFS_CO(Wnd);
switch(wBar)
{
@@ -885,16 +880,16 @@ co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow)
return( FALSE);
}
if(!co_IntCreateScrollBars(Window))
if(!co_IntCreateScrollBars(Wnd))
{
return( FALSE);
}
if (wBar == SB_CTL)
{
IntUpdateSBInfo(Window, SB_CTL);
IntUpdateSBInfo(Wnd, SB_CTL);
co_WinPosShowWindow(Window, bShow ? SW_SHOW : SW_HIDE);
co_WinPosShowWindow(Wnd, bShow ? SW_SHOW : SW_HIDE);
return( TRUE);
}
@@ -907,14 +902,14 @@ co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow)
if(Wnd->style != OldStyle)
{
if(Wnd->style & WS_HSCROLL)
IntUpdateSBInfo(Window, SB_HORZ);
IntUpdateSBInfo(Wnd, SB_HORZ);
if(Wnd->style & WS_VSCROLL)
IntUpdateSBInfo(Window, SB_VERT);
IntUpdateSBInfo(Wnd, SB_VERT);
if(Wnd->style & WS_VISIBLE)
{
/* Frame has been changed, let the window redraw itself */
co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
co_WinPosSetWindowPos(Wnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOSENDCHANGING);
}
}
@@ -926,7 +921,7 @@ co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow)
DWORD APIENTRY
NtUserShowScrollBar(HWND hWnd, int wBar, DWORD bShow)
{
PWINDOW_OBJECT Window;
PWND Window;
DECLARE_RETURN(DWORD);
DWORD ret;
USER_REFERENCE_ENTRY Ref;
@@ -230,7 +230,7 @@ NtUserCallOneParam(
case ONEPARAM_ROUTINE_ISWINDOWINDESTROY:
{
PWINDOW_OBJECT Window;
PWND Window;
DWORD_PTR Result;
if(!(Window = UserGetWindowObject((HWND)Param)))
@@ -377,7 +377,7 @@ NtUserCallTwoParam(
DWORD Routine)
{
NTSTATUS Status;
PWINDOW_OBJECT Window;
PWND Window;
DECLARE_RETURN(DWORD_PTR);
DPRINT("Enter NtUserCallTwoParam\n");
@@ -456,7 +456,7 @@ NtUserCallTwoParam(
wParam = MAKEWPARAM((Param2 >> 3) & 0x3,
Param2 & (UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE));
RETURN( UserUpdateUiState(Window->Wnd, wParam) );
RETURN( UserUpdateUiState(Window, wParam) );
}
case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW:
@@ -496,22 +496,19 @@ NtUserCallHwndLock(
DWORD Routine)
{
BOOL Ret = 0;
PWINDOW_OBJECT Window;
PWND Wnd;
PWND Window;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(BOOLEAN);
DPRINT("Enter NtUserCallHwndLock\n");
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
if (!(Window = UserGetWindowObject(hWnd)))
{
RETURN( FALSE);
}
UserRefObjectCo(Window, &Ref);
Wnd = Window->Wnd;
/* FIXME: Routine can be 0x53 - 0x5E */
switch (Routine)
{
@@ -523,7 +520,7 @@ NtUserCallHwndLock(
{
DPRINT("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
Ret = TRUE;
if ((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
if ((Window->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
co_WinPosSetWindowPos( Window,
HWND_DESKTOP,
0,0,0,0,
@@ -615,13 +612,13 @@ NtUserCallHwnd(
{
case HWND_ROUTINE_GETWNDCONTEXTHLPID:
{
PWINDOW_OBJECT Window;
PWND Window;
PPROPERTY HelpId;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
if (!(Window = UserGetWindowObject(hWnd)))
{
UserLeave();
return 0;
@@ -664,7 +661,7 @@ NtUserCallHwndParam(
case HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID:
{
PWINDOW_OBJECT Window;
PWND Window;
UserEnterExclusive();
if(!(Window = UserGetWindowObject(hWnd)))
@@ -684,20 +681,18 @@ NtUserCallHwndParam(
case HWNDPARAM_ROUTINE_SETDIALOGPOINTER:
{
PWINDOW_OBJECT Window;
PWND pWnd;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
if (!(pWnd = UserGetWindowObject(hWnd)))
{
UserLeave();
return 0;
}
UserRefObjectCo(Window, &Ref);
UserRefObjectCo(pWnd, &Ref);
pWnd = Window->Wnd;
if (pWnd->head.pti->ppi == PsGetCurrentProcessWin32Process() &&
pWnd->cbwndExtra == DLGWINDOWEXTRA &&
!(pWnd->state & WNDS_SERVERSIDEWINDOWPROC))
@@ -714,7 +709,7 @@ NtUserCallHwndParam(
}
}
UserDerefObjectCo(Window);
UserDerefObjectCo(pWnd);
UserLeave();
return 0;
}
@@ -733,14 +728,14 @@ NtUserCallHwndParamLock(
DWORD Routine)
{
DWORD Ret = 0;
PWINDOW_OBJECT Window;
PWND Window;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(DWORD);
DPRINT1("Enter NtUserCallHwndParamLock\n");
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
if (!(Window = UserGetWindowObject(hWnd)))
{
RETURN( FALSE);
}
+11 -11
View File
@@ -114,7 +114,7 @@ RemoveTimer(PTIMER pTmr)
PTIMER
FASTCALL
FindTimer(PWINDOW_OBJECT Window,
FindTimer(PWND Window,
UINT_PTR nID,
UINT flags)
{
@@ -194,7 +194,7 @@ ValidateTimerCallback(PTHREADINFO pti,
}
UINT_PTR FASTCALL
IntSetTimer( PWINDOW_OBJECT Window,
IntSetTimer( PWND Window,
UINT_PTR IDEvent,
UINT Elapse,
TIMERPROC TimerFunc,
@@ -262,7 +262,7 @@ IntSetTimer( PWINDOW_OBJECT Window,
if (!pTmr) return 0;
if (Window && (Type & TMRF_TIFROMWND))
pTmr->pti = Window->pti->pEThread->Tcb.Win32Thread;
pTmr->pti = Window->head.pti->pEThread->Tcb.Win32Thread;
else
{
if (Type & TMRF_RIT)
@@ -316,12 +316,12 @@ StartTheTimers(VOID)
UINT_PTR
FASTCALL
SystemTimerSet( PWINDOW_OBJECT Window,
SystemTimerSet( PWND Window,
UINT_PTR nIDEvent,
UINT uElapse,
TIMERPROC lpTimerFunc)
{
if (Window && Window->pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
if (Window && Window->head.pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
{
SetLastWin32Error(ERROR_ACCESS_DENIED);
DPRINT("SysemTimerSet: Access Denied!\n");
@@ -332,7 +332,7 @@ SystemTimerSet( PWINDOW_OBJECT Window,
BOOL
FASTCALL
PostTimerMessages(PWINDOW_OBJECT Window)
PostTimerMessages(PWND Window)
{
PLIST_ENTRY pLE;
PUSER_MESSAGE_QUEUE ThreadQueue;
@@ -354,7 +354,7 @@ PostTimerMessages(PWINDOW_OBJECT Window)
(pTmr->pti == pti) &&
((pTmr->pWnd == Window) || (Window == NULL)) )
{
Msg.hwnd = (pTmr->pWnd) ? pTmr->pWnd->hSelf : 0;
Msg.hwnd = (pTmr->pWnd) ? pTmr->pWnd->head.h : 0;
Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER;
Msg.wParam = (WPARAM) pTmr->nID;
Msg.lParam = (LPARAM) pTmr->pfn;
@@ -455,7 +455,7 @@ ProcessTimers(VOID)
}
BOOL FASTCALL
DestroyTimersForWindow(PTHREADINFO pti, PWINDOW_OBJECT Window)
DestroyTimersForWindow(PTHREADINFO pti, PWND Window)
{
PLIST_ENTRY pLE;
PTIMER pTmr = FirstpTmr;
@@ -509,7 +509,7 @@ DestroyTimersForThread(PTHREADINFO pti)
}
BOOL FASTCALL
IntKillTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, BOOL SystemTimer)
IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
{
PTIMER pTmr = NULL;
DPRINT("IntKillTimer Window %x id %p systemtimer %s\n",
@@ -561,7 +561,7 @@ NtUserSetTimer
TIMERPROC lpTimerFunc
)
{
PWINDOW_OBJECT Window;
PWND Window;
DECLARE_RETURN(UINT_PTR);
DPRINT("Enter NtUserSetTimer\n");
@@ -586,7 +586,7 @@ NtUserKillTimer
UINT_PTR uIDEvent
)
{
PWINDOW_OBJECT Window;
PWND Window;
DECLARE_RETURN(BOOL);
DPRINT("Enter NtUserKillTimer\n");
+35 -48
View File
@@ -31,16 +31,13 @@
HRGN FASTCALL
VIS_ComputeVisibleRegion(
PWINDOW_OBJECT Window,
PWND Wnd,
BOOLEAN ClientArea,
BOOLEAN ClipChildren,
BOOLEAN ClipSiblings)
{
HRGN VisRgn, ClipRgn;
PWINDOW_OBJECT PreviousWindow, CurrentWindow, CurrentSibling;
PWND Wnd, CurrentWnd, PreviousWnd, CurrentSiblingWnd;
Wnd = Window->Wnd;
PWND PreviousWindow, CurrentWindow, CurrentSibling;
if (!Wnd || !(Wnd->style & WS_VISIBLE))
{
@@ -51,11 +48,11 @@ VIS_ComputeVisibleRegion(
if (ClientArea)
{
VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
VisRgn = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
}
else
{
VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
VisRgn = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
}
/*
@@ -64,49 +61,45 @@ VIS_ComputeVisibleRegion(
* our window.
*/
PreviousWindow = Window;
PreviousWnd = PreviousWindow->Wnd;
CurrentWindow = Window->spwndParent;
PreviousWindow = Wnd;
CurrentWindow = Wnd->spwndParent;
while (CurrentWindow)
{
if ( CurrentWindow->state & WINDOWSTATUS_DESTROYING || // state2
CurrentWindow->state & WINDOWSTATUS_DESTROYED )
if ( CurrentWindow->state2 & WNDS2_INDESTROY ||
CurrentWindow->state & WNDS_DESTROYED )
{
DPRINT1("ATM the Current Window or Parent is dead!\n");
if (VisRgn) REGION_FreeRgnByHandle(VisRgn);
return NULL;
}
CurrentWnd = CurrentWindow->Wnd;
if (!CurrentWnd || !(CurrentWnd->style & WS_VISIBLE))
if (!(CurrentWindow->style & WS_VISIBLE))
{
if (VisRgn) REGION_FreeRgnByHandle(VisRgn);
return NULL;
}
ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWnd->rcClient);
ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWindow->rcClient);
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_AND);
REGION_FreeRgnByHandle(ClipRgn);
if ((PreviousWnd->style & WS_CLIPSIBLINGS) ||
(PreviousWnd == Wnd && ClipSiblings))
if ((PreviousWindow->style & WS_CLIPSIBLINGS) ||
(PreviousWindow == Wnd && ClipSiblings))
{
CurrentSibling = CurrentWindow->spwndChild;
while ( CurrentSibling != NULL &&
CurrentSibling != PreviousWindow &&
CurrentSibling->Wnd )
CurrentSibling != PreviousWindow )
{
CurrentSiblingWnd = CurrentSibling->Wnd;
if ((CurrentSiblingWnd->style & WS_VISIBLE) &&
!(CurrentSiblingWnd->ExStyle & WS_EX_TRANSPARENT))
if ((CurrentSibling->style & WS_VISIBLE) &&
!(CurrentSibling->ExStyle & WS_EX_TRANSPARENT))
{
ClipRgn = IntSysCreateRectRgnIndirect(&CurrentSiblingWnd->rcWindow);
ClipRgn = IntSysCreateRectRgnIndirect(&CurrentSibling->rcWindow);
/* Combine it with the window region if available */
if (CurrentSibling->hrgnClip && !(CurrentSiblingWnd->style & WS_MINIMIZE))
if (CurrentSibling->hrgnClip && !(CurrentSibling->style & WS_MINIMIZE))
{
NtGdiOffsetRgn(ClipRgn, -CurrentSiblingWnd->rcWindow.left, -CurrentSiblingWnd->rcWindow.top);
NtGdiOffsetRgn(ClipRgn, -CurrentSibling->rcWindow.left, -CurrentSibling->rcWindow.top);
NtGdiCombineRgn(ClipRgn, ClipRgn, CurrentSibling->hrgnClip, RGN_AND);
NtGdiOffsetRgn(ClipRgn, CurrentSiblingWnd->rcWindow.left, CurrentSiblingWnd->rcWindow.top);
NtGdiOffsetRgn(ClipRgn, CurrentSibling->rcWindow.left, CurrentSibling->rcWindow.top);
}
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
REGION_FreeRgnByHandle(ClipRgn);
@@ -116,26 +109,24 @@ VIS_ComputeVisibleRegion(
}
PreviousWindow = CurrentWindow;
PreviousWnd = PreviousWindow->Wnd;
CurrentWindow = CurrentWindow->spwndParent;
}
if (ClipChildren)
{
CurrentWindow = Window->spwndChild;
while (CurrentWindow && CurrentWindow->Wnd)
CurrentWindow = Wnd->spwndChild;
while (CurrentWindow)
{
CurrentWnd = CurrentWindow->Wnd;
if ((CurrentWnd->style & WS_VISIBLE) &&
!(CurrentWnd->ExStyle & WS_EX_TRANSPARENT))
if ((CurrentWindow->style & WS_VISIBLE) &&
!(CurrentWindow->ExStyle & WS_EX_TRANSPARENT))
{
ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWnd->rcWindow);
ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWindow->rcWindow);
/* Combine it with the window region if available */
if (CurrentWindow->hrgnClip && !(CurrentWnd->style & WS_MINIMIZE))
if (CurrentWindow->hrgnClip && !(CurrentWindow->style & WS_MINIMIZE))
{
NtGdiOffsetRgn(ClipRgn, -CurrentWnd->rcWindow.left, -CurrentWnd->rcWindow.top);
NtGdiOffsetRgn(ClipRgn, -CurrentWindow->rcWindow.left, -CurrentWindow->rcWindow.top);
NtGdiCombineRgn(ClipRgn, ClipRgn, CurrentWindow->hrgnClip, RGN_AND);
NtGdiOffsetRgn(ClipRgn, CurrentWnd->rcWindow.left, CurrentWnd->rcWindow.top);
NtGdiOffsetRgn(ClipRgn, CurrentWindow->rcWindow.left, CurrentWindow->rcWindow.top);
}
NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
REGION_FreeRgnByHandle(ClipRgn);
@@ -144,10 +135,10 @@ VIS_ComputeVisibleRegion(
}
}
if (Window->hrgnClip && !(Wnd->style & WS_MINIMIZE))
if (Wnd->hrgnClip && !(Wnd->style & WS_MINIMIZE))
{
NtGdiOffsetRgn(VisRgn, -Wnd->rcWindow.left, -Wnd->rcWindow.top);
NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND);
NtGdiCombineRgn(VisRgn, VisRgn, Wnd->hrgnClip, RGN_AND);
NtGdiOffsetRgn(VisRgn, Wnd->rcWindow.left, Wnd->rcWindow.top);
}
@@ -156,28 +147,24 @@ VIS_ComputeVisibleRegion(
VOID FASTCALL
co_VIS_WindowLayoutChanged(
PWINDOW_OBJECT Window,
PWND Wnd,
HRGN NewlyExposed)
{
HRGN Temp;
PWINDOW_OBJECT Parent;
PWND Parent;
USER_REFERENCE_ENTRY Ref;
PWND Wnd, ParentWnd;
ASSERT_REFS_CO(Window);
Wnd = Window->Wnd;
ASSERT_REFS_CO(Wnd);
Temp = IntSysCreateRectRgn(0, 0, 0, 0);
NtGdiCombineRgn(Temp, NewlyExposed, NULL, RGN_COPY);
Parent = Window->spwndParent;
Parent = Wnd->spwndParent;
if(Parent)
{
ParentWnd = Parent->Wnd;
NtGdiOffsetRgn(Temp,
Wnd->rcWindow.left - ParentWnd->rcClient.left,
Wnd->rcWindow.top - ParentWnd->rcClient.top);
Wnd->rcWindow.left - Parent->rcClient.left,
Wnd->rcWindow.top - Parent->rcClient.top);
UserRefObjectCo(Parent, &Ref);
co_UserRedrawWindow(Parent, NULL, Temp,
+55 -66
View File
@@ -59,7 +59,7 @@ DceCreateDisplayDC(VOID)
static
HRGN FASTCALL
DceGetVisRgn(PWINDOW_OBJECT Window, ULONG Flags, HWND hWndChild, ULONG CFlags)
DceGetVisRgn(PWND Window, ULONG Flags, HWND hWndChild, ULONG CFlags)
{
HRGN VisRgn;
@@ -75,12 +75,9 @@ DceGetVisRgn(PWINDOW_OBJECT Window, ULONG Flags, HWND hWndChild, ULONG CFlags)
}
PDCE FASTCALL
DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type)
DceAllocDCE(PWND Window OPTIONAL, DCE_TYPE Type)
{
PDCE pDce;
PWND Wnd = NULL;
if (Window) Wnd = Window->Wnd;
pDce = ExAllocatePoolWithTag(PagedPool, sizeof(DCE), TAG_PDCE);
if(!pDce)
@@ -94,9 +91,9 @@ DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type)
}
DCECount++;
DPRINT("Alloc DCE's! %d\n",DCECount);
pDce->hwndCurrent = (Window ? Window->hSelf : NULL);
pDce->pwndOrg = Wnd;
pDce->pwndClip = Wnd;
pDce->hwndCurrent = (Window ? Window->head.h : NULL);
pDce->pwndOrg = Window;
pDce->pwndClip = Window;
pDce->hrgnClip = NULL;
pDce->hrgnClipPublic = NULL;
pDce->hrgnSavedVis = NULL;
@@ -124,12 +121,12 @@ DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type)
else
{
pDce->DCXFlags = DCX_DCEBUSY;
if (Wnd)
if (Window)
{
if (Type == DCE_WINDOW_DC)
{
if (Wnd->style & WS_CLIPCHILDREN) pDce->DCXFlags |= DCX_CLIPCHILDREN;
if (Wnd->style & WS_CLIPSIBLINGS) pDce->DCXFlags |= DCX_CLIPSIBLINGS;
if (Window->style & WS_CLIPCHILDREN) pDce->DCXFlags |= DCX_CLIPCHILDREN;
if (Window->style & WS_CLIPSIBLINGS) pDce->DCXFlags |= DCX_CLIPSIBLINGS;
}
}
}
@@ -137,12 +134,11 @@ DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type)
}
static VOID APIENTRY
DceSetDrawable( PWINDOW_OBJECT Window OPTIONAL,
DceSetDrawable( PWND Window OPTIONAL,
HDC hDC,
ULONG Flags,
BOOL SetClipOrigin)
{
PWND Wnd;
DC *dc = DC_LockDc(hDC);
if(!dc)
return;
@@ -154,16 +150,15 @@ DceSetDrawable( PWINDOW_OBJECT Window OPTIONAL,
}
else
{
Wnd = Window->Wnd;
if (Flags & DCX_WINDOW)
{
dc->ptlDCOrig.x = Wnd->rcWindow.left;
dc->ptlDCOrig.y = Wnd->rcWindow.top;
dc->ptlDCOrig.x = Window->rcWindow.left;
dc->ptlDCOrig.y = Window->rcWindow.top;
}
else
{
dc->ptlDCOrig.x = Wnd->rcClient.left;
dc->ptlDCOrig.y = Wnd->rcClient.top;
dc->ptlDCOrig.x = Window->rcClient.left;
dc->ptlDCOrig.y = Window->rcClient.top;
}
}
DC_UnlockDc(dc);
@@ -254,16 +249,15 @@ DceReleaseDC(DCE* dce, BOOL EndPaint)
}
static VOID FASTCALL
DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
DceUpdateVisRgn(DCE *Dce, PWND Window, ULONG Flags)
{
HANDLE hRgnVisible = NULL;
ULONG DcxFlags;
PWINDOW_OBJECT DesktopWindow;
PWND DesktopWindow;
if (Flags & DCX_PARENTCLIP)
{
PWINDOW_OBJECT Parent;
PWND ParentWnd;
PWND Parent;
Parent = Window->spwndParent;
if(!Parent)
@@ -272,9 +266,7 @@ DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
goto noparent;
}
ParentWnd = Parent->Wnd;
if (ParentWnd->style & WS_CLIPSIBLINGS)
if (Parent->style & WS_CLIPSIBLINGS)
{
DcxFlags = DCX_CLIPSIBLINGS |
(Flags & ~(DCX_CLIPCHILDREN | DCX_WINDOW));
@@ -283,14 +275,14 @@ DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
{
DcxFlags = Flags & ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW);
}
hRgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->hSelf, Flags);
hRgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->head.h, Flags);
}
else if (Window == NULL)
{
DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
if (NULL != DesktopWindow)
{
hRgnVisible = IntSysCreateRectRgnIndirect(&DesktopWindow->Wnd->rcWindow);
hRgnVisible = IntSysCreateRectRgnIndirect(&DesktopWindow->rcWindow);
}
else
{
@@ -338,24 +330,21 @@ noparent:
}
HDC FASTCALL
UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
{
PWINDOW_OBJECT Parent;
PWND Parent;
ULONG DcxFlags;
DCE* Dce = NULL;
BOOL UpdateClipOrigin = FALSE;
PWND Wnd = NULL;
HDC hDC = NULL;
PPROCESSINFO ppi;
PLIST_ENTRY pLE;
if (NULL == Window)
if (NULL == Wnd)
{
Flags &= ~DCX_USESTYLE;
Flags |= DCX_CACHE;
}
else
Wnd = Window->Wnd;
if (Flags & (DCX_WINDOW | DCX_PARENTCLIP)) Flags |= DCX_CACHE;
@@ -420,9 +409,9 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
Flags &= ~(DCX_PARENTCLIP | DCX_CLIPCHILDREN);
}
Parent = (Window ? Window->spwndParent : NULL);
Parent = (Wnd ? Wnd->spwndParent : NULL);
if (NULL == Window || !(Wnd->style & WS_CHILD) || NULL == Parent)
if (NULL == Wnd || !(Wnd->style & WS_CHILD) || NULL == Parent)
{
Flags &= ~DCX_PARENTCLIP;
Flags |= DCX_CLIPSIBLINGS;
@@ -434,10 +423,10 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
if (Flags & DCX_PARENTCLIP)
{
if ((Wnd->style & WS_VISIBLE) &&
(Parent->Wnd->style & WS_VISIBLE))
(Parent->style & WS_VISIBLE))
{
Flags &= ~DCX_CLIPCHILDREN;
if (Parent->Wnd->style & WS_CLIPSIBLINGS)
if (Parent->style & WS_CLIPSIBLINGS)
{
Flags |= DCX_CLIPSIBLINGS;
}
@@ -478,7 +467,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
{
DceEmpty = Dce;
}
else if (Dce->hwndCurrent == (Window ? Window->hSelf : NULL) &&
else if (Dce->hwndCurrent == (Wnd ? Wnd->head.h : NULL) &&
((Dce->DCXFlags & DCX_CACHECOMPAREMASK) == DcxFlags))
{
UpdateClipOrigin = TRUE;
@@ -499,7 +488,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
}
if (!Dce) return NULL;
Dce->hwndCurrent = (Window ? Window->hSelf : NULL);
Dce->hwndCurrent = (Wnd ? Wnd->head.h : NULL);
}
else // If we are here, we are POWNED or having CLASS.
{
@@ -508,7 +497,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
Dce = CONTAINING_RECORD(pLE, DCE, List);
do
{ // Check for Window handle than HDC match for CLASS.
if ((Dce->hwndCurrent == Window->hSelf) ||
if ((Dce->hwndCurrent == Wnd->head.h) ||
(Dce->hDC == hDC))
break;
pLE = Dce->List.Flink;
@@ -556,18 +545,18 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
{
Flags |= DCX_INTERSECTRGN | DCX_KEEPCLIPRGN;
Dce->DCXFlags |= DCX_INTERSECTRGN | DCX_KEEPCLIPRGN;
ClipRegion = Window->hrgnUpdate;
ClipRegion = Wnd->hrgnUpdate;
}
if (ClipRegion == (HRGN) 1)
{
if (!(Flags & DCX_WINDOW))
{
Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
}
else
{
Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
}
Dce->DCXFlags &= ~DCX_KEEPCLIPRGN;
}
@@ -582,9 +571,9 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
Dce->hrgnClip = ClipRegion;
}
DceSetDrawable(Window, Dce->hDC, Flags, UpdateClipOrigin);
DceSetDrawable(Wnd, Dce->hDC, Flags, UpdateClipOrigin);
DceUpdateVisRgn(Dce, Window, Flags);
DceUpdateVisRgn(Dce, Wnd, Flags);
if (Dce->DCXFlags & DCX_CACHE)
{
@@ -679,7 +668,7 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force)
* Remove owned DCE and reset unreleased cache DCEs.
*/
void FASTCALL
DceFreeWindowDCE(PWINDOW_OBJECT Window)
DceFreeWindowDCE(PWND Window)
{
PDCE pDCE;
PLIST_ENTRY pLE;
@@ -704,12 +693,12 @@ DceFreeWindowDCE(PWINDOW_OBJECT Window)
DPRINT1("FreeWindowDCE List is Empty!!!!\n");
break;
}
if ( pDCE->hwndCurrent == Window->hSelf &&
if ( pDCE->hwndCurrent == Window->head.h &&
!(pDCE->DCXFlags & DCX_DCEEMPTY) )
{
if (!(pDCE->DCXFlags & DCX_CACHE)) /* owned or Class DCE*/
{
if (Window->Wnd->pcls->style & CS_CLASSDC) /* Test Class first */
if (Window->pcls->style & CS_CLASSDC) /* Test Class first */
{
if (pDCE->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) /* Class DCE*/
DceDeleteClipRgn(pDCE);
@@ -727,7 +716,7 @@ DceFreeWindowDCE(PWINDOW_OBJECT Window)
}
/* Do not change owner so thread can clean up! */
}
else if (Window->Wnd->pcls->style & CS_OWNDC) /* owned DCE*/
else if (Window->pcls->style & CS_OWNDC) /* owned DCE*/
{
pDCE = DceFreeDCE(pDCE, FALSE);
if (!pDCE) break;
@@ -750,7 +739,7 @@ DceFreeWindowDCE(PWINDOW_OBJECT Window)
* We should change this to DPRINT when ReactOS is more stable
* (for 1.0?).
*/
DPRINT1("[%p] GetDC() without ReleaseDC()!\n", Window->hSelf);
DPRINT1("[%p] GetDC() without ReleaseDC()!\n", Window->head.h);
DceReleaseDC(pDCE, FALSE);
}
pDCE->DCXFlags |= DCX_DCEEMPTY;
@@ -830,11 +819,11 @@ DceEmptyCache(VOID)
}
VOID FASTCALL
DceResetActiveDCEs(PWINDOW_OBJECT Window)
DceResetActiveDCEs(PWND Window)
{
DCE *pDCE;
PDC dc;
PWINDOW_OBJECT CurrentWindow;
PWND CurrentWindow;
INT DeltaX;
INT DeltaY;
PLIST_ENTRY pLE;
@@ -852,7 +841,7 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window)
if(pLE == &LEDce) break;
if (0 == (pDCE->DCXFlags & (DCX_DCEEMPTY|DCX_INDESTROY)))
{
if (Window->hSelf == pDCE->hwndCurrent)
if (Window->head.h == pDCE->hwndCurrent)
{
CurrentWindow = Window;
}
@@ -878,17 +867,17 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window)
{
if (pDCE->DCXFlags & DCX_WINDOW)
{
DeltaX = CurrentWindow->Wnd->rcWindow.left - dc->ptlDCOrig.x;
DeltaY = CurrentWindow->Wnd->rcWindow.top - dc->ptlDCOrig.y;
dc->ptlDCOrig.x = CurrentWindow->Wnd->rcWindow.left;
dc->ptlDCOrig.y = CurrentWindow->Wnd->rcWindow.top;
DeltaX = CurrentWindow->rcWindow.left - dc->ptlDCOrig.x;
DeltaY = CurrentWindow->rcWindow.top - dc->ptlDCOrig.y;
dc->ptlDCOrig.x = CurrentWindow->rcWindow.left;
dc->ptlDCOrig.y = CurrentWindow->rcWindow.top;
}
else
{
DeltaX = CurrentWindow->Wnd->rcClient.left - dc->ptlDCOrig.x;
DeltaY = CurrentWindow->Wnd->rcClient.top - dc->ptlDCOrig.y;
dc->ptlDCOrig.x = CurrentWindow->Wnd->rcClient.left;
dc->ptlDCOrig.y = CurrentWindow->Wnd->rcClient.top;
DeltaX = CurrentWindow->rcClient.left - dc->ptlDCOrig.x;
DeltaY = CurrentWindow->rcClient.top - dc->ptlDCOrig.y;
dc->ptlDCOrig.x = CurrentWindow->rcClient.left;
dc->ptlDCOrig.y = CurrentWindow->rcClient.top;
}
if (NULL != dc->rosdc.hClipRgn)
{
@@ -904,7 +893,7 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window)
DceUpdateVisRgn(pDCE, CurrentWindow, pDCE->DCXFlags);
if (Window->hSelf != pDCE->hwndCurrent)
if (Window->head.h != pDCE->hwndCurrent)
{
// IntEngWindowChanged(CurrentWindow, WOC_RGN_CLIENT);
// UserDerefObject(CurrentWindow);
@@ -943,7 +932,7 @@ IntWindowFromDC(HDC hDc)
}
INT FASTCALL
UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint)
UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
{
PDCE dce;
PLIST_ENTRY pLE;
@@ -975,7 +964,7 @@ UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint)
}
HDC FASTCALL
UserGetWindowDC(PWINDOW_OBJECT Wnd)
UserGetWindowDC(PWND Wnd)
{
return UserGetDCEx(Wnd, 0, DCX_USESTYLE | DCX_WINDOW);
}
@@ -984,7 +973,7 @@ HWND FASTCALL
UserGethWnd( HDC hdc, PWNDOBJ *pwndo)
{
PWNDGDI pWndgdi;
PWINDOW_OBJECT Wnd;
PWND Wnd;
HWND hWnd;
hWnd = IntWindowFromDC(hdc);
@@ -1004,7 +993,7 @@ UserGethWnd( HDC hdc, PWNDOBJ *pwndo)
HDC APIENTRY
NtUserGetDCEx(HWND hWnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
{
PWINDOW_OBJECT Wnd=NULL;
PWND Wnd=NULL;
DECLARE_RETURN(HDC);
DPRINT("Enter NtUserGetDCEx\n");
File diff suppressed because it is too large Load Diff
+178 -206
View File
@@ -33,10 +33,10 @@
#include <debug.h>
VOID FASTCALL
co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse);
co_IntPaintWindows(PWND Window, ULONG Flags, BOOL Recurse);
BOOL FASTCALL
IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse);
IntValidateParent(PWND Child, HRGN hValidateRgn, BOOL Recurse);
/* GLOBALS *******************************************************************/
@@ -55,7 +55,7 @@ IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse);
/* FUNCTIONS *****************************************************************/
BOOL FASTCALL
IntGetClientOrigin(PWINDOW_OBJECT Window OPTIONAL, LPPOINT Point)
IntGetClientOrigin(PWND Window OPTIONAL, LPPOINT Point)
{
Window = Window ? Window : UserGetWindowObject(IntGetDesktopWindow());
if (Window == NULL)
@@ -63,14 +63,14 @@ IntGetClientOrigin(PWINDOW_OBJECT Window OPTIONAL, LPPOINT Point)
Point->x = Point->y = 0;
return FALSE;
}
Point->x = Window->Wnd->rcClient.left;
Point->y = Window->Wnd->rcClient.top;
Point->x = Window->rcClient.left;
Point->y = Window->rcClient.top;
return TRUE;
}
BOOL FASTCALL
UserGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point)
UserGetClientOrigin(PWND Window, LPPOINT Point)
{
BOOL Ret;
POINT pt;
@@ -108,17 +108,17 @@ UserGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point)
* Check if we can activate the specified window.
*/
static
BOOL FASTCALL can_activate_window( PWINDOW_OBJECT Wnd OPTIONAL)
BOOL FASTCALL can_activate_window( PWND Wnd OPTIONAL)
{
LONG style;
if (!Wnd) return FALSE;
if (!Wnd->Wnd) return FALSE;
style = Wnd->Wnd->style;
style = Wnd->style;
if (!(style & WS_VISIBLE) &&
Wnd->pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
if ((style & WS_MINIMIZE) &&
Wnd->pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE;
return TRUE;
/* FIXME: This window could be disable because the child that closed
@@ -133,25 +133,22 @@ BOOL FASTCALL can_activate_window( PWINDOW_OBJECT Wnd OPTIONAL)
* Activates window other than pWnd.
*/
VOID FASTCALL
co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
co_WinPosActivateOtherWindow(PWND Wnd)
{
PWINDOW_OBJECT WndTo = NULL;
PWND WndTo = NULL;
HWND Fg;
USER_REFERENCE_ENTRY Ref;
PWND Wnd;
ASSERT_REFS_CO(Window);
ASSERT_REFS_CO(Wnd);
Wnd = Window->Wnd;
if (IntIsDesktopWindow(Window))
if (IntIsDesktopWindow(Wnd))
{
IntSetFocusMessageQueue(NULL);
return;
}
/* If this is popup window, try to activate the owner first. */
if ((Wnd->style & WS_POPUP) && (WndTo = Window->spwndOwner))
if ((Wnd->style & WS_POPUP) && (WndTo = Wnd->spwndOwner))
{
WndTo = UserGetAncestor( WndTo, GA_ROOT );
if (can_activate_window(WndTo)) goto done;
@@ -159,7 +156,7 @@ co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
/* Pick a next top-level window. */
/* FIXME: Search for non-tooltip windows first. */
WndTo = Window;
WndTo = Wnd;
for (;;)
{
if (!(WndTo = WndTo->spwndNext)) break;
@@ -171,7 +168,7 @@ done:
if (WndTo) UserRefObjectCo(WndTo, &Ref);
Fg = UserGetForegroundWindow();
if ((!Fg || Window->hSelf == Fg) && WndTo)//fixme: ok if WndTo is NULL??
if ((!Fg || Wnd->head.h == Fg) && WndTo)//fixme: ok if WndTo is NULL??
{
/* fixme: wine can pass WndTo=NULL to co_IntSetForegroundWindow. hmm */
if (co_IntSetForegroundWindow(WndTo))
@@ -190,7 +187,7 @@ done:
UINT
FASTCALL
co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
co_WinPosArrangeIconicWindows(PWND parent)
{
RECTL rectParent;
INT i, x, y, xspacing, yspacing;
@@ -209,24 +206,21 @@ co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
for( i = 0; List[i]; i++)
{
PWINDOW_OBJECT WndChild;
PWND ChildWnd;
PWND Child;
if (!(WndChild = UserGetWindowObject(List[i])))
if (!(Child = UserGetWindowObject(List[i])))
continue;
ChildWnd = WndChild->Wnd;
if((ChildWnd->style & WS_MINIMIZE) != 0 )
if((Child->style & WS_MINIMIZE) != 0 )
{
USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(WndChild, &Ref);
UserRefObjectCo(Child, &Ref);
co_WinPosSetWindowPos(WndChild, 0, x + UserGetSystemMetrics(SM_CXBORDER),
co_WinPosSetWindowPos(Child, 0, x + UserGetSystemMetrics(SM_CXBORDER),
y - yspacing - UserGetSystemMetrics(SM_CYBORDER)
, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
UserDerefObjectCo(WndChild);
UserDerefObjectCo(Child);
if (x <= rectParent.right - xspacing)
x += xspacing;
@@ -243,35 +237,34 @@ co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
static VOID FASTCALL
WinPosFindIconPos(PWINDOW_OBJECT Window, POINT *Pos)
WinPosFindIconPos(PWND Window, POINT *Pos)
{
/* FIXME */
}
VOID FASTCALL
WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect)
WinPosInitInternalPos(PWND Wnd, POINT *pt, RECTL *RestoreRect)
{
PWINDOW_OBJECT Parent;
PWND Parent;
UINT XInc, YInc;
PWND Wnd = Window->Wnd;
if (!Wnd->InternalPosInitialized)
{
RECTL WorkArea;
Parent = Window->spwndParent;
Parent = Wnd->spwndParent;
if(Parent)
{
if(IntIsDesktopWindow(Parent))
UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
else
WorkArea = Parent->Wnd->rcClient;
WorkArea = Parent->rcClient;
}
else
UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
Wnd->InternalPos.NormalRect = Window->Wnd->rcWindow;
IntGetWindowBorderMeasures(Window, &XInc, &YInc);
Wnd->InternalPos.NormalRect = Wnd->rcWindow;
IntGetWindowBorderMeasures(Wnd, &XInc, &YInc);
Wnd->InternalPos.MaxPos.x = WorkArea.left - XInc;
Wnd->InternalPos.MaxPos.y = WorkArea.top - YInc;
Wnd->InternalPos.IconPos.x = WorkArea.left;
@@ -294,25 +287,23 @@ WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect)
}
UINT FASTCALL
co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos)
{
POINT Size;
UINT SwpFlags = 0;
PWND Wnd;
ASSERT_REFS_CO(Window);
Wnd = Window->Wnd;
ASSERT_REFS_CO(Wnd);
Size.x = Wnd->rcWindow.left;
Size.y = Wnd->rcWindow.top;
WinPosInitInternalPos(Window, &Size, &Wnd->rcWindow);
WinPosInitInternalPos(Wnd, &Size, &Wnd->rcWindow);
if (co_HOOK_CallHooks( WH_CBT, HCBT_MINMAX, (WPARAM)Window->hSelf, ShowFlag))
if (co_HOOK_CallHooks( WH_CBT, HCBT_MINMAX, (WPARAM)Wnd->head.h, ShowFlag))
return SWP_NOSIZE | SWP_NOMOVE;
if (Wnd->style & WS_MINIMIZE)
{
if (!co_IntSendMessageNoWait(Window->hSelf, WM_QUERYOPEN, 0, 0))
if (!co_IntSendMessageNoWait(Wnd->head.h, WM_QUERYOPEN, 0, 0))
{
return(SWP_NOSIZE | SWP_NOMOVE);
}
@@ -324,17 +315,17 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
{
if (Wnd->style & WS_MAXIMIZE)
{
Window->state |= WINDOWOBJECT_RESTOREMAX;
Wnd->state2 |= WNDS2_MAXIMIZEBUTTONDOWN;
Wnd->style &= ~WS_MAXIMIZE;
}
else
{
Window->state &= ~WINDOWOBJECT_RESTOREMAX;
Wnd->state2 &= ~WNDS2_MAXIMIZEBUTTONDOWN;
}
co_UserRedrawWindow(Window, NULL, 0, RDW_VALIDATE | RDW_NOERASE |
co_UserRedrawWindow(Wnd, NULL, 0, RDW_VALIDATE | RDW_NOERASE |
RDW_NOINTERNALPAINT);
Wnd->style |= WS_MINIMIZE;
WinPosFindIconPos(Window, &Wnd->InternalPos.IconPos);
WinPosFindIconPos(Wnd, &Wnd->InternalPos.IconPos);
RECTL_vSetRect(NewPos, Wnd->InternalPos.IconPos.x, Wnd->InternalPos.IconPos.y,
UserGetSystemMetrics(SM_CXMINIMIZED),
UserGetSystemMetrics(SM_CYMINIMIZED));
@@ -344,7 +335,7 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
case SW_MAXIMIZE:
{
co_WinPosGetMinMaxInfo(Window, &Size, &Wnd->InternalPos.MaxPos,
co_WinPosGetMinMaxInfo(Wnd, &Size, &Wnd->InternalPos.MaxPos,
NULL, NULL);
DPRINT("Maximize: %d,%d %dx%d\n",
Wnd->InternalPos.MaxPos.x, Wnd->InternalPos.MaxPos.y, Size.x, Size.y);
@@ -363,9 +354,9 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
if (Wnd->style & WS_MINIMIZE)
{
Wnd->style &= ~WS_MINIMIZE;
if (Window->state & WINDOWOBJECT_RESTOREMAX)
if (Wnd->state2 & WNDS2_MAXIMIZEBUTTONDOWN)
{
co_WinPosGetMinMaxInfo(Window, &Size,
co_WinPosGetMinMaxInfo(Wnd, &Size,
&Wnd->InternalPos.MaxPos, NULL, NULL);
Wnd->style |= WS_MAXIMIZE;
RECTL_vSetRect(NewPos, Wnd->InternalPos.MaxPos.x,
@@ -467,22 +458,22 @@ UserAdjustWindowRectEx(LPRECT lpRect,
}
UINT FASTCALL
co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
co_WinPosGetMinMaxInfo(PWND Window, POINT* MaxSize, POINT* MaxPos,
POINT* MinTrack, POINT* MaxTrack)
{
MINMAXINFO MinMax;
PMONITOR monitor;
INT xinc, yinc;
LONG style = Window->Wnd->style;
LONG style = Window->style;
LONG adjustedStyle;
LONG exstyle = Window->Wnd->ExStyle;
LONG exstyle = Window->ExStyle;
RECT rc;
ASSERT_REFS_CO(Window);
/* Compute default values */
rc = Window->Wnd->rcWindow;
rc = Window->rcWindow;
MinMax.ptReserved.x = rc.left;
MinMax.ptReserved.y = rc.top;
@@ -491,9 +482,9 @@ co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
else
adjustedStyle = style;
if(Window->Wnd->spwndParent)
if(Window->spwndParent)
IntGetClientRect(Window->spwndParent, &rc);
UserAdjustWindowRectEx(&rc, adjustedStyle, ((style & WS_POPUP) && Window->Wnd->IDMenu), exstyle);
UserAdjustWindowRectEx(&rc, adjustedStyle, ((style & WS_POPUP) && Window->IDMenu), exstyle);
xinc = -rc.left;
yinc = -rc.top;
@@ -517,7 +508,7 @@ co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
//if (!EMPTYPOINT(win->max_pos)) MinMax.ptMaxPosition = win->max_pos;
co_IntSendMessage(Window->hSelf, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax);
co_IntSendMessage(Window->head.h, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax);
/* if the app didn't change the values, adapt them for the current monitor */
if ((monitor = IntGetPrimaryMonitor()))
@@ -603,15 +594,13 @@ FixClientRect(PRECTL ClientRect, PRECTL WindowRect)
static
LONG FASTCALL
co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
co_WinPosDoNCCALCSize(PWND Window, PWINDOWPOS WinPos,
RECT* WindowRect, RECT* ClientRect)
{
PWINDOW_OBJECT Parent;
PWND Parent;
UINT wvrFlags = 0;
PWND Wnd;
ASSERT_REFS_CO(Window);
Wnd = Window->Wnd;
/* Send WM_NCCALCSIZE message to get new client area */
if ((WinPos->flags & (SWP_FRAMECHANGED | SWP_NOSIZE)) != SWP_NOSIZE)
@@ -620,48 +609,48 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
WINDOWPOS winposCopy;
params.rgrc[0] = *WindowRect;
params.rgrc[1] = Window->Wnd->rcWindow;
params.rgrc[2] = Window->Wnd->rcClient;
params.rgrc[1] = Window->rcWindow;
params.rgrc[2] = Window->rcClient;
Parent = Window->spwndParent;
if (0 != (Wnd->style & WS_CHILD) && Parent)
if (0 != (Window->style & WS_CHILD) && Parent)
{
RECTL_vOffsetRect(&(params.rgrc[0]), - Parent->Wnd->rcClient.left,
- Parent->Wnd->rcClient.top);
RECTL_vOffsetRect(&(params.rgrc[1]), - Parent->Wnd->rcClient.left,
- Parent->Wnd->rcClient.top);
RECTL_vOffsetRect(&(params.rgrc[2]), - Parent->Wnd->rcClient.left,
- Parent->Wnd->rcClient.top);
RECTL_vOffsetRect(&(params.rgrc[0]), - Parent->rcClient.left,
- Parent->rcClient.top);
RECTL_vOffsetRect(&(params.rgrc[1]), - Parent->rcClient.left,
- Parent->rcClient.top);
RECTL_vOffsetRect(&(params.rgrc[2]), - Parent->rcClient.left,
- Parent->rcClient.top);
}
params.lppos = &winposCopy;
winposCopy = *WinPos;
wvrFlags = co_IntSendMessageNoWait(Window->hSelf, WM_NCCALCSIZE, TRUE, (LPARAM) &params);
wvrFlags = co_IntSendMessageNoWait(Window->head.h, WM_NCCALCSIZE, TRUE, (LPARAM) &params);
/* If the application send back garbage, ignore it */
if (params.rgrc[0].left <= params.rgrc[0].right &&
params.rgrc[0].top <= params.rgrc[0].bottom)
{
*ClientRect = params.rgrc[0];
if ((Wnd->style & WS_CHILD) && Parent)
if ((Window->style & WS_CHILD) && Parent)
{
RECTL_vOffsetRect(ClientRect, Parent->Wnd->rcClient.left,
Parent->Wnd->rcClient.top);
RECTL_vOffsetRect(ClientRect, Parent->rcClient.left,
Parent->rcClient.top);
}
FixClientRect(ClientRect, WindowRect);
}
/* FIXME: WVR_ALIGNxxx */
if (ClientRect->left != Wnd->rcClient.left ||
ClientRect->top != Wnd->rcClient.top)
if (ClientRect->left != Window->rcClient.left ||
ClientRect->top != Window->rcClient.top)
{
WinPos->flags &= ~SWP_NOCLIENTMOVE;
}
if ((ClientRect->right - ClientRect->left !=
Wnd->rcClient.right - Wnd->rcClient.left) ||
Window->rcClient.right - Window->rcClient.left) ||
(ClientRect->bottom - ClientRect->top !=
Wnd->rcClient.bottom - Wnd->rcClient.top))
Window->rcClient.bottom - Window->rcClient.top))
{
WinPos->flags &= ~SWP_NOCLIENTSIZE;
}
@@ -669,8 +658,8 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
else
{
if (! (WinPos->flags & SWP_NOMOVE)
&& (ClientRect->left != Wnd->rcClient.left ||
ClientRect->top != Wnd->rcClient.top))
&& (ClientRect->left != Window->rcClient.left ||
ClientRect->top != Window->rcClient.top))
{
WinPos->flags &= ~SWP_NOCLIENTMOVE;
}
@@ -681,24 +670,22 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
static
BOOL FASTCALL
co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window,
co_WinPosDoWinPosChanging(PWND Window,
PWINDOWPOS WinPos,
PRECTL WindowRect,
PRECTL ClientRect)
{
INT X, Y;
PWND Wnd;
ASSERT_REFS_CO(Window);
Wnd = Window->Wnd;
if (!(WinPos->flags & SWP_NOSENDCHANGING))
{
co_IntSendMessageNoWait(Window->hSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos);
co_IntSendMessageNoWait(Window->head.h, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos);
}
*WindowRect = Wnd->rcWindow;
*ClientRect = Wnd->rcClient;
*WindowRect = Window->rcWindow;
*ClientRect = Window->rcClient;
if (!(WinPos->flags & SWP_NOSIZE))
{
@@ -708,23 +695,23 @@ co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window,
if (!(WinPos->flags & SWP_NOMOVE))
{
PWINDOW_OBJECT Parent;
PWND Parent;
X = WinPos->x;
Y = WinPos->y;
Parent = Window->spwndParent;
if ((0 != (Wnd->style & WS_CHILD)) && Parent)
if ((0 != (Window->style & WS_CHILD)) && Parent)
{
X += Parent->Wnd->rcClient.left;
Y += Parent->Wnd->rcClient.top;
X += Parent->rcClient.left;
Y += Parent->rcClient.top;
}
WindowRect->left = X;
WindowRect->top = Y;
WindowRect->right += X - Wnd->rcWindow.left;
WindowRect->bottom += Y - Wnd->rcWindow.top;
WindowRect->right += X - Window->rcWindow.left;
WindowRect->bottom += Y - Window->rcWindow.top;
RECTL_vOffsetRect(ClientRect,
X - Wnd->rcWindow.left,
Y - Wnd->rcWindow.top);
X - Window->rcWindow.left,
Y - Window->rcWindow.top);
}
WinPos->flags |= SWP_NOCLIENTMOVE | SWP_NOCLIENTSIZE;
@@ -743,12 +730,12 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
HWND *List = NULL;
HWND Owner;
LONG Style;
PWINDOW_OBJECT Window ,DesktopWindow, ChildObject;
PWND Window ,DesktopWindow, ChildObject;
int i;
Window = UserGetWindowObject(hWnd);
Owner = Window->spwndOwner ? Window->spwndOwner->hSelf : NULL;
Style = Window->Wnd->style;
Owner = Window->spwndOwner ? Window->spwndOwner->head.h : NULL;
Style = Window->style;
if ((Style & WS_POPUP) && Owner)
{
@@ -771,7 +758,7 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
ChildObject = UserGetWindowObject(List[i]);
if (NULL != ChildObject)
{
if (0 == (ChildObject->Wnd->ExStyle & WS_EX_TOPMOST))
if (0 == (ChildObject->ExStyle & WS_EX_TOPMOST))
{
break;
}
@@ -800,7 +787,7 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
{
for (i = 0; List[i]; i++)
{
PWINDOW_OBJECT Wnd;
PWND Wnd;
if (List[i] == hWnd)
break;
@@ -808,7 +795,7 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
if (!(Wnd = UserGetWindowObject(List[i])))
continue;
if (Wnd->Wnd->style & WS_POPUP && Wnd->spwndOwner == Window)
if (Wnd->style & WS_POPUP && Wnd->spwndOwner == Window)
{
USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(Wnd, &Ref);
@@ -835,21 +822,21 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
*/
static
VOID FASTCALL
WinPosInternalMoveWindow(PWINDOW_OBJECT Window, INT MoveX, INT MoveY)
WinPosInternalMoveWindow(PWND Window, INT MoveX, INT MoveY)
{
PWINDOW_OBJECT Child;
PWND Child;
ASSERT(Window != Window->spwndChild);
Window->Wnd->rcWindow.left += MoveX;
Window->Wnd->rcWindow.right += MoveX;
Window->Wnd->rcWindow.top += MoveY;
Window->Wnd->rcWindow.bottom += MoveY;
Window->rcWindow.left += MoveX;
Window->rcWindow.right += MoveX;
Window->rcWindow.top += MoveY;
Window->rcWindow.bottom += MoveY;
Window->Wnd->rcClient.left += MoveX;
Window->Wnd->rcClient.right += MoveX;
Window->Wnd->rcClient.top += MoveY;
Window->Wnd->rcClient.bottom += MoveY;
Window->rcClient.left += MoveX;
Window->rcClient.right += MoveX;
Window->rcClient.top += MoveY;
Window->rcClient.bottom += MoveY;
for(Child = Window->spwndChild; Child; Child = Child->spwndNext)
{
@@ -864,12 +851,8 @@ WinPosInternalMoveWindow(PWINDOW_OBJECT Window, INT MoveX, INT MoveY)
*/
static
BOOL FASTCALL
WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
WinPosFixupFlags(WINDOWPOS *WinPos, PWND Wnd)
{
PWND Wnd = Window->Wnd;
if (!Wnd) return FALSE;
if (Wnd->style & WS_VISIBLE)
{
WinPos->flags &= ~SWP_SHOWWINDOW;
@@ -945,7 +928,7 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
&& HWND_NOTOPMOST != WinPos->hwndInsertAfter
&& HWND_BOTTOM != WinPos->hwndInsertAfter)
{
PWINDOW_OBJECT InsAfterWnd, Parent = Window->spwndParent;
PWND InsAfterWnd, Parent = Wnd->spwndParent;
InsAfterWnd = UserGetWindowObject(WinPos->hwndInsertAfter);
@@ -961,7 +944,7 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
* itself.
*/
if ((WinPos->hwnd == WinPos->hwndInsertAfter) ||
((InsAfterWnd->spwndNext) && (WinPos->hwnd == InsAfterWnd->spwndNext->hSelf)))
((InsAfterWnd->spwndNext) && (WinPos->hwnd == InsAfterWnd->spwndNext->head.h)))
{
WinPos->flags |= SWP_NOZORDER;
}
@@ -975,7 +958,7 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
/* x and y are always screen relative */
BOOLEAN FASTCALL
co_WinPosSetWindowPos(
PWINDOW_OBJECT Window,
PWND Window,
HWND WndInsertAfter,
INT x,
INT y,
@@ -999,24 +982,22 @@ co_WinPosSetWindowPos(
HDC Dc;
RECTL CopyRect;
RECTL TempRect;
PWINDOW_OBJECT Ancestor;
PWND Ancestor;
ASSERT_REFS_CO(Window);
if (!Window->Wnd) return FALSE;
/* FIXME: Get current active window from active queue. */
/*
* Only allow CSRSS to mess with the desktop window
*/
if ( Window->hSelf == IntGetDesktopWindow() &&
Window->pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
if ( Window->head.h == IntGetDesktopWindow() &&
Window->head.pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
{
return FALSE;
}
WinPos.hwnd = Window->hSelf;
WinPos.hwnd = Window->head.h;
WinPos.hwndInsertAfter = WndInsertAfter;
WinPos.x = x;
WinPos.y = y;
@@ -1043,7 +1024,7 @@ co_WinPosSetWindowPos(
Ancestor = UserGetAncestor(Window, GA_PARENT);
if ( (WinPos.flags & (SWP_NOZORDER | SWP_HIDEWINDOW | SWP_SHOWWINDOW)) !=
SWP_NOZORDER &&
Ancestor && Ancestor->hSelf == IntGetDesktopWindow() )
Ancestor && Ancestor->head.h == IntGetDesktopWindow() )
{
WinPos.hwndInsertAfter = WinPosDoOwnedPopups(WinPos.hwnd, WinPos.hwndInsertAfter);
}
@@ -1070,7 +1051,7 @@ co_WinPosSetWindowPos(
else if(VisRgn)
{
RGNOBJAPI_Unlock(VisRgn);
NtGdiOffsetRgn(VisBefore, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
NtGdiOffsetRgn(VisBefore, -Window->rcWindow.left, -Window->rcWindow.top);
}
}
}
@@ -1085,8 +1066,8 @@ co_WinPosSetWindowPos(
IntLinkHwnd(Window, WndInsertAfter);
}
OldWindowRect = Window->Wnd->rcWindow;
OldClientRect = Window->Wnd->rcClient;
OldWindowRect = Window->rcWindow;
OldClientRect = Window->rcClient;
if (OldClientRect.bottom - OldClientRect.top ==
NewClientRect.bottom - NewClientRect.top)
@@ -1110,8 +1091,8 @@ co_WinPosSetWindowPos(
NewClientRect.top - OldClientRect.top);
}
Window->Wnd->rcWindow = NewWindowRect;
Window->Wnd->rcClient = NewClientRect;
Window->rcWindow = NewWindowRect;
Window->rcClient = NewClientRect;
if (!(WinPos.flags & SWP_SHOWWINDOW) && (WinPos.flags & SWP_HIDEWINDOW))
{
@@ -1121,21 +1102,21 @@ co_WinPosSetWindowPos(
0,
RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_ALLCHILDREN);
if ((Window->Wnd->style & WS_VISIBLE) &&
if ((Window->style & WS_VISIBLE) &&
Window->spwndParent == UserGetDesktopWindow())
{
co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM)Window->hSelf);
co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM)Window->head.h);
}
Window->Wnd->style &= ~WS_VISIBLE;
Window->style &= ~WS_VISIBLE;
}
else if (WinPos.flags & SWP_SHOWWINDOW)
{
if (!(Window->Wnd->style & WS_VISIBLE) &&
if (!(Window->style & WS_VISIBLE) &&
Window->spwndParent == UserGetDesktopWindow() )
{
co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)Window->hSelf);
co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)Window->head.h);
}
Window->Wnd->style |= WS_VISIBLE;
Window->style |= WS_VISIBLE;
}
if (Window->hrgnUpdate != NULL && Window->hrgnUpdate != (HRGN)1)
@@ -1164,7 +1145,7 @@ co_WinPosSetWindowPos(
else if(VisRgn)
{
RGNOBJAPI_Unlock(VisRgn);
NtGdiOffsetRgn(VisAfter, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
NtGdiOffsetRgn(VisAfter, -Window->rcWindow.left, -Window->rcWindow.top);
}
/*
@@ -1178,7 +1159,7 @@ co_WinPosSetWindowPos(
VisAfter != NULL &&
!(WinPos.flags & SWP_NOCOPYBITS) &&
((WinPos.flags & SWP_NOSIZE) || !(WvrFlags & WVR_REDRAW)) &&
!(Window->Wnd->ExStyle & WS_EX_TRANSPARENT) )
!(Window->ExStyle & WS_EX_TRANSPARENT) )
{
CopyRgn = IntSysCreateRectRgn(0, 0, 0, 0);
RgnType = NtGdiCombineRgn(CopyRgn, VisAfter, VisBefore, RGN_AND);
@@ -1296,14 +1277,14 @@ co_WinPosSetWindowPos(
GreDeleteObject(DirtyRgn);
*/
PWINDOW_OBJECT Parent = Window->spwndParent;
PWND Parent = Window->spwndParent;
NtGdiOffsetRgn( DirtyRgn,
Window->Wnd->rcWindow.left,
Window->Wnd->rcWindow.top);
if ( (Window->Wnd->style & WS_CHILD) &&
Window->rcWindow.left,
Window->rcWindow.top);
if ( (Window->style & WS_CHILD) &&
(Parent) &&
!(Parent->Wnd->style & WS_CLIPCHILDREN))
!(Parent->style & WS_CLIPCHILDREN))
{
IntInvalidateWindows( Parent,
DirtyRgn,
@@ -1354,7 +1335,7 @@ co_WinPosSetWindowPos(
if (!(WinPos.flags & SWP_NOACTIVATE))
{
if ((Window->Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
if ((Window->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
{
co_IntSendMessageNoWait(WinPos.hwnd, WM_CHILDACTIVATE, 0, 0);
}
@@ -1381,14 +1362,14 @@ co_WinPosSetWindowPos(
}
LRESULT FASTCALL
co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECT* WindowRect, RECT* ClientRect)
co_WinPosGetNonClientSize(PWND Window, RECT* WindowRect, RECT* ClientRect)
{
LRESULT Result;
ASSERT_REFS_CO(Window);
*ClientRect = *WindowRect;
Result = co_IntSendMessageNoWait(Window->hSelf, WM_NCCALCSIZE, FALSE, (LPARAM) ClientRect);
Result = co_IntSendMessageNoWait(Window->head.h, WM_NCCALCSIZE, FALSE, (LPARAM) ClientRect);
FixClientRect(ClientRect, WindowRect);
@@ -1396,12 +1377,11 @@ co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECT* WindowRect, RECT* ClientR
}
void FASTCALL
co_WinPosSendSizeMove(PWINDOW_OBJECT Window)
co_WinPosSendSizeMove(PWND Wnd)
{
WPARAM wParam = SIZE_RESTORED;
PWND Wnd = Window->Wnd;
Window->state &= ~WINDOWOBJECT_NEED_SIZE;
Wnd->state &= ~WNDS_SENDSIZEMOVEMSGS;
if (Wnd->style & WS_MAXIMIZE)
{
wParam = SIZE_MAXIMIZED;
@@ -1411,31 +1391,27 @@ co_WinPosSendSizeMove(PWINDOW_OBJECT Window)
wParam = SIZE_MINIMIZED;
}
co_IntSendMessageNoWait(Window->hSelf, WM_SIZE, wParam,
co_IntSendMessageNoWait(Wnd->head.h, WM_SIZE, wParam,
MAKELONG(Wnd->rcClient.right -
Wnd->rcClient.left,
Wnd->rcClient.bottom -
Wnd->rcClient.top));
co_IntSendMessageNoWait(Window->hSelf, WM_MOVE, 0,
co_IntSendMessageNoWait(Wnd->head.h, WM_MOVE, 0,
MAKELONG(Wnd->rcClient.left,
Wnd->rcClient.top));
IntEngWindowChanged(Window, WOC_RGN_CLIENT);
IntEngWindowChanged(Wnd, WOC_RGN_CLIENT);
}
BOOLEAN FASTCALL
co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
co_WinPosShowWindow(PWND Wnd, INT Cmd)
{
BOOLEAN WasVisible;
UINT Swp = 0;
RECTL NewPos;
BOOLEAN ShowFlag;
// HRGN VisibleRgn;
PWND Wnd;
ASSERT_REFS_CO(Window);
Wnd = Window->Wnd;
if (!Wnd) return FALSE;
ASSERT_REFS_CO(Wnd);
WasVisible = (Wnd->style & WS_VISIBLE) != 0;
@@ -1448,7 +1424,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
return(FALSE);
}
Swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE;
if (Window->hSelf != UserGetActiveWindow())
if (Wnd->head.h != UserGetActiveWindow())
Swp |= SWP_NOACTIVATE | SWP_NOZORDER;
break;
}
@@ -1464,7 +1440,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
Swp |= SWP_NOACTIVATE;
if (!(Wnd->style & WS_MINIMIZE))
{
Swp |= co_WinPosMinMaximize(Window, SW_MINIMIZE, &NewPos) |
Swp |= co_WinPosMinMaximize(Wnd, SW_MINIMIZE, &NewPos) |
SWP_FRAMECHANGED;
}
else
@@ -1483,7 +1459,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
Swp |= SWP_SHOWWINDOW;
if (!(Wnd->style & WS_MAXIMIZE))
{
Swp |= co_WinPosMinMaximize(Window, SW_MAXIMIZE, &NewPos) |
Swp |= co_WinPosMinMaximize(Wnd, SW_MAXIMIZE, &NewPos) |
SWP_FRAMECHANGED;
}
else
@@ -1516,7 +1492,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
Swp |= SWP_SHOWWINDOW;
if (Wnd->style & (WS_MINIMIZE | WS_MAXIMIZE))
{
Swp |= co_WinPosMinMaximize(Window, SW_RESTORE, &NewPos) |
Swp |= co_WinPosMinMaximize(Wnd, SW_RESTORE, &NewPos) |
SWP_FRAMECHANGED;
}
else
@@ -1534,7 +1510,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
if (ShowFlag != WasVisible)
{
co_IntSendMessageNoWait(Window->hSelf, WM_SHOWWINDOW, ShowFlag, 0);
co_IntSendMessageNoWait(Wnd->head.h, WM_SHOWWINDOW, ShowFlag, 0);
}
/* We can't activate a child window */
@@ -1544,22 +1520,22 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
Swp |= SWP_NOACTIVATE | SWP_NOZORDER;
}
co_WinPosSetWindowPos(Window, 0 != (Wnd->ExStyle & WS_EX_TOPMOST)
co_WinPosSetWindowPos(Wnd, 0 != (Wnd->ExStyle & WS_EX_TOPMOST)
? HWND_TOPMOST : HWND_TOP,
NewPos.left, NewPos.top, NewPos.right, NewPos.bottom, LOWORD(Swp));
if ((Cmd == SW_HIDE) || (Cmd == SW_MINIMIZE))
{
PWINDOW_OBJECT ThreadFocusWindow;
PWND ThreadFocusWindow;
/* FIXME: This will cause the window to be activated irrespective
* of whether it is owned by the same thread. Has to be done
* asynchronously.
*/
if (Window->hSelf == UserGetActiveWindow())
if (Wnd->head.h == UserGetActiveWindow())
{
co_WinPosActivateOtherWindow(Window);
co_WinPosActivateOtherWindow(Wnd);
}
@@ -1567,20 +1543,20 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
ThreadFocusWindow = UserGetWindowObject(IntGetThreadFocusWindow());
/* Revert focus to parent */
if (ThreadFocusWindow && (Window == ThreadFocusWindow ||
IntIsChildWindow(Window, ThreadFocusWindow)))
if (ThreadFocusWindow && (Wnd == ThreadFocusWindow ||
IntIsChildWindow(Wnd, ThreadFocusWindow)))
{
//faxme: as long as we have ref on Window, we also, indirectly, have ref on parent...
co_UserSetFocus(Window->spwndParent);
co_UserSetFocus(Wnd->spwndParent);
}
}
/* FIXME: Check for window destruction. */
if ((Window->state & WINDOWOBJECT_NEED_SIZE) &&
!(Window->state & WINDOWSTATUS_DESTROYING))
if ((Wnd->state & WNDS_SENDSIZEMOVEMSGS) &&
!(Wnd->state2 & WNDS2_INDESTROY))
{
co_WinPosSendSizeMove(Window);
co_WinPosSendSizeMove(Wnd);
}
/* Activate the window if activation is not requested and the window is not minimized */
@@ -1597,9 +1573,9 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
#if 0
/* find child of 'parent' that contains the given point (in parent-relative coords) */
PWINDOW_OBJECT child_window_from_point(PWINDOW_OBJECT parent, int x, int y )
PWND child_window_from_point(PWND parent, int x, int y )
{
PWINDOW_OBJECT Wnd;// = parent->spwndChild;
PWND Wnd;// = parent->spwndChild;
// LIST_FOR_EACH_ENTRY( Wnd, &parent->children, struct window, entry )
for (Wnd = parent->spwndChild; Wnd; Wnd = Wnd->spwndNext)
@@ -1627,15 +1603,14 @@ Caller must dereference the "returned" Window
static
VOID FASTCALL
co_WinPosSearchChildren(
PWINDOW_OBJECT ScopeWin,
PWND ScopeWin,
PUSER_MESSAGE_QUEUE OnlyHitTests,
POINT *Point,
PWINDOW_OBJECT* Window,
PWND* Window,
USHORT *HitTest
)
{
PWINDOW_OBJECT Current;
PWND CurrentWnd;
PWND Current;
HWND *List, *phWnd;
USER_REFERENCE_ENTRY Ref;
@@ -1647,14 +1622,13 @@ co_WinPosSearchChildren(
{
if (!(Current = UserGetWindowObject(*phWnd)))
continue;
CurrentWnd = Current->Wnd;
if (!(CurrentWnd->style & WS_VISIBLE))
if (!(Current->style & WS_VISIBLE))
{
continue;
}
if ((CurrentWnd->style & (WS_POPUP | WS_CHILD | WS_DISABLED)) ==
if ((Current->style & (WS_POPUP | WS_CHILD | WS_DISABLED)) ==
(WS_CHILD | WS_DISABLED))
{
continue;
@@ -1669,13 +1643,13 @@ co_WinPosSearchChildren(
*Window = Current;
UserReferenceObject(*Window);
if (CurrentWnd->style & WS_MINIMIZE)
if (Current->style & WS_MINIMIZE)
{
*HitTest = HTCAPTION;
break;
}
if (CurrentWnd->style & WS_DISABLED)
if (Current->style & WS_DISABLED)
{
*HitTest = HTERROR;
break;
@@ -1683,9 +1657,9 @@ co_WinPosSearchChildren(
UserRefObjectCo(Current, &Ref);
if (OnlyHitTests && (Current->pti->MessageQueue == OnlyHitTests))
if (OnlyHitTests && (Current->head.pti->MessageQueue == OnlyHitTests))
{
*HitTest = co_IntSendMessage(Current->hSelf, WM_NCHITTEST, 0,
*HitTest = co_IntSendMessage(Current->head.h, WM_NCHITTEST, 0,
MAKELONG(Point->x, Point->y));
if ((*HitTest) == (USHORT)HTTRANSPARENT)
{
@@ -1696,10 +1670,10 @@ co_WinPosSearchChildren(
else
*HitTest = HTCLIENT;
if (Point->x >= CurrentWnd->rcClient.left &&
Point->x < CurrentWnd->rcClient.right &&
Point->y >= CurrentWnd->rcClient.top &&
Point->y < CurrentWnd->rcClient.bottom)
if (Point->x >= Current->rcClient.left &&
Point->x < Current->rcClient.right &&
Point->y >= Current->rcClient.top &&
Point->y < Current->rcClient.bottom)
{
co_WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest);
}
@@ -1714,11 +1688,11 @@ co_WinPosSearchChildren(
/* wine: WINPOS_WindowFromPoint */
USHORT FASTCALL
co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
PWINDOW_OBJECT* Window)
co_WinPosWindowFromPoint(PWND ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
PWND* Window)
{
HWND DesktopWindowHandle;
PWINDOW_OBJECT DesktopWindow;
PWND DesktopWindow;
POINT Point = *WinPoint;
USHORT HitTest;
@@ -1732,18 +1706,18 @@ co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTes
return(HTERROR);
}
if (ScopeWin->Wnd->style & WS_DISABLED)
if (ScopeWin->style & WS_DISABLED)
{
return(HTERROR);
}
/* Translate the point to the space of the scope window. */
DesktopWindowHandle = IntGetDesktopWindow();
if((DesktopWindowHandle != ScopeWin->hSelf) &&
if((DesktopWindowHandle != ScopeWin->head.h) &&
(DesktopWindow = UserGetWindowObject(DesktopWindowHandle)))
{
Point.x += ScopeWin->Wnd->rcClient.left - DesktopWindow->Wnd->rcClient.left;
Point.y += ScopeWin->Wnd->rcClient.top - DesktopWindow->Wnd->rcClient.top;
Point.x += ScopeWin->rcClient.left - DesktopWindow->rcClient.left;
Point.y += ScopeWin->rcClient.top - DesktopWindow->rcClient.top;
}
HitTest = HTNOWHERE;
@@ -1761,8 +1735,7 @@ NtUserGetMinMaxInfo(
BOOL SendMessage)
{
POINT Size;
PWINDOW_OBJECT Window = NULL;
PWND Wnd;
PWND Window = NULL;
MINMAXINFO SafeMinMax;
NTSTATUS Status;
BOOL ret;
@@ -1778,12 +1751,11 @@ NtUserGetMinMaxInfo(
}
UserRefObjectCo(Window, &Ref);
Wnd = Window->Wnd;
Size.x = Window->Wnd->rcWindow.left;
Size.y = Window->Wnd->rcWindow.top;
Size.x = Window->rcWindow.left;
Size.y = Window->rcWindow.top;
WinPosInitInternalPos(Window, &Size,
&Wnd->rcWindow);
&Window->rcWindow);
co_WinPosGetMinMaxInfo(Window, &SafeMinMax.ptMaxSize, &SafeMinMax.ptMaxPosition,
&SafeMinMax.ptMinTrackSize, &SafeMinMax.ptMaxTrackSize);
@@ -1357,7 +1357,7 @@ IntChangeDisplaySettings(
{
WCHAR szBuffer[MAX_DRIVER_NAME];
PDC DC;
PWINDOW_OBJECT Wnd=NULL;
PWND Wnd=NULL;
HWND hWnd;
HDC hDC;
@@ -1478,7 +1478,7 @@ GetDisplayNumberFromDeviceName(
if (pDeviceName == NULL || pDeviceName->Length == 0)
{
PWINDOW_OBJECT DesktopObject;
PWND DesktopObject;
HDC DesktopHDC;
PDC pDC;
@@ -752,7 +752,7 @@ IntAnimatePalette(HPALETTE hPal,
UINT pal_entries;
HDC hDC;
PDC dc;
PWINDOW_OBJECT Wnd;
PWND Wnd;
const PALETTEENTRY *pptr = PaletteColors;
palPtr = (PPALETTE)PALETTE_LockPalette(hPal);
@@ -1071,7 +1071,7 @@ BOOL
APIENTRY
NtGdiUpdateColors(HDC hDC)
{
PWINDOW_OBJECT Wnd;
PWND Wnd;
BOOL calledFromUser, ret;
USER_REFERENCE_ENTRY Ref;