remove relatives lock, window props lock, classes locks, thread window lock, menu locks
Modified: trunk/reactos/subsys/win32k/include/class.h
Modified: trunk/reactos/subsys/win32k/include/menu.h
Modified: trunk/reactos/subsys/win32k/include/prop.h
Modified: trunk/reactos/subsys/win32k/include/win32.h
Modified: trunk/reactos/subsys/win32k/include/window.h
Modified: trunk/reactos/subsys/win32k/main/dllmain.c
Modified: trunk/reactos/subsys/win32k/ntuser/class.c
Modified: trunk/reactos/subsys/win32k/ntuser/focus.c
Modified: trunk/reactos/subsys/win32k/ntuser/menu.c
Modified: trunk/reactos/subsys/win32k/ntuser/painting.c
Modified: trunk/reactos/subsys/win32k/ntuser/prop.c
Modified: trunk/reactos/subsys/win32k/ntuser/vis.c
Modified: trunk/reactos/subsys/win32k/ntuser/window.c
Modified: trunk/reactos/subsys/win32k/ntuser/winpos.c

Modified: trunk/reactos/subsys/win32k/include/class.h
--- trunk/reactos/subsys/win32k/include/class.h	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/include/class.h	2005-09-05 22:39:29 UTC (rev 17684)
@@ -24,7 +24,6 @@
   LIST_ENTRY ListEntry;
   PCHAR   ExtraData;
   /* list of windows */
-  FAST_MUTEX ClassWindowsListLock;
   LIST_ENTRY ClassWindowsListHead;
 } WNDCLASS_OBJECT, *PWNDCLASS_OBJECT;
 
@@ -34,18 +33,6 @@
 NTSTATUS FASTCALL
 CleanupClassImpl(VOID);
 
-#define IntLockProcessClasses(W32Process) \
-  ExAcquireFastMutex(&(W32Process)->ClassListLock)
-
-#define IntUnLockProcessClasses(W32Process) \
-  ExReleaseFastMutex(&(W32Process)->ClassListLock)
-
-#define IntLockClassWindows(ClassObj) \
-  ExAcquireFastMutex(&(ClassObj)->ClassWindowsListLock)
-
-#define IntUnLockClassWindows(ClassObj) \
-  ExReleaseFastMutex(&(ClassObj)->ClassWindowsListLock)
-
 #define ClassDereferenceObject(ClassObj) \
   ObmDereferenceObject(ClassObj)
 

Modified: trunk/reactos/subsys/win32k/include/menu.h
--- trunk/reactos/subsys/win32k/include/menu.h	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/include/menu.h	2005-09-05 22:39:29 UTC (rev 17684)
@@ -33,7 +33,6 @@
 {
   PEPROCESS Process;
   LIST_ENTRY ListEntry;
-  FAST_MUTEX MenuItemsLock;
   PMENU_ITEM MenuItemList;
   ROSMENUINFO MenuInfo;
   BOOL RtoL;
@@ -42,18 +41,6 @@
 PMENU_OBJECT FASTCALL
 IntGetMenuObject(HMENU hMenu);
 
-#define IntLockMenuItems(MenuObj) \
-  ExAcquireFastMutex(&(MenuObj)->MenuItemsLock)
-
-#define IntUnLockMenuItems(MenuObj) \
-  ExReleaseFastMutex(&(MenuObj)->MenuItemsLock)
-
-#define IntLockProcessMenus(W32Process) \
-  ExAcquireFastMutex(&(W32Process)->MenuListLock)
-
-#define IntUnLockProcessMenus(W32Process) \
-  ExReleaseFastMutex(&(W32Process)->MenuListLock)
-
 #define IntReleaseMenuObject(MenuObj) \
   ObmDereferenceObject(MenuObj)
 

Modified: trunk/reactos/subsys/win32k/include/prop.h
--- trunk/reactos/subsys/win32k/include/prop.h	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/include/prop.h	2005-09-05 22:39:29 UTC (rev 17684)
@@ -14,11 +14,5 @@
 PPROPERTY FASTCALL
 IntGetProp(PWINDOW_OBJECT WindowObject, ATOM Atom);
 
-#define IntLockWindowProperties(Window) \
-  ExAcquireFastMutex(&Window->PropListLock)
-
-#define IntUnLockWindowProperties(Window) \
-  ExReleaseFastMutex(&Window->PropListLock)
-
 #endif /* _WIN32K_PROP_H */
 

Modified: trunk/reactos/subsys/win32k/include/win32.h
--- trunk/reactos/subsys/win32k/include/win32.h	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/include/win32.h	2005-09-05 22:39:29 UTC (rev 17684)
@@ -6,7 +6,6 @@
 typedef struct _W32THREAD
 {
   struct _USER_MESSAGE_QUEUE* MessageQueue;
-  FAST_MUTEX WindowListLock;
   LIST_ENTRY WindowListHead;
   LIST_ENTRY W32CallbackListHead;
   struct _KBDTABLES* KeyboardLayout;
@@ -21,9 +20,7 @@
 
 typedef struct _W32PROCESS
 {
-  FAST_MUTEX ClassListLock;
   LIST_ENTRY ClassListHead;
-  FAST_MUTEX MenuListLock;
   LIST_ENTRY MenuListHead;
   FAST_MUTEX PrivateFontListLock;
   LIST_ENTRY PrivateFontListHead;

Modified: trunk/reactos/subsys/win32k/include/window.h
--- trunk/reactos/subsys/win32k/include/window.h	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/include/window.h	2005-09-05 22:39:29 UTC (rev 17684)
@@ -67,8 +67,6 @@
   FAST_MUTEX UpdateLock;
   /* Pointer to the owning thread's message queue. */
   PUSER_MESSAGE_QUEUE MessageQueue;
-  /* Lock for the list of child windows. */
-  FAST_MUTEX RelativesLock;
   struct _WINDOW_OBJECT* FirstChild;
   struct _WINDOW_OBJECT* LastChild;
   struct _WINDOW_OBJECT* NextSibling;
@@ -83,7 +81,6 @@
   PDCE Dce;
   /* Property list head.*/
   LIST_ENTRY PropListHead;
-  FAST_MUTEX PropListLock;
   ULONG PropListItems;
   /* Scrollbar info */
   PWINDOW_SCROLLINFO Scroll;
@@ -148,19 +145,7 @@
 #define IntGetWndProcessId(WndObj) \
   WndObj->OwnerThread->ThreadsProcess->UniqueProcessId
 
-#define IntLockRelatives(WndObj) \
-  ExAcquireFastMutex(&WndObj->RelativesLock)
 
-#define IntUnLockRelatives(WndObj) \
-  ExReleaseFastMutex(&WndObj->RelativesLock)
-
-#define IntLockThreadWindows(Thread) \
-  ExAcquireFastMutex(&Thread->WindowListLock)
-
-#define IntUnLockThreadWindows(Thread) \
-  ExReleaseFastMutex(&Thread->WindowListLock)
-
-
 PWINDOW_OBJECT FASTCALL
 IntGetProcessWindowObject(PW32THREAD Thread, HWND hWnd);
 

Modified: trunk/reactos/subsys/win32k/main/dllmain.c
--- trunk/reactos/subsys/win32k/main/dllmain.c	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/main/dllmain.c	2005-09-05 22:39:29 UTC (rev 17684)
@@ -71,10 +71,8 @@
       DPRINT("Creating W32 process PID:%d at IRQ level: %lu\n", Process->UniqueProcessId, KeGetCurrentIrql());
 
       InitializeListHead(&Win32Process->ClassListHead);
-      ExInitializeFastMutex(&Win32Process->ClassListLock);
 
       InitializeListHead(&Win32Process->MenuListHead);
-      ExInitializeFastMutex(&Win32Process->MenuListLock);
 
       InitializeListHead(&Win32Process->PrivateFontListHead);
       ExInitializeFastMutex(&Win32Process->PrivateFontListLock);
@@ -217,7 +215,6 @@
       Win32Thread->KeyboardLayout = W32kGetDefaultKeyLayout();
       Win32Thread->MessagePumpHookValue = 0;
       InitializeListHead(&Win32Thread->WindowListHead);
-      ExInitializeFastMutex(&Win32Thread->WindowListLock);
       InitializeListHead(&Win32Thread->W32CallbackListHead);
     }
   else

Modified: trunk/reactos/subsys/win32k/ntuser/class.c
--- trunk/reactos/subsys/win32k/ntuser/class.c	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/ntuser/class.c	2005-09-05 22:39:29 UTC (rev 17684)
@@ -57,7 +57,6 @@
    PLIST_ENTRY CurrentEntry;
    PW32PROCESS Process = PsGetWin32Process();
 
-   IntLockProcessClasses(Process);
    CurrentEntry = Process->ClassListHead.Flink;
    while (CurrentEntry != &Process->ClassListHead)
    {
@@ -67,7 +66,6 @@
       {
          *Class = Current;
          ObmReferenceObject(Current);
-         IntUnLockProcessClasses(Process);
          return TRUE;
       }
 
@@ -76,7 +74,6 @@
 
       CurrentEntry = CurrentEntry->Flink;
    }
-   IntUnLockProcessClasses(Process);
 
    if (BestMatch != NULL)
    {
@@ -369,7 +366,6 @@
 	}
 
 	InitializeListHead(&ClassObject->ClassWindowsListHead);
-	ExInitializeFastMutex(&ClassObject->ClassWindowsListLock);
 
 	return(ClassObject);
 }
@@ -463,9 +459,8 @@
     DPRINT("Failed creating window class object\n");
     RETURN((RTL_ATOM)0);
   }
-  IntLockProcessClasses(PsGetWin32Process());
+
   InsertTailList(&PsGetWin32Process()->ClassListHead, &ClassObject->ListEntry);
-  IntUnLockProcessClasses(PsGetWin32Process());
 
   RETURN(Atom);
 
@@ -734,16 +729,13 @@
       RETURN( FALSE);
    }
 
-  IntLockClassWindows(Class);
    if (!IsListEmpty(&Class->ClassWindowsListHead))
    {
-      IntUnLockClassWindows(Class);
       /* Dereference the ClassReferenceClassByNameOrAtom() call */
       ObmDereferenceObject(Class);
       SetLastWin32Error(ERROR_CLASS_HAS_WINDOWS);
       RETURN( FALSE);
    }
-   IntUnLockClassWindows(Class);
 
    /* Dereference the ClassReferenceClassByNameOrAtom() call */
    ClassDereferenceObject(Class);

Modified: trunk/reactos/subsys/win32k/ntuser/focus.c
--- trunk/reactos/subsys/win32k/ntuser/focus.c	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/ntuser/focus.c	2005-09-05 22:39:29 UTC (rev 17684)
@@ -126,19 +126,15 @@
 {
   HWND Ret;
   PWINDOW_OBJECT Child, OwnerWnd;
-  IntLockRelatives(Root);
 
   for(Child = Root->FirstChild; Child; Child = Child->NextSibling)
   {
-    IntLockRelatives(Child);
     OwnerWnd = IntGetWindowObject(Child->Owner);
-    IntUnLockRelatives(Child);
     if(!OwnerWnd)
       continue;
 
     if(OwnerWnd == Owner)
     {
-      IntUnLockRelatives(Root);
       Ret = Child->Self;
       IntReleaseWindowObject(OwnerWnd);
       return Ret;
@@ -146,7 +142,6 @@
     IntReleaseWindowObject(OwnerWnd);
   }
 
-  IntUnLockRelatives(Root);
   return NULL;
 }
 

Modified: trunk/reactos/subsys/win32k/ntuser/menu.c
--- trunk/reactos/subsys/win32k/ntuser/menu.c	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/ntuser/menu.c	2005-09-05 22:39:29 UTC (rev 17684)
@@ -228,15 +228,11 @@
     NTSTATUS Status;
 
     /* remove all menu items */
-    IntLockMenuItems(MenuObject);
     IntDeleteMenuItems(MenuObject, bRecurse); /* do not destroy submenus */
-    IntUnLockMenuItems(MenuObject);
 
     if(RemoveFromProcess)
     {
-      IntLockProcessMenus((PW32PROCESS)MenuObject->Process->Win32Process);
       RemoveEntryList(&MenuObject->ListEntry);
-      IntUnLockProcessMenus((PW32PROCESS)MenuObject->Process->Win32Process);
     }
 
     Status = ObReferenceObjectByHandle(MenuObject->Process->Win32WindowStation,
@@ -292,12 +288,9 @@
 
   MenuObject->MenuInfo.MenuItemCount = 0;
   MenuObject->MenuItemList = NULL;
-  ExInitializeFastMutex(&MenuObject->MenuItemsLock);
 
   /* Insert menu item into process menu handle list */
-  IntLockProcessMenus(PsGetWin32Process());
   InsertTailList(&PsGetWin32Process()->MenuListHead, &MenuObject->ListEntry);
-  IntUnLockProcessMenus(PsGetWin32Process());
 
   return MenuObject;
 }
@@ -311,9 +304,6 @@
   if(!Source->MenuInfo.MenuItemCount)
     return FALSE;
 
-  IntLockMenuItems(Destination);
-  IntLockMenuItems(Source);
-
   MenuItem = Source->MenuItemList;
   while(MenuItem)
   {
@@ -364,8 +354,6 @@
     MenuItem = MenuItem->Next;
   }
 
-  IntUnLockMenuItems(Source);
-  IntUnLockMenuItems(Destination);
   return TRUE;
 }
 
@@ -403,12 +391,9 @@
 
   MenuObject->MenuInfo.MenuItemCount = 0;
   MenuObject->MenuItemList = NULL;
-  ExInitializeFastMutex(&MenuObject->MenuItemsLock);
 
   /* Insert menu item into process menu handle list */
-  IntLockProcessMenus(PsGetWin32Process());
   InsertTailList(&PsGetWin32Process()->MenuListHead, &MenuObject->ListEntry);
-  IntUnLockProcessMenus(PsGetWin32Process());
 
   IntCloneMenuItems(MenuObject, Source);
 
@@ -1156,15 +1141,10 @@
         if(!SubMenuObject || (SubMenuObject == MenuObject))
           break;
 
-        IntLockMenuItems(SubMenuObject);
-        IntUnLockMenuItems(MenuObject);
-
         (*gismc)++;
         sres = IntGetMenuDefaultItem(SubMenuObject, fByPos, gmdiFlags, gismc);
         (*gismc)--;
 
-        IntUnLockMenuItems(SubMenuObject);
-        IntLockMenuItems(MenuObject);
         IntReleaseMenuObject(SubMenuObject);
 
         if(sres > (UINT)-1)
@@ -1253,18 +1233,14 @@
     KeAttachProcess(&Process->Pcb);
   }
 
-  IntLockProcessMenus(Win32Process);
   while (Win32Process->MenuListHead.Flink != &(Win32Process->MenuListHead) &&
          Win32Process->MenuListHead.Flink != LastHead)
   {
     LastHead = Win32Process->MenuListHead.Flink;
     MenuObject = CONTAINING_RECORD(Win32Process->MenuListHead.Flink, MENU_OBJECT, ListEntry);
 
-    IntUnLockProcessMenus(Win32Process);
     IntDestroyMenuObject(MenuObject, FALSE, TRUE);
-    IntLockProcessMenus(Win32Process);
   }
-  IntUnLockProcessMenus(Win32Process);
 
   if (CurrentProcess != Process)
   {
@@ -1303,9 +1279,7 @@
 
   if(Buffer)
   {
-    IntLockMenuItems(MenuObject);
     res = IntBuildMenuItemList(MenuObject, Buffer, nBufSize);
-    IntUnLockMenuItems(MenuObject);
   }
   else
   {
@@ -1345,9 +1319,9 @@
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
     RETURN( (DWORD)-1);
   }
-  IntLockMenuItems(MenuObject);
+
   res = IntCheckMenuItem(MenuObject, uIDCheckItem, uCheck);
-  IntUnLockMenuItems(MenuObject);
+
   IntReleaseMenuObject(MenuObject);
   RETURN( res);
   
@@ -1524,9 +1498,9 @@
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
     RETURN( res);
   }
-  IntLockMenuItems(MenuObject);
+
   res = IntEnableMenuItem(MenuObject, uIDEnableItem, uEnable);
-  IntUnLockMenuItems(MenuObject);
+
   IntReleaseMenuObject(MenuObject);
 
   RETURN( res);
@@ -1578,9 +1552,8 @@
       RETURN( FALSE);
     }
 
-  IntLockMenuItems(MenuObject);
   Res = IntInsertMenuItem(MenuObject, uItem, fByPosition, &ItemInfo);
-  IntUnLockMenuItems(MenuObject);
+
   IntReleaseMenuObject(MenuObject);
 
   RETURN( Res);
@@ -1627,9 +1600,9 @@
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
     RETURN( res);
   }
-  IntLockMenuItems(MenuObject);
+
   res = IntGetMenuDefaultItem(MenuObject, fByPos, gmdiFlags, &gismc);
-  IntUnLockMenuItems(MenuObject);
+
   IntReleaseMenuObject(MenuObject);
   RETURN(res);
   
@@ -1769,9 +1742,7 @@
   }
   if(WindowObject->IDMenu == (UINT)hmenu)
   {
-    IntLockMenuItems(MenuObject);
     res = IntHiliteMenuItem(WindowObject, MenuObject, uItemHilite, uHilite);
-    IntUnLockMenuItems(MenuObject);
   }
   IntReleaseMenuObject(MenuObject);
   IntReleaseWindowObject(WindowObject);
@@ -1914,7 +1885,6 @@
   Y -= WindowObject->WindowRect.top;
   IntReleaseWindowObject(WindowObject);
 
-  IntLockMenuItems(MenuObject);
   mi = MenuObject->MenuItemList;
   for (i = 0; NULL != mi; i++)
     {
@@ -1924,7 +1894,6 @@
         }
       mi = mi->Next;
     }
-  IntUnLockMenuItems(MenuObject);
 
   IntReleaseMenuObject(MenuObject);
 
@@ -2145,9 +2114,9 @@
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
     return( FALSE);
   }
-  IntLockMenuItems(MenuObject);
+
   res = IntSetMenuDefaultItem(MenuObject, uItem, fByPos);
-  IntUnLockMenuItems(MenuObject);
+
   IntReleaseMenuObject(MenuObject);
 
   return( res);
@@ -2176,9 +2145,9 @@
     SetLastWin32Error(ERROR_INVALID_MENU_HANDLE);
     RETURN( FALSE);
   }
-  IntLockMenuItems(MenuObject);
+
   res = IntSetMenuDefaultItem(MenuObject, uItem, fByPos);
-  IntUnLockMenuItems(MenuObject);
+
   IntReleaseMenuObject(MenuObject);
 
   RETURN( res);

Modified: trunk/reactos/subsys/win32k/ntuser/painting.c
--- trunk/reactos/subsys/win32k/ntuser/painting.c	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/ntuser/painting.c	2005-09-05 22:39:29 UTC (rev 17684)
@@ -559,7 +559,6 @@
       return hWnd;
    }
 
-   IntLockRelatives(Window);
    for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
    {
       if (IntIsWindowDirty(Child) &&
@@ -569,7 +568,6 @@
          break;
       }
    }
-   IntUnLockRelatives(Window);
 
    if (hFoundWnd == NULL)
    {

Modified: trunk/reactos/subsys/win32k/ntuser/prop.c
--- trunk/reactos/subsys/win32k/ntuser/prop.c	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/ntuser/prop.c	2005-09-05 22:39:29 UTC (rev 17684)
@@ -91,8 +91,6 @@
     }
 
     /* copy list */
-    IntLockWindowProperties(WindowObject);
-
     li = (PROPLISTITEM *)Buffer;
     ListEntry = WindowObject->PropListHead.Flink;
     while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &WindowObject->PropListHead))
@@ -104,7 +102,6 @@
       Status = MmCopyToCaller(li, &listitem, sizeof(PROPLISTITEM));
       if(!NT_SUCCESS(Status))
       {
-        IntUnLockWindowProperties(WindowObject);
         IntReleaseWindowObject(WindowObject);
         RETURN( Status);
       }
@@ -115,13 +112,10 @@
       ListEntry = ListEntry->Flink;
     }
 
-    IntUnLockWindowProperties(WindowObject);
   }
   else
   {
-    IntLockWindowProperties(WindowObject);
     Cnt = WindowObject->PropListItems * sizeof(PROPLISTITEM);
-    IntUnLockWindowProperties(WindowObject);
   }
 
   IntReleaseWindowObject(WindowObject);
@@ -160,12 +154,10 @@
     RETURN( NULL);
   }
 
-  IntLockWindowProperties(WindowObject);
   Prop = IntGetProp(WindowObject, Atom);
 
   if (Prop == NULL)
     {
-      IntUnLockWindowProperties(WindowObject);
       IntReleaseWindowObject(WindowObject);
       RETURN(NULL);
     }
@@ -173,7 +165,6 @@
   RemoveEntryList(&Prop->PropListEntry);
   ExFreePool(Prop);
   WindowObject->PropListItems--;
-  IntUnLockWindowProperties(WindowObject);
   IntReleaseWindowObject(WindowObject);
   RETURN(Data);
   
@@ -200,13 +191,11 @@
     RETURN( FALSE);
   }
 
-  IntLockWindowProperties(WindowObject);
   Prop = IntGetProp(WindowObject, Atom);
   if (Prop != NULL)
   {
     Data = Prop->Data;
   }
-  IntUnLockWindowProperties(WindowObject);
   IntReleaseWindowObject(WindowObject);
   RETURN(Data);
   
@@ -256,9 +245,7 @@
     RETURN( FALSE);
   }
 
-  IntLockWindowProperties(WindowObject);
   ret = IntSetProp(WindowObject, Atom, Data);
-  IntUnLockWindowProperties(WindowObject);
 
   IntReleaseWindowObject(WindowObject);
   RETURN( ret);

Modified: trunk/reactos/subsys/win32k/ntuser/vis.c
--- trunk/reactos/subsys/win32k/ntuser/vis.c	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/ntuser/vis.c	2005-09-05 22:39:29 UTC (rev 17684)
@@ -92,7 +92,6 @@
       if ((PreviousWindow->Style & WS_CLIPSIBLINGS) ||
           (PreviousWindow == Window && ClipSiblings))
       {
-         IntLockRelatives(CurrentWindow);
          CurrentSibling = CurrentWindow->FirstChild;
          while (CurrentSibling != NULL && CurrentSibling != PreviousWindow)
          {
@@ -111,7 +110,6 @@
             }
             CurrentSibling = CurrentSibling->NextSibling;
          }
-         IntUnLockRelatives(CurrentWindow);
       }
 
       PreviousWindow = CurrentWindow;
@@ -121,7 +119,6 @@
 
    if (ClipChildren)
    {
-      IntLockRelatives(Window);
       CurrentWindow = Window->FirstChild;
       while (CurrentWindow)
       {
@@ -140,7 +137,6 @@
          }
          CurrentWindow = CurrentWindow->NextSibling;
       }
-      IntUnLockRelatives(Window);
    }
 
    if(Window->WindowRegion && !(Window->Style & WS_MINIMIZE))

Modified: trunk/reactos/subsys/win32k/ntuser/window.c
--- trunk/reactos/subsys/win32k/ntuser/window.c	2005-09-05 22:20:04 UTC (rev 17683)
+++ trunk/reactos/subsys/win32k/ntuser/window.c	2005-09-05 22:39:29 UTC (rev 17684)
@@ -135,16 +135,12 @@
 
   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);
   }
 
@@ -156,9 +152,7 @@
 {
   HWND hWnd;
 
-  IntLockRelatives(Wnd);
   hWnd = Wnd->Owner;
-  IntUnLockRelatives(Wnd);
 
   return IntGetWindowObject(hWnd);
 }
@@ -168,9 +162,7 @@
 {
   HWND hParent;
 
-  IntLockRelatives(Wnd);
   hParent = Wnd->Parent;
-  IntUnLockRelatives(Wnd);
   return IntGetWindowObject(hParent);
 }
 
@@ -191,8 +183,6 @@
    HWND *List;
    UINT Index, NumChildren = 0;
 
-   IntLockRelatives(Window);
-
    for (Child = Window->FirstChild; Child; Child = Child->NextSibling)
       ++NumChildren;
 
@@ -200,7 +190,6 @@
    if(!List)
    {
      DPRINT1("Failed to allocate memory for children array\n");
-     IntUnLockRelatives(Window);
      SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
      return NULL;
    }
@@ -210,8 +199,6 @@
       List[Index] = Child->Self;
    List[Index] = NULL;
 
-   IntUnLockRelatives(Window);
-
    return List;
 }
 
@@ -304,10 +291,8 @@
 
   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;
   }
@@ -317,7 +302,6 @@
      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);
 
@@ -368,10 +352,8 @@
   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)
@@ -429,9 +411,7 @@
   IntDestroyScrollBars(Window);
 
   /* remove the window from the class object */
-  IntLockClassWindows(Window->Class);
   RemoveEntryList(&Window->ClassListEntry);
-  IntUnLockClassWindows(Window->Class);
 
   /* dereference the class */
   ClassDereferenceObject(Window->Class);
@@ -577,7 +557,6 @@
   Win32Thread = Thread->Tcb.Win32Thread;
   Win32Process = (PW32PROCESS)Thread->ThreadsProcess->Win32Process;
 
-  IntLockThreadWindows(Win32Thread);
   Current = Win32Thread->WindowListHead.Flink;
   while (Current != &(Win32Thread->WindowListHead))
   {
@@ -591,7 +570,6 @@
     if(!List)
     {
       DPRINT("Not enough memory to allocate window handle list\n");
-      IntUnLockThreadWindows(Win32Thread);
       return;
     }
     pWnd = List;
@@ -603,7 +581,6 @@
       pWnd++;
       Current = Current->Flink;
     }
-    IntUnLockThreadWindows(Win32Thread);
     *pWnd = NULL;
 
     for(pWnd = List; *pWnd; pWnd++)
@@ -615,7 +592,6 @@
     return;
   }
 
-  IntUnLockThreadWindows(Win32Thread);
 }
 
 
@@ -861,7 +837,6 @@
 {
   PWINDOW_OBJECT Parent;
 
-  IntLockRelatives(Wnd);
   Wnd->Parent = WndParent->Self;
   if ((Wnd->PrevSibling = WndPrevSibling))
   {
@@ -870,10 +845,8 @@
       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;
@@ -886,23 +859,18 @@
       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
@@ -915,7 +883,6 @@
   if(!Wnd)
     return NULL;
 
-  IntLockRelatives(Wnd);
   WndOldOwner = IntGetWindowObject(Wnd->Owner);
   if (WndOldOwner)
   {
@@ -935,7 +902,6 @@
   else
     Wnd->Owner = NULL;
 
-  IntUnLockRelatives(Wnd);
   IntReleaseWindowObject(Wnd);
   return ret;
 }
@@ -978,14 +944,12 @@
       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)
       {
@@ -1074,10 +1038,9 @@
 {
   PWINDOW_OBJECT WndParent;
 
-  IntLockRelatives(Wnd);
   if((WndParent = IntGetWindowObject(Wnd->Parent)))
   {
-    IntLockRelatives(WndParent);
+
   }
 
   if (Wnd->NextSibling) Wnd->NextSibling->PrevSibling = Wnd->PrevSibling;
@@ -1088,11 +1051,9 @@
 
   if(WndParent)
   {
-    IntUnLockRelatives(WndParent);
     IntReleaseWindowObject(WndParent);
   }
   Wnd->PrevSibling = Wnd->NextSibling = Wnd->Parent = NULL;
-  IntUnLockRelatives(Wnd);
 }
 
 BOOL FASTCALL
@@ -1106,7 +1067,6 @@
     return FALSE;
   }
 
-  IntLockRelatives(Window);
   for(Child = Window->FirstChild; Child; Child = Child->NextSibling)
   {
     if(Child->Owner && Child->Style & WS_VISIBLE)
@@ -1115,12 +1075,11 @@
        * 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;
 }
@@ -1183,7 +1142,6 @@
       return 0;
     }
 
-    IntLockRelatives(Window);
     for(Child = Window->FirstChild; Child != NULL; Child = Child->NextSibling)
     {
       if(dwCount++ < nBufSize && pWnd)
@@ -1196,7 +1154,6 @@
         }
       }
     }
-    IntUnLockRelatives(Window);
 
     IntReleaseWindowObject(Window);
   }
@@ -1221,7 +1178,6 @@
       return 0;
     }
 
-    IntLockThreadWindows(W32Thread);
     Current = W32Thread->WindowListHead.Flink;
     while(Current != &(W32Thread->WindowListHead))
     {
@@ -1240,7 +1196,6 @@
       dwCount++;
       Current = Current->Flink;
     }
-    IntUnLockThreadWindows(W32Thread);
 
     ObDereferenceObject(Thread);
   }
@@ -1275,7 +1230,6 @@
       return 0;
     }
 
-    IntLockRelatives(Window);
     for(Child = Window->FirstChild; Child != NULL; Child = Child->NextSibling)
     {
       if(dwCount++ < nBufSize && pWnd)
@@ -1288,7 +1242,6 @@
         }
       }
     }
-    IntUnLockRelatives(Window);
 
     IntReleaseWindowObject(Window);
     if(hDesktop)
@@ -1561,9 +1514,8 @@
    * 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;
@@ -1626,8 +1578,6 @@
     }
 
   InitializeListHead(&WindowObject->PropListHead);
-  ExInitializeFastMutex(&WindowObject->PropListLock);
-  ExInitializeFastMutex(&WindowObject->RelativesLock);
   ExInitializeFastMutex(&WindowObject->UpdateLock);
   InitializeListHead(&WindowObject->WndObjListHead);
   ExInitializeFastMutex(&WindowObject->WndObjListLock);
@@ -1690,10 +1640,8 @@
   }
 
   /* 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)
@@ -1899,10 +1847,8 @@
       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)
@@ -1914,7 +1860,6 @@
           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))
@@ -1922,7 +1867,6 @@
                   InsertAfter = Sibling;
                   Sibling = Sibling->NextSibling;
                 }
-              IntUnLockRelatives(ParentWindow);
             }
           else
             {
@@ -2239,14 +2183,12 @@
 		  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);
@@ -2254,12 +2196,12 @@
 		      GotOne = TRUE;
 		      continue;
 		    }
-		  IntLockRelatives(Child);
+
 		  if (Child->Owner != NULL)
 		    {
 		      Child->Owner = NULL;
 		    }
-		  IntUnLockRelatives(Child);
+
 		  IntReleaseWindowObject(Child);
 		}
 	      ExFreePool(Children);
[truncated at 1000 lines; 129 more skipped]