[ros-diffs] [jimtabor] 42223: - [Win32k] Moving forward and replace some of the old header types with the new ones. This will continue and start the win32k object manager rewrite. Finding more bugs and this is still a work in progress. Run across the C_ASSERT bug. I see someone else noticed it. - Finished the user32 system class proc start-up. - Tested wine, Firefox 1.15.xx and AbiWord 2.6.8.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Sun Jul 26 03:59:08 CEST 2009


Author: jimtabor
Date: Sun Jul 26 03:59:08 2009
New Revision: 42223

URL: http://svn.reactos.org/svn/reactos?rev=42223&view=rev
Log:
- [Win32k] Moving forward and replace some of the old header types with the new ones. This will continue and start the win32k object manager rewrite. Finding more bugs and this is still a work in progress. Run across the C_ASSERT bug. I see someone else noticed it.
- Finished the user32 system class proc start-up.
- Tested wine, Firefox 1.15.xx and AbiWord 2.6.8.

Modified:
    trunk/reactos/dll/win32/user32/controls/button.c
    trunk/reactos/dll/win32/user32/controls/combo.c
    trunk/reactos/dll/win32/user32/controls/edit.c
    trunk/reactos/dll/win32/user32/controls/icontitle.c
    trunk/reactos/dll/win32/user32/controls/listbox.c
    trunk/reactos/dll/win32/user32/controls/regcontrol.c
    trunk/reactos/dll/win32/user32/controls/scrollbar.c
    trunk/reactos/dll/win32/user32/controls/static.c
    trunk/reactos/dll/win32/user32/include/controls.h
    trunk/reactos/dll/win32/user32/include/menu.h
    trunk/reactos/dll/win32/user32/include/scroll.h
    trunk/reactos/dll/win32/user32/misc/misc.c
    trunk/reactos/dll/win32/user32/windows/mdi.c
    trunk/reactos/dll/win32/user32/windows/menu.c
    trunk/reactos/dll/win32/user32/windows/message.c
    trunk/reactos/dll/win32/user32/windows/window.c
    trunk/reactos/include/reactos/win32k/ntgdityp.h
    trunk/reactos/include/reactos/win32k/ntuser.h
    trunk/reactos/subsystems/win32/win32k/include/hook.h
    trunk/reactos/subsystems/win32/win32k/include/window.h
    trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c
    trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
    trunk/reactos/subsystems/win32/win32k/ntuser/event.c
    trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
    trunk/reactos/subsystems/win32/win32k/ntuser/object.c
    trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
    trunk/reactos/subsystems/win32/win32k/ntuser/window.c

Modified: trunk/reactos/dll/win32/user32/controls/button.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/button.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/button.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/button.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -102,8 +102,8 @@
 static void UB_Paint( HWND hwnd, HDC hDC, UINT action );
 static void OB_Paint( HWND hwnd, HDC hDC, UINT action );
 static void BUTTON_CheckAutoRadioButton( HWND hwnd );
-static LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
-static LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
 
 #define MAX_BTN_TYPE  12
 
@@ -249,8 +249,8 @@
 /***********************************************************************
  *           ButtonWndProc_common
  */
-static LRESULT ButtonWndProc_common(HWND hWnd, UINT uMsg,
-                                    WPARAM wParam, LPARAM lParam, BOOL unicode )
+LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg,
+                                  WPARAM wParam, LPARAM lParam, BOOL unicode )
 {
     RECT rect;
     POINT pt;
@@ -591,7 +591,7 @@
  * the passed HWND and calls the real window procedure (with a WND*
  * pointer pointing to the locked windowstructure).
  */
-static LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
 {
     if (!IsWindow( hWnd )) return 0;
     return ButtonWndProc_common( hWnd, uMsg, wParam, lParam, TRUE );
@@ -601,7 +601,7 @@
 /***********************************************************************
  *           ButtonWndProcA
  */
-static LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
 {
     if (!IsWindow( hWnd )) return 0;
     return ButtonWndProc_common( hWnd, uMsg, wParam, lParam, FALSE );

Modified: trunk/reactos/dll/win32/user32/controls/combo.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/combo.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/combo.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/combo.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -74,8 +74,8 @@
 #define COMBO_EDITBUTTONSPACE()  0
 #define EDIT_CONTROL_PADDING()   1
 
-static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
-static LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
 
 /*********************************************************************
  * combo class descriptor
@@ -1836,8 +1836,8 @@
 /***********************************************************************
  *           ComboWndProc_common
  */
-static LRESULT ComboWndProc_common( HWND hwnd, UINT message,
-                                    WPARAM wParam, LPARAM lParam, BOOL unicode )
+LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message,
+                                  WPARAM wParam, LPARAM lParam, BOOL unicode )
 {
       LPHEADCOMBO lphc = (LPHEADCOMBO)GetWindowLongPtrW( hwnd, 0 );
 
@@ -2361,7 +2361,7 @@
  * This is just a wrapper for the real ComboWndProc which locks/unlocks
  * window structs.
  */
-static LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
 {
     if (!IsWindow(hwnd)) return 0;
     return ComboWndProc_common( hwnd, message, wParam, lParam, FALSE );
@@ -2370,7 +2370,7 @@
 /***********************************************************************
  *           ComboWndProcW
  */
-static LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
 {
     if (!IsWindow(hwnd)) return 0;
     return ComboWndProc_common( hwnd, message, wParam, lParam, TRUE );

Modified: trunk/reactos/dll/win32/user32/controls/edit.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/edit.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/edit.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/edit.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -4816,7 +4816,7 @@
  *	names).
  *
  */
-static LRESULT EditWndProc_common( HWND hwnd, UINT msg,
+LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg,
                                    WPARAM wParam, LPARAM lParam, BOOL unicode )
 {
 	EDITSTATE *es = (EDITSTATE *)GetWindowLongPtrW( hwnd, 0 );

Modified: trunk/reactos/dll/win32/user32/controls/icontitle.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/icontitle.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/icontitle.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/icontitle.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -30,7 +30,7 @@
 static BOOL bMultiLineTitle;
 static HFONT hIconTitleFont;
 
-static LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
 
 /*********************************************************************
  * icon title class descriptor

Modified: trunk/reactos/dll/win32/user32/controls/listbox.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/listbox.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/listbox.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/listbox.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -138,8 +138,8 @@
 
 static TIMER_DIRECTION LISTBOX_Timer = LB_TIMER_NONE;
 
-static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
-static LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam,LPARAM lParam );
+//static LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
 
 static LRESULT LISTBOX_GetItemRect( const LB_DESCR *descr, INT index, RECT *rect );
 
@@ -2659,8 +2659,8 @@
 /***********************************************************************
  *           ListBoxWndProc_common
  */
-static LRESULT ListBoxWndProc_common( HWND hwnd, UINT msg,
-                                      WPARAM wParam, LPARAM lParam, BOOL unicode )
+LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg,
+                                   WPARAM wParam, LPARAM lParam, BOOL unicode )
 {
     LB_DESCR *descr = (LB_DESCR *)GetWindowLongPtrW( hwnd, 0 );
     LPHEADCOMBO lphc = 0;
@@ -3446,7 +3446,7 @@
 /***********************************************************************
  *           ListBoxWndProcA
  */
-static LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
 {
     return ListBoxWndProc_common( hwnd, msg, wParam, lParam, FALSE );
 }
@@ -3454,7 +3454,7 @@
 /***********************************************************************
  *           ListBoxWndProcW
  */
-static LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
 {
     return ListBoxWndProc_common( hwnd, msg, wParam, lParam, TRUE );
 }

Modified: trunk/reactos/dll/win32/user32/controls/regcontrol.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/regcontrol.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/regcontrol.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/regcontrol.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -12,6 +12,10 @@
 #include <user32.h>
 
 #include <wine/debug.h>
+
+static PFNCLIENT pfnClientA;
+static PFNCLIENT pfnClientW;
+static PFNCLIENTWORKER pfnClientWorker;
 
 static const struct
 {
@@ -61,46 +65,57 @@
     return NtUserRegisterSystemClasses(sizeof(cls) / sizeof(cls[0]), cls);
 }
 
+LRESULT
+WINAPI
+MsgWindowProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+{
+    if (message == WM_NCCREATE) return TRUE;
+    return 0;
+}
 
-
-static PFNCLIENT pfnClientA;
-static PFNCLIENT pfnClientW;
-static PFNCLIENTWORKER pfnClientWorker;
+LRESULT
+WINAPI
+DialogWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
+{
+  if (unicode)
+     return DefDlgProcW( hwnd, uMsg, wParam, lParam);
+  return DefDlgProcA( hwnd, uMsg, wParam, lParam);
+}
 
 BOOL WINAPI RegisterClientPFN(VOID)
 {
   NTSTATUS Status;
 
-//  pfnClientA.pfnScrollBarWndProc      = ScrollBarWndProcA;
-//  pfnClientW.pfnScrollBarWndProc      = ScrollBarWndProcW;
-//  pfnClientA.pfnTitleWndProc          = IconTitleWndProc;
-//  pfnClientW.pfnTitleWndProc          = IconTitleWndProc;
-//  pfnClientA.pfnMenuWndProc           = PopupMenuWndProcA;
-//  pfnClientW.pfnMenuWndProc           = PopupMenuWndProcW;
-  pfnClientA.pfnDesktopWndProc        = DesktopWndProc; // Fixme!
+  pfnClientA.pfnScrollBarWndProc      = ScrollBarWndProcA;
+  pfnClientW.pfnScrollBarWndProc      = ScrollBarWndProcW;
+  pfnClientA.pfnTitleWndProc          = IconTitleWndProc;
+  pfnClientW.pfnTitleWndProc          = IconTitleWndProc;
+  pfnClientA.pfnMenuWndProc           = PopupMenuWndProcA;
+  pfnClientW.pfnMenuWndProc           = PopupMenuWndProcW;
+  pfnClientA.pfnDesktopWndProc        = DesktopWndProc;
   pfnClientW.pfnDesktopWndProc        = DesktopWndProc;
   pfnClientA.pfnDefWindowProc         = DefWindowProcA;
   pfnClientW.pfnDefWindowProc         = DefWindowProcW;
-  pfnClientA.pfnMessageWindowProc     = DefWindowProcA;
-  pfnClientW.pfnMessageWindowProc     = DefWindowProcW;
+  pfnClientA.pfnMessageWindowProc     = MsgWindowProc;
+  pfnClientW.pfnMessageWindowProc     = MsgWindowProc;
   pfnClientA.pfnSwitchWindowProc      = DefWindowProcA;
   pfnClientW.pfnSwitchWindowProc      = DefWindowProcW;
-//  pfnClientA.pfnButtonWndProc         = ButtonWndProcA;
-//  pfnClientW.pfnButtonWndProc         = ButtonWndProcW
-//  pfnClientA.pfnComboBoxWndProc       = ComboWndProcA;
-//  pfnClientW.pfnComboBoxWndProc       = ComboWndProcW;
-//  pfnClientA.pfnComboListBoxProc      = ListBoxWndProcA;
-//  pfnClientW.pfnComboListBoxProc      = ListBoxWndProcW;
-//  pfnClientA.pfnDialogWndProc         = DefDlgProcA;
-//  pfnClientW.pfnDialogWndProc         = DefDlgProcW;
-//  pfnClientA.pfnEditWndProc           = EditWndProcA;
-//  pfnClientW.pfnEditWndProc           = EditWndProcW;
-//  pfnClientA.pfnListBoxWndProc        = ListBoxWndProcA;
-//  pfnClientW.pfnListBoxWndProc        = ListBoxWndProcW;
-//  pfnClientA.pfnMDIClientWndProc      = MDIClientWndProcA;
-//  pfnClientW.pfnMDIClientWndProc      = MDIClientWndProcW;
-//  pfnClientA.pfnStaticWndProc         = StaticWndProcA;
-//  pfnClientW.pfnStaticWndProc         = StaticWndProcW;
+  pfnClientA.pfnButtonWndProc         = ButtonWndProcA;
+  pfnClientW.pfnButtonWndProc         = ButtonWndProcW;
+  pfnClientA.pfnComboBoxWndProc       = ComboWndProcA;
+  pfnClientW.pfnComboBoxWndProc       = ComboWndProcW;
+  pfnClientA.pfnComboListBoxProc      = ListBoxWndProcA;
+  pfnClientW.pfnComboListBoxProc      = ListBoxWndProcW;
+  pfnClientA.pfnDialogWndProc         = DefDlgProcA;
+  pfnClientW.pfnDialogWndProc         = DefDlgProcW;
+  pfnClientA.pfnEditWndProc           = EditWndProcA;
+  pfnClientW.pfnEditWndProc           = EditWndProcW;
+  pfnClientA.pfnListBoxWndProc        = ListBoxWndProcA;
+  pfnClientW.pfnListBoxWndProc        = ListBoxWndProcW;
+  pfnClientA.pfnMDIClientWndProc      = MDIClientWndProcA;
+  pfnClientW.pfnMDIClientWndProc      = MDIClientWndProcW;
+  pfnClientA.pfnStaticWndProc         = StaticWndProcA;
+  pfnClientW.pfnStaticWndProc         = StaticWndProcW;
   pfnClientA.pfnImeWndProc            = DefWindowProcA;
   pfnClientW.pfnImeWndProc            = DefWindowProcW;
   pfnClientA.pfnGhostWndProc          = DefWindowProcA;
@@ -118,14 +133,14 @@
   pfnClientA.pfnMDIActivateDlgProc    = DefWindowProcA;
   pfnClientW.pfnMDIActivateDlgProc    = DefWindowProcW;
 
-//  pfnClientWorker.pfnButtonWndProc    = ButtonWndProc_common;
-//  pfnClientWorker.pfnComboBoxWndProc  = ComboWndProc_common;
-//  pfnClientWorker.pfnComboListBoxProc = ListBoxWndProc_common;
-////  pfnClientWorker.pfnDialogWndProc    = DefDlgProc_common;
-//  pfnClientWorker.pfnEditWndProc      = EditWndProc_common;
-//  pfnClientWorker.pfnListBoxWndProc   = ListBoxWndProc_common;
-//  pfnClientWorker.pfnMDIClientWndProc = MDIClientWndProc_common;
-//  pfnClientWorker.pfnStaticWndProc    = StaticWndProc_common;
+  pfnClientWorker.pfnButtonWndProc    = ButtonWndProc_common;
+  pfnClientWorker.pfnComboBoxWndProc  = ComboWndProc_common;
+  pfnClientWorker.pfnComboListBoxProc = ListBoxWndProc_common;
+  pfnClientWorker.pfnDialogWndProc    = DialogWndProc_common;
+  pfnClientWorker.pfnEditWndProc      = EditWndProc_common;
+  pfnClientWorker.pfnListBoxWndProc   = ListBoxWndProc_common;
+  pfnClientWorker.pfnMDIClientWndProc = MDIClientWndProc_common;
+  pfnClientWorker.pfnStaticWndProc    = StaticWndProc_common;
   pfnClientWorker.pfnImeWndProc       = User32DefWindowProc;
   pfnClientWorker.pfnGhostWndProc     = User32DefWindowProc;
   pfnClientWorker.pfnCtfHookProc      = User32DefWindowProc;

Modified: trunk/reactos/dll/win32/user32/controls/scrollbar.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/scrollbar.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/scrollbar.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/scrollbar.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -69,8 +69,8 @@
 
 HBRUSH DefWndControlColor(HDC hDC, UINT ctlType);
 
-static LRESULT WINAPI ScrollBarWndProcW( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
-static LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI ScrollBarWndProcW( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
 
 UINT WINAPI SetSystemTimer(HWND,UINT_PTR,UINT,TIMERPROC);
 BOOL WINAPI KillSystemTimer(HWND,UINT_PTR);
@@ -1248,7 +1248,7 @@
 /***********************************************************************
  *           ScrollBarWndProc
  */
-static LRESULT WINAPI
+LRESULT WINAPI
 ScrollBarWndProc(WNDPROC DefWindowProc, HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
   if (! IsWindow(Wnd))
@@ -1457,13 +1457,13 @@
   return 0;
 }
 
-static LRESULT WINAPI
+LRESULT WINAPI
 ScrollBarWndProcW(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
   return ScrollBarWndProc(DefWindowProcW, Wnd, Msg, wParam, lParam);
 }
 
-static LRESULT WINAPI
+LRESULT WINAPI
 ScrollBarWndProcA(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 {
   return ScrollBarWndProc(DefWindowProcA, Wnd, Msg, wParam, lParam);

Modified: trunk/reactos/dll/win32/user32/controls/static.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/controls/static.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/controls/static.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/controls/static.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -55,8 +55,8 @@
 static void STATIC_PaintBitmapfn( HWND hwnd, HDC hdc, DWORD style );
 //static void STATIC_PaintEnhMetafn( HWND hwnd, HDC hdc, DWORD style );
 static void STATIC_PaintEtchedfn( HWND hwnd, HDC hdc, DWORD style );
-static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
-static LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
 
 static COLORREF color_3dshadow, color_3ddkshadow, color_3dhighlight;
 
@@ -436,7 +436,7 @@
 /***********************************************************************
  *           StaticWndProc_common
  */
-static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
+LRESULT WINAPI StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
                                      LPARAM lParam, BOOL unicode )
 {
     LRESULT lResult = 0;
@@ -663,7 +663,7 @@
 /***********************************************************************
  *           StaticWndProcA
  */
-static LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
 {
     if (!IsWindow( hWnd )) return 0;
     return StaticWndProc_common(hWnd, uMsg, wParam, lParam, FALSE);
@@ -672,7 +672,7 @@
 /***********************************************************************
  *           StaticWndProcW
  */
-static LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
 {
     if (!IsWindow( hWnd )) return 0;
     return StaticWndProc_common(hWnd, uMsg, wParam, lParam, TRUE);

Modified: trunk/reactos/dll/win32/user32/include/controls.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/controls.h?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/include/controls.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/include/controls.h [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -110,5 +110,24 @@
 LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
 LRESULT WINAPI User32DefWindowProc(HWND,UINT,WPARAM,LPARAM,BOOL);
 BOOL WINAPI RegisterClientPFN(VOID);
+LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
+LRESULT WINAPI ButtonWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+LRESULT WINAPI ButtonWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+LRESULT WINAPI ButtonWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode);
+LRESULT WINAPI ComboWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+LRESULT WINAPI ComboWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+LRESULT WINAPI ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL unicode);
+LRESULT WINAPI EditWndProcA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+LRESULT WINAPI EditWndProcW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode);
+LRESULT WINAPI ListBoxWndProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+LRESULT WINAPI ListBoxWndProcW( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
+LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg,WPARAM wParam, LPARAM lParam, BOOL unicode);
+LRESULT WINAPI MDIClientWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
+LRESULT WINAPI MDIClientWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
+LRESULT WINAPI MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, BOOL unicode);
+LRESULT WINAPI StaticWndProcA( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+LRESULT WINAPI StaticWndProcW( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
+LRESULT WINAPI StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode);
 
 #endif /* _ROS_CONTROLS_H */

Modified: trunk/reactos/dll/win32/user32/include/menu.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/menu.h?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/include/menu.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/include/menu.h [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -19,4 +19,7 @@
 VOID
 MenuTrackKbdMenuBar(HWND hWnd, UINT wParam, WCHAR wChar);
 
+LRESULT WINAPI PopupMenuWndProcA(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
+LRESULT WINAPI PopupMenuWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
+
 #endif /* __LIB_USER32_INCLUDE_MENU_H */

Modified: trunk/reactos/dll/win32/user32/include/scroll.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/scroll.h?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/include/scroll.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/include/scroll.h [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -9,6 +9,8 @@
 #ifndef USER32_SCROLL_H_INCLUDED
 #define USER32_SCROLL_H_INCLUDED
 
-extern VOID FASTCALL ScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt);
+LRESULT WINAPI ScrollBarWndProcW( HWND hwnd, UINT uMsg, WPARAM wParam,LPARAM lParam );
+LRESULT WINAPI ScrollBarWndProcA( HWND hwnd, UINT uMsg, WPARAM wParam,LPARAM lParam );
+VOID FASTCALL ScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt);
 
 #endif

Modified: trunk/reactos/dll/win32/user32/misc/misc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/misc.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/misc/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/misc/misc.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -270,10 +270,10 @@
 FASTCALL
 TestWindowProcess(PWND Wnd)
 {
-   if (Wnd->pti == (PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo)
+   if (Wnd->head.pti == (PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo)
       return TRUE;
    else
-      return (NtUserQueryWindow(Wnd->hdr.Handle, QUERY_WINDOW_UNIQUE_PROCESS_ID) ==
+      return (NtUserQueryWindow(Wnd->head.h, QUERY_WINDOW_UNIQUE_PROCESS_ID) ==
               (DWORD)NtCurrentTeb()->ClientId.UniqueProcess );
 }
 

Modified: trunk/reactos/dll/win32/user32/windows/mdi.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/mdi.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/mdi.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/mdi.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -123,8 +123,8 @@
 static LRESULT MDI_RefreshMenu(MDICLIENTINFO *);
 
 static HWND MDI_MoreWindowsDialog(HWND);
-static LRESULT WINAPI MDIClientWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
-static LRESULT WINAPI MDIClientWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI MDIClientWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
+//static LRESULT WINAPI MDIClientWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
 
 HWND* WIN_ListChildren (HWND hWndparent)
 {
@@ -1057,8 +1057,8 @@
 /**********************************************************************
  *		MDIClientWndProc_common
  */
-static LRESULT MDIClientWndProc_common( HWND hwnd, UINT message,
-                                        WPARAM wParam, LPARAM lParam, BOOL unicode )
+LRESULT WINAPI MDIClientWndProc_common( HWND hwnd, UINT message,
+                                   WPARAM wParam, LPARAM lParam, BOOL unicode )
 {
     MDICLIENTINFO *ci = NULL;
 
@@ -1319,7 +1319,7 @@
 /***********************************************************************
  *		MDIClientWndProcA
  */
-static LRESULT WINAPI MDIClientWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI MDIClientWndProcA( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
 {
     if (!IsWindow(hwnd)) return 0;
     return MDIClientWndProc_common( hwnd, message, wParam, lParam, FALSE );
@@ -1328,7 +1328,7 @@
 /***********************************************************************
  *		MDIClientWndProcW
  */
-static LRESULT WINAPI MDIClientWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
+LRESULT WINAPI MDIClientWndProcW( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
 {
     if (!IsWindow(hwnd)) return 0;
     return MDIClientWndProc_common( hwnd, message, wParam, lParam, TRUE );

Modified: trunk/reactos/dll/win32/user32/windows/menu.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/menu.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/menu.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -72,8 +72,8 @@
   POINT Pt;
 } MTRACKER;
 
-static LRESULT WINAPI PopupMenuWndProcA(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
-static LRESULT WINAPI PopupMenuWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
+//static LRESULT WINAPI PopupMenuWndProcA(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);
+//static LRESULT WINAPI PopupMenuWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
 
 /*********************************************************************
  * PopupMenu class descriptor
@@ -972,7 +972,7 @@
     }
 }
 
-static LRESULT WINAPI
+LRESULT WINAPI
 PopupMenuWndProcA(HWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam)
 {
   TRACE("YES! hwnd=%x msg=0x%04x wp=0x%04lx lp=0x%08lx\n", Wnd, Message, wParam, lParam);
@@ -1036,7 +1036,7 @@
   return 0;
 }
 
-static LRESULT WINAPI
+LRESULT WINAPI
 PopupMenuWndProcW(HWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam)
 {
   TRACE("hwnd=%x msg=0x%04x wp=0x%04lx lp=0x%08lx\n", Wnd, Message, wParam, lParam);

Modified: trunk/reactos/dll/win32/user32/windows/message.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/message.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -1340,7 +1340,7 @@
     if (lpmsg->hwnd != NULL)
     {
         Wnd = ValidateHwnd(lpmsg->hwnd);
-        if (!Wnd || SharedPtrToUser(Wnd->pti) != GetW32ThreadInfo())
+        if (!Wnd || SharedPtrToUser(Wnd->head.pti) != GetW32ThreadInfo())
             return 0;
     }
     else
@@ -1401,7 +1401,7 @@
     if (lpmsg->hwnd != NULL)
     {
         Wnd = ValidateHwnd(lpmsg->hwnd);
-        if (!Wnd || SharedPtrToUser(Wnd->pti) != GetW32ThreadInfo())
+        if (!Wnd || SharedPtrToUser(Wnd->head.pti) != GetW32ThreadInfo())
             return 0;
     }
     else
@@ -1801,7 +1801,7 @@
       PW32THREADINFO ti = GetW32ThreadInfo();
 
       Window = ValidateHwnd(Wnd);
-      if (Window != NULL && SharedPtrToUser(Window->pti) == ti && !IsThreadHooked(GetWin32ClientInfo()))
+      if (Window != NULL && SharedPtrToUser(Window->head.pti) == ti && !IsThreadHooked(GetWin32ClientInfo()))
       {
           /* NOTE: We can directly send messages to the window procedure
                    if *all* the following conditions are met:
@@ -1865,7 +1865,7 @@
       PW32THREADINFO ti = GetW32ThreadInfo();
 
       Window = ValidateHwnd(Wnd);
-      if (Window != NULL && SharedPtrToUser(Window->pti) == ti && !IsThreadHooked(GetWin32ClientInfo()))
+      if (Window != NULL && SharedPtrToUser(Window->head.pti) == ti && !IsThreadHooked(GetWin32ClientInfo()))
       {
           /* NOTE: We can directly send messages to the window procedure
                    if *all* the following conditions are met:

Modified: trunk/reactos/dll/win32/user32/windows/window.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/window.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -1268,7 +1268,7 @@
 
     if (!pWnd) return Ret;
 
-    ti = SharedPtrToUser(pWnd->pti);
+    ti = SharedPtrToUser(pWnd->head.pti);
  
     if (ti)
     {

Modified: trunk/reactos/include/reactos/win32k/ntgdityp.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntgdityp.h?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdityp.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntgdityp.h [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -451,7 +451,8 @@
   RECT r;
   HBRUSH hBrush;
 } PATRECT, * PPATRECT;
-
+#endif
+#ifndef __WIN32K_NTUSER_H
 typedef struct _W32CLIENTINFO
 {
     ULONG CI_flags;
@@ -462,7 +463,6 @@
     ULONG W32ClientInfo[57];
 } W32CLIENTINFO, *PW32CLIENTINFO;
 #endif
-
 typedef struct _GDIBSPPATBLT
 {
   GDIBATCHHDR gbHdr;

Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntuser.h?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -2,7 +2,6 @@
 #define __WIN32K_NTUSER_H
 
 typedef struct _PROCESSINFO *PPROCESSINFO;
-struct _W32THREADINFO;
 struct _DESKTOP;
 struct _WND;
 
@@ -36,8 +35,134 @@
 VOID NTAPI RtlInitLargeUnicodeString(IN OUT PLARGE_UNICODE_STRING,IN PCWSTR,IN INT);
 BOOL NTAPI RtlLargeStringToUnicodeString( PUNICODE_STRING, PLARGE_STRING);
 
-/* FIXME: UserHMGetHandle needs to be updated once the new handle manager is implemented */
-#define UserHMGetHandle(obj) ((obj)->hdr.Handle)
+typedef struct _DESKTOPINFO
+{
+    PVOID pvDesktopBase;
+    PVOID pvDesktopLimit;
+
+    HANDLE hKernelHeap;
+    ULONG_PTR HeapLimit;
+    HWND hTaskManWindow;
+    HWND hProgmanWindow;
+    HWND hShellWindow;
+    struct _WND *Wnd;
+
+    union
+    {
+        UINT Dummy;
+        struct
+        {
+            UINT LastInputWasKbd : 1;
+        };
+    };
+
+    WCHAR szDesktopName[1];
+} DESKTOPINFO, *PDESKTOPINFO;
+
+#define CTI_INSENDMESSAGE 0x0002
+
+typedef struct _CLIENTTHREADINFO
+{
+    DWORD CTI_flags;
+    WORD  fsChangeBits;
+    WORD  fsWakeBits;
+    WORD  fsWakeBitsJournal;
+    WORD  fsWakeMask;
+    ULONG tickLastMsgChecked;
+    DWORD dwcPumpHook;
+} CLIENTTHREADINFO, *PCLIENTTHREADINFO;
+
+typedef struct _W32THREADINFO
+{
+    PPROCESSINFO ppi; /* [KERNEL] */
+    PDESKTOPINFO pDeskInfo;
+    ULONG fsHooks;
+} W32THREADINFO, *PW32THREADINFO;
+
+typedef struct _HEAD
+{
+  HANDLE h;
+  DWORD  cLockObj;
+} HEAD, *PHEAD;
+
+typedef struct _THRDESKHEAD
+{
+  HANDLE h;
+  DWORD  cLockObj;
+  PW32THREADINFO pti;
+  struct _DESKTOP *rpdesk;
+  PVOID       pSelf;
+} THRDESKHEAD, *PTHRDESKHEAD;
+
+typedef struct _PROCDESKHEAD
+{
+  HANDLE h;
+  DWORD  cLockObj;  
+  DWORD hTaskWow;
+  struct _DESKTOP *rpdesk;
+  PVOID       pSelf;
+} PROCDESKHEAD, *PPROCDESKHEAD;
+
+#define UserHMGetHandle(obj) ((obj)->head.h)
+
+/* Window Client Information structure */
+struct  _ETHREAD;
+
+typedef struct tagHOOK
+{
+  THRDESKHEAD    head;
+  LIST_ENTRY     Chain;      /* Hook chain entry */
+  struct _ETHREAD* Thread;   /* Thread owning the hook */
+  int            HookId;     /* Hook table index */
+  HOOKPROC       Proc;       /* Hook function */
+  BOOLEAN        Ansi;       /* Is it an Ansi hook? */
+  ULONG          Flags;      /* Some internal flags */
+  UNICODE_STRING ModuleName; /* Module name for global hooks */
+} HOOK, *PHOOK;
+
+typedef struct _CALLBACKWND
+{
+     HWND hWnd;
+     PVOID pvWnd;
+} CALLBACKWND, *PCALLBACKWND;
+
+#define CI_CURTHPRHOOK    0x00000010
+
+typedef struct _CLIENTINFO
+{
+    ULONG CI_flags;
+    ULONG cSpins;
+    DWORD dwExpWinVer;
+    DWORD dwCompatFlags;
+    DWORD dwCompatFlags2;
+    DWORD dwTIFlags;
+    PDESKTOPINFO pDeskInfo;
+    ULONG_PTR ulClientDelta;
+    PHOOK phkCurrent;
+    ULONG fsHooks;
+    CALLBACKWND CallbackWnd;
+    DWORD dwHookCurrent;
+    INT cInDDEMLCallback;
+    PCLIENTTHREADINFO pClientThreadInfo;
+    ULONG_PTR dwHookData;
+    DWORD dwKeyCache;
+    DWORD afKeyState[2];
+    DWORD dwAsyncKeyCache;
+    DWORD afAsyncKeyState[2];
+    DWORD afAsyncKeyStateRecentDow[2];
+    HKL hKL;
+    USHORT CodePage;
+    USHORT achDbcsCF;
+    MSG msgDbcsCB;
+    ULONG Win32ClientInfo3[28];
+/* It's just a pointer reference not to be used w the structure in user space. */
+    PPROCESSINFO ppi;
+} CLIENTINFO, *PCLIENTINFO;
+
+/* Make sure it fits exactly into the TEB */
+C_ASSERT(sizeof(CLIENTINFO) == FIELD_OFFSET(TEB, glDispatchTable) - FIELD_OFFSET(TEB, Win32ClientInfo));
+
+#define GetWin32ClientInfo() ((PCLIENTINFO)(NtCurrentTeb()->Win32ClientInfo))
 
 typedef struct _REGISTER_SYSCLASS
 {
@@ -60,36 +185,6 @@
   PUNICODE_STRING pusMenuName;
 } CLSMENUNAME, *PCLSMENUNAME;
 
-typedef struct _USER_OBJHDR
-{
-    /* This is the common header for all user handle objects */
-    HANDLE Handle;
-} USER_OBJHDR, PUSER_OBJHDR;
-
-typedef struct _DESKTOPINFO
-{
-    PVOID pvDesktopBase;
-    PVOID pvDesktopLimit;
-
-    HANDLE hKernelHeap;
-    ULONG_PTR HeapLimit;
-    HWND hTaskManWindow;
-    HWND hProgmanWindow;
-    HWND hShellWindow;
-    struct _WND *Wnd;
-
-    union
-    {
-        UINT Dummy;
-        struct
-        {
-            UINT LastInputWasKbd : 1;
-        };
-    };
-
-    WCHAR szDesktopName[1];
-} DESKTOPINFO, *PDESKTOPINFO;
-
 typedef enum _GETCPD
 {
     UserGetCPDU2A      = 0x01,
@@ -102,9 +197,7 @@
 
 typedef struct _CALLPROCDATA
 {
-//    PROCDESKHEAD head; // Use this once new handle manager is implemented!!!
-    USER_OBJHDR hdr; /* FIXME: Move out of the structure once new handle manager is implemented */
-//
+    PROCDESKHEAD head;
     struct _CALLPROCDATA *spcpdNext;
     WNDPROC pfnClientPrevious;
     union
@@ -257,15 +350,7 @@
 
 typedef struct _WND
 {
-    //THRDESKHEAD head; // head.h == handle
-    USER_OBJHDR hdr; /* FIXME: Move out of the structure once new handle manager is implemented */
-    /* NOTE: This structure is located in the desktop heap and will
-             eventually replace WINDOW_OBJECT. Right now WINDOW_OBJECT
-             keeps a reference to this structure until all the information
-             is moved to this structure */
-    struct _W32THREADINFO *pti; // head.pti
-    struct _DESKTOP *rpdesk; // head.rpdesk
-
+    THRDESKHEAD head;
     DWORD state;
     DWORD state2;
     /* Extended style. */
@@ -388,6 +473,7 @@
 #define FNID_MENU                   0x029C
 #define FNID_DESKTOP                0x029D
 #define FNID_DEFWINDOWPROC          0x029E
+#define FNID_MESSAGEWND             0x029F
 #define FNID_SWITCH                 0x02A0
 #define FNID_BUTTON                 0x02A1
 #define FNID_COMBOBOX               0x02A2
@@ -398,17 +484,20 @@
 #define FNID_MDICLIENT              0x02A7
 #define FNID_STATIC                 0x02A8
 #define FNID_IME                    0x02A9
-#define FNID_CALLWNDPROC            0x02AA
-#define FNID_CALLWNDPROCRET         0x02AB
-#define FNID_HKINLPCWPEXSTRUCT      0x02AC
-#define FNID_HKINLPCWPRETEXSTRUCT   0x02AD
-#define FNID_SENDMESSAGE            0x02B0
+#define FNID_GHOST                  0x02AA
+#define FNID_CALLWNDPROC            0x02AB
+#define FNID_CALLWNDPROCRET         0x02AC
+#define FNID_HKINLPCWPEXSTRUCT      0x02AD
+#define FNID_HKINLPCWPRETEXSTRUCT   0x02AE
+#define FNID_MB_DLGPROC             0x02AF
+#define FNID_MDIACTIVATEDLGPROC     0x02B0
+#define FNID_SENDMESSAGE            0x02B1
+#define FNID_SENDMESSAGEFF          0x02B2
 // Kernel has option to use TimeOut or normal msg send, based on type of msg.
-#define FNID_SENDMESSAGEWTOOPTION   0x02B1
-#define FNID_SENDMESSAGETIMEOUT     0x02B2
-#define FNID_BROADCASTSYSTEMMESSAGE 0x02B4
-#define FNID_TOOLTIPS               0x02B5
-#define FNID_UNKNOWN                0x02B6
+#define FNID_SENDMESSAGEWTOOPTION   0x02B3
+#define FNID_SENDMESSAGETIMEOUT     0x02B4
+#define FNID_BROADCASTSYSTEMMESSAGE 0x02B5
+#define FNID_TOOLTIPS               0x02B6 
 #define FNID_SENDNOTIFYMESSAGE      0x02B7
 #define FNID_SENDMESSAGECALLBACK    0x02B8
 #define FNID_LAST                   0x02B9
@@ -551,85 +640,6 @@
     PERUSERSERVERINFO;
 } SERVERINFO, *PSERVERINFO;
 
-#define CTI_INSENDMESSAGE 0x0002
-
-typedef struct _CLIENTTHREADINFO
-{
-    DWORD CTI_flags;
-    WORD  fsChangeBits;
-    WORD  fsWakeBits;
-    WORD  fsWakeBitsJournal;
-    WORD  fsWakeMask;
-    ULONG tickLastMsgChecked;
-    DWORD dwcPumpHook;
-} CLIENTTHREADINFO, *PCLIENTTHREADINFO;
-
-typedef struct _W32THREADINFO
-{
-    PPROCESSINFO ppi; /* [KERNEL] */
-    PDESKTOPINFO pDeskInfo;
-    ULONG fsHooks;
-} W32THREADINFO, *PW32THREADINFO;
-
-/* Window Client Information structure */
-struct  _ETHREAD;
-
-
-typedef struct tagHOOK
-{
-  LIST_ENTRY     Chain;      /* Hook chain entry */
-  HHOOK          Self;       /* user handle for this hook */
-  struct _ETHREAD* Thread;   /* Thread owning the hook */
-  int            HookId;     /* Hook table index */
-  HOOKPROC       Proc;       /* Hook function */
-  BOOLEAN        Ansi;       /* Is it an Ansi hook? */
-  ULONG          Flags;      /* Some internal flags */
-  UNICODE_STRING ModuleName; /* Module name for global hooks */
-} HOOK, *PHOOK;
-
-typedef struct _CALLBACKWND
-{
-     HWND hWnd;
-     PVOID pvWnd;
-} CALLBACKWND, *PCALLBACKWND;
-
-#define CI_CURTHPRHOOK    0x00000010
-
-typedef struct _CLIENTINFO
-{
-    ULONG CI_flags;
-    ULONG cSpins;
-    DWORD dwExpWinVer;
-    DWORD dwCompatFlags;
-    DWORD dwCompatFlags2;
-    DWORD dwTIFlags;
-    PDESKTOPINFO pDeskInfo;
-    ULONG_PTR ulClientDelta;
-    PHOOK phkCurrent;
-    ULONG fsHooks;
-    CALLBACKWND CallbackWnd;
-    DWORD dwHookCurrent;
-    INT cInDDEMLCallback;
-    PCLIENTTHREADINFO pClientThreadInfo;
-    ULONG_PTR dwHookData;
-    DWORD dwKeyCache;
-    DWORD afKeyState[2];
-    DWORD dwAsyncKeyCache;
-    DWORD afAsyncKeyState[2];
-    DWORD afAsyncKeyStateRecentDow[2];
-    HKL hKL;
-    USHORT CodePage;
-    USHORT achDbcsCF;
-    MSG msgDbcsCB;
-    ULONG Win32ClientInfo3[28];
-/* It's just a pointer reference not to be used w the structure in user space. */
-    PPROCESSINFO ppi;
-} CLIENTINFO, *PCLIENTINFO;
-
-/* Make sure it fits exactly into the TEB */
-C_ASSERT(sizeof(CLIENTINFO) == FIELD_OFFSET(TEB, glDispatchTable) - FIELD_OFFSET(TEB, Win32ClientInfo));
-
-#define GetWin32ClientInfo() ((PCLIENTINFO)(NtCurrentTeb()->Win32ClientInfo))
 
 // Server event activity bits.
 #define SRV_EVENT_MENU            0x0001

Modified: trunk/reactos/subsystems/win32/win32k/include/hook.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/include/hook.h?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/hook.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/hook.h [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -2,19 +2,6 @@
 #define _WIN32K_HOOK_H
 
 #define HOOK_THREAD_REFERENCED	(0x1)
-#if 0
-typedef struct tagHOOK
-{
-  LIST_ENTRY Chain;          /* Hook chain entry */
-  HHOOK      Self;           /* user handle for this hook */
-  PETHREAD   Thread;         /* Thread owning the hook */
-  int        HookId;         /* Hook table index */
-  HOOKPROC   Proc;           /* Hook function */
-  BOOLEAN    Ansi;           /* Is it an Ansi hook? */
-  ULONG      Flags;          /* Some internal flags */
-  UNICODE_STRING ModuleName; /* Module name for global hooks */
-} HOOK, *PHOOK;
-#endif
 #define NB_HOOKS (WH_MAXHOOK-WH_MINHOOK+1)
 #define HOOKID_TO_INDEX(HookId) (HookId - WH_MINHOOK)
 #define HOOKID_TO_FLAG(HookId) (1 << ((HookId) + 1))
@@ -29,7 +16,6 @@
 typedef struct tagEVENTHOOK
 {
   LIST_ENTRY     Chain;      /* Event chain entry */
-  HWINEVENTHOOK  Self;       /* user handle for this event */
   PETHREAD       Thread;     /* Thread owning the event */
   UINT           eventMin;
   UINT           eventMax; 
@@ -39,6 +25,7 @@
   ULONG          Flags;      /* Some internal flags */
   ULONG_PTR      offPfn;
   INT            ihmod;
+  THRDESKHEAD    head; // FIXME When on top it creates problems
   UNICODE_STRING ModuleName; /* Module name for global events */
 } EVENTHOOK, *PEVENTHOOK;
 

Modified: trunk/reactos/subsystems/win32/win32k/include/window.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/include/window.h?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/window.h [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -169,7 +169,7 @@
 LRESULT FASTCALL
 IntDefWindowProc( PWINDOW_OBJECT Window, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL Ansi);
 
-VOID FASTCALL IntNotifyWinEvent(DWORD, HWND, LONG, LONG);
+VOID FASTCALL IntNotifyWinEvent(DWORD, PWND, LONG, LONG);
 
 PWND APIENTRY co_IntCreateWindowEx(DWORD,PUNICODE_STRING,PUNICODE_STRING,DWORD,LONG,LONG,LONG,LONG,HWND,HMENU,HINSTANCE,LPVOID,DWORD,BOOL);
 #endif /* _WIN32K_WINDOW_H */

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -48,7 +48,7 @@
                                              sizeof(CALLPROCDATA));
     if (NewCallProc != NULL)
     {
-        NewCallProc->hdr.Handle = Handle; /* FIXME: Remove hack */
+        NewCallProc->head.h = Handle;
         NewCallProc->pfnClientPrevious = CallProc->pfnClientPrevious;
         NewCallProc->Unicode = CallProc->Unicode;
         NewCallProc->spcpdNext = NULL;
@@ -73,7 +73,7 @@
                                              sizeof(CALLPROCDATA));
     if (NewCallProc != NULL)
     {
-        NewCallProc->hdr.Handle = Handle; /* FIXME: Remove hack */
+        NewCallProc->head.h = Handle;
         NewCallProc->pfnClientPrevious = WndProc;
         NewCallProc->Unicode = Unicode;
         NewCallProc->spcpdNext = NULL;

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -566,7 +566,7 @@
       DPRINT("No active desktop\n");
       return NULL;
    }
-   return pdo->spwndMessage->hdr.Handle;
+   return pdo->spwndMessage->head.h;
 }
 
 HWND FASTCALL IntGetCurrentThreadDesktopWindow(VOID)
@@ -1119,7 +1119,7 @@
 
    wc.cbSize = sizeof(wc);
    wc.style = 0;
-   wc.lpfnWndProc = gpsi->apfnClientW.pfnDesktopWndProc; // Use pfnMessageWindowProc
+   wc.lpfnWndProc = gpsi->apfnClientW.pfnMessageWindowProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = hModClient;

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/event.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/event.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -3,6 +3,9 @@
 
 #define NDEBUG
 #include <debug.h>
+
+#define WINEVENT_INIT      0x40000000
+#define WINEVENT_DESTROYED 0x80000000
 
 typedef struct _EVENTPACK
 {
@@ -126,10 +129,13 @@
 {
    if (pEH)
    {
+      DPRINT("IntRemoveEvent pEH 0x%x\n",pEH);
+      KeEnterCriticalRegion();
       RemoveEntryList(&pEH->Chain);
       GlobalEvents->Counts--;
       if (!GlobalEvents->Counts) gpsi->dwInstalledEventHooks = 0;
-      UserDeleteObject(pEH->Self, otEvent);
+      UserDeleteObject(pEH->head.h, otEvent);
+      KeLeaveCriticalRegion();
       return TRUE;
    }
    return FALSE;
@@ -150,14 +156,14 @@
 
    pEH = pEP->pEH;
    
-   Result = co_IntCallEventProc( pEH->Self,
-                                     event,
-                                      hwnd,
-                             pEP->idObject,
-                              pEP->idChild,
+   Result = co_IntCallEventProc( pEH->head.h,
+                                       event,
+                                        hwnd,
+                               pEP->idObject,
+                                pEP->idChild,
  (DWORD)(NtCurrentTeb()->ClientId).UniqueThread,
-                  (DWORD)EngGetTickCount(),
-                                 pEH->Proc);
+                    (DWORD)EngGetTickCount(),
+                                   pEH->Proc);
    return Result;
 }
 
@@ -165,19 +171,32 @@
 FASTCALL
 IntNotifyWinEvent(
    DWORD Event,
-   HWND  hWnd,
+   PWND  pWnd,
    LONG  idObject,
    LONG  idChild)
 {
    PEVENTHOOK pEH;
    LRESULT Result;
 
+   DPRINT("IntNotifyWinEvent GlobalEvents = 0x%x pWnd 0x%x\n",GlobalEvents, pWnd);
+
+   if (!pWnd) return;
+
+   if (pWnd && pWnd->state & WNDS_DESTROYED) return;
+
    if (!GlobalEvents || !GlobalEvents->Counts) return;
 
+   if (!UserIsEntered()) return;
+
    pEH = (PEVENTHOOK)GlobalEvents->Events.Flink;
-
+   DPRINT("IntNotifyWinEvent pEH 0x%x\n",pEH);
    do
    { 
+     if (pEH->Flags & WINEVENT_INIT)
+     {
+        DPRINT("IntNotifyWinEvent is still in INIT MODE!! pEH 0x%x\n",pEH);
+     }
+
      UserReferenceObject(pEH);
      // Must be inside the event window.
      if ( (pEH->eventMin <= Event) && (pEH->eventMax >= Event))
@@ -187,7 +206,7 @@
            if (!(pEH->idProcess) || !(pEH->idThread) || 
                (NtCurrentTeb()->ClientId.UniqueProcess == (PVOID)pEH->idProcess))
            {
-              Result = IntCallLowLevelEvent(pEH, Event, hWnd, idObject, idChild);
+              Result = IntCallLowLevelEvent(pEH, Event, UserHMGetHandle(pWnd), idObject, idChild);
            }
         }// if ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process)
         else if ( !(pEH->Flags & WINEVENT_SKIPOWNTHREAD) &&
@@ -196,14 +215,16 @@
                      !(pEH->Flags & WINEVENT_SKIPOWNPROCESS)) ||
                      !pEH->idProcess ) )
         {
-           Result = co_IntCallEventProc( pEH->Self,
-                                             Event,
-                                              hWnd,
-                                          idObject,
-                                           idChild,
+
+           Result = co_IntCallEventProc( pEH->head.h,
+                                               Event,
+                               UserHMGetHandle(pWnd),
+                                            idObject,
+                                             idChild,
              PtrToUint(NtCurrentTeb()->ClientId.UniqueThread),
-                          (DWORD)EngGetTickCount(),
-                                         pEH->Proc);
+                            (DWORD)EngGetTickCount(),
+                                           pEH->Proc);
+
         }
      }
      UserDereferenceObject(pEH);
@@ -234,7 +255,7 @@
    if (gpsi->dwInstalledEventHooks & GetMaskFromEvent(Event))
    {
       UserRefObjectCo(Window, &Ref);
-      IntNotifyWinEvent( Event, Window->hSelf, idObject, idChild);
+      IntNotifyWinEvent( Event, Window->Wnd, idObject, idChild);
       UserDerefObjectCo(Window);
    }
    UserLeave();
@@ -309,7 +330,10 @@
       InsertTailList(&GlobalEvents->Events, &pEH->Chain);
       GlobalEvents->Counts++;
 
-      pEH->Self      = Handle;
+      pEH->Flags     = dwflags|WINEVENT_INIT;
+      pEH->head.h    = Handle;
+//      pEH->head.pti  =?
+//      pEH->head.rpdesk
       if (Thread)
          pEH->Thread = Thread;
       else
@@ -318,8 +342,6 @@
       pEH->eventMax  = eventMax;
       pEH->idProcess = idProcess;
       pEH->idThread  = idThread;
-      pEH->Flags     = dwflags;
-
 
       if (NULL != hmodWinEventProc)
       {
@@ -371,6 +393,8 @@
       else
          pEH->Proc = lpfnWinEventProc;
 
+      pEH->Flags &= ~WINEVENT_INIT;
+
       UserDereferenceObject(pEH);
 
       Ret = Handle;

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/hook.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/hook.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/hook.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -104,7 +104,9 @@
         return NULL;
     }
 
-    Hook->Self = Handle;
+//    Hook->head.pti =?
+//    Hook->head.rpdesk
+    Hook->head.h = Handle;
     Hook->Thread = Thread;
     Hook->HookId = HookId;
 
@@ -218,7 +220,7 @@
     }
 
     /* Close handle */
-    UserDeleteObject(Hook->Self, otHook);
+    UserDeleteObject(Hook->head.h, otHook);
 }
 
 /* remove a hook, freeing it if the chain is not in use */
@@ -1282,7 +1284,7 @@
         Hook->Proc = HookProc;
 
     Hook->Ansi = Ansi;
-    Handle = Hook->Self;
+    Handle = Hook->head.h;
 
     /* Clear the client threads next hook. */
     ClientInfo->phkCurrent = 0;
@@ -1333,7 +1335,7 @@
         RETURN( FALSE);
     }
 
-    ASSERT(Hook == HookObj->Self);
+    ASSERT(Hook == HookObj->head.h);
 
     IntRemoveHook(HookObj, WinStaObj, FALSE);
 

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/object.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/object.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/object.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/object.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -382,7 +382,7 @@
    if (!hdr->destroyed && hdr->RefCount == 0)
    {
       hdr->RefCount++; // BOUNCE!!!!!
-      DPRINT1("warning! Dereference to zero without deleting!\n");
+      DPRINT1("warning! Dereference to zero without deleting! Obj -> 0x%x\n", obj);
    }
 
    if (hdr->RefCount == 0 && hdr->destroyed)

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/windc.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -418,7 +418,7 @@
    // Window nz, check to see if we still own this or it is just cheap wine tonight.
    if (!(Flags & DCX_CACHE))
    {
-      if ( Wnd->pti != GetW32ThreadInfo())
+      if ( Wnd->head.pti != GetW32ThreadInfo())
          Flags |= DCX_CACHE; // Ah~ Not Powned! Forced to be cheap~
    }
 

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/window.c?rev=42223&r1=42222&r2=42223&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Sun Jul 26 03:59:08 2009
@@ -329,12 +329,12 @@
    {
        Wnd->strName.Length = 0;
        Wnd->strName.MaximumLength = 0;
-       DesktopHeapFree(Wnd->rpdesk,
+       DesktopHeapFree(Wnd->head.rpdesk,
                        Wnd->strName.Buffer);
        Wnd->strName.Buffer = NULL;
    }
 
-    DesktopHeapFree(Wnd->rpdesk, Wnd);
+    DesktopHeapFree(Wnd->head.rpdesk, Wnd);
     WindowObject->Wnd = NULL;
 }
 
@@ -370,6 +370,9 @@
    }
    Window->Status |= WINDOWSTATUS_DESTROYING;
    Wnd->style &= ~WS_VISIBLE;
+
+   IntNotifyWinEvent(EVENT_OBJECT_DESTROY, Wnd, 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
       in IntDestroyWindow() */
@@ -378,8 +381,6 @@
    BelongsToThreadData = IntWndBelongsToThread(Window, ThreadData);
 
    IntDeRegisterShellHookWindow(Window->hSelf);
-
-   IntNotifyWinEvent(EVENT_OBJECT_DESTROY, Window->hSelf, OBJID_WINDOW, 0);
 
    if(SendMessages)
    {
@@ -428,6 +429,8 @@
 
    /* from now on no messages can be sent to this window anymore */
    Window->Status |= WINDOWSTATUS_DESTROYED;
+   Wnd->state |= WNDS_DESTROYED;
+
    /* don't remove the WINDOWSTATUS_DESTROYING bit */
 
    /* reset shell window handles */
@@ -569,10 +572,10 @@
                                                Wnd->Unicode);
                 if (NewCallProc == NULL)
                 {
-                    NewCallProc = CreateCallProc(Wnd->pti->pDeskInfo,
+                    NewCallProc = CreateCallProc(Wnd->head.pti->pDeskInfo,
                                                  Wnd->lpfnWndProc,
                                                  Wnd->Unicode,
-                                                 Wnd->pti->ppi);
+                                                 Wnd->head.pti->ppi);
                     if (NewCallProc == NULL)
                     {
                         SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
@@ -1669,11 +1672,11 @@
            goto AllocErr;
        RtlZeroMemory(Window->Wnd,
                      sizeof(WND) + Class->cbwndExtra);
-       Window->Wnd->hdr.Handle = hWnd; /* FIXME: Remove hack , are you sure?*/
+       Window->Wnd->head.h = hWnd;
        Wnd = Window->Wnd;
 
-       Wnd->pti = ti;
-       Wnd->rpdesk = pti->Desktop;
+       Wnd->head.pti = ti;
+       Wnd->head.rpdesk = pti->Desktop;
        Wnd->hWndLastActive = hWnd;
    }
 
@@ -1769,7 +1772,7 @@
 
    if ( NULL != WindowName->Buffer && WindowName->Length > 0 )
    {
-      Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->rpdesk,
+      Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->head.rpdesk,
                                                 WindowName->Length + sizeof(UNICODE_NULL));
       if (Wnd->strName.Buffer == NULL)
       {
@@ -2122,7 +2125,7 @@
       RETURN((PWND)0);
    }
 
-   IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window->hSelf, OBJID_WINDOW, 0);
+   IntNotifyWinEvent(EVENT_OBJECT_CREATE, Window->Wnd, OBJID_WINDOW, 0);
 
    /* Send move and size messages. */
    if (!(Window->Flags & WINDOWOBJECT_NEED_SIZE))
@@ -2240,7 +2243,7 @@
    {
       PCALLPROCDATA CallProc;
       //CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, bUnicodeWindow, Wnd->ti->ppi);
-      CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, Wnd->Unicode , Wnd->pti->ppi);
+      CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, Wnd->Unicode , Wnd->head.pti->ppi);
 
       if (!CallProc)
       {
@@ -2363,7 +2366,7 @@
                                       dwShowMode,
                                       bUnicodeWindow);
 
-   if (pNewWindow) NewWindow = pNewWindow->hdr.Handle;
+   if (pNewWindow) NewWindow = UserHMGetHandle(pNewWindow);
 
    if (WindowName.Buffer)
    {
@@ -3729,7 +3732,7 @@
                 CallProc = CreateCallProc(NULL,
                                           Wnd->lpfnWndProc,
                                           Wnd->Unicode,
-                                          Wnd->pti->ppi);
+                                          Wnd->head.pti->ppi);
                 if (CallProc == NULL)
                 {
                     SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
@@ -4819,10 +4822,10 @@
          Wnd->strName.Buffer = NULL;
          if (buf != NULL)
          {
-            DesktopHeapFree(Wnd->rpdesk, buf);
+            DesktopHeapFree(Wnd->head.rpdesk, buf);
          }
 
-         Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->rpdesk,
+         Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->head.rpdesk,
                                                    UnicodeString.Length + sizeof(UNICODE_NULL));
          if (Wnd->strName.Buffer != NULL)
          {




More information about the Ros-diffs mailing list