if (Wnd->Style & WS_POPUP)
{
- IntLockRelatives(Wnd);
hWnd = Wnd->Owner;
- IntUnLockRelatives(Wnd);
return IntGetWindowObject(hWnd);
}
else if (Wnd->Style & WS_CHILD)
{
- IntLockRelatives(Wnd);
hWnd = Wnd->Parent;
- IntUnLockRelatives(Wnd);
return IntGetWindowObject(hWnd);
}
{
HWND hWnd;
- IntLockRelatives(Wnd);
hWnd = Wnd->Owner;
- IntUnLockRelatives(Wnd);
return IntGetWindowObject(hWnd);
}
{
HWND hParent;
- IntLockRelatives(Wnd);
hParent = Wnd->Parent;
- IntUnLockRelatives(Wnd);
return IntGetWindowObject(hParent);
}
HWND *List;
UINT Index, NumChildren = 0;
- IntLockRelatives(Window);
-
for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
++NumChildren;
if(!List)
{
DPRINT1("Failed to allocate memory for children array\n");
- IntUnLockRelatives(Window);
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
return NULL;
}
List[Index] = Child->Self;
List[Index] = NULL;
- IntUnLockRelatives(Window);
-
return List;
}
ASSERT(Window);
- IntLockThreadWindows(Window->OwnerThread->Tcb.Win32Thread);
if(Window->Status & WINDOWSTATUS_DESTROYING)
{
- IntUnLockThreadWindows(Window->OwnerThread->Tcb.Win32Thread);
DPRINT("Tried to call IntDestroyWindow() twice\n");
return 0;
}
don't get into trouble when destroying the thread windows while we're still
in IntDestroyWindow() */
RemoveEntryList(&Window->ThreadListEntry);
- IntUnLockThreadWindows(Window->OwnerThread->Tcb.Win32Thread);
BelongsToThreadData = IntWndBelongsToThread(Window, ThreadData);
MsqRemoveWindowMessagesFromQueue(Window);
/* from now on no messages can be sent to this window anymore */
- IntLockThreadWindows(Window->OwnerThread->Tcb.Win32Thread);
Window->Status |= WINDOWSTATUS_DESTROYED;
/* don't remove the WINDOWSTATUS_DESTROYING bit */
- IntUnLockThreadWindows(Window->OwnerThread->Tcb.Win32Thread);
/* reset shell window handles */
if(ThreadData->Desktop)
IntDestroyScrollBars(Window);
/* remove the window from the class object */
- IntLockClassWindows(Window->Class);
RemoveEntryList(&Window->ClassListEntry);
- IntUnLockClassWindows(Window->Class);
/* dereference the class */
ClassDereferenceObject(Window->Class);
Win32Thread = Thread->Tcb.Win32Thread;
Win32Process = (PW32PROCESS)Thread->ThreadsProcess->Win32Process;
- IntLockThreadWindows(Win32Thread);
Current = Win32Thread->WindowListHead.Flink;
while (Current != &(Win32Thread->WindowListHead))
{
if(!List)
{
DPRINT("Not enough memory to allocate window handle list\n");
- IntUnLockThreadWindows(Win32Thread);
return;
}
pWnd = List;
pWnd++;
Current = Current->Flink;
}
- IntUnLockThreadWindows(Win32Thread);
*pWnd = NULL;
for(pWnd = List; *pWnd; pWnd++)
return;
}
- IntUnLockThreadWindows(Win32Thread);
}
{
PWINDOW_OBJECT Parent;
- IntLockRelatives(Wnd);
Wnd->Parent = WndParent->Self;
if ((Wnd->PrevSibling = WndPrevSibling))
{
Wnd->NextSibling->PrevSibling = Wnd;
else if ((Parent = IntGetWindowObject(Wnd->Parent)))
{
- IntLockRelatives(Parent);
if(Parent->LastChild == WndPrevSibling)
Parent->LastChild = Wnd;
- IntUnLockRelatives(Parent);
IntReleaseWindowObject(Parent);
}
Wnd->PrevSibling->NextSibling = Wnd;
Wnd->NextSibling->PrevSibling = Wnd;
else if (Parent)
{
- IntLockRelatives(Parent);
Parent->LastChild = Wnd;
Parent->FirstChild = Wnd;
- IntUnLockRelatives(Parent);
IntReleaseWindowObject(Parent);
- IntUnLockRelatives(Wnd);
return;
}
if(Parent)
{
- IntLockRelatives(Parent);
Parent->FirstChild = Wnd;
- IntUnLockRelatives(Parent);
IntReleaseWindowObject(Parent);
}
}
- IntUnLockRelatives(Wnd);
+
}
HWND FASTCALL
if(!Wnd)
return NULL;
- IntLockRelatives(Wnd);
WndOldOwner = IntGetWindowObject(Wnd->Owner);
if (WndOldOwner)
{
else
Wnd->Owner = NULL;
- IntUnLockRelatives(Wnd);
IntReleaseWindowObject(Wnd);
return ret;
}
if (0 == (Wnd->ExStyle & WS_EX_TOPMOST))
{
/* Not a TOPMOST window, put after TOPMOSTs of new parent */
- IntLockRelatives(WndNewParent);
Sibling = WndNewParent->FirstChild;
while (NULL != Sibling && 0 != (Sibling->ExStyle & WS_EX_TOPMOST))
{
InsertAfter = Sibling;
Sibling = Sibling->NextSibling;
}
- IntUnLockRelatives(WndNewParent);
}
if (NULL == InsertAfter)
{
{
PWINDOW_OBJECT WndParent;
- IntLockRelatives(Wnd);
if((WndParent = IntGetWindowObject(Wnd->Parent)))
{
- IntLockRelatives(WndParent);
+
}
if (Wnd->NextSibling) Wnd->NextSibling->PrevSibling = Wnd->PrevSibling;
if(WndParent)
{
- IntUnLockRelatives(WndParent);
IntReleaseWindowObject(WndParent);
}
Wnd->PrevSibling = Wnd->NextSibling = Wnd->Parent = NULL;
- IntUnLockRelatives(Wnd);
}
BOOL FASTCALL
return FALSE;
}
- IntLockRelatives(Window);
for(Child = Window->FirstChild; Child; Child = Child->NextSibling)
{
if(Child->Owner && Child->Style & WS_VISIBLE)
* The desktop has a popup window if one of them has
* an owner window and is visible
*/
- IntUnLockRelatives(Window);
IntReleaseWindowObject(Window);
return TRUE;
}
}
- IntUnLockRelatives(Window);
+
IntReleaseWindowObject(Window);
return FALSE;
}
return 0;
}
- IntLockRelatives(Window);
for(Child = Window->FirstChild; Child != NULL; Child = Child->NextSibling)
{
if(dwCount++ < nBufSize && pWnd)
}
}
}
- IntUnLockRelatives(Window);
IntReleaseWindowObject(Window);
}
return 0;
}
- IntLockThreadWindows(W32Thread);
Current = W32Thread->WindowListHead.Flink;
while(Current != &(W32Thread->WindowListHead))
{
dwCount++;
Current = Current->Flink;
}
- IntUnLockThreadWindows(W32Thread);
ObDereferenceObject(Thread);
}
return 0;
}
- IntLockRelatives(Window);
for(Child = Window->FirstChild; Child != NULL; Child = Child->NextSibling)
{
if(dwCount++ < nBufSize && pWnd)
}
}
}
- IntUnLockRelatives(Window);
IntReleaseWindowObject(Window);
if(hDesktop)
* Fill out the structure describing it.
*/
WindowObject->Class = ClassObject;
- IntLockClassWindows(ClassObject);
+
InsertTailList(&ClassObject->ClassWindowsListHead, &WindowObject->ClassListEntry);
- IntUnLockClassWindows(ClassObject);
WindowObject->ExStyle = dwExStyle;
WindowObject->Style = dwStyle & ~WS_VISIBLE;
}
InitializeListHead(&WindowObject->PropListHead);
- ExInitializeFastMutex(&WindowObject->PropListLock);
- ExInitializeFastMutex(&WindowObject->RelativesLock);
ExInitializeFastMutex(&WindowObject->UpdateLock);
InitializeListHead(&WindowObject->WndObjListHead);
ExInitializeFastMutex(&WindowObject->WndObjListLock);
}
/* Insert the window into the thread's window list. */
- IntLockThreadWindows(PsGetWin32Thread());
InsertTailList (&PsGetWin32Thread()->WindowListHead,
&WindowObject->ThreadListEntry);
- IntUnLockThreadWindows(PsGetWin32Thread());
/* Allocate a DCE for this window. */
if (dwStyle & CS_OWNDC)
if ((dwStyle & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
{
PWINDOW_OBJECT PrevSibling;
- IntLockRelatives(ParentWindow);
if((PrevSibling = ParentWindow->LastChild))
IntReferenceWindowObject(PrevSibling);
- IntUnLockRelatives(ParentWindow);
/* link window as bottom sibling */
IntLinkWindow(WindowObject, ParentWindow, PrevSibling /*prev sibling*/);
if(PrevSibling)
PWINDOW_OBJECT InsertAfter, Sibling;
if (0 == (dwExStyle & WS_EX_TOPMOST))
{
- IntLockRelatives(ParentWindow);
InsertAfter = NULL;
Sibling = ParentWindow->FirstChild;
while (NULL != Sibling && 0 != (Sibling->ExStyle & WS_EX_TOPMOST))
InsertAfter = Sibling;
Sibling = Sibling->NextSibling;
}
- IntUnLockRelatives(ParentWindow);
}
else
{
Child = IntGetWindowObject(*ChildHandle);
if (Child == NULL)
continue;
- IntLockRelatives(Child);
if (Child->Owner != Window->Self)
{
- IntUnLockRelatives(Child);
IntReleaseWindowObject(Child);
continue;
}
- IntUnLockRelatives(Child);
+
if (IntWndBelongsToThread(Child, PsGetWin32Thread()))
{
co_UserDestroyWindow(Child);
GotOne = TRUE;
continue;
}
- IntLockRelatives(Child);
+
if (Child->Owner != NULL)
{
Child->Owner = NULL;
}
- IntUnLockRelatives(Child);
+
IntReleaseWindowObject(Child);
}
ExFreePool(Children);
case GW_HWNDFIRST:
if((Parent = IntGetParentObject(WindowObject)))
{
- IntLockRelatives(Parent);
if (Parent->FirstChild)
hWndResult = Parent->FirstChild->Self;
- IntUnLockRelatives(Parent);
+
IntReleaseWindowObject(Parent);
}
break;
case GW_HWNDLAST:
if((Parent = IntGetParentObject(WindowObject)))
{
- IntLockRelatives(Parent);
if (Parent->LastChild)
hWndResult = Parent->LastChild->Self;
- IntUnLockRelatives(Parent);
+
IntReleaseWindowObject(Parent);
}
break;
case GW_HWNDNEXT:
- IntLockRelatives(WindowObject);
if (WindowObject->NextSibling)
hWndResult = WindowObject->NextSibling->Self;
- IntUnLockRelatives(WindowObject);
break;
case GW_HWNDPREV:
- IntLockRelatives(WindowObject);
if (WindowObject->PrevSibling)
hWndResult = WindowObject->PrevSibling->Self;
- IntUnLockRelatives(WindowObject);
break;
case GW_OWNER:
- IntLockRelatives(WindowObject);
if((Parent = IntGetWindowObject(WindowObject->Owner)))
{
hWndResult = Parent->Self;
IntReleaseWindowObject(Parent);
}
- IntUnLockRelatives(WindowObject);
break;
case GW_CHILD:
- IntLockRelatives(WindowObject);
if (WindowObject->FirstChild)
hWndResult = WindowObject->FirstChild->Self;
- IntUnLockRelatives(WindowObject);
break;
}
break;
case GWL_HWNDPARENT:
- IntLockRelatives(WindowObject);
Parent = IntGetWindowObject(WindowObject->Parent);
- IntUnLockRelatives(WindowObject);
if(Parent)
{
if (Parent && Parent->Self == IntGetDesktopWindow())