diff --git a/reactos/dll/win32/user32/windows/paint.c b/reactos/dll/win32/user32/windows/paint.c index 49e0e1c202d..290f42c7705 100644 --- a/reactos/dll/win32/user32/windows/paint.c +++ b/reactos/dll/win32/user32/windows/paint.c @@ -198,8 +198,7 @@ UpdateWindow( 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 @@ ValidateRgn( 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); } /* diff --git a/reactos/subsystems/win32/win32k/eng/engwindow.c b/reactos/subsystems/win32/win32k/eng/engwindow.c index 08c004458b7..aed25f0e8b8 100644 --- a/reactos/subsystems/win32/win32k/eng/engwindow.c +++ b/reactos/subsystems/win32/win32k/eng/engwindow.c @@ -84,6 +84,8 @@ IntEngWndUpdateClipObj( CLIPOBJ *ClipObj = NULL; CLIPOBJ *OldClipObj; + DPRINT("IntEngWndUpdateClipObj\n"); + hVisRgn = VIS_ComputeVisibleRegion(Window, TRUE, TRUE, TRUE); if (hVisRgn != NULL) { @@ -115,6 +117,7 @@ IntEngWndUpdateClipObj( { DPRINT1("Warning: Couldn't lock visible region of window DC\n"); } + REGION_FreeRgnByHandle(hVisRgn); } else { diff --git a/reactos/subsystems/win32/win32k/ntuser/monitor.c b/reactos/subsystems/win32/win32k/ntuser/monitor.c index 24598fb3ae7..072bad97df4 100644 --- a/reactos/subsystems/win32/win32k/ntuser/monitor.c +++ b/reactos/subsystems/win32/win32k/ntuser/monitor.c @@ -190,7 +190,7 @@ IntAttachMonitor(IN PDEVOBJ *pGdiDevice, Monitor->rcWork = Monitor->rcMonitor; Monitor->cWndStack = 0; - Monitor->hrgnMonitor= IntSysCreateRectRgnIndirect( &Monitor->rcMonitor ); + Monitor->hrgnMonitor = IntSysCreateRectRgnIndirect( &Monitor->rcMonitor ); IntGdiSetRegionOwner(Monitor->hrgnMonitor, GDI_OBJ_HMGR_PUBLIC); @@ -264,6 +264,9 @@ IntDetachMonitor(IN PDEVOBJ *pGdiDevice) Monitor->Next->Prev = Monitor->Prev; } + if (Monitor->hrgnMonitor) + REGION_FreeRgnByHandle(Monitor->hrgnMonitor); + IntDestroyMonitorObject(Monitor); return STATUS_SUCCESS; diff --git a/reactos/subsystems/win32/win32k/ntuser/simplecall.c b/reactos/subsystems/win32/win32k/ntuser/simplecall.c index 08a8e0d2dbe..3522cd15e95 100644 --- a/reactos/subsystems/win32/win32k/ntuser/simplecall.c +++ b/reactos/subsystems/win32/win32k/ntuser/simplecall.c @@ -712,9 +712,39 @@ NtUserCallHwndParamLock( DWORD Param, DWORD Routine) { - UNIMPLEMENTED; + 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; - return 0; } /* EOF */ diff --git a/reactos/subsystems/win32/win32k/ntuser/window.c b/reactos/subsystems/win32/win32k/ntuser/window.c index 52708c43ea5..299138710b7 100644 --- a/reactos/subsystems/win32/win32k/ntuser/window.c +++ b/reactos/subsystems/win32/win32k/ntuser/window.c @@ -4625,6 +4625,7 @@ NtUserSetWindowRgn( HRGN hRgn, BOOL bRedraw) { + HRGN hrgnCopy; PWINDOW_OBJECT Window; DECLARE_RETURN(INT); @@ -4636,15 +4637,25 @@ NtUserSetWindowRgn( RETURN( 0); } - /* FIXME - Verify if hRgn is a valid handle!!!! - Propably make this operation thread-safe, but maybe it's not necessary */ + 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) + 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 */