Use UserHMGetHandle macro everywhere instead of obj->head.h for consistency.
ASSERT_REFS_CO(Window);
- hWnd = Window->head.h;
+ hWnd = UserHMGetHandle(Window);
TRACE("IntTranslateAccelerator(hwnd %p, message %x, wParam %x, lParam %x, fVirt 0x%x, key %x, cmd %x)\n",
hWnd, pMsg->message, pMsg->wParam, pMsg->lParam, pAccel->fVirt, pAccel->key, pAccel->cmd);
if (MenuObject)
{
if ((MENU_FindItem (&MenuObject, &nPos, MF_BYPOSITION)))
- hSubMenu = MenuObject->head.h;
+ hSubMenu = UserHMGetHandle(MenuObject);
else
hMenu = NULL;
}
if (MenuObject)
{
if ((MENU_FindItem (&MenuObject, &nPos, MF_BYPOSITION)))
- hSubMenu = MenuObject->head.h;
+ hSubMenu = UserHMGetHandle(MenuObject);
else
hMenu = NULL;
}
Accel->Table = NULL;
}
- UserDeleteObject(Accel->head.h, TYPE_ACCELTABLE);
+ UserDeleteObject(UserHMGetHandle(Accel), TYPE_ACCELTABLE);
return TRUE;
}
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
- if(Window && ThreadQueue->CaretInfo.hWnd != Window->head.h)
+ if(Window && ThreadQueue->CaretInfo.hWnd != UserHMGetHandle(Window))
{
EngSetLastError(ERROR_ACCESS_DENIED);
return FALSE;
pti = PsGetCurrentThreadWin32Thread();
ThreadQueue = pti->MessageQueue;
- if(Window && ThreadQueue->CaretInfo.hWnd != Window->head.h)
+ if(Window && ThreadQueue->CaretInfo.hWnd != UserHMGetHandle(Window))
{
EngSetLastError(ERROR_ACCESS_DENIED);
return FALSE;
if (!pWinStaObj)
return;
- co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERALLFORMATS, 0, 0);
+ co_IntSendMessage(UserHMGetHandle(pWinStaObj->spwndClipOwner), WM_RENDERALLFORMATS, 0, 0);
/* If the window being destroyed is the current clipboard owner... */
if (pWindow == pWinStaObj->spwndClipOwner)
pWinStaObj->fClipboardChanged = FALSE;
if (pWinStaObj->spwndClipViewer)
{
- TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", pWinStaObj->spwndClipViewer->head.h);
+ TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", UserHMGetHandle(pWinStaObj->spwndClipViewer));
// For 32-bit applications this message is sent as a notification
- co_IntSendMessageNoWait(pWinStaObj->spwndClipViewer->head.h, WM_DRAWCLIPBOARD, 0, 0);
+ co_IntSendMessageNoWait(UserHMGetHandle(pWinStaObj->spwndClipViewer), WM_DRAWCLIPBOARD, 0, 0);
}
}
pWinStaObj->fClipboardChanged = FALSE;
if (pWinStaObj->spwndClipViewer)
{
- TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", pWinStaObj->spwndClipViewer->head.h);
+ TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", UserHMGetHandle(pWinStaObj->spwndClipViewer));
// For 32-bit applications this message is sent as a notification
- co_IntSendMessageNoWait(pWinStaObj->spwndClipViewer->head.h, WM_DRAWCLIPBOARD, 0, 0);
+ co_IntSendMessageNoWait(UserHMGetHandle(pWinStaObj->spwndClipViewer), WM_DRAWCLIPBOARD, 0, 0);
}
}
goto cleanup;
if (pWinStaObj->spwndClipOpen)
- hWnd = pWinStaObj->spwndClipOpen->head.h;
+ hWnd = UserHMGetHandle(pWinStaObj->spwndClipOpen);
ObDereferenceObject(pWinStaObj);
pWinStaObj->spwndClipViewer = UserGetWindowObject(hWndNewNext);
if (pWinStaObj->spwndClipViewer)
- bRet = (BOOL)co_IntSendMessage(pWinStaObj->spwndClipViewer->head.h, WM_CHANGECBCHAIN, (WPARAM)hWndRemove, (LPARAM)hWndNewNext);
+ bRet = (BOOL)co_IntSendMessage(UserHMGetHandle(pWinStaObj->spwndClipViewer), WM_CHANGECBCHAIN, (WPARAM)hWndRemove, (LPARAM)hWndNewNext);
}
ObDereferenceObject(pWinStaObj);
if (pWinStaObj->spwndClipOwner)
{
- TRACE("Clipboard: WM_DESTROYCLIPBOARD to %p\n", pWinStaObj->spwndClipOwner->head.h);
+ TRACE("Clipboard: WM_DESTROYCLIPBOARD to %p\n", UserHMGetHandle(pWinStaObj->spwndClipOwner));
// For 32-bit applications this message is sent as a notification
- co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_DESTROYCLIPBOARD, 0, 0);
+ co_IntSendMessage(UserHMGetHandle(pWinStaObj->spwndClipOwner), WM_DESTROYCLIPBOARD, 0, 0);
}
pWinStaObj->spwndClipOwner = pWinStaObj->spwndClipOpen;
goto cleanup;
if (pWinStaObj->spwndClipOwner)
- hWnd = pWinStaObj->spwndClipOwner->head.h;
+ hWnd = UserHMGetHandle(pWinStaObj->spwndClipOwner);
ObDereferenceObject(pWinStaObj);
goto cleanup;
if (pWinStaObj->spwndClipViewer)
- hWnd = pWinStaObj->spwndClipViewer->head.h;
+ hWnd = UserHMGetHandle(pWinStaObj->spwndClipViewer);
ObDereferenceObject(pWinStaObj);
{
/* Send WM_RENDERFORMAT message */
pWinStaObj->fInDelayedRendering = TRUE;
- co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERFORMAT, (WPARAM)uSourceFmt, 0);
+ co_IntSendMessage(UserHMGetHandle(pWinStaObj->spwndClipOwner), WM_RENDERFORMAT, (WPARAM)uSourceFmt, 0);
pWinStaObj->fInDelayedRendering = FALSE;
/* Data should be in clipboard now */
/* Return previous viewer. New viever window should
send messages to rest of the chain */
if (pWinStaObj->spwndClipViewer)
- hWndNext = pWinStaObj->spwndClipViewer->head.h;
+ hWndNext = UserHMGetHandle(pWinStaObj->spwndClipViewer);
/* Set new viewer window */
pWinStaObj->spwndClipViewer = pWindow;
pWinStaObj->fClipboardChanged = FALSE;
if (pWinStaObj->spwndClipViewer)
{
- TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", pWinStaObj->spwndClipViewer->head.h);
+ TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", UserHMGetHandle(pWinStaObj->spwndClipViewer));
// For 32-bit applications this message is sent as a notification
- co_IntSendMessageNoWait(pWinStaObj->spwndClipViewer->head.h, WM_DRAWCLIPBOARD, 0, 0);
+ co_IntSendMessageNoWait(UserHMGetHandle(pWinStaObj->spwndClipViewer), WM_DRAWCLIPBOARD, 0, 0);
}
cleanup:
/* We just mark the handle as being destroyed.
* Deleting all the stuff will be deferred to the actual struct free. */
- UserDeleteObject(CurIcon->head.h, TYPE_CURSOR);
+ UserDeleteObject(UserHMGetHandle(CurIcon), TYPE_CURSOR);
return TRUE;
}
SafeCi.cbSize = sizeof(CURSORINFO);
SafeCi.flags = ((CurIcon && CurInfo->ShowingCursor >= 0) ? CURSOR_SHOWING : 0);
- SafeCi.hCursor = (CurIcon ? CurIcon->head.h : NULL);
+ SafeCi.hCursor = (CurIcon ? UserHMGetHandle(CurIcon) : NULL);
SafeCi.ptScreenPos = gpsi->ptCursor;
}
}
if (CurIcon)
- Ret = CurIcon->head.h;
+ Ret = UserHMGetHandle(CurIcon);
UserLeave();
done:
return NULL;
}
- ret = CurIcon->head.h;
+ ret = UserHMGetHandle(CurIcon);
if (CurIcon->CURSORF_flags & CURSORF_ACON)
{
}
jiffies = AniCurIcon->ajifRate[istep];
steps = AniCurIcon->cicur;
- ret = AniCurIcon->aspcur[AniCurIcon->aicur[istep]]->head.h;
+ ret = UserHMGetHandle(AniCurIcon->aspcur[AniCurIcon->aicur[istep]]);
}
_SEH2_TRY
case WM_SYSCOMMAND:
{
- TRACE("hwnd %p WM_SYSCOMMAND %lx %lx\n", Wnd->head.h, wParam, lParam );
+ TRACE("hwnd %p WM_SYSCOMMAND %lx %lx\n", UserHMGetHandle(Wnd), wParam, lParam );
lResult = DefWndHandleSysCommand(Wnd, wParam, lParam);
break;
}
_SEH2_END;
}
if (!lResult)
- lResult = co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)Wnd->head.h, lParam ? (LPARAM)&rt : 0);
+ lResult = co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)UserHMGetHandle(Wnd), lParam ? (LPARAM)&rt : 0);
}
break;
}
TRACE("No active desktop\n");
return NULL;
}
- return pdo->spwndMessage->head.h;
+ return UserHMGetHandle(pdo->spwndMessage);
}
// Win: _GetMessageWindow
}
pdesk->dwSessionId = PsGetCurrentProcessSessionId();
- pdesk->DesktopWindow = pWnd->head.h;
+ pdesk->DesktopWindow = UserHMGetHandle(pWnd);
pdesk->pDeskInfo->spwnd = pWnd;
pWnd->fnid = FNID_DESKTOP;
ptiChg = Wnd->head.pti;
IntSetFocusMessageQueue(Wnd->head.pti->MessageQueue);
gptiForeground = Wnd->head.pti;
- //ERR("Set Foreground pti 0x%p Q 0x%p hWnd 0x%p\n",Wnd->head.pti, Wnd->head.pti->MessageQueue,Wnd->head.h);
+ //ERR("Set Foreground pti 0x%p Q 0x%p hWnd 0x%p\n", Wnd->head.pti, Wnd->head.pti->MessageQueue, UserHMGetHandle(Wnd));
}
else
{
}
else
{
- //ERR("SFWAMQ : SAW I pti 0x%p hWnd 0x%p\n",ptiChg,Wnd->head.h);
+ //ERR("SFWAMQ : SAW I pti 0x%p hWnd 0x%p\n", ptiChg, Wnd ? UserHMGetHandle(Wnd) : NULL);
Ret = co_IntSetActiveWindow(Wnd, MouseActivate, TRUE/*Type*/, FALSE);
//if (!Ret) ERR("SFWAMQ : ISAW : return error\n");
return Ret;
if ( pumqPrev && pumq == pumqPrev )
{
HANDLE tid = Wnd ? PsGetThreadId(Wnd->head.pti->pEThread) : NULL;
- //ERR("SFWAMQ : DAW I pti 0x%p tid 0x%p hWnd 0x%p\n",ptiPrev,tid,Wnd ? Wnd->head.h : 0);
+ //ERR("SFWAMQ : DAW I pti 0x%p tid 0x%p hWnd 0x%p\n", ptiPrev, tid, Wnd ? UserHMGetHandle(Wnd) : NULL);
IntDeactivateWindow(pti, tid);
}
}
!(gpqForegroundPrev->spwndActivePrev->state2 & WNDS2_BOTTOMMOST) &&
(Wnd = VerifyWnd(gpqForegroundPrev->spwndActivePrev)) != NULL )
{
- TRACE("USAW:PAW hwnd %p\n",Wnd?Wnd->head.h:NULL);
+ TRACE("USAW:PAW hwnd %p\n", UserHMGetHandle(Wnd));
return IntUserSetActiveWindow(Wnd, FALSE, TRUE, FALSE);
}
if ( pti->MessageQueue->spwndActive &&
(Wnd = VerifyWnd(pti->MessageQueue->spwndActive)) != NULL )
{
- //ERR("USAW:AOWM hwnd %p\n",Wnd?Wnd->head.h:NULL);
+ //ERR("USAW:AOWM hwnd %p\n", UserHMGetHandle(Wnd));
if (!ActivateOtherWindowMin(Wnd))
{
// Okay, now go find someone else to play with!
if (pwndTop->spwndParent == NULL) break;
}
////
- if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)Window->head.h, (LPARAM)hWndPrev))
+ if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)UserHMGetHandle(Window), (LPARAM)hWndPrev))
{
ERR("SetFocus 1 WH_CBT Call Hook return!\n");
return 0;
IntSendFocusMessages( pti, Window);
- TRACE("Focus: %p -> %p\n", hWndPrev, Window->head.h);
+ TRACE("Focus: %p -> %p\n", hWndPrev, UserHMGetHandle(Window));
}
else /* NULL hwnd passed in */
{
{
pHook = CONTAINING_RECORD(pElem, HOOK, Chain);
NT_ASSERT(i < cHooks);
- pList[i++] = pHook->head.h;
+ pList[i++] = UserHMGetHandle(pHook);
}
pList[i] = NULL;
{
/* We have failed - destroy created object */
if (pkf)
- UserDeleteObject(pkf->head.h, TYPE_KBDFILE);
+ UserDeleteObject(UserHMGetHandle(pkf), TYPE_KBDFILE);
}
return pRet;
if (!pKl->spkf)
{
ERR("UserLoadKbdFile(%wZ) failed!\n", pustrKLID);
- UserDeleteObject(pKl->head.h, TYPE_KBDLAYOUT);
+ UserDeleteObject(UserHMGetHandle(pKl), TYPE_KBDLAYOUT);
return NULL;
}
if (!NT_SUCCESS(RtlUnicodeStringToInteger(pustrKLID, 16, (PULONG)&lCid)))
{
ERR("RtlUnicodeStringToInteger failed for '%wZ'\n", pustrKLID);
- UserDeleteObject(pKl->head.h, TYPE_KBDLAYOUT);
+ UserDeleteObject(UserHMGetHandle(pKl), TYPE_KBDLAYOUT);
return NULL;
}
*ppkfLink = pkf->pkfNext;
EngUnloadImage(pkf->hBase);
- UserDeleteObject(pkf->head.h, TYPE_KBDFILE);
+ UserDeleteObject(UserHMGetHandle(pkf), TYPE_KBDFILE);
}
/*
{
ExFreePoolWithTag(pKl->piiex, USERTAG_IME);
}
- UserDeleteObject(pKl->head.h, TYPE_KBDLAYOUT);
+ UserDeleteObject(UserHMGetHandle(pKl), TYPE_KBDLAYOUT);
return TRUE;
}
/* Remove all menu items */
IntDestroyMenu( Menu, bRecurse);
- ret = UserDeleteObject(Menu->head.h, TYPE_MENU);
+ ret = UserDeleteObject(UserHMGetHandle(Menu), TYPE_MENU);
TRACE("IntDestroyMenuObject %d\n",ret);
return ret;
}
lpmi->dwArrowsOn = Menu->dwArrowsOn;
lpmi->fFlags = Menu->fFlags;
- lpmi->Self = Menu->head.h;
+ lpmi->Self = UserHMGetHandle(Menu);
lpmi->TimeToHide = Menu->TimeToHide;
lpmi->Wnd = Menu->hWnd;
}
}
if(lpmii->fMask & MIIM_SUBMENU)
{
- lpmii->hSubMenu = MenuItem->spSubMenu ? MenuItem->spSubMenu->head.h : NULL;
+ lpmii->hSubMenu = (MenuItem->spSubMenu ? UserHMGetHandle(MenuItem->spSubMenu) : NULL);
}
if ((lpmii->fMask & MIIM_STRING) ||
{
if (UserHMGetHandle(pPopupMenu->spmenu) != hMenu)
{
- ERR("Window Pop Up hMenu %p not the same as Get hMenu %p!\n",pPopupMenu->spmenu->head.h,hMenu);
+ ERR("Window Pop Up hMenu %p not the same as Get hMenu %p!\n", UserHMGetHandle(pPopupMenu->spmenu), hMenu);
}
}
break;
if (!pWnd || UserIsDesktopWindow(pWnd) || UserIsMessageWindow(pWnd))
return 0;
- TRACE("Internal Event Msg 0x%x hWnd 0x%p\n", msg, pWnd->head.h);
+ TRACE("Internal Event Msg 0x%x hWnd 0x%p\n", msg, UserHMGetHandle(pWnd));
switch(msg)
{
if (List != NULL)
{
- UserPostMessage(DesktopWindow->head.h, Msg, wParam, lParam);
+ UserPostMessage(UserHMGetHandle(DesktopWindow), Msg, wParam, lParam);
for (i = 0; List[i]; i++)
{
PWND pwnd = UserGetWindowObject(List[i]);
if (hWnd != HWND_TOPMOST)
{
/* Send message to the desktop window too! */
- co_IntSendMessageTimeoutSingle(DesktopWindow->head.h, Msg, wParam, lParam, uFlags, uTimeout, uResult);
+ co_IntSendMessageTimeoutSingle(UserHMGetHandle(DesktopWindow), Msg, wParam, lParam, uFlags, uTimeout, uResult);
}
Children = IntWinListChildren(DesktopWindow);
if (List != NULL)
{
- UserSendNotifyMessage(DesktopWindow->head.h, Msg, wParam, lParam);
+ UserSendNotifyMessage(UserHMGetHandle(DesktopWindow), Msg, wParam, lParam);
for (i = 0; List[i]; i++)
{
PWND pwnd = UserGetWindowObject(List[i]);
else
{
pwnd = IntTopLevelWindowFromPoint(Msg->pt.x, Msg->pt.y);
- if (pwnd) Msg->hwnd = pwnd->head.h;
+ if (pwnd) Msg->hwnd = UserHMGetHandle(pwnd);
}
hdcScreen = IntGetScreenDC();
{
PostedMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry);
- if (PostedMessage->Msg.hwnd == Window->head.h)
+ if (PostedMessage->Msg.hwnd == UserHMGetHandle(Window))
{
if (PostedMessage->Msg.message == WM_QUIT && pti->QuitPosted == 0)
{
{
SentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE, ListEntry);
- if(SentMessage->Msg.hwnd == Window->head.h)
+ if(SentMessage->Msg.hwnd == UserHMGetHandle(Window))
{
ERR("Remove Window Messages %p From Sent Queue\n",SentMessage);
#if 0 // Should mark these as invalid and allow the rest clean up, so far no harm by just commenting out. See CORE-9210.
*/
if ( ( !Window || // 1
( Window == PWND_BOTTOM && CurrentMessage->Msg.hwnd == NULL ) || // 2
- ( Window != PWND_BOTTOM && Window->head.h == CurrentMessage->Msg.hwnd ) || // 3
+ ( Window != PWND_BOTTOM && UserHMGetHandle(Window) == CurrentMessage->Msg.hwnd ) || // 3
( is_mouse_message(CurrentMessage->Msg.message) ) ) && // Null window for anything mouse.
( ( ( MsgFilterLow == 0 && MsgFilterHigh == 0 ) && CurrentMessage->QS_Flags & QSflags ) ||
( MsgFilterLow <= CurrentMessage->Msg.message && MsgFilterHigh >= CurrentMessage->Msg.message ) ) )
*/
if ( ( !Window || // 1
( Window == PWND_BOTTOM && CurrentMessage->Msg.hwnd == NULL ) || // 2
- ( Window != PWND_BOTTOM && Window->head.h == CurrentMessage->Msg.hwnd ) ) && // 3
+ ( Window != PWND_BOTTOM && UserHMGetHandle(Window) == CurrentMessage->Msg.hwnd ) ) && // 3
( ( ( MsgFilterLow == 0 && MsgFilterHigh == 0 ) && CurrentMessage->QS_Flags & QSflags ) ||
( MsgFilterLow <= CurrentMessage->Msg.message && MsgFilterHigh >= CurrentMessage->Msg.message ) ) )
{
co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
{
HDC hDC;
- HWND hWnd = Wnd->head.h;
+ HWND hWnd = UserHMGetHandle(Wnd);
HRGN TempRegion = NULL;
Wnd->state &= ~WNDS_PAINTNOTPROCESSED;
VOID FASTCALL
co_IntUpdateWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
{
- HWND hWnd = Wnd->head.h;
+ HWND hWnd = UserHMGetHandle(Wnd);
if ( Wnd->hrgnUpdate != NULL || Wnd->state & WNDS_INTERNALPAINT )
{
Size = 3 * (sizeof(SBINFOEX));
if(!(Window->pSBInfoex = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO)))
{
- ERR("Unable to allocate memory for scrollbar information for window %p\n", Window->head.h);
+ ERR("Unable to allocate memory for scrollbar information for window %p\n", UserHMGetHandle(Window));
return FALSE;
}
if(!(Window->pSBInfo = DesktopHeapAlloc(Window->head.rpdesk, sizeof(SBINFO))))
{
- ERR("Unable to allocate memory for scrollbar information for window %p\n", Window->head.h);
+ ERR("Unable to allocate memory for scrollbar information for window %p\n", UserHMGetHandle(Window));
return FALSE;
}
if (wParam & MCS_QUERYENDSESSION)
{
- if (!co_IntSendMessage(WndChild->head.h, WM_QUERYENDSESSION, 0, lParams))
+ if (!co_IntSendMessage(UserHMGetHandle(WndChild), WM_QUERYENDSESSION, 0, lParams))
{
lResult = MCSR_DONOTSHUTDOWN;
break;
}
else
{
- co_IntSendMessage(WndChild->head.h, WM_ENDSESSION, KillTimers, lParams);
+ co_IntSendMessage(UserHMGetHandle(WndChild), WM_ENDSESSION, KillTimers, lParams);
if (KillTimers)
{
DestroyTimersForWindow(WndChild->head.pti, WndChild);
/* Send to the caller */
if (wParam & MCS_QUERYENDSESSION)
{
- if (!co_IntSendMessage(pWindow->head.h, WM_QUERYENDSESSION, 0, lParams))
+ if (!co_IntSendMessage(UserHMGetHandle(pWindow), WM_QUERYENDSESSION, 0, lParams))
{
lResult = MCSR_DONOTSHUTDOWN;
}
}
else
{
- co_IntSendMessage(pWindow->head.h, WM_ENDSESSION, KillTimers, lParams);
+ co_IntSendMessage(UserHMGetHandle(pWindow), WM_ENDSESSION, KillTimers, lParams);
if (KillTimers)
{
DestroyTimersForWindow(pWindow->head.pti, pWindow);
if (fAltTab && (Window->style & WS_MINIMIZE))
{
- MSG msg = { Window->head.h, WM_SYSCOMMAND, SC_RESTORE, 0 };
+ MSG msg = { UserHMGetHandle(Window), WM_SYSCOMMAND, SC_RESTORE, 0 };
MsqPostMessage(Window->head.pti, &msg, FALSE, QS_POSTMESSAGE, 0, 0);
}
break;
(pTmr->pti == pti) &&
((pTmr->pWnd == Window) || (Window == NULL)) )
{
- Msg.hwnd = (pTmr->pWnd) ? pTmr->pWnd->head.h : 0;
+ Msg.hwnd = (pTmr->pWnd ? UserHMGetHandle(pTmr->pWnd) : NULL);
Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER;
Msg.wParam = (WPARAM) pTmr->nID;
Msg.lParam = (LPARAM) pTmr->pfn;
}
DCECount++;
TRACE("Alloc DCE's! %d\n",DCECount);
- pDce->hwndCurrent = (Window ? Window->head.h : NULL);
+ pDce->hwndCurrent = (Window ? UserHMGetHandle(Window) : NULL);
pDce->pwndOrg = Window;
pDce->pwndClip = Window;
pDce->hrgnClip = NULL;
{
DcxFlags = Flags & ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW);
}
- RgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->head.h, Flags);
+ RgnVisible = DceGetVisRgn(Parent, DcxFlags, UserHMGetHandle(Window), Flags);
}
else if (Window == NULL)
{
{
DceEmpty = Dce;
}
- else if (Dce->hwndCurrent == (Wnd ? Wnd->head.h : NULL) &&
+ else if (Dce->hwndCurrent == (Wnd ? UserHMGetHandle(Wnd) : NULL) &&
((Dce->DCXFlags & DCX_CACHECOMPAREMASK) == DcxFlags))
{
UpdateClipOrigin = TRUE;
}
if (Dce == NULL) return NULL;
- Dce->hwndCurrent = (Wnd ? Wnd->head.h : NULL);
+ Dce->hwndCurrent = (Wnd ? UserHMGetHandle(Wnd) : NULL);
Dce->pwndOrg = Dce->pwndClip = Wnd;
}
else // If we are here, we are POWNED or having CLASS.
if (!(Dce->DCXFlags & DCX_CACHE))
{
// Check for Window handle than HDC match for CLASS.
- if (Dce->hwndCurrent == Wnd->head.h)
+ if (Dce->hwndCurrent == UserHMGetHandle(Wnd))
{
bUpdateVisRgn = FALSE;
break;
{
pDCE = CONTAINING_RECORD(ListEntry, DCE, List);
ListEntry = ListEntry->Flink;
- if ( pDCE->hwndCurrent == Window->head.h &&
+ if ( pDCE->hwndCurrent == UserHMGetHandle(Window) &&
!(pDCE->DCXFlags & DCX_DCEEMPTY) )
{
if (!(pDCE->DCXFlags & DCX_CACHE)) /* Owned or Class DCE */
* We should change this to TRACE when ReactOS is more stable
* (for 1.0?).
*/
- ERR("[%p] GetDC() without ReleaseDC()!\n", Window->head.h);
+ ERR("[%p] GetDC() without ReleaseDC()!\n", UserHMGetHandle(Window));
DceReleaseDC(pDCE, FALSE);
}
pDCE->DCXFlags |= DCX_DCEEMPTY;
ListEntry = ListEntry->Flink;
if (0 == (pDCE->DCXFlags & (DCX_DCEEMPTY|DCX_INDESTROY)))
{
- if (Window->head.h == pDCE->hwndCurrent)
+ if (UserHMGetHandle(Window) == pDCE->hwndCurrent)
{
CurrentWindow = Window;
}
Index = 0;
for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
{
- List[Index++] = Child->head.h;
+ List[Index++] = UserHMGetHandle(Child);
}
List[Index] = NULL;
for (Child = Desktop->spwndChild; Child; Child = Child->spwndNext)
{
if (Child->spwndOwner == Window && !IntWndIsDefaultIme(Child))
- List[Index++] = Child->head.h;
+ List[Index++] = UserHMGetHandle(Child);
}
List[Index] = NULL;
/* reset shell window handles */
if (ThreadData->rpdesk)
{
- if (Window->head.h == ThreadData->rpdesk->rpwinstaParent->ShellWindow)
+ if (UserHMGetHandle(Window) == ThreadData->rpdesk->rpwinstaParent->ShellWindow)
ThreadData->rpdesk->rpwinstaParent->ShellWindow = NULL;
- if (Window->head.h == ThreadData->rpdesk->rpwinstaParent->ShellListView)
+ if (UserHMGetHandle(Window) == ThreadData->rpdesk->rpwinstaParent->ShellListView)
ThreadData->rpdesk->rpwinstaParent->ShellListView = NULL;
}
if (WndOldParent)
{
- hWndOldParent = WndOldParent->head.h;
+ hWndOldParent = UserHMGetHandle(WndOldParent);
UserDereferenceObject(WndOldParent);
}
_SEH2_TRY
{
ProbeForWrite(phwndList, sizeof(HWND), 1);
- *phwndList = Window->head.h;
+ *phwndList = UserHMGetHandle(Window);
phwndList++;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
_SEH2_TRY
{
ProbeForWrite(phwndList, sizeof(HWND), 1);
- *phwndList = Window->head.h;
+ *phwndList = UserHMGetHandle(Window);
phwndList++;
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
USER_REFERENCE_ENTRY Ref;
UserRefObjectCo(pWindow->spwndParent, &Ref);
- co_IntSendMessage( pWindow->spwndParent->head.h,
+ co_IntSendMessage( UserHMGetHandle(pWindow->spwndParent),
WM_PARENTNOTIFY,
MAKEWPARAM( msg, pWindow->IDMenu),
- (LPARAM)pWindow->head.h );
+ (LPARAM)UserHMGetHandle(pWindow) );
UserDerefObjectCo(pWindow->spwndParent);
}
}
}
/* Now find the parent and the owner window */
- hWndParent = pti->rpdesk->pDeskInfo->spwnd->head.h;
+ hWndParent = UserHMGetHandle(pti->rpdesk->pDeskInfo->spwnd);
hWndOwner = NULL;
if (Cs->hwndParent == HWND_MESSAGE)
{
- Cs->hwndParent = hWndParent = pti->rpdesk->spwndMessage->head.h;
+ Cs->hwndParent = hWndParent = UserHMGetHandle(pti->rpdesk->spwndMessage);
}
else if (Cs->hwndParent)
{
Result = co_WinPosGetNonClientSize(Window, &Window->rcWindow, &Window->rcClient);
//rc = Window->rcWindow;
- //Result = co_IntSendMessageNoWait(Window->head.h, WM_NCCALCSIZE, FALSE, (LPARAM)&rc);
+ //Result = co_IntSendMessageNoWait(UserHMGetHandle(Window), WM_NCCALCSIZE, FALSE, (LPARAM)&rc);
//Window->rcClient = rc;
RECTL_vOffsetRect(&Window->rcWindow, MaxPos.x - Window->rcWindow.left,
return TRUE;
}
- hWnd = Window->head.h;
+ hWnd = UserHMGetHandle(Window);
ti = PsGetCurrentThreadWin32Thread();
TRACE("co_UserDestroyWindow(Window = 0x%p, hWnd = 0x%p)\n", Window, hWnd);
if(ChildAfter)
{
/* skip handles before and including ChildAfter */
- while(*phWnd && (*(phWnd++) != ChildAfter->head.h))
+ while(*phWnd && (*(phWnd++) != UserHMGetHandle(ChildAfter)))
;
}
(Child->strName.Length < 0xFFFF &&
!RtlCompareUnicodeString(WindowName, &CurrentWindowName, TRUE)))
{
- Ret = Child->head.h;
+ Ret = UserHMGetHandle(Child);
break;
}
}
_SEH2_TRY
{
- if(Parent->head.h == Desktop)
+ if(UserHMGetHandle(Parent) == Desktop)
{
HWND *List, *phWnd;
PWND TopLevelWindow;
if(ChildAfter)
{
/* skip handles before and including ChildAfter */
- while(*phWnd && (*(phWnd++) != ChildAfter->head.h))
+ while(*phWnd && (*(phWnd++) != UserHMGetHandle(ChildAfter)))
;
}
if (WindowMatches && ClassMatches)
{
- Ret = TopLevelWindow->head.h;
+ Ret = UserHMGetHandle(TopLevelWindow);
break;
}
{
/* window returns the handle of the top-level window, in case it found
the child window */
- Ret = TopLevelWindow->head.h;
+ Ret = UserHMGetHandle(TopLevelWindow);
break;
}
{
PWND WndAncestor, Parent;
- if (Wnd->head.h == IntGetDesktopWindow())
+ if (UserHMGetHandle(Wnd) == IntGetDesktopWindow())
{
return NULL;
}
case GWLP_HWNDPARENT: // LONG_PTR
Parent = Window->spwndParent;
- if (Parent && (Parent->head.h == IntGetDesktopWindow()))
- OldValue = (LONG_PTR) IntSetOwner(Window->head.h, (HWND) NewValue);
+ if (Parent && (UserHMGetHandle(Parent) == IntGetDesktopWindow()))
+ OldValue = (LONG_PTR)IntSetOwner(UserHMGetHandle(Window), (HWND)NewValue);
else
- OldValue = (LONG_PTR) co_UserSetParent(Window->head.h, (HWND) NewValue);
+ OldValue = (LONG_PTR)co_UserSetParent(UserHMGetHandle(Window), (HWND)NewValue);
break;
case GWLP_ID: // LONG
USER_REFERENCE_ENTRY Ref;
PTHREADINFO pti = gptiCurrent;
- //ERR("AOWM 1 %p\n",Wnd->head.h);
+ //ERR("AOWM 1 %p\n", UserHMGetHandle(Wnd));
ActivePrev = (pti->MessageQueue->spwndActivePrev != NULL);
FindTopWnd = TRUE;
//ERR("ActivateOtherWindowMin Set FG 1\n");
co_IntSetForegroundWindow(pWndSetActive);
UserDerefObjectCo(pWndSetActive);
- //ERR("AOWM 2 Exit Good %p\n",pWndSetActive->head.h);
+ //ERR("AOWM 2 Exit Good %p\n", UserHMGetHandle(pWndSetActive));
return TRUE;
}
if (!pWndTemp ) pWndTemp = pWndSetActive;
//ERR("ActivateOtherWindowMin Set FG 2\n");
co_IntSetForegroundWindow(pWndSetActive);
UserDerefObjectCo(pWndSetActive);
- //ERR("AOWM 3 Exit Good %p\n",pWndSetActive->head.h);
+ //ERR("AOWM 3 Exit Good %p\n", UserHMGetHandle(pWndSetActive));
return TRUE;
}
//ERR("AOWM 4 Bad\n");
if (gpqForeground && (!gpqForeground->spwndActive || Wnd == gpqForeground->spwndActive))
{
/* ReactOS can pass WndTo = NULL to co_IntSetForegroundWindow and returns FALSE. */
- //ERR("WinPosActivateOtherWindow Set FG 0x%p hWnd %p\n",WndTo, WndTo ? WndTo->head.h : 0);
+ //ERR("WinPosActivateOtherWindow Set FG 0x%p hWnd %p\n", WndTo, WndTo ? UserHMGetHandle(WndTo) : NULL);
if (co_IntSetForegroundWindow(WndTo))
{
if (WndTo) UserDerefObjectCo(WndTo);
if (!EMPTYPOINT(Window->InternalPos.MaxPos)) MinMax.ptMaxPosition = Window->InternalPos.MaxPos;
- co_IntSendMessage(Window->head.h, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax);
+ co_IntSendMessage(UserHMGetHandle(Window), WM_GETMINMAXINFO, 0, (LPARAM)&MinMax);
/* if the app didn't change the values, adapt them for the current monitor */
if ((monitor = UserGetPrimaryMonitor()))
params.lppos = &winposCopy;
winposCopy = *WinPos;
- wvrFlags = co_IntSendMessage(Window->head.h, WM_NCCALCSIZE, TRUE, (LPARAM) ¶ms);
+ wvrFlags = co_IntSendMessage(UserHMGetHandle(Window), WM_NCCALCSIZE, TRUE, (LPARAM)¶ms);
/* If the application send back garbage, ignore it */
if (params.rgrc[0].left <= params.rgrc[0].right &&
if (!(WinPos->flags & SWP_NOSENDCHANGING)
&& !((WinPos->flags & SWP_AGG_NOCLIENTCHANGE) && (WinPos->flags & SWP_SHOWWINDOW)))
{
- TRACE("Sending WM_WINDOWPOSCHANGING to hwnd %p flags %04x.\n", Window->head.h,WinPos->flags);
- co_IntSendMessage(Window->head.h, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos);
+ TRACE("Sending WM_WINDOWPOSCHANGING to hwnd %p flags %04x.\n", UserHMGetHandle(Window), WinPos->flags);
+ co_IntSendMessage(UserHMGetHandle(Window), WM_WINDOWPOSCHANGING, 0, (LPARAM)WinPos);
}
/* Calculate new position and size */
return hWndInsertAfter;
}
- Owner = Window->spwndOwner ? Window->spwndOwner->head.h : NULL;
+ Owner = (Window->spwndOwner ? UserHMGetHandle(Window->spwndOwner) : NULL);
if (Owner)
{
if (!(Wnd = ValidateHwndNoErr(List[i])))
continue;
- Owner = Wnd->spwndOwner ? Wnd->spwndOwner->head.h : NULL;
+ Owner = (Wnd->spwndOwner ? UserHMGetHandle(Wnd->spwndOwner) : NULL);
if (Owner != UserHMGetHandle(Window)) continue;
* itself.
*/
if ((WinPos->hwnd == WinPos->hwndInsertAfter) ||
- ((InsAfterWnd->spwndNext) && (WinPos->hwnd == InsAfterWnd->spwndNext->head.h)))
+ ((InsAfterWnd->spwndNext) && (WinPos->hwnd == UserHMGetHandle(InsAfterWnd->spwndNext))))
{
WinPos->flags |= SWP_NOZORDER;
}
bPointerInWindow = IntPtInWindow(Window, gpsi->ptCursor.x, gpsi->ptCursor.y);
- WinPos.hwnd = Window->head.h;
+ WinPos.hwnd = UserHMGetHandle(Window);
WinPos.hwndInsertAfter = WndInsertAfter;
WinPos.x = x;
WinPos.y = y;
Ancestor = UserGetAncestor(Window, GA_PARENT);
if ( (WinPos.flags & (SWP_NOZORDER | SWP_HIDEWINDOW | SWP_SHOWWINDOW)) != SWP_NOZORDER &&
- Ancestor && Ancestor->head.h == IntGetDesktopWindow() )
+ Ancestor && UserHMGetHandle(Ancestor) == IntGetDesktopWindow() )
{
WinPos.hwndInsertAfter = WinPosDoOwnedPopups(Window, WinPos.hwndInsertAfter);
}
RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_ALLCHILDREN);
if (UserIsDesktopWindow(Window->spwndParent))
- co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (WPARAM)Window->head.h, 0);
+ co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (WPARAM)UserHMGetHandle(Window), 0);
Window->style &= ~WS_VISIBLE; //IntSetStyle( Window, 0, WS_VISIBLE );
Window->head.pti->cVisWindows--;
{
if ((Window->style & WS_POPUP) && (Window->ExStyle & WS_EX_APPWINDOW))
{
- co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)Window->head.h, 0);
+ co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)UserHMGetHandle(Window), 0);
if (!(WinPos.flags & SWP_NOACTIVATE))
UpdateShellHook(Window);
}
{
if (!UserIsDesktopWindow(Window))
{
- co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)Window->head.h, 0);
+ co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)UserHMGetHandle(Window), 0);
if (!(WinPos.flags & SWP_NOACTIVATE))
UpdateShellHook(Window);
}
/* And last, send the WM_WINDOWPOSCHANGED message */
- TRACE("\tstatus hwnd %p flags = %04x\n",Window?Window->head.h:NULL,WinPos.flags & SWP_AGG_STATUSFLAGS);
+ TRACE("\tstatus hwnd %p flags = %04x\n", Window ? UserHMGetHandle(Window) : NULL, WinPos.flags & SWP_AGG_STATUSFLAGS);
if (((WinPos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE)
&& !((flags & SWP_AGG_NOCLIENTCHANGE) && (flags & SWP_SHOWWINDOW)))
ASSERT_REFS_CO(Window);
*ClientRect = *WindowRect;
- Result = co_IntSendMessageNoWait(Window->head.h, WM_NCCALCSIZE, FALSE, (LPARAM) ClientRect);
+ Result = co_IntSendMessageNoWait(UserHMGetHandle(Window), WM_NCCALCSIZE, FALSE, (LPARAM)ClientRect);
FixClientRect(ClientRect, WindowRect);
wpl.length = sizeof(wpl);
IntGetWindowPlacement( Wnd, &wpl );
- if (co_HOOK_CallHooks( WH_CBT, HCBT_MINMAX, (WPARAM)Wnd->head.h, ShowFlag))
+ if (co_HOOK_CallHooks(WH_CBT, HCBT_MINMAX, (WPARAM)UserHMGetHandle(Wnd), ShowFlag))
{
ERR("WinPosMinMaximize WH_CBT Call Hook return!\n");
return SWP_NOSIZE | SWP_NOMOVE;
case SW_FORCEMINIMIZE:
return SWP_NOSIZE | SWP_NOMOVE;
}
- if (!co_IntSendMessageNoWait(Wnd->head.h, WM_QUERYOPEN, 0, 0))
+ if (!co_IntSendMessageNoWait(UserHMGetHandle(Wnd), WM_QUERYOPEN, 0, 0))
{
return(SWP_NOSIZE | SWP_NOMOVE);
}
style = Wnd->style;
TRACE("co_WinPosShowWindow START hwnd %p Cmd %d usicmd %u\n",
- Wnd->head.h, Cmd, pti->ppi->usi.wShowWindow);
+ UserHMGetHandle(Wnd), Cmd, pti->ppi->usi.wShowWindow);
if ( pti->ppi->usi.dwFlags & STARTF_USESHOWWINDOW )
{
if ((ShowFlag != WasVisible || Cmd == SW_SHOWNA) && Cmd != SW_SHOWMAXIMIZED && !(Swp & SWP_STATECHANGED))
{
- co_IntSendMessageNoWait(Wnd->head.h, WM_SHOWWINDOW, ShowFlag, 0);
+ co_IntSendMessageNoWait(UserHMGetHandle(Wnd), WM_SHOWWINDOW, ShowFlag, 0);
#if 0 // Fix wine msg test_SetParent:WmSetParentSeq_1:2
if (!(Wnd->state2 & WNDS2_WIN31COMPAT)) // <------------- XP sets this bit!
- co_IntSendMessageNoWait(Wnd->head.h, WM_SETVISIBLE, ShowFlag, 0);
+ co_IntSendMessageNoWait(UserHMGetHandle(Wnd), WM_SETVISIBLE, ShowFlag, 0);
#endif
if (!VerifyWnd(Wnd)) return WasVisible;
}
if (ScopeWin->head.pti == PsGetCurrentThreadWin32Thread())
{
- *HitTest = (USHORT)co_IntSendMessage(ScopeWin->head.h, WM_NCHITTEST, 0, MAKELONG(Point->x, Point->y));
+ *HitTest = (USHORT)co_IntSendMessage(UserHMGetHandle(ScopeWin), WM_NCHITTEST, 0, MAKELONG(Point->x, Point->y));
if ((*HitTest) == (USHORT)HTTRANSPARENT)
{