Author: jimtabor
Date: Sat Jan 30 05:23:58 2010
New Revision: 45339

URL: http://svn.reactos.org/svn/reactos?rev=45339&view=rev
Log:
[Win32k|User32]
- Updated paint functions to use one calls.
- Found one leak in engwindow.c and monitor.c, not the big one.

Modified:
    trunk/reactos/dll/win32/user32/windows/paint.c
    trunk/reactos/subsystems/win32/win32k/eng/engwindow.c
    trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c
    trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
    trunk/reactos/subsystems/win32/win32k/ntuser/window.c

Modified: trunk/reactos/dll/win32/user32/windows/paint.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/paint.c?rev=45339&r1=45338&r2=45339&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/paint.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/paint.c [iso-8859-1] Sat Jan 30 
05:23:58 2010
@@ -198,8 +198,7 @@
        pWnd->state & WNDS_INTERNALPAINT ||
        pWnd->spwndChild )
   {*/
-     return RedrawWindow( hWnd, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN );
-//     return NtUserCallHwndLock(hWnd, HWNDLOCK_ROUTINE_UPDATEWINDOW);
+     return NtUserCallHwndLock(hWnd, HWNDLOCK_ROUTINE_UPDATEWINDOW);
 /*  }
   return TRUE;*/
 }
@@ -213,10 +212,7 @@
   HWND hWnd,
   HRGN hRgn)
 {
-  /* FIXME: should RDW_NOCHILDREN be included too? Ros used to,
-     but Wine dont so i removed it... */
-  return RedrawWindow( hWnd, NULL, hRgn, RDW_VALIDATE );
-//  return NtUserCallHwndParamLock(hWnd, (DWORD)hRgn, 
TWOPARAM_ROUTINE_VALIDATERGN);
+  return NtUserCallHwndParamLock(hWnd, (DWORD)hRgn, 
TWOPARAM_ROUTINE_VALIDATERGN);
 }
 
 /*

Modified: trunk/reactos/subsystems/win32/win32k/eng/engwindow.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng/engwindow.c?rev=45339&r1=45338&r2=45339&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/engwindow.c [iso-8859-1] 
(original)
+++ trunk/reactos/subsystems/win32/win32k/eng/engwindow.c [iso-8859-1] Sat Jan 
30 05:23:58 2010
@@ -83,6 +83,8 @@
   PROSRGNDATA visRgn;
   CLIPOBJ *ClipObj = NULL;
   CLIPOBJ *OldClipObj;
+
+  DPRINT("IntEngWndUpdateClipObj\n");
 
   hVisRgn = VIS_ComputeVisibleRegion(Window, TRUE, TRUE, TRUE);
   if (hVisRgn != NULL)
@@ -115,6 +117,7 @@
     {
       DPRINT1("Warning: Couldn't lock visible region of window DC\n");
     }
+    REGION_FreeRgnByHandle(hVisRgn);
   }
   else
   {

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c?rev=45339&r1=45338&r2=45339&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] 
(original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/monitor.c [iso-8859-1] Sat Jan 
30 05:23:58 2010
@@ -190,7 +190,7 @@
    Monitor->rcWork = Monitor->rcMonitor;
    Monitor->cWndStack = 0;
 
-   Monitor->hrgnMonitor= IntSysCreateRectRgnIndirect( &Monitor->rcMonitor );
+   Monitor->hrgnMonitor = IntSysCreateRectRgnIndirect( &Monitor->rcMonitor );
 
    IntGdiSetRegionOwner(Monitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC);
 
@@ -263,6 +263,9 @@
       if (Monitor->Next != NULL)
          Monitor->Next->Prev = Monitor->Prev;
    }
+
+   if (Monitor->hrgnMonitor)
+      REGION_FreeRgnByHandle(Monitor->hrgnMonitor);
 
    IntDestroyMonitorObject(Monitor);
 

Modified: trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c?rev=45339&r1=45338&r2=45339&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] 
(original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/simplecall.c [iso-8859-1] Sat 
Jan 30 05:23:58 2010
@@ -712,9 +712,39 @@
    DWORD Param,
    DWORD Routine)
 {
-   UNIMPLEMENTED;
-
-   return 0;
+   DWORD Ret = 0;
+   PWINDOW_OBJECT Window;
+   PWND Wnd;
+   USER_REFERENCE_ENTRY Ref;
+   DECLARE_RETURN(DWORD);
+
+   DPRINT1("Enter NtUserCallHwndParamLock\n");
+   UserEnterExclusive();
+
+   if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+   {
+      RETURN( FALSE);
+   }
+   UserRefObjectCo(Window, &Ref);
+
+   Wnd = Window->Wnd;
+
+   switch (Routine)
+   {
+      case TWOPARAM_ROUTINE_VALIDATERGN:
+         Ret = (DWORD)co_UserRedrawWindow( Window, NULL, (HRGN)Param, 
RDW_VALIDATE);
+         break;
+   }
+
+   UserDerefObjectCo(Window);
+
+   RETURN( Ret);
+
+CLEANUP:
+   DPRINT1("Leave NtUserCallHwndParamLock, ret=%i\n",_ret_);
+   UserLeave();
+   END_CLEANUP;
+
 }
 
 /* EOF */

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=45339&r1=45338&r2=45339&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] Sat Jan 
30 05:23:58 2010
@@ -4625,6 +4625,7 @@
    HRGN hRgn,
    BOOL bRedraw)
 {
+   HRGN hrgnCopy;
    PWINDOW_OBJECT Window;
    DECLARE_RETURN(INT);
 
@@ -4636,15 +4637,25 @@
       RETURN( 0);
    }
 
-   /* FIXME - Verify if hRgn is a valid handle!!!!
-              Propably make this operation thread-safe, but maybe it's not 
necessary */
-
-   if(Window->hrgnClip)
+   if (hRgn) // The region will be deleted in user32.
+   {
+      if (GDIOBJ_ValidateHandle(hRgn, GDI_OBJECT_TYPE_REGION))
+      {
+         hrgnCopy = IntSysCreateRectRgn(0, 0, 0, 0);
+         NtGdiCombineRgn(hrgnCopy, hRgn, 0, RGN_COPY);
+      }
+      else
+         RETURN( 0);
+   }
+   else
+      hrgnCopy = (HRGN) 1;
+
+   if (Window->hrgnClip)
    {
       /* Delete no longer needed region handle */
       GreDeleteObject(Window->hrgnClip);
    }
-   Window->hrgnClip = hRgn;
+   Window->hrgnClip = hrgnCopy;
 
    /* FIXME - send WM_WINDOWPOSCHANGING and WM_WINDOWPOSCHANGED messages to 
the window */
 


Reply via email to