mirror of
https://github.com/reactos/reactos.git
synced 2025-05-19 00:54:18 +00:00
[WIN32K]
Make sure to respect GDI object lock order in (Nt)UserScrollDC svn path=/trunk/; revision=65745
This commit is contained in:
parent
b037edeae8
commit
fc5dd61639
1 changed files with 22 additions and 14 deletions
|
@ -1490,6 +1490,7 @@ UserScrollDC(
|
||||||
INT dy,
|
INT dy,
|
||||||
const RECTL *prcScroll,
|
const RECTL *prcScroll,
|
||||||
const RECTL *prcClip,
|
const RECTL *prcClip,
|
||||||
|
HRGN hrgnUpdate,
|
||||||
PREGION RgnUpdate,
|
PREGION RgnUpdate,
|
||||||
RECTL *prcUpdate)
|
RECTL *prcUpdate)
|
||||||
{
|
{
|
||||||
|
@ -1535,16 +1536,27 @@ UserScrollDC(
|
||||||
|
|
||||||
/* Calculate the region that was invalidated by moving or
|
/* Calculate the region that was invalidated by moving or
|
||||||
could not be copied, because it was not visible */
|
could not be copied, because it was not visible */
|
||||||
if (RgnUpdate || prcUpdate)
|
if (RgnUpdate || hrgnUpdate || prcUpdate)
|
||||||
{
|
{
|
||||||
PREGION RgnOwn, RgnTmp;
|
PREGION RgnOwn, RgnTmp;
|
||||||
|
|
||||||
pDC = DC_LockDc(hDC);
|
pDC = DC_LockDc(hDC);
|
||||||
if (!pDC)
|
if (!pDC)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hrgnUpdate)
|
||||||
|
{
|
||||||
|
NT_ASSERT(RgnUpdate == NULL);
|
||||||
|
RgnUpdate = RGNOBJAPI_Lock(hrgnUpdate, NULL);
|
||||||
|
if (!RgnUpdate)
|
||||||
|
{
|
||||||
|
DC_UnlockDc(pDC);
|
||||||
|
return ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Begin with the shifted and then clipped scroll rect */
|
/* Begin with the shifted and then clipped scroll rect */
|
||||||
rcDst = rcScroll;
|
rcDst = rcScroll;
|
||||||
RECTL_vOffsetRect(&rcDst, dx, dy);
|
RECTL_vOffsetRect(&rcDst, dx, dy);
|
||||||
|
@ -1578,7 +1590,11 @@ UserScrollDC(
|
||||||
REGION_GetRgnBox(RgnOwn, prcUpdate);
|
REGION_GetRgnBox(RgnOwn, prcUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!RgnUpdate)
|
if (hrgnUpdate)
|
||||||
|
{
|
||||||
|
RGNOBJAPI_Unlock(RgnUpdate);
|
||||||
|
}
|
||||||
|
else if (!RgnUpdate)
|
||||||
{
|
{
|
||||||
REGION_Delete(RgnOwn);
|
REGION_Delete(RgnOwn);
|
||||||
}
|
}
|
||||||
|
@ -1609,7 +1625,6 @@ NtUserScrollDC(
|
||||||
RECTL rcScroll, rcClip, rcUpdate;
|
RECTL rcScroll, rcClip, rcUpdate;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
DWORD Result;
|
DWORD Result;
|
||||||
PREGION RgnUpdate = NULL;
|
|
||||||
|
|
||||||
TRACE("Enter NtUserScrollDC\n");
|
TRACE("Enter NtUserScrollDC\n");
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
@ -1642,19 +1657,13 @@ NtUserScrollDC(
|
||||||
RETURN(FALSE);
|
RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hrgnUpdate)
|
|
||||||
{
|
|
||||||
RgnUpdate = RGNOBJAPI_Lock(hrgnUpdate, NULL);
|
|
||||||
if (!RgnUpdate)
|
|
||||||
RETURN(FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
Result = UserScrollDC( hDC,
|
Result = UserScrollDC( hDC,
|
||||||
dx,
|
dx,
|
||||||
dy,
|
dy,
|
||||||
prcUnsafeScroll? &rcScroll : 0,
|
prcUnsafeScroll? &rcScroll : 0,
|
||||||
prcUnsafeClip? &rcClip : 0,
|
prcUnsafeClip? &rcClip : 0,
|
||||||
RgnUpdate,
|
hrgnUpdate,
|
||||||
|
NULL,
|
||||||
prcUnsafeUpdate? &rcUpdate : NULL);
|
prcUnsafeUpdate? &rcUpdate : NULL);
|
||||||
if(Result == ERROR)
|
if(Result == ERROR)
|
||||||
{
|
{
|
||||||
|
@ -1684,8 +1693,6 @@ NtUserScrollDC(
|
||||||
RETURN(TRUE);
|
RETURN(TRUE);
|
||||||
|
|
||||||
CLEANUP:
|
CLEANUP:
|
||||||
if (RgnUpdate)
|
|
||||||
RGNOBJAPI_Unlock(RgnUpdate);
|
|
||||||
TRACE("Leave NtUserScrollDC, ret=%lu\n",_ret_);
|
TRACE("Leave NtUserScrollDC, ret=%lu\n",_ret_);
|
||||||
UserLeave();
|
UserLeave();
|
||||||
END_CLEANUP;
|
END_CLEANUP;
|
||||||
|
@ -1824,6 +1831,7 @@ NtUserScrollWindowEx(
|
||||||
dy,
|
dy,
|
||||||
&rcScroll,
|
&rcScroll,
|
||||||
&rcClip,
|
&rcClip,
|
||||||
|
NULL,
|
||||||
RgnUpdate,
|
RgnUpdate,
|
||||||
prcUnsafeUpdate? &rcUpdate : NULL);
|
prcUnsafeUpdate? &rcUpdate : NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue