ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
July 2014
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
9 participants
111 discussions
Start a n
N
ew thread
[jgardou] 63731: [WIN32K] - Correctly use the Clip, Meta, Rao, API and Vis Regions in DCs - Update the DC clipping object on demand each time a blt is performed - Reduce the number of region alloca...
by jgardou@svn.reactos.org
Author: jgardou Date: Wed Jul 23 16:05:47 2014 New Revision: 63731 URL:
http://svn.reactos.org/svn/reactos?rev=63731&view=rev
Log: [WIN32K] - Correctly use the Clip, Meta, Rao, API and Vis Regions in DCs - Update the DC clipping object on demand each time a blt is performed - Reduce the number of region allocated with handles when it's not needed This commit fixes numerous bugs regarding clipping, most notably SetDIBitsToDevice overlapping foreground windows CORE-8353 #resolve #comment There are still a few quirks in winetests which will get fixed in a next commit CORE-7628 #comment should be fixed in rev 63731, please confirm. Modified: trunk/reactos/win32ss/gdi/ntgdi/arc.c trunk/reactos/win32ss/gdi/ntgdi/bitblt.c trunk/reactos/win32ss/gdi/ntgdi/cliprgn.c trunk/reactos/win32ss/gdi/ntgdi/cliprgn.h trunk/reactos/win32ss/gdi/ntgdi/dc.h trunk/reactos/win32ss/gdi/ntgdi/dclife.c trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c trunk/reactos/win32ss/gdi/ntgdi/dcstate.c trunk/reactos/win32ss/gdi/ntgdi/dcutil.c trunk/reactos/win32ss/gdi/ntgdi/dibobj.c trunk/reactos/win32ss/gdi/ntgdi/fillshap.c trunk/reactos/win32ss/gdi/ntgdi/freetype.c trunk/reactos/win32ss/gdi/ntgdi/line.c trunk/reactos/win32ss/gdi/ntgdi/path.c trunk/reactos/win32ss/gdi/ntgdi/region.c trunk/reactos/win32ss/gdi/ntgdi/region.h trunk/reactos/win32ss/user/ntuser/cursoricon.c trunk/reactos/win32ss/user/ntuser/cursoricon_new.c trunk/reactos/win32ss/user/ntuser/dce.h trunk/reactos/win32ss/user/ntuser/windc.c Modified: trunk/reactos/win32ss/gdi/ntgdi/arc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/arc.c?re…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/arc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/arc.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -335,8 +335,7 @@ worker.l = dwStartAngle; worker1.l = dwSweepAngle; - DC_vPrepareDCsForBlit(pDC, pDC->rosdc.CombinedClip->rclBounds, - NULL, pDC->rosdc.CombinedClip->rclBounds); + DC_vPrepareDCsForBlit(pDC, NULL, NULL, NULL); if (pDC->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) DC_vUpdateFillBrush(pDC); if (pDC->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY)) @@ -381,8 +380,7 @@ return TRUE; } - DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds, - NULL, dc->rosdc.CombinedClip->rclBounds); + DC_vPrepareDCsForBlit(dc, NULL, NULL, NULL); if (dc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) DC_vUpdateFillBrush(dc); Modified: trunk/reactos/win32ss/gdi/ntgdi/bitblt.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/bitblt.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/bitblt.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/bitblt.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -107,7 +107,7 @@ /* Prepare DCs for blit */ TRACE("Preparing DCs for blit\n"); - DC_vPrepareDCsForBlit(DCDest, DestRect, DCSrc, SourceRect); + DC_vPrepareDCsForBlit(DCDest, &DestRect, DCSrc, &SourceRect); /* Determine surfaces to be used in the bitblt */ BitmapDest = DCDest->dclevel.pSurface; @@ -268,7 +268,7 @@ rcSrc.bottom += DCSrc->ptlDCOrig.y; /* Prepare for blit */ - DC_vPrepareDCsForBlit(DCDest, rcDest, DCSrc, rcSrc); + DC_vPrepareDCsForBlit(DCDest, &rcDest, DCSrc, &rcSrc); BitmapDest = DCDest->dclevel.pSurface; if (!BitmapDest) @@ -456,7 +456,7 @@ } /* Prepare blit */ - DC_vPrepareDCsForBlit(DCDest, DestRect, DCSrc, SourceRect); + DC_vPrepareDCsForBlit(DCDest, &DestRect, DCSrc, &SourceRect); if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) DC_vUpdateFillBrush(DCDest); @@ -647,7 +647,7 @@ BrushOrigin.y = 0; /* Only prepare Source and Dest, hdcMask represents a DIB */ - DC_vPrepareDCsForBlit(DCDest, DestRect, DCSrc, SourceRect); + DC_vPrepareDCsForBlit(DCDest, &DestRect, DCSrc, &SourceRect); if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) DC_vUpdateFillBrush(DCDest); @@ -826,7 +826,7 @@ BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y; #endif - DC_vPrepareDCsForBlit(pdc, DestRect, NULL, DestRect); + DC_vPrepareDCsForBlit(pdc, &DestRect, NULL, NULL); psurf = pdc->dclevel.pSurface; Modified: trunk/reactos/win32ss/gdi/ntgdi/cliprgn.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/cliprgn.…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/cliprgn.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/cliprgn.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -11,164 +11,102 @@ #define NDEBUG #include <debug.h> -int FASTCALL -CLIPPING_UpdateGCRegion(DC* Dc) -{ - PROSRGNDATA CombinedRegion; - //HRGN hRgnVis; - PREGION prgnClip, prgnGCClip; - - /* Would prefer this, but the rest of the code sucks... */ - //ASSERT(Dc->rosdc.hGCClipRgn); - //ASSERT(Dc->rosdc.hClipRgn); - ASSERT(Dc->prgnVis); - //hRgnVis = Dc->prgnVis->BaseObject.hHmgr; - - if (Dc->rosdc.hGCClipRgn == NULL) - Dc->rosdc.hGCClipRgn = IntSysCreateRectRgn(0, 0, 0, 0); - - prgnGCClip = REGION_LockRgn(Dc->rosdc.hGCClipRgn); - ASSERT(prgnGCClip); - - if (Dc->rosdc.hClipRgn == NULL) - IntGdiCombineRgn(prgnGCClip, Dc->prgnVis, NULL, RGN_COPY); - else - { - prgnClip = REGION_LockRgn(Dc->rosdc.hClipRgn); // FIXME: Locking order, ugh! - IntGdiCombineRgn(prgnGCClip, Dc->prgnVis, prgnClip, RGN_AND); - REGION_UnlockRgn(prgnClip); - } - REGION_UnlockRgn(prgnGCClip); - - NtGdiOffsetRgn(Dc->rosdc.hGCClipRgn, Dc->ptlDCOrig.x, Dc->ptlDCOrig.y); - - if((CombinedRegion = RGNOBJAPI_Lock(Dc->rosdc.hGCClipRgn, NULL))) - { - CLIPOBJ *CombinedClip; - - CombinedClip = IntEngCreateClipRegion(CombinedRegion->rdh.nCount, - CombinedRegion->Buffer, - &CombinedRegion->rdh.rcBound); - - RGNOBJAPI_Unlock(CombinedRegion); - - if ( !CombinedClip ) - { - DPRINT1("IntEngCreateClipRegion() failed\n"); - return ERROR; - } - - if(Dc->rosdc.CombinedClip != NULL) - IntEngDeleteClipRegion(Dc->rosdc.CombinedClip); - - Dc->rosdc.CombinedClip = CombinedClip ; - } - - return NtGdiOffsetRgn(Dc->rosdc.hGCClipRgn, -Dc->ptlDCOrig.x, -Dc->ptlDCOrig.y); -} - -INT FASTCALL -GdiSelectVisRgn(HDC hdc, HRGN hrgn) -{ - int retval; - DC *dc; - PREGION prgn; - - if (!hrgn) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return ERROR; - } - if (!(dc = DC_LockDc(hdc))) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return ERROR; - } - - dc->fs &= ~DC_FLAG_DIRTY_RAO; - - ASSERT (dc->prgnVis != NULL); - - prgn = RGNOBJAPI_Lock(hrgn, NULL); - retval = prgn ? IntGdiCombineRgn(dc->prgnVis, prgn, NULL, RGN_COPY) : ERROR; - RGNOBJAPI_Unlock(prgn); - if ( retval != ERROR ) - { +VOID +FASTCALL +GdiSelectVisRgn( + HDC hdc, + PREGION prgn) +{ + DC *dc; + + if (!(dc = DC_LockDc(hdc))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return; + } + + dc->fs |= DC_FLAG_DIRTY_RAO; + + ASSERT(dc->prgnVis != NULL); + ASSERT(prgn != NULL); + + IntGdiCombineRgn(dc->prgnVis, prgn, NULL, RGN_COPY); IntGdiOffsetRgn(dc->prgnVis, -dc->ptlDCOrig.x, -dc->ptlDCOrig.y); - CLIPPING_UpdateGCRegion(dc); - } - DC_UnlockDc(dc); - - return retval; -} - - -int FASTCALL GdiExtSelectClipRgn(PDC dc, - HRGN hrgn, - int fnMode) -{ - // dc->fs &= ~DC_FLAG_DIRTY_RAO; - - if (!hrgn) - { - if (fnMode == RGN_COPY) - { - if (dc->rosdc.hClipRgn != NULL) - { - GreDeleteObject(dc->rosdc.hClipRgn); - dc->rosdc.hClipRgn = NULL; - } - } - else - { - EngSetLastError(ERROR_INVALID_PARAMETER); - return ERROR; - } - } - else - { - if (!dc->rosdc.hClipRgn) - { - RECTL rect; - if(dc->prgnVis) - { + + DC_UnlockDc(dc); +} + + +int +FASTCALL +IntGdiExtSelectClipRgn( + PDC dc, + PREGION prgn, + int fnMode) +{ + if (!prgn) + { + if (fnMode == RGN_COPY) + { + if (dc->dclevel.prgnClip != NULL) + { + REGION_Delete(dc->dclevel.prgnClip); + dc->dclevel.prgnClip = NULL; + dc->fs |= DC_FLAG_DIRTY_RAO; + } + return SIMPLEREGION; + } + else + { + EngSetLastError(ERROR_INVALID_PARAMETER); + return ERROR; + } + } + + if (!dc->dclevel.prgnClip) + { + RECTL rect; + REGION_GetRgnBox(dc->prgnVis, &rect); - dc->rosdc.hClipRgn = IntSysCreateRectRgnIndirect(&rect); - } - else - { - dc->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0); - } - } + dc->dclevel.prgnClip = IntSysCreateRectpRgnIndirect(&rect); + } + + dc->fs |= DC_FLAG_DIRTY_RAO; + if(fnMode == RGN_COPY) - { - NtGdiCombineRgn(dc->rosdc.hClipRgn, hrgn, 0, fnMode); - } - else - NtGdiCombineRgn(dc->rosdc.hClipRgn, dc->rosdc.hClipRgn, hrgn, fnMode); - } - - return CLIPPING_UpdateGCRegion(dc); -} - - -int APIENTRY NtGdiExtSelectClipRgn(HDC hDC, - HRGN hrgn, - int fnMode) -{ - int retval; - DC *dc; - - if (!(dc = DC_LockDc(hDC))) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return ERROR; - } - - retval = GdiExtSelectClipRgn ( dc, hrgn, fnMode ); - - DC_UnlockDc(dc); - return retval; + return IntGdiCombineRgn(dc->dclevel.prgnClip, prgn, 0, fnMode); + + return IntGdiCombineRgn(dc->dclevel.prgnClip, dc->dclevel.prgnClip, prgn, fnMode); +} + + +int +APIENTRY +NtGdiExtSelectClipRgn( + HDC hDC, + HRGN hrgn, + int fnMode) +{ + int retval; + DC *dc; + PREGION prgn; + + if (!(dc = DC_LockDc(hDC))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return ERROR; + } + + prgn = REGION_LockRgn(hrgn); + + /* IntGdiExtSelectClipRgn takes care of checking for NULL region */ + retval = IntGdiExtSelectClipRgn(dc, prgn, fnMode); + + if (prgn) + REGION_UnlockRgn(prgn); + + DC_UnlockDc(dc); + return retval; } INT FASTCALL @@ -177,7 +115,6 @@ INT retval; PDC dc; PROSRGNDATA pRgnNew, pRgn = NULL; - BOOL Unlock = FALSE; // Small HACK if (!(dc = DC_LockDc(hDC))) { @@ -193,10 +130,9 @@ { pRgn = dc->dclevel.prgnMeta; } - else if (dc->rosdc.hClipRgn) + else if (dc->dclevel.prgnClip) // CLIPRGN { - Unlock = TRUE ; - pRgn = REGION_LockRgn(dc->rosdc.hClipRgn); // CLIPRGN + pRgn = dc->dclevel.prgnClip; } if (pRgn) @@ -206,7 +142,6 @@ if (!pRgnNew) { DC_UnlockDc(dc); - if(Unlock) REGION_UnlockRgn(pRgn); return ERROR; } @@ -217,12 +152,11 @@ REGION_Delete(pRgnNew); DC_UnlockDc(dc); - if(Unlock) REGION_UnlockRgn(pRgn); return retval; } retval = REGION_GetRgnBox(dc->prgnVis, rc); - IntDPtoLP(dc, (LPPOINT)rc, 2); + DC_UnlockDc(dc); return retval; @@ -265,53 +199,49 @@ int RightRect, int BottomRect) { - INT Result; - RECTL Rect; - PREGION prgnNew, prgnClip; - PDC dc = DC_LockDc(hDC); - - if (!dc) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return ERROR; - } - - Rect.left = LeftRect; - Rect.top = TopRect; - Rect.right = RightRect; - Rect.bottom = BottomRect; - - IntLPtoDP(dc, (LPPOINT)&Rect, 2); - - prgnNew = IntSysCreateRectpRgnIndirect(&Rect); - if (!prgnNew) - { - Result = ERROR; - } - else - { - if (!dc->rosdc.hClipRgn) - { - dc->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0); - prgnClip = REGION_LockRgn(dc->rosdc.hClipRgn); - IntGdiCombineRgn(prgnClip, dc->prgnVis, prgnNew, RGN_DIFF); - REGION_UnlockRgn(prgnClip); - Result = SIMPLEREGION; - } - else - { - prgnClip = REGION_LockRgn(dc->rosdc.hClipRgn); - Result = IntGdiCombineRgn(prgnClip, prgnClip, prgnNew, RGN_DIFF); - REGION_UnlockRgn(prgnClip); - } - REGION_Delete(prgnNew); - } - if (Result != ERROR) - CLIPPING_UpdateGCRegion(dc); - - DC_UnlockDc(dc); - - return Result; + INT Result; + RECTL Rect; + PREGION prgnNew; + PDC dc = DC_LockDc(hDC); + + if (!dc) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return ERROR; + } + + Rect.left = LeftRect; + Rect.top = TopRect; + Rect.right = RightRect; + Rect.bottom = BottomRect; + + IntLPtoDP(dc, (LPPOINT)&Rect, 2); + + prgnNew = IntSysCreateRectpRgnIndirect(&Rect); + if (!prgnNew) + { + Result = ERROR; + } + else + { + if (!dc->dclevel.prgnClip) + { + dc->dclevel.prgnClip = IntSysCreateRectpRgn(0, 0, 0, 0); + IntGdiCombineRgn(dc->dclevel.prgnClip, dc->prgnVis, prgnNew, RGN_DIFF); + Result = SIMPLEREGION; + } + else + { + Result = IntGdiCombineRgn(dc->dclevel.prgnClip, dc->dclevel.prgnClip, prgnNew, RGN_DIFF); + } + REGION_Delete(prgnNew); + } + if (Result != ERROR) + dc->fs |= DC_FLAG_DIRTY_RAO; + + DC_UnlockDc(dc); + + return Result; } int APIENTRY NtGdiIntersectClipRect(HDC hDC, @@ -320,200 +250,191 @@ int RightRect, int BottomRect) { - INT Result; - RECTL Rect; - HRGN NewRgn; - PDC dc = DC_LockDc(hDC); - - DPRINT("NtGdiIntersectClipRect(%p, %d,%d-%d,%d)\n", - hDC, LeftRect, TopRect, RightRect, BottomRect); - - if (!dc) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return ERROR; - } - - Rect.left = LeftRect; - Rect.top = TopRect; - Rect.right = RightRect; - Rect.bottom = BottomRect; - - IntLPtoDP(dc, (LPPOINT)&Rect, 2); - - NewRgn = IntSysCreateRectRgnIndirect(&Rect); - if (!NewRgn) - { - Result = ERROR; - } - else if (!dc->rosdc.hClipRgn) - { - dc->rosdc.hClipRgn = NewRgn; - Result = SIMPLEREGION; - } - else - { - Result = NtGdiCombineRgn(dc->rosdc.hClipRgn, dc->rosdc.hClipRgn, NewRgn, RGN_AND); - GreDeleteObject(NewRgn); - } - if (Result != ERROR) - CLIPPING_UpdateGCRegion(dc); - - DC_UnlockDc(dc); - - return Result; + INT Result; + RECTL Rect; + PREGION pNewRgn; + PDC dc = DC_LockDc(hDC); + + DPRINT("NtGdiIntersectClipRect(%p, %d,%d-%d,%d)\n", + hDC, LeftRect, TopRect, RightRect, BottomRect); + + if (!dc) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return ERROR; + } + + Rect.left = LeftRect; + Rect.top = TopRect; + Rect.right = RightRect; + Rect.bottom = BottomRect; + + IntLPtoDP(dc, (LPPOINT)&Rect, 2); + + pNewRgn = IntSysCreateRectpRgnIndirect(&Rect); + if (!pNewRgn) + { + Result = ERROR; + } + else if (!dc->dclevel.prgnClip) + { + dc->dclevel.prgnClip = pNewRgn; + Result = SIMPLEREGION; + } + else + { + Result = IntGdiCombineRgn(dc->dclevel.prgnClip, dc->dclevel.prgnClip, pNewRgn, RGN_AND); + REGION_Delete(pNewRgn); + } + if (Result != ERROR) + dc->fs |= DC_FLAG_DIRTY_RAO; + + DC_UnlockDc(dc); + + return Result; } int APIENTRY NtGdiOffsetClipRgn(HDC hDC, int XOffset, int YOffset) { - INT Result; - DC *dc; - - if(!(dc = DC_LockDc(hDC))) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return ERROR; - } - - if(dc->rosdc.hClipRgn != NULL) - { - Result = NtGdiOffsetRgn(dc->rosdc.hClipRgn, - XOffset, - YOffset); - CLIPPING_UpdateGCRegion(dc); - } - else - { - Result = NULLREGION; - } - - DC_UnlockDc(dc); - return Result; + INT Result; + DC *dc; + + if(!(dc = DC_LockDc(hDC))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return ERROR; + } + + if(dc->dclevel.prgnClip != NULL) + { + Result = IntGdiOffsetRgn(dc->dclevel.prgnClip, + XOffset, + YOffset); + dc->fs |= DC_FLAG_DIRTY_RAO; + } + else + { + Result = NULLREGION; + } + + DC_UnlockDc(dc); + return Result; } BOOL APIENTRY NtGdiPtVisible(HDC hDC, int X, int Y) { - HRGN rgn; - DC *dc; - - if(!(dc = DC_LockDc(hDC))) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - - rgn = dc->rosdc.hGCClipRgn; - DC_UnlockDc(dc); - - return (rgn ? NtGdiPtInRegion(rgn, X, Y) : FALSE); -} - -BOOL APIENTRY NtGdiRectVisible(HDC hDC, - LPRECT UnsafeRect) -{ - NTSTATUS Status = STATUS_SUCCESS; - PROSRGNDATA Rgn; - PDC dc = DC_LockDc(hDC); - BOOL Result = FALSE; - RECTL Rect; - - if (!dc) - { - EngSetLastError(ERROR_INVALID_HANDLE); - return FALSE; - } - - _SEH2_TRY - { - ProbeForRead(UnsafeRect, + BOOL ret = FALSE; + PDC dc; + + if(!(dc = DC_LockDc(hDC))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + if (dc->prgnRao) + { + POINT pt = {X, Y}; + IntLPtoDP(dc, &pt, 1); + ret = REGION_PtInRegion(dc->prgnRao, pt.x, pt.y); + } + + DC_UnlockDc(dc); + + return ret; +} + +BOOL +APIENTRY +NtGdiRectVisible( + HDC hDC, + LPRECT UnsafeRect) +{ + NTSTATUS Status = STATUS_SUCCESS; + PDC dc = DC_LockDc(hDC); + BOOL Result = FALSE; + RECTL Rect; + + if (!dc) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + _SEH2_TRY + { + ProbeForRead(UnsafeRect, sizeof(RECT), 1); - Rect = *UnsafeRect; - } - _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) - { - Status = _SEH2_GetExceptionCode(); - } - _SEH2_END; - - if(!NT_SUCCESS(Status)) - { - DC_UnlockDc(dc); - SetLastNtError(Status); - return FALSE; - } - - if (dc->rosdc.hGCClipRgn) - { - if((Rgn = (PROSRGNDATA)RGNOBJAPI_Lock(dc->rosdc.hGCClipRgn, NULL))) - { + Rect = *UnsafeRect; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END; + + if(!NT_SUCCESS(Status)) + { + DC_UnlockDc(dc); + SetLastNtError(Status); + return FALSE; + } + + if (dc->fs & DC_FLAG_DIRTY_RAO) + CLIPPING_UpdateGCRegion(dc); + + if (dc->prgnRao) + { IntLPtoDP(dc, (LPPOINT)&Rect, 2); - Result = REGION_RectInRegion(Rgn, &Rect); - RGNOBJAPI_Unlock(Rgn); - } - } - DC_UnlockDc(dc); - - return Result; + Result = REGION_RectInRegion(dc->prgnRao, &Rect); + } + DC_UnlockDc(dc); + + return Result; } int FASTCALL IntGdiSetMetaRgn(PDC pDC) { - INT Ret = ERROR; - PROSRGNDATA TempRgn; - - if ( pDC->dclevel.prgnMeta ) - { - if ( pDC->dclevel.prgnClip ) - { - TempRgn = IntSysCreateRectpRgn(0,0,0,0); - if (TempRgn) - { - Ret = IntGdiCombineRgn( TempRgn, - pDC->dclevel.prgnMeta, - pDC->dclevel.prgnClip, - RGN_AND); - if ( Ret ) - { - GDIOBJ_vDereferenceObject(&pDC->dclevel.prgnMeta->BaseObject); - if (!((PROSRGNDATA)pDC->dclevel.prgnMeta)->BaseObject.ulShareCount) - REGION_Delete(pDC->dclevel.prgnMeta); - - pDC->dclevel.prgnMeta = TempRgn; - - GDIOBJ_vDereferenceObject(&pDC->dclevel.prgnClip->BaseObject); - if (!((PROSRGNDATA)pDC->dclevel.prgnClip)->BaseObject.ulShareCount) - REGION_Delete(pDC->dclevel.prgnClip); - - pDC->dclevel.prgnClip = NULL; - - IntGdiReleaseRaoRgn(pDC); - } - else - REGION_Delete(TempRgn); - } - } - else - Ret = REGION_Complexity(pDC->dclevel.prgnMeta); - } - else - { - if ( pDC->dclevel.prgnClip ) - { - Ret = REGION_Complexity(pDC->dclevel.prgnClip); - pDC->dclevel.prgnMeta = pDC->dclevel.prgnClip; - pDC->dclevel.prgnClip = NULL; - } - else - Ret = SIMPLEREGION; - } - return Ret; + INT Ret = ERROR; + + if ( pDC->dclevel.prgnMeta ) + { + if ( pDC->dclevel.prgnClip ) + { + Ret = IntGdiCombineRgn(pDC->dclevel.prgnMeta, pDC->dclevel.prgnMeta, pDC->dclevel.prgnClip, RGN_AND); + if (Ret != ERROR) + { + REGION_Delete(pDC->dclevel.prgnClip); + pDC->dclevel.prgnClip = NULL; + IntGdiReleaseRaoRgn(pDC); + } + } + else + Ret = REGION_Complexity(pDC->dclevel.prgnMeta); + } + else + { + if ( pDC->dclevel.prgnClip ) + { + Ret = REGION_Complexity(pDC->dclevel.prgnClip); + pDC->dclevel.prgnMeta = pDC->dclevel.prgnClip; + pDC->dclevel.prgnClip = NULL; + } + else + Ret = SIMPLEREGION; + } + + if (Ret != ERROR) + pDC->fs |= DC_FLAG_DIRTY_RAO; + + return Ret; } @@ -533,88 +454,95 @@ return Ret; } -INT FASTCALL -NEW_CLIPPING_UpdateGCRegion(PDC pDC) -{ - CLIPOBJ * co; - - /* Must have VisRgn set to a valid state! */ - ASSERT (pDC->prgnVis); - -// FIXME: this seems to be broken! - - if (pDC->prgnAPI) - { - REGION_Delete(pDC->prgnAPI); - pDC->prgnAPI = IntSysCreateRectpRgn(0,0,0,0); - } - - if (pDC->prgnRao) - { - REGION_Delete(pDC->prgnRao); - pDC->prgnRao = IntSysCreateRectpRgn(0,0,0,0); - } - - if (!pDC->prgnRao) - { - return ERROR; - } - - if (pDC->dclevel.prgnMeta && pDC->dclevel.prgnClip) - { - IntGdiCombineRgn( pDC->prgnAPI, - pDC->dclevel.prgnClip, - pDC->dclevel.prgnMeta, - RGN_AND); - } - else - { - if (pDC->dclevel.prgnClip) - { - IntGdiCombineRgn( pDC->prgnAPI, - pDC->dclevel.prgnClip, - NULL, - RGN_COPY); - } - else if (pDC->dclevel.prgnMeta) - { - IntGdiCombineRgn( pDC->prgnAPI, - pDC->dclevel.prgnMeta, - NULL, - RGN_COPY); - } - } - - IntGdiCombineRgn( pDC->prgnRao, - pDC->prgnVis, - pDC->prgnAPI, - RGN_AND); - - RtlCopyMemory(&pDC->erclClip, +VOID +FASTCALL +CLIPPING_UpdateGCRegion(PDC pDC) +{ + CLIPOBJ * co; + + /* Must have VisRgn set to a valid state! */ + ASSERT (pDC->prgnVis); + + if (pDC->prgnAPI) + { + REGION_Delete(pDC->prgnAPI); + pDC->prgnAPI = NULL; + } + + if (pDC->prgnRao) + REGION_Delete(pDC->prgnRao); + + pDC->prgnRao = IntSysCreateRectpRgn(0,0,0,0); + + ASSERT(pDC->prgnRao); + + if (pDC->dclevel.prgnMeta || pDC->dclevel.prgnClip) + { + pDC->prgnAPI = IntSysCreateRectpRgn(0,0,0,0); + if (!pDC->dclevel.prgnMeta) + { + IntGdiCombineRgn(pDC->prgnAPI, + pDC->dclevel.prgnClip, + NULL, + RGN_COPY); + } + else if (!pDC->dclevel.prgnClip) + { + IntGdiCombineRgn(pDC->prgnAPI, + pDC->dclevel.prgnMeta, + NULL, + RGN_COPY); + } + else + { + IntGdiCombineRgn(pDC->prgnAPI, + pDC->dclevel.prgnClip, + pDC->dclevel.prgnMeta, + RGN_AND); + } + } + + if (pDC->prgnAPI) + { + IntGdiCombineRgn(pDC->prgnRao, + pDC->prgnVis, + pDC->prgnAPI, + RGN_AND); + } + else + { + IntGdiCombineRgn(pDC->prgnRao, + pDC->prgnVis, + NULL, + RGN_COPY); + } + + + IntGdiOffsetRgn(pDC->prgnRao, pDC->ptlDCOrig.x, pDC->ptlDCOrig.y); + + RtlCopyMemory(&pDC->erclClip, &pDC->prgnRao->rdh.rcBound, sizeof(RECTL)); - pDC->fs &= ~DC_FLAG_DIRTY_RAO; - - IntGdiOffsetRgn(pDC->prgnRao, pDC->ptlDCOrig.x, pDC->ptlDCOrig.y); - - // pDC->co should be used. Example, CLIPOBJ_cEnumStart uses XCLIPOBJ to build - // the rects from region objects rects in pClipRgn->Buffer. - // With pDC->co.pClipRgn->Buffer, - // pDC->co.pClipRgn = pDC->prgnRao ? pDC->prgnRao : pDC->prgnVis; - - co = IntEngCreateClipRegion(pDC->prgnRao->rdh.nCount, - pDC->prgnRao->Buffer, - &pDC->erclClip); - if (co) - { - if (pDC->rosdc.CombinedClip != NULL) - IntEngDeleteClipRegion(pDC->rosdc.CombinedClip); - - pDC->rosdc.CombinedClip = co; - } - - return IntGdiOffsetRgn(pDC->prgnRao, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y); + pDC->fs &= ~DC_FLAG_DIRTY_RAO; + + // pDC->co should be used. Example, CLIPOBJ_cEnumStart uses XCLIPOBJ to build + // the rects from region objects rects in pClipRgn->Buffer. + // With pDC->co.pClipRgn->Buffer, + // pDC->co.pClipRgn = pDC->prgnRao ? pDC->prgnRao : pDC->prgnVis; + + co = IntEngCreateClipRegion(pDC->prgnRao->rdh.nCount, + pDC->prgnRao->Buffer, + &pDC->erclClip); + if (co) + { + if (pDC->rosdc.CombinedClip != NULL) + IntEngDeleteClipRegion(pDC->rosdc.CombinedClip); + + pDC->rosdc.CombinedClip = co; + } + + IntGdiOffsetRgn(pDC->prgnRao, -pDC->ptlDCOrig.x, -pDC->ptlDCOrig.y); } /* EOF */ Modified: trunk/reactos/win32ss/gdi/ntgdi/cliprgn.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/cliprgn.…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/cliprgn.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/cliprgn.h [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -1,6 +1,6 @@ #pragma once INT FASTCALL GdiGetClipBox(HDC hDC, RECTL *rc); -INT FASTCALL GdiSelectVisRgn(HDC hdc, HRGN hrgn); -INT FASTCALL GdiExtSelectClipRgn (PDC dc, HRGN hrgn, int fnMode); -int FASTCALL CLIPPING_UpdateGCRegion(DC* Dc); +VOID FASTCALL GdiSelectVisRgn(HDC hdc, PREGION prgn); +INT FASTCALL IntGdiExtSelectClipRgn (PDC dc, PREGION prgn, int fnMode); +VOID FASTCALL CLIPPING_UpdateGCRegion(DC* Dc); Modified: trunk/reactos/win32ss/gdi/ntgdi/dc.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dc.h?rev…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dc.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dc.h [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -48,9 +48,6 @@ typedef struct _ROS_DC_INFO { - HRGN hClipRgn; /* Clip region (may be 0) */ - HRGN hGCClipRgn; /* GC clip region (ClipRgn AND VisRgn) */ - CLIPOBJ *CombinedClip; } ROS_DC_INFO; @@ -199,9 +196,9 @@ BOOL FASTCALL DC_InvertXform(const XFORM *xformSrc, XFORM *xformDest); VOID FASTCALL DC_vUpdateViewportExt(PDC pdc); -VOID FASTCALL DC_vCopyState(PDC pdcSrc, PDC pdcDst, BOOL to); +VOID FASTCALL DC_vCopyState(PDC pdcSrc, PDC pdcDst, BOOL To); VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2); -VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdc1, RECT rc1, PDC pdc2, RECT rc2); +VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT* rcDest, PDC pdcSrc, const RECT* rcSrc); VOID NTAPI DC_vRestoreDC(IN PDC pdc, INT iSaveLevel); Modified: trunk/reactos/win32ss/gdi/ntgdi/dclife.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dclife.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dclife.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dclife.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -95,22 +95,11 @@ void DC_InitHack(PDC pdc) { - HRGN hVisRgn; - TextIntRealizeFont(pdc->pdcattr->hlfntNew,NULL); pdc->pdcattr->iCS_CP = ftGdiGetTextCharsetInfo(pdc,NULL,0); /* This should never fail */ ASSERT(pdc->dclevel.ppal); - - /* Select regions */ - pdc->rosdc.hClipRgn = NULL; - pdc->rosdc.hGCClipRgn = NULL; - - hVisRgn = IntSysCreateRectRgn(0, 0, 1, 1); - ASSERT(hVisRgn); - GdiSelectVisRgn(pdc->BaseObject.hHmgr, hVisRgn); - GreDeleteObject(hVisRgn); } VOID @@ -170,7 +159,7 @@ pdc->erclBoundsApp.right = 0x00007ffc; // FIXME pdc->erclBoundsApp.bottom = 0x00000333; // FIXME pdc->erclClip = pdc->erclBounds; -// pdc->co + pdc->co = gxcoTrivial; pdc->fs |= DC_SYNCHRONIZEACCESS | DC_ACCUM_APP | DC_PERMANANT | DC_DISPLAY; } @@ -185,7 +174,7 @@ pdc->erclBounds.bottom = 0; pdc->erclBoundsApp = pdc->erclBounds; pdc->erclClip = pdc->erclWindow; - //pdc->co = NULL + pdc->co = gxcoTrivial; } //pdc->dcattr.VisRectRegion: @@ -237,6 +226,8 @@ /* Setup regions */ pdc->prgnAPI = NULL; pdc->prgnRao = NULL; + pdc->dclevel.prgnClip = NULL; + pdc->dclevel.prgnMeta = NULL; /* Allocate a Vis region */ pdc->prgnVis = IntSysCreateRectpRgn(0, 0, pdc->dclevel.sizl.cx, pdc->dclevel.sizl.cy); ASSERT(pdc->prgnVis); @@ -372,17 +363,17 @@ LFONT_ShareUnlockFont(pdc->dclevel.plfnt); /* Free regions */ - if (pdc->rosdc.hClipRgn && GreIsHandleValid(pdc->rosdc.hClipRgn)) - GreDeleteObject(pdc->rosdc.hClipRgn); + if (pdc->dclevel.prgnClip) + REGION_Delete(pdc->dclevel.prgnClip); + if (pdc->dclevel.prgnMeta) + REGION_Delete(pdc->dclevel.prgnMeta); if (pdc->prgnVis) - { REGION_Delete(pdc->prgnVis); - } - if (pdc->rosdc.hGCClipRgn && GreIsHandleValid(pdc->rosdc.hGCClipRgn)) - { - GreDeleteObject(pdc->rosdc.hGCClipRgn); - } - if (NULL != pdc->rosdc.CombinedClip) + if (pdc->prgnRao) + REGION_Delete(pdc->prgnRao); + if (pdc->prgnAPI) + REGION_Delete(pdc->prgnAPI); + if (pdc->rosdc.CombinedClip) IntEngDeleteClipRegion(pdc->rosdc.CombinedClip); PATH_Delete(pdc->dclevel.hPath); @@ -397,17 +388,6 @@ NTAPI DC_vSetOwner(PDC pdc, ULONG ulOwner) { - - if (pdc->rosdc.hClipRgn) - { - IntGdiSetRegionOwner(pdc->rosdc.hClipRgn, ulOwner); - } - - if (pdc->rosdc.hGCClipRgn) - { - IntGdiSetRegionOwner(pdc->rosdc.hGCClipRgn, ulOwner); - } - if (pdc->dclevel.hPath) { GreSetObjectOwner(pdc->dclevel.hPath, ulOwner); @@ -466,7 +446,7 @@ void DC_vUpdateDC(PDC pdc) { - HRGN hVisRgn ; + // PREGION VisRgn ; PPDEVOBJ ppdev = pdc->ppdev ; pdc->dhpdev = ppdev->dhpdev; @@ -475,10 +455,12 @@ pdc->dclevel.pSurface = PDEVOBJ_pSurface(ppdev); PDEVOBJ_sizl(pdc->ppdev, &pdc->dclevel.sizl); - hVisRgn = NtGdiCreateRectRgn(0, 0, pdc->dclevel.sizl.cx, pdc->dclevel.sizl.cy); - ASSERT(hVisRgn); - GdiSelectVisRgn(pdc->BaseObject.hHmgr, hVisRgn); - GreDeleteObject(hVisRgn); +#if 0 + VisRgn = IntSysCreateRectpRgn(0, 0, pdc->dclevel.sizl.cx, pdc->dclevel.sizl.cy); + ASSERT(VisRgn); + GdiSelectVisRgn(pdc->BaseObject.hHmgr, VisRgn); + REGION_Delete(VisRgn); +#endif pdc->flGraphicsCaps = ppdev->devinfo.flGraphicsCaps; pdc->flGraphicsCaps2 = ppdev->devinfo.flGraphicsCaps2; @@ -492,75 +474,106 @@ * from where we take pixels. */ VOID FASTCALL -DC_vPrepareDCsForBlit(PDC pdc1, - RECT rc1, - PDC pdc2, - RECT rc2) +DC_vPrepareDCsForBlit( + PDC pdcDest, + const RECT* rcDest, + PDC pdcSrc, + const RECT* rcSrc) { PDC pdcFirst, pdcSecond; - PRECT prcFirst, prcSecond; + const RECT *prcFirst, *prcSecond; /* Update brushes */ - if (pdc1->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) - DC_vUpdateFillBrush(pdc1); - if (pdc1->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY)) - DC_vUpdateLineBrush(pdc1); - if(pdc1->pdcattr->ulDirty_ & DIRTY_TEXT) - DC_vUpdateTextBrush(pdc1); + if (pdcDest->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) + DC_vUpdateFillBrush(pdcDest); + if (pdcDest->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY)) + DC_vUpdateLineBrush(pdcDest); + if(pdcDest->pdcattr->ulDirty_ & DIRTY_TEXT) + DC_vUpdateTextBrush(pdcDest); /* Lock them in good order */ - if(pdc2) - { - if((ULONG_PTR)pdc1->ppdev->hsemDevLock >= (ULONG_PTR)pdc2->ppdev->hsemDevLock) - { - pdcFirst = pdc1; - prcFirst = &rc1; - pdcSecond = pdc2; - prcSecond = &rc2; + if(pdcSrc) + { + if((ULONG_PTR)pdcDest->ppdev->hsemDevLock >= (ULONG_PTR)pdcSrc->ppdev->hsemDevLock) + { + pdcFirst = pdcDest; + prcFirst = rcDest; + pdcSecond = pdcSrc; + prcSecond = rcSrc; } else { - pdcFirst = pdc2; - prcFirst = &rc2; - pdcSecond = pdc1; - prcSecond = &rc1; + pdcFirst = pdcSrc; + prcFirst = rcSrc; + pdcSecond = pdcDest; + prcSecond = rcDest; } } else { - pdcFirst = pdc1 ; - prcFirst = &rc1; + pdcFirst = pdcDest ; + prcFirst = rcDest; pdcSecond = NULL; prcSecond = NULL; } - if(pdcFirst && pdcFirst->dctype == DCTYPE_DIRECT) + /* Update clipping of dest DC if needed */ + if (pdcDest->dctype == DCTYPE_DIRECT) + { + DCE* dce = DceGetDceFromDC(pdcDest->BaseObject.hHmgr); + if (dce) + DceUpdateVisRgn(dce, dce->pwndOrg, dce->DCXFlags); + } + + if (pdcDest->fs & DC_FLAG_DIRTY_RAO) + CLIPPING_UpdateGCRegion(pdcDest); + + /* Lock and update first DC */ + if(pdcFirst->dctype == DCTYPE_DIRECT) { EngAcquireSemaphore(pdcFirst->ppdev->hsemDevLock); - MouseSafetyOnDrawStart(pdcFirst->ppdev, - prcFirst->left, - prcFirst->top, - prcFirst->right, - prcFirst->bottom) ; /* Update surface if needed */ if(pdcFirst->ppdev->pSurface != pdcFirst->dclevel.pSurface) { DC_vUpdateDC(pdcFirst); } } - if(pdcSecond && pdcSecond->dctype == DCTYPE_DIRECT) + + if(pdcFirst->dctype == DCTYPE_DIRECT) + { + if (!prcFirst) + prcFirst = &pdcFirst->erclClip; + + MouseSafetyOnDrawStart(pdcFirst->ppdev, + prcFirst->left, + prcFirst->top, + prcFirst->right, + prcFirst->bottom) ; + } + + if (!pdcSecond) + return; + + /* Lock and update second DC */ + if(pdcSecond->dctype == DCTYPE_DIRECT) { EngAcquireSemaphore(pdcSecond->ppdev->hsemDevLock); - MouseSafetyOnDrawStart(pdcSecond->ppdev, - prcSecond->left, - prcSecond->top, - prcSecond->right, - prcSecond->bottom) ; /* Update surface if needed */ if(pdcSecond->ppdev->pSurface != pdcSecond->dclevel.pSurface) { DC_vUpdateDC(pdcSecond); } + } + + if(pdcSecond->dctype == DCTYPE_DIRECT) + { + if (!prcSecond) + prcSecond = &pdcSecond->erclClip; + MouseSafetyOnDrawStart(pdcSecond->ppdev, + prcSecond->left, + prcSecond->top, + prcSecond->right, + prcSecond->bottom) ; } } Modified: trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dcobjs.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -330,7 +330,7 @@ PDC pdc; HBITMAP hbmpOld; PSURFACE psurfNew, psurfOld; - HRGN hVisRgn; + PREGION VisRgn; HDC hdcOld; ULONG cBitsPixel; ASSERT_NOGDILOCKS(); @@ -452,15 +452,15 @@ pdc->pdcattr->ulDirty_ |= DIRTY_FILL | DIRTY_LINE; /* FIXME: Improve by using a region without a handle and selecting it */ - hVisRgn = IntSysCreateRectRgn( 0, + VisRgn = IntSysCreateRectpRgn( 0, 0, pdc->dclevel.sizl.cx, pdc->dclevel.sizl.cy); - if (hVisRgn) - { - GdiSelectVisRgn(hdc, hVisRgn); - GreDeleteObject(hVisRgn); + if (VisRgn) + { + GdiSelectVisRgn(hdc, VisRgn); + REGION_Delete(VisRgn); } /* Unlock the DC */ @@ -509,7 +509,10 @@ /* Construct a region from the path */ else if (PATH_PathToRegion(pPath, pdcattr->jFillMode, &hrgnPath)) { - success = GdiExtSelectClipRgn(pdc, hrgnPath, Mode) != ERROR; + PREGION prgnPath = REGION_LockRgn(hrgnPath); + ASSERT(prgnPath); + success = IntGdiExtSelectClipRgn(pdc, prgnPath, Mode) != ERROR; + REGION_UnlockRgn(prgnPath); GreDeleteObject( hrgnPath ); /* Empty the path */ @@ -693,9 +696,7 @@ { INT ret = 0; PDC pdc; - HRGN hrgnSrc = NULL; PREGION prgnSrc = NULL; - POINTL ptlOrg; pdc = DC_LockDc(hdc); if (!pdc) @@ -707,8 +708,7 @@ switch (iCode) { case CLIPRGN: - hrgnSrc = pdc->rosdc.hClipRgn; -// if (pdc->dclevel.prgnClip) prgnSrc = pdc->dclevel.prgnClip; + prgnSrc = pdc->dclevel.prgnClip; break; case METARGN: @@ -716,14 +716,15 @@ break; case APIRGN: + if (pdc->fs & DC_FLAG_DIRTY_RAO) + CLIPPING_UpdateGCRegion(pdc); if (pdc->prgnAPI) { prgnSrc = pdc->prgnAPI; } -// else if (pdc->dclevel.prgnClip) prgnSrc = pdc->dclevel.prgnClip; - else if (pdc->rosdc.hClipRgn) + else if (pdc->dclevel.prgnClip) { - hrgnSrc = pdc->rosdc.hClipRgn; + prgnSrc = pdc->dclevel.prgnClip; } else if (pdc->dclevel.prgnMeta) { @@ -739,26 +740,18 @@ break; } - if (hrgnSrc) - { - ret = NtGdiCombineRgn(hrgnDest, hrgnSrc, 0, RGN_COPY) == ERROR ? -1 : 1; - } - else if (prgnSrc) + if (prgnSrc) { PREGION prgnDest = REGION_LockRgn(hrgnDest); if (prgnDest) { ret = IntGdiCombineRgn(prgnDest, prgnSrc, 0, RGN_COPY) == ERROR ? -1 : 1; + if ((ret == 1) && (iCode == SYSRGN)) + IntGdiOffsetRgn(prgnDest, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y); REGION_UnlockRgn(prgnDest); } else ret = -1; - } - - if (iCode == SYSRGN) - { - ptlOrg = pdc->ptlDCOrig; - NtGdiOffsetRgn(hrgnDest, ptlOrg.x, ptlOrg.y ); } DC_UnlockDc(pdc); Modified: trunk/reactos/win32ss/gdi/ntgdi/dcstate.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcstate.…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dcstate.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dcstate.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -51,23 +51,26 @@ pdcDst->dclevel.plfnt = pdcSrc->dclevel.plfnt; /* Get/SetDCState() don't change hVisRgn field ("Undoc. Windows" p.559). */ - if (To) // Copy "To" SaveDC state. - { - if (pdcSrc->rosdc.hClipRgn) - { - pdcDst->rosdc.hClipRgn = IntSysCreateRectRgn(0, 0, 0, 0); - NtGdiCombineRgn(pdcDst->rosdc.hClipRgn, pdcSrc->rosdc.hClipRgn, 0, RGN_COPY); - } - // FIXME: Handle prgnMeta! - } - else // Copy "!To" RestoreDC state. - { /* The VisRectRegion field needs to be set to a valid state */ - GdiExtSelectClipRgn(pdcDst, pdcSrc->rosdc.hClipRgn, RGN_COPY); - } -} - - -BOOL FASTCALL + if (!To) + { + IntGdiExtSelectClipRgn(pdcDst, pdcSrc->dclevel.prgnClip, RGN_COPY); + if (pdcDst->dclevel.prgnMeta) + { + REGION_Delete(pdcDst->dclevel.prgnMeta); + pdcDst->dclevel.prgnMeta = NULL; + } + if (pdcSrc->dclevel.prgnMeta) + { + pdcDst->dclevel.prgnMeta = IntSysCreateRectpRgn(0, 0, 0, 0); + IntGdiCombineRgn(pdcDst->dclevel.prgnMeta, pdcSrc->dclevel.prgnMeta, NULL, RGN_COPY); + } + pdcDst->fs |= DC_FLAG_DIRTY_RAO; + } +} + + +BOOL +FASTCALL IntGdiCleanDC(HDC hDC) { PDC dc; @@ -87,6 +90,16 @@ DC_vUpdateTextBrush(dc); } + /* DC_vCopyState frees the Clip rgn and the Meta rgn. Take care of the other ones + * There is no need to clear prgnVis, as UserGetDC updates it immediately. */ + if (dc->prgnRao) + REGION_Delete(dc->prgnRao); + if (dc->prgnAPI) + REGION_Delete(dc->prgnAPI); + dc->prgnRao = dc->prgnAPI = NULL; + + dc->fs |= DC_FLAG_DIRTY_RAO; + DC_UnlockDc(dc); return TRUE; @@ -272,7 +285,7 @@ GDIOBJ_vSetObjectOwner(&pdcSave->BaseObject, GDI_OBJ_HMGR_PUBLIC); /* Copy the current state */ - DC_vCopyState(pdc, pdcSave, TRUE); + DC_vCopyState(pdc, pdcSave, FALSE); /* Only memory DC's change their surface */ if (pdc->dctype == DCTYPE_MEMORY) Modified: trunk/reactos/win32ss/gdi/ntgdi/dcutil.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dcutil.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dcutil.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dcutil.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -367,7 +367,7 @@ } else if (Flags & DCHF_VALIDATEVISRGN || 0 == Flags) { - dc->fs &= ~DC_FLAG_DIRTY_RAO; + //dc->fs &= ~DC_FLAG_DIRTY_RAO; } DC_UnlockDc(dc); Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dibobj.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -502,7 +502,7 @@ } /* This is actually a blit */ - DC_vPrepareDCsForBlit(pDC, rcDest, NULL, rcDest); + DC_vPrepareDCsForBlit(pDC, &rcDest, NULL, NULL); pSurf = pDC->dclevel.pSurface; if (!pSurf) { @@ -1184,7 +1184,7 @@ } /* Prepare DC for blit */ - DC_vPrepareDCsForBlit(pdc, rcDst, NULL, rcSrc); + DC_vPrepareDCsForBlit(pdc, &rcDst, NULL, NULL); psurfDst = pdc->dclevel.pSurface; Modified: trunk/reactos/win32ss/gdi/ntgdi/fillshap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/fillshap…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -307,7 +307,7 @@ tmpFillBrushObj.ptOrigin.x += dc->ptlDCOrig.x; tmpFillBrushObj.ptOrigin.y += dc->ptlDCOrig.y; - DC_vPrepareDCsForBlit(dc, RectBounds, NULL, RectBounds); + DC_vPrepareDCsForBlit(dc, &RectBounds, NULL, NULL); ret = IntFillEllipse( dc, CenterX - RadiusX, @@ -480,8 +480,7 @@ return TRUE; } - DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds, - NULL, dc->rosdc.CombinedClip->rclBounds); + DC_vPrepareDCsForBlit(dc, NULL, NULL, NULL); if (dc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) DC_vUpdateFillBrush(dc); @@ -567,7 +566,7 @@ DestRect.bottom--; } - DC_vPrepareDCsForBlit(dc, DestRect, NULL, DestRect); + DC_vPrepareDCsForBlit(dc, &DestRect, NULL, NULL); if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) DC_vUpdateFillBrush(dc); @@ -796,7 +795,7 @@ else { - DC_vPrepareDCsForBlit(dc, RectBounds, NULL, RectBounds); + DC_vPrepareDCsForBlit(dc, &RectBounds, NULL, NULL); RtlCopyMemory(&brushTemp, pbrFill, sizeof(brushTemp)); brushTemp.ptOrigin.x += RectBounds.left - Left; @@ -962,9 +961,9 @@ EXLATEOBJ_vInitialize(&exlo, &gpalRGB, psurf->ppal, 0, 0, 0); + DC_vPrepareDCsForBlit(pdc, &rclExtent, NULL, NULL); + ASSERT(pdc->rosdc.CombinedClip); - - DC_vPrepareDCsForBlit(pdc, rclExtent, NULL, rclExtent); bRet = IntEngGradientFill(&psurf->SurfObj, pdc->rosdc.CombinedClip, @@ -1091,6 +1090,13 @@ return TRUE; } + psurf = dc->dclevel.pSurface; + if (!psurf) + { + Ret = FALSE; + goto cleanup; + } + pdcattr = dc->pdcattr; if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) @@ -1103,20 +1109,18 @@ Pt.y = YStart; IntLPtoDP(dc, (LPPOINT)&Pt, 1); - Ret = NtGdiPtInRegion(dc->rosdc.hGCClipRgn, Pt.x, Pt.y); - if (Ret) - IntGdiGetRgnBox(dc->rosdc.hGCClipRgn,(LPRECT)&DestRect); + if (dc->prgnRao) + { + Ret = REGION_PtInRegion(dc->prgnRao, Pt.x, Pt.y); + if (Ret) + REGION_GetRgnBox(dc->prgnRao ,(LPRECT)&DestRect); + else + goto cleanup; + } else - goto cleanup; - - DC_vPrepareDCsForBlit(dc, DestRect, NULL, DestRect); - - psurf = dc->dclevel.pSurface; - if (!psurf) - { - Ret = FALSE; - goto cleanup; - } + RECTL_vSetRect(&DestRect, 0, psurf->SurfObj.sizlBitmap.cx, 0, psurf->SurfObj.sizlBitmap.cy); + + DC_vPrepareDCsForBlit(dc, &DestRect, NULL, NULL); EXLATEOBJ_vInitialize(&exlo, &gpalRGB, psurf->ppal, 0, 0xffffff, 0); @@ -1127,10 +1131,11 @@ ConvColor = XLATEOBJ_iXlate(&exlo.xlo, Color); Ret = DIB_XXBPP_FloodFillSolid(&psurf->SurfObj, &dc->eboFill.BrushObject, &DestRect, &Pt, ConvColor, FillType); + DC_vFinishBlit(dc, NULL); + EXLATEOBJ_vCleanup(&exlo); cleanup: - DC_vFinishBlit(dc, NULL); DC_UnlockDc(dc); return Ret; } Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -3212,7 +3212,7 @@ LONGLONG TextLeft, RealXStart; ULONG TextTop, previous, BackgroundLeft; FT_Bool use_kerning; - RECTL DestRect, MaskRect, DummyRect = {0, 0, 0, 0}; + RECTL DestRect, MaskRect; POINTL SourcePoint, BrushOrigin; HBITMAP HSourceGlyph; SURFOBJ *SourceGlyphSurf; @@ -3308,7 +3308,7 @@ DestRect.right += dc->ptlDCOrig.x; DestRect.bottom += dc->ptlDCOrig.y; - DC_vPrepareDCsForBlit(dc, DestRect, NULL, DestRect); + DC_vPrepareDCsForBlit(dc, &DestRect, NULL, NULL); if (pdcattr->ulDirty_ & DIRTY_BACKGROUND) DC_vUpdateBackgroundBrush(dc); @@ -3502,7 +3502,7 @@ BackgroundLeft = (RealXStart + 32) >> 6; /* Lock blit with a dummy rect */ - DC_vPrepareDCsForBlit(dc, DummyRect, NULL, DummyRect); + DC_vPrepareDCsForBlit(dc, NULL, NULL, NULL); psurf = dc->dclevel.pSurface ; if(!psurf) psurf = psurfDefaultBitmap; Modified: trunk/reactos/win32ss/gdi/ntgdi/line.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/line.c?r…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/line.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/line.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -257,8 +257,7 @@ if (PATH_IsPathOpen(dc->dclevel)) return PATH_Polyline(dc, pt, Count); - DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds, - NULL, dc->rosdc.CombinedClip->rclBounds); + DC_vPrepareDCsForBlit(dc, NULL, NULL, NULL); if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY)) DC_vUpdateFillBrush(dc); @@ -411,7 +410,7 @@ rcLockRect.right += dc->ptlDCOrig.x; rcLockRect.bottom += dc->ptlDCOrig.y; - DC_vPrepareDCsForBlit(dc, rcLockRect, NULL, rcLockRect); + DC_vPrepareDCsForBlit(dc, &rcLockRect, NULL, NULL); if (dc->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY)) DC_vUpdateLineBrush(dc); Modified: trunk/reactos/win32ss/gdi/ntgdi/path.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/path.c?r…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/path.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/path.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -2511,8 +2511,7 @@ return FALSE; } - DC_vPrepareDCsForBlit(dc, dc->rosdc.CombinedClip->rclBounds, - NULL, dc->rosdc.CombinedClip->rclBounds); + DC_vPrepareDCsForBlit(dc, NULL, NULL, NULL); pdcattr = dc->pdcattr; @@ -2777,8 +2776,7 @@ return FALSE; } - DC_vPrepareDCsForBlit(pDc, pDc->rosdc.CombinedClip->rclBounds, - NULL, pDc->rosdc.CombinedClip->rclBounds); + DC_vPrepareDCsForBlit(pDc, NULL, NULL, NULL); pdcattr = pDc->pdcattr; @@ -2822,8 +2820,7 @@ return FALSE; } - DC_vPrepareDCsForBlit(pDc, pDc->rosdc.CombinedClip->rclBounds, - NULL, pDc->rosdc.CombinedClip->rclBounds); + DC_vPrepareDCsForBlit(pDc, NULL, NULL, NULL); pdcattr = pDc->pdcattr; Modified: trunk/reactos/win32ss/gdi/ntgdi/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/region.c…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/region.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/region.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -2300,11 +2300,13 @@ VOID FASTCALL IntGdiReleaseRaoRgn(PDC pDC) { - INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr); - PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; - pDC->fs |= DC_FLAG_DIRTY_RAO; - Entry->Flags |= GDI_ENTRY_VALIDATE_VIS; - RECTL_vSetEmptyRect(&pDC->erclClip); + INT Index = GDI_HANDLE_GET_INDEX(pDC->BaseObject.hHmgr); + PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index]; + pDC->fs |= DC_FLAG_DIRTY_RAO; + Entry->Flags |= GDI_ENTRY_VALIDATE_VIS; + RECTL_vSetEmptyRect(&pDC->erclClip); + REGION_Delete(pDC->prgnRao); + pDC->prgnRao = NULL; } VOID FASTCALL @@ -2503,14 +2505,15 @@ return FALSE; } - NtGdiCombineRgn(tmpVisRgn, tmpVisRgn, dc->rosdc.hGCClipRgn, RGN_AND); - visrgn = RGNOBJAPI_Lock(tmpVisRgn, NULL); if (visrgn == NULL) { GreDeleteObject(tmpVisRgn); return FALSE; } + + if (dc->prgnRao) + IntGdiCombineRgn(visrgn, visrgn, dc->prgnRao, RGN_AND); ClipRegion = IntEngCreateClipRegion(visrgn->rdh.nCount, visrgn->Buffer, @@ -2533,6 +2536,29 @@ // Fill the region return bRet; +} + +BOOL +FASTCALL +REGION_PtInRegion( + PREGION prgn, + INT X, + INT Y) +{ + ULONG i; + PRECT r; + + if (prgn->rdh.nCount > 0 && INRECT(prgn->rdh.rcBound, X, Y)) + { + r = prgn->Buffer; + for (i = 0; i < prgn->rdh.nCount; i++) + { + if (INRECT(r[i], X, Y)) + return TRUE; + } + } + + return FALSE; } BOOL @@ -3861,27 +3887,19 @@ INT Y ) { - PROSRGNDATA rgn; - ULONG i; - PRECTL r; - - if (!(rgn = RGNOBJAPI_Lock(hRgn, NULL) ) ) + PREGION prgn; + BOOL ret; + + if (!(prgn = RGNOBJAPI_Lock(hRgn, NULL) ) ) return FALSE; - if (rgn->rdh.nCount > 0 && INRECT(rgn->rdh.rcBound, X, Y)) - { - r = rgn->Buffer; - for (i = 0; i < rgn->rdh.nCount; i++) - { - if (INRECT(*r, X, Y)) - { - RGNOBJAPI_Unlock(rgn); - return TRUE; - } - r++; - } - } - RGNOBJAPI_Unlock(rgn); + ret = REGION_PtInRegion(prgn, X, Y); + + RGNOBJAPI_Unlock(prgn); + return ret; + + + RGNOBJAPI_Unlock(prgn); return FALSE; } Modified: trunk/reactos/win32ss/gdi/ntgdi/region.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/region.h…
============================================================================== --- trunk/reactos/win32ss/gdi/ntgdi/region.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/ntgdi/region.h [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -27,6 +27,7 @@ VOID FASTCALL REGION_UnionRectWithRgn(ROSRGNDATA *rgn, const RECTL *rect); INT FASTCALL REGION_GetRgnBox(PROSRGNDATA Rgn, RECTL *pRect); BOOL FASTCALL REGION_RectInRegion(PROSRGNDATA Rgn, const RECTL *rc); +BOOL FASTCALL REGION_PtInRegion(PREGION, INT, INT); BOOL FASTCALL REGION_CropAndOffsetRegion(PROSRGNDATA rgnDst, PROSRGNDATA rgnSrc, const RECTL *rect, const POINT *off); VOID FASTCALL REGION_SetRectRgn(PROSRGNDATA pRgn, INT LeftRect, INT TopRect, INT RightRect, INT BottomRect); VOID NTAPI REGION_vCleanup(PVOID ObjectBody); Modified: trunk/reactos/win32ss/user/ntuser/cursoricon.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/cursor…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/cursoricon.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/cursoricon.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -1287,7 +1287,7 @@ RECTL_vOffsetRect(&rcDest, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y); /* Prepare the underlying surface */ - DC_vPrepareDCsForBlit(pdc, rcDest, NULL, rcDest); + DC_vPrepareDCsForBlit(pdc, &rcDest, NULL, NULL); /* Get the clip object */ pdcClipObj = pdc->rosdc.CombinedClip; @@ -1472,7 +1472,7 @@ RECTL_vOffsetRect(&rcDest, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y); /* Prepare the underlying surface */ - DC_vPrepareDCsForBlit(pdc, rcDest, NULL, rcDest); + DC_vPrepareDCsForBlit(pdc, &rcDest, NULL, NULL); /* Get the clip object */ pdcClipObj = pdc->rosdc.CombinedClip; Modified: trunk/reactos/win32ss/user/ntuser/cursoricon_new.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/cursor…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -1195,7 +1195,7 @@ RECTL_vOffsetRect(&rcDest, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y); /* Prepare the underlying surface */ - DC_vPrepareDCsForBlit(pdc, rcDest, NULL, rcDest); + DC_vPrepareDCsForBlit(pdc, &rcDest, NULL, NULL); /* We now have our destination surface and rectangle */ psurfDest = pdc->dclevel.pSurface; Modified: trunk/reactos/win32ss/user/ntuser/dce.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/dce.h?…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/dce.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/dce.h [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -51,3 +51,5 @@ HWND FASTCALL UserGethWnd(HDC,PWNDOBJ*); void FASTCALL DceFreeWindowDCE(PWND); void FASTCALL DceFreeThreadDCE(PTHREADINFO); +VOID FASTCALL DceUpdateVisRgn(DCE *Dce, PWND Window, ULONG Flags); +DCE* FASTCALL DceGetDceFromDC(HDC hdc); Modified: trunk/reactos/win32ss/user/ntuser/windc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/windc.…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/windc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/windc.c [iso-8859-1] Wed Jul 23 16:05:47 2014 @@ -46,21 +46,47 @@ return IntGdiCreateDC(&DriverName, NULL, NULL, NULL, FALSE); } +/* Returns the DCE pointer from the HDC handle */ +DCE* +FASTCALL +DceGetDceFromDC(HDC hdc) +{ + LIST_ENTRY* Entry = LEDce.Flink; + DCE* dce; + + while (Entry != &LEDce) + { + dce = CONTAINING_RECORD(Entry, DCE, List); + if (dce->hDC == hdc) + return dce; + Entry = Entry->Flink; + } + + return NULL; +} + static -HRGN FASTCALL +PREGION FASTCALL DceGetVisRgn(PWND Window, ULONG Flags, HWND hWndChild, ULONG CFlags) { - HRGN VisRgn; - - VisRgn = VIS_ComputeVisibleRegion( Window, - 0 == (Flags & DCX_WINDOW), - 0 != (Flags & DCX_CLIPCHILDREN), - 0 != (Flags & DCX_CLIPSIBLINGS)); - - if (VisRgn == NULL) - VisRgn = IntSysCreateRectRgn(0, 0, 0, 0); - - return VisRgn; + PREGION RetRgn; + HRGN hVisRgn; + hVisRgn = VIS_ComputeVisibleRegion( Window, + 0 == (Flags & DCX_WINDOW), + 0 != (Flags & DCX_CLIPCHILDREN), + 0 != (Flags & DCX_CLIPSIBLINGS)); + + RetRgn = IntSysCreateRectpRgn(0, 0, 0, 0); + + if (hVisRgn != NULL) + { + PREGION VisRgn = REGION_LockRgn(hVisRgn); + IntGdiCombineRgn(RetRgn, VisRgn, NULL, RGN_COPY); + REGION_UnlockRgn(VisRgn); + GreDeleteObject(hVisRgn); + } + + return RetRgn; } PDCE FASTCALL @@ -150,6 +176,7 @@ dc->ptlDCOrig.y = Window->rcClient.top; } } + dc->fs |= DC_FLAG_DIRTY_RAO; DC_UnlockDc(dc); } @@ -175,10 +202,11 @@ IntGdiSetHookFlags(Dce->hDC, DCHF_INVALIDATEVISRGN); } -static VOID FASTCALL +VOID +FASTCALL DceUpdateVisRgn(DCE *Dce, PWND Window, ULONG Flags) { - HANDLE hRgnVisible = NULL; + PREGION RgnVisible = NULL; ULONG DcxFlags; PWND DesktopWindow; @@ -189,7 +217,7 @@ Parent = Window->spwndParent; if(!Parent) { - hRgnVisible = NULL; + RgnVisible = NULL; goto noparent; } @@ -202,23 +230,23 @@ { DcxFlags = Flags & ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW); } - hRgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->head.h, Flags); + RgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->head.h, Flags); } else if (Window == NULL) { DesktopWindow = UserGetWindowObject(IntGetDesktopWindow()); if (NULL != DesktopWindow) { - hRgnVisible = IntSysCreateRectRgnIndirect(&DesktopWindow->rcWindow); + RgnVisible = IntSysCreateRectpRgnIndirect(&DesktopWindow->rcWindow); } else { - hRgnVisible = NULL; + RgnVisible = NULL; } } else { - hRgnVisible = DceGetVisRgn(Window, Flags, 0, 0); + RgnVisible = DceGetVisRgn(Window, Flags, 0, 0); } noparent: @@ -226,33 +254,37 @@ { if(Dce->hrgnClip != NULL) { - NtGdiCombineRgn(hRgnVisible, hRgnVisible, Dce->hrgnClip, RGN_AND); + PREGION RgnClip = REGION_LockRgn(Dce->hrgnClip); + IntGdiCombineRgn(RgnVisible, RgnVisible, RgnClip, RGN_AND); + REGION_UnlockRgn(RgnClip); } else { - if(hRgnVisible != NULL) - { - GreDeleteObject(hRgnVisible); - } - hRgnVisible = IntSysCreateRectRgn(0, 0, 0, 0); - } - } - else if (Flags & DCX_EXCLUDERGN && Dce->hrgnClip != NULL) - { - NtGdiCombineRgn(hRgnVisible, hRgnVisible, Dce->hrgnClip, RGN_DIFF); + if(RgnVisible != NULL) + { + REGION_Delete(RgnVisible); + } + RgnVisible = IntSysCreateRectpRgn(0, 0, 0, 0); + } + } + else if ((Flags & DCX_EXCLUDERGN) && Dce->hrgnClip != NULL) + { + PREGION RgnClip = REGION_LockRgn(Dce->hrgnClip); + IntGdiCombineRgn(RgnVisible, RgnVisible, RgnClip, RGN_DIFF); + REGION_UnlockRgn(RgnClip); } Dce->DCXFlags &= ~DCX_DCEDIRTY; - GdiSelectVisRgn(Dce->hDC, hRgnVisible); + GdiSelectVisRgn(Dce->hDC, RgnVisible); if (VerifyWnd(Window)) // Window maybe dead by this time before finishing the DCE release. { IntEngWindowChanged(Window, WOC_RGN_CLIENT); } - if (hRgnVisible != NULL) - { - GreDeleteObject(hRgnVisible); + if (RgnVisible != NULL) + { + REGION_Delete(RgnVisible); } } @@ -889,10 +921,10 @@ dc->ptlDCOrig.y = CurrentWindow->rcClient.top; } - if (NULL != dc->rosdc.hClipRgn) + if (NULL != dc->dclevel.prgnClip) { - NtGdiOffsetRgn(dc->rosdc.hClipRgn, DeltaX, DeltaY); - CLIPPING_UpdateGCRegion(dc); + IntGdiOffsetRgn(dc->dclevel.prgnClip, DeltaX, DeltaY); + dc->fs |= DC_FLAG_DIRTY_RAO; } if (NULL != pDCE->hrgnClip) {
10 years, 5 months
1
0
0
0
[tfaber] 63730: [FORREALTHISTIME] - Apparently we got that typo from Wine. Fix build. Will send upstream.
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jul 23 12:46:47 2014 New Revision: 63730 URL:
http://svn.reactos.org/svn/reactos?rev=63730&view=rev
Log: [FORREALTHISTIME] - Apparently we got that typo from Wine. Fix build. Will send upstream. Modified: trunk/reactos/lib/rtl/error.c trunk/rostests/winetests/ntdll/error.c Modified: trunk/reactos/lib/rtl/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/error.c?rev=63730&…
============================================================================== --- trunk/reactos/lib/rtl/error.c [iso-8859-1] (original) +++ trunk/reactos/lib/rtl/error.c [iso-8859-1] Wed Jul 23 12:46:47 2014 @@ -1523,7 +1523,7 @@ ERROR_SXS_MANIFEST_TOO_BIG, /* c0150022 (STATUS_SXS_MANIFEST_TOO_BIG) */ ERROR_SXS_SETTING_NOT_REGISTERED, /* c0150023 (STATUS_SXS_SETTING_NOT_REGISTERED) */ ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE, /* c0150024 (STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE) */ - ERROR_SMI_PRIMITIVE_INSTALLER_FAILED, /* c0150025 (STATUS_SXS_PRIMITIVE_INSTALLER_FAILED) */ + ERROR_SMI_PRIMITIVE_INSTALLER_FAILED, /* c0150025 (STATUS_SMI_PRIMITIVE_INSTALLER_FAILED) */ ERROR_GENERIC_COMMAND_FAILED, /* c0150026 (STATUS_GENERIC_COMMAND_FAILED) */ ERROR_SXS_FILE_HASH_MISSING /* c0150027 (STATUS_SXS_FILE_HASH_MISSING) */ }; Modified: trunk/rostests/winetests/ntdll/error.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ntdll/error.c?r…
============================================================================== --- trunk/rostests/winetests/ntdll/error.c [iso-8859-1] (original) +++ trunk/rostests/winetests/ntdll/error.c [iso-8859-1] Wed Jul 23 12:46:47 2014 @@ -963,7 +963,7 @@ cmp2(STATUS_SXS_MANIFEST_TOO_BIG, ERROR_SXS_MANIFEST_TOO_BIG); cmp2(STATUS_SXS_SETTING_NOT_REGISTERED, ERROR_SXS_SETTING_NOT_REGISTERED); cmp2(STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE, ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE); - cmp2(STATUS_SXS_PRIMITIVE_INSTALLER_FAILED, ERROR_SMI_PRIMITIVE_INSTALLER_FAILED); + cmp2(STATUS_SMI_PRIMITIVE_INSTALLER_FAILED, ERROR_SMI_PRIMITIVE_INSTALLER_FAILED); cmp2(STATUS_GENERIC_COMMAND_FAILED, ERROR_GENERIC_COMMAND_FAILED); cmp2(STATUS_SXS_FILE_HASH_MISSING, ERROR_SXS_FILE_HASH_MISSING); cmp2(STATUS_REDIRECTOR_STARTED, ERROR_SERVICE_ALREADY_RUNNING);
10 years, 5 months
1
0
0
0
[tfaber] 63729: [CLT2014] - ... and remove the branch
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jul 23 12:39:02 2014 New Revision: 63729 URL:
http://svn.reactos.org/svn/reactos?rev=63729&view=rev
Log: [CLT2014] - ... and remove the branch Removed: branches/ros-branch-0_3_16-clt2014/
10 years, 5 months
1
0
0
0
[tfaber] 63728: [CLT2014] - Erm, that branch shouldn't even exist anymore. Tag the release...
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jul 23 12:38:37 2014 New Revision: 63728 URL:
http://svn.reactos.org/svn/reactos?rev=63728&view=rev
Log: [CLT2014] - Erm, that branch shouldn't even exist anymore. Tag the release... Added: tags/ReactOS-0.3.16-CLT2014/ - copied from r62441, branches/ros-branch-0_3_16-clt2014/
10 years, 5 months
1
0
0
0
[tfaber] 63727: [OOPS] - Apparently we got that typo from Wine. Fix build. Will send upstream.
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jul 23 12:33:25 2014 New Revision: 63727 URL:
http://svn.reactos.org/svn/reactos?rev=63727&view=rev
Log: [OOPS] - Apparently we got that typo from Wine. Fix build. Will send upstream. Modified: branches/ros-branch-0_3_16-clt2014/reactos/lib/rtl/error.c branches/ros-branch-0_3_16-clt2014/rostests/winetests/ntdll/error.c Modified: branches/ros-branch-0_3_16-clt2014/reactos/lib/rtl/error.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_16-clt2014/react…
============================================================================== --- branches/ros-branch-0_3_16-clt2014/reactos/lib/rtl/error.c [iso-8859-1] (original) +++ branches/ros-branch-0_3_16-clt2014/reactos/lib/rtl/error.c [iso-8859-1] Wed Jul 23 12:33:25 2014 @@ -1523,7 +1523,7 @@ ERROR_SXS_MANIFEST_TOO_BIG, /* c0150022 (STATUS_SXS_MANIFEST_TOO_BIG) */ ERROR_SXS_SETTING_NOT_REGISTERED, /* c0150023 (STATUS_SXS_SETTING_NOT_REGISTERED) */ ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE, /* c0150024 (STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE) */ - ERROR_SMI_PRIMITIVE_INSTALLER_FAILED, /* c0150025 (STATUS_SXS_PRIMITIVE_INSTALLER_FAILED) */ + ERROR_SMI_PRIMITIVE_INSTALLER_FAILED, /* c0150025 (STATUS_SMI_PRIMITIVE_INSTALLER_FAILED) */ ERROR_GENERIC_COMMAND_FAILED, /* c0150026 (STATUS_GENERIC_COMMAND_FAILED) */ ERROR_SXS_FILE_HASH_MISSING /* c0150027 (STATUS_SXS_FILE_HASH_MISSING) */ }; Modified: branches/ros-branch-0_3_16-clt2014/rostests/winetests/ntdll/error.c URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_16-clt2014/roste…
============================================================================== --- branches/ros-branch-0_3_16-clt2014/rostests/winetests/ntdll/error.c [iso-8859-1] (original) +++ branches/ros-branch-0_3_16-clt2014/rostests/winetests/ntdll/error.c [iso-8859-1] Wed Jul 23 12:33:25 2014 @@ -963,7 +963,7 @@ cmp2(STATUS_SXS_MANIFEST_TOO_BIG, ERROR_SXS_MANIFEST_TOO_BIG); cmp2(STATUS_SXS_SETTING_NOT_REGISTERED, ERROR_SXS_SETTING_NOT_REGISTERED); cmp2(STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE, ERROR_SXS_TRANSACTION_CLOSURE_INCOMPLETE); - cmp2(STATUS_SXS_PRIMITIVE_INSTALLER_FAILED, ERROR_SMI_PRIMITIVE_INSTALLER_FAILED); + cmp2(STATUS_SMI_PRIMITIVE_INSTALLER_FAILED, ERROR_SMI_PRIMITIVE_INSTALLER_FAILED); cmp2(STATUS_GENERIC_COMMAND_FAILED, ERROR_GENERIC_COMMAND_FAILED); cmp2(STATUS_SXS_FILE_HASH_MISSING, ERROR_SXS_FILE_HASH_MISSING); cmp2(STATUS_REDIRECTOR_STARTED, ERROR_SERVICE_ALREADY_RUNNING);
10 years, 5 months
1
0
0
0
[tfaber] 63726: [PSDK] - Fix a typo in ntstatus.h
by tfaber@svn.reactos.org
Author: tfaber Date: Wed Jul 23 12:23:31 2014 New Revision: 63726 URL:
http://svn.reactos.org/svn/reactos?rev=63726&view=rev
Log: [PSDK] - Fix a typo in ntstatus.h Modified: trunk/reactos/include/psdk/ntstatus.h Modified: trunk/reactos/include/psdk/ntstatus.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/psdk/ntstatus.h?re…
============================================================================== --- trunk/reactos/include/psdk/ntstatus.h [iso-8859-1] (original) +++ trunk/reactos/include/psdk/ntstatus.h [iso-8859-1] Wed Jul 23 12:23:31 2014 @@ -1181,7 +1181,7 @@ #define STATUS_SXS_MANIFEST_TOO_BIG ((NTSTATUS) 0xC0150022) #define STATUS_SXS_SETTING_NOT_REGISTERED ((NTSTATUS) 0xC0150023) #define STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE ((NTSTATUS) 0xC0150024) -#define STATUS_SXS_PRIMITIVE_INSTALLER_FAILED ((NTSTATUS) 0xC0150025) +#define STATUS_SMI_PRIMITIVE_INSTALLER_FAILED ((NTSTATUS) 0xC0150025) #define STATUS_GENERIC_COMMAND_FAILED ((NTSTATUS) 0xC0150026) #define STATUS_SXS_FILE_HASH_MISSING ((NTSTATUS) 0xC0150027)
10 years, 5 months
1
0
0
0
[tfaber] 63725: [WININET_WINETEST] - Add back work-around for testbot hang lost in winesync. ROSTESTS-73
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Jul 20 11:19:44 2014 New Revision: 63725 URL:
http://svn.reactos.org/svn/reactos?rev=63725&view=rev
Log: [WININET_WINETEST] - Add back work-around for testbot hang lost in winesync. ROSTESTS-73 Modified: trunk/rostests/winetests/wininet/http.c Modified: trunk/rostests/winetests/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/wininet/http.c?…
============================================================================== --- trunk/rostests/winetests/wininet/http.c [iso-8859-1] (original) +++ trunk/rostests/winetests/wininet/http.c [iso-8859-1] Sun Jul 20 11:19:44 2014 @@ -3143,7 +3143,11 @@ SET_EXPECT(INTERNET_STATUS_CONNECTION_CLOSED); SET_EXPECT(INTERNET_STATUS_REQUEST_COMPLETE); SetEvent(conn_close_event); +#ifdef ROSTESTS_73_FIXED WaitForSingleObject(hCompleteEvent, INFINITE); +#else /* ROSTESTS_73_FIXED */ + ok(WaitForSingleObject(hCompleteEvent, 5000) == WAIT_OBJECT_0, "Wait timed out\n"); +#endif /* ROSTESTS_73_FIXED */ ok(req_error == ERROR_SUCCESS, "req_error = %u\n", req_error); CHECK_NOTIFIED(INTERNET_STATUS_CLOSING_CONNECTION); CHECK_NOTIFIED(INTERNET_STATUS_CONNECTION_CLOSED);
10 years, 5 months
1
0
0
0
[tfaber] 63724: [WININET] - Apply Wine commit 8fd44a3d (wininet: Fix invalid memory access in HTTP_QUERY_RAW_HEADERS (Valgrind).) by Sebastian Lackner. Fixes crash in wininet:http InternetReadFile_...
by tfaber@svn.reactos.org
Author: tfaber Date: Sun Jul 20 08:30:21 2014 New Revision: 63724 URL:
http://svn.reactos.org/svn/reactos?rev=63724&view=rev
Log: [WININET] - Apply Wine commit 8fd44a3d (wininet: Fix invalid memory access in HTTP_QUERY_RAW_HEADERS (Valgrind).) by Sebastian Lackner. Fixes crash in wininet:http InternetReadFile_test Modified: trunk/reactos/dll/win32/wininet/http.c Modified: trunk/reactos/dll/win32/wininet/http.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wininet/http.c?r…
============================================================================== --- trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/wininet/http.c [iso-8859-1] Sun Jul 20 08:30:21 2014 @@ -3568,12 +3568,12 @@ TRACE("returning data: %s\n", debugstr_wn(headers, len / sizeof(WCHAR))); - for (i=0; i<len; i++) + for (i = 0; i < len / sizeof(WCHAR); i++) { if (headers[i] == '\n') headers[i] = 0; } - memcpy(lpBuffer, headers, len + sizeof(WCHAR)); + memcpy(lpBuffer, headers, len); } *lpdwBufferLength = len - sizeof(WCHAR);
10 years, 5 months
1
0
0
0
[ekohl] 63723: [SCSIPORT] ScsiPortLogError: Print the information that is to be logged.
by ekohl@svn.reactos.org
Author: ekohl Date: Sun Jul 20 07:19:42 2014 New Revision: 63723 URL:
http://svn.reactos.org/svn/reactos?rev=63723&view=rev
Log: [SCSIPORT] ScsiPortLogError: Print the information that is to be logged. Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c Modified: trunk/reactos/drivers/storage/scsiport/scsiport.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/scsiport/s…
============================================================================== --- trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/scsiport/scsiport.c [iso-8859-1] Sun Jul 20 07:19:42 2014 @@ -1840,6 +1840,8 @@ //PSCSI_PORT_DEVICE_EXTENSION DeviceExtension; DPRINT1("ScsiPortLogError() called\n"); + DPRINT1("PathId: 0x%02x TargetId: 0x%02x Lun: 0x%02x ErrorCode: 0x%08lx UniqueId: 0x%08lx\n", + PathId, TargetId, Lun, ErrorCode, UniqueId); //DeviceExtension = CONTAINING_RECORD(HwDeviceExtension, SCSI_PORT_DEVICE_EXTENSION, MiniPortDeviceExtension);
10 years, 5 months
1
0
0
0
[tfaber] 63722: [NTOS:FSTUB] - Make sure to NULL the return pointer in the failure case of xHalIoReadPartitionTable. CORE-8359
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Jul 19 17:50:56 2014 New Revision: 63722 URL:
http://svn.reactos.org/svn/reactos?rev=63722&view=rev
Log: [NTOS:FSTUB] - Make sure to NULL the return pointer in the failure case of xHalIoReadPartitionTable. CORE-8359 Modified: trunk/reactos/ntoskrnl/fstub/disksup.c Modified: trunk/reactos/ntoskrnl/fstub/disksup.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/fstub/disksup.c?r…
============================================================================== --- trunk/reactos/ntoskrnl/fstub/disksup.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/fstub/disksup.c [iso-8859-1] Sat Jul 19 17:50:56 2014 @@ -1787,7 +1787,11 @@ /* Free the buffer and check for success */ if (Buffer) ExFreePoolWithTag(Buffer, TAG_FILE_SYSTEM); - if (!NT_SUCCESS(Status)) ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM); + if (!NT_SUCCESS(Status)) + { + ExFreePoolWithTag(*PartitionBuffer, TAG_FILE_SYSTEM); + *PartitionBuffer = NULL; + } /* Return status */ return Status;
10 years, 5 months
1
0
0
0
← Newer
1
...
4
5
6
7
8
9
10
11
12
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
Results per page:
10
25
50
100
200