From 781981aa5f324a71e41c5329388af9e33125cdad Mon Sep 17 00:00:00 2001 From: Gunnar Dalsnes Date: Tue, 6 Sep 2005 11:00:27 +0000 Subject: [PATCH] naming changes: -remove annying "Object" from variables. prepend handles with "h" instead. -rename window->Self -> Window->hSelf svn path=/trunk/; revision=17695 --- reactos/subsys/win32k/include/window.h | 2 +- reactos/subsys/win32k/ntuser/caret.c | 12 +- reactos/subsys/win32k/ntuser/class.c | 117 ++- reactos/subsys/win32k/ntuser/focus.c | 14 +- reactos/subsys/win32k/ntuser/hotkey.c | 2 +- reactos/subsys/win32k/ntuser/menu.c | 22 +- reactos/subsys/win32k/ntuser/message.c | 10 +- reactos/subsys/win32k/ntuser/msgqueue.c | 8 +- reactos/subsys/win32k/ntuser/painting.c | 4 +- reactos/subsys/win32k/ntuser/scrollbar.c | 8 +- reactos/subsys/win32k/ntuser/windc.c | 22 +- reactos/subsys/win32k/ntuser/window.c | 883 +++++++++++------------ reactos/subsys/win32k/ntuser/winpos.c | 137 ++-- 13 files changed, 613 insertions(+), 628 deletions(-) diff --git a/reactos/subsys/win32k/include/window.h b/reactos/subsys/win32k/include/window.h index 9ff75cd6f29..c0dd4130dcb 100644 --- a/reactos/subsys/win32k/include/window.h +++ b/reactos/subsys/win32k/include/window.h @@ -53,7 +53,7 @@ typedef struct _WINDOW_OBJECT /* Position of the window's client area. */ RECT ClientRect; /* Handle for the window. */ - HANDLE Self; + HWND hSelf; /* Window flags. */ ULONG Flags; /* Window menu handle or window id */ diff --git a/reactos/subsys/win32k/ntuser/caret.c b/reactos/subsys/win32k/ntuser/caret.c index f769b318931..47c5fc51cbb 100644 --- a/reactos/subsys/win32k/ntuser/caret.c +++ b/reactos/subsys/win32k/ntuser/caret.c @@ -334,7 +334,7 @@ BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT WindowObject) ThreadQueue = (PUSER_MESSAGE_QUEUE)PsGetWin32Thread()->MessageQueue; - if(ThreadQueue->CaretInfo->hWnd != WindowObject->Self) + if(ThreadQueue->CaretInfo->hWnd != WindowObject->hSelf) { SetLastWin32Error(ERROR_ACCESS_DENIED); return FALSE; @@ -342,7 +342,7 @@ BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT WindowObject) if(ThreadQueue->CaretInfo->Visible) { - IntKillTimer(WindowObject->Self, IDCARETTIMER, TRUE); + IntKillTimer(WindowObject->hSelf, IDCARETTIMER, TRUE); co_IntHideCaret(ThreadQueue->CaretInfo); ThreadQueue->CaretInfo->Visible = 0; @@ -384,11 +384,11 @@ CLEANUP: } -BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT WindowObject) +BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT Window) { PUSER_MESSAGE_QUEUE ThreadQueue; - if(WindowObject->OwnerThread != PsGetCurrentThread()) + if(Window->OwnerThread != PsGetCurrentThread()) { SetLastWin32Error(ERROR_ACCESS_DENIED); return FALSE; @@ -396,7 +396,7 @@ BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT WindowObject) ThreadQueue = (PUSER_MESSAGE_QUEUE)PsGetWin32Thread()->MessageQueue; - if(ThreadQueue->CaretInfo->hWnd != WindowObject->Self) + if(ThreadQueue->CaretInfo->hWnd != Window->hSelf) { SetLastWin32Error(ERROR_ACCESS_DENIED); return FALSE; @@ -409,7 +409,7 @@ BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT WindowObject) { co_IntSendMessage(ThreadQueue->CaretInfo->hWnd, WM_SYSTIMER, IDCARETTIMER, 0); } - IntSetTimer(WindowObject->Self, IDCARETTIMER, IntGetCaretBlinkTime(), NULL, TRUE); + IntSetTimer(Window->hSelf, IDCARETTIMER, IntGetCaretBlinkTime(), NULL, TRUE); } return TRUE; diff --git a/reactos/subsys/win32k/ntuser/class.c b/reactos/subsys/win32k/ntuser/class.c index 71bcdbac474..8fea7722411 100644 --- a/reactos/subsys/win32k/ntuser/class.c +++ b/reactos/subsys/win32k/ntuser/class.c @@ -471,19 +471,19 @@ CLEANUP: } ULONG FASTCALL -IntGetClassLong(struct _WINDOW_OBJECT *WindowObject, ULONG Offset, BOOL Ansi) +IntGetClassLong(struct _WINDOW_OBJECT *Window, ULONG Offset, BOOL Ansi) { LONG Ret; if ((int)Offset >= 0) { - DPRINT("GetClassLong(%x, %d)\n", WindowObject->Self, Offset); - if ((Offset + sizeof(LONG)) > WindowObject->Class->cbClsExtra) + DPRINT("GetClassLong(%x, %d)\n", Window->hSelf, Offset); + if ((Offset + sizeof(LONG)) > Window->Class->cbClsExtra) { SetLastWin32Error(ERROR_INVALID_PARAMETER); return 0; } - Ret = *((LONG *)(WindowObject->Class->ExtraData + Offset)); + Ret = *((LONG *)(Window->Class->ExtraData + Offset)); DPRINT("Result: %x\n", Ret); return Ret; } @@ -491,40 +491,40 @@ IntGetClassLong(struct _WINDOW_OBJECT *WindowObject, ULONG Offset, BOOL Ansi) switch (Offset) { case GCL_CBWNDEXTRA: - Ret = WindowObject->Class->cbWndExtra; + Ret = Window->Class->cbWndExtra; break; case GCL_CBCLSEXTRA: - Ret = WindowObject->Class->cbClsExtra; + Ret = Window->Class->cbClsExtra; break; case GCL_HBRBACKGROUND: - Ret = (ULONG)WindowObject->Class->hbrBackground; + Ret = (ULONG)Window->Class->hbrBackground; break; case GCL_HCURSOR: - Ret = (ULONG)WindowObject->Class->hCursor; + Ret = (ULONG)Window->Class->hCursor; break; case GCL_HICON: - Ret = (ULONG)WindowObject->Class->hIcon; + Ret = (ULONG)Window->Class->hIcon; break; case GCL_HICONSM: - Ret = (ULONG)WindowObject->Class->hIconSm; + Ret = (ULONG)Window->Class->hIconSm; break; case GCL_HMODULE: - Ret = (ULONG)WindowObject->Class->hInstance; + Ret = (ULONG)Window->Class->hInstance; break; case GCL_MENUNAME: - Ret = (ULONG)WindowObject->Class->lpszMenuName.Buffer; + Ret = (ULONG)Window->Class->lpszMenuName.Buffer; break; case GCL_STYLE: - Ret = WindowObject->Class->style; + Ret = Window->Class->style; break; case GCL_WNDPROC: if (Ansi) { - Ret = (ULONG)WindowObject->Class->lpfnWndProcA; + Ret = (ULONG)Window->Class->lpfnWndProcA; } else { - Ret = (ULONG)WindowObject->Class->lpfnWndProcW; + Ret = (ULONG)Window->Class->lpfnWndProcW; } break; default: @@ -537,21 +537,21 @@ IntGetClassLong(struct _WINDOW_OBJECT *WindowObject, ULONG Offset, BOOL Ansi) DWORD STDCALL NtUserGetClassLong(HWND hWnd, DWORD Offset, BOOL Ansi) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; LONG Ret; DECLARE_RETURN(DWORD); DPRINT("Enter NtUserGetClassLong\n"); UserEnterExclusive(); - WindowObject = IntGetWindowObject(hWnd); - if (WindowObject == NULL) + Window = IntGetWindowObject(hWnd); + if (Window == NULL) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN(0); } - Ret = IntGetClassLong(WindowObject, Offset, Ansi); - IntReleaseWindowObject(WindowObject); + Ret = IntGetClassLong(Window, Offset, Ansi); + IntReleaseWindowObject(Window); RETURN(Ret); CLEANUP: @@ -561,44 +561,44 @@ CLEANUP: } void FASTCALL -co_IntSetClassLong(PWINDOW_OBJECT WindowObject, ULONG Offset, LONG dwNewLong, BOOL Ansi) +co_IntSetClassLong(PWINDOW_OBJECT Window, ULONG Offset, LONG dwNewLong, BOOL Ansi) { PWINDOW_OBJECT Parent, Owner; if ((int)Offset >= 0) { - DPRINT("SetClassLong(%x, %d, %x)\n", WindowObject->Self, Offset, dwNewLong); - if ((Offset + sizeof(LONG)) > WindowObject->Class->cbClsExtra) + DPRINT("SetClassLong(%x, %d, %x)\n", Window->hSelf, Offset, dwNewLong); + if ((Offset + sizeof(LONG)) > Window->Class->cbClsExtra) { SetLastWin32Error(ERROR_INVALID_PARAMETER); return; } - *((LONG *)(WindowObject->Class->ExtraData + Offset)) = dwNewLong; + *((LONG *)(Window->Class->ExtraData + Offset)) = dwNewLong; return; } switch (Offset) { case GCL_CBWNDEXTRA: - WindowObject->Class->cbWndExtra = dwNewLong; + Window->Class->cbWndExtra = dwNewLong; break; case GCL_CBCLSEXTRA: - WindowObject->Class->cbClsExtra = dwNewLong; + Window->Class->cbClsExtra = dwNewLong; break; case GCL_HBRBACKGROUND: - WindowObject->Class->hbrBackground = (HBRUSH)dwNewLong; + Window->Class->hbrBackground = (HBRUSH)dwNewLong; break; case GCL_HCURSOR: - WindowObject->Class->hCursor = (HCURSOR)dwNewLong; + Window->Class->hCursor = (HCURSOR)dwNewLong; break; case GCL_HICON: - WindowObject->Class->hIcon = (HICON)dwNewLong; - Owner = IntGetOwner(WindowObject); - Parent = IntGetParent(WindowObject); + Window->Class->hIcon = (HICON)dwNewLong; + Owner = IntGetOwner(Window); + Parent = IntGetParent(Window); if ((!Owner) && (!Parent)) { - co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) WindowObject->Self); + co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) Window->hSelf); } if (Parent) @@ -614,43 +614,43 @@ co_IntSetClassLong(PWINDOW_OBJECT WindowObject, ULONG Offset, LONG dwNewLong, BO break; case GCL_HICONSM: - WindowObject->Class->hIconSm = (HICON)dwNewLong; + Window->Class->hIconSm = (HICON)dwNewLong; break; case GCL_HMODULE: - WindowObject->Class->hInstance = (HINSTANCE)dwNewLong; + Window->Class->hInstance = (HINSTANCE)dwNewLong; break; case GCL_MENUNAME: - if (WindowObject->Class->lpszMenuName.MaximumLength) - RtlFreeUnicodeString(&WindowObject->Class->lpszMenuName); + if (Window->Class->lpszMenuName.MaximumLength) + RtlFreeUnicodeString(&Window->Class->lpszMenuName); if (!IS_INTRESOURCE(dwNewLong)) { - WindowObject->Class->lpszMenuName.Length = - WindowObject->Class->lpszMenuName.MaximumLength = ((PUNICODE_STRING)dwNewLong)->MaximumLength; - WindowObject->Class->lpszMenuName.Buffer = ExAllocatePoolWithTag(PagedPool, WindowObject->Class->lpszMenuName.MaximumLength, TAG_STRING); - RtlCopyUnicodeString(&WindowObject->Class->lpszMenuName, (PUNICODE_STRING)dwNewLong); + Window->Class->lpszMenuName.Length = + Window->Class->lpszMenuName.MaximumLength = ((PUNICODE_STRING)dwNewLong)->MaximumLength; + Window->Class->lpszMenuName.Buffer = ExAllocatePoolWithTag(PagedPool, Window->Class->lpszMenuName.MaximumLength, TAG_STRING); + RtlCopyUnicodeString(&Window->Class->lpszMenuName, (PUNICODE_STRING)dwNewLong); } else { - WindowObject->Class->lpszMenuName.Length = - WindowObject->Class->lpszMenuName.MaximumLength = 0; - WindowObject->Class->lpszMenuName.Buffer = (LPWSTR)dwNewLong; + Window->Class->lpszMenuName.Length = + Window->Class->lpszMenuName.MaximumLength = 0; + Window->Class->lpszMenuName.Buffer = (LPWSTR)dwNewLong; } break; case GCL_STYLE: - WindowObject->Class->style = dwNewLong; + Window->Class->style = dwNewLong; break; case GCL_WNDPROC: if (Ansi) { - WindowObject->Class->lpfnWndProcA = (WNDPROC)dwNewLong; - WindowObject->Class->lpfnWndProcW = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,FALSE); - WindowObject->Class->Unicode = FALSE; + Window->Class->lpfnWndProcA = (WNDPROC)dwNewLong; + Window->Class->lpfnWndProcW = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,FALSE); + Window->Class->Unicode = FALSE; } else { - WindowObject->Class->lpfnWndProcW = (WNDPROC)dwNewLong; - WindowObject->Class->lpfnWndProcA = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,TRUE); - WindowObject->Class->Unicode = TRUE; + Window->Class->lpfnWndProcW = (WNDPROC)dwNewLong; + Window->Class->lpfnWndProcA = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,TRUE); + Window->Class->Unicode = TRUE; } break; } @@ -662,22 +662,21 @@ NtUserSetClassLong(HWND hWnd, LONG dwNewLong, BOOL Ansi) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; LONG Ret; DECLARE_RETURN(DWORD); DPRINT("Enter NtUserSetClassLong\n"); UserEnterExclusive(); - WindowObject = IntGetWindowObject(hWnd); - if (WindowObject == NULL) + if (!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN(0); } - Ret = IntGetClassLong(WindowObject, Offset, Ansi); - co_IntSetClassLong(WindowObject, Offset, dwNewLong, Ansi); - IntReleaseWindowObject(WindowObject); + Ret = IntGetClassLong(Window, Offset, Ansi); + co_IntSetClassLong(Window, Offset, dwNewLong, Ansi); + IntReleaseWindowObject(Window); RETURN(Ret); CLEANUP: @@ -702,7 +701,7 @@ NtUserUnregisterClass( DWORD Unknown) { PWNDCLASS_OBJECT Class; - PWINSTATION_OBJECT WinStaObject; + PWINSTATION_OBJECT WinSta; DECLARE_RETURN(BOOL); DPRINT("Enter NtUserUnregisterClass(%S)\n", ClassNameOrAtom); @@ -714,7 +713,7 @@ NtUserUnregisterClass( RETURN( FALSE); } - WinStaObject = PsGetWin32Thread()->Desktop->WindowStation; + WinSta = PsGetWin32Thread()->Desktop->WindowStation; if (!ClassReferenceClassByNameOrAtom(&Class, ClassNameOrAtom, hInstance)) { @@ -742,7 +741,7 @@ NtUserUnregisterClass( RemoveEntryList(&Class->ListEntry); - RtlDeleteAtomFromAtomTable(WinStaObject->AtomTable, Class->Atom); + RtlDeleteAtomFromAtomTable(WinSta->AtomTable, Class->Atom); /* Free the object */ ClassDereferenceObject(Class); diff --git a/reactos/subsys/win32k/ntuser/focus.c b/reactos/subsys/win32k/ntuser/focus.c index 653f9f80ebc..f99292fb4bf 100644 --- a/reactos/subsys/win32k/ntuser/focus.c +++ b/reactos/subsys/win32k/ntuser/focus.c @@ -135,7 +135,7 @@ IntFindChildWindowToOwner(PWINDOW_OBJECT Root, PWINDOW_OBJECT Owner) if(OwnerWnd == Owner) { - Ret = Child->Self; + Ret = Child->hSelf; IntReleaseWindowObject(OwnerWnd); return Ret; } @@ -148,9 +148,9 @@ IntFindChildWindowToOwner(PWINDOW_OBJECT Root, PWINDOW_OBJECT Owner) STATIC BOOL FASTCALL co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWindow, BOOL MouseActivate) { - HWND hWnd = Window->Self; + HWND hWnd = Window->hSelf; HWND hWndPrev = NULL; - HWND hWndFocus = FocusWindow->Self; + HWND hWndFocus = FocusWindow->hSelf; HWND hWndFocusPrev = NULL; PUSER_MESSAGE_QUEUE PrevForegroundQueue; @@ -243,8 +243,8 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window) return FALSE; } - Top = UserGetAncestor(Window->Self, GA_ROOT); - if (Top != Window->Self) + Top = UserGetAncestor(Window->hSelf, GA_ROOT); + if (Top != Window->hSelf) { TopWindow = IntGetWindowObject(Top); if (TopWindow == NULL) @@ -261,7 +261,7 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window) /* TMN: Check return valud from this function? */ co_IntSetForegroundAndFocusWindow(TopWindow, Window, TRUE); - if (Top != Window->Self) + if (Top != Window->hSelf) { IntReleaseWindowObject(TopWindow); } @@ -285,7 +285,7 @@ co_IntSetActiveWindow(PWINDOW_OBJECT Window) { return ThreadQueue ? 0 : ThreadQueue->ActiveWindow; } - hWnd = Window->Self; + hWnd = Window->hSelf; } hWndPrev = ThreadQueue->ActiveWindow; diff --git a/reactos/subsys/win32k/ntuser/hotkey.c b/reactos/subsys/win32k/ntuser/hotkey.c index 5bffbb04d66..60c3ce68155 100644 --- a/reactos/subsys/win32k/ntuser/hotkey.c +++ b/reactos/subsys/win32k/ntuser/hotkey.c @@ -128,7 +128,7 @@ UnregisterWindowHotKeys(PWINDOW_OBJECT Window) HOT_KEY_ITEM, ListEntry); Entry = Entry->Flink; - if (HotKeyItem->hWnd == Window->Self) + if (HotKeyItem->hWnd == Window->hSelf) { RemoveEntryList (&HotKeyItem->ListEntry); ExFreePool (HotKeyItem); diff --git a/reactos/subsys/win32k/ntuser/menu.c b/reactos/subsys/win32k/ntuser/menu.c index 4cf363128ab..32e198b59f2 100644 --- a/reactos/subsys/win32k/ntuser/menu.c +++ b/reactos/subsys/win32k/ntuser/menu.c @@ -1161,52 +1161,52 @@ IntGetMenuDefaultItem(PMENU_OBJECT MenuObject, UINT fByPos, UINT gmdiFlags, } VOID FASTCALL -co_IntInitTracking(PWINDOW_OBJECT WindowObject, PMENU_OBJECT MenuObject, BOOL Popup, +co_IntInitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup, UINT Flags) { /* FIXME - hide caret */ if(!(Flags & TPM_NONOTIFY)) - co_IntSendMessage(WindowObject->Self, WM_SETCURSOR, (WPARAM)WindowObject->Self, HTCAPTION); + co_IntSendMessage(Window->hSelf, WM_SETCURSOR, (WPARAM)Window->hSelf, HTCAPTION); /* FIXME - send WM_SETCURSOR message */ if(!(Flags & TPM_NONOTIFY)) - co_IntSendMessage(WindowObject->Self, WM_INITMENU, (WPARAM)MenuObject->MenuInfo.Self, 0); + co_IntSendMessage(Window->hSelf, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0); } VOID FASTCALL -co_IntExitTracking(PWINDOW_OBJECT WindowObject, PMENU_OBJECT MenuObject, BOOL Popup, +co_IntExitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup, UINT Flags) { if(!(Flags & TPM_NONOTIFY)) - co_IntSendMessage(WindowObject->Self, WM_EXITMENULOOP, 0 /* FIXME */, 0); + co_IntSendMessage(Window->hSelf, WM_EXITMENULOOP, 0 /* FIXME */, 0); /* FIXME - Show caret again */ } INT FASTCALL -IntTrackMenu(PMENU_OBJECT MenuObject, PWINDOW_OBJECT WindowObject, INT x, INT y, +IntTrackMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window, INT x, INT y, RECT lprect) { return 0; } BOOL FASTCALL -co_IntTrackPopupMenu(PMENU_OBJECT MenuObject, PWINDOW_OBJECT WindowObject, +co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window, UINT Flags, POINT *Pos, UINT MenuPos, RECT *ExcludeRect) { - co_IntInitTracking(WindowObject, MenuObject, TRUE, Flags); + co_IntInitTracking(Window, Menu, TRUE, Flags); - co_IntExitTracking(WindowObject, MenuObject, TRUE, Flags); + co_IntExitTracking(Window, Menu, TRUE, Flags); return FALSE; } BOOL FASTCALL -IntSetMenuItemRect(PMENU_OBJECT MenuObject, UINT Item, BOOL fByPos, RECT *rcRect) +IntSetMenuItemRect(PMENU_OBJECT Menu, UINT Item, BOOL fByPos, RECT *rcRect) { PMENU_ITEM mi; - if(IntGetMenuItemByFlag(MenuObject, Item, (fByPos ? MF_BYPOSITION : MF_BYCOMMAND), + if(IntGetMenuItemByFlag(Menu, Item, (fByPos ? MF_BYPOSITION : MF_BYCOMMAND), &mi, NULL) > -1) { mi->Rect = *rcRect; diff --git a/reactos/subsys/win32k/ntuser/message.c b/reactos/subsys/win32k/ntuser/message.c index e5e97dbf6da..365ba3dc357 100644 --- a/reactos/subsys/win32k/ntuser/message.c +++ b/reactos/subsys/win32k/ntuser/message.c @@ -513,7 +513,7 @@ co_IntActivateWindowMouse(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, PWINDOW_OB return TRUE; } - Result = co_IntSendMessage(MsgWindow->Self, WM_MOUSEACTIVATE, (WPARAM)IntGetParent(MsgWindow), (LPARAM)MAKELONG(*HitTest, Msg->message)); + Result = co_IntSendMessage(MsgWindow->hSelf, WM_MOUSEACTIVATE, (WPARAM)IntGetParent(MsgWindow), (LPARAM)MAKELONG(*HitTest, Msg->message)); switch (Result) { case MA_NOACTIVATEANDEAT: @@ -544,10 +544,10 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT * } if(ThreadQueue == Window->MessageQueue && - ThreadQueue->CaptureWindow != Window->Self) + ThreadQueue->CaptureWindow != Window->hSelf) { /* only send WM_NCHITTEST messages if we're not capturing the window! */ - *HitTest = co_IntSendMessage(Window->Self, WM_NCHITTEST, 0, + *HitTest = co_IntSendMessage(Window->hSelf, WM_NCHITTEST, 0, MAKELONG(Msg->pt.x, Msg->pt.y)); if(*HitTest == (USHORT)HTTRANSPARENT) @@ -565,7 +565,7 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT * if(Wnd != Window) { /* post the message to the other window */ - Msg->hwnd = Wnd->Self; + Msg->hwnd = Wnd->hSelf; if(!(Wnd->Status & WINDOWSTATUS_DESTROYING)) { MsqPostMessage(Wnd->MessageQueue, Msg, FALSE, @@ -612,7 +612,7 @@ co_IntTranslateMouseMessage(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg, USHORT * (((*HitTest) == HTCAPTION) || ((*HitTest) == HTSYSMENU))) { Msg->message = WM_CONTEXTMENU; - Msg->wParam = (WPARAM)Window->Self; + Msg->wParam = (WPARAM)Window->hSelf; } else { diff --git a/reactos/subsys/win32k/ntuser/msgqueue.c b/reactos/subsys/win32k/ntuser/msgqueue.c index 3b97f10dcbc..55321bf653b 100644 --- a/reactos/subsys/win32k/ntuser/msgqueue.c +++ b/reactos/subsys/win32k/ntuser/msgqueue.c @@ -354,7 +354,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, UINT Fi *ScreenPoint = Message->Msg.pt; - if((hWnd != NULL && Window->Self != hWnd) || + if((hWnd != NULL && Window->hSelf != hWnd) || ((FilterLow != 0 || FilterLow != 0) && (Msg < FilterLow || Msg > FilterHigh))) { /* Reject the message because it doesn't match the filter */ @@ -395,7 +395,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, HWND hWnd, UINT Fi } /* FIXME - only assign if removing? */ - Message->Msg.hwnd = Window->Self; + Message->Msg.hwnd = Window->hSelf; Message->Msg.message = Msg; Message->Msg.lParam = MAKELONG(Message->Msg.pt.x, Message->Msg.pt.y); @@ -924,7 +924,7 @@ MsqRemoveWindowMessagesFromQueue(PVOID pWindow) { PostedMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry); - if (PostedMessage->Msg.hwnd == Window->Self) + if (PostedMessage->Msg.hwnd == Window->hSelf) { RemoveEntryList(&PostedMessage->ListEntry); MsqDestroyMessage(PostedMessage); @@ -944,7 +944,7 @@ MsqRemoveWindowMessagesFromQueue(PVOID pWindow) CurrentEntry = RemoveHeadList(&MessageQueue->SentMessagesListHead); SentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE, ListEntry); - if(SentMessage->Msg.hwnd == Window->Self) + if(SentMessage->Msg.hwnd == Window->hSelf) { DPRINT("Notify the sender and remove a message from the queue that had not been dispatched\n"); diff --git a/reactos/subsys/win32k/ntuser/painting.c b/reactos/subsys/win32k/ntuser/painting.c index ce42bfbdf2c..ba4c75c3483 100644 --- a/reactos/subsys/win32k/ntuser/painting.c +++ b/reactos/subsys/win32k/ntuser/painting.c @@ -81,7 +81,7 @@ STATIC VOID FASTCALL co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags) { HDC hDC; - HWND hWnd = Window->Self; + HWND hWnd = Window->hSelf; HRGN TempRegion; if (Flags & (RDW_ERASENOW | RDW_UPDATENOW)) @@ -555,7 +555,7 @@ IntFindWindowToRepaint(HWND hWnd, PW32THREAD Thread) if (IntIsWindowDirty(Child) && IntWndBelongsToThread(Child, Thread)) { - hFoundWnd = Child->Self; + hFoundWnd = Child->hSelf; break; } } diff --git a/reactos/subsys/win32k/ntuser/scrollbar.c b/reactos/subsys/win32k/ntuser/scrollbar.c index c0113072de2..a80f3efa9a4 100644 --- a/reactos/subsys/win32k/ntuser/scrollbar.c +++ b/reactos/subsys/win32k/ntuser/scrollbar.c @@ -365,7 +365,7 @@ co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bR } else if ((nBar != SB_CTL) && bChangeParams) { - co_UserShowScrollBar(Window->Self, nBar, FALSE); + co_UserShowScrollBar(Window->hSelf, nBar, FALSE); return Info->nPos; } } @@ -374,7 +374,7 @@ co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bR /* new_flags = 0;*/ if ((nBar != SB_CTL) && bChangeParams) { - co_UserShowScrollBar(Window->Self, nBar, TRUE); + co_UserShowScrollBar(Window->hSelf, nBar, TRUE); } } @@ -452,13 +452,13 @@ co_IntCreateScrollBars(PWINDOW_OBJECT Window) Size = 3 * (sizeof(WINDOW_SCROLLINFO)); if(!(Window->Scroll = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO))) { - DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window->Self); + DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window->hSelf); return FALSE; } RtlZeroMemory(Window->Scroll, Size); - Result = co_WinPosGetNonClientSize(Window->Self, + Result = co_WinPosGetNonClientSize(Window->hSelf, &Window->WindowRect, &Window->ClientRect); diff --git a/reactos/subsys/win32k/ntuser/windc.c b/reactos/subsys/win32k/ntuser/windc.c index 88267018aad..ca578c59943 100644 --- a/reactos/subsys/win32k/ntuser/windc.c +++ b/reactos/subsys/win32k/ntuser/windc.c @@ -294,7 +294,7 @@ DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags) { DcxFlags = Flags & ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW); } - hRgnVisible = DceGetVisRgn(Parent->Self, DcxFlags, Window->Self, Flags); + hRgnVisible = DceGetVisRgn(Parent->hSelf, DcxFlags, Window->hSelf, Flags); if (hRgnVisible == NULL) { hRgnVisible = NtGdiCreateRectRgn(0, 0, 0, 0); @@ -332,7 +332,7 @@ DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags) } else { - hRgnVisible = DceGetVisRgn(Window->Self, Flags, 0, 0); + hRgnVisible = DceGetVisRgn(Window->hSelf, Flags, 0, 0); } noparent: @@ -471,7 +471,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags) { DceEmpty = Dce; } - else if (Dce->hwndCurrent == (Window ? Window->Self : NULL) && + else if (Dce->hwndCurrent == (Window ? Window->hSelf : NULL) && ((Dce->DCXFlags & DCX_CACHECOMPAREMASK) == DcxFlags)) { #if 0 /* FIXME */ @@ -498,7 +498,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags) else { Dce = Window->Dce; - if (NULL != Dce && Dce->hwndCurrent == (Window ? Window->Self : NULL)) + if (NULL != Dce && Dce->hwndCurrent == (Window ? Window->hSelf : NULL)) { UpdateVisRgn = FALSE; /* updated automatically, via DCHook() */ } @@ -512,7 +512,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags) return(NULL); } - Dce->hwndCurrent = (Window ? Window->Self : NULL); + Dce->hwndCurrent = (Window ? Window->hSelf : NULL); Dce->DCXFlags = DcxFlags | (Flags & DCX_WINDOWPAINT) | DCX_DCEBUSY; if (0 == (Flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && NULL != ClipRegion) @@ -781,7 +781,7 @@ DceFreeWindowDCE(PWINDOW_OBJECT Window) pDCE = FirstDce; while (pDCE) { - if (pDCE->hwndCurrent == Window->Self) + if (pDCE->hwndCurrent == Window->hSelf) { if (pDCE == Window->Dce) /* owned or Class DCE*/ { @@ -808,7 +808,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->Self); + DPRINT1("[%p] GetDC() without ReleaseDC()!\n", Window->hSelf); DceReleaseDC(pDCE); } @@ -854,7 +854,7 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window) { if (0 == (pDCE->DCXFlags & DCX_DCEEMPTY)) { - if (Window->Self == pDCE->hwndCurrent) + if (Window->hSelf == pDCE->hwndCurrent) { CurrentWindow = Window; } @@ -871,14 +871,14 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window) dc = DC_LockDc(pDCE->hDC); if (dc == NULL) { - if (Window->Self != pDCE->hwndCurrent) + if (Window->hSelf != pDCE->hwndCurrent) { IntReleaseWindowObject(CurrentWindow); } pDCE = pDCE->next; continue; } - if (Window == CurrentWindow || IntIsChildWindow(Window->Self, CurrentWindow->Self)) + if (Window == CurrentWindow || IntIsChildWindow(Window->hSelf, CurrentWindow->hSelf)) { if (pDCE->DCXFlags & DCX_WINDOW) { @@ -907,7 +907,7 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window) DceUpdateVisRgn(pDCE, CurrentWindow, pDCE->DCXFlags); - if (Window->Self != pDCE->hwndCurrent) + if (Window->hSelf != pDCE->hwndCurrent) { // IntEngWindowChanged(CurrentWindow, WOC_RGN_CLIENT); IntReleaseWindowObject(CurrentWindow); diff --git a/reactos/subsys/win32k/ntuser/window.c b/reactos/subsys/win32k/ntuser/window.c index 73622f3782f..97db6f0a4cd 100644 --- a/reactos/subsys/win32k/ntuser/window.c +++ b/reactos/subsys/win32k/ntuser/window.c @@ -124,16 +124,16 @@ IntIsWindow(HWND hWnd) PWINDOW_OBJECT FASTCALL IntGetProcessWindowObject(PW32THREAD Thread, HWND hWnd) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; NTSTATUS Status; if(Thread->Desktop != NULL) { Status = ObmReferenceObjectByHandle(gHandleTable, - hWnd, otWindow, (PVOID*)&WindowObject); + hWnd, otWindow, (PVOID*)&Window); if (NT_SUCCESS(Status)) { - return WindowObject; + return Window; } } return NULL; @@ -208,7 +208,7 @@ IntWinListChildren(PWINDOW_OBJECT Window) for (Child = Window->FirstChild, Index = 0; Child != NULL; Child = Child->NextSibling, ++Index) - List[Index] = Child->Self; + List[Index] = Child->hSelf; List[Index] = NULL; return List; @@ -317,12 +317,12 @@ static LRESULT co_IntDestroyWindow(PWINDOW_OBJECT Window, BelongsToThreadData = IntWndBelongsToThread(Window, ThreadData); - IntDeRegisterShellHookWindow(Window->Self); + IntDeRegisterShellHookWindow(Window->hSelf); if(SendMessages) { /* Send destroy messages */ - IntSendDestroyMsg(Window->Self); + IntSendDestroyMsg(Window->hSelf); } /* free child windows */ @@ -336,7 +336,7 @@ static LRESULT co_IntDestroyWindow(PWINDOW_OBJECT Window, if(!IntWndBelongsToThread(Child, ThreadData)) { /* send WM_DESTROY messages to windows not belonging to the same thread */ - IntSendDestroyMsg(Child->Self); + IntSendDestroyMsg(Child->hSelf); } else co_IntDestroyWindow(Child, ProcessData, ThreadData, SendMessages); @@ -356,9 +356,9 @@ static LRESULT co_IntDestroyWindow(PWINDOW_OBJECT Window, RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_NOCHILDREN); if(BelongsToThreadData) - co_IntSendMessage(Window->Self, WM_NCDESTROY, 0, 0); + co_IntSendMessage(Window->hSelf, WM_NCDESTROY, 0, 0); } - MsqRemoveTimersWindow(ThreadData->MessageQueue, Window->Self); + MsqRemoveTimersWindow(ThreadData->MessageQueue, Window->hSelf); /* flush the message queue */ MsqRemoveWindowMessagesFromQueue(Window); @@ -370,10 +370,10 @@ static LRESULT co_IntDestroyWindow(PWINDOW_OBJECT Window, /* reset shell window handles */ if(ThreadData->Desktop) { - if (Window->Self == ThreadData->Desktop->WindowStation->ShellWindow) + if (Window->hSelf == ThreadData->Desktop->WindowStation->ShellWindow) ThreadData->Desktop->WindowStation->ShellWindow = NULL; - if (Window->Self == ThreadData->Desktop->WindowStation->ShellListView) + if (Window->hSelf == ThreadData->Desktop->WindowStation->ShellListView) ThreadData->Desktop->WindowStation->ShellListView = NULL; } @@ -383,14 +383,14 @@ static LRESULT co_IntDestroyWindow(PWINDOW_OBJECT Window, /* FIXME: do we need to fake QS_MOUSEMOVE wakebit? */ #if 0 /* FIXME */ - WinPosCheckInternalPos(Window->Self); - if (Window->Self == GetCapture()) + WinPosCheckInternalPos(Window->hSelf); + if (Window->hSelf == GetCapture()) { ReleaseCapture(); } /* free resources associated with the window */ - TIMER_RemoveWindowTimers(Window->Self); + TIMER_RemoveWindowTimers(Window->hSelf); #endif if (!(Window->Style & WS_CHILD) && Window->IDMenu @@ -418,7 +418,7 @@ static LRESULT co_IntDestroyWindow(PWINDOW_OBJECT Window, IntUnlinkWindow(Window); IntReferenceWindowObject(Window); - ObmCloseHandle(gHandleTable, Window->Self); + ObmCloseHandle(gHandleTable, Window->hSelf); IntDestroyScrollBars(Window); @@ -442,21 +442,21 @@ static LRESULT co_IntDestroyWindow(PWINDOW_OBJECT Window, } VOID FASTCALL -IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, UINT *cx, UINT *cy) +IntGetWindowBorderMeasures(PWINDOW_OBJECT Window, UINT *cx, UINT *cy) { - if(HAS_DLGFRAME(WindowObject->Style, WindowObject->ExStyle) && !(WindowObject->Style & WS_MINIMIZE)) + if(HAS_DLGFRAME(Window->Style, Window->ExStyle) && !(Window->Style & WS_MINIMIZE)) { *cx = UserGetSystemMetrics(SM_CXDLGFRAME); *cy = UserGetSystemMetrics(SM_CYDLGFRAME); } else { - if(HAS_THICKFRAME(WindowObject->Style, WindowObject->ExStyle)&& !(WindowObject->Style & WS_MINIMIZE)) + if(HAS_THICKFRAME(Window->Style, Window->ExStyle)&& !(Window->Style & WS_MINIMIZE)) { *cx = UserGetSystemMetrics(SM_CXFRAME); *cy = UserGetSystemMetrics(SM_CYFRAME); } - else if(HAS_THINFRAME(WindowObject->Style, WindowObject->ExStyle)) + else if(HAS_THINFRAME(Window->Style, Window->ExStyle)) { *cx = UserGetSystemMetrics(SM_CXBORDER); *cy = UserGetSystemMetrics(SM_CYBORDER); @@ -469,68 +469,68 @@ IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, UINT *cx, UINT *cy) } BOOL FASTCALL -IntGetWindowInfo(PWINDOW_OBJECT WindowObject, PWINDOWINFO pwi) +IntGetWindowInfo(PWINDOW_OBJECT Window, PWINDOWINFO pwi) { pwi->cbSize = sizeof(WINDOWINFO); - pwi->rcWindow = WindowObject->WindowRect; - pwi->rcClient = WindowObject->ClientRect; - pwi->dwStyle = WindowObject->Style; - pwi->dwExStyle = WindowObject->ExStyle; - pwi->dwWindowStatus = (UserGetForegroundWindow() == WindowObject->Self); /* WS_ACTIVECAPTION */ - IntGetWindowBorderMeasures(WindowObject, &pwi->cxWindowBorders, &pwi->cyWindowBorders); - pwi->atomWindowType = (WindowObject->Class ? WindowObject->Class->Atom : 0); + pwi->rcWindow = Window->WindowRect; + pwi->rcClient = Window->ClientRect; + pwi->dwStyle = Window->Style; + pwi->dwExStyle = Window->ExStyle; + pwi->dwWindowStatus = (UserGetForegroundWindow() == Window->hSelf); /* WS_ACTIVECAPTION */ + IntGetWindowBorderMeasures(Window, &pwi->cxWindowBorders, &pwi->cyWindowBorders); + pwi->atomWindowType = (Window->Class ? Window->Class->Atom : 0); pwi->wCreatorVersion = 0x400; /* FIXME - return a real version number */ return TRUE; } static BOOL FASTCALL IntSetMenu( - PWINDOW_OBJECT WindowObject, + PWINDOW_OBJECT Window, HMENU Menu, BOOL *Changed) { - PMENU_OBJECT OldMenuObject, NewMenuObject = NULL; + PMENU_OBJECT OldMenu, NewMenu = NULL; - if ((WindowObject->Style & (WS_CHILD | WS_POPUP)) == WS_CHILD) + if ((Window->Style & (WS_CHILD | WS_POPUP)) == WS_CHILD) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); return FALSE; } - *Changed = (WindowObject->IDMenu != (UINT) Menu); + *Changed = (Window->IDMenu != (UINT) Menu); if (! *Changed) { return TRUE; } - if (WindowObject->IDMenu) + if (Window->IDMenu) { - OldMenuObject = IntGetMenuObject((HMENU) WindowObject->IDMenu); - ASSERT(NULL == OldMenuObject || OldMenuObject->MenuInfo.Wnd == WindowObject->Self); + OldMenu = IntGetMenuObject((HMENU) Window->IDMenu); + ASSERT(NULL == OldMenu || OldMenu->MenuInfo.Wnd == Window->hSelf); } else { - OldMenuObject = NULL; + OldMenu = NULL; } if (NULL != Menu) { - NewMenuObject = IntGetMenuObject(Menu); - if (NULL == NewMenuObject) + NewMenu = IntGetMenuObject(Menu); + if (NULL == NewMenu) { - if (NULL != OldMenuObject) + if (NULL != OldMenu) { - IntReleaseMenuObject(OldMenuObject); + IntReleaseMenuObject(OldMenu); } SetLastWin32Error(ERROR_INVALID_MENU_HANDLE); return FALSE; } - if (NULL != NewMenuObject->MenuInfo.Wnd) + if (NULL != NewMenu->MenuInfo.Wnd) { /* Can't use the same menu for two windows */ - if (NULL != OldMenuObject) + if (NULL != OldMenu) { - IntReleaseMenuObject(OldMenuObject); + IntReleaseMenuObject(OldMenu); } SetLastWin32Error(ERROR_INVALID_MENU_HANDLE); return FALSE; @@ -538,16 +538,16 @@ IntSetMenu( } - WindowObject->IDMenu = (UINT) Menu; - if (NULL != NewMenuObject) + Window->IDMenu = (UINT) Menu; + if (NULL != NewMenu) { - NewMenuObject->MenuInfo.Wnd = WindowObject->Self; - IntReleaseMenuObject(NewMenuObject); + NewMenu->MenuInfo.Wnd = Window->hSelf; + IntReleaseMenuObject(NewMenu); } - if (NULL != OldMenuObject) + if (NULL != OldMenu) { - OldMenuObject->MenuInfo.Wnd = NULL; - IntReleaseMenuObject(OldMenuObject); + OldMenu->MenuInfo.Wnd = NULL; + IntReleaseMenuObject(OldMenu); } return TRUE; @@ -614,14 +614,14 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread) * \note Does not check the validity of the parameters */ VOID FASTCALL -IntGetClientRect(PWINDOW_OBJECT WindowObject, PRECT Rect) +IntGetClientRect(PWINDOW_OBJECT Window, PRECT Rect) { - ASSERT( WindowObject ); + ASSERT( Window ); ASSERT( Rect ); Rect->left = Rect->top = 0; - Rect->right = WindowObject->ClientRect.right - WindowObject->ClientRect.left; - Rect->bottom = WindowObject->ClientRect.bottom - WindowObject->ClientRect.top; + Rect->right = Window->ClientRect.right - Window->ClientRect.left; + Rect->bottom = Window->ClientRect.bottom - Window->ClientRect.top; } @@ -645,11 +645,11 @@ IntGetFocusWindow(VOID) #endif PMENU_OBJECT FASTCALL -IntGetSystemMenu(PWINDOW_OBJECT WindowObject, BOOL bRevert, BOOL RetMenu) +IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu) { - PMENU_OBJECT MenuObject, NewMenuObject, SysMenuObject, ret = NULL; + PMENU_OBJECT Menu, NewMenu, SysMenu, ret = NULL; PW32THREAD W32Thread; - HMENU NewMenu, SysMenu; + HMENU hNewMenu, hSysMenu; ROSMENUITEMINFO ItemInfo; if(bRevert) @@ -659,71 +659,71 @@ IntGetSystemMenu(PWINDOW_OBJECT WindowObject, BOOL bRevert, BOOL RetMenu) if(!W32Thread->Desktop) return NULL; - if(WindowObject->SystemMenu) + if(Window->SystemMenu) { - MenuObject = IntGetMenuObject(WindowObject->SystemMenu); - if(MenuObject) + Menu = IntGetMenuObject(Window->SystemMenu); + if(Menu) { - IntDestroyMenuObject(MenuObject, FALSE, TRUE); - WindowObject->SystemMenu = (HMENU)0; - IntReleaseMenuObject(MenuObject); + IntDestroyMenuObject(Menu, FALSE, TRUE); + Window->SystemMenu = (HMENU)0; + IntReleaseMenuObject(Menu); } } if(W32Thread->Desktop->WindowStation->SystemMenuTemplate) { /* clone system menu */ - MenuObject = IntGetMenuObject(W32Thread->Desktop->WindowStation->SystemMenuTemplate); - if(!MenuObject) + Menu = IntGetMenuObject(W32Thread->Desktop->WindowStation->SystemMenuTemplate); + if(!Menu) return NULL; - NewMenuObject = IntCloneMenu(MenuObject); - if(NewMenuObject) + NewMenu = IntCloneMenu(Menu); + if(NewMenu) { - WindowObject->SystemMenu = NewMenuObject->MenuInfo.Self; - NewMenuObject->MenuInfo.Flags |= MF_SYSMENU; - NewMenuObject->MenuInfo.Wnd = WindowObject->Self; - ret = NewMenuObject; + Window->SystemMenu = NewMenu->MenuInfo.Self; + NewMenu->MenuInfo.Flags |= MF_SYSMENU; + NewMenu->MenuInfo.Wnd = Window->hSelf; + ret = NewMenu; //IntReleaseMenuObject(NewMenuObject); } - IntReleaseMenuObject(MenuObject); + IntReleaseMenuObject(Menu); } else { - SysMenu = UserCreateMenu(FALSE); + hSysMenu = UserCreateMenu(FALSE); if (NULL == SysMenu) { return NULL; } - SysMenuObject = IntGetMenuObject(SysMenu); - if (NULL == SysMenuObject) + SysMenu = IntGetMenuObject(hSysMenu); + if (NULL == SysMenu) { - UserDestroyMenu(SysMenu); + UserDestroyMenu(hSysMenu); return NULL; } - SysMenuObject->MenuInfo.Flags |= MF_SYSMENU; - SysMenuObject->MenuInfo.Wnd = WindowObject->Self; - NewMenu = co_IntLoadSysMenuTemplate(); + SysMenu->MenuInfo.Flags |= MF_SYSMENU; + SysMenu->MenuInfo.Wnd = Window->hSelf; + hNewMenu = co_IntLoadSysMenuTemplate(); if(!NewMenu) { - IntReleaseMenuObject(SysMenuObject); - UserDestroyMenu(SysMenu); + IntReleaseMenuObject(SysMenu); + UserDestroyMenu(hSysMenu); return NULL; } - MenuObject = IntGetMenuObject(NewMenu); - if(!MenuObject) + Menu = IntGetMenuObject(hNewMenu); + if(!Menu) { - IntReleaseMenuObject(SysMenuObject); - UserDestroyMenu(SysMenu); + IntReleaseMenuObject(SysMenu); + UserDestroyMenu(hSysMenu); return NULL; } - NewMenuObject = IntCloneMenu(MenuObject); - if(NewMenuObject) + NewMenu = IntCloneMenu(Menu); + if(NewMenu) { - NewMenuObject->MenuInfo.Flags |= MF_SYSMENU | MF_POPUP; - IntReleaseMenuObject(NewMenuObject); - UserSetMenuDefaultItem(NewMenuObject->MenuInfo.Self, SC_CLOSE, FALSE); + NewMenu->MenuInfo.Flags |= MF_SYSMENU | MF_POPUP; + IntReleaseMenuObject(NewMenu); + UserSetMenuDefaultItem(NewMenu->MenuInfo.Self, SC_CLOSE, FALSE); ItemInfo.cbSize = sizeof(MENUITEMINFOW); ItemInfo.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_STATE | MIIM_SUBMENU; @@ -731,15 +731,15 @@ IntGetSystemMenu(PWINDOW_OBJECT WindowObject, BOOL bRevert, BOOL RetMenu) ItemInfo.fState = MFS_ENABLED; ItemInfo.dwTypeData = NULL; ItemInfo.cch = 0; - ItemInfo.hSubMenu = NewMenuObject->MenuInfo.Self; - IntInsertMenuItem(SysMenuObject, (UINT) -1, TRUE, &ItemInfo); + ItemInfo.hSubMenu = NewMenu->MenuInfo.Self; + IntInsertMenuItem(SysMenu, (UINT) -1, TRUE, &ItemInfo); - WindowObject->SystemMenu = SysMenuObject->MenuInfo.Self; + Window->SystemMenu = SysMenu->MenuInfo.Self; - ret = SysMenuObject; + ret = SysMenu; } - IntDestroyMenuObject(MenuObject, FALSE, TRUE); - IntReleaseMenuObject(MenuObject); + IntDestroyMenuObject(Menu, FALSE, TRUE); + IntReleaseMenuObject(Menu); } if(RetMenu) return ret; @@ -748,8 +748,8 @@ IntGetSystemMenu(PWINDOW_OBJECT WindowObject, BOOL bRevert, BOOL RetMenu) } else { - if(WindowObject->SystemMenu) - return IntGetMenuObject((HMENU)WindowObject->SystemMenu); + if(Window->SystemMenu) + return IntGetMenuObject((HMENU)Window->SystemMenu); else return NULL; } @@ -769,7 +769,7 @@ IntIsChildWindow(HWND Parent, HWND Child) Window = BaseWindow; while (Window) { - if (Window->Self == Parent) + if (Window->hSelf == Parent) { if(Window != BaseWindow) IntReleaseWindowObject(Window); @@ -849,7 +849,7 @@ IntLinkWindow( { PWINDOW_OBJECT Parent; - Wnd->Parent = WndParent->Self; + Wnd->Parent = WndParent->hSelf; if ((Wnd->PrevSibling = WndPrevSibling)) { /* link after WndPrevSibling */ @@ -898,7 +898,7 @@ IntSetOwner(HWND hWnd, HWND hWndNewOwner) WndOldOwner = IntGetWindowObject(Wnd->Owner); if (WndOldOwner) { - ret = WndOldOwner->Self; + ret = WndOldOwner->hSelf; IntReleaseWindowObject(WndOldOwner); } else @@ -929,8 +929,8 @@ IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent) ASSERT(Wnd); ASSERT(WndNewParent); - hWnd = Wnd->Self; - hWndNewParent = WndNewParent->Self; + hWnd = Wnd->hSelf; + hWndNewParent = WndNewParent->hSelf; /* * Windows hides the window first, then shows it again @@ -947,7 +947,7 @@ IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent) return NULL; WndOldParent = IntGetParentObject(Wnd); - hWndOldParent = (WndOldParent ? WndOldParent->Self : NULL); + hWndOldParent = (WndOldParent ? WndOldParent->hSelf : NULL); if (WndNewParent != WndOldParent) { @@ -974,7 +974,7 @@ IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent) IntReleaseWindowObject(InsertAfter); } - if (WndNewParent->Self != IntGetDesktopWindow()) /* a child window */ + if (WndNewParent->hSelf != IntGetDesktopWindow()) /* a child window */ { if (!(Wnd->Style & WS_CHILD)) { @@ -1004,7 +1004,7 @@ IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent) */ if(WndOldParent) { - if(!IntIsWindow(WndOldParent->Self)) + if(!IntIsWindow(WndOldParent->hSelf)) { IntReleaseWindowObject(WndOldParent); return NULL; @@ -1018,27 +1018,27 @@ IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent) } BOOL FASTCALL -IntSetSystemMenu(PWINDOW_OBJECT WindowObject, PMENU_OBJECT MenuObject) +IntSetSystemMenu(PWINDOW_OBJECT Window, PMENU_OBJECT Menu) { - PMENU_OBJECT OldMenuObject; - if(WindowObject->SystemMenu) + PMENU_OBJECT OldMenu; + if(Window->SystemMenu) { - OldMenuObject = IntGetMenuObject(WindowObject->SystemMenu); - if(OldMenuObject) + OldMenu = IntGetMenuObject(Window->SystemMenu); + if(OldMenu) { - OldMenuObject->MenuInfo.Flags &= ~ MF_SYSMENU; - IntReleaseMenuObject(OldMenuObject); + OldMenu->MenuInfo.Flags &= ~ MF_SYSMENU; + IntReleaseMenuObject(OldMenu); } } - if(MenuObject) + if(Menu) { /* FIXME check window style, propably return FALSE ? */ - WindowObject->SystemMenu = MenuObject->MenuInfo.Self; - MenuObject->MenuInfo.Flags |= MF_SYSMENU; + Window->SystemMenu = Menu->MenuInfo.Self; + Menu->MenuInfo.Flags |= MF_SYSMENU; } else - WindowObject->SystemMenu = (HMENU)0; + Window->SystemMenu = (HMENU)0; return TRUE; } @@ -1158,7 +1158,7 @@ NtUserBuildHwndList( { if(dwCount++ < nBufSize && pWnd) { - Status = MmCopyToCaller(pWnd++, &Child->Self, sizeof(HWND)); + Status = MmCopyToCaller(pWnd++, &Child->hSelf, sizeof(HWND)); if(!NT_SUCCESS(Status)) { SetLastNtError(Status); @@ -1198,7 +1198,7 @@ NtUserBuildHwndList( if(dwCount < nBufSize && pWnd) { - Status = MmCopyToCaller(pWnd++, &Window->Self, sizeof(HWND)); + Status = MmCopyToCaller(pWnd++, &Window->hSelf, sizeof(HWND)); if(!NT_SUCCESS(Status)) { SetLastNtError(Status); @@ -1246,7 +1246,7 @@ NtUserBuildHwndList( { if(dwCount++ < nBufSize && pWnd) { - Status = MmCopyToCaller(pWnd++, &Child->Self, sizeof(HWND)); + Status = MmCopyToCaller(pWnd++, &Child->hSelf, sizeof(HWND)); if(!NT_SUCCESS(Status)) { SetLastNtError(Status); @@ -1287,7 +1287,7 @@ NtUserChildWindowFromPointEx(HWND hwndParent, Pt.x = x; Pt.y = y; - if(Parent->Self != IntGetDesktopWindow()) + if(Parent->hSelf != IntGetDesktopWindow()) { Pt.x += Parent->ClientRect.left; Pt.y += Parent->ClientRect.top; @@ -1299,7 +1299,7 @@ NtUserChildWindowFromPointEx(HWND hwndParent, return NULL; } - Ret = Parent->Self; + Ret = Parent->hSelf; if((List = IntWinListChildren(Parent))) { for(phWnd = List; *phWnd; phWnd++) @@ -1324,7 +1324,7 @@ NtUserChildWindowFromPointEx(HWND hwndParent, } if(IntPtInWindow(Child, Pt.x, Pt.y)) { - Ret = Child->Self; + Ret = Child->hSelf; IntReleaseWindowObject(Child); break; } @@ -1343,7 +1343,7 @@ NtUserChildWindowFromPointEx(HWND hwndParent, * calculates the default position of a window */ BOOL FASTCALL -IntCalcDefPosSize(PWINDOW_OBJECT Parent, PWINDOW_OBJECT WindowObject, RECT *rc, BOOL IncPos) +IntCalcDefPosSize(PWINDOW_OBJECT Parent, PWINDOW_OBJECT Window, RECT *rc, BOOL IncPos) { SIZE Sz; POINT Pos = {0, 0}; @@ -1405,9 +1405,9 @@ co_IntCreateWindowEx(DWORD dwExStyle, DWORD dwShowMode, BOOL bUnicodeWindow) { - PWINSTATION_OBJECT WinStaObject; - PWNDCLASS_OBJECT ClassObject; - PWINDOW_OBJECT WindowObject; + PWINSTATION_OBJECT WinSta; + PWNDCLASS_OBJECT Class; + PWINDOW_OBJECT Window; PWINDOW_OBJECT ParentWindow, OwnerWindow; HWND ParentWindowHandle; HWND OwnerWindowHandle; @@ -1463,7 +1463,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, /* FIXME: parent must belong to the current process */ /* Check the class. */ - ClassFound = ClassReferenceClassByNameOrAtom(&ClassObject, ClassName->Buffer, hInstance); + ClassFound = ClassReferenceClassByNameOrAtom(&Class, ClassName->Buffer, hInstance); if (!ClassFound) { if (IS_ATOM(ClassName->Buffer)) @@ -1485,7 +1485,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, /* Check the window station. */ if (PsGetWin32Thread()->Desktop == NULL) { - ClassDereferenceObject(ClassObject); + ClassDereferenceObject(Class); if (NULL != ParentWindow) { IntReleaseWindowObject(ParentWindow); @@ -1493,20 +1493,20 @@ co_IntCreateWindowEx(DWORD dwExStyle, DPRINT("Thread is not attached to a desktop! Cannot create window!\n"); return (HWND)0; } - WinStaObject = PsGetWin32Thread()->Desktop->WindowStation; - ObReferenceObjectByPointer(WinStaObject, KernelMode, ExWindowStationObjectType, 0); + WinSta = PsGetWin32Thread()->Desktop->WindowStation; + ObReferenceObjectByPointer(WinSta, KernelMode, ExWindowStationObjectType, 0); /* Create the window object. */ - WindowObject = (PWINDOW_OBJECT) + Window = (PWINDOW_OBJECT) ObmCreateObject(gHandleTable, &Handle, - otWindow, sizeof(WINDOW_OBJECT) + ClassObject->cbWndExtra + otWindow, sizeof(WINDOW_OBJECT) + Class->cbWndExtra ); DPRINT("Created object with handle %X\n", Handle); - if (!WindowObject) + if (!Window) { - ObDereferenceObject(WinStaObject); - ClassDereferenceObject(ClassObject); + ObDereferenceObject(WinSta); + ClassDereferenceObject(Class); if (NULL != ParentWindow) { IntReleaseWindowObject(ParentWindow); @@ -1514,7 +1514,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, SetLastNtError(STATUS_INSUFFICIENT_RESOURCES); return (HWND)0; } - ObDereferenceObject(WinStaObject); + ObDereferenceObject(WinSta); if (NULL == PsGetWin32Thread()->Desktop->DesktopWindow) { @@ -1525,92 +1525,92 @@ co_IntCreateWindowEx(DWORD dwExStyle, /* * Fill out the structure describing it. */ - WindowObject->Class = ClassObject; + Window->Class = Class; - InsertTailList(&ClassObject->ClassWindowsListHead, &WindowObject->ClassListEntry); + InsertTailList(&Class->ClassWindowsListHead, &Window->ClassListEntry); - WindowObject->ExStyle = dwExStyle; - WindowObject->Style = dwStyle & ~WS_VISIBLE; - DPRINT("1: Style is now %lx\n", WindowObject->Style); + Window->ExStyle = dwExStyle; + Window->Style = dwStyle & ~WS_VISIBLE; + DPRINT("1: Style is now %lx\n", Window->Style); - WindowObject->SystemMenu = (HMENU)0; - WindowObject->ContextHelpId = 0; - WindowObject->IDMenu = 0; - WindowObject->Instance = hInstance; - WindowObject->Self = Handle; + Window->SystemMenu = (HMENU)0; + Window->ContextHelpId = 0; + Window->IDMenu = 0; + Window->Instance = hInstance; + Window->hSelf = Handle; if (0 != (dwStyle & WS_CHILD)) { - WindowObject->IDMenu = (UINT) hMenu; + Window->IDMenu = (UINT) hMenu; } else { - IntSetMenu(WindowObject, hMenu, &MenuChanged); + IntSetMenu(Window, hMenu, &MenuChanged); } - WindowObject->MessageQueue = PsGetWin32Thread()->MessageQueue; - IntReferenceMessageQueue(WindowObject->MessageQueue); - WindowObject->Parent = (ParentWindow ? ParentWindow->Self : NULL); + Window->MessageQueue = PsGetWin32Thread()->MessageQueue; + IntReferenceMessageQueue(Window->MessageQueue); + Window->Parent = (ParentWindow ? ParentWindow->hSelf : NULL); if((OwnerWindow = IntGetWindowObject(OwnerWindowHandle))) { - WindowObject->Owner = OwnerWindowHandle; + Window->Owner = OwnerWindowHandle; IntReleaseWindowObject(OwnerWindow); HasOwner = TRUE; } else { - WindowObject->Owner = NULL; + Window->Owner = NULL; HasOwner = FALSE; } - WindowObject->UserData = 0; - if ((((DWORD)ClassObject->lpfnWndProcA & 0xFFFF0000) != 0xFFFF0000) - && (((DWORD)ClassObject->lpfnWndProcW & 0xFFFF0000) != 0xFFFF0000)) + Window->UserData = 0; + if ((((DWORD)Class->lpfnWndProcA & 0xFFFF0000) != 0xFFFF0000) + && (((DWORD)Class->lpfnWndProcW & 0xFFFF0000) != 0xFFFF0000)) { - WindowObject->Unicode = bUnicodeWindow; + Window->Unicode = bUnicodeWindow; } else { - WindowObject->Unicode = ClassObject->Unicode; + Window->Unicode = Class->Unicode; } - WindowObject->WndProcA = ClassObject->lpfnWndProcA; - WindowObject->WndProcW = ClassObject->lpfnWndProcW; - WindowObject->OwnerThread = PsGetCurrentThread(); - WindowObject->FirstChild = NULL; - WindowObject->LastChild = NULL; - WindowObject->PrevSibling = NULL; - WindowObject->NextSibling = NULL; + Window->WndProcA = Class->lpfnWndProcA; + Window->WndProcW = Class->lpfnWndProcW; + Window->OwnerThread = PsGetCurrentThread(); + Window->FirstChild = NULL; + Window->LastChild = NULL; + Window->PrevSibling = NULL; + Window->NextSibling = NULL; /* extra window data */ - if (ClassObject->cbWndExtra != 0) + if (Class->cbWndExtra != 0) { - WindowObject->ExtraData = (PCHAR)(WindowObject + 1); - WindowObject->ExtraDataSize = ClassObject->cbWndExtra; - RtlZeroMemory(WindowObject->ExtraData, WindowObject->ExtraDataSize); + Window->ExtraData = (PCHAR)(Window + 1); + Window->ExtraDataSize = Class->cbWndExtra; + RtlZeroMemory(Window->ExtraData, Window->ExtraDataSize); } else { - WindowObject->ExtraData = NULL; - WindowObject->ExtraDataSize = 0; + Window->ExtraData = NULL; + Window->ExtraDataSize = 0; } - InitializeListHead(&WindowObject->PropListHead); - InitializeListHead(&WindowObject->WndObjListHead); - ExInitializeFastMutex(&WindowObject->WndObjListLock); + InitializeListHead(&Window->PropListHead); + InitializeListHead(&Window->WndObjListHead); + ExInitializeFastMutex(&Window->WndObjListLock); if (NULL != WindowName->Buffer) { - WindowObject->WindowName.MaximumLength = WindowName->MaximumLength; - WindowObject->WindowName.Length = WindowName->Length; - WindowObject->WindowName.Buffer = ExAllocatePoolWithTag(PagedPool, WindowName->MaximumLength, + Window->WindowName.MaximumLength = WindowName->MaximumLength; + Window->WindowName.Length = WindowName->Length; + Window->WindowName.Buffer = ExAllocatePoolWithTag(PagedPool, WindowName->MaximumLength, TAG_STRING); - if (NULL == WindowObject->WindowName.Buffer) + if (NULL == Window->WindowName.Buffer) { - ClassDereferenceObject(ClassObject); + ClassDereferenceObject(Class); DPRINT1("Failed to allocate mem for window name\n"); SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); return NULL; } - RtlCopyMemory(WindowObject->WindowName.Buffer, WindowName->Buffer, WindowName->MaximumLength); + RtlCopyMemory(Window->WindowName.Buffer, WindowName->Buffer, WindowName->MaximumLength); } else { - RtlInitUnicodeString(&WindowObject->WindowName, NULL); + RtlInitUnicodeString(&Window->WindowName, NULL); } @@ -1628,36 +1628,35 @@ co_IntCreateWindowEx(DWORD dwExStyle, /* Correct the window style. */ if (!(dwStyle & WS_CHILD)) { - WindowObject->Style |= WS_CLIPSIBLINGS; - DPRINT("3: Style is now %lx\n", WindowObject->Style); + Window->Style |= WS_CLIPSIBLINGS; + DPRINT("3: Style is now %lx\n", Window->Style); if (!(dwStyle & WS_POPUP)) { - WindowObject->Style |= WS_CAPTION; - WindowObject->Flags |= WINDOWOBJECT_NEED_SIZE; - DPRINT("4: Style is now %lx\n", WindowObject->Style); + Window->Style |= WS_CAPTION; + Window->Flags |= WINDOWOBJECT_NEED_SIZE; + DPRINT("4: Style is now %lx\n", Window->Style); } } /* create system menu */ - if((WindowObject->Style & WS_SYSMENU) && - (WindowObject->Style & WS_CAPTION) == WS_CAPTION) + if((Window->Style & WS_SYSMENU) && + (Window->Style & WS_CAPTION) == WS_CAPTION) { - SystemMenu = IntGetSystemMenu(WindowObject, TRUE, TRUE); + SystemMenu = IntGetSystemMenu(Window, TRUE, TRUE); if(SystemMenu) { - WindowObject->SystemMenu = SystemMenu->MenuInfo.Self; + Window->SystemMenu = SystemMenu->MenuInfo.Self; IntReleaseMenuObject(SystemMenu); } } /* Insert the window into the thread's window list. */ - InsertTailList (&PsGetWin32Thread()->WindowListHead, - &WindowObject->ThreadListEntry); + InsertTailList (&PsGetWin32Thread()->WindowListHead, &Window->ThreadListEntry); /* Allocate a DCE for this window. */ if (dwStyle & CS_OWNDC) { - WindowObject->Dce = DceAllocDCE(WindowObject->Self, DCE_WINDOW_DC); + Window->Dce = DceAllocDCE(Window->hSelf, DCE_WINDOW_DC); } /* FIXME: Handle "CS_CLASSDC" */ @@ -1691,7 +1690,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, /* FIXME - Delete window object and remove it from the thread windows list */ /* FIXME - delete allocated DCE */ - ClassDereferenceObject(ClassObject); + ClassDereferenceObject(Class); DPRINT1("CBT-hook returned !0\n"); return (HWND) NULL; } @@ -1702,20 +1701,20 @@ co_IntCreateWindowEx(DWORD dwExStyle, nHeight = Cs.cy; /* default positioning for overlapped windows */ - if(!(WindowObject->Style & (WS_POPUP | WS_CHILD))) + if(!(Window->Style & (WS_POPUP | WS_CHILD))) { RECT rc, WorkArea; PRTL_USER_PROCESS_PARAMETERS ProcessParams; BOOL CalculatedDefPosSize = FALSE; - IntGetDesktopWorkArea(WindowObject->OwnerThread->Tcb.Win32Thread->Desktop, &WorkArea); + IntGetDesktopWorkArea(Window->OwnerThread->Tcb.Win32Thread->Desktop, &WorkArea); rc = WorkArea; ProcessParams = PsGetCurrentProcess()->Peb->ProcessParameters; if(x == CW_USEDEFAULT || x == CW_USEDEFAULT16) { - CalculatedDefPosSize = IntCalcDefPosSize(ParentWindow, WindowObject, &rc, TRUE); + CalculatedDefPosSize = IntCalcDefPosSize(ParentWindow, Window, &rc, TRUE); if(ProcessParams->WindowFlags & STARTF_USEPOSITION) { @@ -1740,7 +1739,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, { if(!CalculatedDefPosSize) { - IntCalcDefPosSize(ParentWindow, WindowObject, &rc, FALSE); + IntCalcDefPosSize(ParentWindow, Window, &rc, FALSE); } if(ProcessParams->WindowFlags & STARTF_USESIZE) { @@ -1777,16 +1776,16 @@ co_IntCreateWindowEx(DWORD dwExStyle, } /* Initialize the window dimensions. */ - WindowObject->WindowRect.left = Pos.x; - WindowObject->WindowRect.top = Pos.y; - WindowObject->WindowRect.right = Pos.x + Size.cx; - WindowObject->WindowRect.bottom = Pos.y + Size.cy; - if (0 != (WindowObject->Style & WS_CHILD) && ParentWindow) + Window->WindowRect.left = Pos.x; + Window->WindowRect.top = Pos.y; + Window->WindowRect.right = Pos.x + Size.cx; + Window->WindowRect.bottom = Pos.y + Size.cy; + if (0 != (Window->Style & WS_CHILD) && ParentWindow) { - IntGdiOffsetRect(&(WindowObject->WindowRect), ParentWindow->ClientRect.left, + IntGdiOffsetRect(&(Window->WindowRect), ParentWindow->ClientRect.left, ParentWindow->ClientRect.top); } - WindowObject->ClientRect = WindowObject->WindowRect; + Window->ClientRect = Window->WindowRect; /* * Get the size and position of the window. @@ -1796,7 +1795,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, POINT MaxSize, MaxPos, MinTrack, MaxTrack; /* WinPosGetMinMaxInfo sends the WM_GETMINMAXINFO message */ - co_WinPosGetMinMaxInfo(WindowObject, &MaxSize, &MaxPos, &MinTrack, + co_WinPosGetMinMaxInfo(Window, &MaxSize, &MaxPos, &MinTrack, &MaxTrack); if (MaxSize.x < nWidth) nWidth = MaxSize.x; if (MaxSize.y < nHeight) nHeight = MaxSize.y; @@ -1806,16 +1805,16 @@ co_IntCreateWindowEx(DWORD dwExStyle, if (nHeight < 0) nHeight = 0; } - WindowObject->WindowRect.left = Pos.x; - WindowObject->WindowRect.top = Pos.y; - WindowObject->WindowRect.right = Pos.x + Size.cx; - WindowObject->WindowRect.bottom = Pos.y + Size.cy; - if (0 != (WindowObject->Style & WS_CHILD) && ParentWindow) + Window->WindowRect.left = Pos.x; + Window->WindowRect.top = Pos.y; + Window->WindowRect.right = Pos.x + Size.cx; + Window->WindowRect.bottom = Pos.y + Size.cy; + if (0 != (Window->Style & WS_CHILD) && ParentWindow) { - IntGdiOffsetRect(&(WindowObject->WindowRect), ParentWindow->ClientRect.left, + IntGdiOffsetRect(&(Window->WindowRect), ParentWindow->ClientRect.left, ParentWindow->ClientRect.top); } - WindowObject->ClientRect = WindowObject->WindowRect; + Window->ClientRect = Window->WindowRect; /* FIXME: Initialize the window menu. */ @@ -1828,7 +1827,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, DPRINT("[win32k.window] IntCreateWindowEx style %d, exstyle %d, parent %d\n", Cs.style, Cs.dwExStyle, Cs.hwndParent); DPRINT("IntCreateWindowEx(): (%d,%d-%d,%d)\n", x, y, nWidth, nHeight); DPRINT("IntCreateWindowEx(): About to send NCCREATE message.\n"); - Result = co_IntSendMessage(WindowObject->Self, WM_NCCREATE, 0, (LPARAM) &Cs); + Result = co_IntSendMessage(Window->hSelf, WM_NCCREATE, 0, (LPARAM) &Cs); if (!Result) { /* FIXME: Cleanup. */ @@ -1841,16 +1840,16 @@ co_IntCreateWindowEx(DWORD dwExStyle, } /* Calculate the non-client size. */ - MaxPos.x = WindowObject->WindowRect.left; - MaxPos.y = WindowObject->WindowRect.top; + MaxPos.x = Window->WindowRect.left; + MaxPos.y = Window->WindowRect.top; DPRINT("IntCreateWindowEx(): About to get non-client size.\n"); /* WinPosGetNonClientSize SENDS THE WM_NCCALCSIZE message */ - Result = co_WinPosGetNonClientSize(WindowObject->Self, - &WindowObject->WindowRect, - &WindowObject->ClientRect); - IntGdiOffsetRect(&WindowObject->WindowRect, - MaxPos.x - WindowObject->WindowRect.left, - MaxPos.y - WindowObject->WindowRect.top); + Result = co_WinPosGetNonClientSize(Window->hSelf, + &Window->WindowRect, + &Window->ClientRect); + IntGdiOffsetRect(&Window->WindowRect, + MaxPos.x - Window->WindowRect.left, + MaxPos.y - Window->WindowRect.top); if (NULL != ParentWindow) { @@ -1861,7 +1860,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, if((PrevSibling = ParentWindow->LastChild)) IntReferenceWindowObject(PrevSibling); /* link window as bottom sibling */ - IntLinkWindow(WindowObject, ParentWindow, PrevSibling /*prev sibling*/); + IntLinkWindow(Window, ParentWindow, PrevSibling /*prev sibling*/); if(PrevSibling) IntReleaseWindowObject(PrevSibling); } @@ -1887,7 +1886,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, { IntReferenceWindowObject(InsertAfter); } - IntLinkWindow(WindowObject, ParentWindow, InsertAfter /* prev sibling */); + IntLinkWindow(Window, ParentWindow, InsertAfter /* prev sibling */); if (NULL != InsertAfter) { IntReleaseWindowObject(InsertAfter); @@ -1897,7 +1896,7 @@ co_IntCreateWindowEx(DWORD dwExStyle, /* Send the WM_CREATE message. */ DPRINT("IntCreateWindowEx(): about to send CREATE message.\n"); - Result = co_IntSendMessage(WindowObject->Self, WM_CREATE, 0, (LPARAM) &Cs); + Result = co_IntSendMessage(Window->hSelf, WM_CREATE, 0, (LPARAM) &Cs); if (Result == (LRESULT)-1) { /* FIXME: Cleanup. */ @@ -1905,77 +1904,77 @@ co_IntCreateWindowEx(DWORD dwExStyle, { IntReleaseWindowObject(ParentWindow); } - ClassDereferenceObject(ClassObject); + ClassDereferenceObject(Class); DPRINT("IntCreateWindowEx(): send CREATE message failed.\n"); return((HWND)0); } /* Send move and size messages. */ - if (!(WindowObject->Flags & WINDOWOBJECT_NEED_SIZE)) + if (!(Window->Flags & WINDOWOBJECT_NEED_SIZE)) { LONG lParam; DPRINT("IntCreateWindow(): About to send WM_SIZE\n"); - if ((WindowObject->ClientRect.right - WindowObject->ClientRect.left) < 0 || - (WindowObject->ClientRect.bottom - WindowObject->ClientRect.top) < 0) + if ((Window->ClientRect.right - Window->ClientRect.left) < 0 || + (Window->ClientRect.bottom - Window->ClientRect.top) < 0) { DPRINT("Sending bogus WM_SIZE\n"); } - lParam = MAKE_LONG(WindowObject->ClientRect.right - - WindowObject->ClientRect.left, - WindowObject->ClientRect.bottom - - WindowObject->ClientRect.top); - co_IntSendMessage(WindowObject->Self, WM_SIZE, SIZE_RESTORED, + lParam = MAKE_LONG(Window->ClientRect.right - + Window->ClientRect.left, + Window->ClientRect.bottom - + Window->ClientRect.top); + co_IntSendMessage(Window->hSelf, WM_SIZE, SIZE_RESTORED, lParam); DPRINT("IntCreateWindow(): About to send WM_MOVE\n"); - if (0 != (WindowObject->Style & WS_CHILD) && ParentWindow) + if (0 != (Window->Style & WS_CHILD) && ParentWindow) { - lParam = MAKE_LONG(WindowObject->ClientRect.left - ParentWindow->ClientRect.left, - WindowObject->ClientRect.top - ParentWindow->ClientRect.top); + lParam = MAKE_LONG(Window->ClientRect.left - ParentWindow->ClientRect.left, + Window->ClientRect.top - ParentWindow->ClientRect.top); } else { - lParam = MAKE_LONG(WindowObject->ClientRect.left, - WindowObject->ClientRect.top); + lParam = MAKE_LONG(Window->ClientRect.left, + Window->ClientRect.top); } - co_IntSendMessage(WindowObject->Self, WM_MOVE, 0, lParam); + co_IntSendMessage(Window->hSelf, WM_MOVE, 0, lParam); /* Call WNDOBJ change procs */ - IntEngWindowChanged(WindowObject, WOC_RGN_CLIENT); + IntEngWindowChanged(Window, WOC_RGN_CLIENT); } /* Show or maybe minimize or maximize the window. */ - if (WindowObject->Style & (WS_MINIMIZE | WS_MAXIMIZE)) + if (Window->Style & (WS_MINIMIZE | WS_MAXIMIZE)) { RECT NewPos; UINT16 SwFlag; - SwFlag = (WindowObject->Style & WS_MINIMIZE) ? SW_MINIMIZE : + SwFlag = (Window->Style & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE; - co_WinPosMinMaximize(WindowObject, SwFlag, &NewPos); + co_WinPosMinMaximize(Window, SwFlag, &NewPos); SwFlag = - ((WindowObject->Style & WS_CHILD) || UserGetActiveWindow()) ? + ((Window->Style & WS_CHILD) || UserGetActiveWindow()) ? SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED : SWP_NOZORDER | SWP_FRAMECHANGED; DPRINT("IntCreateWindow(): About to minimize/maximize\n"); DPRINT("%d,%d %dx%d\n", NewPos.left, NewPos.top, NewPos.right, NewPos.bottom); - co_WinPosSetWindowPos(WindowObject->Self, 0, NewPos.left, NewPos.top, + co_WinPosSetWindowPos(Window->hSelf, 0, NewPos.left, NewPos.top, NewPos.right, NewPos.bottom, SwFlag); } /* Notify the parent window of a new child. */ - if ((WindowObject->Style & WS_CHILD) && - (!(WindowObject->ExStyle & WS_EX_NOPARENTNOTIFY)) && ParentWindow) + if ((Window->Style & WS_CHILD) && + (!(Window->ExStyle & WS_EX_NOPARENTNOTIFY)) && ParentWindow) { DPRINT("IntCreateWindow(): About to notify parent\n"); - co_IntSendMessage(ParentWindow->Self, + co_IntSendMessage(ParentWindow->hSelf, WM_PARENTNOTIFY, - MAKEWPARAM(WM_CREATE, WindowObject->IDMenu), - (LPARAM)WindowObject->Self); + MAKEWPARAM(WM_CREATE, Window->IDMenu), + (LPARAM)Window->hSelf); } if ((!hWndParent) && (!HasOwner)) { @@ -1991,23 +1990,23 @@ co_IntCreateWindowEx(DWORD dwExStyle, } /* Initialize and show the window's scrollbars */ - if (WindowObject->Style & WS_VSCROLL) + if (Window->Style & WS_VSCROLL) { - co_UserShowScrollBar(WindowObject->Self, SB_VERT, TRUE); + co_UserShowScrollBar(Window->hSelf, SB_VERT, TRUE); } - if (WindowObject->Style & WS_HSCROLL) + if (Window->Style & WS_HSCROLL) { - co_UserShowScrollBar(WindowObject->Self, SB_HORZ, TRUE); + co_UserShowScrollBar(Window->hSelf, SB_HORZ, TRUE); } if (dwStyle & WS_VISIBLE) { DPRINT("IntCreateWindow(): About to show window\n"); - co_WinPosShowWindow(WindowObject->Self, dwShowMode); + co_WinPosShowWindow(Window->hSelf, dwShowMode); } DPRINT("IntCreateWindow(): = %X\n", Handle); - DPRINT("WindowObject->SystemMenu = 0x%x\n", WindowObject->SystemMenu); + DPRINT("WindowObject->SystemMenu = 0x%x\n", Window->SystemMenu); return((HWND)Handle); } @@ -2127,19 +2126,19 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window) /* Look whether the focus is within the tree of windows we will * be destroying. */ - if (!co_WinPosShowWindow(Window->Self, SW_HIDE)) + if (!co_WinPosShowWindow(Window->hSelf, SW_HIDE)) { - if (UserGetActiveWindow() == Window->Self) + if (UserGetActiveWindow() == Window->hSelf) { co_WinPosActivateOtherWindow(Window); } } - if (Window->MessageQueue->ActiveWindow == Window->Self) + if (Window->MessageQueue->ActiveWindow == Window->hSelf) Window->MessageQueue->ActiveWindow = NULL; - if (Window->MessageQueue->FocusWindow == Window->Self) + if (Window->MessageQueue->FocusWindow == Window->hSelf) Window->MessageQueue->FocusWindow = NULL; - if (Window->MessageQueue->CaptureWindow == Window->Self) + if (Window->MessageQueue->CaptureWindow == Window->hSelf) Window->MessageQueue->CaptureWindow = NULL; IntDereferenceMessageQueue(Window->MessageQueue); @@ -2169,7 +2168,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window) } #endif - if (!IntIsWindow(Window->Self)) + if (!IntIsWindow(Window->hSelf)) { return TRUE; } @@ -2194,7 +2193,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window) Child = IntGetWindowObject(*ChildHandle); if (Child == NULL) continue; - if (Child->Owner != Window->Self) + if (Child->Owner != Window->hSelf) { IntReleaseWindowObject(Child); continue; @@ -2224,7 +2223,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window) } } - if (!IntIsWindow(Window->Self)) + if (!IntIsWindow(Window->hSelf)) { return TRUE; } @@ -2332,7 +2331,7 @@ IntFindWindow(PWINDOW_OBJECT Parent, if(ChildAfter) { /* skip handles before and including ChildAfter */ - while(*phWnd && (*(phWnd++) != ChildAfter->Self)); + while(*phWnd && (*(phWnd++) != ChildAfter->hSelf)); } /* search children */ @@ -2350,7 +2349,7 @@ IntFindWindow(PWINDOW_OBJECT Parent, if((!CheckWindowName || !RtlCompareUnicodeString(WindowName, &(Child->WindowName), FALSE)) && (!ClassAtom || Child->Class->Atom == ClassAtom)) { - Ret = Child->Self; + Ret = Child->hSelf; IntReleaseWindowObject(Child); break; } @@ -2493,7 +2492,7 @@ NtUserFindWindowEx(HWND hwndParent, } } - if(Parent->Self == Desktop) + if(Parent->hSelf == Desktop) { HWND *List, *phWnd; PWINDOW_OBJECT TopLevelWindow; @@ -2512,7 +2511,7 @@ NtUserFindWindowEx(HWND hwndParent, if(ChildAfter) { /* skip handles before and including ChildAfter */ - while(*phWnd && (*(phWnd++) != ChildAfter->Self)); + while(*phWnd && (*(phWnd++) != ChildAfter->hSelf)); } CheckWindowName = WindowName.Length > 0; @@ -2536,7 +2535,7 @@ NtUserFindWindowEx(HWND hwndParent, if (WindowMatches && ClassMatches) { - Ret = TopLevelWindow->Self; + Ret = TopLevelWindow->hSelf; IntReleaseWindowObject(TopLevelWindow); break; } @@ -2545,7 +2544,7 @@ NtUserFindWindowEx(HWND hwndParent, { /* window returns the handle of the top-level window, in case it found the child window */ - Ret = TopLevelWindow->Self; + Ret = TopLevelWindow->hSelf; IntReleaseWindowObject(TopLevelWindow); break; } @@ -2685,7 +2684,7 @@ HWND FASTCALL UserGetAncestor(HWND hWnd, UINT Type) } } - hWndAncestor = (WndAncestor ? WndAncestor->Self : NULL); + hWndAncestor = (WndAncestor ? WndAncestor->hSelf : NULL); IntReleaseWindowObject(Wnd); if(WndAncestor && (WndAncestor != Wnd)) @@ -2728,21 +2727,21 @@ CLEANUP: BOOL STDCALL NtUserGetClientRect(HWND hWnd, LPRECT Rect) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; RECT SafeRect; DECLARE_RETURN(BOOL); DPRINT("Enter NtUserGetClientRect\n"); UserEnterShared(); - if(!(WindowObject = IntGetWindowObject(hWnd))) + if(!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( FALSE); } - IntGetClientRect(WindowObject, &SafeRect); - IntReleaseWindowObject(WindowObject); + IntGetClientRect(Window, &SafeRect); + IntReleaseWindowObject(Window); if(!NT_SUCCESS(MmCopyToCaller(Rect, &SafeRect, sizeof(RECT)))) { @@ -2858,7 +2857,7 @@ NtUserGetParent(HWND hWnd) WndParent = IntGetParent(Wnd); if (WndParent) { - hWndParent = WndParent->Self; + hWndParent = WndParent->hSelf; IntReleaseWindowObject(WndParent); } @@ -2921,7 +2920,7 @@ UserSetParent(HWND hWndChild, HWND hWndNewParent) if (WndOldParent) { - hWndOldParent = WndOldParent->Self; + hWndOldParent = WndOldParent->hSelf; IntReleaseWindowObject(WndOldParent); } @@ -3127,28 +3126,26 @@ HMENU STDCALL NtUserGetSystemMenu(HWND hWnd, BOOL bRevert) { HMENU Result = 0; - PWINDOW_OBJECT WindowObject; - PMENU_OBJECT MenuObject; + PWINDOW_OBJECT Window; + PMENU_OBJECT Menu; DECLARE_RETURN(HMENU); DPRINT("Enter NtUserGetSystemMenu\n"); UserEnterShared(); - WindowObject = IntGetWindowObject((HWND)hWnd); - if (WindowObject == NULL) + if (!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( 0); } - MenuObject = IntGetSystemMenu(WindowObject, bRevert, FALSE); - if (MenuObject) + if (!(Menu = IntGetSystemMenu(Window, bRevert, FALSE))) { - Result = MenuObject->MenuInfo.Self; - IntReleaseMenuObject(MenuObject); + Result = Menu->MenuInfo.Self; + IntReleaseMenuObject(Menu); } - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( Result); CLEANUP: @@ -3168,15 +3165,14 @@ BOOL STDCALL NtUserSetSystemMenu(HWND hWnd, HMENU hMenu) { BOOL Result = FALSE; - PWINDOW_OBJECT WindowObject; - PMENU_OBJECT MenuObject; + PWINDOW_OBJECT Window; + PMENU_OBJECT Menu; DECLARE_RETURN(BOOL); DPRINT("Enter NtUserSetSystemMenu\n"); UserEnterExclusive(); - WindowObject = IntGetWindowObject(hWnd); - if (!WindowObject) + if (!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( FALSE); @@ -3187,20 +3183,20 @@ NtUserSetSystemMenu(HWND hWnd, HMENU hMenu) /* * Assign new menu handle. */ - MenuObject = IntGetMenuObject(hMenu); - if (!MenuObject) + Menu = IntGetMenuObject(hMenu); + if (!Menu) { - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); SetLastWin32Error(ERROR_INVALID_MENU_HANDLE); RETURN( FALSE); } - Result = IntSetSystemMenu(WindowObject, MenuObject); + Result = IntSetSystemMenu(Window, Menu); - IntReleaseMenuObject(MenuObject); + IntReleaseMenuObject(Menu); } - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( Result); @@ -3216,57 +3212,57 @@ CLEANUP: HWND FASTCALL UserGetWindow(HWND hWnd, UINT Relationship) { - PWINDOW_OBJECT Parent, WindowObject; + PWINDOW_OBJECT Parent, Window; HWND hWndResult = NULL; - if (!(WindowObject = IntGetWindowObject(hWnd))) return NULL; + if (!(Window = IntGetWindowObject(hWnd))) return NULL; switch (Relationship) { case GW_HWNDFIRST: - if((Parent = IntGetParentObject(WindowObject))) + if((Parent = IntGetParentObject(Window))) { if (Parent->FirstChild) - hWndResult = Parent->FirstChild->Self; + hWndResult = Parent->FirstChild->hSelf; IntReleaseWindowObject(Parent); } break; case GW_HWNDLAST: - if((Parent = IntGetParentObject(WindowObject))) + if((Parent = IntGetParentObject(Window))) { if (Parent->LastChild) - hWndResult = Parent->LastChild->Self; + hWndResult = Parent->LastChild->hSelf; IntReleaseWindowObject(Parent); } break; case GW_HWNDNEXT: - if (WindowObject->NextSibling) - hWndResult = WindowObject->NextSibling->Self; + if (Window->NextSibling) + hWndResult = Window->NextSibling->hSelf; break; case GW_HWNDPREV: - if (WindowObject->PrevSibling) - hWndResult = WindowObject->PrevSibling->Self; + if (Window->PrevSibling) + hWndResult = Window->PrevSibling->hSelf; break; case GW_OWNER: - if((Parent = IntGetWindowObject(WindowObject->Owner))) + if((Parent = IntGetWindowObject(Window->Owner))) { - hWndResult = Parent->Self; + hWndResult = Parent->hSelf; IntReleaseWindowObject(Parent); } break; case GW_CHILD: - if (WindowObject->FirstChild) - hWndResult = WindowObject->FirstChild->Self; + if (Window->FirstChild) + hWndResult = Window->FirstChild->hSelf; break; } - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); return hWndResult; } @@ -3316,13 +3312,12 @@ CLEANUP: LONG FASTCALL UserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi) { - PWINDOW_OBJECT WindowObject, Parent; + PWINDOW_OBJECT Window, Parent; LONG Result = 0; DPRINT("NtUserGetWindowLong(%x,%d,%d)\n", hWnd, (INT)Index, Ansi); - WindowObject = IntGetWindowObject(hWnd); - if (WindowObject == NULL) + if (!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); return 0; @@ -3332,7 +3327,7 @@ UserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi) * WndProc is only available to the owner process */ if (GWL_WNDPROC == Index - && WindowObject->OwnerThread->ThreadsProcess != PsGetCurrentProcess()) + && Window->OwnerThread->ThreadsProcess != PsGetCurrentProcess()) { SetLastWin32Error(ERROR_ACCESS_DENIED); return 0; @@ -3340,54 +3335,54 @@ UserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi) if ((INT)Index >= 0) { - if ((Index + sizeof(LONG)) > WindowObject->ExtraDataSize) + if ((Index + sizeof(LONG)) > Window->ExtraDataSize) { SetLastWin32Error(ERROR_INVALID_PARAMETER); return 0; } - Result = *((LONG *)(WindowObject->ExtraData + Index)); + Result = *((LONG *)(Window->ExtraData + Index)); } else { switch (Index) { case GWL_EXSTYLE: - Result = WindowObject->ExStyle; + Result = Window->ExStyle; break; case GWL_STYLE: - Result = WindowObject->Style; + Result = Window->Style; break; case GWL_WNDPROC: if (Ansi) - Result = (LONG) WindowObject->WndProcA; + Result = (LONG) Window->WndProcA; else - Result = (LONG) WindowObject->WndProcW; + Result = (LONG) Window->WndProcW; break; case GWL_HINSTANCE: - Result = (LONG) WindowObject->Instance; + Result = (LONG) Window->Instance; break; case GWL_HWNDPARENT: - Parent = IntGetWindowObject(WindowObject->Parent); + Parent = IntGetWindowObject(Window->Parent); if(Parent) { - if (Parent && Parent->Self == IntGetDesktopWindow()) - Result = (LONG) UserGetWindow(WindowObject->Self, GW_OWNER); + if (Parent && Parent->hSelf == IntGetDesktopWindow()) + Result = (LONG) UserGetWindow(Window->hSelf, GW_OWNER); else - Result = (LONG) Parent->Self; + Result = (LONG) Parent->hSelf; IntReleaseWindowObject(Parent); } break; case GWL_ID: - Result = (LONG) WindowObject->IDMenu; + Result = (LONG) Window->IDMenu; break; case GWL_USERDATA: - Result = WindowObject->UserData; + Result = Window->UserData; break; default: @@ -3398,7 +3393,7 @@ UserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi) } } - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); return Result; } @@ -3439,7 +3434,7 @@ CLEANUP: LONG FASTCALL UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi) { - PWINDOW_OBJECT WindowObject, Parent; + PWINDOW_OBJECT Window, Parent; PWINSTATION_OBJECT WindowStation; LONG OldValue; STYLESTRUCT Style; @@ -3450,8 +3445,7 @@ UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi) return( 0); } - WindowObject = IntGetWindowObject(hWnd); - if (WindowObject == NULL) + if (!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); return( 0); @@ -3459,28 +3453,28 @@ UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi) if ((INT)Index >= 0) { - if ((Index + sizeof(LONG)) > WindowObject->ExtraDataSize) + if ((Index + sizeof(LONG)) > Window->ExtraDataSize) { SetLastWin32Error(ERROR_INVALID_PARAMETER); - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); return( 0); } - OldValue = *((LONG *)(WindowObject->ExtraData + Index)); - *((LONG *)(WindowObject->ExtraData + Index)) = NewValue; + OldValue = *((LONG *)(Window->ExtraData + Index)); + *((LONG *)(Window->ExtraData + Index)) = NewValue; } else { switch (Index) { case GWL_EXSTYLE: - OldValue = (LONG) WindowObject->ExStyle; + OldValue = (LONG) Window->ExStyle; Style.styleOld = OldValue; Style.styleNew = NewValue; /* * Remove extended window style bit WS_EX_TOPMOST for shell windows. */ - WindowStation = WindowObject->OwnerThread->Tcb.Win32Thread->Desktop->WindowStation; + WindowStation = Window->OwnerThread->Tcb.Win32Thread->Desktop->WindowStation; if(WindowStation) { if (hWnd == WindowStation->ShellWindow || hWnd == WindowStation->ShellListView) @@ -3488,16 +3482,16 @@ UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi) } co_IntSendMessage(hWnd, WM_STYLECHANGING, GWL_EXSTYLE, (LPARAM) &Style); - WindowObject->ExStyle = (DWORD)Style.styleNew; + Window->ExStyle = (DWORD)Style.styleNew; co_IntSendMessage(hWnd, WM_STYLECHANGED, GWL_EXSTYLE, (LPARAM) &Style); break; case GWL_STYLE: - OldValue = (LONG) WindowObject->Style; + OldValue = (LONG) Window->Style; Style.styleOld = OldValue; Style.styleNew = NewValue; co_IntSendMessage(hWnd, WM_STYLECHANGING, GWL_STYLE, (LPARAM) &Style); - WindowObject->Style = (DWORD)Style.styleNew; + Window->Style = (DWORD)Style.styleNew; co_IntSendMessage(hWnd, WM_STYLECHANGED, GWL_STYLE, (LPARAM) &Style); break; @@ -3505,43 +3499,43 @@ UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi) /* FIXME: should check if window belongs to current process */ if (Ansi) { - OldValue = (LONG) WindowObject->WndProcA; - WindowObject->WndProcA = (WNDPROC) NewValue; - WindowObject->WndProcW = (WNDPROC) IntAddWndProcHandle((WNDPROC)NewValue,FALSE); - WindowObject->Unicode = FALSE; + OldValue = (LONG) Window->WndProcA; + Window->WndProcA = (WNDPROC) NewValue; + Window->WndProcW = (WNDPROC) IntAddWndProcHandle((WNDPROC)NewValue,FALSE); + Window->Unicode = FALSE; } else { - OldValue = (LONG) WindowObject->WndProcW; - WindowObject->WndProcW = (WNDPROC) NewValue; - WindowObject->WndProcA = (WNDPROC) IntAddWndProcHandle((WNDPROC)NewValue,TRUE); - WindowObject->Unicode = TRUE; + OldValue = (LONG) Window->WndProcW; + Window->WndProcW = (WNDPROC) NewValue; + Window->WndProcA = (WNDPROC) IntAddWndProcHandle((WNDPROC)NewValue,TRUE); + Window->Unicode = TRUE; } break; case GWL_HINSTANCE: - OldValue = (LONG) WindowObject->Instance; - WindowObject->Instance = (HINSTANCE) NewValue; + OldValue = (LONG) Window->Instance; + Window->Instance = (HINSTANCE) NewValue; break; case GWL_HWNDPARENT: - Parent = IntGetParentObject(WindowObject); - if (Parent && (Parent->Self == IntGetDesktopWindow())) - OldValue = (LONG) IntSetOwner(WindowObject->Self, (HWND) NewValue); + Parent = IntGetParentObject(Window); + if (Parent && (Parent->hSelf == IntGetDesktopWindow())) + OldValue = (LONG) IntSetOwner(Window->hSelf, (HWND) NewValue); else - OldValue = (LONG) UserSetParent(WindowObject->Self, (HWND) NewValue); + OldValue = (LONG) UserSetParent(Window->hSelf, (HWND) NewValue); if(Parent) IntReleaseWindowObject(Parent); break; case GWL_ID: - OldValue = (LONG) WindowObject->IDMenu; - WindowObject->IDMenu = (UINT) NewValue; + OldValue = (LONG) Window->IDMenu; + Window->IDMenu = (UINT) NewValue; break; case GWL_USERDATA: - OldValue = WindowObject->UserData; - WindowObject->UserData = NewValue; + OldValue = Window->UserData; + Window->UserData = NewValue; break; default: @@ -3552,7 +3546,7 @@ UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi) } } - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); return( OldValue); } @@ -3598,7 +3592,7 @@ CLEANUP: WORD STDCALL NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewValue) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; WORD OldValue; DECLARE_RETURN(WORD); @@ -3619,24 +3613,23 @@ NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewValue) } } - WindowObject = IntGetWindowObject(hWnd); - if (WindowObject == NULL) + if (!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( 0); } - if (Index > WindowObject->ExtraDataSize - sizeof(WORD)) + if (Index > Window->ExtraDataSize - sizeof(WORD)) { SetLastWin32Error(ERROR_INVALID_PARAMETER); - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( 0); } - OldValue = *((WORD *)(WindowObject->ExtraData + Index)); - *((WORD *)(WindowObject->ExtraData + Index)) = NewValue; + OldValue = *((WORD *)(Window->ExtraData + Index)); + *((WORD *)(Window->ExtraData + Index)) = NewValue; - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( OldValue); @@ -3653,7 +3646,7 @@ BOOL STDCALL NtUserGetWindowPlacement(HWND hWnd, WINDOWPLACEMENT *lpwndpl) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; PINTERNALPOS InternalPos; POINT Size; WINDOWPLACEMENT Safepl; @@ -3663,8 +3656,7 @@ NtUserGetWindowPlacement(HWND hWnd, DPRINT("Enter NtUserGetWindowPlacement\n"); UserEnterShared(); - WindowObject = IntGetWindowObject(hWnd); - if (WindowObject == NULL) + if (!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( FALSE); @@ -3674,22 +3666,22 @@ NtUserGetWindowPlacement(HWND hWnd, if(!NT_SUCCESS(Status)) { SetLastNtError(Status); - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( FALSE); } if(Safepl.length != sizeof(WINDOWPLACEMENT)) { - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( FALSE); } Safepl.flags = 0; - Safepl.showCmd = ((WindowObject->Flags & WINDOWOBJECT_RESTOREMAX) ? SW_MAXIMIZE : SW_SHOWNORMAL); + Safepl.showCmd = ((Window->Flags & WINDOWOBJECT_RESTOREMAX) ? SW_MAXIMIZE : SW_SHOWNORMAL); - Size.x = WindowObject->WindowRect.left; - Size.y = WindowObject->WindowRect.top; - InternalPos = WinPosInitInternalPos(WindowObject, &Size, - &WindowObject->WindowRect); + Size.x = Window->WindowRect.left; + Size.y = Window->WindowRect.top; + InternalPos = WinPosInitInternalPos(Window, &Size, + &Window->WindowRect); if (InternalPos) { Safepl.rcNormalPosition = InternalPos->NormalRect; @@ -3698,7 +3690,7 @@ NtUserGetWindowPlacement(HWND hWnd, } else { - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( FALSE); } @@ -3706,11 +3698,11 @@ NtUserGetWindowPlacement(HWND hWnd, if(!NT_SUCCESS(Status)) { SetLastNtError(Status); - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( FALSE); } - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( TRUE); CLEANUP: @@ -3999,35 +3991,34 @@ NtUserSetLogonNotifyWindow(DWORD Unknown0) */ BOOL STDCALL NtUserSetMenu( - HWND Wnd, + HWND hWnd, HMENU Menu, BOOL Repaint) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; BOOL Changed; DECLARE_RETURN(BOOL); DPRINT("Enter NtUserSetMenu\n"); UserEnterExclusive(); - WindowObject = IntGetWindowObject((HWND) Wnd); - if (NULL == WindowObject) + if (!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( FALSE); } - if (! IntSetMenu(WindowObject, Menu, &Changed)) + if (! IntSetMenu(Window, Menu, &Changed)) { - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( FALSE); } - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); if (Changed && Repaint) { - co_WinPosSetWindowPos(Wnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | + co_WinPosSetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED); } @@ -4061,7 +4052,7 @@ BOOL STDCALL NtUserSetWindowPlacement(HWND hWnd, WINDOWPLACEMENT *lpwndpl) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; WINDOWPLACEMENT Safepl; NTSTATUS Status; DECLARE_RETURN(BOOL); @@ -4069,8 +4060,7 @@ NtUserSetWindowPlacement(HWND hWnd, DPRINT("Enter NtUserSetWindowPlacement\n"); UserEnterExclusive(); - WindowObject = IntGetWindowObject(hWnd); - if (WindowObject == NULL) + if (!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( FALSE); @@ -4079,18 +4069,18 @@ NtUserSetWindowPlacement(HWND hWnd, if(!NT_SUCCESS(Status)) { SetLastNtError(Status); - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( FALSE); } if(Safepl.length != sizeof(WINDOWPLACEMENT)) { - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( FALSE); } - if ((WindowObject->Style & (WS_MAXIMIZE | WS_MINIMIZE)) == 0) + if ((Window->Style & (WS_MAXIMIZE | WS_MINIMIZE)) == 0) { - co_WinPosSetWindowPos(WindowObject->Self, NULL, + co_WinPosSetWindowPos(Window->hSelf, NULL, Safepl.rcNormalPosition.left, Safepl.rcNormalPosition.top, Safepl.rcNormalPosition.right - Safepl.rcNormalPosition.left, Safepl.rcNormalPosition.bottom - Safepl.rcNormalPosition.top, @@ -4098,15 +4088,15 @@ NtUserSetWindowPlacement(HWND hWnd, } /* FIXME - change window status */ - co_WinPosShowWindow(WindowObject->Self, Safepl.showCmd); + co_WinPosShowWindow(Window->hSelf, Safepl.showCmd); - if (WindowObject->InternalPos == NULL) - WindowObject->InternalPos = ExAllocatePoolWithTag(PagedPool, sizeof(INTERNALPOS), TAG_WININTLIST); - WindowObject->InternalPos->NormalRect = Safepl.rcNormalPosition; - WindowObject->InternalPos->IconPos = Safepl.ptMinPosition; - WindowObject->InternalPos->MaxPos = Safepl.ptMaxPosition; + if (Window->InternalPos == NULL) + Window->InternalPos = ExAllocatePoolWithTag(PagedPool, sizeof(INTERNALPOS), TAG_WININTLIST); + Window->InternalPos->NormalRect = Safepl.rcNormalPosition; + Window->InternalPos->IconPos = Safepl.ptMinPosition; + Window->InternalPos->MaxPos = Safepl.ptMaxPosition; - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( TRUE); CLEANUP: @@ -4147,27 +4137,27 @@ INT FASTCALL IntGetWindowRgn(HWND hWnd, HRGN hRgn) { INT Ret; - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; HRGN VisRgn; ROSRGNDATA *pRgn; - if(!(WindowObject = IntGetWindowObject(hWnd))) + if(!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); return ERROR; } if(!hRgn) { - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); return ERROR; } /* Create a new window region using the window rectangle */ - VisRgn = UnsafeIntCreateRectRgnIndirect(&WindowObject->WindowRect); - NtGdiOffsetRgn(VisRgn, -WindowObject->WindowRect.left, -WindowObject->WindowRect.top); + VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->WindowRect); + NtGdiOffsetRgn(VisRgn, -Window->WindowRect.left, -Window->WindowRect.top); /* if there's a region assigned to the window, combine them both */ - if(WindowObject->WindowRegion && !(WindowObject->Style & WS_MINIMIZE)) - NtGdiCombineRgn(VisRgn, VisRgn, WindowObject->WindowRegion, RGN_AND); + if(Window->WindowRegion && !(Window->Style & WS_MINIMIZE)) + NtGdiCombineRgn(VisRgn, VisRgn, Window->WindowRegion, RGN_AND); /* Copy the region into hRgn */ NtGdiCombineRgn(hRgn, VisRgn, NULL, RGN_COPY); @@ -4181,7 +4171,7 @@ IntGetWindowRgn(HWND hWnd, HRGN hRgn) NtGdiDeleteObject(VisRgn); - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); return Ret; } @@ -4189,27 +4179,27 @@ INT FASTCALL IntGetWindowRgnBox(HWND hWnd, RECT *Rect) { INT Ret; - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; HRGN VisRgn; ROSRGNDATA *pRgn; - if(!(WindowObject = IntGetWindowObject(hWnd))) + if(!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); return ERROR; } if(!Rect) { - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); return ERROR; } /* Create a new window region using the window rectangle */ - VisRgn = UnsafeIntCreateRectRgnIndirect(&WindowObject->WindowRect); - NtGdiOffsetRgn(VisRgn, -WindowObject->WindowRect.left, -WindowObject->WindowRect.top); + VisRgn = UnsafeIntCreateRectRgnIndirect(&Window->WindowRect); + NtGdiOffsetRgn(VisRgn, -Window->WindowRect.left, -Window->WindowRect.top); /* if there's a region assigned to the window, combine them both */ - if(WindowObject->WindowRegion && !(WindowObject->Style & WS_MINIMIZE)) - NtGdiCombineRgn(VisRgn, VisRgn, WindowObject->WindowRegion, RGN_AND); + if(Window->WindowRegion && !(Window->Style & WS_MINIMIZE)) + NtGdiCombineRgn(VisRgn, VisRgn, Window->WindowRegion, RGN_AND); if((pRgn = RGNDATA_LockRgn(VisRgn))) { @@ -4222,7 +4212,7 @@ IntGetWindowRgnBox(HWND hWnd, RECT *Rect) NtGdiDeleteObject(VisRgn); - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); return Ret; } @@ -4236,14 +4226,13 @@ NtUserSetWindowRgn( HRGN hRgn, BOOL bRedraw) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; DECLARE_RETURN(INT); DPRINT("Enter NtUserSetWindowRgn\n"); UserEnterExclusive(); - WindowObject = IntGetWindowObject(hWnd); - if (WindowObject == NULL) + if (!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( 0); @@ -4252,21 +4241,21 @@ NtUserSetWindowRgn( /* FIXME - Verify if hRgn is a valid handle!!!! Propably make this operation thread-safe, but maybe it's not necessary */ - if(WindowObject->WindowRegion) + if(Window->WindowRegion) { /* Delete no longer needed region handle */ - NtGdiDeleteObject(WindowObject->WindowRegion); + NtGdiDeleteObject(Window->WindowRegion); } - WindowObject->WindowRegion = hRgn; + Window->WindowRegion = hRgn; /* FIXME - send WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages to the window */ if(bRedraw) { - co_UserRedrawWindow(WindowObject, NULL, NULL, RDW_INVALIDATE); + co_UserRedrawWindow(Window, NULL, NULL, RDW_INVALIDATE); } - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( (INT)hRgn); CLEANUP: @@ -4365,7 +4354,7 @@ NtUserWindowFromPoint(LONG X, LONG Y) if(Window) { - Ret = Window->Self; + Ret = Window->hSelf; IntReleaseWindowObject(Window); IntReleaseWindowObject(DesktopWindow); RETURN( Ret); @@ -4395,9 +4384,9 @@ CLEANUP: */ BOOL STDCALL -NtUserDefSetText(HWND WindowHandle, PUNICODE_STRING WindowText) +NtUserDefSetText(HWND hWnd, PUNICODE_STRING WindowText) { - PWINDOW_OBJECT WindowObject, Parent, Owner; + PWINDOW_OBJECT Window, Parent, Owner; UNICODE_STRING SafeText; NTSTATUS Status; DECLARE_RETURN(INT); @@ -4405,8 +4394,7 @@ NtUserDefSetText(HWND WindowHandle, PUNICODE_STRING WindowText) DPRINT("Enter NtUserDefSetText\n"); UserEnterExclusive(); - WindowObject = IntGetWindowObject(WindowHandle); - if(!WindowObject) + if(!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( FALSE); @@ -4418,7 +4406,7 @@ NtUserDefSetText(HWND WindowHandle, PUNICODE_STRING WindowText) if(!NT_SUCCESS(Status)) { SetLastNtError(Status); - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( FALSE); } } @@ -4428,18 +4416,18 @@ NtUserDefSetText(HWND WindowHandle, PUNICODE_STRING WindowText) } /* FIXME - do this thread-safe! otherwise one could crash here! */ - RtlFreeUnicodeString(&WindowObject->WindowName); + RtlFreeUnicodeString(&Window->WindowName); - WindowObject->WindowName = SafeText; + Window->WindowName = SafeText; /* Send shell notifications */ - Owner = IntGetOwner(WindowObject); - Parent = IntGetParent(WindowObject); + Owner = IntGetOwner(Window); + Parent = IntGetParent(Window); if ((!Owner) && (!Parent)) { - co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) WindowHandle); + co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) hWnd); } if (Owner) @@ -4452,7 +4440,7 @@ NtUserDefSetText(HWND WindowHandle, PUNICODE_STRING WindowText) IntReleaseWindowObject(Parent); } - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( TRUE); CLEANUP: @@ -4471,7 +4459,7 @@ CLEANUP: INT STDCALL NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; NTSTATUS Status; INT Result; DECLARE_RETURN(INT); @@ -4485,15 +4473,14 @@ NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount) RETURN( 0); } - WindowObject = IntGetWindowObject(hWnd); - if(!WindowObject) + if(!(Window = IntGetWindowObject(hWnd))) { SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE); RETURN( 0); } /* FIXME - do this thread-safe! otherwise one could crash here! */ - Result = WindowObject->WindowName.Length / sizeof(WCHAR); + Result = Window->WindowName.Length / sizeof(WCHAR); if(lpString) { const WCHAR Terminator = L'\0'; @@ -4503,11 +4490,11 @@ NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount) Copy = min(nMaxCount - 1, Result); if(Copy > 0) { - Status = MmCopyToCaller(Buffer, WindowObject->WindowName.Buffer, Copy * sizeof(WCHAR)); + Status = MmCopyToCaller(Buffer, Window->WindowName.Buffer, Copy * sizeof(WCHAR)); if(!NT_SUCCESS(Status)) { SetLastNtError(Status); - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( 0); } Buffer += Copy; @@ -4517,14 +4504,14 @@ NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount) if(!NT_SUCCESS(Status)) { SetLastNtError(Status); - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( 0); } Result = Copy; } - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); RETURN( Result); CLEANUP: diff --git a/reactos/subsys/win32k/ntuser/winpos.c b/reactos/subsys/win32k/ntuser/winpos.c index 0068eac710e..175ae5d84c3 100644 --- a/reactos/subsys/win32k/ntuser/winpos.c +++ b/reactos/subsys/win32k/ntuser/winpos.c @@ -52,18 +52,18 @@ BOOL FASTCALL IntGetClientOrigin(HWND hWnd, LPPOINT Point) { - PWINDOW_OBJECT WindowObject; + PWINDOW_OBJECT Window; - WindowObject = IntGetWindowObject((hWnd ? hWnd : IntGetDesktopWindow())); - if (WindowObject == NULL) + Window = IntGetWindowObject((hWnd ? hWnd : IntGetDesktopWindow())); + if (Window == NULL) { Point->x = Point->y = 0; return FALSE; } - Point->x = WindowObject->ClientRect.left; - Point->y = WindowObject->ClientRect.top; + Point->x = Window->ClientRect.left; + Point->y = Window->ClientRect.top; - IntReleaseWindowObject(WindowObject); + IntReleaseWindowObject(Window); return TRUE; } @@ -172,7 +172,7 @@ co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window) IntReleaseWindowObject(Old); break; } - Wnd = IntGetWindowObject(Old->NextSibling->Self); + Wnd = IntGetWindowObject(Old->NextSibling->hSelf); if (Old != Window) IntReleaseWindowObject(Old); if ((Wnd->Style & (WS_DISABLED | WS_VISIBLE)) == WS_VISIBLE && @@ -182,7 +182,7 @@ co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window) done: Fg = UserGetForegroundWindow(); - if (Wnd && (!Fg || Window->Self == Fg)) + if (Wnd && (!Fg || Window->hSelf == Fg)) { if (co_IntSetForegroundWindow(Wnd)) { @@ -244,17 +244,17 @@ WinPosFindIconPos(PWINDOW_OBJECT Window, POINT *Pos) } PINTERNALPOS FASTCALL -WinPosInitInternalPos(PWINDOW_OBJECT WindowObject, POINT *pt, PRECT RestoreRect) +WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, PRECT RestoreRect) { PWINDOW_OBJECT Parent; UINT XInc, YInc; - if (WindowObject->InternalPos == NULL) + if (Window->InternalPos == NULL) { RECT WorkArea; PDESKTOP_OBJECT Desktop = PsGetWin32Thread()->Desktop; /* Or rather get it from the window? */ - Parent = IntGetParentObject(WindowObject); + Parent = IntGetParentObject(Window); if(Parent) { if(IntIsDesktopWindow(Parent)) @@ -266,51 +266,50 @@ WinPosInitInternalPos(PWINDOW_OBJECT WindowObject, POINT *pt, PRECT RestoreRect) else IntGetDesktopWorkArea(Desktop, &WorkArea); - WindowObject->InternalPos = ExAllocatePoolWithTag(PagedPool, sizeof(INTERNALPOS), TAG_WININTLIST); - if(!WindowObject->InternalPos) + Window->InternalPos = ExAllocatePoolWithTag(PagedPool, sizeof(INTERNALPOS), TAG_WININTLIST); + if(!Window->InternalPos) { - DPRINT1("Failed to allocate INTERNALPOS structure for window 0x%x\n", WindowObject->Self); + DPRINT1("Failed to allocate INTERNALPOS structure for window 0x%x\n", Window->hSelf); return NULL; } - WindowObject->InternalPos->NormalRect = WindowObject->WindowRect; - IntGetWindowBorderMeasures(WindowObject, &XInc, &YInc); - WindowObject->InternalPos->MaxPos.x = WorkArea.left - XInc; - WindowObject->InternalPos->MaxPos.y = WorkArea.top - YInc; - WindowObject->InternalPos->IconPos.x = WorkArea.left; - WindowObject->InternalPos->IconPos.y = WorkArea.bottom - UserGetSystemMetrics(SM_CYMINIMIZED); + Window->InternalPos->NormalRect = Window->WindowRect; + IntGetWindowBorderMeasures(Window, &XInc, &YInc); + Window->InternalPos->MaxPos.x = WorkArea.left - XInc; + Window->InternalPos->MaxPos.y = WorkArea.top - YInc; + Window->InternalPos->IconPos.x = WorkArea.left; + Window->InternalPos->IconPos.y = WorkArea.bottom - UserGetSystemMetrics(SM_CYMINIMIZED); } - if (WindowObject->Style & WS_MINIMIZE) + if (Window->Style & WS_MINIMIZE) { - WindowObject->InternalPos->IconPos = *pt; + Window->InternalPos->IconPos = *pt; } - else if (WindowObject->Style & WS_MAXIMIZE) + else if (Window->Style & WS_MAXIMIZE) { - WindowObject->InternalPos->MaxPos = *pt; + Window->InternalPos->MaxPos = *pt; } else if (RestoreRect != NULL) { - WindowObject->InternalPos->NormalRect = *RestoreRect; + Window->InternalPos->NormalRect = *RestoreRect; } - return(WindowObject->InternalPos); + return(Window->InternalPos); } UINT FASTCALL -co_WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos) +co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos) { POINT Size; PINTERNALPOS InternalPos; UINT SwpFlags = 0; - Size.x = WindowObject->WindowRect.left; - Size.y = WindowObject->WindowRect.top; - InternalPos = WinPosInitInternalPos(WindowObject, &Size, - &WindowObject->WindowRect); + Size.x = Window->WindowRect.left; + Size.y = Window->WindowRect.top; + InternalPos = WinPosInitInternalPos(Window, &Size, &Window->WindowRect); if (InternalPos) { - if (WindowObject->Style & WS_MINIMIZE) + if (Window->Style & WS_MINIMIZE) { - if (!co_IntSendMessage(WindowObject->Self, WM_QUERYOPEN, 0, 0)) + if (!co_IntSendMessage(Window->hSelf, WM_QUERYOPEN, 0, 0)) { return(SWP_NOSIZE | SWP_NOMOVE); } @@ -320,19 +319,19 @@ co_WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos) { case SW_MINIMIZE: { - if (WindowObject->Style & WS_MAXIMIZE) + if (Window->Style & WS_MAXIMIZE) { - WindowObject->Flags |= WINDOWOBJECT_RESTOREMAX; - WindowObject->Style &= ~WS_MAXIMIZE; + Window->Flags |= WINDOWOBJECT_RESTOREMAX; + Window->Style &= ~WS_MAXIMIZE; } else { - WindowObject->Flags &= ~WINDOWOBJECT_RESTOREMAX; + Window->Flags &= ~WINDOWOBJECT_RESTOREMAX; } - co_UserRedrawWindow(WindowObject, NULL, 0, RDW_VALIDATE | RDW_NOERASE | + co_UserRedrawWindow(Window, NULL, 0, RDW_VALIDATE | RDW_NOERASE | RDW_NOINTERNALPAINT); - WindowObject->Style |= WS_MINIMIZE; - WinPosFindIconPos(WindowObject, &InternalPos->IconPos); + Window->Style |= WS_MINIMIZE; + WinPosFindIconPos(Window, &InternalPos->IconPos); IntGdiSetRect(NewPos, InternalPos->IconPos.x, InternalPos->IconPos.y, UserGetSystemMetrics(SM_CXMINIMIZED), UserGetSystemMetrics(SM_CYMINIMIZED)); @@ -342,15 +341,15 @@ co_WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos) case SW_MAXIMIZE: { - co_WinPosGetMinMaxInfo(WindowObject, &Size, &InternalPos->MaxPos, + co_WinPosGetMinMaxInfo(Window, &Size, &InternalPos->MaxPos, NULL, NULL); DPRINT("Maximize: %d,%d %dx%d\n", InternalPos->MaxPos.x, InternalPos->MaxPos.y, Size.x, Size.y); - if (WindowObject->Style & WS_MINIMIZE) + if (Window->Style & WS_MINIMIZE) { - WindowObject->Style &= ~WS_MINIMIZE; + Window->Style &= ~WS_MINIMIZE; } - WindowObject->Style |= WS_MAXIMIZE; + Window->Style |= WS_MAXIMIZE; IntGdiSetRect(NewPos, InternalPos->MaxPos.x, InternalPos->MaxPos.y, Size.x, Size.y); break; @@ -358,14 +357,14 @@ co_WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos) case SW_RESTORE: { - if (WindowObject->Style & WS_MINIMIZE) + if (Window->Style & WS_MINIMIZE) { - WindowObject->Style &= ~WS_MINIMIZE; - if (WindowObject->Flags & WINDOWOBJECT_RESTOREMAX) + Window->Style &= ~WS_MINIMIZE; + if (Window->Flags & WINDOWOBJECT_RESTOREMAX) { - co_WinPosGetMinMaxInfo(WindowObject, &Size, + co_WinPosGetMinMaxInfo(Window, &Size, &InternalPos->MaxPos, NULL, NULL); - WindowObject->Style |= WS_MAXIMIZE; + Window->Style |= WS_MAXIMIZE; IntGdiSetRect(NewPos, InternalPos->MaxPos.x, InternalPos->MaxPos.y, Size.x, Size.y); break; @@ -380,11 +379,11 @@ co_WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECT* NewPos) } else { - if (!(WindowObject->Style & WS_MAXIMIZE)) + if (!(Window->Style & WS_MAXIMIZE)) { return 0; } - WindowObject->Style &= ~WS_MAXIMIZE; + Window->Style &= ~WS_MAXIMIZE; *NewPos = InternalPos->NormalRect; NewPos->right -= NewPos->left; NewPos->bottom -= NewPos->top; @@ -440,7 +439,7 @@ co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos, WinPosFillMinMaxInfoStruct(Window, &MinMax); - co_IntSendMessage(Window->Self, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax); + co_IntSendMessage(Window->hSelf, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax); MinMax.ptMaxTrackSize.x = max(MinMax.ptMaxTrackSize.x, MinMax.ptMinTrackSize.x); @@ -521,7 +520,7 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos, params.lppos = &winposCopy; winposCopy = *WinPos; - wvrFlags = co_IntSendMessage(Window->Self, WM_NCCALCSIZE, TRUE, (LPARAM) ¶ms); + wvrFlags = co_IntSendMessage(Window->hSelf, WM_NCCALCSIZE, TRUE, (LPARAM) ¶ms); /* If the application send back garbage, ignore it */ if (params.rgrc[0].left <= params.rgrc[0].right && @@ -568,7 +567,7 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos, } BOOL FASTCALL -co_WinPosDoWinPosChanging(PWINDOW_OBJECT WindowObject, +co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window, PWINDOWPOS WinPos, PRECT WindowRect, PRECT ClientRect) @@ -577,11 +576,11 @@ co_WinPosDoWinPosChanging(PWINDOW_OBJECT WindowObject, if (!(WinPos->flags & SWP_NOSENDCHANGING)) { - co_IntSendMessage(WindowObject->Self, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos); + co_IntSendMessage(Window->hSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos); } - *WindowRect = WindowObject->WindowRect; - *ClientRect = WindowObject->ClientRect; + *WindowRect = Window->WindowRect; + *ClientRect = Window->ClientRect; if (!(WinPos->flags & SWP_NOSIZE)) { @@ -594,8 +593,8 @@ co_WinPosDoWinPosChanging(PWINDOW_OBJECT WindowObject, PWINDOW_OBJECT Parent; X = WinPos->x; Y = WinPos->y; - Parent = IntGetParentObject(WindowObject); - if ((0 != (WindowObject->Style & WS_CHILD)) && Parent) + Parent = IntGetParentObject(Window); + if ((0 != (Window->Style & WS_CHILD)) && Parent) { X += Parent->ClientRect.left; Y += Parent->ClientRect.top; @@ -604,11 +603,11 @@ co_WinPosDoWinPosChanging(PWINDOW_OBJECT WindowObject, IntReleaseWindowObject(Parent); WindowRect->left = X; WindowRect->top = Y; - WindowRect->right += X - WindowObject->WindowRect.left; - WindowRect->bottom += Y - WindowObject->WindowRect.top; + WindowRect->right += X - Window->WindowRect.left; + WindowRect->bottom += Y - Window->WindowRect.top; IntGdiOffsetRect(ClientRect, - X - WindowObject->WindowRect.left, - Y - WindowObject->WindowRect.top); + X - Window->WindowRect.left, + Y - Window->WindowRect.top); } WinPos->flags |= SWP_NOCLIENTMOVE | SWP_NOCLIENTSIZE; @@ -808,7 +807,7 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window) { PWINDOW_OBJECT Parent = IntGetParentObject(Window); if (UserGetAncestor(WinPos->hwndInsertAfter, GA_PARENT) != - (Parent ? Parent->Self : NULL)) + (Parent ? Parent->hSelf : NULL)) { if(Parent) IntReleaseWindowObject(Parent); @@ -1277,7 +1276,7 @@ co_WinPosShowWindow(HWND Wnd, INT Cmd) return(FALSE); } Swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE; - if (Window->Self != UserGetActiveWindow()) + if (Window->hSelf != UserGetActiveWindow()) Swp |= SWP_NOACTIVATE | SWP_NOZORDER; break; } @@ -1363,7 +1362,7 @@ co_WinPosShowWindow(HWND Wnd, INT Cmd) Swp |= SWP_NOACTIVATE | SWP_NOZORDER; } - co_WinPosSetWindowPos(Window->Self, 0 != (Window->ExStyle & WS_EX_TOPMOST) + co_WinPosSetWindowPos(Window->hSelf, 0 != (Window->ExStyle & WS_EX_TOPMOST) ? HWND_TOPMOST : HWND_TOP, NewPos.left, NewPos.top, NewPos.right, NewPos.bottom, LOWORD(Swp)); @@ -1374,7 +1373,7 @@ co_WinPosShowWindow(HWND Wnd, INT Cmd) * asynchronously. */ - if (Window->Self == UserGetActiveWindow()) + if (Window->hSelf == UserGetActiveWindow()) { co_WinPosActivateOtherWindow(Window); } @@ -1484,7 +1483,7 @@ co_WinPosSearchChildren( if (OnlyHitTests && (Current->MessageQueue == OnlyHitTests)) { - *HitTest = co_IntSendMessage(Current->Self, WM_NCHITTEST, 0, + *HitTest = co_IntSendMessage(Current->hSelf, WM_NCHITTEST, 0, MAKELONG(Point->x, Point->y)); if ((*HitTest) == (USHORT)HTTRANSPARENT) continue; @@ -1530,7 +1529,7 @@ co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTes /* Translate the point to the space of the scope window. */ DesktopWindowHandle = IntGetDesktopWindow(); - if((DesktopWindowHandle != ScopeWin->Self) && + if((DesktopWindowHandle != ScopeWin->hSelf) && (DesktopWindow = IntGetWindowObject(DesktopWindowHandle))) { Point.x += ScopeWin->ClientRect.left - DesktopWindow->ClientRect.left;