Commit in reactos on win32k_user_rewrite
include/win32k/ntuser.h+1-11.137.4.2 -> 1.137.4.3
subsys/win32k/include/internal.h+6-41.1.4.5 -> 1.1.4.6
subsys/win32k/ntuser/ntuser.c+103-141.1.4.6 -> 1.1.4.7
                    /prop.c+45-211.11.12.1 -> 1.11.12.2
                    /stubs.c+1-381.45.12.3 -> 1.45.12.4
                    /window.c+5-51.244.2.3 -> 1.244.2.4
+161-83
6 modified files
some more fixes

reactos/include/win32k
ntuser.h 1.137.4.2 -> 1.137.4.3
diff -u -r1.137.4.2 -r1.137.4.3
--- ntuser.h	27 Aug 2004 15:56:04 -0000	1.137.4.2
+++ ntuser.h	1 Sep 2004 14:14:25 -0000	1.137.4.3
@@ -1728,7 +1728,7 @@
   HANDLE ProcessID;
 } WndProcHandle;
                                     
-DWORD STDCALL
+BOOL STDCALL
 NtUserDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data);
 
 VOID STDCALL

reactos/subsys/win32k/include
internal.h 1.1.4.5 -> 1.1.4.6
diff -u -r1.1.4.5 -r1.1.4.6
--- internal.h	31 Aug 2004 14:34:38 -0000	1.1.4.5
+++ internal.h	1 Sep 2004 14:14:26 -0000	1.1.4.6
@@ -695,7 +695,8 @@
   ATOM Atom;
 } PROPERTY;
 
-BOOL      FASTCALL IntSetProp(PWINDOW_OBJECT Wnd, ATOM Atom, HANDLE Data);
+BOOL      FASTCALL IntSetProp(PWINDOW_OBJECT WindowObject, ATOM Atom, HANDLE Data);
+BOOL      FASTCALL IntRemoveProp(PWINDOW_OBJECT WindowObject, ATOM Atom, HANDLE *Data);
 PPROPERTY FASTCALL IntGetProp(PWINDOW_OBJECT WindowObject, ATOM Atom);
 
 /* SCROLL BARS ****************************************************************/
@@ -925,9 +926,10 @@
 WORD           FASTCALL IntSetWindowWord(PWINDOW_OBJECT WindowObject, INT Index, WORD NewValue);
 ULONG          FASTCALL IntGetWindowThreadProcessId(PWINDOW_OBJECT Window, ULONG *Pid);
 PWINDOW_OBJECT FASTCALL IntGetWindow(PWINDOW_OBJECT Window, UINT uCmd);
-DWORD                   IntRemoveWndProcHandle(WNDPROC Handle);
-DWORD                   IntRemoveProcessWndProcHandles(HANDLE ProcessID);
-DWORD                   IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
+BOOL           FASTCALL IntDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data);
+DWORD          FASTCALL IntRemoveWndProcHandle(WNDPROC Handle);
+DWORD          FASTCALL IntRemoveProcessWndProcHandles(HANDLE ProcessID);
+DWORD          FASTCALL IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
 
 /* WINPOS *********************************************************************/
 

reactos/subsys/win32k/ntuser
ntuser.c 1.1.4.6 -> 1.1.4.7
diff -u -r1.1.4.6 -r1.1.4.7
--- ntuser.c	31 Aug 2004 14:34:39 -0000	1.1.4.6
+++ ntuser.c	1 Sep 2004 14:14:26 -0000	1.1.4.7
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: ntuser.c,v 1.1.4.6 2004/08/31 14:34:39 weiden Exp $
+/* $Id: ntuser.c,v 1.1.4.7 2004/09/01 14:14:26 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -45,7 +45,7 @@
   } \
   return Result; \
 error: \
-  return ErrorResult;
+  return ErrorResult
 
 #define END_NTUSER_NOERR() \
   return Result;
@@ -533,6 +533,19 @@
 }
 
 BOOL STDCALL
+NtUserDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data)
+{
+  BEGIN_NTUSER_NOERR(BOOL);
+  
+  ENTER_CRITICAL();
+  /* FIXME - probe the buffer Data points to */
+  Result = IntDereferenceWndProcHandle(wpHandle, Data);
+  LEAVE_CRITICAL();
+  
+  END_NTUSER_NOERR();
+}
+
+BOOL STDCALL
 NtUserDestroyCursorIcon(HANDLE Handle,
                         DWORD Unknown)
 {
@@ -586,7 +599,7 @@
   
   NTUSER_COPY_BUFFER_NTERROR(&MsgInfo, UnsafeMsgInfo, sizeof(NTUSERDISPATCHMESSAGEINFO));
   
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   if(MsgInfo.Msg.hwnd != NULL)
   {
     /* win doesn't set a last error in this case */
@@ -645,7 +658,7 @@
      back the buffer */
   NTUSER_COPY_BUFFER_W32ERROR(&SafePs, lPs, sizeof(PAINTSTRUCT), ERROR_NOACCESS);
   
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   if(hWnd != NULL)
   {
     VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
@@ -716,7 +729,7 @@
     case GA_ROOT:
     case GA_ROOTOWNER:
     {
-      ENTER_CRITICAL();
+      ENTER_CRITICAL_SHARED();
       VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
       Ancestor = IntGetAncestor(Window, Type);
       Result = (Ancestor != NULL ? Ancestor->Handle : NULL);
@@ -864,7 +877,7 @@
   
   NTUSER_FAIL_INVALID_PARAMETER(IconInfo, NULL);
   
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   VALIDATE_USER_OBJECT(CURSOR, Handle, Cursor);
   IntGetCursorIconInfo(Cursor, &SafeInfo);
   LEAVE_CRITICAL();
@@ -891,7 +904,7 @@
   NTUSER_FAIL_INVALID_PARAMETER(fIcon, NULL);
   NTUSER_FAIL_INVALID_PARAMETER(Size, NULL);
   
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   VALIDATE_USER_OBJECT(CURSOR, Handle, Cursor);
   Result = IntGetCursorIconSize(Cursor, &SafeIsIcon, &SafeSize);
   LEAVE_CRITICAL();
@@ -1031,7 +1044,7 @@
   
   GotMessage = FALSE;
   
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   if(Wnd != NULL)
   {
     VALIDATE_USER_OBJECT(WINDOW, Wnd, Window);
@@ -1121,6 +1134,22 @@
   END_NTUSER();
 }
 
+HANDLE STDCALL
+NtUserGetProp(HWND hWnd, ATOM Atom)
+{
+  PPROPERTY Property;
+  NTUSER_USER_OBJECT(WINDOW, Window);
+  BEGIN_NTUSER(HANDLE, NULL);
+
+  ENTER_CRITICAL_SHARED();
+  VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+  Property = IntGetProp(Window, Atom);
+  Result = (Property != NULL ? Property->Data : NULL);
+  LEAVE_CRITICAL();
+
+  END_NTUSER();
+}
+
 HWND STDCALL
 NtUserGetShellWindow()
 {
@@ -1146,7 +1175,7 @@
     NTUSER_FAIL();
   }
   
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   Result = IntGetSystemMetrics(Index);
   LEAVE_CRITICAL();
    
@@ -1162,7 +1191,7 @@
   BEGIN_NTUSER(BOOL, FALSE);
   
   /* FIXME - if bErase == FALSE, should we do ENTER_CRITICAL_SHARED() instead? */
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
   Result = IntGetUpdateRect(Window, &SafeRect, bErase);
   LEAVE_CRITICAL();
@@ -1182,7 +1211,7 @@
   BEGIN_NTUSER(INT, ERROR);
   
   /* FIXME - if bErase == FALSE, should we do ENTER_CRITICAL_SHARED() instead? */
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
   Result = IntGetUpdateRgn(Window, hRgn, bErase);
   LEAVE_CRITICAL();
@@ -1212,7 +1241,7 @@
   NTUSER_USER_OBJECT(WINDOW, Window);
   BEGIN_NTUSER(HDC, NULL);
   
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   if(hWnd != NULL)
   {
     VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
@@ -1357,7 +1386,7 @@
     MsgFilterMax = 0;
   }
   
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   if(hWnd != NULL)
   {
     VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
@@ -1513,6 +1542,35 @@
   END_NTUSER();
 }
 
+BOOL STDCALL
+NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate,
+   UINT flags)
+{
+  NTUSER_USER_OBJECT(WINDOW, Window);
+  BEGIN_NTUSER(BOOL, FALSE);
+  
+  /* FIXME - probe lprcUpdate! */
+  
+  ENTER_CRITICAL_SHARED();
+  if(hWnd != NULL)
+  {
+    VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+  }
+  else
+  {
+    if(!(Window = IntGetDesktopWindow()))
+    {
+      LEAVE_CRITICAL();
+      DPRINT1("RedrawWindow(): Unable to get desktop window!\n");
+      NTUSER_FAIL_ERROR(ERROR_ACCESS_DENIED);
+    }
+  }
+  Result = IntRedrawWindow(Window, (LPRECT)lprcUpdate, hrgnUpdate, flags);
+  LEAVE_CRITICAL();
+  
+  END_NTUSER();
+}
+
 RTL_ATOM STDCALL
 NtUserRegisterClassExWOW(CONST WNDCLASSEXW* lpwcx,
                          PUNICODE_STRING ClassName,
@@ -1594,7 +1652,7 @@
   NTUSER_USER_OBJECT(WINDOW, Window);
   BEGIN_NTUSER(INT, 0);
   
-  ENTER_CRITICAL();
+  ENTER_CRITICAL_SHARED();
   if(hWnd != NULL)
   {
     VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
@@ -1616,6 +1674,23 @@
   END_NTUSER();
 }
 
+HANDLE STDCALL
+NtUserRemoveProp(HWND hWnd, ATOM Atom)
+{
+  NTUSER_USER_OBJECT(WINDOW, Window);
+  BEGIN_NTUSER(HANDLE, NULL);
+
+  ENTER_CRITICAL();
+  VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+  if(!IntRemoveProp(Window, Atom, &Result))
+  {
+    Result = NULL;
+  }
+  LEAVE_CRITICAL();
+
+  END_NTUSER();
+}
+
 UINT STDCALL
 NtUserSendInput(UINT nInputs,
                 LPINPUT pInput,
@@ -1879,6 +1954,20 @@
 }
 
 BOOL STDCALL
+NtUserSetProp(HWND hWnd, ATOM Atom, HANDLE Data)
+{
+  NTUSER_USER_OBJECT(WINDOW, Window);
+  BEGIN_NTUSER(BOOL, FALSE);
+  
+  ENTER_CRITICAL();
+  VALIDATE_USER_OBJECT(WINDOW, hWnd, Window);
+  Result = IntSetProp(Window, Atom, Data);
+  LEAVE_CRITICAL();
+  
+  END_NTUSER();
+}
+
+BOOL STDCALL
 NtUserSetShellWindowEx(HWND hwndShell, HWND hwndListView)
 {
   NTUSER_USER_OBJECT(WINDOW, ShellWindow);

reactos/subsys/win32k/ntuser
prop.c 1.11.12.1 -> 1.11.12.2
diff -u -r1.11.12.1 -r1.11.12.2
--- prop.c	15 Jul 2004 20:07:18 -0000	1.11.12.1
+++ prop.c	1 Sep 2004 14:14:26 -0000	1.11.12.2
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: prop.c,v 1.11.12.1 2004/07/15 20:07:18 weiden Exp $
+/* $Id: prop.c,v 1.11.12.2 2004/09/01 14:14:26 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -30,7 +30,7 @@
 
 #include <w32k.h>
 
-//#define NDEBUG
+#define NDEBUG
 #include <debug.h>
 
 typedef struct _PROPLISTITEM
@@ -48,39 +48,63 @@
   PPROPERTY Property;
   
   ListEntry = WindowObject->PropListHead.Flink;
-  while (ListEntry != &WindowObject->PropListHead)
+  while(ListEntry != &WindowObject->PropListHead)
+  {
+    Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
+    if(Property->Atom == Atom)
     {
-      Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
-      if (Property->Atom == Atom)
-	{
-	  return(Property);
-	}
-      ListEntry = ListEntry->Flink;
+      return Property;
     }
-  return(NULL);
+    ListEntry = ListEntry->Flink;
+  }
+  
+  return NULL;
 }
 
 BOOL FASTCALL
-IntSetProp(PWINDOW_OBJECT Wnd, ATOM Atom, HANDLE Data)
+IntRemoveProp(PWINDOW_OBJECT WindowObject, ATOM Atom, HANDLE *Data)
 {
-  PPROPERTY Prop;
+  PLIST_ENTRY ListEntry;
+  PPROPERTY Property;
+  
+  ASSERT(Data);
 
-  Prop = IntGetProp(Wnd, Atom);
+  ListEntry = WindowObject->PropListHead.Flink;
+  while(ListEntry != &WindowObject->PropListHead)
+  {
+    Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
+    if(Property->Atom == Atom)
+    {
+      *Data = Property->Data;
+      RemoveEntryList(&Property->PropListEntry);
+      ExFreePool(Property);
+      return TRUE;
+    }
+    ListEntry = ListEntry->Flink;
+  }
+  
+  return FALSE;
+}
 
-  if (Prop == NULL)
+BOOL FASTCALL
+IntSetProp(PWINDOW_OBJECT WindowObject, ATOM Atom, HANDLE Data)
+{
+  PPROPERTY Prop = IntGetProp(WindowObject, Atom);
+  if(Prop == NULL)
   {
     Prop = ExAllocatePoolWithTag(PagedPool, sizeof(PROPERTY), TAG_WNDPROP);
-    if (Prop == NULL)
+    if(Prop != NULL)
     {
-      return FALSE;
+      Prop->Atom = Atom;
+      Prop->Data = Data;
+      InsertTailList(&WindowObject->PropListHead, &Prop->PropListEntry);
+      WindowObject->PropListItems++;
+
+      return TRUE;
     }
-    Prop->Atom = Atom;
-    InsertTailList(&Wnd->PropListHead, &Prop->PropListEntry);
-    Wnd->PropListItems++;
   }
 
-  Prop->Data = Data;
-  return TRUE;
+  return FALSE;
 }
 
 /* EOF */

reactos/subsys/win32k/ntuser
stubs.c 1.45.12.3 -> 1.45.12.4
diff -u -r1.45.12.3 -r1.45.12.4
--- stubs.c	31 Aug 2004 11:38:56 -0000	1.45.12.3
+++ stubs.c	1 Sep 2004 14:14:26 -0000	1.45.12.4
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.45.12.3 2004/08/31 11:38:56 weiden Exp $
+/* $Id: stubs.c,v 1.45.12.4 2004/09/01 14:14:26 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -750,15 +750,6 @@
    return FALSE;
 }
 
-
-BOOL STDCALL
-NtUserRedrawWindow(HWND hWnd, CONST RECT *lprcUpdate, HRGN hrgnUpdate,
-   UINT flags)
-{
-   UNIMPLEMENTED;
-   return FALSE;
-}
-
 /*
  * Scroll
  */
@@ -854,27 +845,6 @@
    return FALSE;
 }
 
-HANDLE STDCALL
-NtUserRemoveProp(HWND hWnd, ATOM Atom)
-{
-   UNIMPLEMENTED;
-   return FALSE;
-}
-
-HANDLE STDCALL
-NtUserGetProp(HWND hWnd, ATOM Atom)
-{
-   UNIMPLEMENTED;
-   return FALSE;
-}
-
-BOOL STDCALL
-NtUserSetProp(HWND hWnd, ATOM Atom, HANDLE Data)
-{
-   UNIMPLEMENTED;
-   return FALSE;
-}
-
 /*
  * Timers
  */
@@ -1319,13 +1289,6 @@
 }
 
 
-DWORD STDCALL
-NtUserDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data)
-{
-   UNIMPLEMENTED;
-   return 0;
-}
-
 /*
  * Miscellaneous
  */

reactos/subsys/win32k/ntuser
window.c 1.244.2.3 -> 1.244.2.4
diff -u -r1.244.2.3 -r1.244.2.4
--- window.c	31 Aug 2004 11:38:56 -0000	1.244.2.3
+++ window.c	1 Sep 2004 14:14:26 -0000	1.244.2.4
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: window.c,v 1.244.2.3 2004/08/31 11:38:56 weiden Exp $
+/* $Id: window.c,v 1.244.2.4 2004/09/01 14:14:26 weiden Exp $
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -2026,7 +2026,7 @@
 
 /* WINPROC ********************************************************************/
 
-DWORD FASTCALL
+BOOL FASTCALL
 IntDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data)
 {
 	WndProcHandle Entry;
@@ -2043,7 +2043,7 @@
 	return FALSE;
 }
 
-DWORD
+DWORD FASTCALL
 IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode)
 {
 	WORD i;
@@ -2076,7 +2076,7 @@
 	return FreeSpot + 0xFFFF0000;
 }
 
-DWORD
+DWORD FASTCALL
 IntRemoveWndProcHandle(WNDPROC Handle)
 {
 	WORD position;
@@ -2091,7 +2091,7 @@
 	return TRUE;
 }
 
-DWORD
+DWORD FASTCALL
 IntRemoveProcessWndProcHandles(HANDLE ProcessID)
 {
 	WORD i;
CVSspam 0.2.8