[Win32k|User32]
authorJames Tabor <james.tabor@reactos.org>
Mon, 11 Oct 2010 03:41:41 +0000 (03:41 +0000)
committerJames Tabor <james.tabor@reactos.org>
Mon, 11 Oct 2010 03:41:41 +0000 (03:41 +0000)
- Move to the new window structure. Window Object served us well.

svn path=/trunk/; revision=49109

52 files changed:
reactos/dll/win32/user32/misc/misc.c
reactos/dll/win32/user32/windows/class.c
reactos/dll/win32/user32/windows/dialog.c
reactos/dll/win32/user32/windows/message.c
reactos/include/reactos/win32k/ntuser.h
reactos/subsystems/win32/win32k/eng/engwindow.c
reactos/subsystems/win32/win32k/include/caret.h
reactos/subsystems/win32/win32k/include/clipboard.h
reactos/subsystems/win32/win32k/include/dce.h
reactos/subsystems/win32/win32k/include/desktop.h
reactos/subsystems/win32/win32k/include/eng.h
reactos/subsystems/win32/win32k/include/focus.h
reactos/subsystems/win32/win32k/include/hotkey.h
reactos/subsystems/win32/win32k/include/menu.h
reactos/subsystems/win32/win32k/include/msgqueue.h
reactos/subsystems/win32/win32k/include/painting.h
reactos/subsystems/win32/win32k/include/prop.h
reactos/subsystems/win32/win32k/include/scroll.h
reactos/subsystems/win32/win32k/include/timer.h
reactos/subsystems/win32/win32k/include/userfuncs.h
reactos/subsystems/win32/win32k/include/vis.h
reactos/subsystems/win32/win32k/include/window.h
reactos/subsystems/win32/win32k/include/winpos.h
reactos/subsystems/win32/win32k/ntuser/accelerator.c
reactos/subsystems/win32/win32k/ntuser/callback.c
reactos/subsystems/win32/win32k/ntuser/callproc.c
reactos/subsystems/win32/win32k/ntuser/caret.c
reactos/subsystems/win32/win32k/ntuser/class.c
reactos/subsystems/win32/win32k/ntuser/clipboard.c
reactos/subsystems/win32/win32k/ntuser/cursoricon.c
reactos/subsystems/win32/win32k/ntuser/defwnd.c
reactos/subsystems/win32/win32k/ntuser/desktop.c
reactos/subsystems/win32/win32k/ntuser/event.c
reactos/subsystems/win32/win32k/ntuser/focus.c
reactos/subsystems/win32/win32k/ntuser/hotkey.c
reactos/subsystems/win32/win32k/ntuser/input.c
reactos/subsystems/win32/win32k/ntuser/menu.c
reactos/subsystems/win32/win32k/ntuser/message.c
reactos/subsystems/win32/win32k/ntuser/monitor.c
reactos/subsystems/win32/win32k/ntuser/msgqueue.c
reactos/subsystems/win32/win32k/ntuser/object.c
reactos/subsystems/win32/win32k/ntuser/painting.c
reactos/subsystems/win32/win32k/ntuser/prop.c
reactos/subsystems/win32/win32k/ntuser/scrollbar.c
reactos/subsystems/win32/win32k/ntuser/simplecall.c
reactos/subsystems/win32/win32k/ntuser/timer.c
reactos/subsystems/win32/win32k/ntuser/vis.c
reactos/subsystems/win32/win32k/ntuser/windc.c
reactos/subsystems/win32/win32k/ntuser/window.c
reactos/subsystems/win32/win32k/ntuser/winpos.c
reactos/subsystems/win32/win32k/objects/device.c
reactos/subsystems/win32/win32k/objects/palette.c

index aca5d8d..76aaf46 100644 (file)
@@ -304,7 +304,7 @@ GetUser32Handle(HANDLE handle)
 static const BOOL g_ObjectHeapTypeShared[VALIDATE_TYPE_EVENT + 1] =
 {
     FALSE, /* VALIDATE_TYPE_FREE (not used) */
-    TRUE, /* VALIDATE_TYPE_WIN  FALSE */
+    FALSE, /* VALIDATE_TYPE_WIN  FALSE */
     TRUE, /* VALIDATE_TYPE_MENU  FALSE */
     TRUE, /* VALIDATE_TYPE_CURSOR */
     TRUE, /* VALIDATE_TYPE_MWPOS */
@@ -427,12 +427,6 @@ ValidateCallProc(HANDLE hCallProc)
   return NULL;
 }
 
-// HACK HACK HACK!
-typedef struct _WNDX
-{
-    THRDESKHEAD head;
-    PWND pWnd;
-} WNDX, *PWNDX;
 
 //
 // Validate a window handle and return the pointer to the object.
@@ -447,24 +441,12 @@ ValidateHwnd(HWND hwnd)
 
     /* See if the window is cached */
     if (hwnd == ClientInfo->CallbackWnd.hWnd)
-        return ClientInfo->CallbackWnd.pvWnd;
+        return ClientInfo->CallbackWnd.pWnd;
 
     Wnd = ValidateHandle((HANDLE)hwnd, VALIDATE_TYPE_WIN);
     if (Wnd != NULL)
     {
-#if 0
         return Wnd;
-#else
-        /* HACK HACK HACK! This needs to be done until WINDOW_OBJECT is completely
-           superseded by the WINDOW structure. We *ASSUME* a pointer to the WINDOW
-           structure to be at the beginning of the WINDOW_OBJECT structure!!!
-
-           !!! REMOVE AS SOON AS WINDOW_OBJECT NO LONGER EXISTS !!!
-         */
-
-        if ( ((PWNDX)Wnd)->pWnd != NULL)
-            return DesktopPtrToUser( ((PWNDX)Wnd)->pWnd );
-#endif
     }
 
     return NULL;
@@ -483,24 +465,12 @@ ValidateHwndNoErr(HWND hwnd)
 
     /* See if the window is cached */
     if (hwnd == ClientInfo->CallbackWnd.hWnd)
-        return ClientInfo->CallbackWnd.pvWnd;
+        return ClientInfo->CallbackWnd.pWnd;
 
     Wnd = ValidateHandleNoErr((HANDLE)hwnd, VALIDATE_TYPE_WIN);
     if (Wnd != NULL)
     {
-#if 0
         return Wnd;
-#else
-        /* HACK HACK HACK! This needs to be done until WINDOW_OBJECT is completely
-           superseded by the WINDOW structure. We *ASSUME* a pointer to the WINDOW
-           structure to be at the beginning of the WINDOW_OBJECT structure!!!
-
-           !!! REMOVE AS SOON AS WINDOW_OBJECT NO LONGER EXISTS !!!
-         */
-
-        if ( ((PWNDX)Wnd)->pWnd != NULL)
-            return DesktopPtrToUser( ((PWNDX)Wnd)->pWnd );
-#endif
     }
 
     return NULL;
index cf45f18..d55d29c 100644 (file)
@@ -32,8 +32,11 @@ GetClassInfoExA(
         IS_ATOM(lpszClass) ? lpszClass : 0,
         lpwcx);
 
-    //HACKHACK: This is ROS-specific and should go away
-    lpwcx->cbSize = sizeof(*lpwcx);
+    if (!lpwcx)
+    {
+       SetLastError( ERROR_NOACCESS );
+       return FALSE;
+    }
 
     if (hInstance == User32Instance)
     {
@@ -105,8 +108,14 @@ GetClassInfoExW(
         IS_ATOM(lpszClass) ? lpszClass : 0,
         lpwcx);
 
-    //HACKHACK: This is ROS-specific and should go away
-    lpwcx->cbSize = sizeof(*lpwcx);
+    /* From wine, for speed only, ReactOS supports the correct return in
+     * Win32k. cbSize is ignored.
+     */
+    if (!lpwcx)
+    {
+       SetLastError( ERROR_NOACCESS );
+       return FALSE;
+    }
 
     if (hInstance == User32Instance)
     {
index 2e812fc..c1a219e 100644 (file)
@@ -270,7 +270,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
     else
     {
         info->className = (LPCWSTR)p;
-        p += wcslen( info->className ) + 1;
+        p += strlenW( info->className ) + 1;
     }
 
     if (GET_WORD(p) == 0xffff)  /* Is it an integer id? */
@@ -292,7 +292,7 @@ static const WORD *DIALOG_GetControl32( const WORD *p, DLG_CONTROL_INFO *info,
     {
         info->windowName = (LPCWSTR)p;
         info->windowNameFree = FALSE;
-        p += wcslen( info->windowName ) + 1;
+        p += strlenW( info->windowName ) + 1;
     }
 
     if (GET_WORD(p))
@@ -431,7 +431,8 @@ static HWND DIALOG_FindMsgDestination( HWND hwndDlg )
         if (!IsWindow(hParent)) break;
 
         pWnd = ValidateHwnd(hParent);
-        if (!pWnd) break;
+        // FIXME: Use pWnd->fnid == FNID_DESKTOP
+        if (!pWnd || hParent == GetDesktopWindow()) break;
 
         if (!(pWnd->state & WNDS_DIALOGWINDOW))
         {
@@ -473,8 +474,7 @@ static BOOL DIALOG_IsAccelerator( HWND hwnd, HWND hwndDlg, WPARAM wParam )
                 while (p != NULL && p[1] == '&');
 
                 /* and check if it's the one we're looking for */
-                               /* FIXME: usage of towupper correct? */
-                if (p != NULL && towupper( p[1] ) == towupper( wParam ) )
+                if (p != NULL && toupperW( p[1] ) == toupperW( wParam ) )
                 {
                     if ((dlgCode & DLGC_STATIC) || (style & 0x0f) == BS_GROUPBOX )
                     {
@@ -623,7 +623,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
             break;
         default:
             result->menuName = (LPCWSTR)p;
-            p += wcslen( result->menuName ) + 1;
+            p += strlenW( result->menuName ) + 1;
             break;
     }
 
@@ -641,14 +641,14 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
             break;
         default:
             result->className = (LPCWSTR)p;
-            p += wcslen( result->className ) + 1;
+            p += strlenW( result->className ) + 1;
             break;
     }
 
     /* Get the window caption */
 
     result->caption = (LPCWSTR)p;
-    p += wcslen( result->caption ) + 1;
+    p += strlenW( result->caption ) + 1;
 
     /* Get the font name */
 
@@ -682,7 +682,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
                 result->italic = LOBYTE(GET_WORD(p)); p++;
             }
             result->faceName = (LPCWSTR)p;
-            p += wcslen( result->faceName ) + 1;
+            p += strlenW( result->faceName ) + 1;
         }
     }
 
@@ -956,7 +956,6 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
     dlgInfo->yBaseUnit   = yBaseUnit;
     dlgInfo->idResult    = IDOK;
     dlgInfo->flags       = flags;
-    /* dlgInfo->hDialogHeap = 0; */
 
     if (template.helpId) SetWindowContextHelpId( hwnd, template.helpId );
 
@@ -1134,12 +1133,6 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
 //// ReactOS
             if ((dlgInfo = (DIALOGINFO *)SetWindowLongPtrW( hwnd, DWLP_ROS_DIALOGINFO, 0 )))
             {
-                /* Free dialog heap (if created) */
-                /*if (dlgInfo->hDialogHeap)
-                {
-                    GlobalUnlock16(dlgInfo->hDialogHeap);
-                    GlobalFree16(dlgInfo->hDialogHeap);
-                }*/
                 if (dlgInfo->hUserFont) DeleteObject( dlgInfo->hUserFont );
                 if (dlgInfo->hMenu) DestroyMenu( dlgInfo->hMenu );
                 HeapFree( GetProcessHeap(), 0, dlgInfo );
@@ -2327,14 +2320,12 @@ IsDialogMessageW(
   HWND hDlg,
   LPMSG lpMsg)
 {
-     INT dlgCode = 0;
-
-     // FIXME: hooks
-     if (CallMsgFilterW( lpMsg, MSGF_DIALOGBOX )) return TRUE;
+    INT dlgCode = 0;
 
-     if ((hDlg != lpMsg->hwnd) && !IsChild( hDlg, lpMsg->hwnd )) return FALSE;
+    if (CallMsgFilterW( lpMsg, MSGF_DIALOGBOX )) return TRUE;
 
     if (hDlg == GetDesktopWindow()) return FALSE;
+    if ((hDlg != lpMsg->hwnd) && !IsChild( hDlg, lpMsg->hwnd )) return FALSE;
 
      hDlg = DIALOG_FindMsgDestination(hDlg);
 
@@ -2380,7 +2371,7 @@ IsDialogMessageW(
                             {
                                 INT length;
                                 SendMessageW (hwndNext, WM_GETTEXT, maxlen, (LPARAM) buffer);
-                                length = wcslen (buffer);
+                                length = strlenW (buffer);
                                 HeapFree (GetProcessHeap(), 0, buffer);
                                 SendMessageW (hwndNext, EM_SETSEL, 0, length);
                             }
@@ -2425,11 +2416,8 @@ IsDialogMessageW(
                  else if (DC_HASDEFID == HIWORD(dw = SendMessageW (hDlg, DM_GETDEFID, 0, 0)))
                  {
                     HWND hwndDef = GetDlgItem(hDlg, LOWORD(dw));
-                    if (!hwndDef || !IsWindowEnabled(hwndDef))
-                        return TRUE;
-
-                     SendMessageW( hDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ),
-                                     (LPARAM)GetDlgItem(hDlg, LOWORD(dw)));
+                    if (hwndDef ? IsWindowEnabled(hwndDef) : LOWORD(dw)==IDOK)
+                        SendMessageW( hDlg, WM_COMMAND, MAKEWPARAM( LOWORD(dw), BN_CLICKED ), (LPARAM)hwndDef);
                  }
                  else
                  {
@@ -2442,6 +2430,9 @@ IsDialogMessageW(
          break;
 
      case WM_CHAR:
+         /* FIXME Under what circumstances does WM_GETDLGCODE get sent?
+          * It does NOT get sent in the test program I have
+          */
          dlgCode = SendMessageW( lpMsg->hwnd, WM_GETDLGCODE, lpMsg->wParam, (LPARAM)lpMsg );
          if (dlgCode & (DLGC_WANTCHARS|DLGC_WANTMESSAGE)) break;
          if (lpMsg->wParam == '\t' && (dlgCode & DLGC_WANTTAB)) break;
@@ -2454,7 +2445,7 @@ IsDialogMessageW(
              return TRUE;
          }
          break;
-
+//// ReactOS
      case WM_SYSKEYDOWN:
          /* If the ALT key is being pressed display the keyboard cues */
          if (lpMsg->lParam & (1 << 29))
index 5a045b1..2c89b78 100644 (file)
@@ -2624,7 +2624,7 @@ User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength)
     }
 
   if (pci->CallbackWnd.hWnd == UMMsg.hwnd)
-     pWnd  = pci->CallbackWnd.pvWnd;
+     pWnd  = pci->CallbackWnd.pWnd;
     
   CallbackArgs->Result = IntCallWindowProcW( CallbackArgs->IsAnsiProc,
                                              CallbackArgs->Proc,
index bd9998c..920e4e1 100644 (file)
@@ -173,7 +173,7 @@ typedef struct tagHOOK
 typedef struct _CALLBACKWND
 {
      HWND hWnd;
-     PVOID pvWnd;
+     struct _WND *pWnd;
 } CALLBACKWND, *PCALLBACKWND;
 
 #define CI_TRANSACTION       0x00000001
@@ -384,6 +384,12 @@ typedef struct _CLS
 } CLS, *PCLS;
 
 
+typedef struct _SBINFOEX
+{
+  SCROLLBARINFO ScrollBarInfo;
+  SCROLLINFO ScrollInfo;
+} SBINFOEX, *PSBINFOEX;
+
 // State Flags !Not Implemented!
 #define WNDS_HASMENU                 0X00000001
 #define WNDS_HASVERTICALSCROOLLBAR   0X00000002
@@ -526,6 +532,7 @@ typedef struct _WND
     struct _WND *spwndClipboardListener;
     DWORD ExStyle2;
 
+    /* ReactOS */
     struct
     {
         RECT NormalRect;
@@ -538,6 +545,11 @@ typedef struct _WND
     UINT InternalPosInitialized : 1;
     UINT HideFocus : 1; // WS_EX_UISTATEFOCUSRECTHIDDEN ?
     UINT HideAccel : 1; // WS_EX_UISTATEKBACCELHIDDEN ?
+
+  /* Scrollbar info */
+  PSBINFOEX pSBInfoex; // convert to PSBINFO
+  /* Entry in the list of thread windows. */
+  LIST_ENTRY ThreadListEntry;
 } WND, *PWND;
 
 typedef struct _PFNCLIENT
@@ -1013,13 +1025,13 @@ NtUserSetSystemMenu(
   HWND hWnd,
   HMENU hMenu);
 
-DWORD
+BOOL
 NTAPI
 NtUserThunkedMenuInfo(
   HMENU hMenu,
   LPCMENUINFO lpcmi);
 
-DWORD
+BOOL
 NTAPI
 NtUserThunkedMenuItemInfo(
   HMENU hMenu,
@@ -3231,8 +3243,6 @@ NtUserMenuInfo(
  BOOL fsog
 );
 
-
-
 typedef struct tagROSMENUITEMINFO
 {
     /* ----------- MENUITEMINFOW ----------- */
index 5628610..11eae9e 100644 (file)
@@ -71,13 +71,13 @@ IntEngWndCallChangeProc(
 }
 
 /*
- * Fills the CLIPOBJ and client rect of the WNDOBJ with the data from the given WINDOW_OBJECT
+ * Fills the CLIPOBJ and client rect of the WNDOBJ with the data from the given WND
  */
 BOOLEAN
 FASTCALL
 IntEngWndUpdateClipObj(
   WNDGDI *WndObjInt,
-  PWINDOW_OBJECT Window)
+  PWND Window)
 {
   HRGN hVisRgn;
   PROSRGNDATA visRgn;
@@ -89,7 +89,7 @@ IntEngWndUpdateClipObj(
   hVisRgn = VIS_ComputeVisibleRegion(Window, TRUE, TRUE, TRUE);
   if (hVisRgn != NULL)
   {
-    NtGdiOffsetRgn(hVisRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
+    NtGdiOffsetRgn(hVisRgn, Window->rcClient.left, Window->rcClient.top);
     visRgn = RGNOBJAPI_Lock(hVisRgn, NULL);
     if (visRgn != NULL)
     {
@@ -127,8 +127,8 @@ IntEngWndUpdateClipObj(
   if (ClipObj == NULL)
   {
     /* Fall back to client rect */
-    ClipObj = IntEngCreateClipRegion(1, &Window->Wnd->rcClient,
-                                     &Window->Wnd->rcClient);
+    ClipObj = IntEngCreateClipRegion(1, &Window->rcClient,
+                                     &Window->rcClient);
   }
 
   if (ClipObj == NULL)
@@ -138,7 +138,7 @@ IntEngWndUpdateClipObj(
   }
 
   RtlCopyMemory(&WndObjInt->WndObj.coClient, ClipObj, sizeof (CLIPOBJ));
-  RtlCopyMemory(&WndObjInt->WndObj.rclClient, &Window->Wnd->rcClient, sizeof (RECT));
+  RtlCopyMemory(&WndObjInt->WndObj.rclClient, &Window->rcClient, sizeof (RECT));
   OldClipObj = InterlockedExchangePointer((PVOID*)&WndObjInt->ClientClipObj, ClipObj);
   if (OldClipObj != NULL)
     IntEngDeleteClipRegion(OldClipObj);
@@ -147,12 +147,12 @@ IntEngWndUpdateClipObj(
 }
 
 /*
- * Updates all WNDOBJs of the given WINDOW_OBJECT and calls the change-procs.
+ * Updates all WNDOBJs of the given WND and calls the change-procs.
  */
 VOID
 FASTCALL
 IntEngWindowChanged(
-  PWINDOW_OBJECT  Window,
+  PWND  Window,
   FLONG           flChanged)
 {
   WNDGDI *Current;
@@ -160,7 +160,7 @@ IntEngWindowChanged(
 
   ASSERT_IRQL_LESS_OR_EQUAL(PASSIVE_LEVEL);
 
-  hWnd = Window->hSelf; // pWnd->head.h;
+  hWnd = Window->head.h;
   Current = (WNDGDI *)IntGetProp(Window, AtomWndObj);
 
   if ( gcountPWO &&
@@ -206,7 +206,7 @@ EngCreateWnd(
 {
   WNDGDI *WndObjInt = NULL;
   WNDOBJ *WndObjUser = NULL;
-  PWINDOW_OBJECT Window;
+  PWND Window;
   BOOL calledFromUser;
   DECLARE_RETURN(WNDOBJ*);
 
@@ -279,7 +279,7 @@ EngDeleteWnd(
   IN WNDOBJ *pwo)
 {
   WNDGDI *WndObjInt = ObjToGDI(pwo, WND);
-  PWINDOW_OBJECT Window;
+  PWND Window;
   BOOL calledFromUser;
 
   DPRINT("EngDeleteWnd: pwo = 0x%x\n", pwo);
index 8c7998c..6057188 100644 (file)
@@ -17,8 +17,8 @@ co_IntSetCaretPos(int X, int Y);
 BOOL FASTCALL
 IntSwitchCaretShowing(PVOID Info);
 
-BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT WindowObject);
+BOOL FASTCALL co_UserShowCaret(PWND WindowObject);
 
-BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT WindowObject);
+BOOL FASTCALL co_UserHideCaret(PWND WindowObject);
 
 /* EOF */
index 819ba98..b7251ba 100644 (file)
@@ -7,7 +7,7 @@ VOID FASTCALL IntIncrementSequenceNumber(VOID);
 
 typedef struct _ClipboardChainElement
 {
-    PWINDOW_OBJECT                 window;
+    PWND                 window;
     struct _ClipboardChainElement *next;
 } CLIPBOARDCHAINELEMENT, *PCLIPBOARDCHAINELEMENT;
 
@@ -23,9 +23,9 @@ typedef struct _CLIPBOARDSYSTEM
 {
     PTHREADINFO     ClipboardThread;
     PTHREADINFO     ClipboardOwnerThread;
-    PWINDOW_OBJECT  ClipboardWindow;
-    PWINDOW_OBJECT  ClipboardViewerWindow;
-    PWINDOW_OBJECT  ClipboardOwnerWindow;
+    PWND  ClipboardWindow;
+    PWND  ClipboardViewerWindow;
+    PWND  ClipboardOwnerWindow;
     BOOL            sendDrawClipboardMsg;
     BOOL            recentlySetClipboard;
     BOOL            delayedRender;
@@ -41,7 +41,7 @@ typedef struct _CLIPBOARDSYSTEM
 } CLIPBOARDSYSTEM, *PCLIPBOARDSYSTEM;
 
 VOID FASTCALL
-IntClipboardFreeWindow(PWINDOW_OBJECT window);
+IntClipboardFreeWindow(PWND window);
 
 UINT APIENTRY IntEnumClipboardFormats(UINT format);
 
index de83e8a..7820324 100644 (file)
@@ -50,7 +50,7 @@ typedef struct tagDCE
 #define DCX_INDESTROY           0x00400000
 
 BOOL FASTCALL DCE_Cleanup(PDCE pDce);
-PDCE FASTCALL DceAllocDCE(PWINDOW_OBJECT Window, DCE_TYPE Type);
+PDCE FASTCALL DceAllocDCE(PWND Window, DCE_TYPE Type);
 PDCE FASTCALL DCE_FreeDCE(PDCE dce);
 VOID FASTCALL DCE_FreeWindowDCE(HWND);
 INT  FASTCALL DCE_ExcludeRgn(HDC, HWND, HRGN);
@@ -58,8 +58,8 @@ BOOL FASTCALL DCE_InvalidateDCE(HWND, const PRECTL);
 HWND FASTCALL IntWindowFromDC(HDC hDc);
 PDCE FASTCALL DceFreeDCE(PDCE dce, BOOLEAN Force);
 void FASTCALL DceEmptyCache(void);
-VOID FASTCALL DceResetActiveDCEs(PWINDOW_OBJECT Window);
+VOID FASTCALL DceResetActiveDCEs(PWND Window);
 void FASTCALL DceFreeClassDCE(HDC);
 HWND FASTCALL UserGethWnd(HDC,PWNDOBJ*);
-void FASTCALL DceFreeWindowDCE(PWINDOW_OBJECT);
+void FASTCALL DceFreeWindowDCE(PWND);
 void FASTCALL DceFreeThreadDCE(PTHREADINFO);
index 406ee7b..83ec40c 100644 (file)
@@ -76,7 +76,7 @@ IntGetScreenDC(VOID);
 HWND FASTCALL
 IntGetDesktopWindow (VOID);
 
-PWINDOW_OBJECT FASTCALL
+PWND FASTCALL
 UserGetDesktopWindow(VOID);
 
 HWND FASTCALL
index 82e2463..5d95070 100644 (file)
@@ -15,7 +15,7 @@ IntEngMaskBlt(SURFOBJ *psoDest,
 
 VOID FASTCALL
 IntEngWindowChanged(
-        PWINDOW_OBJECT Window,
+        PWND Window,
         FLONG flChanged);
 
 VOID FASTCALL IntGdiAcquireSemaphore ( HSEMAPHORE hsem );
index 859d1c7..299efb5 100644 (file)
@@ -17,8 +17,8 @@ HWND APIENTRY IntGetCapture(VOID);
 HWND FASTCALL UserGetActiveWindow(VOID);
 
 BOOL FASTCALL
-co_IntMouseActivateWindow(PWINDOW_OBJECT Window);
+co_IntMouseActivateWindow(PWND Window);
 BOOL FASTCALL
-co_IntSetForegroundWindow(PWINDOW_OBJECT Window);
+co_IntSetForegroundWindow(PWND Window);
 HWND FASTCALL
-co_IntSetActiveWindow(PWINDOW_OBJECT Window);
+co_IntSetActiveWindow(PWND Window);
index 1e1c663..c03e6eb 100644 (file)
@@ -27,7 +27,7 @@ GetHotKey (UINT fsModifiers,
           int *id);
 
 VOID FASTCALL
-UnregisterWindowHotKeys(PWINDOW_OBJECT Window);
+UnregisterWindowHotKeys(PWND Window);
 
 VOID FASTCALL
 UnregisterThreadHotKeys(struct _ETHREAD *Thread);
index 94d7106..6b86b62 100644 (file)
@@ -94,7 +94,7 @@ IntCheckMenuItem(PMENU_OBJECT MenuObject, UINT uIDCheckItem, UINT uCheck);
 BOOL FASTCALL
 IntSetMenuItemRect(PMENU_OBJECT MenuObject, UINT Item, BOOL fByPos, RECTL *rcRect);
 
-DWORD APIENTRY UserInsertMenuItem(HMENU hMenu, UINT uItem, BOOL fByPosition, LPCMENUITEMINFOW lpmii);
+DWORD FASTCALL UserInsertMenuItem(PMENU_OBJECT Menu, UINT uItem, BOOL fByPosition, LPCMENUITEMINFOW lpmii);
 
 BOOL FASTCALL
 IntCleanupMenus(struct _EPROCESS *Process, PPROCESSINFO Win32Process);
index 07ebc53..64f270a 100644 (file)
@@ -128,7 +128,7 @@ BOOLEAN APIENTRY
 co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
               IN BOOLEAN Hardware,
               IN BOOLEAN Remove,
-              IN PWINDOW_OBJECT Window,
+              IN PWND Window,
               IN UINT MsgFilterLow,
               IN UINT MsgFilterHigh,
               OUT PUSER_MESSAGE* Message);
@@ -147,7 +147,7 @@ MsqInitializeImpl(VOID);
 BOOLEAN FASTCALL
 co_MsqDispatchOneSentMessage(PUSER_MESSAGE_QUEUE MessageQueue);
 NTSTATUS FASTCALL
-co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT WndFilter,
+co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter,
                       UINT MsgFilterMin, UINT MsgFilterMax);
 VOID FASTCALL
 MsqSendNotifyMessage(PUSER_MESSAGE_QUEUE MessageQueue,
index ed7bea4..91385ca 100644 (file)
@@ -5,11 +5,11 @@
 #include <include/window.h>
 
 BOOL FASTCALL
-co_UserRedrawWindow(PWINDOW_OBJECT Wnd, const RECTL* UpdateRect, HRGN UpdateRgn, ULONG Flags);
+co_UserRedrawWindow(PWND Wnd, const RECTL* UpdateRect, HRGN UpdateRgn, ULONG Flags);
 VOID FASTCALL
-IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags);
+IntInvalidateWindows(PWND Window, HRGN hRgn, ULONG Flags);
 BOOL FASTCALL
-IntGetPaintMessage(PWINDOW_OBJECT Window, UINT MsgFilterMin, UINT MsgFilterMax, PTHREADINFO Thread,
+IntGetPaintMessage(PWND Window, UINT MsgFilterMin, UINT MsgFilterMax, PTHREADINFO Thread,
                    MSG *Message, BOOL Remove);
 INT FASTCALL UserRealizePalette(HDC);
-INT FASTCALL co_UserGetUpdateRgn(PWINDOW_OBJECT, HRGN, BOOL);
+INT FASTCALL co_UserGetUpdateRgn(PWND, HRGN, BOOL);
index 4eb8652..0804556 100644 (file)
@@ -1,5 +1,5 @@
 #pragma once
 
-PPROPERTY FASTCALL IntGetProp(PWINDOW_OBJECT,ATOM);
-BOOL FASTCALL IntRemoveProp(PWINDOW_OBJECT,ATOM);
-BOOL FASTCALL IntSetProp(PWINDOW_OBJECT, ATOM, HANDLE);
+PPROPERTY FASTCALL IntGetProp(PWND,ATOM);
+BOOL FASTCALL IntRemoveProp(PWND,ATOM);
+BOOL FASTCALL IntSetProp(PWND, ATOM, HANDLE);
index 171a4eb..429de28 100644 (file)
@@ -43,21 +43,21 @@ typedef struct tagSBTRACK
     PSBCALC  pSBCalc;
 } SBTRACK, *PSBTRACK;
 
-
+/*
 typedef struct _SBINFOEX
 {
   SCROLLBARINFO ScrollBarInfo;
   SCROLLINFO ScrollInfo;
 } SBINFOEX, *PSBINFOEX;
-
+*/
 #define IntGetScrollbarInfoFromWindow(Window, i) \
-  ((PSCROLLBARINFO)(&((Window)->pSBInfo + i)->ScrollBarInfo))
+  ((PSCROLLBARINFO)(&((Window)->pSBInfoex + i)->ScrollBarInfo))
 
 #define IntGetScrollInfoFromWindow(Window, i) \
-  ((LPSCROLLINFO)(&((Window)->pSBInfo + i)->ScrollInfo))
+  ((LPSCROLLINFO)(&((Window)->pSBInfoex + i)->ScrollInfo))
 
 #define SBOBJ_TO_SBID(Obj)     ((Obj) - OBJID_HSCROLL)
 #define SBID_IS_VALID(id)      (id == SB_HORZ || id == SB_VERT || id == SB_CTL)
 
-BOOL FASTCALL co_IntCreateScrollBars(PWINDOW_OBJECT Window);
-BOOL FASTCALL IntDestroyScrollBars(PWINDOW_OBJECT Window);
+BOOL FASTCALL co_IntCreateScrollBars(PWND Window);
+BOOL FASTCALL IntDestroyScrollBars(PWND Window);
index e857402..20faa68 100644 (file)
@@ -5,7 +5,7 @@ typedef struct _TIMER
   HEAD           head;
   LIST_ENTRY     ptmrList;
   PTHREADINFO    pti;
-  PWINDOW_OBJECT pWnd;         // hWnd
+  PWND           pWnd;         // hWnd
   UINT_PTR       nID;          // Specifies a nonzero timer identifier.
   INT            cmsCountdown; // uElapse
   INT            cmsRate;      // uElapse
@@ -28,13 +28,13 @@ extern PKTIMER MasterTimer;
 
 NTSTATUS FASTCALL InitTimerImpl(VOID);
 BOOL FASTCALL DestroyTimersForThread(PTHREADINFO pti);
-BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWINDOW_OBJECT Window);
-BOOL FASTCALL IntKillTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, BOOL SystemTimer);
-UINT_PTR FASTCALL IntSetTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type);
+BOOL FASTCALL DestroyTimersForWindow(PTHREADINFO pti, PWND Window);
+BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer);
+UINT_PTR FASTCALL IntSetTimer(PWND Window, UINT_PTR IDEvent, UINT Elapse, TIMERPROC TimerFunc, INT Type);
 PTIMER FASTCALL FindSystemTimer(PMSG);
 BOOL FASTCALL ValidateTimerCallback(PTHREADINFO,LPARAM);
 VOID CALLBACK SystemTimerProc(HWND,UINT,UINT_PTR,DWORD);
-UINT_PTR FASTCALL SystemTimerSet(PWINDOW_OBJECT,UINT_PTR,UINT,TIMERPROC);
-BOOL FASTCALL PostTimerMessages(PWINDOW_OBJECT);
+UINT_PTR FASTCALL SystemTimerSet(PWND,UINT_PTR,UINT,TIMERPROC);
+BOOL FASTCALL PostTimerMessages(PWND);
 VOID FASTCALL ProcessTimers(VOID);
 VOID FASTCALL StartTheTimers(VOID);
index d31e66f..9ef6b27 100644 (file)
@@ -35,7 +35,7 @@ PMENU_OBJECT FASTCALL UserGetMenuObject(HMENU hMenu);
 
 #define DUMP_REFS(obj) DPRINT1("obj 0x%x, refs %i\n",obj, ((PHEAD)obj)->cLockObj)
 
-PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd);
+PWND FASTCALL IntGetWindowObject(HWND hWnd);
 
 /*************** WINSTA.C ***************/
 
@@ -44,7 +44,7 @@ HWINSTA FASTCALL UserGetProcessWindowStation(VOID);
 /*************** WINPOS.C ***************/
 
 BOOL FASTCALL
-UserGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point);
+UserGetClientOrigin(PWND Window, LPPOINT Point);
 
 /*************** FOCUS.C ***************/
 
@@ -52,18 +52,18 @@ HWND FASTCALL UserGetActiveWindow(VOID);
 
 HWND FASTCALL UserGetForegroundWindow(VOID);
 
-HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window);
+HWND FASTCALL co_UserSetFocus(PWND Window);
 
 /*************** WINDC.C ***************/
 
 INT FASTCALL
-UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint);
+UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint);
 
 HDC FASTCALL
-UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
+UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
 
 HDC FASTCALL
-UserGetWindowDC(PWINDOW_OBJECT Wnd);
+UserGetWindowDC(PWND Wnd);
 
 
 /*************** SESSION.C ***************/
@@ -110,12 +110,12 @@ UserPostMessage(HWND Wnd,
 
 /*************** PAINTING.C ***************/
 
-BOOL FASTCALL co_UserValidateRgn(PWINDOW_OBJECT Window, HRGN hRgn);
+BOOL FASTCALL co_UserValidateRgn(PWND Window, HRGN hRgn);
 
 
 /*************** WINDOW.C ***************/
 
-PWINDOW_OBJECT FASTCALL UserGetWindowObject(HWND hWnd);
+PWND FASTCALL UserGetWindowObject(HWND hWnd);
 
 VOID FASTCALL
 co_DestroyThreadWindows(struct _ETHREAD *Thread);
@@ -123,11 +123,11 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread);
 HWND FASTCALL UserGetShellWindow(VOID);
 
 HDC FASTCALL
-UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
+UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
 
-BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Wnd);
+BOOLEAN FASTCALL co_UserDestroyWindow(PWND Wnd);
 
-PWINDOW_OBJECT FASTCALL UserGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
+PWND FASTCALL UserGetAncestor(PWND Wnd, UINT Type);
 
 /*************** MENU.C ***************/
 
@@ -148,6 +148,6 @@ BOOL FASTCALL UserDestroyMenu(HMENU hMenu);
 /*************** SCROLLBAR.C ***************/
 
 DWORD FASTCALL
-co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow);
+co_UserShowScrollBar(PWND Window, int wBar, DWORD bShow);
 
 /* EOF */
index 5fd4a5f..e81e478 100644 (file)
 #include <include/window.h>
 
 HRGN FASTCALL
-VIS_ComputeVisibleRegion(PWINDOW_OBJECT Window, BOOLEAN ClientArea,
+VIS_ComputeVisibleRegion(PWND Window, BOOLEAN ClientArea,
    BOOLEAN ClipChildren, BOOLEAN ClipSiblings);
 
 VOID FASTCALL
-co_VIS_WindowLayoutChanged(PWINDOW_OBJECT Window, HRGN UncoveredRgn);
+co_VIS_WindowLayoutChanged(PWND Window, HRGN UncoveredRgn);
 
 /* EOF */
index 617e3e5..a91183a 100644 (file)
@@ -17,44 +17,6 @@ extern ATOM AtomWndObj; /* WNDOBJ list */
 
 BOOL FASTCALL UserUpdateUiState(PWND Wnd, WPARAM wParam);
 
-typedef struct _WINDOW_OBJECT
-{
-  THRDESKHEAD head;
-  PWND Wnd;
-
-  /* Pointer to the thread information */
-  PTHREADINFO pti; // Use Wnd->head.pti
-  /* system menu handle. */
-  HMENU SystemMenu;
-  /* Handle for the window. */
-  HWND hSelf; // Use Wnd->head.h
-  /* Window flags. */
-  ULONG state;
-  /* Handle of region of the window to be updated. */
-  HANDLE hrgnUpdate;
-  /* Handle of the window region. */
-  HANDLE hrgnClip;
-  struct _WINDOW_OBJECT* spwndChild;
-  struct _WINDOW_OBJECT* spwndNext;
-  struct _WINDOW_OBJECT* spwndPrev;
-  struct _WINDOW_OBJECT* spwndParent;
-  struct _WINDOW_OBJECT* spwndOwner;
-
-  /* Scrollbar info */
-  PSBINFOEX pSBInfo; // convert to PSBINFO
-  /* Entry in the list of thread windows. */
-  LIST_ENTRY ThreadListEntry;
-} WINDOW_OBJECT; /* PWINDOW_OBJECT already declared at top of file */
-
-/* Window flags. */
-#define WINDOWOBJECT_NEED_SIZE            WNDS_SENDSIZEMOVEMSGS
-#define WINDOWOBJECT_NEED_ERASEBKGND      WNDS_ERASEBACKGROUND
-#define WINDOWOBJECT_NEED_NCPAINT         WNDS_SENDNCPAINT
-#define WINDOWOBJECT_RESTOREMAX           (0x00000020) // Set/Clr WS_MAXIMIZE && Clr/Set WS_EX2_VERTICALLYMAXIMIZEDLEFT/RIGHT
-
-#define WINDOWSTATUS_DESTROYING         WNDS2_INDESTROY
-#define WINDOWSTATUS_DESTROYED          WNDS_DESTROYED
-
 #define HAS_DLGFRAME(Style, ExStyle) \
             (((ExStyle) & WS_EX_DLGMODALFRAME) || \
             (((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME))))
@@ -74,23 +36,19 @@ typedef struct _WINDOW_OBJECT
 
 
 #define IntWndBelongsToThread(WndObj, W32Thread) \
-  (((WndObj->pti->pEThread && WndObj->pti->pEThread->Tcb.Win32Thread)) && \
-   (WndObj->pti->pEThread->Tcb.Win32Thread == W32Thread))
-//  ((WndObj->head.pti) && (WndObj->head.pti == W32Thread))
+  ((WndObj->head.pti) && (WndObj->head.pti == W32Thread))
 
 #define IntGetWndThreadId(WndObj) \
-  WndObj->pti->pEThread->Cid.UniqueThread
-//  WndObj->head.pti->pEThread->Cid.UniqueThread
+  WndObj->head.pti->pEThread->Cid.UniqueThread
 
 #define IntGetWndProcessId(WndObj) \
-  WndObj->pti->pEThread->ThreadsProcess->UniqueProcessId
-//  WndObj->head.pti->pEThread->ThreadsProcess->UniqueProcessId
+  WndObj->head.pti->pEThread->ThreadsProcess->UniqueProcessId
 
 BOOL FASTCALL
 IntIsWindow(HWND hWnd);
 
 HWND* FASTCALL
-IntWinListChildren(PWINDOW_OBJECT Window);
+IntWinListChildren(PWND Window);
 
 NTSTATUS FASTCALL
 InitWindowImpl (VOID);
@@ -99,52 +57,52 @@ NTSTATUS FASTCALL
 CleanupWindowImpl (VOID);
 
 VOID FASTCALL
-IntGetClientRect (PWINDOW_OBJECT WindowObject, RECTL *Rect);
+IntGetClientRect (PWND WindowObject, RECTL *Rect);
 
 HWND FASTCALL
 IntGetActiveWindow (VOID);
 
 BOOL FASTCALL
-IntIsWindowVisible (PWINDOW_OBJECT Window);
+IntIsWindowVisible (PWND Window);
 
 BOOL FASTCALL
-IntIsChildWindow (PWINDOW_OBJECT Parent, PWINDOW_OBJECT Child);
+IntIsChildWindow (PWND Parent, PWND Child);
 
 VOID FASTCALL
-IntUnlinkWindow(PWINDOW_OBJECT Wnd);
+IntUnlinkWindow(PWND Wnd);
 
 VOID FASTCALL
-IntLinkWindow(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndPrevSibling);
+IntLinkWindow(PWND Wnd, PWND WndPrevSibling);
 
 VOID FASTCALL 
-IntLinkHwnd(PWINDOW_OBJECT Wnd, HWND hWndPrev);
+IntLinkHwnd(PWND Wnd, HWND hWndPrev);
 
-PWINDOW_OBJECT FASTCALL
-IntGetAncestor(PWINDOW_OBJECT Wnd, UINT Type);
+PWND FASTCALL
+IntGetAncestor(PWND Wnd, UINT Type);
 
-PWINDOW_OBJECT FASTCALL
-IntGetParent(PWINDOW_OBJECT Wnd);
+PWND FASTCALL
+IntGetParent(PWND Wnd);
 
 INT FASTCALL
-IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn);
+IntGetWindowRgn(PWND Window, HRGN hRgn);
 
 INT FASTCALL
-IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECTL *Rect);
+IntGetWindowRgnBox(PWND Window, RECTL *Rect);
 
 BOOL FASTCALL
-IntGetWindowInfo(PWINDOW_OBJECT WindowObject, PWINDOWINFO pwi);
+IntGetWindowInfo(PWND WindowObject, PWINDOWINFO pwi);
 
 VOID FASTCALL
-IntGetWindowBorderMeasures(PWINDOW_OBJECT WindowObject, UINT *cx, UINT *cy);
+IntGetWindowBorderMeasures(PWND WindowObject, UINT *cx, UINT *cy);
 
 BOOL FASTCALL
-IntIsWindowInDestroy(PWINDOW_OBJECT Window);
+IntIsWindowInDestroy(PWND Window);
 
 BOOL FASTCALL
-IntShowOwnedPopups( PWINDOW_OBJECT owner, BOOL fShow );
+IntShowOwnedPopups( PWND owner, BOOL fShow );
 
 LRESULT FASTCALL
-IntDefWindowProc( PWINDOW_OBJECT Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi);
+IntDefWindowProc( PWND Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi);
 
 VOID FASTCALL IntNotifyWinEvent(DWORD, PWND, LONG, LONG);
 
index 7d14676..cee93ab 100644 (file)
@@ -1,36 +1,36 @@
 #pragma once
 
 #define IntPtInWindow(WndObject,x,y) \
-  ((x) >= (WndObject)->Wnd->rcWindow.left && \
-   (x) < (WndObject)->Wnd->rcWindow.right && \
-   (y) >= (WndObject)->Wnd->rcWindow.top && \
-   (y) < (WndObject)->Wnd->rcWindow.bottom && \
-   (!(WndObject)->hrgnClip || ((WndObject)->Wnd->style & WS_MINIMIZE) || \
-    NtGdiPtInRegion((WndObject)->hrgnClip, (INT)((x) - (WndObject)->Wnd->rcWindow.left), \
-                    (INT)((y) - (WndObject)->Wnd->rcWindow.top))))
+  ((x) >= (WndObject)->rcWindow.left && \
+   (x) < (WndObject)->rcWindow.right && \
+   (y) >= (WndObject)->rcWindow.top && \
+   (y) < (WndObject)->rcWindow.bottom && \
+   (!(WndObject)->hrgnClip || ((WndObject)->style & WS_MINIMIZE) || \
+    NtGdiPtInRegion((WndObject)->hrgnClip, (INT)((x) - (WndObject)->rcWindow.left), \
+                    (INT)((y) - (WndObject)->rcWindow.top))))
 
 UINT
-FASTCALL co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent);
+FASTCALL co_WinPosArrangeIconicWindows(PWND parent);
 BOOL FASTCALL
-IntGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point);
+IntGetClientOrigin(PWND Window, LPPOINT Point);
 LRESULT FASTCALL
-co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECTL* WindowRect, RECTL* ClientRect);
+co_WinPosGetNonClientSize(PWND Window, RECTL* WindowRect, RECTL* ClientRect);
 UINT FASTCALL
-co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
+co_WinPosGetMinMaxInfo(PWND Window, POINT* MaxSize, POINT* MaxPos,
                    POINT* MinTrack, POINT* MaxTrack);
 UINT FASTCALL
-co_WinPosMinMaximize(PWINDOW_OBJECT WindowObject, UINT ShowFlag, RECTL* NewPos);
+co_WinPosMinMaximize(PWND WindowObject, UINT ShowFlag, RECTL* NewPos);
 BOOLEAN FASTCALL
-co_WinPosSetWindowPos(PWINDOW_OBJECT Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
+co_WinPosSetWindowPos(PWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx,
                   INT cy, UINT flags);
 BOOLEAN FASTCALL
-co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd);
+co_WinPosShowWindow(PWND Window, INT Cmd);
 void FASTCALL
-co_WinPosSendSizeMove(PWINDOW_OBJECT Window);
+co_WinPosSendSizeMove(PWND Window);
 USHORT FASTCALL
-co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
-                     PWINDOW_OBJECT* Window);
-VOID FASTCALL co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window);
+co_WinPosWindowFromPoint(PWND ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
+                     PWND* Window);
+VOID FASTCALL co_WinPosActivateOtherWindow(PWND Window);
 
-VOID FASTCALL WinPosInitInternalPos(PWINDOW_OBJECT WindowObject,
+VOID FASTCALL WinPosInitInternalPos(PWND WindowObject,
                                     POINT *pt, RECTL *RestoreRect);
index d963344..a913de1 100644 (file)
@@ -95,7 +95,7 @@ PACCELERATOR_TABLE FASTCALL UserGetAccelObject(HACCEL hAccel)
 static
 BOOLEAN FASTCALL
 co_IntTranslateAccelerator(
-   PWINDOW_OBJECT Window,
+   PWND Window,
    UINT message,
    WPARAM wParam,
    LPARAM lParam,
@@ -108,7 +108,7 @@ co_IntTranslateAccelerator(
    ASSERT_REFS_CO(Window);
 
    DPRINT("IntTranslateAccelerator(hwnd %x, message %x, wParam %x, lParam %x, fVirt %d, key %x, cmd %x)\n",
-          Window->hSelf, message, wParam, lParam, fVirt, key, cmd);
+          Window->head.h, message, wParam, lParam, fVirt, key, cmd);
 
    if (wParam != key)
    {
@@ -162,7 +162,7 @@ co_IntTranslateAccelerator(
    }
 
    DPRINT("IntTranslateAccelerator(hwnd %x, message %x, wParam %x, lParam %x, fVirt %d, key %x, cmd %x) = FALSE\n",
-          Window->hSelf, message, wParam, lParam, fVirt, key, cmd);
+          Window->head.h, message, wParam, lParam, fVirt, key, cmd);
 
    return FALSE;
 
@@ -250,12 +250,12 @@ found:
    if (mesg == WM_COMMAND)
    {
       DPRINT(", sending WM_COMMAND, wParam=%0x\n", 0x10000 | cmd);
-      co_IntSendMessage(Window->hSelf, mesg, 0x10000 | cmd, 0L);
+      co_IntSendMessage(Window->head.h, mesg, 0x10000 | cmd, 0L);
    }
    else if (mesg == WM_SYSCOMMAND)
    {
       DPRINT(", sending WM_SYSCOMMAND, wParam=%0x\n", cmd);
-      co_IntSendMessage(Window->hSelf, mesg, cmd, 0x00010000L);
+      co_IntSendMessage(Window->head.h, mesg, cmd, 0x00010000L);
    }
    else
    {
@@ -276,7 +276,7 @@ found:
    }
 
    DPRINT("IntTranslateAccelerator(hWnd %x, message %x, wParam %x, lParam %x, fVirt %d, key %x, cmd %x) = TRUE\n",
-          Window->hSelf, message, wParam, lParam, fVirt, key, cmd);
+          Window->head.h, message, wParam, lParam, fVirt, key, cmd);
 
    return TRUE;
 }
@@ -458,7 +458,7 @@ NtUserTranslateAccelerator(
    HACCEL hAccel,
    LPMSG Message)
 {
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    PACCELERATOR_TABLE Accel = NULL;
    ULONG i;
    USER_REFERENCE_ENTRY AccelRef, WindowRef;
index 0bcbaf2..6d6a752 100644 (file)
@@ -93,26 +93,26 @@ IntCleanupThreadCallbacks(PTHREADINFO W32Thread)
 // This will help user space programs speed up read access with the window object.
 //
 static VOID
-IntSetTebWndCallback (HWND * hWnd, PVOID * pWnd)
+IntSetTebWndCallback (HWND * hWnd, PWND * pWnd)
 {
   HWND hWndS = *hWnd;
-  PWINDOW_OBJECT Window = UserGetWindowObject(*hWnd);
+  PWND Window = UserGetWindowObject(*hWnd);
   PCLIENTINFO ClientInfo = GetWin32ClientInfo();
 
   *hWnd = ClientInfo->CallbackWnd.hWnd;
-  *pWnd = ClientInfo->CallbackWnd.pvWnd;
+  *pWnd = ClientInfo->CallbackWnd.pWnd;
 
   ClientInfo->CallbackWnd.hWnd  = hWndS;
-  ClientInfo->CallbackWnd.pvWnd = DesktopHeapAddressToUser(Window->Wnd);
+  ClientInfo->CallbackWnd.pWnd = DesktopHeapAddressToUser(Window);
 }
 
 static VOID
-IntRestoreTebWndCallback (HWND hWnd, PVOID pWnd)
+IntRestoreTebWndCallback (HWND hWnd, PWND pWnd)
 {
   PCLIENTINFO ClientInfo = GetWin32ClientInfo();
 
   ClientInfo->CallbackWnd.hWnd = hWnd;
-  ClientInfo->CallbackWnd.pvWnd = pWnd;
+  ClientInfo->CallbackWnd.pWnd = pWnd;
 }
 
 /* FUNCTIONS *****************************************************************/
@@ -125,7 +125,8 @@ co_IntCallSentMessageCallback(SENDASYNCPROC CompletionCallback,
                               LRESULT Result)
 {
    SENDASYNCPROC_CALLBACK_ARGUMENTS Arguments;
-   PVOID ResultPointer, pWnd;
+   PVOID ResultPointer;
+   PWND pWnd;
    ULONG ResultLength;
    NTSTATUS Status;
 
@@ -168,7 +169,8 @@ co_IntCallWindowProc(WNDPROC Proc,
    WINDOWPROC_CALLBACK_ARGUMENTS StackArguments;
    PWINDOWPROC_CALLBACK_ARGUMENTS Arguments;
    NTSTATUS Status;
-   PVOID ResultPointer, pWnd;
+   PVOID ResultPointer;
+   PWND pWnd;
    ULONG ResultLength;
    ULONG ArgumentLength;
    LRESULT Result;
index f229825..52f8345 100644 (file)
@@ -193,16 +193,14 @@ NtUserGetCPD(
    GETCPD Flags,
    ULONG_PTR ProcIn)
 {
-   PWINDOW_OBJECT Window;
    PWND Wnd;
    ULONG_PTR Result = 0;
 
    UserEnterExclusive();
-   if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+   if (!(Wnd = UserGetWindowObject(hWnd)))
    {   
       goto Cleanup;
    }
-   Wnd = Window->Wnd;
 
    // Processing Window only from User space.
    if ((Flags & ~(UserGetCPDU2A|UserGetCPDA2U)) != UserGetCPDClass)        
index 340cd49..3ebae7a 100644 (file)
@@ -239,14 +239,14 @@ co_IntDrawCaret(HWND hWnd)
 
 
 
-BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT Window OPTIONAL)
+BOOL FASTCALL co_UserHideCaret(PWND Window OPTIONAL)
 {
    PTHREADINFO pti;
    PUSER_MESSAGE_QUEUE ThreadQueue;
 
    if (Window) ASSERT_REFS_CO(Window);
 
-   if(Window && Window->pti->pEThread != PsGetCurrentThread())
+   if(Window && Window->head.pti->pEThread != PsGetCurrentThread())
    {
       SetLastWin32Error(ERROR_ACCESS_DENIED);
       return FALSE;
@@ -255,7 +255,7 @@ BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT Window OPTIONAL)
    pti = PsGetCurrentThreadWin32Thread();
    ThreadQueue = pti->MessageQueue;
 
-   if(Window && ThreadQueue->CaretInfo->hWnd != Window->hSelf)
+   if(Window && ThreadQueue->CaretInfo->hWnd != Window->head.h)
    {
       SetLastWin32Error(ERROR_ACCESS_DENIED);
       return FALSE;
@@ -274,14 +274,14 @@ BOOL FASTCALL co_UserHideCaret(PWINDOW_OBJECT Window OPTIONAL)
 }
 
 
-BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT Window OPTIONAL)
+BOOL FASTCALL co_UserShowCaret(PWND Window OPTIONAL)
 {
    PTHREADINFO pti;
    PUSER_MESSAGE_QUEUE ThreadQueue;
 
    if (Window) ASSERT_REFS_CO(Window);
 
-   if(Window && Window->pti->pEThread != PsGetCurrentThread())
+   if(Window && Window->head.pti->pEThread != PsGetCurrentThread())
    {
       SetLastWin32Error(ERROR_ACCESS_DENIED);
       return FALSE;
@@ -290,7 +290,7 @@ BOOL FASTCALL co_UserShowCaret(PWINDOW_OBJECT Window OPTIONAL)
    pti = PsGetCurrentThreadWin32Thread();
    ThreadQueue = pti->MessageQueue;
 
-   if(Window && ThreadQueue->CaretInfo->hWnd != Window->hSelf)
+   if(Window && ThreadQueue->CaretInfo->hWnd != Window->head.h)
    {
       SetLastWin32Error(ERROR_ACCESS_DENIED);
       return FALSE;
@@ -320,7 +320,7 @@ NtUserCreateCaret(
    int nWidth,
    int nHeight)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    PTHREADINFO pti;
    PUSER_MESSAGE_QUEUE ThreadQueue;
    DECLARE_RETURN(BOOL);
@@ -333,7 +333,7 @@ NtUserCreateCaret(
       RETURN(FALSE);
    }
 
-   if(Window->pti->pEThread != PsGetCurrentThread())
+   if(Window->head.pti->pEThread != PsGetCurrentThread())
    {
       SetLastWin32Error(ERROR_ACCESS_DENIED);
       RETURN(FALSE);
@@ -431,7 +431,7 @@ BOOL
 APIENTRY
 NtUserShowCaret(HWND hWnd OPTIONAL)
 {
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    USER_REFERENCE_ENTRY Ref;
    DECLARE_RETURN(BOOL);
    BOOL ret;
@@ -462,7 +462,7 @@ BOOL
 APIENTRY
 NtUserHideCaret(HWND hWnd OPTIONAL)
 {
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    USER_REFERENCE_ENTRY Ref;
    DECLARE_RETURN(BOOL);
    BOOL ret;
index ac6a5b7..31c2970 100644 (file)
@@ -2102,7 +2102,7 @@ NtUserSetClassLong(HWND hWnd,
                    BOOL Ansi)
 {
     PPROCESSINFO pi;
-    PWINDOW_OBJECT Window;
+    PWND Window;
     ULONG_PTR Ret = 0;
 
     UserEnterExclusive();
@@ -2112,7 +2112,7 @@ NtUserSetClassLong(HWND hWnd,
     Window = UserGetWindowObject(hWnd);
     if (Window != NULL)
     {
-        if (Window->pti->ppi != pi)
+        if (Window->head.pti->ppi != pi)
         {
             SetLastWin32Error(ERROR_ACCESS_DENIED);
             goto Cleanup;
@@ -2154,7 +2154,7 @@ InvalidParameter:
                 dwNewLong = (ULONG_PTR)&Value;
             }
 
-            Ret = UserSetClassLongPtr(Window->Wnd->pcls,
+            Ret = UserSetClassLongPtr(Window->pcls,
                                       Offset,
                                       dwNewLong,
                                       Ansi);
@@ -2274,7 +2274,9 @@ NtUserGetClassInfo(
 
       if (CapturedClassName.Length & 1)
       {
-         goto InvalidParameter;
+         SetLastWin32Error(ERROR_INVALID_PARAMETER);
+         Ret = FALSE;
+         _SEH2_LEAVE;
       }
 
       if (CapturedClassName.Length != 0)
@@ -2297,7 +2299,9 @@ NtUserGetClassInfo(
          if (!IS_ATOM(CapturedClassName.Buffer))
          {
             ERR("NtUserGetClassInfo() got ClassName instead of Atom!\n");
-            goto InvalidParameter;
+            SetLastWin32Error(ERROR_INVALID_PARAMETER);
+            Ret = FALSE;
+            _SEH2_LEAVE;
          }
 
          SafeClassName.Buffer = CapturedClassName.Buffer;
@@ -2305,21 +2309,13 @@ NtUserGetClassInfo(
          SafeClassName.MaximumLength = 0;
       }
 
-      if (ProbeForReadUint(&lpWndClassEx->cbSize) != sizeof(WNDCLASSEXW))
-      {
-InvalidParameter:
-         SetLastWin32Error(ERROR_INVALID_PARAMETER);
-         Ret = FALSE;
-         _SEH2_LEAVE;
-      }
-
       ProbeForWrite( lpWndClassEx, sizeof(WNDCLASSEXW), sizeof(ULONG));
 
       RtlCopyMemory( &Safewcexw, lpWndClassEx, sizeof(WNDCLASSEXW));
    }
    _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
    {
-      SetLastWin32Error(ERROR_CLASS_DOES_NOT_EXIST);
+      SetLastNtError(_SEH2_GetExceptionCode());
       Ret = FALSE;
    }
    _SEH2_END;
@@ -2383,7 +2379,7 @@ NtUserGetClassName (IN HWND hWnd,
                     OUT PUNICODE_STRING ClassName,
                     IN BOOL Ansi)
 {
-    PWINDOW_OBJECT Window;
+    PWND Window;
     UNICODE_STRING CapturedClassName;
     INT Ret = 0;
 
@@ -2398,7 +2394,7 @@ NtUserGetClassName (IN HWND hWnd,
             CapturedClassName = *ClassName;
 
             /* get the class name */
-            Ret = UserGetClassName(Window->Wnd->pcls,
+            Ret = UserGetClassName(Window->pcls,
                                    &CapturedClassName,
                                    Ansi);
 
index 81a7667..538cf25 100644 (file)
@@ -17,9 +17,9 @@
 
 PTHREADINFO      ClipboardThread;
 PTHREADINFO      ClipboardOwnerThread;
-PWINDOW_OBJECT  ClipboardWindow;
-PWINDOW_OBJECT  ClipboardViewerWindow;
-PWINDOW_OBJECT  ClipboardOwnerWindow;
+PWND  ClipboardWindow;
+PWND  ClipboardViewerWindow;
+PWND  ClipboardOwnerWindow;
 BOOL            sendDrawClipboardMsg;
 BOOL            recentlySetClipboard;
 BOOL            delayedRender;
@@ -38,7 +38,7 @@ DWORD synthesizedDataSize;
 /* return the pointer to the prev window of the finded window,
    if NULL does not exists in the chain */
 PCLIPBOARDCHAINELEMENT FASTCALL
-IntIsWindowInChain(PWINDOW_OBJECT window)
+IntIsWindowInChain(PWND window)
 {
     PCLIPBOARDCHAINELEMENT wce = WindowsChain;
 
@@ -60,14 +60,14 @@ VOID FASTCALL printChain(VOID)
     PCLIPBOARDCHAINELEMENT wce2 = WindowsChain;
     while (wce2)
     {
-        DPRINT1("chain: %p\n", wce2->window->hSelf);
+        DPRINT1("chain: %p\n", wce2->window->head.h);
         wce2 = wce2->next;
     }
 }
 
 /* the new window always have to be the first in the chain */
 PCLIPBOARDCHAINELEMENT FASTCALL
-IntAddWindowToChain(PWINDOW_OBJECT window)
+IntAddWindowToChain(PWND window)
 {
     PCLIPBOARDCHAINELEMENT wce = NULL;
 
@@ -96,7 +96,7 @@ exit_addChain:
 }
 
 PCLIPBOARDCHAINELEMENT FASTCALL
-IntRemoveWindowFromChain(PWINDOW_OBJECT window)
+IntRemoveWindowFromChain(PWND window)
 {
     PCLIPBOARDCHAINELEMENT wce = WindowsChain;
        PCLIPBOARDCHAINELEMENT *link = &WindowsChain;
@@ -345,7 +345,7 @@ intIsClipboardOpenByMe(VOID)
 
 /* IntClipboardFreeWindow it's called when a window was destroyed */
 VOID FASTCALL
-IntClipboardFreeWindow(PWINDOW_OBJECT window)
+IntClipboardFreeWindow(PWND window)
 {
     /* called from co_UserFreeWindow in window.c */
     /* check if clipboard is not locked by this window, if yes, unlock it */
@@ -377,7 +377,7 @@ BOOL APIENTRY
 NtUserOpenClipboard(HWND hWnd, DWORD Unknown1)
 {
 
-    PWINDOW_OBJECT Window;
+    PWND Window;
     BOOL ret = FALSE;
 
     UserEnterExclusive();
@@ -392,7 +392,7 @@ NtUserOpenClipboard(HWND hWnd, DWORD Unknown1)
         {
             if  (ClipboardOwnerWindow)
             {
-                if (ClipboardOwnerWindow->hSelf == hWnd)
+                if (ClipboardOwnerWindow->head.h == hWnd)
                 {
                     ret = TRUE;
                 }
@@ -485,7 +485,7 @@ NtUserGetOpenClipboardWindow(VOID)
 
     if (ClipboardWindow)
     {
-        ret = ClipboardWindow->hSelf;
+        ret = ClipboardWindow->head.h;
     }
 
     UserLeave();
@@ -498,7 +498,7 @@ NtUserChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext)
 {
     BOOL ret = FALSE;
     PCLIPBOARDCHAINELEMENT w = NULL;
-    PWINDOW_OBJECT removeWindow;
+    PWND removeWindow;
     UserEnterExclusive();
 
     removeWindow = UserGetWindowObject(hWndRemove);
@@ -521,9 +521,9 @@ NtUserChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext)
         // then they do the chain
 
         /* WindowsChain->window may be NULL */
-        LPARAM lparam = WindowsChain->window == NULL ? 0 : (LPARAM)WindowsChain->window->hSelf;
-        DPRINT1("Message: WM_CHANGECBCHAIN to %p", WindowsChain->window->hSelf);
-        co_IntSendMessage(WindowsChain->window->hSelf, WM_CHANGECBCHAIN, (WPARAM)hWndRemove, lparam);
+        LPARAM lparam = WindowsChain->window == NULL ? 0 : (LPARAM)WindowsChain->window->head.h;
+        DPRINT1("Message: WM_CHANGECBCHAIN to %p", WindowsChain->window->head.h);
+        co_IntSendMessage(WindowsChain->window->head.h, WM_CHANGECBCHAIN, (WPARAM)hWndRemove, lparam);
     }
 
     UserLeave();
@@ -572,8 +572,8 @@ NtUserEmptyClipboard(VOID)
 
     if (ret && ClipboardOwnerWindow)
     {
-        DPRINT("Clipboard: WM_DESTROYCLIPBOARD to %p", ClipboardOwnerWindow->hSelf);
-        co_IntSendMessage( ClipboardOwnerWindow->hSelf, WM_DESTROYCLIPBOARD, 0, 0);
+        DPRINT("Clipboard: WM_DESTROYCLIPBOARD to %p", ClipboardOwnerWindow->head.h);
+        co_IntSendMessage( ClipboardOwnerWindow->head.h, WM_DESTROYCLIPBOARD, 0, 0);
     }
 
     UserLeave();
@@ -603,8 +603,8 @@ NtUserGetClipboardData(UINT uFormat, PVOID pBuffer)
                     /* tell owner what data needs to be rendered */
                     if (ClipboardOwnerWindow)
                     {
-                        ASSERT(ClipboardOwnerWindow->hSelf);
-                        co_IntSendMessage(ClipboardOwnerWindow->hSelf, WM_RENDERFORMAT, (WPARAM)uFormat, 0);
+                        ASSERT(ClipboardOwnerWindow->head.h);
+                        co_IntSendMessage(ClipboardOwnerWindow->head.h, WM_RENDERFORMAT, (WPARAM)uFormat, 0);
                         data = intIsFormatAvailable(uFormat);
                         ASSERT(data->size);
                         ret = (HANDLE)(ULONG_PTR)data->size;
@@ -754,7 +754,7 @@ NtUserGetClipboardOwner(VOID)
 
     if (ClipboardOwnerWindow)
     {
-        ret = ClipboardOwnerWindow->hSelf;
+        ret = ClipboardOwnerWindow->head.h;
     }
 
     UserLeave();
@@ -771,7 +771,7 @@ NtUserGetClipboardViewer(VOID)
 
     if (WindowsChain)
     {
-        ret = WindowsChain->window->hSelf;
+        ret = WindowsChain->window->head.h;
     }
 
     UserLeave();
@@ -1037,7 +1037,7 @@ NtUserSetClipboardViewer(HWND hWndNewViewer)
 {
     HWND ret = NULL;
     PCLIPBOARDCHAINELEMENT newWC = NULL;
-    PWINDOW_OBJECT window;
+    PWND window;
 
     UserEnterExclusive();
 
@@ -1053,7 +1053,7 @@ NtUserSetClipboardViewer(HWND hWndNewViewer)
                 if (newWC->next)
                 {
                     // return the next HWND available window in the chain
-                    ret = newWC->next->window->hSelf;
+                    ret = newWC->next->window->head.h;
                 }
             }
         }
index 4291a98..427632e 100644 (file)
@@ -176,7 +176,7 @@ UserSetCursor(
 
 BOOL UserSetCursorPos( INT x, INT y, BOOL SendMouseMoveMsg)
 {
-    PWINDOW_OBJECT DesktopWindow;
+    PWND DesktopWindow;
     PSYSTEM_CURSORINFO CurInfo;
     HDC hDC;
     MSG Msg;
@@ -197,7 +197,7 @@ BOOL UserSetCursorPos( INT x, INT y, BOOL SendMouseMoveMsg)
 
     /* Clip cursor position */
     if (!CurInfo->bClipped)
-        rcClip = DesktopWindow->Wnd->rcClient;
+        rcClip = DesktopWindow->rcClient;
     else
         rcClip = CurInfo->rcClip;
 
@@ -704,7 +704,7 @@ NtUserClipCursor(
     /* FIXME - check if process has WINSTA_WRITEATTRIBUTES */
     PSYSTEM_CURSORINFO CurInfo;
     RECTL Rect;
-    PWINDOW_OBJECT DesktopWindow = NULL;
+    PWND DesktopWindow = NULL;
     DECLARE_RETURN(BOOL);
 
     DPRINT("Enter NtUserClipCursor\n");
@@ -725,7 +725,7 @@ NtUserClipCursor(
     {
 
         CurInfo->bClipped = TRUE;
-        RECTL_bIntersectRect(&CurInfo->rcClip, &Rect, &DesktopWindow->Wnd->rcWindow);
+        RECTL_bIntersectRect(&CurInfo->rcClip, &Rect, &DesktopWindow->rcWindow);
         UserSetCursorPos(gpsi->ptCursor.x, gpsi->ptCursor.y, FALSE);
 
         RETURN(TRUE);
index afc60e8..e888d4a 100644 (file)
@@ -27,7 +27,7 @@
 static
 LRESULT FASTCALL
 IntClientShutdown(
-   PWINDOW_OBJECT pWindow,
+   PWND pWindow,
    WPARAM wParam,
    LPARAM lParam
 )
@@ -49,14 +49,14 @@ IntClientShutdown(
    {
       for (i = 0; List[i]; i++)
       {
-          PWINDOW_OBJECT WndChild;
+          PWND WndChild;
 
-          if (!(WndChild = UserGetWindowObject(List[i])) || !WndChild->Wnd)
+          if (!(WndChild = UserGetWindowObject(List[i])))
              continue;
 
           if (wParam & MCS_QUERYENDSESSION)
           {
-             if (!co_IntSendMessage(WndChild->hSelf, WM_QUERYENDSESSION, 0, lParams))
+             if (!co_IntSendMessage(WndChild->head.h, WM_QUERYENDSESSION, 0, lParams))
              {
                 lResult = MCSR_DONOTSHUTDOWN;
                 break;
@@ -64,10 +64,10 @@ IntClientShutdown(
           }
           else          
           {
-             co_IntSendMessage(WndChild->hSelf, WM_ENDSESSION, KillTimers, lParams);
+             co_IntSendMessage(WndChild->head.h, WM_ENDSESSION, KillTimers, lParams);
              if (KillTimers)
              {
-                DestroyTimersForWindow(WndChild->pti, WndChild);
+                DestroyTimersForWindow(WndChild->head.pti, WndChild);
              }
              lResult = MCSR_SHUTDOWNFINISHED;
           }
@@ -80,17 +80,17 @@ IntClientShutdown(
  */
    if (wParam & MCS_QUERYENDSESSION)
    {
-      if (!co_IntSendMessage(pWindow->hSelf, WM_QUERYENDSESSION, 0, lParams))
+      if (!co_IntSendMessage(pWindow->head.h, WM_QUERYENDSESSION, 0, lParams))
       {
          lResult = MCSR_DONOTSHUTDOWN;
       }
    }
    else          
    {
-      co_IntSendMessage(pWindow->hSelf, WM_ENDSESSION, KillTimers, lParams);
+      co_IntSendMessage(pWindow->head.h, WM_ENDSESSION, KillTimers, lParams);
       if (KillTimers)
       {
-         DestroyTimersForWindow(pWindow->pti, pWindow);
+         DestroyTimersForWindow(pWindow->head.pti, pWindow);
       }
       lResult = MCSR_SHUTDOWNFINISHED;
    }
@@ -102,25 +102,21 @@ IntClientShutdown(
  */
 LRESULT FASTCALL
 IntDefWindowProc(
-   PWINDOW_OBJECT Window,
+   PWND Wnd,
    UINT Msg,
    WPARAM wParam,
    LPARAM lParam,
    BOOL Ansi)
 {
-   PWND Wnd;
    LRESULT lResult = 0;
 
    if (Msg > WM_USER) return 0;
 
-   Wnd = Window->Wnd;
-   if (!Wnd) return 0;
-
    switch (Msg)
    {
       case WM_SYSCOMMAND:
       {
-         DPRINT1("hwnd %p WM_SYSCOMMAND %lx %lx\n", Window->hSelf, wParam, lParam );
+         DPRINT1("hwnd %p WM_SYSCOMMAND %lx %lx\n", Wnd->head.h, wParam, lParam );
          if (!ISITHOOKED(WH_CBT)) break;
          lResult = co_HOOK_CallHooks(WH_CBT, HCBT_SYSCOMMAND, wParam, lParam);
          break;
@@ -129,7 +125,7 @@ IntDefWindowProc(
       {
          if ((Wnd->style & WS_VISIBLE) && wParam) break;
          if (!(Wnd->style & WS_VISIBLE) && !wParam) break;
-         if (!Window->spwndOwner) break;
+         if (!Wnd->spwndOwner) break;
          if (LOWORD(lParam))
          {
             if (wParam)
@@ -140,12 +136,12 @@ IntDefWindowProc(
             else
                 Wnd->state |= WNDS_HIDDENPOPUP;
 
-            co_WinPosShowWindow(Window, wParam ? SW_SHOWNOACTIVATE : SW_HIDE);
+            co_WinPosShowWindow(Wnd, wParam ? SW_SHOWNOACTIVATE : SW_HIDE);
          }
       }
       break;
       case WM_CLIENTSHUTDOWN:
-         return IntClientShutdown(Window, wParam, lParam);
+         return IntClientShutdown(Wnd, wParam, lParam);
 
       case WM_CBT:
       {
@@ -176,8 +172,8 @@ IntDefWindowProc(
                   _SEH2_END;
                }
                if (!lResult)
-                  lResult = co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)Window->hSelf, lParam ? (LPARAM)&rt : 0);
-            }
+                  lResult = co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)Wnd->head.h, lParam ? (LPARAM)&rt : 0);
+           }
             break;
          }
          break;
index 5025283..3a054f2 100644 (file)
@@ -515,7 +515,7 @@ HWND FASTCALL IntGetDesktopWindow(VOID)
    return pdo->DesktopWindow;
 }
 
-PWINDOW_OBJECT FASTCALL UserGetDesktopWindow(VOID)
+PWND FASTCALL UserGetDesktopWindow(VOID)
 {
    PDESKTOP pdo = IntGetActiveDesktop();
 
@@ -593,7 +593,7 @@ BOOL FASTCALL IntDesktopUpdatePerUserSettings(BOOL bEnable)
 HDC FASTCALL
 UserGetDesktopDC(ULONG DcType, BOOL EmptyDC, BOOL ValidatehWnd)
 {
-    PWINDOW_OBJECT DesktopObject = 0;
+    PWND DesktopObject = 0;
     HDC DesktopHDC = 0;
 
     if (DcType == DC_TYPE_DIRECT)
@@ -614,7 +614,7 @@ UserGetDesktopDC(ULONG DcType, BOOL EmptyDC, BOOL ValidatehWnd)
 VOID APIENTRY
 UserRedrawDesktop()
 {
-    PWINDOW_OBJECT Window = NULL;
+    PWND Window = NULL;
 
     UserEnterExclusive();
 
@@ -656,15 +656,13 @@ IntHideDesktop(PDESKTOP Desktop)
    return NotifyCsrss(&Request, &Reply);
 #else
 
-   PWINDOW_OBJECT DesktopWindow;
    PWND DesktopWnd;
 
-   DesktopWindow = IntGetWindowObject(Desktop->DesktopWindow);
-   if (! DesktopWindow)
+   DesktopWnd = IntGetWindowObject(Desktop->DesktopWindow);
+   if (! DesktopWnd)
    {
       return ERROR_INVALID_WINDOW_HANDLE;
    }
-   DesktopWnd = DesktopWindow->Wnd;
    DesktopWnd->style &= ~WS_VISIBLE;
 
    return STATUS_SUCCESS;
@@ -1401,7 +1399,7 @@ NtUserPaintDesktop(HDC hDC)
    HBRUSH DesktopBrush, PreviousBrush;
    HWND hWndDesktop;
    BOOL doPatBlt = TRUE;
-   PWINDOW_OBJECT WndDesktop;
+   PWND WndDesktop;
    int len;
    COLORREF color_old;
    UINT align_old;
@@ -1423,7 +1421,7 @@ NtUserPaintDesktop(HDC hDC)
       RETURN(FALSE);
    }
 
-   DesktopBrush = (HBRUSH)WndDesktop->Wnd->pcls->hbrBackground;
+   DesktopBrush = (HBRUSH)WndDesktop->pcls->hbrBackground;
 
 
    /*
@@ -1432,7 +1430,7 @@ NtUserPaintDesktop(HDC hDC)
 
    if (WinSta->hbmWallpaper != NULL)
    {
-      PWINDOW_OBJECT DeskWin;
+      PWND DeskWin;
 
       DeskWin = UserGetWindowObject(hWndDesktop);
 
@@ -1442,8 +1440,8 @@ NtUserPaintDesktop(HDC hDC)
          int x, y;
          HDC hWallpaperDC;
 
-         sz.cx = DeskWin->Wnd->rcWindow.right - DeskWin->Wnd->rcWindow.left;
-         sz.cy = DeskWin->Wnd->rcWindow.bottom - DeskWin->Wnd->rcWindow.top;
+         sz.cx = DeskWin->rcWindow.right - DeskWin->rcWindow.left;
+         sz.cy = DeskWin->rcWindow.bottom - DeskWin->rcWindow.top;
 
          if (WinSta->WallpaperMode == wmStretch ||
              WinSta->WallpaperMode == wmTile)
index 3f0d368..02d2ffe 100644 (file)
@@ -241,7 +241,7 @@ NtUserNotifyWinEvent(
    LONG  idObject,
    LONG  idChild)
 {
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    USER_REFERENCE_ENTRY Ref;
    UserEnterExclusive();
 
@@ -255,7 +255,7 @@ NtUserNotifyWinEvent(
    if (gpsi->dwInstalledEventHooks & GetMaskFromEvent(Event))
    {
       UserRefObjectCo(Window, &Ref);
-      IntNotifyWinEvent( Event, Window->Wnd, idObject, idChild);
+      IntNotifyWinEvent( Event, Window, idObject, idChild);
       UserDerefObjectCo(Window);
    }
    UserLeave();
index 59f364e..5832eaf 100644 (file)
@@ -51,13 +51,13 @@ IntGetThreadFocusWindow(VOID)
 VOID FASTCALL
 co_IntSendDeactivateMessages(HWND hWndPrev, HWND hWnd)
 {
-    PWINDOW_OBJECT WndPrev ;
+    PWND WndPrev ;
 
    if (hWndPrev && (WndPrev = UserGetWindowObject(hWndPrev)))
    {
       co_IntSendMessageNoWait(hWndPrev, WM_NCACTIVATE, FALSE, 0);
       co_IntSendMessageNoWait(hWndPrev, WM_ACTIVATE,
-                 MAKEWPARAM(WA_INACTIVE, WndPrev->Wnd->style & WS_MINIMIZE),
+                 MAKEWPARAM(WA_INACTIVE, WndPrev->style & WS_MINIMIZE),
                  (LPARAM)hWnd);
    }
 }
@@ -66,7 +66,7 @@ VOID FASTCALL
 co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
 {
    USER_REFERENCE_ENTRY Ref, RefPrev;
-   PWINDOW_OBJECT Window, WindowPrev = NULL;
+   PWND Window, WindowPrev = NULL;
 
    if ((Window = UserGetWindowObject(hWnd)))
    { 
@@ -94,26 +94,26 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
          co_IntShellHookNotify(HSHELL_WINDOWACTIVATED, (LPARAM) hWnd);
       }
 
-      if (Window->Wnd)
+      if (Window)
       {  // Set last active for window and it's owner.
-         Window->Wnd->hWndLastActive = hWnd;
-         if (Window->Wnd->spwndOwner)
-            Window->Wnd->spwndOwner->hWndLastActive = hWnd;
-         Window->Wnd->state |= WNDS_ACTIVEFRAME;
+         Window->hWndLastActive = hWnd;
+         if (Window->spwndOwner)
+            Window->spwndOwner->hWndLastActive = hWnd;
+         Window->state |= WNDS_ACTIVEFRAME;
       }
 
-      if (WindowPrev && WindowPrev->Wnd)
-         WindowPrev->Wnd->state &= ~WNDS_ACTIVEFRAME;
+      if (WindowPrev)
+         WindowPrev->state &= ~WNDS_ACTIVEFRAME;
 
       if (Window && WindowPrev)
       {
-         PWINDOW_OBJECT cWindow;
+         PWND cWindow;
          HWND *List, *phWnd;
          HANDLE OldTID = IntGetWndThreadId(WindowPrev);
          HANDLE NewTID = IntGetWndThreadId(Window);
 
          DPRINT("SendActiveMessage Old -> %x, New -> %x\n", OldTID, NewTID);
-         if (Window->Wnd->style & WS_MINIMIZE)
+         if (Window->style & WS_MINIMIZE)
          {
             DPRINT("Widow was minimized\n");
          }
@@ -155,7 +155,7 @@ co_IntSendActivateMessages(HWND hWndPrev, HWND hWnd, BOOL MouseActivate)
       /* FIXME: WA_CLICKACTIVE */
       co_IntSendMessageNoWait(hWnd, WM_ACTIVATE,
                               MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE,
-                              Window->Wnd->style & WS_MINIMIZE),
+                              Window->style & WS_MINIMIZE),
                               (LPARAM)hWndPrev);
    }
 }
@@ -179,10 +179,10 @@ co_IntSendSetFocusMessages(HWND hWndPrev, HWND hWnd)
 }
 
 HWND FASTCALL
-IntFindChildWindowToOwner(PWINDOW_OBJECT Root, PWINDOW_OBJECT Owner)
+IntFindChildWindowToOwner(PWND Root, PWND Owner)
 {
    HWND Ret;
-   PWINDOW_OBJECT Child, OwnerWnd;
+   PWND Child, OwnerWnd;
 
    for(Child = Root->spwndChild; Child; Child = Child->spwndNext)
    {
@@ -192,7 +192,7 @@ IntFindChildWindowToOwner(PWINDOW_OBJECT Root, PWINDOW_OBJECT Owner)
 
       if(OwnerWnd == Owner)
       {
-         Ret = Child->hSelf;
+         Ret = Child->head.h;
          return Ret;
       }
    }
@@ -201,21 +201,18 @@ IntFindChildWindowToOwner(PWINDOW_OBJECT Root, PWINDOW_OBJECT Owner)
 }
 
 static BOOL FASTCALL
-co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWindow, BOOL MouseActivate)
+co_IntSetForegroundAndFocusWindow(PWND Wnd, PWND FocusWindow, BOOL MouseActivate)
 {
-   HWND hWnd = Window->hSelf;
+   HWND hWnd = Wnd->head.h;
    HWND hWndPrev = NULL;
-   HWND hWndFocus = FocusWindow->hSelf;
+   HWND hWndFocus = FocusWindow->head.h;
    HWND hWndFocusPrev = NULL;
    PUSER_MESSAGE_QUEUE PrevForegroundQueue;
-   PWND Wnd;
 
-   ASSERT_REFS_CO(Window);
+   ASSERT_REFS_CO(Wnd);
 
    DPRINT("IntSetForegroundAndFocusWindow(%x, %x, %s)\n", hWnd, hWndFocus, MouseActivate ? "TRUE" : "FALSE");
 
-   Wnd = Window->Wnd;
-
    if ((Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
    {
       DPRINT("Failed - Child\n");
@@ -223,7 +220,7 @@ co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWin
    }
 
    if (0 == (Wnd->style & WS_VISIBLE) &&
-       Window->pti->pEThread->ThreadsProcess != CsrProcess)
+       Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess)
    {
       DPRINT("Failed - Invisible\n");
       return FALSE;
@@ -248,19 +245,19 @@ co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWin
    co_IntSendKillFocusMessages(hWndFocusPrev, hWndFocus);
 
 
-   IntSetFocusMessageQueue(Window->pti->MessageQueue);
+   IntSetFocusMessageQueue(Wnd->head.pti->MessageQueue);
 
-   if (Window->pti->MessageQueue)
+   if (Wnd->head.pti->MessageQueue)
    {
-      Window->pti->MessageQueue->ActiveWindow = hWnd;
+      Wnd->head.pti->MessageQueue->ActiveWindow = hWnd;
    }
 
-   if (FocusWindow->pti->MessageQueue)
+   if (FocusWindow->head.pti->MessageQueue)
    {
-      FocusWindow->pti->MessageQueue->FocusWindow = hWndFocus;
+      FocusWindow->head.pti->MessageQueue->FocusWindow = hWndFocus;
    }
 
-   if (PrevForegroundQueue != Window->pti->MessageQueue)
+   if (PrevForegroundQueue != Wnd->head.pti->MessageQueue)
    {
       /* FIXME: Send WM_ACTIVATEAPP to all thread windows. */
    }
@@ -272,7 +269,7 @@ co_IntSetForegroundAndFocusWindow(PWINDOW_OBJECT Window, PWINDOW_OBJECT FocusWin
 }
 
 BOOL FASTCALL
-co_IntSetForegroundWindow(PWINDOW_OBJECT Window)//FIXME: can Window be NULL??
+co_IntSetForegroundWindow(PWND Window)//FIXME: can Window be NULL??
 {
    /*if (Window)*/ ASSERT_REFS_CO(Window);
 
@@ -280,24 +277,22 @@ co_IntSetForegroundWindow(PWINDOW_OBJECT Window)//FIXME: can Window be NULL??
 }
 
 BOOL FASTCALL
-co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
+co_IntMouseActivateWindow(PWND Wnd)
 {
    HWND Top;
-   PWINDOW_OBJECT TopWindow;
+   PWND TopWindow;
    USER_REFERENCE_ENTRY Ref;
-   PWND Wnd;
 
-   ASSERT_REFS_CO(Window);
+   ASSERT_REFS_CO(Wnd);
 
-   Wnd = Window->Wnd;
    if(Wnd->style & WS_DISABLED)
    {
       BOOL Ret;
-      PWINDOW_OBJECT TopWnd;
-      PWINDOW_OBJECT DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
+      PWND TopWnd;
+      PWND DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
       if(DesktopWindow)
       {
-         Top = IntFindChildWindowToOwner(DesktopWindow, Window);
+         Top = IntFindChildWindowToOwner(DesktopWindow, Wnd);
          if((TopWnd = UserGetWindowObject(Top)))
          {
             UserRefObjectCo(TopWnd, &Ref);
@@ -311,13 +306,13 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
    }
 
 
-   TopWindow = UserGetAncestor(Window, GA_ROOT);
+   TopWindow = UserGetAncestor(Wnd, GA_ROOT);
    if (!TopWindow) return FALSE;
 
    /* TMN: Check return valud from this function? */
    UserRefObjectCo(TopWindow, &Ref);
 
-   co_IntSetForegroundAndFocusWindow(TopWindow, Window, TRUE);
+   co_IntSetForegroundAndFocusWindow(TopWindow, Wnd, TRUE);
 
    UserDerefObjectCo(TopWindow);
 
@@ -325,32 +320,30 @@ co_IntMouseActivateWindow(PWINDOW_OBJECT Window)
 }
 
 HWND FASTCALL
-co_IntSetActiveWindow(PWINDOW_OBJECT Window OPTIONAL)
+co_IntSetActiveWindow(PWND Wnd OPTIONAL)
 {
    PTHREADINFO pti;
    PUSER_MESSAGE_QUEUE ThreadQueue;
    HWND hWndPrev;
    HWND hWnd = 0;
-   PWND Wnd;
    CBTACTIVATESTRUCT cbt;
 
-   if (Window)
-      ASSERT_REFS_CO(Window);
+   if (Wnd)
+      ASSERT_REFS_CO(Wnd);
 
    pti = PsGetCurrentThreadWin32Thread();
    ThreadQueue = pti->MessageQueue;
    ASSERT(ThreadQueue != 0);
 
-   if (Window != 0)
+   if (Wnd != 0)
    {
-      Wnd = Window->Wnd;
       if ((!(Wnd->style & WS_VISIBLE) &&
-           Window->pti->pEThread->ThreadsProcess != CsrProcess) ||
+           Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess) ||
           (Wnd->style & (WS_POPUP | WS_CHILD)) == WS_CHILD)
       {
          return ThreadQueue ? 0 : ThreadQueue->ActiveWindow;
       }
-      hWnd = Window->hSelf;
+      hWnd = Wnd->head.h;
    }
 
    hWndPrev = ThreadQueue->ActiveWindow;
@@ -377,7 +370,7 @@ co_IntSetActiveWindow(PWINDOW_OBJECT Window OPTIONAL)
 
 static
 HWND FASTCALL
-co_IntSetFocusWindow(PWINDOW_OBJECT Window OPTIONAL)
+co_IntSetFocusWindow(PWND Window OPTIONAL)
 {
    HWND hWndPrev = 0;
    PTHREADINFO pti;
@@ -394,18 +387,18 @@ co_IntSetFocusWindow(PWINDOW_OBJECT Window OPTIONAL)
 
    if (Window != 0)
    {
-      if (hWndPrev == Window->hSelf)
+      if (hWndPrev == Window->head.h)
       {
          return hWndPrev;
       }
 
-     if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)Window->hSelf, (LPARAM)hWndPrev))
+     if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)Window->head.h, (LPARAM)hWndPrev))
         return 0;
 
-      ThreadQueue->FocusWindow = Window->hSelf;
+      ThreadQueue->FocusWindow = Window->head.h;
 
-      co_IntSendKillFocusMessages(hWndPrev, Window->hSelf);
-      co_IntSendSetFocusMessages(hWndPrev, Window->hSelf);
+      co_IntSendKillFocusMessages(hWndPrev, Window->head.h);
+      co_IntSendSetFocusMessages(hWndPrev, Window->head.h);
    }
    else
    {
@@ -475,7 +468,7 @@ NtUserSetActiveWindow(HWND hWnd)
 
    if (hWnd)
    {
-      PWINDOW_OBJECT Window;
+      PWND Window;
       PTHREADINFO pti;
       PUSER_MESSAGE_QUEUE ThreadQueue;
       HWND hWndPrev;
@@ -488,7 +481,7 @@ NtUserSetActiveWindow(HWND hWnd)
       pti = PsGetCurrentThreadWin32Thread();
       ThreadQueue = pti->MessageQueue;
 
-      if (Window->pti->MessageQueue != ThreadQueue)
+      if (Window->head.pti->MessageQueue != ThreadQueue)
       {
          SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
          RETURN( 0);
@@ -540,7 +533,7 @@ NtUserSetCapture(HWND hWnd)
 {
    PTHREADINFO pti;
    PUSER_MESSAGE_QUEUE ThreadQueue;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    HWND hWndPrev;
    DECLARE_RETURN(HWND);
 
@@ -552,7 +545,7 @@ NtUserSetCapture(HWND hWnd)
 
    if((Window = UserGetWindowObject(hWnd)))
    {
-      if(Window->pti->MessageQueue != ThreadQueue)
+      if(Window->head.pti->MessageQueue != ThreadQueue)
       {
          RETURN(NULL);
       }
@@ -580,44 +573,42 @@ CLEANUP:
 
 
 
-HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window OPTIONAL)
+HWND FASTCALL co_UserSetFocus(PWND Wnd OPTIONAL)
 {
-   if (Window)
+   if (Wnd)
    {
       PTHREADINFO pti;
       PUSER_MESSAGE_QUEUE ThreadQueue;
       HWND hWndPrev;
-      PWINDOW_OBJECT TopWnd;
+      PWND TopWnd;
       USER_REFERENCE_ENTRY Ref;
-      PWND Wnd;
 
-      ASSERT_REFS_CO(Window);
+      ASSERT_REFS_CO(Wnd);
 
       pti = PsGetCurrentThreadWin32Thread();
       ThreadQueue = pti->MessageQueue;
 
-      Wnd = Window->Wnd;
       if (Wnd->style & (WS_MINIMIZE | WS_DISABLED))
       {
          return( (ThreadQueue ? ThreadQueue->FocusWindow : 0));
       }
 
-      if (Window->pti->MessageQueue != ThreadQueue)
+      if (Wnd->head.pti->MessageQueue != ThreadQueue)
       {
          SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
          return( 0);
       }
 
-      TopWnd = UserGetAncestor(Window, GA_ROOT);
-      if (TopWnd && TopWnd->hSelf != UserGetActiveWindow())
+      TopWnd = UserGetAncestor(Wnd, GA_ROOT);
+      if (TopWnd && TopWnd->head.h != UserGetActiveWindow())
       {
-//         PWINDOW_OBJECT WndTops = UserGetWindowObject(hWndTop);
+//         PWND WndTops = UserGetWindowObject(hWndTop);
          UserRefObjectCo(TopWnd, &Ref);
          co_IntSetActiveWindow(TopWnd);
          UserDerefObjectCo(TopWnd);
       }
 
-      hWndPrev = co_IntSetFocusWindow(Window);
+      hWndPrev = co_IntSetFocusWindow(Wnd);
 
       return( hWndPrev);
    }
@@ -635,7 +626,7 @@ HWND FASTCALL co_UserSetFocus(PWINDOW_OBJECT Window OPTIONAL)
 HWND APIENTRY
 NtUserSetFocus(HWND hWnd)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    USER_REFERENCE_ENTRY Ref;
    DECLARE_RETURN(HWND);
    HWND ret;
index 4ec1f1b..adfc6a5 100644 (file)
@@ -102,13 +102,13 @@ GetHotKey (UINT fsModifiers,
 
 
 VOID FASTCALL
-UnregisterWindowHotKeys(PWINDOW_OBJECT Window)
+UnregisterWindowHotKeys(PWND Window)
 {
    PHOT_KEY_ITEM HotKeyItem, tmp;
 
    LIST_FOR_EACH_SAFE(HotKeyItem, tmp, &gHotkeyList, HOT_KEY_ITEM, ListEntry)
    {
-      if (HotKeyItem->hWnd == Window->hSelf)
+      if (HotKeyItem->hWnd == Window->head.h)
       {
          RemoveEntryList (&HotKeyItem->ListEntry);
          ExFreePool (HotKeyItem);
@@ -164,7 +164,7 @@ NtUserRegisterHotKey(HWND hWnd,
                      UINT vk)
 {
    PHOT_KEY_ITEM HotKeyItem;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    PETHREAD HotKeyThread;
    DECLARE_RETURN(BOOL);
 
@@ -181,7 +181,7 @@ NtUserRegisterHotKey(HWND hWnd,
       {
          RETURN( FALSE);
       }
-      HotKeyThread = Window->pti->pEThread;
+      HotKeyThread = Window->head.pti->pEThread;
    }
 
    /* Check for existing hotkey */
@@ -217,7 +217,7 @@ BOOL APIENTRY
 NtUserUnregisterHotKey(HWND hWnd, int id)
 {
    PHOT_KEY_ITEM HotKeyItem;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    DECLARE_RETURN(BOOL);
 
    DPRINT("Enter NtUserUnregisterHotKey\n");
index c88b08a..316b930 100644 (file)
@@ -453,7 +453,7 @@ IntKeyboardUpdateLeds(HANDLE KeyboardDeviceHandle,
 static VOID APIENTRY
 IntKeyboardSendWinKeyMsg()
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    MSG Mesg;
 
    if (!(Window = UserGetWindowObject(InputWindowStation->ShellWindow)))
@@ -468,7 +468,7 @@ IntKeyboardSendWinKeyMsg()
    Mesg.lParam = 0;
 
    /* The QS_HOTKEY is just a guess */
-   MsqPostMessage(Window->pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
+   MsqPostMessage(Window->head.pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
 }
 
 static VOID APIENTRY
index 65475c4..0661829 100644 (file)
@@ -15,7 +15,7 @@
 #include <debug.h>
 
 PMENU_OBJECT FASTCALL
-IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu);
+IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu);
 
 
 
@@ -253,7 +253,7 @@ IntDestroyMenuObject(PMENU_OBJECT Menu,
 {
    if(Menu)
    {
-      PWINDOW_OBJECT Window;
+      PWND Window;
       PWINSTATION_OBJECT WindowStation;
       NTSTATUS Status;
 
@@ -279,7 +279,7 @@ IntDestroyMenuObject(PMENU_OBJECT Menu,
             Window = UserGetWindowObject(Menu->MenuInfo.Wnd);
             if (Window)
             {
-               Window->Wnd->IDMenu = 0;
+               Window->IDMenu = 0;
             }
          }
 //         UserDereferenceObject(Menu);
@@ -1079,7 +1079,7 @@ IntCheckMenuItem(PMENU_OBJECT MenuObject, UINT uIDCheckItem, UINT uCheck)
 }
 
 BOOL FASTCALL
-IntHiliteMenuItem(PWINDOW_OBJECT WindowObject, PMENU_OBJECT MenuObject,
+IntHiliteMenuItem(PWND WindowObject, PMENU_OBJECT MenuObject,
                   UINT uItemHilite, UINT uHilite)
 {
    PMENU_ITEM MenuItem;
@@ -1207,39 +1207,39 @@ IntGetMenuDefaultItem(PMENU_OBJECT MenuObject, UINT fByPos, UINT gmdiFlags,
 }
 
 VOID FASTCALL
-co_IntInitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup,
+co_IntInitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
                    UINT Flags)
 {
    /* FIXME - hide caret */
 
    if(!(Flags & TPM_NONOTIFY))
-      co_IntSendMessage(Window->hSelf, WM_SETCURSOR, (WPARAM)Window->hSelf, HTCAPTION);
+      co_IntSendMessage(Window->head.h, WM_SETCURSOR, (WPARAM)Window->head.h, HTCAPTION);
 
    /* FIXME - send WM_SETCURSOR message */
 
    if(!(Flags & TPM_NONOTIFY))
-      co_IntSendMessage(Window->hSelf, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0);
+      co_IntSendMessage(Window->head.h, WM_INITMENU, (WPARAM)Menu->MenuInfo.Self, 0);
 }
 
 VOID FASTCALL
-co_IntExitTracking(PWINDOW_OBJECT Window, PMENU_OBJECT Menu, BOOL Popup,
+co_IntExitTracking(PWND Window, PMENU_OBJECT Menu, BOOL Popup,
                    UINT Flags)
 {
    if(!(Flags & TPM_NONOTIFY))
-      co_IntSendMessage(Window->hSelf, WM_EXITMENULOOP, 0 /* FIXME */, 0);
+      co_IntSendMessage(Window->head.h, WM_EXITMENULOOP, 0 /* FIXME */, 0);
 
    /* FIXME - Show caret again */
 }
 
 INT FASTCALL
-IntTrackMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window, INT x, INT y,
+IntTrackMenu(PMENU_OBJECT Menu, PWND Window, INT x, INT y,
              RECTL lprect)
 {
    return 0;
 }
 
 BOOL FASTCALL
-co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWINDOW_OBJECT Window,
+co_IntTrackPopupMenu(PMENU_OBJECT Menu, PWND Window,
                      UINT Flags, POINT *Pos, UINT MenuPos, RECTL *ExcludeRect)
 {
    co_IntInitTracking(Window, Menu, TRUE, Flags);
@@ -1295,7 +1295,7 @@ IntCleanupMenus(struct _EPROCESS *Process, PPROCESSINFO Win32Process)
 }
 
 BOOLEAN APIENTRY
-intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
+intGetTitleBarInfo(PWND pWindowObject, PTITLEBARINFO bti)
 {
 
     DWORD dwStyle = 0;
@@ -1308,13 +1308,13 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
 
         bti->rgstate[0] = STATE_SYSTEM_FOCUSABLE;
 
-        dwStyle = pWindowObject->Wnd->style;
-        dwExStyle = pWindowObject->Wnd->ExStyle;
+        dwStyle = pWindowObject->style;
+        dwExStyle = pWindowObject->ExStyle;
 
         bti->rcTitleBar.top  = 0;
         bti->rcTitleBar.left = 0;
-        bti->rcTitleBar.right  = pWindowObject->Wnd->rcWindow.right - pWindowObject->Wnd->rcWindow.left;
-        bti->rcTitleBar.bottom = pWindowObject->Wnd->rcWindow.bottom - pWindowObject->Wnd->rcWindow.top;
+        bti->rcTitleBar.right  = pWindowObject->rcWindow.right - pWindowObject->rcWindow.left;
+        bti->rcTitleBar.bottom = pWindowObject->rcWindow.bottom - pWindowObject->rcWindow.top;
 
         /* is it iconiced ? */ 
         if ((dwStyle & WS_ICONIC)!=WS_ICONIC)
@@ -1355,9 +1355,9 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
             }
         }
 
-        bti->rcTitleBar.top += pWindowObject->Wnd->rcWindow.top;
-        bti->rcTitleBar.left += pWindowObject->Wnd->rcWindow.left;
-        bti->rcTitleBar.right += pWindowObject->Wnd->rcWindow.left;
+        bti->rcTitleBar.top += pWindowObject->rcWindow.top;
+        bti->rcTitleBar.left += pWindowObject->rcWindow.left;
+        bti->rcTitleBar.right += pWindowObject->rcWindow.left;
 
         bti->rcTitleBar.bottom = bti->rcTitleBar.top;
         if (dwExStyle & WS_EX_TOOLWINDOW)
@@ -1398,7 +1398,7 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
                 {
                     bti->rgstate[4] = STATE_SYSTEM_INVISIBLE;
                 }
-                if (pWindowObject->Wnd->pcls->style & CS_NOCLOSE)
+                if (pWindowObject->pcls->style & CS_NOCLOSE)
                 {
                     bti->rgstate[5] = STATE_SYSTEM_UNAVAILABLE;
                 }
@@ -1425,50 +1425,49 @@ intGetTitleBarInfo(PWINDOW_OBJECT pWindowObject, PTITLEBARINFO bti)
     return retValue;
 }
 
-/* FUNCTIONS *****************************************************************/
-
-
-/*
- * @implemented
- */
-DWORD
-APIENTRY
-NtUserBuildMenuItemList(
-   HMENU hMenu,
-   VOID* Buffer,
-   ULONG nBufSize,
-   DWORD Reserved)
+DWORD FASTCALL
+UserInsertMenuItem(
+   PMENU_OBJECT Menu,
+   UINT uItem,
+   BOOL fByPosition,
+   LPCMENUITEMINFOW UnsafeItemInfo)
 {
-   DWORD res = -1;
-   PMENU_OBJECT Menu;
-   DECLARE_RETURN(DWORD);
-
-   DPRINT("Enter NtUserBuildMenuItemList\n");
-   UserEnterExclusive();
+   NTSTATUS Status;
+   ROSMENUITEMINFO ItemInfo;
 
-   if(!(Menu = UserGetMenuObject(hMenu)))
+   /* Try to copy the whole MENUITEMINFOW structure */
+   Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, sizeof(MENUITEMINFOW));
+   if (NT_SUCCESS(Status))
    {
-      RETURN( (DWORD)-1);
+      if (sizeof(MENUITEMINFOW) != ItemInfo.cbSize
+         && FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
+      {
+         SetLastWin32Error(ERROR_INVALID_PARAMETER);
+         return FALSE;
+      }
+      return IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo);
    }
 
-   if(Buffer)
-   {
-      res = IntBuildMenuItemList(Menu, Buffer, nBufSize);
-   }
-   else
+   /* Try to copy without last field (not present in older versions) */
+   Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, FIELD_OFFSET(MENUITEMINFOW, hbmpItem));
+   if (NT_SUCCESS(Status))
    {
-      res = Menu->MenuInfo.MenuItemCount;
+      if (FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
+      {
+         SetLastWin32Error(ERROR_INVALID_PARAMETER);
+         return FALSE;
+      }
+      ItemInfo.hbmpItem = (HBITMAP)0;
+      return IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo);
    }
 
-   RETURN( res);
-
-CLEANUP:
-   DPRINT("Leave NtUserBuildMenuItemList, ret=%i\n",_ret_);
-   UserLeave();
-   END_CLEANUP;
+   SetLastNtError(Status);
+   return FALSE;
 }
 
 
+/* FUNCTIONS *****************************************************************/
+
 /*
  * @implemented
  */
@@ -1497,7 +1496,6 @@ CLEANUP:
    END_CLEANUP;
 }
 
-
 HMENU FASTCALL UserCreateMenu(BOOL PopupMenu)
 {
    PWINSTATION_OBJECT WinStaObject;
@@ -1537,7 +1535,6 @@ HMENU FASTCALL UserCreateMenu(BOOL PopupMenu)
    return (HMENU)Handle;
 }
 
-
 /*
  * @implemented
  */
@@ -1574,7 +1571,7 @@ NtUserGetTitleBarInfo(
     HWND hwnd,
     PTITLEBARINFO bti)
 {
-    PWINDOW_OBJECT WindowObject;
+    PWND WindowObject;
     TITLEBARINFO bartitleinfo;
     DECLARE_RETURN(BOOLEAN);
     BOOLEAN retValue = TRUE;
@@ -1633,8 +1630,6 @@ CLEANUP:
     END_CLEANUP;
 }
 
-
-
 /*
  * @implemented
  */
@@ -1688,7 +1683,6 @@ CLEANUP:
    END_CLEANUP;
 }
 
-
 /*
  * @implemented
  */
@@ -1717,66 +1711,6 @@ CLEANUP:
    END_CLEANUP;
 }
 
-
-/*
- * @implemented
- */
-DWORD APIENTRY
-UserInsertMenuItem(
-   HMENU hMenu,
-   UINT uItem,
-   BOOL fByPosition,
-   LPCMENUITEMINFOW UnsafeItemInfo)
-{
-   PMENU_OBJECT Menu;
-   NTSTATUS Status;
-   ROSMENUITEMINFO ItemInfo;
-   DECLARE_RETURN(DWORD);
-
-   DPRINT("Enter UserInsertMenuItem\n");
-   UserEnterExclusive();
-
-   if(!(Menu = UserGetMenuObject(hMenu)))
-   {
-      RETURN( FALSE);
-   }
-
-   /* Try to copy the whole MENUITEMINFOW structure */
-   Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, sizeof(MENUITEMINFOW));
-   if (NT_SUCCESS(Status))
-   {
-      if (sizeof(MENUITEMINFOW) != ItemInfo.cbSize
-         && FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
-      {
-         SetLastWin32Error(ERROR_INVALID_PARAMETER);
-         RETURN( FALSE);
-      }
-      RETURN( IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo));
-   }
-
-   /* Try to copy without last field (not present in older versions) */
-   Status = MmCopyFromCaller(&ItemInfo, UnsafeItemInfo, FIELD_OFFSET(MENUITEMINFOW, hbmpItem));
-   if (NT_SUCCESS(Status))
-   {
-      if (FIELD_OFFSET(MENUITEMINFOW, hbmpItem) != ItemInfo.cbSize)
-      {
-         SetLastWin32Error(ERROR_INVALID_PARAMETER);
-         RETURN( FALSE);
-      }
-      ItemInfo.hbmpItem = (HBITMAP)0;
-      RETURN( IntInsertMenuItem(Menu, uItem, fByPosition, &ItemInfo));
-   }
-
-   SetLastNtError(Status);
-   RETURN( FALSE);
-
-CLEANUP:
-   DPRINT("Leave UserInsertMenuItem, ret=%i\n",_ret_);
-   UserLeave();
-   END_CLEANUP;
-}
-
-
 /*
  * @unimplemented
  */
@@ -1788,37 +1722,6 @@ NtUserEndMenu(VOID)
    return 0;
 }
 
-
-/*
- * @implemented
- */
-UINT APIENTRY
-NtUserGetMenuDefaultItem(
-   HMENU hMenu,
-   UINT fByPos,
-   UINT gmdiFlags)
-{
-   PMENU_OBJECT Menu;
-   DWORD gismc = 0;
-   DECLARE_RETURN(UINT);
-
-   DPRINT("Enter NtUserGetMenuDefaultItem\n");
-   UserEnterExclusive();
-
-   if(!(Menu = UserGetMenuObject(hMenu)))
-   {
-      RETURN(-1);
-   }
-
-   RETURN( IntGetMenuDefaultItem(Menu, fByPos, gmdiFlags, &gismc));
-
-CLEANUP:
-   DPRINT("Leave NtUserGetMenuDefaultItem, ret=%i\n",_ret_);
-   UserLeave();
-   END_CLEANUP;
-}
-
-
 /*
  * @implemented
  */
@@ -1832,7 +1735,7 @@ NtUserGetMenuBarInfo(
    BOOL Res = TRUE;
    PMENU_OBJECT MenuObject;
    PMENU_ITEM mi;
-   PWINDOW_OBJECT WindowObject;
+   PWND WindowObject;
    HMENU hMenu;
    POINT Offset;
    RECTL Rect;
@@ -1848,7 +1751,7 @@ NtUserGetMenuBarInfo(
         RETURN(FALSE);
      }
 
-   hMenu = (HMENU)(DWORD_PTR)WindowObject->Wnd->IDMenu;
+   hMenu = (HMENU)(DWORD_PTR)WindowObject->IDMenu;
 
    if (!(MenuObject = UserGetMenuObject(hMenu)))
      {
@@ -1934,7 +1837,7 @@ NtUserGetMenuBarInfo(
            }
          else
            {
-              PWINDOW_OBJECT SubWinObj;
+              PWND SubWinObj;
               if (!(SubWinObj = UserGetWindowObject(SubMenuObject->MenuInfo.Wnd)))
                 {
                    Res = FALSE;
@@ -1984,7 +1887,7 @@ NtUserGetMenuBarInfo(
            }
          else
            {
-              PWINDOW_OBJECT SysWinObj;
+              PWND SysWinObj;
               if (!(SysWinObj = UserGetWindowObject(SysMenuObject->MenuInfo.Wnd)))
                 {
                    Res = FALSE;
@@ -2080,7 +1983,7 @@ NtUserGetMenuItemRect(
    PRECTL lprcItem)
 {
    ROSMENUINFO mi;
-   PWINDOW_OBJECT ReferenceWnd;
+   PWND ReferenceWnd;
    LONG XMove, YMove;
    RECTL Rect;
    NTSTATUS Status;
@@ -2115,13 +2018,13 @@ NtUserGetMenuItemRect(
 
    if(MenuItem->fType & MF_POPUP)
    {
-     XMove = ReferenceWnd->Wnd->rcClient.left;
-     YMove = ReferenceWnd->Wnd->rcClient.top;
+     XMove = ReferenceWnd->rcClient.left;
+     YMove = ReferenceWnd->rcClient.top;
    }
    else
    {
-     XMove = ReferenceWnd->Wnd->rcWindow.left;
-     YMove = ReferenceWnd->Wnd->rcWindow.top;
+     XMove = ReferenceWnd->rcWindow.left;
+     YMove = ReferenceWnd->rcWindow.top;
    }
 
    Rect.left   += XMove;
@@ -2143,7 +2046,6 @@ CLEANUP:
    END_CLEANUP;
 }
 
-
 /*
  * @implemented
  */
@@ -2155,7 +2057,7 @@ NtUserHiliteMenuItem(
    UINT uHilite)
 {
    PMENU_OBJECT Menu;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    DECLARE_RETURN(BOOLEAN);
 
    DPRINT("Enter NtUserHiliteMenuItem\n");
@@ -2171,7 +2073,7 @@ NtUserHiliteMenuItem(
       RETURN(FALSE);
    }
 
-   if(Window->Wnd->IDMenu == (UINT)(UINT_PTR)hMenu)
+   if(Window->IDMenu == (UINT)(UINT_PTR)hMenu)
    {
       RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite));
    }
@@ -2184,7 +2086,6 @@ CLEANUP:
    END_CLEANUP;
 }
 
-
 static
 BOOL FASTCALL
 UserMenuInfo(
@@ -2238,37 +2139,6 @@ UserMenuInfo(
    return( Res);
 }
 
-/*
- * @implemented
- */
-BOOL
-APIENTRY
-NtUserMenuInfo(
-   HMENU hMenu,
-   PROSMENUINFO UnsafeMenuInfo,
-   BOOL SetOrGet)
-{
-   PMENU_OBJECT Menu;
-   DECLARE_RETURN(BOOL);
-
-   DPRINT("Enter NtUserMenuInfo\n");
-   UserEnterShared();
-
-   if (!(Menu = UserGetMenuObject(hMenu)))
-   {
-      RETURN(FALSE);
-   }
-
-   RETURN(UserMenuInfo(Menu, UnsafeMenuInfo, SetOrGet));
-
-CLEANUP:
-   DPRINT("Leave NtUserMenuInfo, ret=%i\n",_ret_);
-   UserLeave();
-   END_CLEANUP;
-}
-
-
-
 /*
  * @implemented
  */
@@ -2280,7 +2150,7 @@ NtUserMenuItemFromPoint(
    DWORD Y)
 {
    PMENU_OBJECT Menu;
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    PMENU_ITEM mi;
    int i;
    DECLARE_RETURN(int);
@@ -2298,8 +2168,8 @@ NtUserMenuItemFromPoint(
       RETURN( -1);
    }
 
-   X -= Window->Wnd->rcWindow.left;
-   Y -= Window->Wnd->rcWindow.top;
+   X -= Window->rcWindow.left;
+   Y -= Window->rcWindow.top;
 
    mi = Menu->MenuItemList;
    for (i = 0; NULL != mi; i++)
@@ -2319,8 +2189,6 @@ CLEANUP:
    END_CLEANUP;
 }
 
-
-
 static
 BOOL FASTCALL
 UserMenuItemInfo(
@@ -2393,41 +2261,6 @@ UserMenuItemInfo(
    return( Ret);
 }
 
-
-
-/*
- * @implemented
- */
-BOOL
-APIENTRY
-NtUserMenuItemInfo(
-   HMENU hMenu,
-   UINT Item,
-   BOOL ByPosition,
-   PROSMENUITEMINFO UnsafeItemInfo,
-   BOOL SetOrGet)
-{
-   PMENU_OBJECT Menu;
-   DECLARE_RETURN(BOOL);
-
-   DPRINT("Enter NtUserMenuItemInfo\n");
-   UserEnterExclusive();
-
-   if (!(Menu = UserGetMenuObject(hMenu)))
-   {
-      RETURN(FALSE);
-   }
-
-   RETURN( UserMenuItemInfo(Menu, Item, ByPosition, UnsafeItemInfo, SetOrGet));
-
-CLEANUP:
-   DPRINT("Leave NtUserMenuItemInfo, ret=%i\n",_ret_);
-   UserLeave();
-   END_CLEANUP;
-
-}
-
-
 /*
  * @implemented
  */
@@ -2457,7 +2290,6 @@ CLEANUP:
 
 }
 
-
 /*
  * @implemented
  */
@@ -2485,8 +2317,6 @@ CLEANUP:
    END_CLEANUP;
 }
 
-
-
 /*
  * @implemented
  */
@@ -2515,7 +2345,6 @@ CLEANUP:
    END_CLEANUP;
 }
 
-
 /*
  * @implemented
  */
@@ -2542,25 +2371,37 @@ CLEANUP:
    END_CLEANUP;
 }
 
-
 /*
- * @unimplemented
+ * @implemented
  */
-DWORD APIENTRY
+BOOL APIENTRY
 NtUserThunkedMenuInfo(
    HMENU hMenu,
    LPCMENUINFO lpcmi)
 {
-   UNIMPLEMENTED
-   /* This function seems just to call SetMenuInfo() */
-   return 0;
-}
+   PMENU_OBJECT Menu;
+   DECLARE_RETURN(BOOL);
 
+   DPRINT("Enter NtUserThunkedMenuInfo\n");
+   UserEnterExclusive();
+
+   if (!(Menu = UserGetMenuObject(hMenu)))
+   {
+      RETURN(FALSE);
+   }
+
+   RETURN(UserMenuInfo(Menu, (PROSMENUINFO)lpcmi, TRUE));
+
+CLEANUP:
+   DPRINT("Leave NtUserThunkedMenuInfo, ret=%i\n",_ret_);
+   UserLeave();
+   END_CLEANUP;
+}
 
 /*
- * @unimplemented
+ * @implemented
  */
-DWORD APIENTRY
+BOOL APIENTRY
 NtUserThunkedMenuItemInfo(
    HMENU hMenu,
    UINT uItem,
@@ -2569,16 +2410,48 @@ NtUserThunkedMenuItemInfo(
    LPMENUITEMINFOW lpmii,
    PUNICODE_STRING lpszCaption)
 {
+   PMENU_OBJECT Menu;
+   NTSTATUS Status;
+   UNICODE_STRING lstrCaption;
+   DECLARE_RETURN(BOOL);
+
+   DPRINT("Enter NtUserThunkedMenuItemInfo\n");
+   UserEnterExclusive();
 
    /* lpszCaption may be NULL, check for it and call RtlInitUnicodeString()
-      if bInsert == TRUE call NtUserInsertMenuItem() else NtUserSetMenuItemInfo()   */
+      if bInsert == TRUE call UserInsertMenuItem() else UserSetMenuItemInfo()   */
 
-   if (bInsert) return UserInsertMenuItem(hMenu, uItem, fByPosition, lpmii);
+   if (!(Menu = UserGetMenuObject(hMenu)))
+   {
+      RETURN(FALSE);
+   }
 
-   UNIMPLEMENTED
-   return 0;
-}
+   lstrCaption.Buffer = NULL;
+
+   /* Check if we got a Caption */
+   if (lpszCaption)
+   {
+      /* Copy the string to kernel mode */
+      Status = ProbeAndCaptureUnicodeString( &lstrCaption,
+                                                 UserMode,
+                                              lpszCaption);
+      if (!NT_SUCCESS(Status))
+      {
+         DPRINT1("Failed to capture MenuItem Caption (status 0x%08x)\n",Status);
+         SetLastNtError(Status);
+         RETURN(FALSE);
+      }       
+   }
+
+   if (bInsert) RETURN( UserInsertMenuItem(Menu, uItem, fByPosition, lpmii));
 
+   RETURN( UserMenuItemInfo(Menu, uItem, fByPosition, (PROSMENUITEMINFO)lpmii, TRUE));
+
+CLEANUP:
+   DPRINT("Leave NtUserThunkedMenuItemInfo, ret=%i\n",_ret_);
+   UserLeave();
+   END_CLEANUP;
+}
 
 /*
  * @implemented
@@ -2599,4 +2472,135 @@ NtUserTrackPopupMenuEx(
 }
 
 
+////// ReactOS NtUserBad
+/*
+ * @implemented
+ */
+DWORD
+APIENTRY
+NtUserBuildMenuItemList(
+   HMENU hMenu,
+   VOID* Buffer,
+   ULONG nBufSize,
+   DWORD Reserved)
+{
+   DWORD res = -1;
+   PMENU_OBJECT Menu;
+   DECLARE_RETURN(DWORD);
+
+   DPRINT("Enter NtUserBuildMenuItemList\n");
+   UserEnterExclusive();
+
+   if(!(Menu = UserGetMenuObject(hMenu)))
+   {
+      RETURN( (DWORD)-1);
+   }
+
+   if(Buffer)
+   {
+      res = IntBuildMenuItemList(Menu, Buffer, nBufSize);
+   }
+   else
+   {
+      res = Menu->MenuInfo.MenuItemCount;
+   }
+
+   RETURN( res);
+
+CLEANUP:
+   DPRINT("Leave NtUserBuildMenuItemList, ret=%i\n",_ret_);
+   UserLeave();
+   END_CLEANUP;
+}
+
+/*
+ * @implemented
+ */
+UINT APIENTRY
+NtUserGetMenuDefaultItem(
+   HMENU hMenu,
+   UINT fByPos,
+   UINT gmdiFlags)
+{
+   PMENU_OBJECT Menu;
+   DWORD gismc = 0;
+   DECLARE_RETURN(UINT);
+
+   DPRINT("Enter NtUserGetMenuDefaultItem\n");
+   UserEnterExclusive();
+
+   if(!(Menu = UserGetMenuObject(hMenu)))
+   {
+      RETURN(-1);
+   }
+
+   RETURN( IntGetMenuDefaultItem(Menu, fByPos, gmdiFlags, &gismc));
+
+CLEANUP:
+   DPRINT("Leave NtUserGetMenuDefaultItem, ret=%i\n",_ret_);
+   UserLeave();
+   END_CLEANUP;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+APIENTRY
+NtUserMenuInfo(
+   HMENU hMenu,
+   PROSMENUINFO UnsafeMenuInfo,
+   BOOL SetOrGet)
+{
+   PMENU_OBJECT Menu;
+   DECLARE_RETURN(BOOL);
+
+   DPRINT("Enter NtUserMenuInfo\n");
+   UserEnterShared();
+
+   if (!(Menu = UserGetMenuObject(hMenu)))
+   {
+      RETURN(FALSE);
+   }
+
+   RETURN(UserMenuInfo(Menu, UnsafeMenuInfo, SetOrGet));
+
+CLEANUP:
+   DPRINT("Leave NtUserMenuInfo, ret=%i\n",_ret_);
+   UserLeave();
+   END_CLEANUP;
+}
+
+/*
+ * @implemented
+ */
+BOOL
+APIENTRY
+NtUserMenuItemInfo(
+   HMENU hMenu,
+   UINT Item,
+   BOOL ByPosition,
+   PROSMENUITEMINFO UnsafeItemInfo,
+   BOOL SetOrGet)
+{
+   PMENU_OBJECT Menu;
+   DECLARE_RETURN(BOOL);
+
+   DPRINT("Enter NtUserMenuItemInfo\n");
+   UserEnterExclusive();
+
+   if (!(Menu = UserGetMenuObject(hMenu)))
+   {
+      RETURN(FALSE);
+   }
+
+   RETURN( UserMenuItemInfo(Menu, Item, ByPosition, UnsafeItemInfo, SetOrGet));
+
+CLEANUP:
+   DPRINT("Leave NtUserMenuItemInfo, ret=%i\n",_ret_);
+   UserLeave();
+   END_CLEANUP;
+
+}
+
 /* EOF */
index efa88eb..78378b2 100644 (file)
@@ -327,14 +327,14 @@ static
 VOID
 FASTCALL
 IntCallWndProc
-( PWINDOW_OBJECT Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
+( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
    BOOL SameThread = FALSE;
 
-   if (Window->pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
+   if (Window->head.pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
       SameThread = TRUE;
 
-   if ((!SameThread && (Window->pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROC))) ||
+   if ((!SameThread && (Window->head.pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROC))) ||
         (SameThread && ISITHOOKED(WH_CALLWNDPROC)) )
    {
       CWPSTRUCT CWP;
@@ -350,14 +350,14 @@ static
 VOID
 FASTCALL
 IntCallWndProcRet
-( PWINDOW_OBJECT Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *uResult)
+( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *uResult)
 {
    BOOL SameThread = FALSE;
 
-   if (Window->pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
+   if (Window->head.pti == ((PTHREADINFO)PsGetCurrentThreadWin32Thread()))
       SameThread = TRUE;
 
-   if ((!SameThread && (Window->pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROCRET))) ||
+   if ((!SameThread && (Window->head.pti->fsHooks & HOOKID_TO_FLAG(WH_CALLWNDPROCRET))) ||
         (SameThread && ISITHOOKED(WH_CALLWNDPROCRET)) )
    {
       CWPRETSTRUCT CWPR;
@@ -380,12 +380,12 @@ IntDispatchMessage(PMSG pMsg)
   PMSGMEMORY MsgMemoryEntry;
   INT lParamBufferSize;
   LPARAM lParamPacked;
-  PWINDOW_OBJECT Window = NULL;
+  PWND Window = NULL;
 
   if (pMsg->hwnd)
   {
      Window = UserGetWindowObject(pMsg->hwnd);
-     if (!Window || !Window->Wnd) return 0;
+     if (!Window) return 0;
   }
 
   if (((pMsg->message == WM_SYSTIMER) ||
@@ -421,7 +421,7 @@ IntDispatchMessage(PMSG pMsg)
      }
   }
   // Need a window!
-  if ( !Window || !Window->Wnd ) return 0;
+  if ( !Window ) return 0;
 
   /* See if this message type is present in the table */
   MsgMemoryEntry = FindMsgMemory(pMsg->message);
@@ -440,8 +440,8 @@ IntDispatchMessage(PMSG pMsg)
      return 0;
   }
 
-  retval = co_IntCallWindowProc( Window->Wnd->lpfnWndProc,
-                                !Window->Wnd->Unicode,
+  retval = co_IntCallWindowProc( Window->lpfnWndProc,
+                                !Window->Unicode,
                                  pMsg->hwnd,
                                  pMsg->message,
                                  pMsg->wParam,
@@ -522,11 +522,11 @@ BOOL FASTCALL
 co_IntActivateWindowMouse(
    PUSER_MESSAGE_QUEUE ThreadQueue,
    LPMSG Msg,
-   PWINDOW_OBJECT MsgWindow,
+   PWND MsgWindow,
    USHORT *HitTest)
 {
    ULONG Result;
-   PWINDOW_OBJECT Parent;
+   PWND Parent;
 
    ASSERT_REFS_CO(MsgWindow);
 
@@ -539,9 +539,9 @@ co_IntActivateWindowMouse(
    Parent = IntGetParent(MsgWindow);//fixme: deref retval?
 
    /* If no parent window, pass MsgWindows HWND as wParam. Fixes bug #3111 */
-   Result = co_IntSendMessage(MsgWindow->hSelf,
+   Result = co_IntSendMessage(MsgWindow->head.h,
                               WM_MOUSEACTIVATE,
-                              (WPARAM) (Parent ? Parent->hSelf : MsgWindow->hSelf),
+                              (WPARAM) (Parent ? Parent->head.h : MsgWindow->head.h),
                               (LPARAM)MAKELONG(*HitTest, Msg->message)
                              );
 
@@ -570,7 +570,7 @@ co_IntTranslateMouseMessage(
    USHORT *HitTest,
    BOOL Remove)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    USER_REFERENCE_ENTRY Ref, DesktopRef;
 
    if(!(Window = UserGetWindowObject(Msg->hwnd)))
@@ -583,38 +583,38 @@ co_IntTranslateMouseMessage(
 
    UserRefObjectCo(Window, &Ref);
 
-   if ( ThreadQueue == Window->pti->MessageQueue &&
-        ThreadQueue->CaptureWindow != Window->hSelf)
+   if ( ThreadQueue == Window->head.pti->MessageQueue &&
+        ThreadQueue->CaptureWindow != Window->head.h)
    {
       /* only send WM_NCHITTEST messages if we're not capturing the window! */
       if (Remove ) 
       {
-         *HitTest = co_IntSendMessage(Window->hSelf, WM_NCHITTEST, 0,
+         *HitTest = co_IntSendMessage(Window->head.h, WM_NCHITTEST, 0,
                                       MAKELONG(Msg->pt.x, Msg->pt.y));
       } 
       /* else we are going to see this message again, but then with Remove == TRUE */
 
       if (*HitTest == (USHORT)HTTRANSPARENT)
       {
-         PWINDOW_OBJECT DesktopWindow;
+         PWND DesktopWindow;
          HWND hDesktop = IntGetDesktopWindow();
 
          if ((DesktopWindow = UserGetWindowObject(hDesktop)))
          {
-            PWINDOW_OBJECT Wnd;
+            PWND Wnd;
 
             UserRefObjectCo(DesktopWindow, &DesktopRef);
 
-            co_WinPosWindowFromPoint(DesktopWindow, Window->pti->MessageQueue, &Msg->pt, &Wnd);
+            co_WinPosWindowFromPoint(DesktopWindow, Window->head.pti->MessageQueue, &Msg->pt, &Wnd);
             if (Wnd)
             {
                if (Wnd != Window)
                {
                   /* post the message to the other window */
-                  Msg->hwnd = Wnd->hSelf;
-                  if(!(Wnd->state & WINDOWSTATUS_DESTROYING))
+                  Msg->hwnd = Wnd->head.h;
+                  if(!(Wnd->state & WNDS_DESTROYED))
                   {
-                     MsqPostMessage(Wnd->pti->MessageQueue, Msg, FALSE,
+                     MsqPostMessage(Wnd->head.pti->MessageQueue, Msg, FALSE,
                                     Msg->message == WM_MOUSEMOVE ? QS_MOUSEMOVE :
                                     QS_MOUSEBUTTON);
                   }
@@ -648,7 +648,7 @@ co_IntTranslateMouseMessage(
    {
       /* generate double click messages, if necessary */
       if ((((*HitTest) != HTCLIENT) ||
-            (Window->Wnd->pcls->style & CS_DBLCLKS)) &&
+            (Window->pcls->style & CS_DBLCLKS)) &&
             MsqIsDblClk(Msg, Remove))
       {
          Msg->message += WM_LBUTTONDBLCLK - WM_LBUTTONDOWN;
@@ -665,7 +665,7 @@ co_IntTranslateMouseMessage(
               (((*HitTest) == HTCAPTION) || ((*HitTest) == HTSYSMENU)) )
          {
             Msg->message = WM_CONTEXTMENU;
-            Msg->wParam = (WPARAM)Window->hSelf;
+            Msg->wParam = (WPARAM)Window->head.h;
          }
          else
          {
@@ -678,8 +678,8 @@ co_IntTranslateMouseMessage(
       {
          /* NOTE: Msg->pt should remain in screen coordinates. -- FiN */
          Msg->lParam = MAKELONG(
-                          Msg->pt.x - (WORD)Window->Wnd->rcClient.left,
-                          Msg->pt.y - (WORD)Window->Wnd->rcClient.top);
+                          Msg->pt.x - (WORD)Window->rcClient.left,
+                          Msg->pt.y - (WORD)Window->rcClient.top);
       }
    }
 
@@ -760,7 +760,7 @@ BOOL ProcessKeyboardMessage(MSG* Msg, UINT RemoveMsg)
  */
 BOOL FASTCALL
 co_IntPeekMessage( PUSER_MESSAGE Msg,
-                   PWINDOW_OBJECT Window,
+                   PWND Window,
                    UINT MsgFilterMin,
                    UINT MsgFilterMax,
                    UINT RemoveMsg )
@@ -893,7 +893,7 @@ MessageFound:
 
       if(RemoveMessages)
       {
-         PWINDOW_OBJECT MsgWindow = NULL;
+         PWND MsgWindow = NULL;
 
          /* Mouse message process */
 
@@ -1088,7 +1088,7 @@ CopyMsgToUserMem(MSG *UserModeMsg, MSG *KernelModeMsg)
 }
 
 static BOOL FASTCALL
-co_IntWaitMessage( PWINDOW_OBJECT Window,
+co_IntWaitMessage( PWND Window,
                    UINT MsgFilterMin,
                    UINT MsgFilterMax )
 {
@@ -1137,7 +1137,7 @@ co_IntGetPeekMessage( PMSG pMsg,
                       BOOL bGMSG )
 {
    BOOL Present;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    USER_MESSAGE Msg;
 
    if ( hWnd == HWND_TOPMOST ||
@@ -1157,7 +1157,7 @@ co_IntGetPeekMessage( PMSG pMsg,
    }
    else
    {
-      Window = (PWINDOW_OBJECT)hWnd;
+      Window = (PWND)hWnd;
    }
 
    if (MsgFilterMax < MsgFilterMin)
@@ -1281,7 +1281,7 @@ UserPostMessage( HWND Wnd,
    if (Wnd == HWND_BROADCAST)
    {
       HWND *List;
-      PWINDOW_OBJECT DesktopWindow;
+      PWND DesktopWindow;
       ULONG i;
 
       DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
@@ -1296,22 +1296,22 @@ UserPostMessage( HWND Wnd,
    }
    else
    {
-      PWINDOW_OBJECT Window;
+      PWND Window;
 
       Window = UserGetWindowObject(Wnd);
-      if ( !Window || !Window->Wnd )
+      if ( !Window )
       {
          return FALSE;
       }
 
-      pti = Window->Wnd->head.pti;
+      pti = Window->head.pti;
       if ( pti->TIF_flags & TIF_INCLEANUP )
       {
          DPRINT1("Attempted to post message to window 0x%x when the thread is in cleanup!\n", Wnd);
          return FALSE;
       }
 
-      if ( Window->state & WINDOWSTATUS_DESTROYING )
+      if ( Window->state & WNDS_DESTROYED )
       {
          DPRINT1("Attempted to post message to window 0x%x that is being destroyed!\n", Wnd);
          /* FIXME - last error code? */
@@ -1320,7 +1320,7 @@ UserPostMessage( HWND Wnd,
 
       if (WM_QUIT == Msg)
       {
-          MsqPostQuitMessage(Window->pti->MessageQueue, wParam);
+          MsqPostQuitMessage(Window->head.pti->MessageQueue, wParam);
       }
       else
       {
@@ -1331,7 +1331,7 @@ UserPostMessage( HWND Wnd,
          Message.pt = gpsi->ptCursor;
          KeQueryTickCount(&LargeTickCount);
          pti->timeLast = Message.time = MsqCalculateMessageTime(&LargeTickCount);
-         MsqPostMessage(Window->pti->MessageQueue, &Message, FALSE, QS_POSTMESSAGE);
+         MsqPostMessage(Window->head.pti->MessageQueue, &Message, FALSE, QS_POSTMESSAGE);
       }
    }
    return TRUE;
@@ -1364,7 +1364,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
 {
    ULONG_PTR Result;
    NTSTATUS Status;
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    PMSGMEMORY MsgMemoryEntry;
    INT lParamBufferSize;
    LPARAM lParamPacked;
@@ -1384,7 +1384,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
    IntCallWndProc( Window, hWnd, Msg, wParam, lParam);
 
    if ( NULL != Win32Thread &&
-        Window->pti->MessageQueue == Win32Thread->MessageQueue)
+        Window->head.pti->MessageQueue == Win32Thread->MessageQueue)
    {
       if (Win32Thread->TIF_flags & TIF_INCLEANUP)
       {
@@ -1409,8 +1409,8 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
           RETURN( FALSE);
       }
 
-      Result = (ULONG_PTR)co_IntCallWindowProc( Window->Wnd->lpfnWndProc,
-                                               !Window->Wnd->Unicode,
+      Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc,
+                                               !Window->Unicode,
                                                 hWnd,
                                                 Msg,
                                                 wParam,
@@ -1432,13 +1432,13 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
       RETURN( TRUE);
    }
 
-   if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->pti->MessageQueue))
+   if (uFlags & SMTO_ABORTIFHUNG && MsqIsHung(Window->head.pti->MessageQueue))
    {
       /* FIXME - Set a LastError? */
       RETURN( FALSE);
    }
 
-   if (Window->state & WINDOWSTATUS_DESTROYING)
+   if (Window->state & WNDS_DESTROYED)
    {
       /* FIXME - last error? */
       DPRINT1("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
@@ -1447,7 +1447,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
 
    do
    {
-      Status = co_MsqSendMessage( Window->pti->MessageQueue,
+      Status = co_MsqSendMessage( Window->head.pti->MessageQueue,
                                                        hWnd,
                                                         Msg,
                                                      wParam,
@@ -1459,7 +1459,7 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
    }
    while ((STATUS_TIMEOUT == Status) &&
           (uFlags & SMTO_NOTIMEOUTIFNOTHUNG) &&
-          !MsqIsHung(Window->pti->MessageQueue));
+          !MsqIsHung(Window->head.pti->MessageQueue));
 
    IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
 
@@ -1498,7 +1498,7 @@ co_IntSendMessageTimeout( HWND hWnd,
                           UINT uTimeout,
                           ULONG_PTR *uResult )
 {
-   PWINDOW_OBJECT DesktopWindow;
+   PWND DesktopWindow;
    HWND *Children;
    HWND *Child;
 
@@ -1556,7 +1556,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
                                ULONG_PTR *uResult)
 {
    ULONG_PTR Result;
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    PMSGMEMORY MsgMemoryEntry;
    INT lParamBufferSize;
    LPARAM lParamPacked;
@@ -1572,7 +1572,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
 
    UserRefObjectCo(Window, &Ref);
 
-   if (Window->state & WINDOWSTATUS_DESTROYING)
+   if (Window->state & WNDS_DESTROYED)
    {
       /* FIXME - last error? */
       DPRINT1("Attempted to send message to window 0x%x that is being destroyed!\n", hWnd);
@@ -1606,18 +1606,18 @@ co_IntSendMessageWithCallBack( HWND hWnd,
       lParamBufferSize = MsgMemorySize(MsgMemoryEntry, wParam, lParam);
    }
 
-   if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, Window->pti->MessageQueue != Win32Thread->MessageQueue)))
+   if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, Window->head.pti->MessageQueue != Win32Thread->MessageQueue)))
    {
        DPRINT1("Failed to pack message parameters\n");
        RETURN( FALSE);
    }
 
    /* If this is not a callback and it can be sent now, then send it. */
-   if ((Window->pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
+   if ((Window->head.pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
    {
 
-      Result = (ULONG_PTR)co_IntCallWindowProc( Window->Wnd->lpfnWndProc,
-                                               !Window->Wnd->Unicode,
+      Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc,
+                                               !Window->Unicode,
                                                 hWnd,
                                                 Msg,
                                                 wParam,
@@ -1631,7 +1631,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
 
    IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT *)uResult);
 
-   if ((Window->pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
+   if ((Window->head.pti->MessageQueue == Win32Thread->MessageQueue) && (CompletionCallback == NULL))
    {
       if (! NT_SUCCESS(UnpackParam(lParamPacked, Msg, wParam, lParam, FALSE)))
       {
@@ -1654,14 +1654,14 @@ co_IntSendMessageWithCallBack( HWND hWnd,
    Message->Result = 0;
    Message->SenderQueue = NULL; //Win32Thread->MessageQueue;
 
-   IntReferenceMessageQueue(Window->pti->MessageQueue);
+   IntReferenceMessageQueue(Window->head.pti->MessageQueue);
    Message->CompletionCallback = CompletionCallback;
    Message->CompletionCallbackContext = CompletionCallbackContext;
    Message->HookMessage = MSQ_NORMAL | MSQ_SENTNOWAIT;
    Message->HasPackedLParam = (lParamBufferSize > 0);
 
-   InsertTailList(&Window->pti->MessageQueue->SentMessagesListHead, &Message->ListEntry);
-   IntDereferenceMessageQueue(Window->pti->MessageQueue);
+   InsertTailList(&Window->head.pti->MessageQueue->SentMessagesListHead, &Message->ListEntry);
+   IntDereferenceMessageQueue(Window->head.pti->MessageQueue);
 
    RETURN(TRUE);
 
@@ -1681,7 +1681,7 @@ co_IntPostOrSendMessage( HWND hWnd,
 {
    ULONG_PTR Result;
    PTHREADINFO pti;
-   PWINDOW_OBJECT Window;
+   PWND Window;
 
    if ( hWnd == HWND_BROADCAST )
    {
@@ -1695,7 +1695,7 @@ co_IntPostOrSendMessage( HWND hWnd,
 
    pti = PsGetCurrentThreadWin32Thread();
 
-   if ( Window->pti->MessageQueue != pti->MessageQueue &&
+   if ( Window->head.pti->MessageQueue != pti->MessageQueue &&
         FindMsgMemory(Msg) == 0 )
    {
       Result = UserPostMessage(hWnd, Msg, wParam, lParam);
@@ -1722,7 +1722,7 @@ co_IntDoSendMessage( HWND hWnd,
    PTHREADINFO pti;
    LRESULT Result = TRUE;
    NTSTATUS Status;
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    NTUSERSENDMESSAGEINFO Info;
    MSG UserModeMsg;
    MSG KernelModeMsg;
@@ -1734,7 +1734,7 @@ co_IntDoSendMessage( HWND hWnd,
    if (HWND_BROADCAST != hWnd)
    {
       Window = UserGetWindowObject(hWnd);
-      if ( !Window || !Window->Wnd )
+      if ( !Window )
       {
          /* Tell usermode to not touch this one */
          Info.HandledByKernel = TRUE;
@@ -1744,7 +1744,7 @@ co_IntDoSendMessage( HWND hWnd,
    }
 
    /* Check for an exiting window. */
-   if (Window && Window->state & WINDOWSTATUS_DESTROYING)
+   if (Window && Window->state & WNDS_DESTROYED)
    {
       DPRINT1("co_IntDoSendMessage Window Exiting!\n");
    }
@@ -1755,7 +1755,7 @@ co_IntDoSendMessage( HWND hWnd,
    // This is checked in user mode!!!!!!!
    if ( HWND_BROADCAST != hWnd &&
         NULL != pti &&
-        Window->pti->MessageQueue == pti->MessageQueue &&
+        Window->head.pti->MessageQueue == pti->MessageQueue &&
        !ISITHOOKED(WH_CALLWNDPROC) &&
        !ISITHOOKED(WH_CALLWNDPROCRET) &&
         ( Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST ) )
@@ -1767,11 +1767,11 @@ co_IntDoSendMessage( HWND hWnd,
                                 sizeof(BOOL));
       if (! NT_SUCCESS(Status))
       {
-         Info.Ansi = ! Window->Wnd->Unicode;
+         Info.Ansi = ! Window->Unicode;
       }
 
-      Info.Ansi = !Window->Wnd->Unicode;
-      Info.Proc = Window->Wnd->lpfnWndProc;
+      Info.Ansi = !Window->Unicode;
+      Info.Proc = Window->lpfnWndProc;
    }
    else
    {
@@ -1850,7 +1850,7 @@ UserSendNotifyMessage( HWND hWnd,
    if (hWnd == HWND_BROADCAST) //Handle Broadcast
    {
       HWND *List;
-      PWINDOW_OBJECT DesktopWindow;
+      PWND DesktopWindow;
       ULONG i;
 
       DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
@@ -1869,13 +1869,13 @@ UserSendNotifyMessage( HWND hWnd,
    {
      ULONG_PTR PResult;
      PTHREADINFO pti;
-     PWINDOW_OBJECT Window;
+     PWND Window;
 
       if ( !(Window = UserGetWindowObject(hWnd)) ) return FALSE;
 
       pti = PsGetCurrentThreadWin32Thread();
 
-      if (Window->pti->MessageQueue != pti->MessageQueue)
+      if (Window->head.pti->MessageQueue != pti->MessageQueue)
       { // Send message w/o waiting for it.
          Result = UserPostMessage(hWnd, Msg, wParam, lParam);
       }
@@ -2096,7 +2096,7 @@ NtUserGetMessage( PNTUSERGETMESSAGEINFO UnsafeInfo,
    NTUSERGETMESSAGEINFO Info;
    NTSTATUS Status;
    /* FIXME: if initialization is removed, gcc complains that this may be used before initialization. Please review */
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    PMSGMEMORY MsgMemoryEntry;
    PVOID UserMem;
    UINT Size;
@@ -2247,7 +2247,7 @@ NtUserPeekMessage(PNTUSERGETMESSAGEINFO UnsafeInfo,
    NTSTATUS Status;
    BOOL Present;
    NTUSERGETMESSAGEINFO Info;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    PMSGMEMORY MsgMemoryEntry;
    PVOID UserMem;
    UINT Size;
@@ -2270,7 +2270,7 @@ NtUserPeekMessage(PNTUSERGETMESSAGEINFO UnsafeInfo,
    }
    else
    {
-      Window = (PWINDOW_OBJECT)hWnd;
+      Window = (PWND)hWnd;
    }
 
    if (MsgFilterMax < MsgFilterMin)
@@ -2521,7 +2521,7 @@ NtUserMessageCall(
    LRESULT lResult = 0;
    BOOL Ret = FALSE;
    BOOL BadChk = FALSE;
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    USER_REFERENCE_ENTRY Ref;
 
    UserEnterExclusive();
index dd20d9d..2f587bf 100644 (file)
@@ -885,7 +885,7 @@ NtUserMonitorFromWindow(
    IN HWND hWnd,
    IN DWORD dwFlags)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    HMONITOR hMonitor = NULL;
    RECTL Rect;
    DECLARE_RETURN(HMONITOR);
@@ -903,11 +903,8 @@ NtUserMonitorFromWindow(
       RETURN(hMonitor);
    }
 
-   if (!Window->Wnd)
-      RETURN(hMonitor);
-
-   Rect.left = Rect.right = Window->Wnd->rcWindow.left;
-   Rect.top = Rect.bottom = Window->Wnd->rcWindow.bottom;
+   Rect.left = Rect.right = Window->rcWindow.left;
+   Rect.top = Rect.bottom = Window->rcWindow.bottom;
 
    IntGetMonitorsFromRect(&Rect, &hMonitor, NULL, 1, dwFlags);
 
index b7cba1d..b54a331 100644 (file)
@@ -69,16 +69,16 @@ static VOID FASTCALL
 IdlePing(VOID)
 {
   HWND hWnd;
-  PWINDOW_OBJECT Window;
+  PWND Window;
   PPROCESSINFO W32d = PsGetCurrentProcessWin32Process();
 
   hWnd = UserGetForegroundWindow();
 
   Window = UserGetWindowObject(hWnd);
 
-  if (Window && Window->pti)
+  if (Window && Window->head.pti)
   {
-     if (Window->pti->fsHooks & HOOKID_TO_FLAG(WH_FOREGROUNDIDLE))
+     if (Window->head.pti->fsHooks & HOOKID_TO_FLAG(WH_FOREGROUNDIDLE))
      {
         co_HOOK_CallHooks(WH_FOREGROUNDIDLE,HC_ACTION,0,0);
      }
@@ -342,12 +342,12 @@ MsqIsDblClk(LPMSG Msg, BOOL Remove)
 }
 
 static BOOL APIENTRY
-co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Window, UINT FilterLow, UINT FilterHigh,
+co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWND Window, UINT FilterLow, UINT FilterHigh,
                             PUSER_MESSAGE Message, BOOL Remove, PBOOL Freed,
-                            PWINDOW_OBJECT ScopeWin, PPOINT ScreenPoint, BOOL FromGlobalQueue, PLIST_ENTRY *Next)
+                            PWND ScopeWin, PPOINT ScreenPoint, BOOL FromGlobalQueue, PLIST_ENTRY *Next)
 {
    USHORT Msg = Message->Msg.message;
-   PWINDOW_OBJECT CaptureWindow = NULL;
+   PWND CaptureWindow = NULL;
    HWND hCaptureWin;
 
    /* FIXME: Mouse message can be sent before the Desktop is up and running in which case ScopeWin (Desktop) is 0.
@@ -411,7 +411,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
       return(FALSE);
    }
 
-   if (CaptureWindow->pti->MessageQueue != MessageQueue)
+   if (CaptureWindow->head.pti->MessageQueue != MessageQueue)
    {
       if (! FromGlobalQueue)
       {
@@ -434,34 +434,34 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
 
       /* lock the destination message queue, so we don't get in trouble with other
          threads, messing with it at the same time */
-      IntLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
-      InsertTailList(&CaptureWindow->pti->MessageQueue->HardwareMessagesListHead,
+      IntLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
+      InsertTailList(&CaptureWindow->head.pti->MessageQueue->HardwareMessagesListHead,
                      &Message->ListEntry);
       if(Message->Msg.message == WM_MOUSEMOVE)
       {
-         if(CaptureWindow->pti->MessageQueue->MouseMoveMsg)
+         if(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg)
          {
             /* remove the old WM_MOUSEMOVE message, we're processing a more recent
                one */
-            RemoveEntryList(&CaptureWindow->pti->MessageQueue->MouseMoveMsg->ListEntry);
-            ExFreePool(CaptureWindow->pti->MessageQueue->MouseMoveMsg);
+            RemoveEntryList(&CaptureWindow->head.pti->MessageQueue->MouseMoveMsg->ListEntry);
+            ExFreePool(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg);
          }
          /* save the pointer to the WM_MOUSEMOVE message in the new queue */
-         CaptureWindow->pti->MessageQueue->MouseMoveMsg = Message;
+         CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = Message;
 
-         CaptureWindow->pti->MessageQueue->QueueBits |= QS_MOUSEMOVE;
-         CaptureWindow->pti->MessageQueue->ChangedBits |= QS_MOUSEMOVE;
-         if (CaptureWindow->pti->MessageQueue->WakeMask & QS_MOUSEMOVE)
-            KeSetEvent(CaptureWindow->pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
+         CaptureWindow->head.pti->MessageQueue->QueueBits |= QS_MOUSEMOVE;
+         CaptureWindow->head.pti->MessageQueue->ChangedBits |= QS_MOUSEMOVE;
+         if (CaptureWindow->head.pti->MessageQueue->WakeMask & QS_MOUSEMOVE)
+            KeSetEvent(CaptureWindow->head.pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
       }
       else
       {
-         CaptureWindow->pti->MessageQueue->QueueBits |= QS_MOUSEBUTTON;
-         CaptureWindow->pti->MessageQueue->ChangedBits |= QS_MOUSEBUTTON;
-         if (CaptureWindow->pti->MessageQueue->WakeMask & QS_MOUSEBUTTON)
-            KeSetEvent(CaptureWindow->pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
+         CaptureWindow->head.pti->MessageQueue->QueueBits |= QS_MOUSEBUTTON;
+         CaptureWindow->head.pti->MessageQueue->ChangedBits |= QS_MOUSEBUTTON;
+         if (CaptureWindow->head.pti->MessageQueue->WakeMask & QS_MOUSEBUTTON)
+            KeSetEvent(CaptureWindow->head.pti->MessageQueue->NewMessages, IO_NO_INCREMENT, FALSE);
       }
-      IntUnLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
+      IntUnLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
 
       *Freed = FALSE;
       UserDereferenceObject(CaptureWindow);
@@ -472,7 +472,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
 
    *ScreenPoint = Message->Msg.pt;
 
-   if((Window != NULL && PtrToInt(Window) != 1 && CaptureWindow->hSelf != Window->hSelf) ||
+   if((Window != NULL && PtrToInt(Window) != 1 && CaptureWindow->head.h != Window->head.h) ||
          ((FilterLow != 0 || FilterHigh != 0) && (Msg < FilterLow || Msg > FilterHigh)))
    {
       /* Reject the message because it doesn't match the filter */
@@ -482,21 +482,21 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
          /* Lock the message queue so no other thread can mess with it.
             Our own message queue is not locked while fetching from the global
             queue, so we have to make sure nothing interferes! */
-         IntLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
+         IntLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
          /* if we're from the global queue, we need to add our message to our
             private queue so we don't loose it! */
-         InsertTailList(&CaptureWindow->pti->MessageQueue->HardwareMessagesListHead,
+         InsertTailList(&CaptureWindow->head.pti->MessageQueue->HardwareMessagesListHead,
                         &Message->ListEntry);
       }
 
       if (Message->Msg.message == WM_MOUSEMOVE)
       {
-         if(CaptureWindow->pti->MessageQueue->MouseMoveMsg &&
-               (CaptureWindow->pti->MessageQueue->MouseMoveMsg != Message))
+         if(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg &&
+               (CaptureWindow->head.pti->MessageQueue->MouseMoveMsg != Message))
          {
             /* delete the old message */
-            RemoveEntryList(&CaptureWindow->pti->MessageQueue->MouseMoveMsg->ListEntry);
-            ExFreePool(CaptureWindow->pti->MessageQueue->MouseMoveMsg);
+            RemoveEntryList(&CaptureWindow->head.pti->MessageQueue->MouseMoveMsg->ListEntry);
+            ExFreePool(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg);
             if (!FromGlobalQueue)
             {
                // We might have deleted the next one in our queue, so fix next
@@ -505,11 +505,11 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
          }
          /* always save a pointer to this WM_MOUSEMOVE message here because we're
             sure that the message is in the private queue */
-         CaptureWindow->pti->MessageQueue->MouseMoveMsg = Message;
+         CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = Message;
       }
       if(FromGlobalQueue)
       {
-         IntUnLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
+         IntUnLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
       }
 
       UserDereferenceObject(CaptureWindow);
@@ -518,7 +518,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
    }
 
    /* FIXME - only assign if removing? */
-   Message->Msg.hwnd = CaptureWindow->hSelf;
+   Message->Msg.hwnd = CaptureWindow->head.h;
    Message->Msg.message = Msg;
    Message->Msg.lParam = MAKELONG(Message->Msg.pt.x, Message->Msg.pt.y);
 
@@ -532,22 +532,22 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
          /* Lock the message queue so no other thread can mess with it.
             Our own message queue is not locked while fetching from the global
             queue, so we have to make sure nothing interferes! */
-         IntLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
-         if(CaptureWindow->pti->MessageQueue->MouseMoveMsg)
+         IntLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
+         if(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg)
          {
             /* delete the WM_(NC)MOUSEMOVE message in the private queue, we're dealing
                with one that's been sent later */
-            RemoveEntryList(&CaptureWindow->pti->MessageQueue->MouseMoveMsg->ListEntry);
-            ExFreePool(CaptureWindow->pti->MessageQueue->MouseMoveMsg);
+            RemoveEntryList(&CaptureWindow->head.pti->MessageQueue->MouseMoveMsg->ListEntry);
+            ExFreePool(CaptureWindow->head.pti->MessageQueue->MouseMoveMsg);
             /* our message is not in the private queue so we can remove the pointer
                instead of setting it to the current message we're processing */
-            CaptureWindow->pti->MessageQueue->MouseMoveMsg = NULL;
+            CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = NULL;
          }
-         IntUnLockHardwareMessageQueue(CaptureWindow->pti->MessageQueue);
+         IntUnLockHardwareMessageQueue(CaptureWindow->head.pti->MessageQueue);
       }
-      else if (CaptureWindow->pti->MessageQueue->MouseMoveMsg == Message)
+      else if (CaptureWindow->head.pti->MessageQueue->MouseMoveMsg == Message)
       {
-         CaptureWindow->pti->MessageQueue->MouseMoveMsg = NULL;
+         CaptureWindow->head.pti->MessageQueue->MouseMoveMsg = NULL;
       }
    }
 
@@ -557,7 +557,7 @@ co_MsqTranslateMouseMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Win
 }
 
 BOOL APIENTRY
-co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Window,
+co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWND Window,
                           UINT FilterLow, UINT FilterHigh, BOOL Remove,
                           PUSER_MESSAGE* Message)
 {
@@ -565,7 +565,7 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Windo
    POINT ScreenPoint;
    BOOL Accept, Freed;
    PLIST_ENTRY CurrentEntry;
-   PWINDOW_OBJECT DesktopWindow = NULL;
+   PWND DesktopWindow = NULL;
    PVOID WaitObjects[2];
    NTSTATUS WaitStatus;
    DECLARE_RETURN(BOOL);
@@ -592,7 +592,7 @@ co_MsqPeekHardwareMessage(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT Windo
    if (DesktopWindow)
    {
        UserRefObjectCo(DesktopWindow, &Ref);//can DesktopWindow be NULL?
-       Desk = DesktopWindow->pti->pDeskInfo;
+       Desk = DesktopWindow->head.pti->pDeskInfo;
    }
 
    /* Process messages in the message queue itself. */
@@ -822,7 +822,7 @@ co_MsqPostKeyboardMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
 VOID FASTCALL
 MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    PTHREADINFO Win32Thread;
    MSG Mesg;
    LARGE_INTEGER LargeTickCount;
@@ -856,7 +856,7 @@ MsqPostHotKeyMessage(PVOID Thread, HWND hWnd, WPARAM wParam, LPARAM lParam)
    KeQueryTickCount(&LargeTickCount);
    Mesg.time = MsqCalculateMessageTime(&LargeTickCount);
    Mesg.pt = gpsi->ptCursor;
-   MsqPostMessage(Window->pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
+   MsqPostMessage(Window->head.pti->MessageQueue, &Mesg, FALSE, QS_HOTKEY);
    UserDereferenceObject(Window);
    ObDereferenceObject (Thread);
 
@@ -1023,11 +1023,11 @@ MsqRemoveWindowMessagesFromQueue(PVOID pWindow)
    PUSER_MESSAGE PostedMessage;
    PUSER_MESSAGE_QUEUE MessageQueue;
    PLIST_ENTRY CurrentEntry, ListHead;
-   PWINDOW_OBJECT Window = pWindow;
+   PWND Window = pWindow;
 
    ASSERT(Window);
 
-   MessageQueue = Window->pti->MessageQueue;
+   MessageQueue = Window->head.pti->MessageQueue;
    ASSERT(MessageQueue);
 
    /* remove the posted messages for this window */
@@ -1037,7 +1037,7 @@ MsqRemoveWindowMessagesFromQueue(PVOID pWindow)
    {
       PostedMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE,
                                         ListEntry);
-      if (PostedMessage->Msg.hwnd == Window->hSelf)
+      if (PostedMessage->Msg.hwnd == Window->head.h)
       {
          RemoveEntryList(&PostedMessage->ListEntry);
          MsqDestroyMessage(PostedMessage);
@@ -1056,7 +1056,7 @@ MsqRemoveWindowMessagesFromQueue(PVOID pWindow)
    {
       SentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE,
                                       ListEntry);
-      if(SentMessage->Msg.hwnd == Window->hSelf)
+      if(SentMessage->Msg.hwnd == Window->head.h)
       {
          DPRINT("Notify the sender and remove a message from the queue that had not been dispatched\n");
 
@@ -1334,7 +1334,7 @@ BOOLEAN APIENTRY
 co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
                   IN BOOLEAN Hardware,
                   IN BOOLEAN Remove,
-                  IN PWINDOW_OBJECT Window,
+                  IN PWND Window,
                   IN UINT MsgFilterLow,
                   IN UINT MsgFilterHigh,
                   OUT PUSER_MESSAGE* Message)
@@ -1361,7 +1361,7 @@ co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
                                          ListEntry);
       if ( ( !Window ||
             PtrToInt(Window) == 1 ||
-            Window->hSelf == CurrentMessage->Msg.hwnd ) &&
+            Window->head.h == CurrentMessage->Msg.hwnd ) &&
             ( (MsgFilterLow == 0 && MsgFilterHigh == 0) ||
               ( MsgFilterLow <= CurrentMessage->Msg.message &&
                 MsgFilterHigh >= CurrentMessage->Msg.message ) ) )
@@ -1381,7 +1381,7 @@ co_MsqFindMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
 }
 
 NTSTATUS FASTCALL
-co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWINDOW_OBJECT WndFilter,
+co_MsqWaitForNewMessages(PUSER_MESSAGE_QUEUE MessageQueue, PWND WndFilter,
                          UINT MsgFilterMin, UINT MsgFilterMax)
 {
    PVOID WaitObjects[2] = {MessageQueue->NewMessages, &HardwareMessageEvent};
index 9f9dd11..0c3fb07 100644 (file)
@@ -328,7 +328,7 @@ UserCreateObject( PUSER_HANDLE_TABLE ht,
 
    switch (type)
    {
-//      case otWindow:
+      case otWindow:
 //      case otMenu:
 //      case otHook:
 //      case otCallProc:
@@ -418,7 +418,7 @@ UserDereferenceObject(PVOID object)
 
      switch (type)
      {
-//        case otWindow:
+        case otWindow:
 //        case otMenu:
 //        case otHook:
 //        case otCallProc:
index 88a7e10..6eca443 100644 (file)
  */
 
 BOOL FASTCALL
-IntIntersectWithParents(PWINDOW_OBJECT Child, RECTL *WindowRect)
+IntIntersectWithParents(PWND Child, RECTL *WindowRect)
 {
-   PWINDOW_OBJECT ParentWindow;
    PWND ParentWnd;
 
-   ParentWindow = Child->spwndParent;
-   while (ParentWindow != NULL)
+   ParentWnd = Child->spwndParent;
+   while (ParentWnd != NULL)
    {
-      ParentWnd = ParentWindow->Wnd;
       if (!(ParentWnd->style & WS_VISIBLE) ||
           (ParentWnd->style & WS_MINIMIZE))
       {
@@ -58,35 +56,33 @@ IntIntersectWithParents(PWINDOW_OBJECT Child, RECTL *WindowRect)
 
       /* FIXME: Layered windows. */
 
-      ParentWindow = ParentWindow->spwndParent;
+      ParentWnd = ParentWnd->spwndParent;
    }
 
    return TRUE;
 }
 
 BOOL FASTCALL
-IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse)
+IntValidateParent(PWND Child, HRGN hValidateRgn, BOOL Recurse)
 {
-   PWINDOW_OBJECT ParentWindow = Child->spwndParent;
-   PWND ParentWnd;
+   PWND ParentWnd = Child->spwndParent;
 
-   while (ParentWindow)
+   while (ParentWnd)
    {
-      ParentWnd = ParentWindow->Wnd;
       if (ParentWnd->style & WS_CLIPCHILDREN)
          break;
 
-      if (ParentWindow->hrgnUpdate != 0)
+      if (ParentWnd->hrgnUpdate != 0)
       {
          if (Recurse)
             return FALSE;
 
-         IntInvalidateWindows( ParentWindow,
+         IntInvalidateWindows( ParentWnd,
                                hValidateRgn,
                                RDW_VALIDATE | RDW_NOCHILDREN);
       }
 
-      ParentWindow = ParentWindow->spwndParent;
+      ParentWnd = ParentWnd->spwndParent;
    }
 
    return TRUE;
@@ -99,23 +95,21 @@ IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse)
  */
 
 HRGN FASTCALL
-IntCalcWindowRgn(PWINDOW_OBJECT Window, BOOL Client)
+IntCalcWindowRgn(PWND Wnd, BOOL Client)
 {
-   PWND Wnd;
    HRGN hRgnWindow;
 
-   Wnd = Window->Wnd;
    if (Client)
       hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
    else
       hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
 
-   if (Window->hrgnClip != NULL && !(Wnd->style & WS_MINIMIZE))
+   if (Wnd->hrgnClip != NULL && !(Wnd->style & WS_MINIMIZE))
    {
       NtGdiOffsetRgn(hRgnWindow,
          -Wnd->rcWindow.left,
          -Wnd->rcWindow.top);
-      NtGdiCombineRgn(hRgnWindow, hRgnWindow, Window->hrgnClip, RGN_AND);
+      NtGdiCombineRgn(hRgnWindow, hRgnWindow, Wnd->hrgnClip, RGN_AND);
       NtGdiOffsetRgn(hRgnWindow,
          Wnd->rcWindow.left,
          Wnd->rcWindow.top);
@@ -140,7 +134,7 @@ IntCalcWindowRgn(PWINDOW_OBJECT Window, BOOL Client)
  */
 
 HRGN FASTCALL
-IntGetNCUpdateRgn(PWINDOW_OBJECT Window, BOOL Validate)
+IntGetNCUpdateRgn(PWND Window, BOOL Validate)
 {
    HRGN hRgnNonClient;
    HRGN hRgnWindow;
@@ -195,8 +189,8 @@ IntGetNCUpdateRgn(PWINDOW_OBJECT Window, BOOL Validate)
             IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
             REGION_FreeRgnByHandle(Window->hrgnUpdate);
             Window->hrgnUpdate = NULL;
-            if (!(Window->Wnd->state & WNDS_INTERNALPAINT))
-               MsqDecPaintCountQueue(Window->pti->MessageQueue);
+            if (!(Window->state & WNDS_INTERNALPAINT))
+               MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
          }
       }
 
@@ -217,26 +211,23 @@ IntGetNCUpdateRgn(PWINDOW_OBJECT Window, BOOL Validate)
  */
 
 VOID FASTCALL
-co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
+co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
 {
    HDC hDC;
-   HWND hWnd = Window->hSelf;
+   HWND hWnd = Wnd->head.h;
    HRGN TempRegion;
-   PWND Wnd;
-
-   Wnd = Window->Wnd;
 
    if (Flags & (RDW_ERASENOW | RDW_UPDATENOW))
    {
-      if (Window->hrgnUpdate)
+      if (Wnd->hrgnUpdate)
       {
-         if (!IntValidateParent(Window, Window->hrgnUpdate, Recurse))
+         if (!IntValidateParent(Wnd, Wnd->hrgnUpdate, Recurse))
             return;
       }
 
       if (Flags & RDW_UPDATENOW)
       {
-         if (Window->hrgnUpdate != NULL ||
+         if (Wnd->hrgnUpdate != NULL ||
              Wnd->state & WNDS_INTERNALPAINT)
          {
             co_IntSendMessage(hWnd, WM_PAINT, 0, 0);
@@ -244,11 +235,11 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
       }
       else
       {
-         if (Window->state & WINDOWOBJECT_NEED_NCPAINT)
+         if (Wnd->state & WNDS_SENDNCPAINT)
          {
-            TempRegion = IntGetNCUpdateRgn(Window, TRUE);
-            Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
-            MsqDecPaintCountQueue(Window->pti->MessageQueue);
+            TempRegion = IntGetNCUpdateRgn(Wnd, TRUE);
+            Wnd->state &= ~WNDS_SENDNCPAINT;
+            MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue);
             co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)TempRegion, 0);
 
             if ( (HANDLE) 1 != TempRegion &&
@@ -259,19 +250,19 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
             }
          }
 
-         if (Window->state & WINDOWOBJECT_NEED_ERASEBKGND)
+         if (Wnd->state & WNDS_ERASEBACKGROUND)
          {
-            if (Window->hrgnUpdate)
+            if (Wnd->hrgnUpdate)
             {
-               hDC = UserGetDCEx( Window,
-                                  Window->hrgnUpdate,
+               hDC = UserGetDCEx( Wnd,
+                                  Wnd->hrgnUpdate,
                                   DCX_CACHE|DCX_USESTYLE|DCX_INTERSECTRGN|DCX_KEEPCLIPRGN);
 
                if (co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)hDC, 0))
                {
-                  Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+                  Wnd->state &= ~WNDS_ERASEBACKGROUND;
                }
-               UserReleaseDC(Window, hDC, FALSE);
+               UserReleaseDC(Wnd, hDC, FALSE);
             }
          }
       }
@@ -294,19 +285,18 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
    {
       HWND *List, *phWnd;
 
-      if ((List = IntWinListChildren(Window)))
+      if ((List = IntWinListChildren(Wnd)))
       {
          /* FIXME: Handle WS_EX_TRANSPARENT */
          for (phWnd = List; *phWnd; ++phWnd)
          {
-            Window = UserGetWindowObject(*phWnd);
-            Wnd = Window->Wnd;
-            if (Window && (Wnd->style & WS_VISIBLE))
+            Wnd = UserGetWindowObject(*phWnd);
+            if (Wnd && (Wnd->style & WS_VISIBLE))
             {
                USER_REFERENCE_ENTRY Ref;
-               UserRefObjectCo(Window, &Ref);
-               co_IntPaintWindows(Window, Flags, TRUE);
-               UserDerefObjectCo(Window);
+               UserRefObjectCo(Wnd, &Ref);
+               co_IntPaintWindows(Wnd, Flags, TRUE);
+               UserDerefObjectCo(Wnd);
             }
          }
          ExFreePool(List);
@@ -321,14 +311,12 @@ co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse)
  */
 
 VOID FASTCALL
-IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
+IntInvalidateWindows(PWND Wnd, HRGN hRgn, ULONG Flags)
 {
    INT RgnType;
-   PWND Wnd;
    BOOL HadPaintMessage, HadNCPaintMessage;
    BOOL HasPaintMessage, HasNCPaintMessage;
 
-   Wnd = Window->Wnd;
    DPRINT("IntInvalidateWindows start\n");
    /*
     * If the nonclient is not to be redrawn, clip the region to the client
@@ -338,7 +326,7 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
    {
       HRGN hRgnClient;
 
-      hRgnClient = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
+      hRgnClient = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
       RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnClient, RGN_AND);
       REGION_FreeRgnByHandle(hRgnClient);
    }
@@ -347,11 +335,11 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
     * Clip the given region with window rectangle (or region)
     */
 
-   if (!Window->hrgnClip || (Wnd->style & WS_MINIMIZE))
+   if (!Wnd->hrgnClip || (Wnd->style & WS_MINIMIZE))
    {
       HRGN hRgnWindow;
 
-      hRgnWindow = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+      hRgnWindow = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
       RgnType = NtGdiCombineRgn(hRgn, hRgn, hRgnWindow, RGN_AND);
       REGION_FreeRgnByHandle(hRgnWindow);
    }
@@ -360,7 +348,7 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
       NtGdiOffsetRgn( hRgn,
                      -Wnd->rcWindow.left,
                      -Wnd->rcWindow.top);
-      RgnType = NtGdiCombineRgn(hRgn, hRgn, Window->hrgnClip, RGN_AND);
+      RgnType = NtGdiCombineRgn(hRgn, hRgn, Wnd->hrgnClip, RGN_AND);
       NtGdiOffsetRgn( hRgn,
                       Wnd->rcWindow.left,
                       Wnd->rcWindow.top);
@@ -370,9 +358,9 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
     * Save current state of pending updates
     */
 
-   HadPaintMessage = Window->hrgnUpdate != NULL ||
+   HadPaintMessage = Wnd->hrgnUpdate != NULL ||
                      Wnd->state & WNDS_INTERNALPAINT;
-   HadNCPaintMessage = Window->state & WINDOWOBJECT_NEED_NCPAINT;
+   HadNCPaintMessage = Wnd->state & WNDS_SENDNCPAINT;
 
    /*
     * Update the region and flags
@@ -380,47 +368,47 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
 
    if (Flags & RDW_INVALIDATE && RgnType != NULLREGION)
    {
-      if (Window->hrgnUpdate == NULL)
+      if (Wnd->hrgnUpdate == NULL)
       {
-         Window->hrgnUpdate = IntSysCreateRectRgn(0, 0, 0, 0);
-         IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_PUBLIC);
+         Wnd->hrgnUpdate = IntSysCreateRectRgn(0, 0, 0, 0);
+         IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_PUBLIC);
       }
 
-      if (NtGdiCombineRgn(Window->hrgnUpdate, Window->hrgnUpdate,
+      if (NtGdiCombineRgn(Wnd->hrgnUpdate, Wnd->hrgnUpdate,
                           hRgn, RGN_OR) == NULLREGION)
       {
-         IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
-         REGION_FreeRgnByHandle(Window->hrgnUpdate);
-         Window->hrgnUpdate = NULL;
+         IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
+         REGION_FreeRgnByHandle(Wnd->hrgnUpdate);
+         Wnd->hrgnUpdate = NULL;
       }
 
       if (Flags & RDW_FRAME)
-         Window->state |= WINDOWOBJECT_NEED_NCPAINT;
+         Wnd->state |= WNDS_SENDNCPAINT;
       if (Flags & RDW_ERASE)
-         Window->state |= WINDOWOBJECT_NEED_ERASEBKGND;
+         Wnd->state |= WNDS_ERASEBACKGROUND;
 
       Flags |= RDW_FRAME;
    }
 
    if (Flags & RDW_VALIDATE && RgnType != NULLREGION)
    {
-      if (Window->hrgnUpdate != NULL)
+      if (Wnd->hrgnUpdate != NULL)
       {
-         if (NtGdiCombineRgn(Window->hrgnUpdate, Window->hrgnUpdate,
+         if (NtGdiCombineRgn(Wnd->hrgnUpdate, Wnd->hrgnUpdate,
                              hRgn, RGN_DIFF) == NULLREGION)
          {
-            IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
-            REGION_FreeRgnByHandle(Window->hrgnUpdate);
-            Window->hrgnUpdate = NULL;
+            IntGdiSetRegionOwner(Wnd->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
+            REGION_FreeRgnByHandle(Wnd->hrgnUpdate);
+            Wnd->hrgnUpdate = NULL;
          }
       }
 
-      if (Window->hrgnUpdate == NULL)
-         Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+      if (Wnd->hrgnUpdate == NULL)
+         Wnd->state &= ~WNDS_ERASEBACKGROUND;
       if (Flags & RDW_NOFRAME)
-         Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
+         Wnd->state &= ~WNDS_SENDNCPAINT;
       if (Flags & RDW_NOERASE)
-         Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+         Wnd->state &= ~WNDS_ERASEBACKGROUND;
    }
 
    if (Flags & RDW_INTERNALPAINT)
@@ -440,11 +428,11 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
    if (!(Flags & RDW_NOCHILDREN) && !(Wnd->style & WS_MINIMIZE) &&
          ((Flags & RDW_ALLCHILDREN) || !(Wnd->style & WS_CLIPCHILDREN)))
    {
-      PWINDOW_OBJECT Child;
+      PWND Child;
 
-      for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
+      for (Child = Wnd->spwndChild; Child; Child = Child->spwndNext)
       {
-         if (Child->Wnd->style & WS_VISIBLE)
+         if (Child->style & WS_VISIBLE)
          {
             /*
              * Recursive call to update children hrgnUpdate
@@ -462,24 +450,24 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
     * Fake post paint messages to window message queue if needed
     */
 
-   HasPaintMessage = Window->hrgnUpdate != NULL ||
+   HasPaintMessage = Wnd->hrgnUpdate != NULL ||
                      Wnd->state & WNDS_INTERNALPAINT;
-   HasNCPaintMessage = Window->state & WINDOWOBJECT_NEED_NCPAINT;
+   HasNCPaintMessage = Wnd->state & WNDS_SENDNCPAINT;
 
    if (HasPaintMessage != HadPaintMessage)
    {
       if (HadPaintMessage)
-         MsqDecPaintCountQueue(Window->pti->MessageQueue);
+         MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue);
       else
-         MsqIncPaintCountQueue(Window->pti->MessageQueue);
+         MsqIncPaintCountQueue(Wnd->head.pti->MessageQueue);
    }
 
    if (HasNCPaintMessage != HadNCPaintMessage)
    {
       if (HadNCPaintMessage)
-         MsqDecPaintCountQueue(Window->pti->MessageQueue);
+         MsqDecPaintCountQueue(Wnd->head.pti->MessageQueue);
       else
-         MsqIncPaintCountQueue(Window->pti->MessageQueue);
+         MsqIncPaintCountQueue(Wnd->head.pti->MessageQueue);
    }
    DPRINT("IntInvalidateWindows exit\n");
 }
@@ -493,19 +481,17 @@ IntInvalidateWindows(PWINDOW_OBJECT Window, HRGN hRgn, ULONG Flags)
  */
 
 BOOL FASTCALL
-IntIsWindowDrawable(PWINDOW_OBJECT Window)
+IntIsWindowDrawable(PWND Wnd)
 {
-   PWINDOW_OBJECT WndObject;
-   PWND Wnd;
+   PWND WndObject;
 
-   for (WndObject = Window; WndObject != NULL; WndObject = WndObject->spwndParent)
+   for (WndObject = Wnd; WndObject != NULL; WndObject = WndObject->spwndParent)
    {
-      Wnd = WndObject->Wnd;
-      if ( Window->state & WINDOWSTATUS_DESTROYING || // state2
-           Window->state & WINDOWSTATUS_DESTROYED ||
-           !Wnd ||
-           !(Wnd->style & WS_VISIBLE) ||
-            ((Wnd->style & WS_MINIMIZE) && (WndObject != Window)))
+      if ( WndObject->state2 & WNDS2_INDESTROY ||
+           WndObject->state & WNDS_DESTROYED ||
+           !WndObject ||
+           !(WndObject->style & WS_VISIBLE) ||
+            ((WndObject->style & WS_MINIMIZE) && (WndObject != Wnd)))
       {
          return FALSE;
       }
@@ -517,13 +503,13 @@ IntIsWindowDrawable(PWINDOW_OBJECT Window)
 /*
  * IntRedrawWindow
  *
- * Internal version of NtUserRedrawWindow that takes WINDOW_OBJECT as
+ * Internal version of NtUserRedrawWindow that takes WND as
  * first parameter.
  */
 
 BOOL FASTCALL
 co_UserRedrawWindow(
-   PWINDOW_OBJECT Window,
+   PWND Window,
    const RECTL* UpdateRect,
    HRGN UpdateRgn,
    ULONG Flags)
@@ -558,26 +544,26 @@ co_UserRedrawWindow(
             hRgn = NULL;
          }
          else
-            NtGdiOffsetRgn(hRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
+            NtGdiOffsetRgn(hRgn, Window->rcClient.left, Window->rcClient.top);
       }
       else if (UpdateRect != NULL)
       {
          if (!RECTL_bIsEmptyRect(UpdateRect))
          {
             hRgn = IntSysCreateRectRgnIndirect((RECTL *)UpdateRect);
-            NtGdiOffsetRgn(hRgn, Window->Wnd->rcClient.left, Window->Wnd->rcClient.top);
+            NtGdiOffsetRgn(hRgn, Window->rcClient.left, Window->rcClient.top);
          }
       }
       else if ((Flags & (RDW_INVALIDATE | RDW_FRAME)) == (RDW_INVALIDATE | RDW_FRAME) ||
                (Flags & (RDW_VALIDATE | RDW_NOFRAME)) == (RDW_VALIDATE | RDW_NOFRAME))
       {
-         if (!RECTL_bIsEmptyRect(&Window->Wnd->rcWindow))
-            hRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+         if (!RECTL_bIsEmptyRect(&Window->rcWindow))
+            hRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow);
       }
       else
       {
-         if (!RECTL_bIsEmptyRect(&Window->Wnd->rcClient))
-            hRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
+         if (!RECTL_bIsEmptyRect(&Window->rcClient))
+            hRgn = IntSysCreateRectRgnIndirect(&Window->rcClient);
       }
    }
 
@@ -617,45 +603,41 @@ co_UserRedrawWindow(
 }
 
 BOOL FASTCALL
-IntIsWindowDirty(PWINDOW_OBJECT Window)
+IntIsWindowDirty(PWND Wnd)
 {
-   PWND Wnd = Window->Wnd;
    return (Wnd->style & WS_VISIBLE) &&
-          ((Window->hrgnUpdate != NULL) ||
+          ((Wnd->hrgnUpdate != NULL) ||
            (Wnd->state & WNDS_INTERNALPAINT) ||
-           (Window->state & WINDOWOBJECT_NEED_NCPAINT));
+           (Wnd->state & WNDS_SENDNCPAINT));
 }
 
 HWND FASTCALL
-IntFindWindowToRepaint(PWINDOW_OBJECT Window, PTHREADINFO Thread)
+IntFindWindowToRepaint(PWND Window, PTHREADINFO Thread)
 {
    HWND hChild;
-   PWINDOW_OBJECT TempWindow;
-   PWND Wnd, TempWnd;
+   PWND TempWindow;
 
    for (; Window != NULL; Window = Window->spwndNext)
    {
-      Wnd = Window->Wnd;
       if (IntWndBelongsToThread(Window, Thread) &&
           IntIsWindowDirty(Window))
       {
          /* Make sure all non-transparent siblings are already drawn. */
-         if (Wnd->ExStyle & WS_EX_TRANSPARENT)
+         if (Window->ExStyle & WS_EX_TRANSPARENT)
          {
             for (TempWindow = Window->spwndNext; TempWindow != NULL;
                  TempWindow = TempWindow->spwndNext)
             {
-               TempWnd = TempWindow->Wnd;
-               if (!(TempWnd->ExStyle & WS_EX_TRANSPARENT) &&
+               if (!(TempWindow->ExStyle & WS_EX_TRANSPARENT) &&
                    IntWndBelongsToThread(TempWindow, Thread) &&
                    IntIsWindowDirty(TempWindow))
                {
-                  return TempWindow->hSelf;
+                  return TempWindow->head.h;
                }
             }
          }
 
-         return Window->hSelf;
+         return Window->head.h;
       }
 
       if (Window->spwndChild)
@@ -671,7 +653,7 @@ IntFindWindowToRepaint(PWINDOW_OBJECT Window, PTHREADINFO Thread)
 
 BOOL FASTCALL
 IntGetPaintMessage(
-   PWINDOW_OBJECT Window,
+   PWND Window,
    UINT MsgFilterMin,
    UINT MsgFilterMax,
    PTHREADINFO Thread,
@@ -697,7 +679,7 @@ IntGetPaintMessage(
       return FALSE;
    }
 
-   if (Window != NULL && Message->hwnd != Window->hSelf)
+   if (Window != NULL && Message->hwnd != Window->head.h)
       return FALSE;
 
    Message->message = WM_PAINT;
@@ -708,12 +690,12 @@ IntGetPaintMessage(
 
 static
 HWND FASTCALL
-co_IntFixCaret(PWINDOW_OBJECT Window, RECTL *lprc, UINT flags)
+co_IntFixCaret(PWND Window, RECTL *lprc, UINT flags)
 {
    PDESKTOP Desktop;
    PTHRDCARETINFO CaretInfo;
    HWND hWndCaret;
-   PWINDOW_OBJECT WndCaret;
+   PWND WndCaret;
 
    ASSERT_REFS_CO(Window);
 
@@ -753,19 +735,13 @@ co_IntFixCaret(PWINDOW_OBJECT Window, RECTL *lprc, UINT flags)
 BOOL
 FASTCALL
 IntPrintWindow(
-    PWINDOW_OBJECT Window,
+    PWND pwnd,
     HDC hdcBlt,
     UINT nFlags)
 {
-    PWND pwnd;
     HDC hdcSrc;
     INT cx, cy, xSrc, ySrc;
 
-    pwnd = Window->Wnd;
-
-    if (!pwnd)
-       return FALSE;
-
     if ( nFlags & PW_CLIENTONLY)
     {
        cx = pwnd->rcClient.right - pwnd->rcClient.left;
@@ -785,9 +761,9 @@ IntPrintWindow(
     return FALSE;
 
     /* Update the window just incase. */
-    co_IntPaintWindows( Window, RDW_ERASENOW|RDW_UPDATENOW, FALSE);
+    co_IntPaintWindows( pwnd, RDW_ERASENOW|RDW_UPDATENOW, FALSE);
 
-    hdcSrc = UserGetDCEx( Window, NULL, DCX_CACHE|DCX_WINDOW);
+    hdcSrc = UserGetDCEx( pwnd, NULL, DCX_CACHE|DCX_WINDOW);
     /* Print window to printer context. */
     NtGdiBitBlt( hdcBlt,
                  0,
@@ -801,7 +777,7 @@ IntPrintWindow(
                  0,
                  0);
 
-    UserReleaseDC( Window, hdcSrc, FALSE);
+    UserReleaseDC( pwnd, hdcSrc, FALSE);
 
     // TODO: Release Redirection from Print.
 
@@ -820,12 +796,11 @@ IntPrintWindow(
 HDC APIENTRY
 NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
 {
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    PAINTSTRUCT Ps;
    NTSTATUS Status;
    DECLARE_RETURN(HDC);
    USER_REFERENCE_ENTRY Ref;
-   PWND Wnd;
 
    DPRINT("Enter NtUserBeginPaint\n");
    UserEnterExclusive();
@@ -837,17 +812,15 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
 
    UserRefObjectCo(Window, &Ref);
 
-   Wnd = Window->Wnd;
-
    co_UserHideCaret(Window);
 
-   if (Window->state & WINDOWOBJECT_NEED_NCPAINT)
+   if (Window->state & WNDS_SENDNCPAINT)
    {
       HRGN hRgn;
 
       hRgn = IntGetNCUpdateRgn(Window, FALSE);
-      Window->state &= ~WINDOWOBJECT_NEED_NCPAINT;
-      MsqDecPaintCountQueue(Window->pti->MessageQueue);
+      Window->state &= ~WNDS_SENDNCPAINT;
+      MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
       co_IntSendMessage(hWnd, WM_NCPAINT, (WPARAM)hRgn, 0);
       if (hRgn != (HANDLE)1 && hRgn != NULL)
       {
@@ -868,7 +841,7 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
 
    if (Window->hrgnUpdate != NULL)
    {
-      MsqDecPaintCountQueue(Window->pti->MessageQueue);
+      MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
       GdiGetClipBox(Ps.hdc, &Ps.rcPaint);
       IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
       /* The region is part of the dc now and belongs to the process! */
@@ -876,17 +849,17 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
    }
    else
    {
-      if (Wnd->state & WNDS_INTERNALPAINT)
-         MsqDecPaintCountQueue(Window->pti->MessageQueue);
+      if (Window->state & WNDS_INTERNALPAINT)
+         MsqDecPaintCountQueue(Window->head.pti->MessageQueue);
 
       IntGetClientRect(Window, &Ps.rcPaint);
    }
 
-   Wnd->state &= ~WNDS_INTERNALPAINT;
+   Window->state &= ~WNDS_INTERNALPAINT;
 
-   if (Window->state & WINDOWOBJECT_NEED_ERASEBKGND)
+   if (Window->state & WNDS_ERASEBACKGROUND)
    {
-      Window->state &= ~WINDOWOBJECT_NEED_ERASEBKGND;
+      Window->state &= ~WNDS_ERASEBACKGROUND;
       Ps.fErase = !co_IntSendMessage(hWnd, WM_ERASEBKGND, (WPARAM)Ps.hdc, 0);
    }
    else
@@ -895,9 +868,9 @@ NtUserBeginPaint(HWND hWnd, PAINTSTRUCT* UnsafePs)
    }
    if (Window->hrgnUpdate)
    {
-      if (!(Wnd->style & WS_CLIPCHILDREN))
+      if (!(Window->style & WS_CLIPCHILDREN))
       {
-         PWINDOW_OBJECT Child;
+         PWND Child;
          for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
          {
             IntInvalidateWindows(Child, Window->hrgnUpdate, RDW_FRAME | RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
@@ -934,7 +907,7 @@ BOOL APIENTRY
 NtUserEndPaint(HWND hWnd, CONST PAINTSTRUCT* pUnsafePs)
 {
    NTSTATUS Status = STATUS_SUCCESS;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    DECLARE_RETURN(BOOL);
    USER_REFERENCE_ENTRY Ref;
    HDC hdc = NULL;
@@ -978,7 +951,7 @@ CLEANUP:
 
 
 INT FASTCALL
-co_UserGetUpdateRgn(PWINDOW_OBJECT Window, HRGN hRgn, BOOL bErase)
+co_UserGetUpdateRgn(PWND Window, HRGN hRgn, BOOL bErase)
 {
    int RegionType;
    RECTL Rect;
@@ -991,11 +964,11 @@ co_UserGetUpdateRgn(PWINDOW_OBJECT Window, HRGN hRgn, BOOL bErase)
    }
    else
    {
-      Rect = Window->Wnd->rcClient;
+      Rect = Window->rcClient;
       IntIntersectWithParents(Window, &Rect);
       NtGdiSetRectRgn(hRgn, Rect.left, Rect.top, Rect.right, Rect.bottom);
       RegionType = NtGdiCombineRgn(hRgn, hRgn, Window->hrgnUpdate, RGN_AND);
-      NtGdiOffsetRgn(hRgn, -Window->Wnd->rcClient.left, -Window->Wnd->rcClient.top);
+      NtGdiOffsetRgn(hRgn, -Window->rcClient.left, -Window->rcClient.top);
    }
 
    if (bErase && RegionType != NULLREGION && RegionType != ERROR)
@@ -1017,7 +990,7 @@ INT APIENTRY
 NtUserGetUpdateRgn(HWND hWnd, HRGN hRgn, BOOL bErase)
 {
    DECLARE_RETURN(INT);
-   PWINDOW_OBJECT Window;
+   PWND Window;
    INT ret;
    USER_REFERENCE_ENTRY Ref;
 
@@ -1051,7 +1024,7 @@ CLEANUP:
 BOOL APIENTRY
 NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    RECTL Rect;
    INT RegionType;
    PROSRGNDATA RgnData;
@@ -1075,7 +1048,7 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
       /* Get the update region bounding box. */
       if (Window->hrgnUpdate == (HRGN)1)
       {
-         Rect = Window->Wnd->rcClient;
+         Rect = Window->rcClient;
       }
       else
       {
@@ -1085,14 +1058,14 @@ NtUserGetUpdateRect(HWND hWnd, LPRECT UnsafeRect, BOOL bErase)
          RGNOBJAPI_Unlock(RgnData);
 
          if (RegionType != ERROR && RegionType != NULLREGION)
-            RECTL_bIntersectRect(&Rect, &Rect, &Window->Wnd->rcClient);
+            RECTL_bIntersectRect(&Rect, &Rect, &Window->rcClient);
       }
 
       if (IntIntersectWithParents(Window, &Rect))
       {
          RECTL_vOffsetRect(&Rect,
-                          -Window->Wnd->rcClient.left,
-                          -Window->Wnd->rcClient.top);
+                          -Window->rcClient.left,
+                          -Window->rcClient.top);
       } else
       {
          Rect.left = Rect.top = Rect.right = Rect.bottom = 0;
@@ -1140,7 +1113,7 @@ NtUserRedrawWindow(
    UINT flags)
 {
    RECTL SafeUpdateRect;
-   PWINDOW_OBJECT Wnd;
+   PWND Wnd;
    BOOL Ret;
    USER_REFERENCE_ENTRY Ref;
    NTSTATUS Status = STATUS_SUCCESS;
@@ -1422,7 +1395,7 @@ NtUserScrollWindowEx(
 {
    RECTL rcScroll, rcClip, rcCaret, rcUpdate;
    INT Result;
-   PWINDOW_OBJECT Window = NULL, CaretWnd;
+   PWND Window = NULL, CaretWnd;
    HDC hDC;
    HRGN hrgnOwn = NULL, hrgnTemp;
    HWND hwndCaret;
@@ -1520,7 +1493,7 @@ NtUserScrollWindowEx(
 
    if (flags & SW_SCROLLCHILDREN)
    {
-      PWINDOW_OBJECT Child;
+      PWND Child;
       RECTL rcChild;
       POINT ClientOrigin;
       USER_REFERENCE_ENTRY WndRef;
@@ -1529,7 +1502,7 @@ NtUserScrollWindowEx(
       IntGetClientOrigin(Window, &ClientOrigin);
       for (Child = Window->spwndChild; Child; Child = Child->spwndNext)
       {
-         rcChild = Child->Wnd->rcWindow;
+         rcChild = Child->rcWindow;
          rcChild.left -= ClientOrigin.x;
          rcChild.top -= ClientOrigin.y;
          rcChild.right -= ClientOrigin.x;
@@ -1603,7 +1576,7 @@ CLEANUP:
 
 BOOL
 UserDrawSysMenuButton(
-   PWINDOW_OBJECT pWnd,
+   PWND pWnd,
    HDC hDc,
    RECTL *lpRc,
    BOOL Down)
@@ -1615,12 +1588,12 @@ UserDrawSysMenuButton(
 
    /* Get the icon to draw. We don't care about WM_GETICON here. */
 
-   hIcon = pWnd->Wnd->pcls->hIconSm;
+   hIcon = pWnd->pcls->hIconSm;
 
    if(!hIcon)
    {
       DPRINT("Wnd class has no small icon.\n");
-      hIcon = pWnd->Wnd->pcls->hIcon;
+      hIcon = pWnd->pcls->hIcon;
    }
 
    if(!hIcon)
@@ -1709,7 +1682,7 @@ UserDrawCaptionText(
 }
 
 BOOL UserDrawCaption(
-   PWINDOW_OBJECT pWnd,
+   PWND pWnd,
    HDC hDc,
    RECTL *lpRc,
    HFONT hFont,
@@ -1726,13 +1699,9 @@ BOOL UserDrawCaption(
    RECTL r = *lpRc;
    LONG ButtonWidth, IconWidth;
    BOOL HasIcon;
-   PWND Wnd = NULL;
 
    //ASSERT(pWnd != NULL);
 
-   if (pWnd)
-       Wnd = pWnd->Wnd;
-
    RECTL_vMakeWellOrdered(lpRc);
    hMemBmp = NtGdiCreateCompatibleBitmap(hDc,
       lpRc->right - lpRc->left,
@@ -1762,11 +1731,11 @@ BOOL UserDrawCaption(
    VCenter = (lpRc->bottom - lpRc->top) / 2;
    Padding = VCenter - (Height / 2);
 
-   if ((!hIcon) && (Wnd != NULL))
+   if ((!hIcon) && (pWnd != NULL))
    {
-     HasIcon = (uFlags & DC_ICON) && (Wnd->style & WS_SYSMENU)
-        && !(uFlags & DC_SMALLCAP) && !(Wnd->ExStyle & WS_EX_DLGMODALFRAME)
-        && !(Wnd->ExStyle & WS_EX_TOOLWINDOW);
+     HasIcon = (uFlags & DC_ICON) && (pWnd->style & WS_SYSMENU)
+        && !(uFlags & DC_SMALLCAP) && !(pWnd->ExStyle & WS_EX_DLGMODALFRAME)
+        && !(pWnd->ExStyle & WS_EX_TOOLWINDOW);
    }
    else
      HasIcon = (hIcon != 0);
@@ -1840,14 +1809,14 @@ BOOL UserDrawCaption(
          TRIVERTEX vert[2];
          COLORREF Colors[2];
 
-                if (Wnd != NULL)
+                if (pWnd != NULL)
                 {
-                        if(Wnd->style & WS_SYSMENU)
+                        if(pWnd->style & WS_SYSMENU)
                         {
                                r.right -= 3 + ButtonWidth;
                                if(!(uFlags & DC_SMALLCAP))
                                {
-                                  if(Wnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
+                                  if(pWnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
                                          r.right -= 2 + 2 * ButtonWidth;
                                   else r.right -= 2;
                                   r.right -= 2;
@@ -1927,12 +1896,12 @@ BOOL UserDrawCaption(
             ButtonWidth = UserGetSystemMetrics(SM_CXSMSIZE) - 2;
          else ButtonWidth = UserGetSystemMetrics(SM_CXSIZE) - 2;
 
-         if ((Wnd != NULL) && (Wnd->style & WS_SYSMENU))
+         if ((pWnd != NULL) && (pWnd->style & WS_SYSMENU))
          {
             r.right -= 3 + ButtonWidth;
             if(! (uFlags & DC_SMALLCAP))
             {
-               if(Wnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
+               if(pWnd->style & (WS_MAXIMIZEBOX | WS_MINIMIZEBOX))
                   r.right -= 2 + 2 * ButtonWidth;
                else r.right -= 2;
                r.right -= 2;
@@ -1946,9 +1915,9 @@ BOOL UserDrawCaption(
       else if (pWnd != NULL)
       {
          UNICODE_STRING ustr;
-         ustr.Buffer = pWnd->Wnd->strName.Buffer;
-         ustr.Length = pWnd->Wnd->strName.Length;
-         ustr.MaximumLength = pWnd->Wnd->strName.MaximumLength;
+         ustr.Buffer = pWnd->strName.Buffer;
+         ustr.Length = pWnd->strName.Length;
+         ustr.MaximumLength = pWnd->strName.MaximumLength;
          UserDrawCaptionText(hMemDc, &ustr, &r, uFlags);
       }
    }
@@ -2002,7 +1971,7 @@ NtUserDrawCaptionTemp(
    const PUNICODE_STRING str,
    UINT uFlags)
 {
-   PWINDOW_OBJECT pWnd = NULL;
+   PWND pWnd = NULL;
    UNICODE_STRING SafeStr = {0};
    NTSTATUS Status = STATUS_SUCCESS;
    RECTL SafeRect;
@@ -2093,7 +2062,7 @@ NtUserPrintWindow(
     HDC  hdcBlt,
     UINT nFlags)
 {
-    PWINDOW_OBJECT Window;   
+    PWND Window;   
     BOOL Ret = FALSE;
 
     UserEnterExclusive();
index 5e032a6..56e221d 100644 (file)
 /* STATIC FUNCTIONS **********************************************************/
 
 PPROPERTY FASTCALL
-IntGetProp(PWINDOW_OBJECT Window, ATOM Atom)
+IntGetProp(PWND Window, ATOM Atom)
 {
    PLIST_ENTRY ListEntry;
    PPROPERTY Property;
 
-   ListEntry = Window->Wnd->PropListHead.Flink;
-   while (ListEntry != &Window->Wnd->PropListHead)
+   ListEntry = Window->PropListHead.Flink;
+   while (ListEntry != &Window->PropListHead)
    {
       Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
       if (Property->Atom == Atom)
@@ -54,7 +54,7 @@ IntGetProp(PWINDOW_OBJECT Window, ATOM Atom)
 }
 
 BOOL FASTCALL
-IntRemoveProp(PWINDOW_OBJECT Window, ATOM Atom)
+IntRemoveProp(PWND Window, ATOM Atom)
 {
    PPROPERTY Prop;
    Prop = IntGetProp(Window, Atom);
@@ -65,12 +65,12 @@ IntRemoveProp(PWINDOW_OBJECT Window, ATOM Atom)
    }
    RemoveEntryList(&Prop->PropListEntry);
    UserHeapFree(Prop);
-   Window->Wnd->PropListItems--;
+   Window->PropListItems--;
    return TRUE;
 }
 
 BOOL FASTCALL
-IntSetProp(PWINDOW_OBJECT pWnd, ATOM Atom, HANDLE Data)
+IntSetProp(PWND pWnd, ATOM Atom, HANDLE Data)
 {
    PPROPERTY Prop;
 
@@ -84,8 +84,8 @@ IntSetProp(PWINDOW_OBJECT pWnd, ATOM Atom, HANDLE Data)
          return FALSE;
       }
       Prop->Atom = Atom;
-      InsertTailList(&pWnd->Wnd->PropListHead, &Prop->PropListEntry);
-      pWnd->Wnd->PropListItems++;
+      InsertTailList(&pWnd->PropListHead, &Prop->PropListEntry);
+      pWnd->PropListItems++;
    }
 
    Prop->Data = Data;
@@ -100,7 +100,7 @@ NtUserBuildPropList(HWND hWnd,
                     DWORD BufferSize,
                     DWORD *Count)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    PPROPERTY Property;
    PLIST_ENTRY ListEntry;
    PROPLISTITEM listitem, *li;
@@ -125,8 +125,8 @@ NtUserBuildPropList(HWND hWnd,
 
       /* copy list */
       li = (PROPLISTITEM *)Buffer;
-      ListEntry = Window->Wnd->PropListHead.Flink;
-      while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &Window->Wnd->PropListHead))
+      ListEntry = Window->PropListHead.Flink;
+      while((BufferSize >= sizeof(PROPLISTITEM)) && (ListEntry != &Window->PropListHead))
       {
          Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
          listitem.Atom = Property->Atom;
@@ -147,7 +147,7 @@ NtUserBuildPropList(HWND hWnd,
    }
    else
    {
-      Cnt = Window->Wnd->PropListItems * sizeof(PROPLISTITEM);
+      Cnt = Window->PropListItems * sizeof(PROPLISTITEM);
    }
 
    if(Count)
@@ -170,7 +170,7 @@ CLEANUP:
 HANDLE APIENTRY
 NtUserRemoveProp(HWND hWnd, ATOM Atom)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    PPROPERTY Prop;
    HANDLE Data;
    DECLARE_RETURN(HANDLE);
@@ -192,7 +192,7 @@ NtUserRemoveProp(HWND hWnd, ATOM Atom)
    Data = Prop->Data;
    RemoveEntryList(&Prop->PropListEntry);
    UserHeapFree(Prop);
-   Window->Wnd->PropListItems--;
+   Window->PropListItems--;
 
    RETURN(Data);
 
@@ -205,7 +205,7 @@ CLEANUP:
 BOOL APIENTRY
 NtUserSetProp(HWND hWnd, ATOM Atom, HANDLE Data)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    DECLARE_RETURN(BOOL);
 
    DPRINT("Enter NtUserSetProp\n");
index 787a0e3..84ed568 100644 (file)
  * the top. Return TRUE if the scrollbar is vertical, FALSE if horizontal.
  */
 BOOL FASTCALL
-IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, RECTL *lprect)
+IntGetScrollBarRect (PWND Wnd, INT nBar, RECTL *lprect)
 {
    BOOL vertical;
-   PWND Wnd = Window->Wnd;
-   RECTL ClientRect = Window->Wnd->rcClient;
-   RECTL WindowRect = Window->Wnd->rcWindow;
+   RECTL ClientRect = Wnd->rcClient;
+   RECTL WindowRect = Wnd->rcWindow;
 
    switch (nBar)
    {
@@ -72,7 +71,7 @@ IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, RECTL *lprect)
          break;
 
       case SB_CTL:
-         IntGetClientRect (Window, lprect);
+         IntGetClientRect (Wnd, lprect);
          vertical = ((Wnd->style & SBS_VERT) != 0);
          break;
 
@@ -84,9 +83,8 @@ IntGetScrollBarRect (PWINDOW_OBJECT Window, INT nBar, RECTL *lprect)
 }
 
 BOOL FASTCALL
-IntCalculateThumb(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi, LPSCROLLINFO psi)
+IntCalculateThumb(PWND Wnd, LONG idObject, PSCROLLBARINFO psbi, LPSCROLLINFO psi)
 {
-   PWND Wnd = Window->Wnd;
    INT Thumb, ThumbBox, ThumbPos, cxy, mx;
    RECTL ClientRect;
 
@@ -101,7 +99,7 @@ IntCalculateThumb(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi, LPS
          cxy = psbi->rcScrollBar.bottom - psbi->rcScrollBar.top;
          break;
       case SB_CTL:
-         IntGetClientRect(Window, &ClientRect);
+         IntGetClientRect(Wnd, &ClientRect);
          if(Wnd->style & SBS_VERT)
          {
             Thumb = UserGetSystemMetrics(SM_CYVSCROLL);
@@ -161,13 +159,13 @@ IntCalculateThumb(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi, LPS
 }
 
 static VOID FASTCALL
-IntUpdateSBInfo(PWINDOW_OBJECT Window, int wBar)
+IntUpdateSBInfo(PWND Window, int wBar)
 {
    PSCROLLBARINFO sbi;
    LPSCROLLINFO psi;
 
    ASSERT(Window);
-   ASSERT(Window->pSBInfo);
+   ASSERT(Window->pSBInfoex);
 
    sbi = IntGetScrollbarInfoFromWindow(Window, wBar);
    psi = IntGetScrollInfoFromWindow(Window, wBar);
@@ -176,7 +174,7 @@ IntUpdateSBInfo(PWINDOW_OBJECT Window, int wBar)
 }
 
 static BOOL FASTCALL
-co_IntGetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPSCROLLINFO lpsi)
+co_IntGetScrollInfo(PWND Window, INT nBar, LPSCROLLINFO lpsi)
 {
    UINT Mask;
    LPSCROLLINFO psi;
@@ -278,7 +276,7 @@ NEWco_IntGetScrollInfo(
 }
 
 static DWORD FASTCALL
-co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
+co_IntSetScrollInfo(PWND Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bRedraw)
 {
    /*
     * Update the scrollbar state and set action flags according to
@@ -420,10 +418,10 @@ co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bR
    if (bRedraw)
    {
       RECTL UpdateRect = psbi->rcScrollBar;
-      UpdateRect.left -= Window->Wnd->rcClient.left - Window->Wnd->rcWindow.left;
-      UpdateRect.right -= Window->Wnd->rcClient.left - Window->Wnd->rcWindow.left;
-      UpdateRect.top -= Window->Wnd->rcClient.top - Window->Wnd->rcWindow.top;
-      UpdateRect.bottom -= Window->Wnd->rcClient.top - Window->Wnd->rcWindow.top;
+      UpdateRect.left -= Window->rcClient.left - Window->rcWindow.left;
+      UpdateRect.right -= Window->rcClient.left - Window->rcWindow.left;
+      UpdateRect.top -= Window->rcClient.top - Window->rcWindow.top;
+      UpdateRect.bottom -= Window->rcClient.top - Window->rcWindow.top;
       co_UserRedrawWindow(Window, &UpdateRect, 0, RDW_INVALIDATE | RDW_FRAME);
    }
 
@@ -432,7 +430,7 @@ co_IntSetScrollInfo(PWINDOW_OBJECT Window, INT nBar, LPCSCROLLINFO lpsi, BOOL bR
 }
 
 BOOL FASTCALL
-co_IntGetScrollBarInfo(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi)
+co_IntGetScrollBarInfo(PWND Window, LONG idObject, PSCROLLBARINFO psbi)
 {
    INT Bar;
    PSCROLLBARINFO sbi;
@@ -466,7 +464,7 @@ co_IntGetScrollBarInfo(PWINDOW_OBJECT Window, LONG idObject, PSCROLLBARINFO psbi
 }
 
 BOOL FASTCALL
-co_IntCreateScrollBars(PWINDOW_OBJECT Window)
+co_IntCreateScrollBars(PWND Window)
 {
    PSCROLLBARINFO psbi;
    LPSCROLLINFO psi;
@@ -475,7 +473,7 @@ co_IntCreateScrollBars(PWINDOW_OBJECT Window)
 
    ASSERT_REFS_CO(Window);
 
-   if(Window->pSBInfo)
+   if(Window->pSBInfoex)
    {
       /* no need to create it anymore */
       return TRUE;
@@ -483,17 +481,17 @@ co_IntCreateScrollBars(PWINDOW_OBJECT Window)
 
    /* allocate memory for all scrollbars (HORZ, VERT, CONTROL) */
    Size = 3 * (sizeof(SBINFOEX));
-   if(!(Window->pSBInfo = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO)))
+   if(!(Window->pSBInfoex = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO)))
    {
-      DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window->hSelf);
+      DPRINT1("Unable to allocate memory for scrollbar information for window 0x%x\n", Window->head.h);
       return FALSE;
    }
 
-   RtlZeroMemory(Window->pSBInfo, Size);
+   RtlZeroMemory(Window->pSBInfoex, Size);
 
    co_WinPosGetNonClientSize(Window,
-                             &Window->Wnd->rcWindow,
-                             &Window->Wnd->rcClient);
+                             &Window->rcWindow,
+                             &Window->rcClient);
 
    for(s = SB_HORZ; s <= SB_VERT; s++)
    {
@@ -514,12 +512,12 @@ co_IntCreateScrollBars(PWINDOW_OBJECT Window)
 }
 
 BOOL FASTCALL
-IntDestroyScrollBars(PWINDOW_OBJECT Window)
+IntDestroyScrollBars(PWND Window)
 {
-   if(Window->pSBInfo)
+   if(Window->pSBInfoex)
    {
-      ExFreePool(Window->pSBInfo);
-      Window->pSBInfo = NULL;
+      ExFreePool(Window->pSBInfoex);
+      Window->pSBInfoex = NULL;
       return TRUE;
    }
    return FALSE;
@@ -570,7 +568,7 @@ NtUserGetScrollBarInfo(HWND hWnd, LONG idObject, PSCROLLBARINFO psbi)
 {
    NTSTATUS Status;
    SCROLLBARINFO sbi;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    BOOL Ret;
    DECLARE_RETURN(BOOL);
    USER_REFERENCE_ENTRY Ref;
@@ -620,7 +618,7 @@ NtUserSBGetParms(
   LPSCROLLINFO lpsi)
 {
    NTSTATUS Status;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    SCROLLINFO psi;
    DWORD sz;
    BOOL Ret;
@@ -677,7 +675,7 @@ NtUserEnableScrollBar(
    UINT wSBflags,
    UINT wArrows)
 {
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    PSCROLLBARINFO InfoV = NULL, InfoH = NULL;
    BOOL Chg = FALSE;
    DECLARE_RETURN(BOOL);
@@ -757,7 +755,7 @@ NtUserSetScrollBarInfo(
    LONG idObject,
    SETSCROLLBARINFO *info)
 {
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    SETSCROLLBARINFO Safeinfo;
    PSCROLLBARINFO sbi;
    LPSCROLLINFO psi;
@@ -821,7 +819,7 @@ NtUserSetScrollInfo(
    LPCSCROLLINFO lpsi,
    BOOL bRedraw)
 {
-   PWINDOW_OBJECT Window = NULL;
+   PWND Window = NULL;
    NTSTATUS Status;
    SCROLLINFO ScrollInfo;
    DECLARE_RETURN(DWORD);
@@ -857,14 +855,11 @@ CLEANUP:
 
 /* Ported from WINE20020904 (SCROLL_ShowScrollBar) */
 DWORD FASTCALL
-co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow)
+co_UserShowScrollBar(PWND Wnd, int wBar, DWORD bShow)
 {
    DWORD Style, OldStyle;
-   PWND Wnd;
 
-   ASSERT_REFS_CO(Window);
-
-   Wnd = Window->Wnd;
+   ASSERT_REFS_CO(Wnd);
 
    switch(wBar)
    {
@@ -885,16 +880,16 @@ co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow)
          return( FALSE);
    }
 
-   if(!co_IntCreateScrollBars(Window))
+   if(!co_IntCreateScrollBars(Wnd))
    {
       return( FALSE);
    }
 
    if (wBar == SB_CTL)
    {
-      IntUpdateSBInfo(Window, SB_CTL);
+      IntUpdateSBInfo(Wnd, SB_CTL);
 
-      co_WinPosShowWindow(Window, bShow ? SW_SHOW : SW_HIDE);
+      co_WinPosShowWindow(Wnd, bShow ? SW_SHOW : SW_HIDE);
       return( TRUE);
    }
 
@@ -907,14 +902,14 @@ co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow)
    if(Wnd->style != OldStyle)
    {
       if(Wnd->style & WS_HSCROLL)
-         IntUpdateSBInfo(Window, SB_HORZ);
+         IntUpdateSBInfo(Wnd, SB_HORZ);
       if(Wnd->style & WS_VSCROLL)
-         IntUpdateSBInfo(Window, SB_VERT);
+         IntUpdateSBInfo(Wnd, SB_VERT);
 
       if(Wnd->style & WS_VISIBLE)
       {
          /* Frame has been changed, let the window redraw itself */
-         co_WinPosSetWindowPos(Window, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
+         co_WinPosSetWindowPos(Wnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
                                SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOSENDCHANGING);
       }
    }
@@ -926,7 +921,7 @@ co_UserShowScrollBar(PWINDOW_OBJECT Window, int wBar, DWORD bShow)
 DWORD APIENTRY
 NtUserShowScrollBar(HWND hWnd, int wBar, DWORD bShow)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    DECLARE_RETURN(DWORD);
    DWORD ret;
    USER_REFERENCE_ENTRY Ref;
index 919072c..af97709 100644 (file)
@@ -230,7 +230,7 @@ NtUserCallOneParam(
 
       case ONEPARAM_ROUTINE_ISWINDOWINDESTROY:
          {
-            PWINDOW_OBJECT Window;
+            PWND Window;
             DWORD_PTR Result;
 
             if(!(Window = UserGetWindowObject((HWND)Param)))
@@ -377,7 +377,7 @@ NtUserCallTwoParam(
    DWORD Routine)
 {
    NTSTATUS Status;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    DECLARE_RETURN(DWORD_PTR);
 
    DPRINT("Enter NtUserCallTwoParam\n");
@@ -456,7 +456,7 @@ NtUserCallTwoParam(
           wParam = MAKEWPARAM((Param2 >> 3) & 0x3,
                               Param2 & (UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE));
 
-          RETURN( UserUpdateUiState(Window->Wnd, wParam) );
+          RETURN( UserUpdateUiState(Window, wParam) );
       }
 
       case TWOPARAM_ROUTINE_SWITCHTOTHISWINDOW:
@@ -496,22 +496,19 @@ NtUserCallHwndLock(
    DWORD Routine)
 {
    BOOL Ret = 0;
-   PWINDOW_OBJECT Window;
-   PWND Wnd;
+   PWND Window;
    USER_REFERENCE_ENTRY Ref;
    DECLARE_RETURN(BOOLEAN);
 
    DPRINT("Enter NtUserCallHwndLock\n");
    UserEnterExclusive();
 
-   if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+   if (!(Window = UserGetWindowObject(hWnd)))
    {
       RETURN( FALSE);
    }
    UserRefObjectCo(Window, &Ref);
 
-   Wnd = Window->Wnd;
-
    /* FIXME: Routine can be 0x53 - 0x5E */
    switch (Routine)
    {
@@ -523,7 +520,7 @@ NtUserCallHwndLock(
          {
             DPRINT("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
             Ret = TRUE;
-            if ((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
+            if ((Window->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
                co_WinPosSetWindowPos( Window,
                                       HWND_DESKTOP,
                                       0,0,0,0,
@@ -615,13 +612,13 @@ NtUserCallHwnd(
    {
       case HWND_ROUTINE_GETWNDCONTEXTHLPID:
       {
-         PWINDOW_OBJECT Window;
+         PWND Window;
          PPROPERTY HelpId;
          USER_REFERENCE_ENTRY Ref;
 
          UserEnterExclusive();
 
-         if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+         if (!(Window = UserGetWindowObject(hWnd)))
          {
             UserLeave();
             return 0;
@@ -664,7 +661,7 @@ NtUserCallHwndParam(
 
       case HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID:
       {
-         PWINDOW_OBJECT Window;
+         PWND Window;
 
          UserEnterExclusive();
          if(!(Window = UserGetWindowObject(hWnd)))
@@ -684,20 +681,18 @@ NtUserCallHwndParam(
 
       case HWNDPARAM_ROUTINE_SETDIALOGPOINTER:
       {
-         PWINDOW_OBJECT Window;
          PWND pWnd;
          USER_REFERENCE_ENTRY Ref;
 
          UserEnterExclusive();
 
-         if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+         if (!(pWnd = UserGetWindowObject(hWnd)))
          {
             UserLeave();
             return 0;
          }
-         UserRefObjectCo(Window, &Ref);
+         UserRefObjectCo(pWnd, &Ref);
 
-         pWnd = Window->Wnd;
          if (pWnd->head.pti->ppi == PsGetCurrentProcessWin32Process() &&
              pWnd->cbwndExtra == DLGWINDOWEXTRA && 
              !(pWnd->state & WNDS_SERVERSIDEWINDOWPROC))
@@ -714,7 +709,7 @@ NtUserCallHwndParam(
             }
          }
          
-         UserDerefObjectCo(Window);
+         UserDerefObjectCo(pWnd);
          UserLeave();
          return 0;
       }
@@ -733,14 +728,14 @@ NtUserCallHwndParamLock(
    DWORD Routine)
 {
    DWORD Ret = 0;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    USER_REFERENCE_ENTRY Ref;
    DECLARE_RETURN(DWORD);
 
    DPRINT1("Enter NtUserCallHwndParamLock\n");
    UserEnterExclusive();
 
-   if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+   if (!(Window = UserGetWindowObject(hWnd)))
    {
       RETURN( FALSE);
    }
index 74bfe76..f9d83d6 100644 (file)
@@ -114,7 +114,7 @@ RemoveTimer(PTIMER pTmr)
 
 PTIMER
 FASTCALL
-FindTimer(PWINDOW_OBJECT Window,
+FindTimer(PWND Window,
           UINT_PTR nID,
           UINT flags)
 {
@@ -194,7 +194,7 @@ ValidateTimerCallback(PTHREADINFO pti,
 }
 
 UINT_PTR FASTCALL
-IntSetTimer( PWINDOW_OBJECT Window,
+IntSetTimer( PWND Window,
                   UINT_PTR IDEvent,
                   UINT Elapse,
                   TIMERPROC TimerFunc,
@@ -262,7 +262,7 @@ IntSetTimer( PWINDOW_OBJECT Window,
      if (!pTmr) return 0;
 
      if (Window && (Type & TMRF_TIFROMWND))
-        pTmr->pti = Window->pti->pEThread->Tcb.Win32Thread;
+        pTmr->pti = Window->head.pti->pEThread->Tcb.Win32Thread;
      else
      {
         if (Type & TMRF_RIT)
@@ -316,12 +316,12 @@ StartTheTimers(VOID)
 
 UINT_PTR
 FASTCALL
-SystemTimerSet( PWINDOW_OBJECT Window,
+SystemTimerSet( PWND Window,
                 UINT_PTR nIDEvent,
                 UINT uElapse,
                 TIMERPROC lpTimerFunc)
 {
-  if (Window && Window->pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
+  if (Window && Window->head.pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
   {
      SetLastWin32Error(ERROR_ACCESS_DENIED);
      DPRINT("SysemTimerSet: Access Denied!\n");
@@ -332,7 +332,7 @@ SystemTimerSet( PWINDOW_OBJECT Window,
 
 BOOL
 FASTCALL
-PostTimerMessages(PWINDOW_OBJECT Window)
+PostTimerMessages(PWND Window)
 {
   PLIST_ENTRY pLE;
   PUSER_MESSAGE_QUEUE ThreadQueue;
@@ -354,7 +354,7 @@ PostTimerMessages(PWINDOW_OBJECT Window)
           (pTmr->pti == pti) &&
           ((pTmr->pWnd == Window) || (Window == NULL)) )
         {
-           Msg.hwnd    = (pTmr->pWnd) ? pTmr->pWnd->hSelf : 0;
+           Msg.hwnd    = (pTmr->pWnd) ? pTmr->pWnd->head.h : 0;
            Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER;
            Msg.wParam  = (WPARAM) pTmr->nID;
            Msg.lParam  = (LPARAM) pTmr->pfn;
@@ -455,7 +455,7 @@ ProcessTimers(VOID)
 }
 
 BOOL FASTCALL
-DestroyTimersForWindow(PTHREADINFO pti, PWINDOW_OBJECT Window)
+DestroyTimersForWindow(PTHREADINFO pti, PWND Window)
 {
    PLIST_ENTRY pLE;
    PTIMER pTmr = FirstpTmr;
@@ -509,7 +509,7 @@ DestroyTimersForThread(PTHREADINFO pti)
 }
 
 BOOL FASTCALL
-IntKillTimer(PWINDOW_OBJECT Window, UINT_PTR IDEvent, BOOL SystemTimer)
+IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
 {
    PTIMER pTmr = NULL;
    DPRINT("IntKillTimer Window %x id %p systemtimer %s\n",
@@ -561,7 +561,7 @@ NtUserSetTimer
    TIMERPROC lpTimerFunc
 )
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    DECLARE_RETURN(UINT_PTR);
 
    DPRINT("Enter NtUserSetTimer\n");
@@ -586,7 +586,7 @@ NtUserKillTimer
    UINT_PTR uIDEvent
 )
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    DECLARE_RETURN(BOOL);
 
    DPRINT("Enter NtUserKillTimer\n");
index d82e384..0bf5dc8 100644 (file)
 
 HRGN FASTCALL
 VIS_ComputeVisibleRegion(
-   PWINDOW_OBJECT Window,
+   PWND Wnd,
    BOOLEAN ClientArea,
    BOOLEAN ClipChildren,
    BOOLEAN ClipSiblings)
 {
    HRGN VisRgn, ClipRgn;
-   PWINDOW_OBJECT PreviousWindow, CurrentWindow, CurrentSibling;
-   PWND Wnd, CurrentWnd, PreviousWnd, CurrentSiblingWnd;
-
-   Wnd = Window->Wnd;
+   PWND PreviousWindow, CurrentWindow, CurrentSibling;
 
    if (!Wnd || !(Wnd->style & WS_VISIBLE))
    {
@@ -51,11 +48,11 @@ VIS_ComputeVisibleRegion(
 
    if (ClientArea)
    {
-      VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
+      VisRgn = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
    }
    else
    {
-      VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+      VisRgn = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
    }
 
    /*
@@ -64,49 +61,45 @@ VIS_ComputeVisibleRegion(
     * our window.
     */
 
-   PreviousWindow = Window;
-   PreviousWnd = PreviousWindow->Wnd;
-   CurrentWindow = Window->spwndParent;
+   PreviousWindow = Wnd;
+   CurrentWindow = Wnd->spwndParent;
    while (CurrentWindow)
    {
-      if ( CurrentWindow->state & WINDOWSTATUS_DESTROYING || // state2
-           CurrentWindow->state & WINDOWSTATUS_DESTROYED )
+      if ( CurrentWindow->state2 & WNDS2_INDESTROY ||
+           CurrentWindow->state & WNDS_DESTROYED )
       {
          DPRINT1("ATM the Current Window or Parent is dead!\n");
          if (VisRgn) REGION_FreeRgnByHandle(VisRgn);
          return NULL;
       }
 
-      CurrentWnd = CurrentWindow->Wnd;
-      if (!CurrentWnd || !(CurrentWnd->style & WS_VISIBLE))
+      if (!(CurrentWindow->style & WS_VISIBLE))
       {
          if (VisRgn) REGION_FreeRgnByHandle(VisRgn);
          return NULL;
       }
 
-      ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWnd->rcClient);
+      ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWindow->rcClient);
       NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_AND);
       REGION_FreeRgnByHandle(ClipRgn);
 
-      if ((PreviousWnd->style & WS_CLIPSIBLINGS) ||
-          (PreviousWnd == Wnd && ClipSiblings))
+      if ((PreviousWindow->style & WS_CLIPSIBLINGS) ||
+          (PreviousWindow == Wnd && ClipSiblings))
       {
          CurrentSibling = CurrentWindow->spwndChild;
          while ( CurrentSibling != NULL && 
-                 CurrentSibling != PreviousWindow &&
-                 CurrentSibling->Wnd )
+                 CurrentSibling != PreviousWindow )
          {
-            CurrentSiblingWnd = CurrentSibling->Wnd;
-            if ((CurrentSiblingWnd->style & WS_VISIBLE) &&
-                !(CurrentSiblingWnd->ExStyle & WS_EX_TRANSPARENT))
+            if ((CurrentSibling->style & WS_VISIBLE) &&
+                !(CurrentSibling->ExStyle & WS_EX_TRANSPARENT))
             {
-               ClipRgn = IntSysCreateRectRgnIndirect(&CurrentSiblingWnd->rcWindow);
+               ClipRgn = IntSysCreateRectRgnIndirect(&CurrentSibling->rcWindow);
                /* Combine it with the window region if available */
-               if (CurrentSibling->hrgnClip && !(CurrentSiblingWnd->style & WS_MINIMIZE))
+               if (CurrentSibling->hrgnClip && !(CurrentSibling->style & WS_MINIMIZE))
                {
-                  NtGdiOffsetRgn(ClipRgn, -CurrentSiblingWnd->rcWindow.left, -CurrentSiblingWnd->rcWindow.top);
+                  NtGdiOffsetRgn(ClipRgn, -CurrentSibling->rcWindow.left, -CurrentSibling->rcWindow.top);
                   NtGdiCombineRgn(ClipRgn, ClipRgn, CurrentSibling->hrgnClip, RGN_AND);
-                  NtGdiOffsetRgn(ClipRgn, CurrentSiblingWnd->rcWindow.left, CurrentSiblingWnd->rcWindow.top);
+                  NtGdiOffsetRgn(ClipRgn, CurrentSibling->rcWindow.left, CurrentSibling->rcWindow.top);
                }
                NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
                REGION_FreeRgnByHandle(ClipRgn);
@@ -116,26 +109,24 @@ VIS_ComputeVisibleRegion(
       }
 
       PreviousWindow = CurrentWindow;
-      PreviousWnd = PreviousWindow->Wnd;
       CurrentWindow = CurrentWindow->spwndParent;
    }
 
    if (ClipChildren)
    {
-      CurrentWindow = Window->spwndChild;
-      while (CurrentWindow && CurrentWindow->Wnd)
+      CurrentWindow = Wnd->spwndChild;
+      while (CurrentWindow)
       {
-         CurrentWnd = CurrentWindow->Wnd;
-         if ((CurrentWnd->style & WS_VISIBLE) &&
-             !(CurrentWnd->ExStyle & WS_EX_TRANSPARENT))
+         if ((CurrentWindow->style & WS_VISIBLE) &&
+             !(CurrentWindow->ExStyle & WS_EX_TRANSPARENT))
          {
-            ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWnd->rcWindow);
+            ClipRgn = IntSysCreateRectRgnIndirect(&CurrentWindow->rcWindow);
             /* Combine it with the window region if available */
-            if (CurrentWindow->hrgnClip && !(CurrentWnd->style & WS_MINIMIZE))
+            if (CurrentWindow->hrgnClip && !(CurrentWindow->style & WS_MINIMIZE))
             {
-               NtGdiOffsetRgn(ClipRgn, -CurrentWnd->rcWindow.left, -CurrentWnd->rcWindow.top);
+               NtGdiOffsetRgn(ClipRgn, -CurrentWindow->rcWindow.left, -CurrentWindow->rcWindow.top);
                NtGdiCombineRgn(ClipRgn, ClipRgn, CurrentWindow->hrgnClip, RGN_AND);
-               NtGdiOffsetRgn(ClipRgn, CurrentWnd->rcWindow.left, CurrentWnd->rcWindow.top);
+               NtGdiOffsetRgn(ClipRgn, CurrentWindow->rcWindow.left, CurrentWindow->rcWindow.top);
             }
             NtGdiCombineRgn(VisRgn, VisRgn, ClipRgn, RGN_DIFF);
             REGION_FreeRgnByHandle(ClipRgn);
@@ -144,10 +135,10 @@ VIS_ComputeVisibleRegion(
       }
    }
 
-   if (Window->hrgnClip && !(Wnd->style & WS_MINIMIZE))
+   if (Wnd->hrgnClip && !(Wnd->style & WS_MINIMIZE))
    {
       NtGdiOffsetRgn(VisRgn, -Wnd->rcWindow.left, -Wnd->rcWindow.top);
-      NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND);
+      NtGdiCombineRgn(VisRgn, VisRgn, Wnd->hrgnClip, RGN_AND);
       NtGdiOffsetRgn(VisRgn, Wnd->rcWindow.left, Wnd->rcWindow.top);
    }
 
@@ -156,28 +147,24 @@ VIS_ComputeVisibleRegion(
 
 VOID FASTCALL
 co_VIS_WindowLayoutChanged(
-   PWINDOW_OBJECT Window,
+   PWND Wnd,
    HRGN NewlyExposed)
 {
    HRGN Temp;
-   PWINDOW_OBJECT Parent;
+   PWND Parent;
    USER_REFERENCE_ENTRY Ref;
-   PWND Wnd, ParentWnd;
-
-   ASSERT_REFS_CO(Window);
 
-   Wnd = Window->Wnd;
+   ASSERT_REFS_CO(Wnd);
 
    Temp = IntSysCreateRectRgn(0, 0, 0, 0);
    NtGdiCombineRgn(Temp, NewlyExposed, NULL, RGN_COPY);
 
-   Parent = Window->spwndParent;
+   Parent = Wnd->spwndParent;
    if(Parent)
    {
-      ParentWnd = Parent->Wnd;
       NtGdiOffsetRgn(Temp,
-                     Wnd->rcWindow.left - ParentWnd->rcClient.left,
-                     Wnd->rcWindow.top - ParentWnd->rcClient.top);
+                     Wnd->rcWindow.left - Parent->rcClient.left,
+                     Wnd->rcWindow.top - Parent->rcClient.top);
 
       UserRefObjectCo(Parent, &Ref);
       co_UserRedrawWindow(Parent, NULL, Temp,
index ed49ac6..e6b3cfa 100644 (file)
@@ -59,7 +59,7 @@ DceCreateDisplayDC(VOID)
 
 static
 HRGN FASTCALL
-DceGetVisRgn(PWINDOW_OBJECT Window, ULONG Flags, HWND hWndChild, ULONG CFlags)
+DceGetVisRgn(PWND Window, ULONG Flags, HWND hWndChild, ULONG CFlags)
 {
   HRGN VisRgn;
 
@@ -75,12 +75,9 @@ DceGetVisRgn(PWINDOW_OBJECT Window, ULONG Flags, HWND hWndChild, ULONG CFlags)
 }
 
 PDCE FASTCALL
-DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type)
+DceAllocDCE(PWND Window OPTIONAL, DCE_TYPE Type)
 {
   PDCE pDce;
-  PWND Wnd = NULL;
-
-  if (Window) Wnd = Window->Wnd;
 
   pDce = ExAllocatePoolWithTag(PagedPool, sizeof(DCE), TAG_PDCE);
   if(!pDce)
@@ -94,9 +91,9 @@ DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type)
   }
   DCECount++;
   DPRINT("Alloc DCE's! %d\n",DCECount);
-  pDce->hwndCurrent = (Window ? Window->hSelf : NULL);
-  pDce->pwndOrg  = Wnd;
-  pDce->pwndClip = Wnd;
+  pDce->hwndCurrent = (Window ? Window->head.h : NULL);
+  pDce->pwndOrg  = Window;
+  pDce->pwndClip = Window;
   pDce->hrgnClip = NULL;
   pDce->hrgnClipPublic = NULL;
   pDce->hrgnSavedVis = NULL;
@@ -124,12 +121,12 @@ DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type)
   else
   {
      pDce->DCXFlags = DCX_DCEBUSY;
-     if (Wnd)
+     if (Window)
      {
         if (Type == DCE_WINDOW_DC)
         {
-          if (Wnd->style & WS_CLIPCHILDREN) pDce->DCXFlags |= DCX_CLIPCHILDREN;
-          if (Wnd->style & WS_CLIPSIBLINGS) pDce->DCXFlags |= DCX_CLIPSIBLINGS;
+          if (Window->style & WS_CLIPCHILDREN) pDce->DCXFlags |= DCX_CLIPCHILDREN;
+          if (Window->style & WS_CLIPSIBLINGS) pDce->DCXFlags |= DCX_CLIPSIBLINGS;
         }
      }
   }
@@ -137,12 +134,11 @@ DceAllocDCE(PWINDOW_OBJECT Window OPTIONAL, DCE_TYPE Type)
 }
 
 static VOID APIENTRY
-DceSetDrawable( PWINDOW_OBJECT Window OPTIONAL,
+DceSetDrawable( PWND Window OPTIONAL,
                 HDC hDC,
                 ULONG Flags,
                 BOOL SetClipOrigin)
 {
-  PWND Wnd;
   DC *dc = DC_LockDc(hDC);
   if(!dc)
       return;
@@ -154,16 +150,15 @@ DceSetDrawable( PWINDOW_OBJECT Window OPTIONAL,
   }
   else
   {
-      Wnd = Window->Wnd;
       if (Flags & DCX_WINDOW)
       {
-         dc->ptlDCOrig.x = Wnd->rcWindow.left;
-         dc->ptlDCOrig.y = Wnd->rcWindow.top;
+         dc->ptlDCOrig.x = Window->rcWindow.left;
+         dc->ptlDCOrig.y = Window->rcWindow.top;
       }
       else
       {
-         dc->ptlDCOrig.x = Wnd->rcClient.left;
-         dc->ptlDCOrig.y = Wnd->rcClient.top;
+         dc->ptlDCOrig.x = Window->rcClient.left;
+         dc->ptlDCOrig.y = Window->rcClient.top;
       }
   }
   DC_UnlockDc(dc);
@@ -254,16 +249,15 @@ DceReleaseDC(DCE* dce, BOOL EndPaint)
 }
 
 static VOID FASTCALL
-DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
+DceUpdateVisRgn(DCE *Dce, PWND Window, ULONG Flags)
 {
    HANDLE hRgnVisible = NULL;
    ULONG DcxFlags;
-   PWINDOW_OBJECT DesktopWindow;
+   PWND DesktopWindow;
 
    if (Flags & DCX_PARENTCLIP)
    {
-      PWINDOW_OBJECT Parent;
-      PWND ParentWnd;
+      PWND Parent;
 
       Parent = Window->spwndParent;
       if(!Parent)
@@ -272,9 +266,7 @@ DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
          goto noparent;
       }
 
-      ParentWnd = Parent->Wnd;
-
-      if (ParentWnd->style & WS_CLIPSIBLINGS)
+      if (Parent->style & WS_CLIPSIBLINGS)
       {
          DcxFlags = DCX_CLIPSIBLINGS |
                     (Flags & ~(DCX_CLIPCHILDREN | DCX_WINDOW));
@@ -283,14 +275,14 @@ DceUpdateVisRgn(DCE *Dce, PWINDOW_OBJECT Window, ULONG Flags)
       {
          DcxFlags = Flags & ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW);
       }
-      hRgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->hSelf, Flags);
+      hRgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->head.h, Flags);
    }
    else if (Window == NULL)
    {
       DesktopWindow = UserGetWindowObject(IntGetDesktopWindow());
       if (NULL != DesktopWindow)
       {
-         hRgnVisible = IntSysCreateRectRgnIndirect(&DesktopWindow->Wnd->rcWindow);
+         hRgnVisible = IntSysCreateRectRgnIndirect(&DesktopWindow->rcWindow);
       }
       else
       {
@@ -338,24 +330,21 @@ noparent:
 }
 
 HDC FASTCALL
-UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
+UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
 {
-   PWINDOW_OBJECT Parent;
+   PWND Parent;
    ULONG DcxFlags;
    DCE* Dce = NULL;
    BOOL UpdateClipOrigin = FALSE;
-   PWND Wnd = NULL;
    HDC hDC = NULL;
    PPROCESSINFO ppi;
    PLIST_ENTRY pLE;
 
-   if (NULL == Window)
+   if (NULL == Wnd)
    {
       Flags &= ~DCX_USESTYLE;
       Flags |= DCX_CACHE;
    }
-   else
-       Wnd = Window->Wnd;
 
    if (Flags & (DCX_WINDOW | DCX_PARENTCLIP)) Flags |= DCX_CACHE;
 
@@ -420,9 +409,9 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
       Flags &= ~(DCX_PARENTCLIP | DCX_CLIPCHILDREN);
    }
 
-   Parent = (Window ? Window->spwndParent : NULL);
+   Parent = (Wnd ? Wnd->spwndParent : NULL);
 
-   if (NULL == Window || !(Wnd->style & WS_CHILD) || NULL == Parent)
+   if (NULL == Wnd || !(Wnd->style & WS_CHILD) || NULL == Parent)
    {
       Flags &= ~DCX_PARENTCLIP;
       Flags |= DCX_CLIPSIBLINGS;
@@ -434,10 +423,10 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
    if (Flags & DCX_PARENTCLIP)
    {
       if ((Wnd->style & WS_VISIBLE) &&
-          (Parent->Wnd->style & WS_VISIBLE))
+          (Parent->style & WS_VISIBLE))
       {
          Flags &= ~DCX_CLIPCHILDREN;
-         if (Parent->Wnd->style & WS_CLIPSIBLINGS)
+         if (Parent->style & WS_CLIPSIBLINGS)
          {
             Flags |= DCX_CLIPSIBLINGS;
          }
@@ -478,7 +467,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
             {
                DceEmpty = Dce;
             }
-            else if (Dce->hwndCurrent == (Window ? Window->hSelf : NULL) &&
+            else if (Dce->hwndCurrent == (Wnd ? Wnd->head.h : NULL) &&
                      ((Dce->DCXFlags & DCX_CACHECOMPAREMASK) == DcxFlags))
             {
                UpdateClipOrigin = TRUE;
@@ -499,7 +488,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
       }
       if (!Dce) return NULL;
 
-      Dce->hwndCurrent = (Window ? Window->hSelf : NULL);
+      Dce->hwndCurrent = (Wnd ? Wnd->head.h : NULL);
    }
    else // If we are here, we are POWNED or having CLASS.
    {
@@ -508,7 +497,7 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
       Dce = CONTAINING_RECORD(pLE, DCE, List);
       do
       {   // Check for Window handle than HDC match for CLASS.
-          if ((Dce->hwndCurrent == Window->hSelf) ||
+          if ((Dce->hwndCurrent == Wnd->head.h) ||
               (Dce->hDC == hDC))
              break;
           pLE = Dce->List.Flink;
@@ -556,18 +545,18 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
    {
       Flags |= DCX_INTERSECTRGN | DCX_KEEPCLIPRGN;
       Dce->DCXFlags |= DCX_INTERSECTRGN | DCX_KEEPCLIPRGN;
-      ClipRegion = Window->hrgnUpdate;
+      ClipRegion = Wnd->hrgnUpdate;
    }
 
    if (ClipRegion == (HRGN) 1)
    {
       if (!(Flags & DCX_WINDOW))
       {
-         Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Window->Wnd->rcClient);
+         Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Wnd->rcClient);
       }
       else
       {
-         Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
+         Dce->hrgnClip = IntSysCreateRectRgnIndirect(&Wnd->rcWindow);
       }
       Dce->DCXFlags &= ~DCX_KEEPCLIPRGN;
    }
@@ -582,9 +571,9 @@ UserGetDCEx(PWINDOW_OBJECT Window OPTIONAL, HANDLE ClipRegion, ULONG Flags)
       Dce->hrgnClip = ClipRegion;
    }
 
-   DceSetDrawable(Window, Dce->hDC, Flags, UpdateClipOrigin);
+   DceSetDrawable(Wnd, Dce->hDC, Flags, UpdateClipOrigin);
 
-   DceUpdateVisRgn(Dce, Window, Flags);
+   DceUpdateVisRgn(Dce, Wnd, Flags);
 
    if (Dce->DCXFlags & DCX_CACHE)
    {
@@ -679,7 +668,7 @@ DceFreeDCE(PDCE pdce, BOOLEAN Force)
  * Remove owned DCE and reset unreleased cache DCEs.
  */
 void FASTCALL
-DceFreeWindowDCE(PWINDOW_OBJECT Window)
+DceFreeWindowDCE(PWND Window)
 {
   PDCE pDCE;
   PLIST_ENTRY pLE;
@@ -704,12 +693,12 @@ DceFreeWindowDCE(PWINDOW_OBJECT Window)
         DPRINT1("FreeWindowDCE List is Empty!!!!\n");
         break;
      }
-     if ( pDCE->hwndCurrent == Window->hSelf &&
+     if ( pDCE->hwndCurrent == Window->head.h &&
           !(pDCE->DCXFlags & DCX_DCEEMPTY) )
      {
         if (!(pDCE->DCXFlags & DCX_CACHE)) /* owned or Class DCE*/
         {
-           if (Window->Wnd->pcls->style & CS_CLASSDC) /* Test Class first */
+           if (Window->pcls->style & CS_CLASSDC) /* Test Class first */
            {
               if (pDCE->DCXFlags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) /* Class DCE*/
                  DceDeleteClipRgn(pDCE);
@@ -727,7 +716,7 @@ DceFreeWindowDCE(PWINDOW_OBJECT Window)
               }
               /* Do not change owner so thread can clean up! */
            }
-           else if (Window->Wnd->pcls->style & CS_OWNDC) /* owned DCE*/
+           else if (Window->pcls->style & CS_OWNDC) /* owned DCE*/
            {
               pDCE = DceFreeDCE(pDCE, FALSE);
               if (!pDCE) break;
@@ -750,7 +739,7 @@ DceFreeWindowDCE(PWINDOW_OBJECT Window)
                * We should change this to DPRINT when ReactOS is more stable
                * (for 1.0?).
                */
-              DPRINT1("[%p] GetDC() without ReleaseDC()!\n", Window->hSelf);
+              DPRINT1("[%p] GetDC() without ReleaseDC()!\n", Window->head.h);
               DceReleaseDC(pDCE, FALSE);
            }
            pDCE->DCXFlags |= DCX_DCEEMPTY;
@@ -830,11 +819,11 @@ DceEmptyCache(VOID)
 }
 
 VOID FASTCALL
-DceResetActiveDCEs(PWINDOW_OBJECT Window)
+DceResetActiveDCEs(PWND Window)
 {
    DCE *pDCE;
    PDC dc;
-   PWINDOW_OBJECT CurrentWindow;
+   PWND CurrentWindow;
    INT DeltaX;
    INT DeltaY;
    PLIST_ENTRY pLE;
@@ -852,7 +841,7 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window)
       if(pLE == &LEDce) break;
       if (0 == (pDCE->DCXFlags & (DCX_DCEEMPTY|DCX_INDESTROY)))
       {
-         if (Window->hSelf == pDCE->hwndCurrent)
+         if (Window->head.h == pDCE->hwndCurrent)
          {
             CurrentWindow = Window;
          }
@@ -878,17 +867,17 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window)
          {
             if (pDCE->DCXFlags & DCX_WINDOW)
             {
-               DeltaX = CurrentWindow->Wnd->rcWindow.left - dc->ptlDCOrig.x;
-               DeltaY = CurrentWindow->Wnd->rcWindow.top - dc->ptlDCOrig.y;
-               dc->ptlDCOrig.x = CurrentWindow->Wnd->rcWindow.left;
-               dc->ptlDCOrig.y = CurrentWindow->Wnd->rcWindow.top;
+               DeltaX = CurrentWindow->rcWindow.left - dc->ptlDCOrig.x;
+               DeltaY = CurrentWindow->rcWindow.top - dc->ptlDCOrig.y;
+               dc->ptlDCOrig.x = CurrentWindow->rcWindow.left;
+               dc->ptlDCOrig.y = CurrentWindow->rcWindow.top;
             }
             else
             {
-               DeltaX = CurrentWindow->Wnd->rcClient.left - dc->ptlDCOrig.x;
-               DeltaY = CurrentWindow->Wnd->rcClient.top - dc->ptlDCOrig.y;
-               dc->ptlDCOrig.x = CurrentWindow->Wnd->rcClient.left;
-               dc->ptlDCOrig.y = CurrentWindow->Wnd->rcClient.top;
+               DeltaX = CurrentWindow->rcClient.left - dc->ptlDCOrig.x;
+               DeltaY = CurrentWindow->rcClient.top - dc->ptlDCOrig.y;
+               dc->ptlDCOrig.x = CurrentWindow->rcClient.left;
+               dc->ptlDCOrig.y = CurrentWindow->rcClient.top;
             }
             if (NULL != dc->rosdc.hClipRgn)
             {
@@ -904,7 +893,7 @@ DceResetActiveDCEs(PWINDOW_OBJECT Window)
 
          DceUpdateVisRgn(pDCE, CurrentWindow, pDCE->DCXFlags);
 
-         if (Window->hSelf != pDCE->hwndCurrent)
+         if (Window->head.h != pDCE->hwndCurrent)
          {
 //            IntEngWindowChanged(CurrentWindow, WOC_RGN_CLIENT);
 //            UserDerefObject(CurrentWindow);
@@ -943,7 +932,7 @@ IntWindowFromDC(HDC hDc)
 }
 
 INT FASTCALL
-UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint)
+UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
 {
   PDCE dce;
   PLIST_ENTRY pLE;
@@ -975,7 +964,7 @@ UserReleaseDC(PWINDOW_OBJECT Window, HDC hDc, BOOL EndPaint)
 }
 
 HDC FASTCALL
-UserGetWindowDC(PWINDOW_OBJECT Wnd)
+UserGetWindowDC(PWND Wnd)
 {
   return UserGetDCEx(Wnd, 0, DCX_USESTYLE | DCX_WINDOW);
 }
@@ -984,7 +973,7 @@ HWND FASTCALL
 UserGethWnd( HDC hdc, PWNDOBJ *pwndo)
 {
   PWNDGDI pWndgdi;
-  PWINDOW_OBJECT Wnd;
+  PWND Wnd;
   HWND hWnd;
 
   hWnd = IntWindowFromDC(hdc);
@@ -1004,7 +993,7 @@ UserGethWnd( HDC hdc, PWNDOBJ *pwndo)
 HDC APIENTRY
 NtUserGetDCEx(HWND hWnd OPTIONAL, HANDLE ClipRegion, ULONG Flags)
 {
-  PWINDOW_OBJECT Wnd=NULL;
+  PWND Wnd=NULL;
   DECLARE_RETURN(HDC);
 
   DPRINT("Enter NtUserGetDCEx\n");
index 8f81fe0..0812cf8 100644 (file)
@@ -84,9 +84,9 @@ BOOL FASTCALL UserUpdateUiState(PWND Wnd, WPARAM wParam)
     return TRUE;
 }
 
-PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd)
+PWND FASTCALL IntGetWindowObject(HWND hWnd)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
 
    if (!hWnd) return NULL;
 
@@ -96,17 +96,15 @@ PWINDOW_OBJECT FASTCALL IntGetWindowObject(HWND hWnd)
       ASSERT(Window->head.cLockObj >= 0);
 
       Window->head.cLockObj++;
-
-      ASSERT(Window->Wnd);
    }
    return Window;
 }
 
 /* temp hack */
-PWINDOW_OBJECT FASTCALL UserGetWindowObject(HWND hWnd)
+PWND FASTCALL UserGetWindowObject(HWND hWnd)
 {
    PTHREADINFO ti;
-   PWINDOW_OBJECT Window;
+   PWND Window;
 
    if (PsGetCurrentProcess() != PsInitialSystemProcess)
    {
@@ -124,8 +122,8 @@ PWINDOW_OBJECT FASTCALL UserGetWindowObject(HWND hWnd)
       return NULL;
    }
 
-   Window = (PWINDOW_OBJECT)UserGetObject(gHandleTable, hWnd, otWindow);
-   if (!Window || 0 != (Window->state & WINDOWSTATUS_DESTROYED))
+   Window = (PWND)UserGetObject(gHandleTable, hWnd, otWindow);
+   if (!Window || 0 != (Window->state & WNDS_DESTROYED))
    {
       SetLastWin32Error(ERROR_INVALID_WINDOW_HANDLE);
       return NULL;
@@ -133,8 +131,6 @@ PWINDOW_OBJECT FASTCALL UserGetWindowObject(HWND hWnd)
 
    ASSERT(Window->head.cLockObj >= 0);
 
-   ASSERT(Window->Wnd);
-
    return Window;
 }
 
@@ -158,7 +154,7 @@ PWINDOW_OBJECT FASTCALL UserGetWindowObject(HWND hWnd)
 BOOL FASTCALL
 IntIsWindow(HWND hWnd)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
 
    if (!(Window = UserGetWindowObject(hWnd)))
       return FALSE;
@@ -168,14 +164,14 @@ IntIsWindow(HWND hWnd)
 
 
 
-PWINDOW_OBJECT FASTCALL
-IntGetParent(PWINDOW_OBJECT Wnd)
+PWND FASTCALL
+IntGetParent(PWND Wnd)
 {
-   if (Wnd->Wnd->style & WS_POPUP)
+   if (Wnd->style & WS_POPUP)
    {
        return Wnd->spwndOwner;
    }
-   else if (Wnd->Wnd->style & WS_CHILD)
+   else if (Wnd->style & WS_CHILD)
    {
       return Wnd->spwndParent;
    }
@@ -195,9 +191,9 @@ IntGetParent(PWINDOW_OBJECT Wnd)
  */
 
 HWND* FASTCALL
-IntWinListChildren(PWINDOW_OBJECT Window)
+IntWinListChildren(PWND Window)
 {
-   PWINDOW_OBJECT Child;
+   PWND Child;
    HWND *List;
    UINT Index, NumChildren = 0;
 
@@ -216,7 +212,7 @@ IntWinListChildren(PWINDOW_OBJECT Window)
    for (Child = Window->spwndChild, Index = 0;
          Child != NULL;
          Child = Child->spwndNext, ++Index)
-      List[Index] = Child->hSelf;
+      List[Index] = Child->head.h;
    List[Index] = NULL;
 
    return List;
@@ -228,7 +224,7 @@ IntWinListChildren(PWINDOW_OBJECT Window)
 static void IntSendDestroyMsg(HWND hWnd)
 {
 
-   PWINDOW_OBJECT Window;
+   PWND Window;
 #if 0 /* FIXME */
 
    GUITHREADINFO info;
@@ -297,17 +293,16 @@ static void IntSendDestroyMsg(HWND hWnd)
 }
 
 static VOID
-UserFreeWindowInfo(PTHREADINFO ti, PWINDOW_OBJECT WindowObject)
+UserFreeWindowInfo(PTHREADINFO ti, PWND Wnd)
 {
     PCLIENTINFO ClientInfo = GetWin32ClientInfo();
-    PWND Wnd = WindowObject->Wnd;
 
     if (!Wnd) return;
     
-    if (ClientInfo->CallbackWnd.pvWnd == DesktopHeapAddressToUser(WindowObject->Wnd))
+    if (ClientInfo->CallbackWnd.pWnd == DesktopHeapAddressToUser(Wnd))
     {
         ClientInfo->CallbackWnd.hWnd = NULL;
-        ClientInfo->CallbackWnd.pvWnd = NULL;
+        ClientInfo->CallbackWnd.pWnd = NULL;
     }
 
    if (Wnd->strName.Buffer != NULL)
@@ -319,8 +314,8 @@ UserFreeWindowInfo(PTHREADINFO ti, PWINDOW_OBJECT WindowObject)
        Wnd->strName.Buffer = NULL;
    }
 
-    DesktopHeapFree(Wnd->head.rpdesk, Wnd);
-    WindowObject->Wnd = NULL;
+//    DesktopHeapFree(Wnd->head.rpdesk, Wnd);
+//    WindowObject->Wnd = NULL;
 }
 
 /***********************************************************************
@@ -332,31 +327,28 @@ UserFreeWindowInfo(PTHREADINFO ti, PWINDOW_OBJECT WindowObject)
  * done in CreateWindow is undone here and not in DestroyWindow:-P
 
  */
-static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
+static LRESULT co_UserFreeWindow(PWND Window,
                                    PPROCESSINFO ProcessData,
                                    PTHREADINFO ThreadData,
                                    BOOLEAN SendMessages)
 {
    HWND *Children;
    HWND *ChildHandle;
-   PWINDOW_OBJECT Child;
+   PWND Child;
    PMENU_OBJECT Menu;
    BOOLEAN BelongsToThreadData;
-   PWND Wnd;
 
    ASSERT(Window);
 
-   Wnd = Window->Wnd;
-
-   if(Window->state & WINDOWSTATUS_DESTROYING)
+   if(Window->state2 & WNDS2_INDESTROY)
    {
       DPRINT("Tried to call IntDestroyWindow() twice\n");
       return 0;
    }
-   Window->state |= WINDOWSTATUS_DESTROYING;
-   Wnd->style &= ~WS_VISIBLE;
+   Window->state2 |= WNDS2_INDESTROY;
+   Window->style &= ~WS_VISIBLE;
 
-   IntNotifyWinEvent(EVENT_OBJECT_DESTROY, Wnd, OBJID_WINDOW, 0);
+   IntNotifyWinEvent(EVENT_OBJECT_DESTROY, Window, OBJID_WINDOW, 0);
 
    /* remove the window already at this point from the thread window list so we
       don't get into trouble when destroying the thread windows while we're still
@@ -365,12 +357,12 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
 
    BelongsToThreadData = IntWndBelongsToThread(Window, ThreadData);
 
-   IntDeRegisterShellHookWindow(Window->hSelf);
+   IntDeRegisterShellHookWindow(Window->head.h);
 
    if(SendMessages)
    {
       /* Send destroy messages */
-      IntSendDestroyMsg(Window->hSelf);
+      IntSendDestroyMsg(Window->head.h);
    }
 
    /* free child windows */
@@ -384,7 +376,7 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
             if(!IntWndBelongsToThread(Child, ThreadData))
             {
                /* send WM_DESTROY messages to windows not belonging to the same thread */
-               IntSendDestroyMsg(Child->hSelf);
+               IntSendDestroyMsg(Child->head.h);
             }
             else
                co_UserFreeWindow(Child, ProcessData, ThreadData, SendMessages);
@@ -405,7 +397,7 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
                           RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE |
                           RDW_NOINTERNALPAINT | RDW_NOCHILDREN);
       if(BelongsToThreadData)
-         co_IntSendMessage(Window->hSelf, WM_NCDESTROY, 0, 0);
+         co_IntSendMessage(Window->head.h, WM_NCDESTROY, 0, 0);
    }
    DestroyTimersForWindow(ThreadData, Window);
    HOOK_DestroyThreadHooks(ThreadData->pEThread); // This is needed here too!
@@ -414,19 +406,18 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
    MsqRemoveWindowMessagesFromQueue(Window);
 
    /* from now on no messages can be sent to this window anymore */
-   Window->state |= WINDOWSTATUS_DESTROYED;
-   Wnd->state |= WNDS_DESTROYED;
-   Wnd->fnid |= FNID_FREED;
+   Window->state |= WNDS_DESTROYED;
+   Window->fnid |= FNID_FREED;
 
    /* don't remove the WINDOWSTATUS_DESTROYING bit */
 
    /* reset shell window handles */
    if(ThreadData->rpdesk)
    {
-      if (Window->hSelf == ThreadData->rpdesk->rpwinstaParent->ShellWindow)
+      if (Window->head.h == ThreadData->rpdesk->rpwinstaParent->ShellWindow)
          ThreadData->rpdesk->rpwinstaParent->ShellWindow = NULL;
 
-      if (Window->hSelf == ThreadData->rpdesk->rpwinstaParent->ShellListView)
+      if (Window->head.h == ThreadData->rpdesk->rpwinstaParent->ShellListView)
          ThreadData->rpdesk->rpwinstaParent->ShellListView = NULL;
    }
 
@@ -437,21 +428,21 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
 
 #if 0 /* FIXME */
 
-   WinPosCheckInternalPos(Window->hSelf);
-   if (Window->hSelf == GetCapture())
+   WinPosCheckInternalPos(Window->head.h);
+   if (Window->head.h == GetCapture())
    {
       ReleaseCapture();
    }
 
    /* free resources associated with the window */
-   TIMER_RemoveWindowTimers(Window->hSelf);
+   TIMER_RemoveWindowTimers(Window->head.h);
 #endif
 
-   if (!(Wnd->style & WS_CHILD) && Wnd->IDMenu
-       && (Menu = UserGetMenuObject((HMENU)Wnd->IDMenu)))
+   if (!(Window->style & WS_CHILD) && Window->IDMenu
+       && (Menu = UserGetMenuObject((HMENU)Window->IDMenu)))
    {
       IntDestroyMenuObject(Menu, TRUE, TRUE);
-      Wnd->IDMenu = 0;
+      Window->IDMenu = 0;
    }
 
    if(Window->SystemMenu
@@ -471,23 +462,23 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
    IntUnlinkWindow(Window);
 
    UserReferenceObject(Window);
-   UserDeleteObject(Window->hSelf, otWindow);
+   UserDeleteObject(Window->head.h, otWindow);
 
    IntDestroyScrollBars(Window);
 
    /* dereference the class */
-   IntDereferenceClass(Wnd->pcls,
-                       Window->pti->pDeskInfo,
-                       Window->pti->ppi);
-   Wnd->pcls = NULL;
+   IntDereferenceClass(Window->pcls,
+                       Window->head.pti->pDeskInfo,
+                       Window->head.pti->ppi);
+   Window->pcls = NULL;
 
    if(Window->hrgnClip)
    {
       GreDeleteObject(Window->hrgnClip);
    }
 
-   ASSERT(Window->Wnd != NULL);
-   UserFreeWindowInfo(Window->pti, Window);
+//   ASSERT(Window != NULL);
+   UserFreeWindowInfo(Window->head.pti, Window);
 
    UserDereferenceObject(Window);
 
@@ -497,9 +488,8 @@ static LRESULT co_UserFreeWindow(PWINDOW_OBJECT Window,
 }
 
 VOID FASTCALL
-IntGetWindowBorderMeasures(PWINDOW_OBJECT Window, UINT *cx, UINT *cy)
+IntGetWindowBorderMeasures(PWND Wnd, UINT *cx, UINT *cy)
 {
-   PWND Wnd = Window->Wnd;
    if(HAS_DLGFRAME(Wnd->style, Wnd->ExStyle) && !(Wnd->style & WS_MINIMIZE))
    {
       *cx = UserGetSystemMetrics(SM_CXDLGFRAME);
@@ -669,17 +659,15 @@ IntSetWindowProc(PWND pWnd,
 
 // Move this to user space!
 BOOL FASTCALL
-IntGetWindowInfo(PWINDOW_OBJECT Window, PWINDOWINFO pwi)
+IntGetWindowInfo(PWND Wnd, PWINDOWINFO pwi)
 {
-   PWND Wnd = Window->Wnd;
-
    pwi->cbSize = sizeof(WINDOWINFO);
-   pwi->rcWindow = Window->Wnd->rcWindow;
-   pwi->rcClient = Window->Wnd->rcClient;
+   pwi->rcWindow = Wnd->rcWindow;
+   pwi->rcClient = Wnd->rcClient;
    pwi->dwStyle = Wnd->style;
    pwi->dwExStyle = Wnd->ExStyle;
-   pwi->dwWindowStatus = (UserGetForegroundWindow() == Window->hSelf); /* WS_ACTIVECAPTION */
-   IntGetWindowBorderMeasures(Window, &pwi->cxWindowBorders, &pwi->cyWindowBorders);
+   pwi->dwWindowStatus = (UserGetForegroundWindow() == Wnd->head.h); /* WS_ACTIVECAPTION */
+   IntGetWindowBorderMeasures(Wnd, &pwi->cxWindowBorders, &pwi->cyWindowBorders);
    pwi->atomWindowType = (Wnd->pcls ? Wnd->pcls->atomClassName : 0);
    pwi->wCreatorVersion = 0x400; /* FIXME - return a real version number */
    return TRUE;
@@ -687,12 +675,11 @@ IntGetWindowInfo(PWINDOW_OBJECT Window, PWINDOWINFO pwi)
 
 static BOOL FASTCALL
 IntSetMenu(
-   PWINDOW_OBJECT Window,
+   PWND Wnd,
    HMENU Menu,
    BOOL *Changed)
 {
    PMENU_OBJECT OldMenu, NewMenu = NULL;
-   PWND Wnd = Window->Wnd;
 
    if ((Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
    {
@@ -709,7 +696,7 @@ IntSetMenu(
    if (Wnd->IDMenu)
    {
       OldMenu = IntGetMenuObject((HMENU) Wnd->IDMenu);
-      ASSERT(NULL == OldMenu || OldMenu->MenuInfo.Wnd == Window->hSelf);
+      ASSERT(NULL == OldMenu || OldMenu->MenuInfo.Wnd == Wnd->head.h);
    }
    else
    {
@@ -744,7 +731,7 @@ IntSetMenu(
    Wnd->IDMenu = (UINT) Menu;
    if (NULL != NewMenu)
    {
-      NewMenu->MenuInfo.Wnd = Window->hSelf;
+      NewMenu->MenuInfo.Wnd = Wnd->head.h;
       IntReleaseMenuObject(NewMenu);
    }
    if (NULL != OldMenu)
@@ -765,14 +752,14 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread)
 {
    PTHREADINFO WThread;
    PLIST_ENTRY Current;
-   PWINDOW_OBJECT Wnd;
+   PWND Wnd;
    USER_REFERENCE_ENTRY Ref;
    WThread = (PTHREADINFO)Thread->Tcb.Win32Thread;
 
    while (!IsListEmpty(&WThread->WindowListHead))
    {
       Current = WThread->WindowListHead.Flink;
-      Wnd = CONTAINING_RECORD(Current, WINDOW_OBJECT, ThreadListEntry);
+      Wnd = CONTAINING_RECORD(Current, WND, ThreadListEntry);
 
       DPRINT("thread cleanup: while destroy wnds, wnd=0x%x\n",Wnd);
 
@@ -803,14 +790,14 @@ co_DestroyThreadWindows(struct _ETHREAD *Thread)
  * \note Does not check the validity of the parameters
 */
 VOID FASTCALL
-IntGetClientRect(PWINDOW_OBJECT Window, RECTL *Rect)
+IntGetClientRect(PWND Window, RECTL *Rect)
 {
    ASSERT( Window );
    ASSERT( Rect );
 
    Rect->left = Rect->top = 0;
-   Rect->right = Window->Wnd->rcClient.right - Window->Wnd->rcClient.left;
-   Rect->bottom = Window->Wnd->rcClient.bottom - Window->Wnd->rcClient.top;
+   Rect->right = Window->rcClient.right - Window->rcClient.left;
+   Rect->bottom = Window->rcClient.bottom - Window->rcClient.top;
 }
 
 
@@ -834,7 +821,7 @@ IntGetFocusWindow(VOID)
 #endif
 
 PMENU_OBJECT FASTCALL
-IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu)
+IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu)
 {
    PMENU_OBJECT Menu, NewMenu = NULL, SysMenu = NULL, ret = NULL;
    PTHREADINFO W32Thread;
@@ -870,7 +857,7 @@ IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu)
          {
             Window->SystemMenu = NewMenu->MenuInfo.Self;
             NewMenu->MenuInfo.Flags |= MF_SYSMENU;
-            NewMenu->MenuInfo.Wnd = Window->hSelf;
+            NewMenu->MenuInfo.Wnd = Window->head.h;
             ret = NewMenu;
             //IntReleaseMenuObject(NewMenu);
          }
@@ -889,7 +876,7 @@ IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu)
             return NULL;
          }
          SysMenu->MenuInfo.Flags |= MF_SYSMENU;
-         SysMenu->MenuInfo.Wnd = Window->hSelf;
+         SysMenu->MenuInfo.Wnd = Window->head.h;
          hNewMenu = co_IntLoadSysMenuTemplate();
          if(!hNewMenu)
          {
@@ -943,20 +930,18 @@ IntGetSystemMenu(PWINDOW_OBJECT Window, BOOL bRevert, BOOL RetMenu)
 
 
 BOOL FASTCALL
-IntIsChildWindow(PWINDOW_OBJECT Parent, PWINDOW_OBJECT BaseWindow)
+IntIsChildWindow(PWND Parent, PWND BaseWindow)
 {
-   PWINDOW_OBJECT Window;
-   PWND Wnd;
+   PWND Window;
 
    Window = BaseWindow;
    while (Window)
    {
-      Wnd = Window->Wnd;
       if (Window == Parent)
       {
          return(TRUE);
       }
-      if(!(Wnd->style & WS_CHILD))
+      if(!(Window->style & WS_CHILD))
       {
          break;
       }
@@ -968,20 +953,18 @@ IntIsChildWindow(PWINDOW_OBJECT Parent, PWINDOW_OBJECT BaseWindow)
 }
 
 BOOL FASTCALL
-IntIsWindowVisible(PWINDOW_OBJECT BaseWindow)
+IntIsWindowVisible(PWND BaseWindow)
 {
-   PWINDOW_OBJECT Window;
-   PWND Wnd;
+   PWND Window;
 
    Window = BaseWindow;
    while(Window)
    {
-      Wnd = Window->Wnd;
-      if(!(Wnd->style & WS_CHILD))
+      if(!(Window->style & WS_CHILD))
       {
          break;
       }
-      if(!(Wnd->style & WS_VISIBLE))
+      if(!(Window->style & WS_VISIBLE))
       {
          return FALSE;
       }
@@ -989,7 +972,7 @@ IntIsWindowVisible(PWINDOW_OBJECT BaseWindow)
       Window = Window->spwndParent;
    }
 
-   if(Window && Wnd->style & WS_VISIBLE)
+   if(Window && Window->style & WS_VISIBLE)
    {
       return TRUE;
    }
@@ -998,42 +981,16 @@ IntIsWindowVisible(PWINDOW_OBJECT BaseWindow)
 }
 
 
-static VOID FASTCALL
-IntLinkWnd(
-   PWND Wnd,
-   PWND WndInsertAfter) /* set to NULL if top sibling */
-{
-   if ((Wnd->spwndPrev = WndInsertAfter))
-   {
-      /* link after WndInsertAfter */
-      if ((Wnd->spwndNext = WndInsertAfter->spwndNext))
-         Wnd->spwndNext->spwndPrev = Wnd;
-
-      Wnd->spwndPrev->spwndNext = Wnd;
-   }
-   else
-   {
-      /* link at top */
-      if ((Wnd->spwndNext = Wnd->spwndParent->spwndChild))
-         Wnd->spwndNext->spwndPrev = Wnd;
-
-      Wnd->spwndParent->spwndChild = Wnd;
-    }
-}
-
 /* 
    link the window into siblings list 
    children and parent are kept in place.
 */
 VOID FASTCALL
 IntLinkWindow(
-   PWINDOW_OBJECT Wnd,
-   PWINDOW_OBJECT WndInsertAfter /* set to NULL if top sibling */
+   PWND Wnd,
+   PWND WndInsertAfter /* set to NULL if top sibling */
 )
 {
-   IntLinkWnd(Wnd->Wnd, 
-              WndInsertAfter ? WndInsertAfter->Wnd : NULL);
-
   if ((Wnd->spwndPrev = WndInsertAfter))
    {
       /* link after WndInsertAfter */
@@ -1053,13 +1010,13 @@ IntLinkWindow(
 }
 
 
-VOID FASTCALL IntLinkHwnd(PWINDOW_OBJECT Wnd, HWND hWndPrev)
+VOID FASTCALL IntLinkHwnd(PWND Wnd, HWND hWndPrev)
 {
     if (hWndPrev == HWND_NOTOPMOST)
     {
-        if (!(Wnd->Wnd->ExStyle & WS_EX_TOPMOST) && 
-            (Wnd->Wnd->ExStyle2 & WS_EX2_LINKED)) return;  /* nothing to do */
-        Wnd->Wnd->ExStyle &= ~WS_EX_TOPMOST;
+        if (!(Wnd->ExStyle & WS_EX_TOPMOST) && 
+            (Wnd->ExStyle2 & WS_EX2_LINKED)) return;  /* nothing to do */
+        Wnd->ExStyle &= ~WS_EX_TOPMOST;
         hWndPrev = HWND_TOP;  /* fallback to the HWND_TOP case */
     }
 
@@ -1068,37 +1025,37 @@ VOID FASTCALL IntLinkHwnd(PWINDOW_OBJECT Wnd, HWND hWndPrev)
     if (hWndPrev == HWND_BOTTOM)
     {
         /* Link in the bottom of the list */
-        PWINDOW_OBJECT WndInsertAfter;
+        PWND WndInsertAfter;
 
         WndInsertAfter = Wnd->spwndParent->spwndChild;
         while( WndInsertAfter && WndInsertAfter->spwndNext)
             WndInsertAfter = WndInsertAfter->spwndNext;
 
         IntLinkWindow(Wnd, WndInsertAfter);
-        Wnd->Wnd->ExStyle &= ~WS_EX_TOPMOST;
+        Wnd->ExStyle &= ~WS_EX_TOPMOST;
     }
     else if (hWndPrev == HWND_TOPMOST)
     {
         /* Link in the top of the list */
         IntLinkWindow(Wnd, NULL);
 
-        Wnd->Wnd->ExStyle |= WS_EX_TOPMOST;
+        Wnd->ExStyle |= WS_EX_TOPMOST;
     }
     else if (hWndPrev == HWND_TOP)
     {
         /* Link it after the last topmost window */
-        PWINDOW_OBJECT WndInsertBefore;
+        PWND WndInsertBefore;
 
         WndInsertBefore = Wnd->spwndParent->spwndChild;
 
-        if (!(Wnd->Wnd->ExStyle & WS_EX_TOPMOST))  /* put it above the first non-topmost window */
+        if (!(Wnd->ExStyle & WS_EX_TOPMOST))  /* put it above the first non-topmost window */
         {
             while (WndInsertBefore != NULL && WndInsertBefore->spwndNext != NULL)
             {
-                if (!(WndInsertBefore->Wnd->ExStyle & WS_EX_TOPMOST)) break;
+                if (!(WndInsertBefore->ExStyle & WS_EX_TOPMOST)) break;
                 if (WndInsertBefore == Wnd->spwndOwner)  /* keep it above owner */
                 {
-                    Wnd->Wnd->ExStyle |= WS_EX_TOPMOST;
+                    Wnd->ExStyle |= WS_EX_TOPMOST;
                     break;
                 }
                 WndInsertBefore = WndInsertBefore->spwndNext;
@@ -1110,7 +1067,7 @@ VOID FASTCALL IntLinkHwnd(PWINDOW_OBJECT Wnd, HWND hWndPrev)
     else
     {
         /* Link it after hWndPrev */
-        PWINDOW_OBJECT WndInsertAfter;
+        PWND WndInsertAfter;
 
         WndInsertAfter = UserGetWindowObject(hWndPrev);
         /* Are we called with an erroneous handle */
@@ -1124,16 +1081,16 @@ VOID FASTCALL IntLinkHwnd(PWINDOW_OBJECT Wnd, HWND hWndPrev)
         IntLinkWindow(Wnd, WndInsertAfter);
 
         /* Fix the WS_EX_TOPMOST flag */
-        if (!(WndInsertAfter->Wnd->ExStyle & WS_EX_TOPMOST)) 
+        if (!(WndInsertAfter->ExStyle & WS_EX_TOPMOST)) 
         {
-            Wnd->Wnd->ExStyle &= ~WS_EX_TOPMOST;
+            Wnd->ExStyle &= ~WS_EX_TOPMOST;
         }
         else
         {
             if(WndInsertAfter->spwndNext &&
-               WndInsertAfter->spwndNext->Wnd->ExStyle & WS_EX_TOPMOST)
+               WndInsertAfter->spwndNext->ExStyle & WS_EX_TOPMOST)
             {
-                Wnd->Wnd->ExStyle |= WS_EX_TOPMOST;
+                Wnd->ExStyle |= WS_EX_TOPMOST;
             }
         }
     }
@@ -1142,7 +1099,7 @@ VOID FASTCALL IntLinkHwnd(PWINDOW_OBJECT Wnd, HWND hWndPrev)
 HWND FASTCALL
 IntSetOwner(HWND hWnd, HWND hWndNewOwner)
 {
-   PWINDOW_OBJECT Wnd, WndOldOwner, WndNewOwner;
+   PWND Wnd, WndOldOwner, WndNewOwner;
    HWND ret;
 
    Wnd = IntGetWindowObject(hWnd);
@@ -1151,27 +1108,25 @@ IntSetOwner(HWND hWnd, HWND hWndNewOwner)
 
    WndOldOwner = Wnd->spwndOwner;
 
-   ret = WndOldOwner ? WndOldOwner->hSelf : 0;
+   ret = WndOldOwner ? WndOldOwner->head.h : 0;
 
    if((WndNewOwner = UserGetWindowObject(hWndNewOwner)))
    {
        Wnd->spwndOwner= WndNewOwner;
-       Wnd->Wnd->spwndOwner = WndNewOwner->Wnd;
    }
    else
    {
        Wnd->spwndOwner = NULL;
-       Wnd->Wnd->spwndOwner = NULL;
    }
 
    UserDereferenceObject(Wnd);
    return ret;
 }
 
-PWINDOW_OBJECT FASTCALL
-co_IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent)
+PWND FASTCALL
+co_IntSetParent(PWND Wnd, PWND WndNewParent)
 {
-   PWINDOW_OBJECT WndOldParent;
+   PWND WndOldParent;
    BOOL WasVisible;
 
    ASSERT(Wnd);
@@ -1193,7 +1148,7 @@ co_IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent)
    WasVisible = co_WinPosShowWindow(Wnd, SW_HIDE);
 
    /* Window must belong to current process */
-   if (Wnd->pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
+   if (Wnd->head.pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
       return NULL;
 
    WndOldParent = Wnd->spwndParent;
@@ -1207,7 +1162,6 @@ co_IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent)
 
       /* Set the new parent */
       Wnd->spwndParent = WndNewParent;
-      Wnd->Wnd->spwndParent = WndNewParent->Wnd;
 
       /* Link the window with its new siblings*/
       IntLinkHwnd(Wnd, HWND_TOP);
@@ -1219,7 +1173,7 @@ co_IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent)
     * in the z-order and send the expected WM_WINDOWPOSCHANGING and
     * WM_WINDOWPOSCHANGED notification messages.
     */
-   co_WinPosSetWindowPos(Wnd, (0 == (Wnd->Wnd->ExStyle & WS_EX_TOPMOST) ? HWND_TOP : HWND_TOPMOST),
+   co_WinPosSetWindowPos(Wnd, (0 == (Wnd->ExStyle & WS_EX_TOPMOST) ? HWND_TOP : HWND_TOPMOST),
                          0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE
                          | (WasVisible ? SWP_SHOWWINDOW : 0));
 
@@ -1232,7 +1186,7 @@ co_IntSetParent(PWINDOW_OBJECT Wnd, PWINDOW_OBJECT WndNewParent)
 }
 
 BOOL FASTCALL
-IntSetSystemMenu(PWINDOW_OBJECT Window, PMENU_OBJECT Menu)
+IntSetSystemMenu(PWND Window, PMENU_OBJECT Menu)
 {
    PMENU_OBJECT OldMenu;
    if(Window->SystemMenu)
@@ -1259,55 +1213,33 @@ IntSetSystemMenu(PWINDOW_OBJECT Window, PMENU_OBJECT Menu)
 
 /* unlink the window from siblings. children and parent are kept in place. */
 VOID FASTCALL
-IntUnlinkWnd(PWND Wnd)
+IntUnlinkWindow(PWND Wnd)
 {
    if (Wnd->spwndNext)
-      Wnd->spwndNext->spwndPrev = Wnd->spwndPrev;
-
-   if (Wnd->spwndPrev)
-      Wnd->spwndPrev->spwndNext = Wnd->spwndNext;
-  
-   if (Wnd->spwndParent && Wnd->spwndParent->spwndChild == Wnd)
-      Wnd->spwndParent->spwndChild = Wnd->spwndNext;
-
-   Wnd->spwndPrev = Wnd->spwndNext = NULL;
-}
-
-
-/* unlink the window from siblings. children and parent are kept in place. */
-VOID FASTCALL
-IntUnlinkWindow(PWINDOW_OBJECT Wnd)
-{
-
-    IntUnlinkWnd(Wnd->Wnd);
-
-    if (Wnd->spwndNext)
        Wnd->spwndNext->spwndPrev = Wnd->spwndPrev;
  
-    if (Wnd->spwndPrev)
+   if (Wnd->spwndPrev)
        Wnd->spwndPrev->spwndNext = Wnd->spwndNext;
 
    if (Wnd->spwndParent && Wnd->spwndParent->spwndChild == Wnd)
-      Wnd->spwndParent->spwndChild = Wnd->spwndNext;
+       Wnd->spwndParent->spwndChild = Wnd->spwndNext;
  
    Wnd->spwndPrev = Wnd->spwndNext = NULL;
 }
 
 BOOL FASTCALL
-IntIsWindowInDestroy(PWINDOW_OBJECT Window)
+IntIsWindowInDestroy(PWND Window)
 {
-   return ((Window->state & WINDOWSTATUS_DESTROYING) == WINDOWSTATUS_DESTROYING);
+   return ((Window->state2 & WNDS2_INDESTROY) == WNDS2_INDESTROY);
 }
 
 
 BOOL
 FASTCALL
-IntGetWindowPlacement(PWINDOW_OBJECT Window, WINDOWPLACEMENT *lpwndpl)
+IntGetWindowPlacement(PWND Wnd, WINDOWPLACEMENT *lpwndpl)
 {
-   PWND Wnd;
    POINT Size;
 
-   Wnd = Window->Wnd;
    if (!Wnd) return FALSE;
 
    if(lpwndpl->length != sizeof(WINDOWPLACEMENT))
@@ -1320,7 +1252,7 @@ IntGetWindowPlacement(PWINDOW_OBJECT Window, WINDOWPLACEMENT *lpwndpl)
    {
       lpwndpl->showCmd = SW_HIDE;
    }
-   else if (0 != (Window->state & WINDOWOBJECT_RESTOREMAX) ||
+   else if (0 != (Wnd->state2 & WNDS2_MAXIMIZEBUTTONDOWN) ||
             0 != (Wnd->style & WS_MAXIMIZE))
    {
       lpwndpl->showCmd = SW_MAXIMIZE;
@@ -1336,7 +1268,7 @@ IntGetWindowPlacement(PWINDOW_OBJECT Window, WINDOWPLACEMENT *lpwndpl)
 
    Size.x = Wnd->rcWindow.left;
    Size.y = Wnd->rcWindow.top;
-   WinPosInitInternalPos(Window, &Size,
+   WinPosInitInternalPos(Wnd, &Size,
                          &Wnd->rcWindow);
 
    lpwndpl->rcNormalPosition = Wnd->InternalPos.NormalRect;
@@ -1393,7 +1325,7 @@ NtUserBuildHwndList(
    if (hwndParent || !dwThreadId)
    {
       PDESKTOP Desktop;
-      PWINDOW_OBJECT Parent, Window;
+      PWND Parent, Window;
 
       if(!hwndParent)
       {
@@ -1435,7 +1367,7 @@ NtUserBuildHwndList(
                   _SEH2_TRY
                   {
                      ProbeForWrite(pWnd, sizeof(HWND), 1);
-                     *pWnd = Window->hSelf;
+                     *pWnd = Window->head.h;
                      pWnd++;
                   }
                   _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
@@ -1480,7 +1412,7 @@ NtUserBuildHwndList(
       PETHREAD Thread;
       PTHREADINFO W32Thread;
       PLIST_ENTRY Current;
-      PWINDOW_OBJECT Window;
+      PWND Window;
 
       Status = PsLookupThreadByThreadId((HANDLE)dwThreadId, &Thread);
       if(!NT_SUCCESS(Status))
@@ -1497,14 +1429,14 @@ NtUserBuildHwndList(
       Current = W32Thread->WindowListHead.Flink;
       while(Current != &(W32Thread->WindowListHead))
       {
-         Window = CONTAINING_RECORD(Current, WINDOW_OBJECT, ThreadListEntry);
+         Window = CONTAINING_RECORD(Current, WND, ThreadListEntry);
          ASSERT(Window);
 
          if(bChildren || Window->spwndOwner != NULL)
          {
              if(dwCount < *pBufSize && pWnd)
              {
-                Status = MmCopyToCaller(pWnd++, &Window->hSelf, sizeof(HWND));
+                Status = MmCopyToCaller(pWnd++, &Window->head.h, sizeof(HWND));
                 if(!NT_SUCCESS(Status))
                 {
                    SetLastNtError(Status);
@@ -1533,7 +1465,7 @@ NtUserChildWindowFromPointEx(HWND hwndParent,
                              LONG y,
                              UINT uiFlags)
 {
-   PWINDOW_OBJECT Parent;
+   PWND Parent;
    POINTL Pt;
    HWND Ret;
    HWND *List, *phWnd;
@@ -1546,10 +1478,10 @@ NtUserChildWindowFromPointEx(HWND hwndParent,
    Pt.x = x;
    Pt.y = y;
 
-   if(Parent->hSelf != IntGetDesktopWindow())
+   if(Parent->head.h != IntGetDesktopWindow())
    {
-      Pt.x += Parent->Wnd->rcClient.left;
-      Pt.y += Parent->Wnd->rcClient.top;
+      Pt.x += Parent->rcClient.left;
+      Pt.y += Parent->rcClient.top;
    }
 
    if(!IntPtInWindow(Parent, Pt.x, Pt.y))
@@ -1557,31 +1489,29 @@ NtUserChildWindowFromPointEx(HWND hwndParent,
       return NULL;
    }
 
-   Ret = Parent->hSelf;
+   Ret = Parent->head.h;
    if((List = IntWinListChildren(Parent)))
    {
       for(phWnd = List; *phWnd; phWnd++)
       {
-         PWINDOW_OBJECT Child;
-         PWND ChildWnd;
+         PWND Child;
          if((Child = UserGetWindowObject(*phWnd)))
          {
-            ChildWnd = Child->Wnd;
-            if(!(ChildWnd->style & WS_VISIBLE) && (uiFlags & CWP_SKIPINVISIBLE))
+            if(!(Child->style & WS_VISIBLE) && (uiFlags & CWP_SKIPINVISIBLE))
             {
                continue;
             }
-            if((ChildWnd->style & WS_DISABLED) && (uiFlags & CWP_SKIPDISABLED))
+            if((Child->style & WS_DISABLED) && (uiFlags & CWP_SKIPDISABLED))
             {
                continue;
             }
-            if((ChildWnd->ExStyle & WS_EX_TRANSPARENT) && (uiFlags & CWP_SKIPTRANSPARENT))
+            if((Child->ExStyle & WS_EX_TRANSPARENT) && (uiFlags & CWP_SKIPTRANSPARENT))
             {
                continue;
             }
             if(IntPtInWindow(Child, Pt.x, Pt.y))
             {
-               Ret = Child->hSelf;
+               Ret = Child->head.h;
                break;
             }
          }
@@ -1592,23 +1522,23 @@ NtUserChildWindowFromPointEx(HWND hwndParent,
    return Ret;
 }
 
- static void IntSendParentNotify( PWINDOW_OBJECT pWindow, UINT msg )
- {
-     if ( (pWindow->Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD &&
-         !(pWindow->Wnd->style & WS_EX_NOPARENTNOTIFY))
-     {
-         if (pWindow->spwndParent && pWindow->spwndParent != UserGetDesktopWindow())
-         {
-             co_IntSendMessage( pWindow->spwndParent->hSelf, 
-                                WM_PARENTNOTIFY,
-                                MAKEWPARAM( msg, pWindow->Wnd->IDMenu), 
-                                (LPARAM)pWindow->hSelf );
-         }
-     }
- }
+static void IntSendParentNotify( PWND pWindow, UINT msg )
+{
+    if ( (pWindow->style & (WS_CHILD | WS_POPUP)) == WS_CHILD &&
+         !(pWindow->style & WS_EX_NOPARENTNOTIFY))
+    {
+        if (pWindow->spwndParent && pWindow->spwndParent != UserGetDesktopWindow())
+        {
+            co_IntSendMessage( pWindow->spwndParent->head.h,
+                               WM_PARENTNOTIFY,
+                               MAKEWPARAM( msg, pWindow->IDMenu), 
+                               (LPARAM)pWindow->head.h );
+        }
+    }
+}
 
 void FASTCALL
-IntFixWindowCoordinates(CREATESTRUCTW* Cs, PWINDOW_OBJECT ParentWindow, DWORD* dwShowMode)
+IntFixWindowCoordinates(CREATESTRUCTW* Cs, PWND ParentWindow, DWORD* dwShowMode)
 {
 #define IS_DEFAULT(x)  ((x) == CW_USEDEFAULT || (x) == (SHORT)0x8000)
 
@@ -1690,14 +1620,13 @@ IntFixWindowCoordinates(CREATESTRUCTW* Cs, PWINDOW_OBJECT ParentWindow, DWORD* d
 }
 
 /* Allocates and initializes a window*/
-PWINDOW_OBJECT FASTCALL IntCreateWindow(CREATESTRUCTW* Cs, 
+PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs, 
                                         PLARGE_STRING WindowName, 
                                         PCLS Class,
-                                        PWINDOW_OBJECT ParentWindow,
-                                        PWINDOW_OBJECT OwnerWindow)
+                                        PWND ParentWindow,
+                                        PWND OwnerWindow)
 {
-   PWND Wnd = NULL;
-   PWINDOW_OBJECT Window;
+   PWND pWnd = NULL;
    HWND hWnd;
    PTHREADINFO pti = NULL;
    PMENU_OBJECT SystemMenu;
@@ -1719,66 +1648,50 @@ PWINDOW_OBJECT FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
    Cs->dwExStyle &= ~WS_EX_SETANSICREATOR;
 
    /* Allocate the new window */
-   Window = (PWINDOW_OBJECT) UserCreateObject( gHandleTable,
-                                               pti->rpdesk,
-                                               (PHANDLE)&hWnd,
-                                               otWindow,
-                                               sizeof(WINDOW_OBJECT));
-   if (!Window)
-   {
-      goto AllocError;
-   }
-
-   Wnd = DesktopHeapAlloc(pti->rpdesk, sizeof(WND) + Class->cbwndExtra);
+   pWnd = (PWND) UserCreateObject( gHandleTable,
+                                   pti->rpdesk,
+                                  (PHANDLE)&hWnd,
+                                   otWindow,
+                                   sizeof(WND) + Class->cbwndExtra);
 
-   if (!Wnd)
+   if (!pWnd)
    {
       goto AllocError;
    }
 
-   RtlZeroMemory(Wnd, sizeof(WND) + Class->cbwndExtra);
-
    DPRINT("Created object with handle %X\n", hWnd);
 
    if (NULL == pti->rpdesk->DesktopWindow)
    {
       /* If there is no desktop window yet, we must be creating it */
       pti->rpdesk->DesktopWindow = hWnd;
-      pti->rpdesk->pDeskInfo->spwnd = Wnd;
+      pti->rpdesk->pDeskInfo->spwnd = pWnd;
    }
 
    /*
     * Fill out the structure describing it.
     */
-   Window->Wnd = Wnd;
-   Window->pti = pti;
-   Window->hSelf = hWnd;
-   Window->spwndParent = ParentWindow;
-   Window->spwndOwner = OwnerWindow;
-
-   Wnd->head.h = hWnd;
-   Wnd->head.pti = pti;
-   Wnd->head.rpdesk = pti->rpdesk;
-   Wnd->fnid = 0;
-   Wnd->hWndLastActive = hWnd;
-   Wnd->state2 |= WNDS2_WIN40COMPAT;
-   Wnd->pcls = Class;
-   Wnd->hModule = Cs->hInstance;
-   Wnd->style = Cs->style & ~WS_VISIBLE;
-   Wnd->ExStyle = Cs->dwExStyle;
-   Wnd->cbwndExtra = Wnd->pcls->cbwndExtra;
-   Wnd->spwndOwner = OwnerWindow ? OwnerWindow->Wnd : NULL;
-   Wnd->spwndParent = ParentWindow ? ParentWindow->Wnd : NULL;      
-
-   IntReferenceMessageQueue(Window->pti->MessageQueue);
-   if (Wnd->spwndParent != NULL && Cs->hwndParent != 0)
-   {
-       Wnd->HideFocus = Wnd->spwndParent->HideFocus;
-       Wnd->HideAccel = Wnd->spwndParent->HideAccel;
-   }
-
-   if (Wnd->pcls->CSF_flags & CSF_SERVERSIDEPROC)
-      Wnd->state |= WNDS_SERVERSIDEWINDOWPROC;
+   /* Remember, pWnd->head is setup in object.c ...*/
+   pWnd->spwndParent = ParentWindow;
+   pWnd->spwndOwner = OwnerWindow;
+   pWnd->fnid = 0;
+   pWnd->hWndLastActive = hWnd;
+   pWnd->state2 |= WNDS2_WIN40COMPAT;
+   pWnd->pcls = Class;
+   pWnd->hModule = Cs->hInstance;
+   pWnd->style = Cs->style & ~WS_VISIBLE;
+   pWnd->ExStyle = Cs->dwExStyle;
+   pWnd->cbwndExtra = pWnd->pcls->cbwndExtra;
+
+   IntReferenceMessageQueue(pWnd->head.pti->MessageQueue);
+   if (pWnd->spwndParent != NULL && Cs->hwndParent != 0)
+   {
+       pWnd->HideFocus = pWnd->spwndParent->HideFocus;
+       pWnd->HideAccel = pWnd->spwndParent->HideAccel;
+   }
+
+   if (pWnd->pcls->CSF_flags & CSF_SERVERSIDEPROC)
+      pWnd->state |= WNDS_SERVERSIDEWINDOWPROC;
 
  /* BugBoy Comments: Comment below say that System classes are always created
     as UNICODE. In windows, creating a window with the ANSI version of CreateWindow
@@ -1789,31 +1702,31 @@ PWINDOW_OBJECT FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
     see what problems this would cause.*/
 
    // Set WndProc from Class.
-   Wnd->lpfnWndProc  = Wnd->pcls->lpfnWndProc;
+   pWnd->lpfnWndProc  = pWnd->pcls->lpfnWndProc;
 
    // GetWindowProc, test for non server side default classes and set WndProc.
-    if ( Wnd->pcls->fnid <= FNID_GHOST && Wnd->pcls->fnid >= FNID_BUTTON )
+    if ( pWnd->pcls->fnid <= FNID_GHOST && pWnd->pcls->fnid >= FNID_BUTTON )
     {
       if (bUnicodeWindow)
       {
-         if (GETPFNCLIENTA(Wnd->pcls->fnid) == Wnd->lpfnWndProc)
-            Wnd->lpfnWndProc = GETPFNCLIENTW(Wnd->pcls->fnid);  
+         if (GETPFNCLIENTA(pWnd->pcls->fnid) == pWnd->lpfnWndProc)
+            pWnd->lpfnWndProc = GETPFNCLIENTW(pWnd->pcls->fnid);  
       }
       else
       {
-         if (GETPFNCLIENTW(Wnd->pcls->fnid) == Wnd->lpfnWndProc)
-            Wnd->lpfnWndProc = GETPFNCLIENTA(Wnd->pcls->fnid);
+         if (GETPFNCLIENTW(pWnd->pcls->fnid) == pWnd->lpfnWndProc)
+            pWnd->lpfnWndProc = GETPFNCLIENTA(pWnd->pcls->fnid);
       }
     }
 
    // If not an Unicode caller, set Ansi creator bit.
-   if (!bUnicodeWindow) Wnd->state |= WNDS_ANSICREATOR;
+   if (!bUnicodeWindow) pWnd->state |= WNDS_ANSICREATOR;
 
    // Clone Class Ansi/Unicode proc type.
-   if (Wnd->pcls->CSF_flags & CSF_ANSIPROC)
+   if (pWnd->pcls->CSF_flags & CSF_ANSIPROC)
    {
-      Wnd->state |= WNDS_ANSIWINDOWPROC;
-      Wnd->Unicode = FALSE;
+      pWnd->state |= WNDS_ANSIWINDOWPROC;
+      pWnd->Unicode = FALSE;
    }
    else
    { /*
@@ -1831,13 +1744,13 @@ PWINDOW_OBJECT FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
             Class->atomClassName == gpsi->atomSysClass[ICLS_MDICLIENT] ||
             Class->atomClassName == gpsi->atomSysClass[ICLS_STATIC] ) )
       { // Override Class and set the window Ansi WndProc.
-         Wnd->state |= WNDS_ANSIWINDOWPROC;
-         Wnd->Unicode = FALSE;
+         pWnd->state |= WNDS_ANSIWINDOWPROC;
+         pWnd->Unicode = FALSE;
       }
       else
       { // Set the window Unicode WndProc.
-         Wnd->state &= ~WNDS_ANSIWINDOWPROC;
-         Wnd->Unicode = TRUE;
+         pWnd->state &= ~WNDS_ANSIWINDOWPROC;
+         pWnd->Unicode = TRUE;
       }
    }
 
@@ -1847,8 +1760,7 @@ PWINDOW_OBJECT FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
    if (Class->atomClassName == gpsi->atomSysClass[ICLS_EDIT])
    {
       PCALLPROCDATA CallProc;
-      //CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, bUnicodeWindow, Wnd->ti->ppi);
-      CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, Wnd->Unicode , Wnd->head.pti->ppi);
+      CallProc = CreateCallProc(NULL, pWnd->lpfnWndProc, pWnd->Unicode , pWnd->head.pti->ppi);
 
       if (!CallProc)
       {
@@ -1857,50 +1769,50 @@ PWINDOW_OBJECT FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
       }
       else
       {
-         UserAddCallProcToClass(Wnd->pcls, CallProc);
+         UserAddCallProcToClass(pWnd->pcls, CallProc);
       }
    }
 
-   InitializeListHead(&Wnd->PropListHead);
+   InitializeListHead(&pWnd->PropListHead);
 
    if ( WindowName->Buffer != NULL && WindowName->Length > 0 )
    {
-      Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->head.rpdesk,
+      pWnd->strName.Buffer = DesktopHeapAlloc(pWnd->head.rpdesk,
                                              WindowName->Length + sizeof(UNICODE_NULL));
-      if (Wnd->strName.Buffer == NULL)
+      if (pWnd->strName.Buffer == NULL)
       {
           goto AllocError;
       }
 
-      RtlCopyMemory(Wnd->strName.Buffer, WindowName->Buffer, WindowName->Length);
-      Wnd->strName.Buffer[WindowName->Length / sizeof(WCHAR)] = L'\0';
-      Wnd->strName.Length = WindowName->Length;
+      RtlCopyMemory(pWnd->strName.Buffer, WindowName->Buffer, WindowName->Length);
+      pWnd->strName.Buffer[WindowName->Length / sizeof(WCHAR)] = L'\0';
+      pWnd->strName.Length = WindowName->Length;
    }
 
    /* Correct the window style. */
-   if ((Wnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
+   if ((pWnd->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
    {
-      Wnd->style |= WS_CLIPSIBLINGS;
-      if (!(Wnd->style & WS_POPUP))
+      pWnd->style |= WS_CLIPSIBLINGS;
+      if (!(pWnd->style & WS_POPUP))
       {
-         Wnd->style |= WS_CAPTION;
-         Window->state |= WINDOWOBJECT_NEED_SIZE;
+         pWnd->style |= WS_CAPTION;
+         pWnd->state |= WNDS_SENDSIZEMOVEMSGS;
       }
    }
 
-   if ((Wnd->ExStyle & WS_EX_DLGMODALFRAME) ||
-          (Wnd->style & (WS_DLGFRAME | WS_THICKFRAME)))
-        Wnd->ExStyle |= WS_EX_WINDOWEDGE;
+   if ((pWnd->ExStyle & WS_EX_DLGMODALFRAME) ||
+          (pWnd->style & (WS_DLGFRAME | WS_THICKFRAME)))
+        pWnd->ExStyle |= WS_EX_WINDOWEDGE;
     else
-        Wnd->ExStyle &= ~WS_EX_WINDOWEDGE;
+        pWnd->ExStyle &= ~WS_EX_WINDOWEDGE;
 
    /* create system menu */
    if((Cs->style & WS_SYSMENU) )//&& (dwStyle & WS_CAPTION) == WS_CAPTION)
    {
-      SystemMenu = IntGetSystemMenu(Window, TRUE, TRUE);
+      SystemMenu = IntGetSystemMenu(pWnd, TRUE, TRUE);
       if(SystemMenu)
       {
-         Window->SystemMenu = SystemMenu->MenuInfo.Self;
+         pWnd->SystemMenu = SystemMenu->MenuInfo.Self;
          IntReleaseMenuObject(SystemMenu);
       }
    }
@@ -1909,51 +1821,48 @@ PWINDOW_OBJECT FASTCALL IntCreateWindow(CREATESTRUCTW* Cs,
    if ((Cs->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
    {
        if (Cs->hMenu)
-         IntSetMenu(Window, Cs->hMenu, &MenuChanged);
-      else if (Wnd->pcls->lpszMenuName) // Take it from the parent.
+         IntSetMenu(pWnd, Cs->hMenu, &MenuChanged);
+      else if (pWnd->pcls->lpszMenuName) // Take it from the parent.
       {
           UNICODE_STRING MenuName;
           HMENU hMenu;
 
-          if (IS_INTRESOURCE(Wnd->pcls->lpszMenuName))
+          if (IS_INTRESOURCE(pWnd->pcls->lpszMenuName))
           {
              MenuName.Length = 0;
              MenuName.MaximumLength = 0;
-             MenuName.Buffer = Wnd->pcls->lpszMenuName;
+             MenuName.Buffer = pWnd->pcls->lpszMenuName;
           }
           else
           {
-             RtlInitUnicodeString( &MenuName, Wnd->pcls->lpszMenuName);
+             RtlInitUnicodeString( &MenuName, pWnd->pcls->lpszMenuName);
           }
-          hMenu = co_IntCallLoadMenu( Wnd->pcls->hModule, &MenuName);
-          if (hMenu) IntSetMenu(Window, hMenu, &MenuChanged);
+          hMenu = co_IntCallLoadMenu( pWnd->pcls->hModule, &MenuName);
+          if (hMenu) IntSetMenu(pWnd, hMenu, &MenuChanged);
       }
    }
    else // Not a child
-      Wnd->IDMenu = (UINT) Cs->hMenu;
+      pWnd->IDMenu = (UINT) Cs->hMenu;
 
    /* Insert the window into the thread's window list. */
-   InsertTailList (&pti->WindowListHead, &Window->ThreadListEntry);
+   InsertTailList (&pti->WindowListHead, &pWnd->ThreadListEntry);
 
    /*  Handle "CS_CLASSDC", it is tested first. */
-   if ( (Wnd->pcls->style & CS_CLASSDC) && !(Wnd->pcls->pdce) )
+   if ( (pWnd->pcls->style & CS_CLASSDC) && !(pWnd->pcls->pdce) )
    {  /* One DCE per class to have CLASS. */
-      Wnd->pcls->pdce = DceAllocDCE( Window, DCE_CLASS_DC );
+      pWnd->pcls->pdce = DceAllocDCE( pWnd, DCE_CLASS_DC );
    }
-   else if ( Wnd->pcls->style & CS_OWNDC)
+   else if ( pWnd->pcls->style & CS_OWNDC)
    {  /* Allocate a DCE for this window. */
-      DceAllocDCE(Window, DCE_WINDOW_DC);
+      DceAllocDCE(pWnd, DCE_WINDOW_DC);
    }
 
-   return Window;
+   return pWnd;
 
 AllocError:
 
-   if(Window)
-      UserDereferenceObject(Window);
-
-   if(Wnd)
-       DesktopHeapFree(Wnd->head.rpdesk, Wnd);
+   if(pWnd)
+      UserDereferenceObject(pWnd);
    
    SetLastNtError(STATUS_INSUFFICIENT_RESOURCES);
    return NULL;
@@ -1967,11 +1876,10 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
                      PUNICODE_STRING ClassName,
                      PLARGE_STRING WindowName)
 {
-   PWINDOW_OBJECT Window = NULL, ParentWindow = NULL, OwnerWindow;
+   PWND Window = NULL, ParentWindow = NULL, OwnerWindow;
    HWND hWnd, hWndParent, hWndOwner;
    DWORD dwStyle;
    PWINSTATION_OBJECT WinSta;
-   PWND Wnd = NULL;
    PCLS Class = NULL;
    SIZE Size;
    POINT MaxPos;
@@ -2048,15 +1956,14 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
        RETURN(0);
    }
 
-   Wnd = Window->Wnd;
-   hWnd = Window->hSelf;
+   hWnd = Window->head.h;
 
    UserRefObjectCo(Window, &Ref);
    ObDereferenceObject(WinSta);
 
    /* Call the WH_CBT hook */
    dwStyle = Cs->style;
-   Cs->style = Wnd->style; /* HCBT_CREATEWND needs the real window style */
+   Cs->style = Window->style; /* HCBT_CREATEWND needs the real window style */
    CbtCreate.lpcs = Cs;
    CbtCreate.hwndInsertAfter = HWND_TOP;
    if (ISITHOOKED(WH_CBT))
@@ -2084,17 +1991,17 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
       if (Size.cy < MinTrack.y) Size.cy = MinTrack.y;
    }
 
-   Wnd->rcWindow.left = Cs->x;
-   Wnd->rcWindow.top = Cs->y;
-   Wnd->rcWindow.right = Cs->x + Size.cx;
-   Wnd->rcWindow.bottom = Cs->y + Size.cy;
-   if (0 != (Wnd->style & WS_CHILD) && ParentWindow)
+   Window->rcWindow.left = Cs->x;
+   Window->rcWindow.top = Cs->y;
+   Window->rcWindow.right = Cs->x + Size.cx;
+   Window->rcWindow.bottom = Cs->y + Size.cy;
+   if (0 != (Window->style & WS_CHILD) && ParentWindow)
    {
-      RECTL_vOffsetRect(&Wnd->rcWindow, 
-                        ParentWindow->Wnd->rcClient.left,
-                        ParentWindow->Wnd->rcClient.top);
+      RECTL_vOffsetRect(&Window->rcWindow, 
+                        ParentWindow->rcClient.left,
+                        ParentWindow->rcClient.top);
    }
-   Wnd->rcClient = Wnd->rcWindow;
+   Window->rcClient = Window->rcWindow;
 
 
    /* Link the window*/
@@ -2108,7 +2015,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
    }
    
    /* Send the NCCREATE message */
-   Result = co_IntSendMessage(Window->hSelf, WM_NCCREATE, 0, (LPARAM) Cs);
+   Result = co_IntSendMessage(Window->head.h, WM_NCCREATE, 0, (LPARAM) Cs);
    if (!Result)
    {
       DPRINT1("co_UserCreateWindowEx(): NCCREATE message failed\n");
@@ -2116,17 +2023,17 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
    }
 
    /* Send the WM_NCCALCSIZE message */
-   MaxPos.x = Window->Wnd->rcWindow.left;
-   MaxPos.y = Window->Wnd->rcWindow.top;
+   MaxPos.x = Window->rcWindow.left;
+   MaxPos.y = Window->rcWindow.top;
 
-   Result = co_WinPosGetNonClientSize(Window, &Wnd->rcWindow, &Wnd->rcClient);
+   Result = co_WinPosGetNonClientSize(Window, &Window->rcWindow, &Window->rcClient);
 
-   RECTL_vOffsetRect(&Wnd->rcWindow, MaxPos.x - Wnd->rcWindow.left,
-                                     MaxPos.y - Wnd->rcWindow.top);
+   RECTL_vOffsetRect(&Window->rcWindow, MaxPos.x - Window->rcWindow.left,
+                                     MaxPos.y - Window->rcWindow.top);
 
 
    /* Send the WM_CREATE message. */
-   Result = co_IntSendMessage(Window->hSelf, WM_CREATE, 0, (LPARAM) Cs);
+   Result = co_IntSendMessage(Window->head.h, WM_CREATE, 0, (LPARAM) Cs);
    if (Result == (LRESULT)-1)
    {
       DPRINT1("co_UserCreateWindowEx(): WM_CREATE message failed\n");
@@ -2134,30 +2041,30 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
    }
 
    /* Send the EVENT_OBJECT_CREATE event*/
-   IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window->Wnd, OBJID_WINDOW, 0);
+   IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window, OBJID_WINDOW, 0);
 
    /* By setting the flag below it can be examined to determine if the window
       was created successfully and a valid pwnd was passed back to caller since
       from here the function has to succeed. */
-   Window->Wnd->state2 |= WNDS2_WMCREATEMSGPROCESSED;
+   Window->state2 |= WNDS2_WMCREATEMSGPROCESSED;
 
    /* Send the WM_SIZE and WM_MOVE messages. */
-   if (!(Window->state & WINDOWOBJECT_NEED_SIZE))
+   if (!(Window->state & WNDS_SENDSIZEMOVEMSGS))
    {
         co_WinPosSendSizeMove(Window);
    }
 
    /* Show or maybe minimize or maximize the window. */
-   if (Wnd->style & (WS_MINIMIZE | WS_MAXIMIZE))
+   if (Window->style & (WS_MINIMIZE | WS_MAXIMIZE))
    {
       RECTL NewPos;
       UINT16 SwFlag;
 
-      SwFlag = (Wnd->style & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE;
+      SwFlag = (Window->style & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE;
 
       co_WinPosMinMaximize(Window, SwFlag, &NewPos);
 
-      SwFlag = ((Wnd->style & WS_CHILD) || UserGetActiveWindow()) ?
+      SwFlag = ((Window->style & WS_CHILD) || UserGetActiveWindow()) ?
                 SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED :
                 SWP_NOZORDER | SWP_FRAMECHANGED;
 
@@ -2175,11 +2082,11 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
    }
 
    /* Initialize and show the window's scrollbars */
-   if (Wnd->style & WS_VSCROLL)
+   if (Window->style & WS_VSCROLL)
    {
       co_UserShowScrollBar(Window, SB_VERT, TRUE);
    }
-   if (Wnd->style & WS_HSCROLL)
+   if (Window->style & WS_HSCROLL)
    {
       co_UserShowScrollBar(Window, SB_HORZ, TRUE);
    }
@@ -2187,23 +2094,23 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs,
    /* Show the new window */
    if (Cs->style & WS_VISIBLE)
    {
-      if (Wnd->style & WS_MAXIMIZE)
+      if (Window->style & WS_MAXIMIZE)
          dwShowMode = SW_SHOW;
-      else if (Wnd->style & WS_MINIMIZE)
+      else if (Window->style & WS_MINIMIZE)
          dwShowMode = SW_SHOWMINIMIZED;
 
       co_WinPosShowWindow(Window, dwShowMode);
 
-      if (Wnd->ExStyle & WS_EX_MDICHILD)
+      if (Window->ExStyle & WS_EX_MDICHILD)
       {
-        co_IntSendMessage(ParentWindow->hSelf, WM_MDIREFRESHMENU, 0, 0);
+        co_IntSendMessage(ParentWindow->head.h, WM_MDIREFRESHMENU, 0, 0);
         /* ShowWindow won't activate child windows */
         co_WinPosSetWindowPos(Window, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOMOVE | SWP_NOSIZE);
       }
    }
 
    DPRINT("co_UserCreateWindowEx(): Created window %X\n", hWnd);
-   RETURN( Wnd);
+   RETURN( Window);
 
 CLEANUP:
    if (!_ret_)
@@ -2414,39 +2321,34 @@ NtUserDeferWindowPos(HDWP WinPosInfo,
 }
 
 
-BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
+BOOLEAN FASTCALL co_UserDestroyWindow(PWND Window)
 {
-   PWND Wnd;
    HWND hWnd;
    PTHREADINFO ti;
    MSG msg;
 
    ASSERT_REFS_CO(Window); // FIXME: temp hack?
 
-   hWnd = Window->hSelf;
-
-   Wnd = Window->Wnd;
-
-   if (!Wnd) return TRUE; // FIXME: Need to finish object rewrite or lock the thread when killing the window!
+   hWnd = Window->head.h;
 
    DPRINT("co_UserDestroyWindow \n");
 
    /* Check for owner thread */
-   if ( (Window->pti->pEThread != PsGetCurrentThread()) ||
-        Wnd->head.pti != PsGetCurrentThreadWin32Thread() )
+   if ( (Window->head.pti->pEThread != PsGetCurrentThread()) ||
+        Window->head.pti != PsGetCurrentThreadWin32Thread() )
    {
       SetLastWin32Error(ERROR_ACCESS_DENIED);
       return FALSE;
    }
 
    /* If window was created successfully and it is hooked */
-   if ((Wnd->state2 & WNDS2_WMCREATEMSGPROCESSED) && (ISITHOOKED(WH_CBT)))
+   if ((Window->state2 & WNDS2_WMCREATEMSGPROCESSED) && (ISITHOOKED(WH_CBT)))
    {
       if (co_HOOK_CallHooks(WH_CBT, HCBT_DESTROYWND, (WPARAM) hWnd, 0)) return FALSE;
    }
 
    /* Inform the parent */
-   if (Wnd->style & WS_CHILD)
+   if (Window->style & WS_CHILD)
    {
       IntSendParentNotify(Window, WM_DESTROY);
    }
@@ -2456,18 +2358,18 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
     */
    if (!co_WinPosShowWindow(Window, SW_HIDE))
    {
-      if (UserGetActiveWindow() == Window->hSelf)
+      if (UserGetActiveWindow() == Window->head.h)
       {
          co_WinPosActivateOtherWindow(Window);
       }
    }
 
-   if (Window->pti->MessageQueue->ActiveWindow == Window->hSelf)
-      Window->pti->MessageQueue->ActiveWindow = NULL;
-   if (Window->pti->MessageQueue->FocusWindow == Window->hSelf)
-      Window->pti->MessageQueue->FocusWindow = NULL;
-   if (Window->pti->MessageQueue->CaptureWindow == Window->hSelf)
-      Window->pti->MessageQueue->CaptureWindow = NULL;
+   if (Window->head.pti->MessageQueue->ActiveWindow == Window->head.h)
+      Window->head.pti->MessageQueue->ActiveWindow = NULL;
+   if (Window->head.pti->MessageQueue->FocusWindow == Window->head.h)
+      Window->head.pti->MessageQueue->FocusWindow = NULL;
+   if (Window->head.pti->MessageQueue->CaptureWindow == Window->head.h)
+      Window->head.pti->MessageQueue->CaptureWindow = NULL;
 
    /*
     * Check if this window is the Shell's Desktop Window. If so set hShellWindow to NULL
@@ -2484,24 +2386,25 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
       }
    }
 
-   IntDereferenceMessageQueue(Window->pti->MessageQueue);
+   IntDereferenceMessageQueue(Window->head.pti->MessageQueue);
 
    IntEngWindowChanged(Window, WOC_DELETE);
-   
-   if (!IntIsWindow(Window->hSelf))
+
+   if (!IntIsWindow(Window->head.h))
    {
       return TRUE;
    }
 
    /* Recursively destroy owned windows */
-   if (! (Wnd->style & WS_CHILD))
+
+   if (! (Window->style & WS_CHILD))
    {
       for (;;)
       {
          BOOL GotOne = FALSE;
          HWND *Children;
          HWND *ChildHandle;
-         PWINDOW_OBJECT Child, Desktop;
+         PWND Child, Desktop;
 
          Desktop = IntIsDesktopWindow(Window) ? Window :
                    UserGetWindowObject(IntGetDesktopWindow());
@@ -2533,7 +2436,6 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
                if (Child->spwndOwner != NULL)
                {
                   Child->spwndOwner = NULL;
-                  Child->Wnd->spwndOwner = NULL;
                }
 
             }
@@ -2553,7 +2455,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
     msg.pt = gpsi->ptCursor;
     MsqInsertSystemMessage(&msg);
 
-   if (!IntIsWindow(Window->hSelf))
+   if (!IntIsWindow(Window->head.h))
    {
       return TRUE;
    }
@@ -2571,7 +2473,7 @@ BOOLEAN FASTCALL co_UserDestroyWindow(PWINDOW_OBJECT Window)
 BOOLEAN APIENTRY
 NtUserDestroyWindow(HWND Wnd)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    DECLARE_RETURN(BOOLEAN);
    BOOLEAN ret;
    USER_REFERENCE_ENTRY Ref;
@@ -2648,8 +2550,8 @@ NtUserFillWindow(HWND hWndPaint,
 
 
 static HWND FASTCALL
-IntFindWindow(PWINDOW_OBJECT Parent,
-              PWINDOW_OBJECT ChildAfter,
+IntFindWindow(PWND Parent,
+              PWND ChildAfter,
               RTL_ATOM ClassAtom,
               PUNICODE_STRING WindowName)
 {
@@ -2668,14 +2570,14 @@ IntFindWindow(PWINDOW_OBJECT Parent,
       if(ChildAfter)
       {
          /* skip handles before and including ChildAfter */
-         while(*phWnd && (*(phWnd++) != ChildAfter->hSelf))
+         while(*phWnd && (*(phWnd++) != ChildAfter->head.h))
             ;
       }
 
       /* search children */
       while(*phWnd)
       {
-         PWINDOW_OBJECT Child;
+         PWND Child;
          if(!(Child = UserGetWindowObject(*(phWnd++))))
          {
             continue;
@@ -2684,17 +2586,17 @@ IntFindWindow(PWINDOW_OBJECT Parent,
          /* Do not send WM_GETTEXT messages in the kernel mode version!
             The user mode version however calls GetWindowText() which will
             send WM_GETTEXT messages to windows belonging to its processes */
-         if (!ClassAtom || Child->Wnd->pcls->atomClassName == ClassAtom)
+         if (!ClassAtom || Child->pcls->atomClassName == ClassAtom)
          {
              // HACK: use UNICODE_STRING instead of LARGE_STRING
-             CurrentWindowName.Buffer = Child->Wnd->strName.Buffer;
-             CurrentWindowName.Length = Child->Wnd->strName.Length;
-             CurrentWindowName.MaximumLength = Child->Wnd->strName.MaximumLength;
+             CurrentWindowName.Buffer = Child->strName.Buffer;
+             CurrentWindowName.Length = Child->strName.Length;
+             CurrentWindowName.MaximumLength = Child->strName.MaximumLength;
              if(!CheckWindowName || 
-                (Child->Wnd->strName.Length < 0xFFFF &&
+                (Child->strName.Length < 0xFFFF &&
                  !RtlCompareUnicodeString(WindowName, &CurrentWindowName, TRUE)))
              {
-            Ret = Child->hSelf;
+            Ret = Child->head.h;
             break;
          }
       }
@@ -2736,7 +2638,7 @@ NtUserFindWindowEx(HWND hwndParent,
                    PUNICODE_STRING ucWindowName,
                    DWORD dwUnknown)
 {
-   PWINDOW_OBJECT Parent, ChildAfter;
+   PWND Parent, ChildAfter;
    UNICODE_STRING ClassName = {0}, WindowName = {0};
    HWND Desktop, Ret = NULL;
    RTL_ATOM ClassAtom = (RTL_ATOM)0;
@@ -2827,10 +2729,10 @@ NtUserFindWindowEx(HWND hwndParent,
 
    _SEH2_TRY
    {
-       if(Parent->hSelf == Desktop)
+       if(Parent->head.h == Desktop)
        {
           HWND *List, *phWnd;
-          PWINDOW_OBJECT TopLevelWindow;
+          PWND TopLevelWindow;
           BOOLEAN CheckWindowName;
           BOOLEAN WindowMatches;
           BOOLEAN ClassMatches;
@@ -2845,7 +2747,7 @@ NtUserFindWindowEx(HWND hwndParent,
              if(ChildAfter)
              {
                 /* skip handles before and including ChildAfter */
-                while(*phWnd && (*(phWnd++) != ChildAfter->hSelf))
+                while(*phWnd && (*(phWnd++) != ChildAfter->head.h))
                    ;
              }
 
@@ -2864,18 +2766,18 @@ NtUserFindWindowEx(HWND hwndParent,
                 /* Do not send WM_GETTEXT messages in the kernel mode version!
                    The user mode version however calls GetWindowText() which will
                    send WM_GETTEXT messages to windows belonging to its processes */
-                ustr.Buffer = TopLevelWindow->Wnd->strName.Buffer;
-                ustr.Length = TopLevelWindow->Wnd->strName.Length;
-                ustr.MaximumLength = TopLevelWindow->Wnd->strName.MaximumLength;
+                ustr.Buffer = TopLevelWindow->strName.Buffer;
+                ustr.Length = TopLevelWindow->strName.Length;
+                ustr.MaximumLength = TopLevelWindow->strName.MaximumLength;
                 WindowMatches = !CheckWindowName || 
-                                (TopLevelWindow->Wnd->strName.Length < 0xFFFF && 
+                                (TopLevelWindow->strName.Length < 0xFFFF && 
                                  !RtlCompareUnicodeString(&WindowName, &ustr, TRUE));
                 ClassMatches = (ClassAtom == (RTL_ATOM)0) ||
-                               ClassAtom == TopLevelWindow->Wnd->pcls->atomClassName;
+                               ClassAtom == TopLevelWindow->pcls->atomClassName;
 
                 if (WindowMatches && ClassMatches)
                 {
-                   Ret = TopLevelWindow->hSelf;
+                   Ret = TopLevelWindow->head.h;
                    break;
                 }
 
@@ -2883,7 +2785,7 @@ NtUserFindWindowEx(HWND hwndParent,
                 {
                    /* window returns the handle of the top-level window, in case it found
                       the child window */
-                   Ret = TopLevelWindow->hSelf;
+                   Ret = TopLevelWindow->head.h;
                    break;
                 }
 
@@ -2901,7 +2803,7 @@ NtUserFindWindowEx(HWND hwndParent,
           /* FIXME - if both hwndParent and hwndChildAfter are NULL, we also should
                      search the message-only windows. Should this also be done if
                      Parent is the desktop window??? */
-          PWINDOW_OBJECT MsgWindows;
+          PWND MsgWindows;
 
           if((MsgWindows = UserGetWindowObject(IntGetMessageWindow())))
           {
@@ -2941,11 +2843,11 @@ NtUserFlashWindowEx(IN PFLASHWINFO pfwi)
 /*
  * @implemented
  */
-PWINDOW_OBJECT FASTCALL UserGetAncestor(PWINDOW_OBJECT Wnd, UINT Type)
+PWND FASTCALL UserGetAncestor(PWND Wnd, UINT Type)
 {
-   PWINDOW_OBJECT WndAncestor, Parent;
+   PWND WndAncestor, Parent;
 
-   if (Wnd->hSelf == IntGetDesktopWindow())
+   if (Wnd->head.h == IntGetDesktopWindow())
    {
       return NULL;
    }
@@ -2985,7 +2887,7 @@ PWINDOW_OBJECT FASTCALL UserGetAncestor(PWINDOW_OBJECT Wnd, UINT Type)
 
             for (;;)
             {
-               PWINDOW_OBJECT Parent;
+               PWND Parent;
 
                Parent = IntGetParent(WndAncestor);
 
@@ -3014,7 +2916,7 @@ PWINDOW_OBJECT FASTCALL UserGetAncestor(PWINDOW_OBJECT Wnd, UINT Type)
 HWND APIENTRY
 NtUserGetAncestor(HWND hWnd, UINT Type)
 {
-   PWINDOW_OBJECT Window, Ancestor;
+   PWND Window, Ancestor;
    DECLARE_RETURN(HWND);
 
    DPRINT("Enter NtUserGetAncestor\n");
@@ -3028,7 +2930,7 @@ NtUserGetAncestor(HWND hWnd, UINT Type)
    Ancestor = UserGetAncestor(Window, Type);
    /* faxme: can UserGetAncestor ever return NULL for a valid window? */
 
-   RETURN(Ancestor ? Ancestor->hSelf : NULL);
+   RETURN(Ancestor ? Ancestor->head.h : NULL);
 
 CLEANUP:
    DPRINT("Leave NtUserGetAncestor, ret=%i\n",_ret_);
@@ -3043,7 +2945,7 @@ NtUserGetComboBoxInfo(
    HWND hWnd,
    PCOMBOBOXINFO pcbi)
 {
-   PWINDOW_OBJECT Wnd;
+   PWND Wnd;
    DECLARE_RETURN(BOOL);
 
    DPRINT("Enter NtUserGetComboBoxInfo\n");
@@ -3070,7 +2972,7 @@ NtUserGetComboBoxInfo(
    _SEH2_END;
 
    // Pass the user pointer, it was already probed.
-   RETURN( (BOOL) co_IntSendMessage( Wnd->hSelf, CB_GETCOMBOBOXINFO, 0, (LPARAM)pcbi));
+   RETURN( (BOOL) co_IntSendMessage( Wnd->head.h, CB_GETCOMBOBOXINFO, 0, (LPARAM)pcbi));
 
 CLEANUP:
    DPRINT("Leave NtUserGetComboBoxInfo, ret=%i\n",_ret_);
@@ -3087,14 +2989,14 @@ NtUserGetInternalWindowPos( HWND hWnd,
                             LPRECT rectWnd,
                             LPPOINT ptIcon)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    DWORD Ret = 0;
    BOOL Hit = FALSE;
    WINDOWPLACEMENT wndpl;
 
    UserEnterShared();
 
-   if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+   if (!(Window = UserGetWindowObject(hWnd)))
    {
       Hit = FALSE;
       goto Exit;
@@ -3158,7 +3060,7 @@ APIENTRY
 NtUserGetListBoxInfo(
    HWND hWnd)
 {
-   PWINDOW_OBJECT Wnd;
+   PWND Wnd;
    DECLARE_RETURN(DWORD);
 
    DPRINT("Enter NtUserGetListBoxInfo\n");
@@ -3169,7 +3071,7 @@ NtUserGetListBoxInfo(
       RETURN( 0 );
    }
 
-   RETURN( (DWORD) co_IntSendMessage( Wnd->hSelf, LB_GETLISTBOXINFO, 0, 0 ));
+   RETURN( (DWORD) co_IntSendMessage( Wnd->head.h, LB_GETLISTBOXINFO, 0, 0 ));
 
 CLEANUP:
    DPRINT("Leave NtUserGetListBoxInfo, ret=%i\n",_ret_);
@@ -3181,7 +3083,7 @@ CLEANUP:
 HWND FASTCALL
 co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
 {
-   PWINDOW_OBJECT Wnd = NULL, WndParent = NULL, WndOldParent;
+   PWND Wnd = NULL, WndParent = NULL, WndOldParent;
    HWND hWndOldParent = NULL;
    USER_REFERENCE_ENTRY Ref, ParentRef;
 
@@ -3227,7 +3129,7 @@ co_UserSetParent(HWND hWndChild, HWND hWndNewParent)
 
    if (WndOldParent)
    {
-      hWndOldParent = WndOldParent->hSelf;
+      hWndOldParent = WndOldParent->head.h;
       UserDereferenceObject(WndOldParent);
    }
 
@@ -3322,7 +3224,7 @@ BOOL APIENTRY
 NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView)
 {
    PWINSTATION_OBJECT WinStaObject;
-   PWINDOW_OBJECT WndShell, WndListView;
+   PWND WndShell, WndListView;
    DECLARE_RETURN(BOOL);
    USER_REFERENCE_ENTRY Ref;
    NTSTATUS Status;
@@ -3374,14 +3276,14 @@ NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView)
       co_WinPosSetWindowPos(hwndListView, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
 #endif
 
-      if (WndListView->Wnd->ExStyle & WS_EX_TOPMOST)
+      if (WndListView->ExStyle & WS_EX_TOPMOST)
       {
          ObDereferenceObject(WinStaObject);
          RETURN( FALSE);
       }
    }
 
-   if (WndShell->Wnd->ExStyle & WS_EX_TOPMOST)
+   if (WndShell->ExStyle & WS_EX_TOPMOST)
    {
       ObDereferenceObject(WinStaObject);
       RETURN( FALSE);
@@ -3437,7 +3339,7 @@ CLEANUP:
 HMENU APIENTRY
 NtUserGetSystemMenu(HWND hWnd, BOOL bRevert)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    PMENU_OBJECT Menu;
    DECLARE_RETURN(HMENU);
 
@@ -3473,7 +3375,7 @@ BOOL APIENTRY
 NtUserSetSystemMenu(HWND hWnd, HMENU hMenu)
 {
    BOOL Result = FALSE;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    PMENU_OBJECT Menu;
    DECLARE_RETURN(BOOL);
 
@@ -3509,8 +3411,7 @@ CLEANUP:
 LONG FASTCALL
 co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
 {
-   PWINDOW_OBJECT Window, Parent;
-   PWND Wnd;
+   PWND Window, Parent;
    PWINSTATION_OBJECT WindowStation;
    LONG OldValue;
    STYLESTRUCT Style;
@@ -3526,19 +3427,15 @@ co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
       return( 0);
    }
 
-   Wnd = Window->Wnd;
-
-   if (!Wnd) return 0; // No go on zero.
-
    if ((INT)Index >= 0)
    {
-      if ((Index + sizeof(LONG)) > Wnd->cbwndExtra)
+      if ((Index + sizeof(LONG)) > Window->cbwndExtra)
       {
          SetLastWin32Error(ERROR_INVALID_INDEX);
          return( 0);
       }
 
-      OldValue = *((LONG *)((PCHAR)(Wnd + 1) + Index));
+      OldValue = *((LONG *)((PCHAR)(Window + 1) + Index));
 /*
       if ( Index == DWLP_DLGPROC && Wnd->state & WNDS_DIALOGWINDOW)
       {
@@ -3548,21 +3445,21 @@ co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
          if (!OldValue) return 0;
       }
 */
-      *((LONG *)((PCHAR)(Wnd + 1) + Index)) = NewValue;
+      *((LONG *)((PCHAR)(Window + 1) + Index)) = NewValue;
    }
    else
    {
       switch (Index)
       {
          case GWL_EXSTYLE:
-            OldValue = (LONG) Wnd->ExStyle;
+            OldValue = (LONG) Window->ExStyle;
             Style.styleOld = OldValue;
             Style.styleNew = NewValue;
 
             /*
              * Remove extended window style bit WS_EX_TOPMOST for shell windows.
              */
-            WindowStation = Window->pti->rpdesk->rpwinstaParent;
+            WindowStation = Window->head.pti->rpdesk->rpwinstaParent;
             if(WindowStation)
             {
                if (hWnd == WindowStation->ShellWindow || hWnd == WindowStation->ShellListView)
@@ -3570,54 +3467,54 @@ co_UserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
             }
 
             co_IntSendMessage(hWnd, WM_STYLECHANGING, GWL_EXSTYLE, (LPARAM) &Style);
-            Wnd->ExStyle = (DWORD)Style.styleNew;
+            Window->ExStyle = (DWORD)Style.styleNew;
             co_IntSendMessage(hWnd, WM_STYLECHANGED, GWL_EXSTYLE, (LPARAM) &Style);
             break;
 
          case GWL_STYLE:
-            OldValue = (LONG) Wnd->style;
+            OldValue = (LONG) Window->style;
             Style.styleOld = OldValue;
             Style.styleNew = NewValue;
             co_IntSendMessage(hWnd, WM_STYLECHANGING, GWL_STYLE, (LPARAM) &Style);
-            Wnd->style = (DWORD)Style.styleNew;
+            Window->style = (DWORD)Style.styleNew;
             co_IntSendMessage(hWnd, WM_STYLECHANGED, GWL_STYLE, (LPARAM) &Style);
             break;
 
          case GWL_WNDPROC:
          {
-            if ( Wnd->head.pti->ppi != PsGetCurrentProcessWin32Process() ||
-                 Wnd->fnid & FNID_FREED)
+            if ( Window->head.pti->ppi != PsGetCurrentProcessWin32Process() ||
+                 Window->fnid & FNID_FREED)
             {
                SetLastWin32Error(ERROR_ACCESS_DENIED);
                return( 0);
             }
-            OldValue = (LONG)IntSetWindowProc(Wnd,
+            OldValue = (LONG)IntSetWindowProc(Window,
                                               (WNDPROC)NewValue,
                                               Ansi);
             break;
          }
 
          case GWL_HINSTANCE:
-            OldValue = (LONG) Wnd->hModule;
-            Wnd->hModule = (HINSTANCE) NewValue;
+            OldValue = (LONG) Window->hModule;
+            Window->hModule = (HINSTANCE) NewValue;
             break;
 
          case GWL_HWNDPARENT:
             Parent = Window->spwndParent;
-            if (Parent && (Parent->hSelf == IntGetDesktopWindow()))
-               OldValue = (LONG) IntSetOwner(Window->hSelf, (HWND) NewValue);
+            if (Parent && (Parent->head.h == IntGetDesktopWindow()))
+               OldValue = (LONG) IntSetOwner(Window->head.h, (HWND) NewValue);
             else
-               OldValue = (LONG) co_UserSetParent(Window->hSelf, (HWND) NewValue);
+               OldValue = (LONG) co_UserSetParent(Window->head.h, (HWND) NewValue);
             break;
 
          case GWL_ID:
-            OldValue = (LONG) Wnd->IDMenu;
-            Wnd->IDMenu = (UINT) NewValue;
+            OldValue = (LONG) Window->IDMenu;
+            Window->IDMenu = (UINT) NewValue;
             break;
 
          case GWL_USERDATA:
-            OldValue = Wnd->dwUserData;
-            Wnd->dwUserData = NewValue;
+            OldValue = Window->dwUserData;
+            Window->dwUserData = NewValue;
             break;
 
          default:
@@ -3670,7 +3567,7 @@ CLEANUP:
 WORD APIENTRY
 NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewValue)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    WORD OldValue;
    DECLARE_RETURN(WORD);
 
@@ -3687,7 +3584,7 @@ NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewValue)
       case GWL_ID:
       case GWL_HINSTANCE:
       case GWL_HWNDPARENT:
-         RETURN( co_UserSetWindowLong(Window->hSelf, Index, (UINT)NewValue, TRUE));
+         RETURN( co_UserSetWindowLong(Window->head.h, Index, (UINT)NewValue, TRUE));
       default:
          if (Index < 0)
          {
@@ -3696,14 +3593,14 @@ NtUserSetWindowWord(HWND hWnd, INT Index, WORD NewValue)
          }
    }
 
-   if (Index > Window->Wnd->cbwndExtra - sizeof(WORD))
+   if (Index > Window->cbwndExtra - sizeof(WORD))
    {
       SetLastWin32Error(ERROR_INVALID_PARAMETER);
       RETURN( 0);
    }
 
-   OldValue = *((WORD *)((PCHAR)(Window->Wnd + 1) + Index));
-   *((WORD *)((PCHAR)(Window->Wnd + 1) + Index)) = NewValue;
+   OldValue = *((WORD *)((PCHAR)(Window + 1) + Index));
+   *((WORD *)((PCHAR)(Window + 1) + Index)) = NewValue;
 
    RETURN( OldValue);
 
@@ -3720,7 +3617,6 @@ BOOL APIENTRY
 NtUserGetWindowPlacement(HWND hWnd,
                          WINDOWPLACEMENT *lpwndpl)
 {
-   PWINDOW_OBJECT Window;
    PWND Wnd;
    POINT Size;
    WINDOWPLACEMENT Safepl;
@@ -3730,11 +3626,10 @@ NtUserGetWindowPlacement(HWND hWnd,
    DPRINT("Enter NtUserGetWindowPlacement\n");
    UserEnterShared();
 
-   if (!(Window = UserGetWindowObject(hWnd)))
+   if (!(Wnd = UserGetWindowObject(hWnd)))
    {
       RETURN( FALSE);
    }
-   Wnd = Window->Wnd;
 
    Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
    if(!NT_SUCCESS(Status))
@@ -3752,7 +3647,7 @@ NtUserGetWindowPlacement(HWND hWnd,
    {
       Safepl.showCmd = SW_HIDE;
    }
-   else if ((0 != (Window->state & WINDOWOBJECT_RESTOREMAX) ||
+   else if ((0 != (Wnd->state2 & WNDS2_MAXIMIZEBUTTONDOWN) ||
             0 != (Wnd->style & WS_MAXIMIZE)) &&
             0 == (Wnd->style & WS_MINIMIZE))
    {
@@ -3769,7 +3664,7 @@ NtUserGetWindowPlacement(HWND hWnd,
 
    Size.x = Wnd->rcWindow.left;
    Size.y = Wnd->rcWindow.top;
-   WinPosInitInternalPos(Window, &Size,
+   WinPosInitInternalPos(Wnd, &Size,
                          &Wnd->rcWindow);
 
    Safepl.rcNormalPosition = Wnd->InternalPos.NormalRect;
@@ -3841,7 +3736,6 @@ NtUserMoveWindow(
 DWORD APIENTRY
 NtUserQueryWindow(HWND hWnd, DWORD Index)
 {
-   PWINDOW_OBJECT Window;
    PWND pWnd;
    DWORD Result;
    DECLARE_RETURN(UINT);
@@ -3849,21 +3743,19 @@ NtUserQueryWindow(HWND hWnd, DWORD Index)
    DPRINT("Enter NtUserQueryWindow\n");
    UserEnterShared();
 
-   if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+   if (!(pWnd = UserGetWindowObject(hWnd)))
    {
       RETURN( 0);
    }
 
-   pWnd = Window->Wnd;
-
    switch(Index)
    {
       case QUERY_WINDOW_UNIQUE_PROCESS_ID:
-         Result = (DWORD)IntGetWndProcessId(Window);
+         Result = (DWORD)IntGetWndProcessId(pWnd);
          break;
 
       case QUERY_WINDOW_UNIQUE_THREAD_ID:
-         Result = (DWORD)IntGetWndThreadId(Window);
+         Result = (DWORD)IntGetWndThreadId(pWnd);
          break;
 
       case QUERY_WINDOW_ACTIVE:
@@ -3875,7 +3767,7 @@ NtUserQueryWindow(HWND hWnd, DWORD Index)
          break;
 
       case QUERY_WINDOW_ISHUNG:
-         Result = (DWORD)MsqIsHung(Window->pti->MessageQueue);
+         Result = (DWORD)MsqIsHung(pWnd->head.pti->MessageQueue);
          break;
 
       case QUERY_WINDOW_REAL_ID:
@@ -4013,7 +3905,7 @@ NtUserSetMenu(
    HMENU Menu,
    BOOL Repaint)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    BOOL Changed;
    DECLARE_RETURN(BOOL);
 
@@ -4057,18 +3949,16 @@ BOOL APIENTRY
 NtUserSetWindowFNID(HWND hWnd,
                     WORD fnID)
 {
-   PWINDOW_OBJECT Window;
    PWND Wnd;
    DECLARE_RETURN(BOOL);
 
    DPRINT("Enter NtUserSetWindowFNID\n");
    UserEnterExclusive();
 
-   if (!(Window = UserGetWindowObject(hWnd)))
+   if (!(Wnd = UserGetWindowObject(hWnd)))
    {
       RETURN( FALSE);
    }
-   Wnd = Window->Wnd;
 
    if (Wnd->pcls)
    {  // From user land we only set these.
@@ -4095,7 +3985,6 @@ BOOL APIENTRY
 NtUserSetWindowPlacement(HWND hWnd,
                          WINDOWPLACEMENT *lpwndpl)
 {
-   PWINDOW_OBJECT Window;
    PWND Wnd;
    WINDOWPLACEMENT Safepl;
    NTSTATUS Status;
@@ -4105,11 +3994,10 @@ NtUserSetWindowPlacement(HWND hWnd,
    DPRINT("Enter NtUserSetWindowPlacement\n");
    UserEnterExclusive();
 
-   if (!(Window = UserGetWindowObject(hWnd)))
+   if (!(Wnd = UserGetWindowObject(hWnd)))
    {
       RETURN( FALSE);
    }
-   Wnd = Window->Wnd;
 
    Status = MmCopyFromCaller(&Safepl, lpwndpl, sizeof(WINDOWPLACEMENT));
    if(!NT_SUCCESS(Status))
@@ -4122,11 +4010,11 @@ NtUserSetWindowPlacement(HWND hWnd,
       RETURN( FALSE);
    }
 
-   UserRefObjectCo(Window, &Ref);
+   UserRefObjectCo(Wnd, &Ref);
 
    if ((Wnd->style & (WS_MAXIMIZE | WS_MINIMIZE)) == 0)
    {
-      co_WinPosSetWindowPos(Window, NULL,
+      co_WinPosSetWindowPos(Wnd, NULL,
                             Safepl.rcNormalPosition.left, Safepl.rcNormalPosition.top,
                             Safepl.rcNormalPosition.right - Safepl.rcNormalPosition.left,
                             Safepl.rcNormalPosition.bottom - Safepl.rcNormalPosition.top,
@@ -4134,14 +4022,14 @@ NtUserSetWindowPlacement(HWND hWnd,
    }
 
    /* FIXME - change window status */
-   co_WinPosShowWindow(Window, Safepl.showCmd);
+   co_WinPosShowWindow(Wnd, Safepl.showCmd);
 
    Wnd->InternalPosInitialized = TRUE;
    Wnd->InternalPos.NormalRect = Safepl.rcNormalPosition;
    Wnd->InternalPos.IconPos = Safepl.ptMinPosition;
    Wnd->InternalPos.MaxPos = Safepl.ptMaxPosition;
 
-   UserDerefObjectCo(Window);
+   UserDerefObjectCo(Wnd);
    RETURN(TRUE);
 
 CLEANUP:
@@ -4165,7 +4053,7 @@ NtUserSetWindowPos(
    UINT uFlags)
 {
    DECLARE_RETURN(BOOL);
-   PWINDOW_OBJECT Window;
+   PWND Window;
    BOOL ret;
    USER_REFERENCE_ENTRY Ref;
 
@@ -4207,12 +4095,11 @@ CLEANUP:
 
 
 INT FASTCALL
-IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn)
+IntGetWindowRgn(PWND Window, HRGN hRgn)
 {
    INT Ret;
    HRGN VisRgn;
    ROSRGNDATA *pRgn;
-   PWND Wnd;
 
    if(!Window)
    {
@@ -4223,13 +4110,11 @@ IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn)
       return ERROR;
    }
 
-   Wnd = Window->Wnd;
-
    /* Create a new window region using the window rectangle */
-   VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
-   NtGdiOffsetRgn(VisRgn, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
+   VisRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow);
+   NtGdiOffsetRgn(VisRgn, -Window->rcWindow.left, -Window->rcWindow.top);
    /* if there's a region assigned to the window, combine them both */
-   if(Window->hrgnClip && !(Wnd->style & WS_MINIMIZE))
+   if(Window->hrgnClip && !(Window->style & WS_MINIMIZE))
       NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND);
    /* Copy the region into hRgn */
    NtGdiCombineRgn(hRgn, VisRgn, NULL, RGN_COPY);
@@ -4248,12 +4133,11 @@ IntGetWindowRgn(PWINDOW_OBJECT Window, HRGN hRgn)
 }
 
 INT FASTCALL
-IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECTL *Rect)
+IntGetWindowRgnBox(PWND Window, RECTL *Rect)
 {
    INT Ret;
    HRGN VisRgn;
    ROSRGNDATA *pRgn;
-   PWND Wnd;
 
    if(!Window)
    {
@@ -4264,13 +4148,11 @@ IntGetWindowRgnBox(PWINDOW_OBJECT Window, RECTL *Rect)
       return ERROR;
    }
 
-   Wnd = Window->Wnd;
-
    /* Create a new window region using the window rectangle */
-   VisRgn = IntSysCreateRectRgnIndirect(&Window->Wnd->rcWindow);
-   NtGdiOffsetRgn(VisRgn, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
+   VisRgn = IntSysCreateRectRgnIndirect(&Window->rcWindow);
+   NtGdiOffsetRgn(VisRgn, -Window->rcWindow.left, -Window->rcWindow.top);
    /* if there's a region assigned to the window, combine them both */
-   if(Window->hrgnClip && !(Wnd->style & WS_MINIMIZE))
+   if(Window->hrgnClip && !(Window->style & WS_MINIMIZE))
       NtGdiCombineRgn(VisRgn, VisRgn, Window->hrgnClip, RGN_AND);
 
    if((pRgn = RGNOBJAPI_Lock(VisRgn, NULL)))
@@ -4298,7 +4180,7 @@ NtUserSetWindowRgn(
    BOOL bRedraw)
 {
    HRGN hrgnCopy;
-   PWINDOW_OBJECT Window;
+   PWND Window;
    DECLARE_RETURN(INT);
 
    DPRINT("Enter NtUserSetWindowRgn\n");
@@ -4354,7 +4236,7 @@ CLEANUP:
 BOOL APIENTRY
 NtUserShowWindow(HWND hWnd, LONG nCmdShow)
 {
-   PWINDOW_OBJECT Window;
+   PWND Window;
    BOOL ret;
    DECLARE_RETURN(BOOL);
    USER_REFERENCE_ENTRY Ref;
@@ -4436,7 +4318,7 @@ NtUserWindowFromPoint(LONG X, LONG Y)
 {
    POINT pt;
    HWND Ret;
-   PWINDOW_OBJECT DesktopWindow = NULL, Window = NULL;
+   PWND DesktopWindow = NULL, Window = NULL;
    DECLARE_RETURN(HWND);
    USER_REFERENCE_ENTRY Ref;
 
@@ -4459,7 +4341,7 @@ NtUserWindowFromPoint(LONG X, LONG Y)
 
       if(Window)
       {
-         Ret = Window->hSelf;
+         Ret = Window->head.h;
 
          RETURN( Ret);
       }
@@ -4490,7 +4372,6 @@ CLEANUP:
 BOOL APIENTRY
 NtUserDefSetText(HWND hWnd, PLARGE_STRING WindowText)
 {
-   PWINDOW_OBJECT Window;
    PWND Wnd;
    LARGE_STRING SafeText;
    UNICODE_STRING UnicodeString;
@@ -4519,12 +4400,11 @@ NtUserDefSetText(HWND hWnd, PLARGE_STRING WindowText)
 
    UserEnterExclusive();
 
-   if(!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+   if(!(Wnd = UserGetWindowObject(hWnd)))
    {
       UserLeave();
       return FALSE;
    }
-   Wnd = Window->Wnd;
 
    // ReactOS uses Unicode and not mixed. Up/Down converting will take time.
    // Brought to you by: The Wine Project! Dysfunctional Thought Processes!
@@ -4603,7 +4483,7 @@ NtUserDefSetText(HWND hWnd, PLARGE_STRING WindowText)
    // In User32, these are called after: NotifyWinEvent EVENT_OBJECT_NAMECHANGE than
    // RepaintButton, StaticRepaint, NtUserCallHwndLock HWNDLOCK_ROUTINE_REDRAWFRAMEANDHOOK, etc.
    /* Send shell notifications */
-   if (!Window->spwndOwner && !IntGetParent(Window))
+   if (!Wnd->spwndOwner && !IntGetParent(Wnd))
    {
       co_IntShellHookNotify(HSHELL_REDRAW, (LPARAM) hWnd);
    }
@@ -4626,7 +4506,6 @@ Exit:
 INT APIENTRY
 NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount)
 {
-   PWINDOW_OBJECT Window;
    PWND Wnd;
    NTSTATUS Status;
    INT Result;
@@ -4641,11 +4520,10 @@ NtUserInternalGetWindowText(HWND hWnd, LPWSTR lpString, INT nMaxCount)
       RETURN( 0);
    }
 
-   if(!(Window = UserGetWindowObject(hWnd)))
+   if(!(Wnd = UserGetWindowObject(hWnd)))
    {
       RETURN( 0);
    }
-   Wnd = Window->Wnd;
 
    Result = Wnd->strName.Length / sizeof(WCHAR);
    if(lpString)
@@ -4687,10 +4565,10 @@ CLEANUP:
 
 BOOL
 FASTCALL
-IntShowOwnedPopups(PWINDOW_OBJECT OwnerWnd, BOOL fShow )
+IntShowOwnedPopups(PWND OwnerWnd, BOOL fShow )
 {
    int count = 0;
-   PWINDOW_OBJECT pWnd;
+   PWND pWnd;
    HWND *win_array;
 
 //   ASSERT(OwnerWnd);
@@ -4711,7 +4589,7 @@ IntShowOwnedPopups(PWINDOW_OBJECT OwnerWnd, BOOL fShow )
 
       if (fShow)
       {
-         if (pWnd->Wnd->state & WNDS_HIDDENPOPUP)
+         if (pWnd->state & WNDS_HIDDENPOPUP)
          {
             /* In Windows, ShowOwnedPopups(TRUE) generates
              * WM_SHOWWINDOW messages with SW_PARENTOPENING,
@@ -4723,7 +4601,7 @@ IntShowOwnedPopups(PWINDOW_OBJECT OwnerWnd, BOOL fShow )
       }
       else
       {
-         if (pWnd->Wnd->style & WS_VISIBLE)
+         if (pWnd->style & WS_VISIBLE)
          {
             /* In Windows, ShowOwnedPopups(FALSE) generates
              * WM_SHOWWINDOW messages with SW_PARENTCLOSING,
@@ -4768,7 +4646,7 @@ NtUserValidateHandleSecure(
      {
        case otWindow:
        {
-         PWINDOW_OBJECT Window;
+         PWND Window;
          if ((Window = UserGetWindowObject((HWND) handle))) return TRUE;
          return FALSE;
        }
index 2d1f77f..7a95626 100644 (file)
 #include <debug.h>
 
 VOID FASTCALL
-co_IntPaintWindows(PWINDOW_OBJECT Window, ULONG Flags, BOOL Recurse);
+co_IntPaintWindows(PWND Window, ULONG Flags, BOOL Recurse);
 
 BOOL FASTCALL
-IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse);
+IntValidateParent(PWND Child, HRGN hValidateRgn, BOOL Recurse);
 
 /* GLOBALS *******************************************************************/
 
@@ -55,7 +55,7 @@ IntValidateParent(PWINDOW_OBJECT Child, HRGN hValidateRgn, BOOL Recurse);
 /* FUNCTIONS *****************************************************************/
 
 BOOL FASTCALL
-IntGetClientOrigin(PWINDOW_OBJECT Window OPTIONAL, LPPOINT Point)
+IntGetClientOrigin(PWND Window OPTIONAL, LPPOINT Point)
 {
    Window = Window ? Window : UserGetWindowObject(IntGetDesktopWindow());
    if (Window == NULL)
@@ -63,14 +63,14 @@ IntGetClientOrigin(PWINDOW_OBJECT Window OPTIONAL, LPPOINT Point)
       Point->x = Point->y = 0;
       return FALSE;
    }
-   Point->x = Window->Wnd->rcClient.left;
-   Point->y = Window->Wnd->rcClient.top;
+   Point->x = Window->rcClient.left;
+   Point->y = Window->rcClient.top;
 
    return TRUE;
 }
 
 BOOL FASTCALL
-UserGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point)
+UserGetClientOrigin(PWND Window, LPPOINT Point)
 {
    BOOL Ret;
    POINT pt;
@@ -108,17 +108,17 @@ UserGetClientOrigin(PWINDOW_OBJECT Window, LPPOINT Point)
  * Check if we can activate the specified window.
  */
 static
-BOOL FASTCALL can_activate_window( PWINDOW_OBJECT Wnd OPTIONAL)
+BOOL FASTCALL can_activate_window( PWND Wnd OPTIONAL)
 {
     LONG style;
 
     if (!Wnd) return FALSE;
-       if (!Wnd->Wnd) return FALSE;
-    style = Wnd->Wnd->style;
+
+    style = Wnd->style;
     if (!(style & WS_VISIBLE) &&
-        Wnd->pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
+        Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
     if ((style & WS_MINIMIZE) &&
-        Wnd->pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
+        Wnd->head.pti->pEThread->ThreadsProcess != CsrProcess) return FALSE;
     if ((style & (WS_POPUP|WS_CHILD)) == WS_CHILD) return FALSE;
     return TRUE;
     /* FIXME: This window could be disable  because the child that closed
@@ -133,25 +133,22 @@ BOOL FASTCALL can_activate_window( PWINDOW_OBJECT Wnd OPTIONAL)
  *  Activates window other than pWnd.
  */
 VOID FASTCALL
-co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
+co_WinPosActivateOtherWindow(PWND Wnd)
 {
-   PWINDOW_OBJECT WndTo = NULL;
+   PWND WndTo = NULL;
    HWND Fg;
    USER_REFERENCE_ENTRY Ref;
-   PWND Wnd;
-
-   ASSERT_REFS_CO(Window);
 
-   Wnd = Window->Wnd;
+   ASSERT_REFS_CO(Wnd);
 
-   if (IntIsDesktopWindow(Window))
+   if (IntIsDesktopWindow(Wnd))
    {
       IntSetFocusMessageQueue(NULL);
       return;
    }
 
    /* If this is popup window, try to activate the owner first. */
-   if ((Wnd->style & WS_POPUP) && (WndTo = Window->spwndOwner))
+   if ((Wnd->style & WS_POPUP) && (WndTo = Wnd->spwndOwner))
    {
       WndTo = UserGetAncestor( WndTo, GA_ROOT );
       if (can_activate_window(WndTo)) goto done;
@@ -159,7 +156,7 @@ co_WinPosActivateOtherWindow(PWINDOW_OBJECT Window)
 
    /* Pick a next top-level window. */
    /* FIXME: Search for non-tooltip windows first. */
-   WndTo = Window;
+   WndTo = Wnd;
    for (;;)
    {
       if (!(WndTo = WndTo->spwndNext)) break;
@@ -171,7 +168,7 @@ done:
    if (WndTo) UserRefObjectCo(WndTo, &Ref);
 
    Fg = UserGetForegroundWindow();
-   if ((!Fg || Window->hSelf == Fg) && WndTo)//fixme: ok if WndTo is NULL??
+   if ((!Fg || Wnd->head.h == Fg) && WndTo)//fixme: ok if WndTo is NULL??
    {
       /* fixme: wine can pass WndTo=NULL to co_IntSetForegroundWindow. hmm */
       if (co_IntSetForegroundWindow(WndTo))
@@ -190,7 +187,7 @@ done:
 
 UINT
 FASTCALL
-co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
+co_WinPosArrangeIconicWindows(PWND parent)
 {
    RECTL rectParent;
    INT i, x, y, xspacing, yspacing;
@@ -209,24 +206,21 @@ co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
 
    for( i = 0; List[i]; i++)
    {
-      PWINDOW_OBJECT WndChild;
-      PWND ChildWnd;
+      PWND Child;
 
-      if (!(WndChild = UserGetWindowObject(List[i])))
+      if (!(Child = UserGetWindowObject(List[i])))
          continue;
 
-      ChildWnd = WndChild->Wnd;
-
-      if((ChildWnd->style & WS_MINIMIZE) != 0 )
+      if((Child->style & WS_MINIMIZE) != 0 )
       {
          USER_REFERENCE_ENTRY Ref;
-         UserRefObjectCo(WndChild, &Ref);
+         UserRefObjectCo(Child, &Ref);
 
-         co_WinPosSetWindowPos(WndChild, 0, x + UserGetSystemMetrics(SM_CXBORDER),
+         co_WinPosSetWindowPos(Child, 0, x + UserGetSystemMetrics(SM_CXBORDER),
                                y - yspacing - UserGetSystemMetrics(SM_CYBORDER)
                                , 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
 
-         UserDerefObjectCo(WndChild);
+         UserDerefObjectCo(Child);
 
          if (x <= rectParent.right - xspacing)
             x += xspacing;
@@ -243,35 +237,34 @@ co_WinPosArrangeIconicWindows(PWINDOW_OBJECT parent)
 
 
 static VOID FASTCALL
-WinPosFindIconPos(PWINDOW_OBJECT Window, POINT *Pos)
+WinPosFindIconPos(PWND Window, POINT *Pos)
 {
    /* FIXME */
 }
 
 VOID FASTCALL
-WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect)
+WinPosInitInternalPos(PWND Wnd, POINT *pt, RECTL *RestoreRect)
 {
-    PWINDOW_OBJECT Parent;
+    PWND Parent;
     UINT XInc, YInc;
-    PWND Wnd = Window->Wnd;
 
    if (!Wnd->InternalPosInitialized)
    {
       RECTL WorkArea;
 
-      Parent = Window->spwndParent;
+      Parent = Wnd->spwndParent;
       if(Parent)
       {
          if(IntIsDesktopWindow(Parent))
              UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
          else
-            WorkArea = Parent->Wnd->rcClient;
+            WorkArea = Parent->rcClient;
       }
       else
          UserSystemParametersInfo(SPI_GETWORKAREA, 0, &WorkArea, 0);
 
-      Wnd->InternalPos.NormalRect = Window->Wnd->rcWindow;
-      IntGetWindowBorderMeasures(Window, &XInc, &YInc);
+      Wnd->InternalPos.NormalRect = Wnd->rcWindow;
+      IntGetWindowBorderMeasures(Wnd, &XInc, &YInc);
       Wnd->InternalPos.MaxPos.x = WorkArea.left - XInc;
       Wnd->InternalPos.MaxPos.y = WorkArea.top - YInc;
       Wnd->InternalPos.IconPos.x = WorkArea.left;
@@ -294,25 +287,23 @@ WinPosInitInternalPos(PWINDOW_OBJECT Window, POINT *pt, RECTL *RestoreRect)
 }
 
 UINT FASTCALL
-co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
+co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos)
 {
    POINT Size;
    UINT SwpFlags = 0;
-   PWND Wnd;
 
-   ASSERT_REFS_CO(Window);
-   Wnd = Window->Wnd;
+   ASSERT_REFS_CO(Wnd);
 
    Size.x = Wnd->rcWindow.left;
    Size.y = Wnd->rcWindow.top;
-   WinPosInitInternalPos(Window, &Size, &Wnd->rcWindow);
+   WinPosInitInternalPos(Wnd, &Size, &Wnd->rcWindow);
 
-   if (co_HOOK_CallHooks( WH_CBT, HCBT_MINMAX, (WPARAM)Window->hSelf, ShowFlag))
+   if (co_HOOK_CallHooks( WH_CBT, HCBT_MINMAX, (WPARAM)Wnd->head.h, ShowFlag))
       return SWP_NOSIZE | SWP_NOMOVE;
 
       if (Wnd->style & WS_MINIMIZE)
       {
-         if (!co_IntSendMessageNoWait(Window->hSelf, WM_QUERYOPEN, 0, 0))
+         if (!co_IntSendMessageNoWait(Wnd->head.h, WM_QUERYOPEN, 0, 0))
          {
             return(SWP_NOSIZE | SWP_NOMOVE);
          }
@@ -324,17 +315,17 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
             {
                if (Wnd->style & WS_MAXIMIZE)
                {
-                  Window->state |= WINDOWOBJECT_RESTOREMAX;
+                  Wnd->state2 |= WNDS2_MAXIMIZEBUTTONDOWN;
                   Wnd->style &= ~WS_MAXIMIZE;
                }
                else
                {
-                  Window->state &= ~WINDOWOBJECT_RESTOREMAX;
+                  Wnd->state2 &= ~WNDS2_MAXIMIZEBUTTONDOWN;
                }
-               co_UserRedrawWindow(Window, NULL, 0, RDW_VALIDATE | RDW_NOERASE |
+               co_UserRedrawWindow(Wnd, NULL, 0, RDW_VALIDATE | RDW_NOERASE |
                                    RDW_NOINTERNALPAINT);
                Wnd->style |= WS_MINIMIZE;
-               WinPosFindIconPos(Window, &Wnd->InternalPos.IconPos);
+               WinPosFindIconPos(Wnd, &Wnd->InternalPos.IconPos);
                RECTL_vSetRect(NewPos, Wnd->InternalPos.IconPos.x, Wnd->InternalPos.IconPos.y,
                              UserGetSystemMetrics(SM_CXMINIMIZED),
                              UserGetSystemMetrics(SM_CYMINIMIZED));
@@ -344,7 +335,7 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
 
          case SW_MAXIMIZE:
             {
-               co_WinPosGetMinMaxInfo(Window, &Size, &Wnd->InternalPos.MaxPos,
+               co_WinPosGetMinMaxInfo(Wnd, &Size, &Wnd->InternalPos.MaxPos,
                                       NULL, NULL);
                DPRINT("Maximize: %d,%d %dx%d\n",
                       Wnd->InternalPos.MaxPos.x, Wnd->InternalPos.MaxPos.y, Size.x, Size.y);
@@ -363,9 +354,9 @@ co_WinPosMinMaximize(PWINDOW_OBJECT Window, UINT ShowFlag, RECT* NewPos)
                if (Wnd->style & WS_MINIMIZE)
                {
                   Wnd->style &= ~WS_MINIMIZE;
-                  if (Window->state & WINDOWOBJECT_RESTOREMAX)
+                  if (Wnd->state2 & WNDS2_MAXIMIZEBUTTONDOWN)
                   {
-                     co_WinPosGetMinMaxInfo(Window, &Size,
+                     co_WinPosGetMinMaxInfo(Wnd, &Size,
                                             &Wnd->InternalPos.MaxPos, NULL, NULL);
                      Wnd->style |= WS_MAXIMIZE;
                      RECTL_vSetRect(NewPos, Wnd->InternalPos.MaxPos.x,
@@ -467,22 +458,22 @@ UserAdjustWindowRectEx(LPRECT lpRect,
 }
 
 UINT FASTCALL
-co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
+co_WinPosGetMinMaxInfo(PWND Window, POINT* MaxSize, POINT* MaxPos,
                        POINT* MinTrack, POINT* MaxTrack)
 {
    MINMAXINFO MinMax;
    PMONITOR monitor;
     INT xinc, yinc;
-    LONG style = Window->Wnd->style;
+    LONG style = Window->style;
     LONG adjustedStyle;
-    LONG exstyle = Window->Wnd->ExStyle;
+    LONG exstyle = Window->ExStyle;
     RECT rc;
 
     ASSERT_REFS_CO(Window);
 
     /* Compute default values */
 
-    rc = Window->Wnd->rcWindow;
+    rc = Window->rcWindow;
     MinMax.ptReserved.x = rc.left;
     MinMax.ptReserved.y = rc.top;
 
@@ -491,9 +482,9 @@ co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
     else
         adjustedStyle = style;
 
-    if(Window->Wnd->spwndParent)
+    if(Window->spwndParent)
         IntGetClientRect(Window->spwndParent, &rc);
-    UserAdjustWindowRectEx(&rc, adjustedStyle, ((style & WS_POPUP) && Window->Wnd->IDMenu), exstyle);
+    UserAdjustWindowRectEx(&rc, adjustedStyle, ((style & WS_POPUP) && Window->IDMenu), exstyle);
 
     xinc = -rc.left;
     yinc = -rc.top;
@@ -517,7 +508,7 @@ co_WinPosGetMinMaxInfo(PWINDOW_OBJECT Window, POINT* MaxSize, POINT* MaxPos,
 
     //if (!EMPTYPOINT(win->max_pos)) MinMax.ptMaxPosition = win->max_pos;
 
-   co_IntSendMessage(Window->hSelf, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax);
+   co_IntSendMessage(Window->head.h, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax);
 
     /* if the app didn't change the values, adapt them for the current monitor */
     if ((monitor = IntGetPrimaryMonitor()))
@@ -603,15 +594,13 @@ FixClientRect(PRECTL ClientRect, PRECTL WindowRect)
 
 static
 LONG FASTCALL
-co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
+co_WinPosDoNCCALCSize(PWND Window, PWINDOWPOS WinPos,
                       RECT* WindowRect, RECT* ClientRect)
 {
-   PWINDOW_OBJECT Parent;
+   PWND Parent;
    UINT wvrFlags = 0;
-   PWND Wnd;
 
    ASSERT_REFS_CO(Window);
-   Wnd = Window->Wnd;
 
    /* Send WM_NCCALCSIZE message to get new client area */
    if ((WinPos->flags & (SWP_FRAMECHANGED | SWP_NOSIZE)) != SWP_NOSIZE)
@@ -620,48 +609,48 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
       WINDOWPOS winposCopy;
 
       params.rgrc[0] = *WindowRect;
-      params.rgrc[1] = Window->Wnd->rcWindow;
-      params.rgrc[2] = Window->Wnd->rcClient;
+      params.rgrc[1] = Window->rcWindow;
+      params.rgrc[2] = Window->rcClient;
       Parent = Window->spwndParent;
-      if (0 != (Wnd->style & WS_CHILD) && Parent)
+      if (0 != (Window->style & WS_CHILD) && Parent)
       {
-         RECTL_vOffsetRect(&(params.rgrc[0]), - Parent->Wnd->rcClient.left,
-                          - Parent->Wnd->rcClient.top);
-         RECTL_vOffsetRect(&(params.rgrc[1]), - Parent->Wnd->rcClient.left,
-                          - Parent->Wnd->rcClient.top);
-         RECTL_vOffsetRect(&(params.rgrc[2]), - Parent->Wnd->rcClient.left,
-                          - Parent->Wnd->rcClient.top);
+         RECTL_vOffsetRect(&(params.rgrc[0]), - Parent->rcClient.left,
+                          - Parent->rcClient.top);
+         RECTL_vOffsetRect(&(params.rgrc[1]), - Parent->rcClient.left,
+                          - Parent->rcClient.top);
+         RECTL_vOffsetRect(&(params.rgrc[2]), - Parent->rcClient.left,
+                          - Parent->rcClient.top);
       }
       params.lppos = &winposCopy;
       winposCopy = *WinPos;
 
-      wvrFlags = co_IntSendMessageNoWait(Window->hSelf, WM_NCCALCSIZE, TRUE, (LPARAM) &params);
+      wvrFlags = co_IntSendMessageNoWait(Window->head.h, WM_NCCALCSIZE, TRUE, (LPARAM) &params);
 
       /* If the application send back garbage, ignore it */
       if (params.rgrc[0].left <= params.rgrc[0].right &&
           params.rgrc[0].top <= params.rgrc[0].bottom)
       {
          *ClientRect = params.rgrc[0];
-         if ((Wnd->style & WS_CHILD) && Parent)
+         if ((Window->style & WS_CHILD) && Parent)
          {
-            RECTL_vOffsetRect(ClientRect, Parent->Wnd->rcClient.left,
-                             Parent->Wnd->rcClient.top);
+            RECTL_vOffsetRect(ClientRect, Parent->rcClient.left,
+                             Parent->rcClient.top);
          }
          FixClientRect(ClientRect, WindowRect);
       }
 
       /* FIXME: WVR_ALIGNxxx */
 
-      if (ClientRect->left != Wnd->rcClient.left ||
-          ClientRect->top != Wnd->rcClient.top)
+      if (ClientRect->left != Window->rcClient.left ||
+          ClientRect->top != Window->rcClient.top)
       {
          WinPos->flags &= ~SWP_NOCLIENTMOVE;
       }
 
       if ((ClientRect->right - ClientRect->left !=
-            Wnd->rcClient.right - Wnd->rcClient.left) ||
+            Window->rcClient.right - Window->rcClient.left) ||
             (ClientRect->bottom - ClientRect->top !=
-             Wnd->rcClient.bottom - Wnd->rcClient.top))
+             Window->rcClient.bottom - Window->rcClient.top))
       {
          WinPos->flags &= ~SWP_NOCLIENTSIZE;
       }
@@ -669,8 +658,8 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
    else
    {
       if (! (WinPos->flags & SWP_NOMOVE)
-            && (ClientRect->left != Wnd->rcClient.left ||
-                ClientRect->top != Wnd->rcClient.top))
+            && (ClientRect->left != Window->rcClient.left ||
+                ClientRect->top != Window->rcClient.top))
       {
          WinPos->flags &= ~SWP_NOCLIENTMOVE;
       }
@@ -681,24 +670,22 @@ co_WinPosDoNCCALCSize(PWINDOW_OBJECT Window, PWINDOWPOS WinPos,
 
 static
 BOOL FASTCALL
-co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window,
+co_WinPosDoWinPosChanging(PWND Window,
                           PWINDOWPOS WinPos,
                           PRECTL WindowRect,
                           PRECTL ClientRect)
 {
    INT X, Y;
-   PWND Wnd;
 
    ASSERT_REFS_CO(Window);
-   Wnd = Window->Wnd;
 
    if (!(WinPos->flags & SWP_NOSENDCHANGING))
    {
-      co_IntSendMessageNoWait(Window->hSelf, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos);
+      co_IntSendMessageNoWait(Window->head.h, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos);
    }
 
-   *WindowRect = Wnd->rcWindow;
-   *ClientRect = Wnd->rcClient;
+   *WindowRect = Window->rcWindow;
+   *ClientRect = Window->rcClient;
 
    if (!(WinPos->flags & SWP_NOSIZE))
    {
@@ -708,23 +695,23 @@ co_WinPosDoWinPosChanging(PWINDOW_OBJECT Window,
 
    if (!(WinPos->flags & SWP_NOMOVE))
    {
-      PWINDOW_OBJECT Parent;
+      PWND Parent;
       X = WinPos->x;
       Y = WinPos->y;
       Parent = Window->spwndParent;
-      if ((0 != (Wnd->style & WS_CHILD)) && Parent)
+      if ((0 != (Window->style & WS_CHILD)) && Parent)
       {
-         X += Parent->Wnd->rcClient.left;
-         Y += Parent->Wnd->rcClient.top;
+         X += Parent->rcClient.left;
+         Y += Parent->rcClient.top;
       }
 
       WindowRect->left = X;
       WindowRect->top = Y;
-      WindowRect->right += X - Wnd->rcWindow.left;
-      WindowRect->bottom += Y - Wnd->rcWindow.top;
+      WindowRect->right += X - Window->rcWindow.left;
+      WindowRect->bottom += Y - Window->rcWindow.top;
       RECTL_vOffsetRect(ClientRect,
-                       X - Wnd->rcWindow.left,
-                       Y - Wnd->rcWindow.top);
+                       X - Window->rcWindow.left,
+                       Y - Window->rcWindow.top);
    }
 
    WinPos->flags |= SWP_NOCLIENTMOVE | SWP_NOCLIENTSIZE;
@@ -743,12 +730,12 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
    HWND *List = NULL;
    HWND Owner;
    LONG Style;
-   PWINDOW_OBJECT Window ,DesktopWindow, ChildObject;
+   PWND Window ,DesktopWindow, ChildObject;
    int i;
 
    Window = UserGetWindowObject(hWnd);
-   Owner = Window->spwndOwner ? Window->spwndOwner->hSelf : NULL;
-   Style = Window->Wnd->style;
+   Owner = Window->spwndOwner ? Window->spwndOwner->head.h : NULL;
+   Style = Window->style;
 
    if ((Style & WS_POPUP) && Owner)
    {
@@ -771,7 +758,7 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
                   ChildObject = UserGetWindowObject(List[i]);
                   if (NULL != ChildObject)
                   {
-                     if (0 == (ChildObject->Wnd->ExStyle & WS_EX_TOPMOST))
+                     if (0 == (ChildObject->ExStyle & WS_EX_TOPMOST))
                      {
                         break;
                      }
@@ -800,7 +787,7 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
    {
       for (i = 0; List[i]; i++)
       {
-         PWINDOW_OBJECT Wnd;
+         PWND Wnd;
 
          if (List[i] == hWnd)
             break;
@@ -808,7 +795,7 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
          if (!(Wnd = UserGetWindowObject(List[i])))
             continue;
 
-         if (Wnd->Wnd->style & WS_POPUP && Wnd->spwndOwner == Window)
+         if (Wnd->style & WS_POPUP && Wnd->spwndOwner == Window)
          {
             USER_REFERENCE_ENTRY Ref;
             UserRefObjectCo(Wnd, &Ref);
@@ -835,21 +822,21 @@ WinPosDoOwnedPopups(HWND hWnd, HWND hWndInsertAfter)
  */
 static
 VOID FASTCALL
-WinPosInternalMoveWindow(PWINDOW_OBJECT Window, INT MoveX, INT MoveY)
+WinPosInternalMoveWindow(PWND Window, INT MoveX, INT MoveY)
 {
-   PWINDOW_OBJECT Child;
+   PWND Child;
 
    ASSERT(Window != Window->spwndChild);
 
-   Window->Wnd->rcWindow.left += MoveX;
-   Window->Wnd->rcWindow.right += MoveX;
-   Window->Wnd->rcWindow.top += MoveY;
-   Window->Wnd->rcWindow.bottom += MoveY;
+   Window->rcWindow.left += MoveX;
+   Window->rcWindow.right += MoveX;
+   Window->rcWindow.top += MoveY;
+   Window->rcWindow.bottom += MoveY;
 
-   Window->Wnd->rcClient.left += MoveX;
-   Window->Wnd->rcClient.right += MoveX;
-   Window->Wnd->rcClient.top += MoveY;
-   Window->Wnd->rcClient.bottom += MoveY;
+   Window->rcClient.left += MoveX;
+   Window->rcClient.right += MoveX;
+   Window->rcClient.top += MoveY;
+   Window->rcClient.bottom += MoveY;
 
    for(Child = Window->spwndChild; Child; Child = Child->spwndNext)
    {
@@ -864,12 +851,8 @@ WinPosInternalMoveWindow(PWINDOW_OBJECT Window, INT MoveX, INT MoveY)
  */
 static
 BOOL FASTCALL
-WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
+WinPosFixupFlags(WINDOWPOS *WinPos, PWND Wnd)
 {
-   PWND Wnd = Window->Wnd;
-
-   if (!Wnd) return FALSE;
-
    if (Wnd->style & WS_VISIBLE)
    {
       WinPos->flags &= ~SWP_SHOWWINDOW;
@@ -945,7 +928,7 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
             && HWND_NOTOPMOST != WinPos->hwndInsertAfter
             && HWND_BOTTOM != WinPos->hwndInsertAfter)
       {
-         PWINDOW_OBJECT InsAfterWnd, Parent = Window->spwndParent;
+         PWND InsAfterWnd, Parent = Wnd->spwndParent;
 
          InsAfterWnd = UserGetWindowObject(WinPos->hwndInsertAfter);
 
@@ -961,7 +944,7 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
              * itself.
              */
             if ((WinPos->hwnd == WinPos->hwndInsertAfter) ||
-                ((InsAfterWnd->spwndNext) && (WinPos->hwnd == InsAfterWnd->spwndNext->hSelf)))
+                ((InsAfterWnd->spwndNext) && (WinPos->hwnd == InsAfterWnd->spwndNext->head.h)))
             {
                WinPos->flags |= SWP_NOZORDER;
             }
@@ -975,7 +958,7 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWINDOW_OBJECT Window)
 /* x and y are always screen relative */
 BOOLEAN FASTCALL
 co_WinPosSetWindowPos(
-   PWINDOW_OBJECT Window,
+   PWND Window,
    HWND WndInsertAfter,
    INT x,
    INT y,
@@ -999,24 +982,22 @@ co_WinPosSetWindowPos(
    HDC Dc;
    RECTL CopyRect;
    RECTL TempRect;
-   PWINDOW_OBJECT Ancestor;
+   PWND Ancestor;
 
    ASSERT_REFS_CO(Window);
 
-   if (!Window->Wnd) return FALSE;
-
    /* FIXME: Get current active window from active queue. */
    /*
     * Only allow CSRSS to mess with the desktop window
     */
 
-   if ( Window->hSelf == IntGetDesktopWindow() &&
-        Window->pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
+   if ( Window->head.h == IntGetDesktopWindow() &&
+        Window->head.pti->pEThread->ThreadsProcess != PsGetCurrentProcess())
    {
       return FALSE;
    }
 
-   WinPos.hwnd = Window->hSelf;
+   WinPos.hwnd = Window->head.h;
    WinPos.hwndInsertAfter = WndInsertAfter;
    WinPos.x = x;
    WinPos.y = y;
@@ -1043,7 +1024,7 @@ co_WinPosSetWindowPos(
    Ancestor = UserGetAncestor(Window, GA_PARENT);
    if ( (WinPos.flags & (SWP_NOZORDER | SWP_HIDEWINDOW | SWP_SHOWWINDOW)) !=
          SWP_NOZORDER &&
-         Ancestor && Ancestor->hSelf == IntGetDesktopWindow() )
+         Ancestor && Ancestor->head.h == IntGetDesktopWindow() )
    {
       WinPos.hwndInsertAfter = WinPosDoOwnedPopups(WinPos.hwnd, WinPos.hwndInsertAfter);
    }
@@ -1070,7 +1051,7 @@ co_WinPosSetWindowPos(
          else if(VisRgn)
          {
             RGNOBJAPI_Unlock(VisRgn);
-            NtGdiOffsetRgn(VisBefore, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
+            NtGdiOffsetRgn(VisBefore, -Window->rcWindow.left, -Window->rcWindow.top);
          }
       }
    }
@@ -1085,8 +1066,8 @@ co_WinPosSetWindowPos(
       IntLinkHwnd(Window, WndInsertAfter);
    }
 
-   OldWindowRect = Window->Wnd->rcWindow;
-   OldClientRect = Window->Wnd->rcClient;
+   OldWindowRect = Window->rcWindow;
+   OldClientRect = Window->rcClient;
 
    if (OldClientRect.bottom - OldClientRect.top ==
          NewClientRect.bottom - NewClientRect.top)
@@ -1110,8 +1091,8 @@ co_WinPosSetWindowPos(
                                NewClientRect.top - OldClientRect.top);
    }
 
-   Window->Wnd->rcWindow = NewWindowRect;
-   Window->Wnd->rcClient = NewClientRect;
+   Window->rcWindow = NewWindowRect;
+   Window->rcClient = NewClientRect;
 
    if (!(WinPos.flags & SWP_SHOWWINDOW) && (WinPos.flags & SWP_HIDEWINDOW))
    {
@@ -1121,21 +1102,21 @@ co_WinPosSetWindowPos(
                            0,
                            RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_ALLCHILDREN);
 
-      if ((Window->Wnd->style & WS_VISIBLE) &&
+      if ((Window->style & WS_VISIBLE) &&
           Window->spwndParent == UserGetDesktopWindow())
       {
-         co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM)Window->hSelf);
+         co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (LPARAM)Window->head.h);
       }
-      Window->Wnd->style &= ~WS_VISIBLE;
+      Window->style &= ~WS_VISIBLE;
    }
    else if (WinPos.flags & SWP_SHOWWINDOW)
    {
-      if (!(Window->Wnd->style & WS_VISIBLE) &&
+      if (!(Window->style & WS_VISIBLE) &&
            Window->spwndParent == UserGetDesktopWindow() )
       {
-         co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)Window->hSelf);
+         co_IntShellHookNotify(HSHELL_WINDOWCREATED, (LPARAM)Window->head.h);
       }
-      Window->Wnd->style |= WS_VISIBLE;
+      Window->style |= WS_VISIBLE;
    }
 
    if (Window->hrgnUpdate != NULL && Window->hrgnUpdate != (HRGN)1)
@@ -1164,7 +1145,7 @@ co_WinPosSetWindowPos(
       else if(VisRgn)
       {
          RGNOBJAPI_Unlock(VisRgn);
-         NtGdiOffsetRgn(VisAfter, -Window->Wnd->rcWindow.left, -Window->Wnd->rcWindow.top);
+         NtGdiOffsetRgn(VisAfter, -Window->rcWindow.left, -Window->rcWindow.top);
       }
 
       /*
@@ -1178,7 +1159,7 @@ co_WinPosSetWindowPos(
            VisAfter != NULL &&
           !(WinPos.flags & SWP_NOCOPYBITS) &&
           ((WinPos.flags & SWP_NOSIZE) || !(WvrFlags & WVR_REDRAW)) &&
-          !(Window->Wnd->ExStyle & WS_EX_TRANSPARENT) )
+          !(Window->ExStyle & WS_EX_TRANSPARENT) )
       {
          CopyRgn = IntSysCreateRectRgn(0, 0, 0, 0);
          RgnType = NtGdiCombineRgn(CopyRgn, VisAfter, VisBefore, RGN_AND);
@@ -1296,14 +1277,14 @@ co_WinPosSetWindowPos(
          GreDeleteObject(DirtyRgn);
          */
 
-            PWINDOW_OBJECT Parent = Window->spwndParent;
+            PWND Parent = Window->spwndParent;
 
             NtGdiOffsetRgn( DirtyRgn,
-                            Window->Wnd->rcWindow.left,
-                            Window->Wnd->rcWindow.top);
-            if ( (Window->Wnd->style & WS_CHILD) &&
+                            Window->rcWindow.left,
+                            Window->rcWindow.top);
+            if ( (Window->style & WS_CHILD) &&
                  (Parent) &&
-                !(Parent->Wnd->style & WS_CLIPCHILDREN))
+                !(Parent->style & WS_CLIPCHILDREN))
             {
                IntInvalidateWindows( Parent,
                                      DirtyRgn,
@@ -1354,7 +1335,7 @@ co_WinPosSetWindowPos(
 
       if (!(WinPos.flags & SWP_NOACTIVATE))
       {
-         if ((Window->Wnd->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
+         if ((Window->style & (WS_CHILD | WS_POPUP)) == WS_CHILD)
          {
             co_IntSendMessageNoWait(WinPos.hwnd, WM_CHILDACTIVATE, 0, 0);
          }
@@ -1381,14 +1362,14 @@ co_WinPosSetWindowPos(
 }
 
 LRESULT FASTCALL
-co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECT* WindowRect, RECT* ClientRect)
+co_WinPosGetNonClientSize(PWND Window, RECT* WindowRect, RECT* ClientRect)
 {
    LRESULT Result;
 
    ASSERT_REFS_CO(Window);
 
    *ClientRect = *WindowRect;
-   Result = co_IntSendMessageNoWait(Window->hSelf, WM_NCCALCSIZE, FALSE, (LPARAM) ClientRect);
+   Result = co_IntSendMessageNoWait(Window->head.h, WM_NCCALCSIZE, FALSE, (LPARAM) ClientRect);
 
    FixClientRect(ClientRect, WindowRect);
 
@@ -1396,12 +1377,11 @@ co_WinPosGetNonClientSize(PWINDOW_OBJECT Window, RECT* WindowRect, RECT* ClientR
 }
 
 void FASTCALL
-co_WinPosSendSizeMove(PWINDOW_OBJECT Window)
+co_WinPosSendSizeMove(PWND Wnd)
 {
     WPARAM wParam = SIZE_RESTORED;
-    PWND Wnd = Window->Wnd;
 
-    Window->state &= ~WINDOWOBJECT_NEED_SIZE;
+    Wnd->state &= ~WNDS_SENDSIZEMOVEMSGS;
     if (Wnd->style & WS_MAXIMIZE)
     {
         wParam = SIZE_MAXIMIZED;
@@ -1411,31 +1391,27 @@ co_WinPosSendSizeMove(PWINDOW_OBJECT Window)
         wParam = SIZE_MINIMIZED;
     }
 
-    co_IntSendMessageNoWait(Window->hSelf, WM_SIZE, wParam,
+    co_IntSendMessageNoWait(Wnd->head.h, WM_SIZE, wParam,
                         MAKELONG(Wnd->rcClient.right -
                                  Wnd->rcClient.left,
                                  Wnd->rcClient.bottom -
                                  Wnd->rcClient.top));
-    co_IntSendMessageNoWait(Window->hSelf, WM_MOVE, 0,
+    co_IntSendMessageNoWait(Wnd->head.h, WM_MOVE, 0,
                         MAKELONG(Wnd->rcClient.left,
                                  Wnd->rcClient.top));
-    IntEngWindowChanged(Window, WOC_RGN_CLIENT);
+    IntEngWindowChanged(Wnd, WOC_RGN_CLIENT);
 }
 
 BOOLEAN FASTCALL
-co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
+co_WinPosShowWindow(PWND Wnd, INT Cmd)
 {
    BOOLEAN WasVisible;
    UINT Swp = 0;
    RECTL NewPos;
    BOOLEAN ShowFlag;
    //  HRGN VisibleRgn;
-   PWND Wnd;
-
-   ASSERT_REFS_CO(Window);
-   Wnd = Window->Wnd;
 
-   if (!Wnd) return FALSE;
+   ASSERT_REFS_CO(Wnd);
    
    WasVisible = (Wnd->style & WS_VISIBLE) != 0;
 
@@ -1448,7 +1424,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
                return(FALSE);
             }
             Swp |= SWP_HIDEWINDOW | SWP_NOSIZE | SWP_NOMOVE;
-            if (Window->hSelf != UserGetActiveWindow())
+            if (Wnd->head.h != UserGetActiveWindow())
                Swp |= SWP_NOACTIVATE | SWP_NOZORDER;
             break;
          }
@@ -1464,7 +1440,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
             Swp |= SWP_NOACTIVATE;
             if (!(Wnd->style & WS_MINIMIZE))
             {
-               Swp |= co_WinPosMinMaximize(Window, SW_MINIMIZE, &NewPos) |
+               Swp |= co_WinPosMinMaximize(Wnd, SW_MINIMIZE, &NewPos) |
                       SWP_FRAMECHANGED;
             }
             else
@@ -1483,7 +1459,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
             Swp |= SWP_SHOWWINDOW;
             if (!(Wnd->style & WS_MAXIMIZE))
             {
-               Swp |= co_WinPosMinMaximize(Window, SW_MAXIMIZE, &NewPos) |
+               Swp |= co_WinPosMinMaximize(Wnd, SW_MAXIMIZE, &NewPos) |
                       SWP_FRAMECHANGED;
             }
             else
@@ -1516,7 +1492,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
          Swp |= SWP_SHOWWINDOW;
          if (Wnd->style & (WS_MINIMIZE | WS_MAXIMIZE))
          {
-            Swp |= co_WinPosMinMaximize(Window, SW_RESTORE, &NewPos) |
+            Swp |= co_WinPosMinMaximize(Wnd, SW_RESTORE, &NewPos) |
                    SWP_FRAMECHANGED;
          }
          else
@@ -1534,7 +1510,7 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
 
    if (ShowFlag != WasVisible)
    {
-      co_IntSendMessageNoWait(Window->hSelf, WM_SHOWWINDOW, ShowFlag, 0);
+      co_IntSendMessageNoWait(Wnd->head.h, WM_SHOWWINDOW, ShowFlag, 0);
    }
 
    /* We can't activate a child window */
@@ -1544,22 +1520,22 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
       Swp |= SWP_NOACTIVATE | SWP_NOZORDER;
    }
 
-   co_WinPosSetWindowPos(Window, 0 != (Wnd->ExStyle & WS_EX_TOPMOST)
+   co_WinPosSetWindowPos(Wnd, 0 != (Wnd->ExStyle & WS_EX_TOPMOST)
                          ? HWND_TOPMOST : HWND_TOP,
                          NewPos.left, NewPos.top, NewPos.right, NewPos.bottom, LOWORD(Swp));
 
    if ((Cmd == SW_HIDE) || (Cmd == SW_MINIMIZE))
    {
-      PWINDOW_OBJECT ThreadFocusWindow;
+      PWND ThreadFocusWindow;
 
       /* FIXME: This will cause the window to be activated irrespective
        * of whether it is owned by the same thread. Has to be done
        * asynchronously.
        */
 
-      if (Window->hSelf == UserGetActiveWindow())
+      if (Wnd->head.h == UserGetActiveWindow())
       {
-         co_WinPosActivateOtherWindow(Window);
+         co_WinPosActivateOtherWindow(Wnd);
       }
 
 
@@ -1567,20 +1543,20 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
       ThreadFocusWindow = UserGetWindowObject(IntGetThreadFocusWindow());
 
       /* Revert focus to parent */
-      if (ThreadFocusWindow && (Window == ThreadFocusWindow ||
-            IntIsChildWindow(Window, ThreadFocusWindow)))
+      if (ThreadFocusWindow && (Wnd == ThreadFocusWindow ||
+            IntIsChildWindow(Wnd, ThreadFocusWindow)))
       {
          //faxme: as long as we have ref on Window, we also, indirectly, have ref on parent...
-         co_UserSetFocus(Window->spwndParent);
+         co_UserSetFocus(Wnd->spwndParent);
       }
    }
 
    /* FIXME: Check for window destruction. */
 
-   if ((Window->state & WINDOWOBJECT_NEED_SIZE) &&
-       !(Window->state & WINDOWSTATUS_DESTROYING))
+   if ((Wnd->state & WNDS_SENDSIZEMOVEMSGS) &&
+       !(Wnd->state2 & WNDS2_INDESTROY))
    {
-        co_WinPosSendSizeMove(Window);
+        co_WinPosSendSizeMove(Wnd);
    }
 
    /* Activate the window if activation is not requested and the window is not minimized */
@@ -1597,9 +1573,9 @@ co_WinPosShowWindow(PWINDOW_OBJECT Window, INT Cmd)
 #if 0
 
 /* find child of 'parent' that contains the given point (in parent-relative coords) */
-PWINDOW_OBJECT child_window_from_point(PWINDOW_OBJECT parent, int x, int y )
+PWND child_window_from_point(PWND parent, int x, int y )
 {
-    PWINDOW_OBJECT Wnd;// = parent->spwndChild;
+    PWND Wnd;// = parent->spwndChild;
 
 //    LIST_FOR_EACH_ENTRY( Wnd, &parent->children, struct window, entry )
     for (Wnd = parent->spwndChild; Wnd; Wnd = Wnd->spwndNext)
@@ -1627,15 +1603,14 @@ Caller must dereference the "returned" Window
 static
 VOID FASTCALL
 co_WinPosSearchChildren(
-   PWINDOW_OBJECT ScopeWin,
+   PWND ScopeWin,
    PUSER_MESSAGE_QUEUE OnlyHitTests,
    POINT *Point,
-   PWINDOW_OBJECT* Window,
+   PWND* Window,
    USHORT *HitTest
    )
 {
-   PWINDOW_OBJECT Current;
-   PWND CurrentWnd;
+   PWND Current;
    HWND *List, *phWnd;
    USER_REFERENCE_ENTRY Ref;
 
@@ -1647,14 +1622,13 @@ co_WinPosSearchChildren(
       {
          if (!(Current = UserGetWindowObject(*phWnd)))
             continue;
-         CurrentWnd = Current->Wnd;
 
-         if (!(CurrentWnd->style & WS_VISIBLE))
+         if (!(Current->style & WS_VISIBLE))
          {
             continue;
          }
 
-         if ((CurrentWnd->style & (WS_POPUP | WS_CHILD | WS_DISABLED)) ==
+         if ((Current->style & (WS_POPUP | WS_CHILD | WS_DISABLED)) ==
                (WS_CHILD | WS_DISABLED))
          {
             continue;
@@ -1669,13 +1643,13 @@ co_WinPosSearchChildren(
          *Window = Current;
          UserReferenceObject(*Window);
 
-         if (CurrentWnd->style & WS_MINIMIZE)
+         if (Current->style & WS_MINIMIZE)
          {
             *HitTest = HTCAPTION;
             break;
          }
 
-         if (CurrentWnd->style & WS_DISABLED)
+         if (Current->style & WS_DISABLED)
          {
             *HitTest = HTERROR;
             break;
@@ -1683,9 +1657,9 @@ co_WinPosSearchChildren(
 
          UserRefObjectCo(Current, &Ref);
 
-         if (OnlyHitTests && (Current->pti->MessageQueue == OnlyHitTests))
+         if (OnlyHitTests && (Current->head.pti->MessageQueue == OnlyHitTests))
          {
-            *HitTest = co_IntSendMessage(Current->hSelf, WM_NCHITTEST, 0,
+            *HitTest = co_IntSendMessage(Current->head.h, WM_NCHITTEST, 0,
                                          MAKELONG(Point->x, Point->y));
             if ((*HitTest) == (USHORT)HTTRANSPARENT)
             {
@@ -1696,10 +1670,10 @@ co_WinPosSearchChildren(
          else
             *HitTest = HTCLIENT;
 
-         if (Point->x >= CurrentWnd->rcClient.left &&
-               Point->x < CurrentWnd->rcClient.right &&
-               Point->y >= CurrentWnd->rcClient.top &&
-               Point->y < CurrentWnd->rcClient.bottom)
+         if (Point->x >= Current->rcClient.left &&
+               Point->x < Current->rcClient.right &&
+               Point->y >= Current->rcClient.top &&
+               Point->y < Current->rcClient.bottom)
          {
             co_WinPosSearchChildren(Current, OnlyHitTests, Point, Window, HitTest);
          }
@@ -1714,11 +1688,11 @@ co_WinPosSearchChildren(
 
 /* wine: WINPOS_WindowFromPoint */
 USHORT FASTCALL
-co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
-                         PWINDOW_OBJECT* Window)
+co_WinPosWindowFromPoint(PWND ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTests, POINT *WinPoint,
+                         PWND* Window)
 {
    HWND DesktopWindowHandle;
-   PWINDOW_OBJECT DesktopWindow;
+   PWND DesktopWindow;
    POINT Point = *WinPoint;
    USHORT HitTest;
 
@@ -1732,18 +1706,18 @@ co_WinPosWindowFromPoint(PWINDOW_OBJECT ScopeWin, PUSER_MESSAGE_QUEUE OnlyHitTes
       return(HTERROR);
    }
 
-   if (ScopeWin->Wnd->style & WS_DISABLED)
+   if (ScopeWin->style & WS_DISABLED)
    {
       return(HTERROR);
    }
 
    /* Translate the point to the space of the scope window. */
    DesktopWindowHandle = IntGetDesktopWindow();
-   if((DesktopWindowHandle != ScopeWin->hSelf) &&
+   if((DesktopWindowHandle != ScopeWin->head.h) &&
          (DesktopWindow = UserGetWindowObject(DesktopWindowHandle)))
    {
-      Point.x += ScopeWin->Wnd->rcClient.left - DesktopWindow->Wnd->rcClient.left;
-      Point.y += ScopeWin->Wnd->rcClient.top - DesktopWindow->Wnd->rcClient.top;
+      Point.x += ScopeWin->rcClient.left - DesktopWindow->rcClient.left;
+      Point.y += ScopeWin->rcClient.top - DesktopWindow->rcClient.top;
    }
 
    HitTest = HTNOWHERE;
@@ -1761,8 +1735,7 @@ NtUserGetMinMaxInfo(
    BOOL SendMessage)
 {
    POINT Size;
-   PWINDOW_OBJECT Window = NULL;
-   PWND Wnd;
+   PWND Window = NULL;
    MINMAXINFO SafeMinMax;
    NTSTATUS Status;
    BOOL ret;
@@ -1778,12 +1751,11 @@ NtUserGetMinMaxInfo(
    }
 
    UserRefObjectCo(Window, &Ref);
-   Wnd = Window->Wnd;
 
-   Size.x = Window->Wnd->rcWindow.left;
-   Size.y = Window->Wnd->rcWindow.top;
+   Size.x = Window->rcWindow.left;
+   Size.y = Window->rcWindow.top;
    WinPosInitInternalPos(Window, &Size,
-                         &Wnd->rcWindow);
+                         &Window->rcWindow);
 
    co_WinPosGetMinMaxInfo(Window, &SafeMinMax.ptMaxSize, &SafeMinMax.ptMaxPosition,
                           &SafeMinMax.ptMinTrackSize, &SafeMinMax.ptMaxTrackSize);
index 659b9cb..b6fb6a2 100644 (file)
@@ -1357,7 +1357,7 @@ IntChangeDisplaySettings(
         {
             WCHAR szBuffer[MAX_DRIVER_NAME];
             PDC DC;
-            PWINDOW_OBJECT Wnd=NULL;
+            PWND Wnd=NULL;
             HWND hWnd;
             HDC hDC;
 
@@ -1478,7 +1478,7 @@ GetDisplayNumberFromDeviceName(
 
     if (pDeviceName == NULL || pDeviceName->Length == 0)
     {
-        PWINDOW_OBJECT DesktopObject;
+        PWND DesktopObject;
         HDC DesktopHDC;
         PDC pDC;
 
index a8f3b82..f031fd3 100644 (file)
@@ -752,7 +752,7 @@ IntAnimatePalette(HPALETTE hPal,
         UINT pal_entries;
         HDC hDC;
         PDC dc;
-        PWINDOW_OBJECT Wnd;
+        PWND Wnd;
         const PALETTEENTRY *pptr = PaletteColors;
 
         palPtr = (PPALETTE)PALETTE_LockPalette(hPal);
@@ -1071,7 +1071,7 @@ BOOL
 APIENTRY
 NtGdiUpdateColors(HDC hDC)
 {
-   PWINDOW_OBJECT Wnd;
+   PWND Wnd;
    BOOL calledFromUser, ret;
    USER_REFERENCE_ENTRY Ref;