[Win32k|User32]

- Updated paint functions to use one calls.
- Found one leak in engwindow.c and monitor.c, not the big one.

svn path=/trunk/; revision=45339
This commit is contained in:
James Tabor 2010-01-30 04:23:58 +00:00
parent 4d1da2ea5c
commit 1263c98dae
5 changed files with 56 additions and 13 deletions

View file

@ -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);
}
/*

View file

@ -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
{

View file

@ -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;

View file

@ -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 */

View file

@ -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 */