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
November 2008
----- 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
28 participants
657 discussions
Start a n
N
ew thread
[gschneider] 37168: StretchBlt: - Enable unsupported bit depth dprint (4bpp) - Respect the destination offset instead of always starting the blt at 0, 0 (8/16bpp) - Adapt routine from 8/16/32bpp, tested to be approx 15-25% faster than the old one (24bpp)
by gschneider@svn.reactos.org
Author: gschneider Date: Mon Nov 3 06:40:24 2008 New Revision: 37168 URL:
http://svn.reactos.org/svn/reactos?rev=37168&view=rev
Log: StretchBlt: - Enable unsupported bit depth dprint (4bpp) - Respect the destination offset instead of always starting the blt at 0,0 (8/16bpp) - Adapt routine from 8/16/32bpp, tested to be approx 15-25% faster than the old one (24bpp) Modified: trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c trunk/reactos/subsystems/win32/win32k/dib/dib8bpp.c Modified: trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib16bpp.c [iso-8859-1] Mon Nov 3 06:40:24 2008 @@ -788,12 +788,12 @@ /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=0; DesY<DesSizeY; DesY++) + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { sx = SourceRect->left; sx_dec = 0; - for (DesX=0; DesX<DesSizeX; DesX++) + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { color = XLATEOBJ_iXlate(ColorTranslation, DIB_1BPP_GetPixel(SourceSurf, sx, sy)); @@ -823,12 +823,12 @@ /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=0; DesY<DesSizeY; DesY++) + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { sx = SourceRect->left; sx_dec = 0; - for (DesX=0; DesX<DesSizeX; DesX++) + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy)); @@ -858,12 +858,12 @@ /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=0; DesY<DesSizeY; DesY++) + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { sx = SourceRect->left; sx_dec = 0; - for (DesX=0; DesX<DesSizeX; DesX++) + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { color = XLATEOBJ_iXlate(ColorTranslation, DIB_8BPP_GetPixel(SourceSurf, sx, sy)); @@ -894,12 +894,12 @@ /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=0; DesY<DesSizeY; DesY++) + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { sx = SourceRect->left; sx_dec = 0; - for (DesX=0; DesX<DesSizeX; DesX++) + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy)); @@ -929,12 +929,12 @@ /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=0; DesY<DesSizeY; DesY++) + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { sx = SourceRect->left; sx_dec = 0; - for (DesX=0; DesX<DesSizeX; DesX++) + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy)); Modified: trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib24bpp.c [iso-8859-1] Mon Nov 3 06:40:24 2008 @@ -414,20 +414,50 @@ LONG SrcSizeX; LONG DesSizeY; LONG DesSizeX; - LONG sx; - LONG sy; + LONG sx = 0; + LONG sy = 0; LONG DesX; LONG DesY; - LONG color; + + LONG SrcZoomXHight; + LONG SrcZoomXLow; + LONG SrcZoomYHight; + LONG SrcZoomYLow; + + LONG sy_dec = 0; + LONG sy_max; + + LONG sx_dec = 0; + LONG sx_max; + ULONG color; DPRINT("DIB_24BPP_StretchBlt: Source BPP: %u, srcRect: (%d,%d)-(%d,%d), dstRect: (%d,%d)-(%d,%d)\n", BitsPerFormat(SourceSurf->iBitmapFormat), SourceRect->left, SourceRect->top, SourceRect->right, SourceRect->bottom, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom); - SrcSizeY = SourceRect->bottom - SourceRect->top; - SrcSizeX = SourceRect->right - SourceRect->left; - - DesSizeY = DestRect->bottom - DestRect->top; - DesSizeX = DestRect->right - DestRect->left; + + /* Calc the Zoom height of Source */ + SrcSizeY = SourceRect->bottom - SourceRect->top; + + /* Calc the Zoom Width of Source */ + SrcSizeX = SourceRect->right - SourceRect->left; + + /* Calc the Zoom height of Destinations */ + DesSizeY = DestRect->bottom - DestRect->top; + + /* Calc the Zoom width of Destinations */ + DesSizeX = DestRect->right - DestRect->left; + + /* Calc the zoom factor of source height */ + SrcZoomYHight = SrcSizeY / DesSizeY; + SrcZoomYLow = SrcSizeY - (SrcZoomYHight * DesSizeY); + + /* Calc the zoom factor of source width */ + SrcZoomXHight = SrcSizeX / DesSizeX; + SrcZoomXLow = SrcSizeX - (SrcZoomXHight * DesSizeX); + + sx_max = DesSizeX; + sy_max = DesSizeY; + sy = SourceRect->top; switch(SourceSurf->iBitmapFormat) { @@ -437,20 +467,31 @@ for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { - sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; + sx = SourceRect->left; + sx_dec = 0; for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; - - if(DIB_1BPP_GetPixel(SourceSurf, sx, sy) == 0) - { - DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 0)); - } - else - { - DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, 1)); - } + color = XLATEOBJ_iXlate(ColorTranslation, + DIB_1BPP_GetPixel(SourceSurf, sx, sy)); + + DIB_24BPP_PutPixel(DestSurf, DesX, DesY, color); + + sx += SrcZoomXHight; + sx_dec += SrcZoomXLow; + if (sx_dec >= sx_max) + { + sx++; + sx_dec -= sx_max; + } + } + + sy += SrcZoomYHight; + sy_dec += SrcZoomYLow; + if (sy_dec >= sy_max) + { + sy++; + sy_dec -= sy_max; } } @@ -462,13 +503,31 @@ for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { - sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; + sx = SourceRect->left; + sx_dec = 0; for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; - color = DIB_4BPP_GetPixel(SourceSurf, sx, sy); - DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); + color = XLATEOBJ_iXlate(ColorTranslation, + DIB_4BPP_GetPixel(SourceSurf, sx, sy)); + + DIB_24BPP_PutPixel(DestSurf, DesX, DesY, color); + + sx += SrcZoomXHight; + sx_dec += SrcZoomXLow; + if (sx_dec >= sx_max) + { + sx++; + sx_dec -= sx_max; + } + } + + sy += SrcZoomYHight; + sy_dec += SrcZoomYLow; + if (sy_dec >= sy_max) + { + sy++; + sy_dec -= sy_max; } } break; @@ -479,13 +538,31 @@ for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { - sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; + sx = SourceRect->left; + sx_dec = 0; for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; - color = DIB_8BPP_GetPixel(SourceSurf, sx, sy); - DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); + color = XLATEOBJ_iXlate(ColorTranslation, + DIB_8BPP_GetPixel(SourceSurf, sx, sy)); + + DIB_24BPP_PutPixel(DestSurf, DesX, DesY, color); + + sx += SrcZoomXHight; + sx_dec += SrcZoomXLow; + if (sx_dec >= sx_max) + { + sx++; + sx_dec -= sx_max; + } + } + + sy += SrcZoomYHight; + sy_dec += SrcZoomYLow; + if (sy_dec >= sy_max) + { + sy++; + sy_dec -= sy_max; } } break; @@ -496,13 +573,31 @@ for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { - sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; + sx = SourceRect->left; + sx_dec = 0; for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; - color = DIB_16BPP_GetPixel(SourceSurf, sx, sy); - DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); + color = XLATEOBJ_iXlate(ColorTranslation, + DIB_16BPP_GetPixel(SourceSurf, sx, sy)); + + DIB_24BPP_PutPixel(DestSurf, DesX, DesY, color); + + sx += SrcZoomXHight; + sx_dec += SrcZoomXLow; + if (sx_dec >= sx_max) + { + sx++; + sx_dec -= sx_max; + } + } + + sy += SrcZoomYHight; + sy_dec += SrcZoomYLow; + if (sy_dec >= sy_max) + { + sy++; + sy_dec -= sy_max; } } break; @@ -513,13 +608,31 @@ for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { - sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; + sx = SourceRect->left; + sx_dec = 0; for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; - color = DIB_24BPP_GetPixel(SourceSurf, sx, sy); - DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); + color = XLATEOBJ_iXlate(ColorTranslation, + DIB_24BPP_GetPixel(SourceSurf, sx, sy)); + + DIB_24BPP_PutPixel(DestSurf, DesX, DesY, color); + + sx += SrcZoomXHight; + sx_dec += SrcZoomXLow; + if (sx_dec >= sx_max) + { + sx++; + sx_dec -= sx_max; + } + } + + sy += SrcZoomYHight; + sy_dec += SrcZoomYLow; + if (sy_dec >= sy_max) + { + sy++; + sy_dec -= sy_max; } } break; @@ -530,13 +643,31 @@ for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { - sy = (((DesY - DestRect->top) * SrcSizeY) / DesSizeY) + SourceRect->top; + sx = SourceRect->left; + sx_dec = 0; for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { - sx = (((DesX - DestRect->left) * SrcSizeX) / DesSizeX) + SourceRect->left; - color = DIB_32BPP_GetPixel(SourceSurf, sx, sy); - DIB_24BPP_PutPixel(DestSurf, DesX, DesY, XLATEOBJ_iXlate(ColorTranslation, color)); + color = XLATEOBJ_iXlate(ColorTranslation, + DIB_32BPP_GetPixel(SourceSurf, sx, sy)); + + DIB_24BPP_PutPixel(DestSurf, DesX, DesY, color); + + sx += SrcZoomXHight; + sx_dec += SrcZoomXLow; + if (sx_dec >= sx_max) + { + sx++; + sx_dec -= sx_max; + } + } + + sy += SrcZoomYHight; + sy_dec += SrcZoomYLow; + if (sy_dec >= sy_max) + { + sy++; + sy_dec -= sy_max; } } break; Modified: trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib4bpp.c [iso-8859-1] Mon Nov 3 06:40:24 2008 @@ -510,7 +510,7 @@ break; default: - //DPRINT1("DIB_4BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); + DPRINT1("DIB_4BPP_StretchBlt: Unhandled Source BPP: %u\n", BitsPerFormat(SourceSurf->iBitmapFormat)); return FALSE; } Modified: trunk/reactos/subsystems/win32/win32k/dib/dib8bpp.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/di…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/dib/dib8bpp.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/dib/dib8bpp.c [iso-8859-1] Mon Nov 3 06:40:24 2008 @@ -522,11 +522,11 @@ case BMF_1BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=0; DesY<DesSizeY; DesY++) + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { sx = SourceRect->left; sx_dec = 0; - for (DesX=0; DesX<DesSizeX; DesX++) + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { color = XLATEOBJ_iXlate(ColorTranslation, DIB_1BPP_GetPixel(SourceSurf, sx, sy)); @@ -555,11 +555,11 @@ case BMF_4BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=0; DesY<DesSizeY; DesY++) + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { sx = SourceRect->left; sx_dec = 0; - for (DesX=0; DesX<DesSizeX; DesX++) + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { color = XLATEOBJ_iXlate(ColorTranslation, DIB_4BPP_GetPixel(SourceSurf, sx, sy)); @@ -593,11 +593,11 @@ case BMF_16BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=0; DesY<DesSizeY; DesY++) + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { sx = SourceRect->left; sx_dec = 0; - for (DesX=0; DesX<DesSizeX; DesX++) + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { color = XLATEOBJ_iXlate(ColorTranslation, DIB_16BPP_GetPixel(SourceSurf, sx, sy)); @@ -624,11 +624,11 @@ break; case BMF_24BPP: - for (DesY=0; DesY<DesSizeY; DesY++) + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { sx = SourceRect->left; sx_dec = 0; - for (DesX=0; DesX<DesSizeX; DesX++) + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { color = XLATEOBJ_iXlate(ColorTranslation, DIB_24BPP_GetPixel(SourceSurf, sx, sy)); @@ -657,11 +657,11 @@ case BMF_32BPP: /* FIXME : MaskOrigin, BrushOrigin, ClipRegion, Mode ? */ /* This is a reference implementation, it hasn't been optimized for speed */ - for (DesY=0; DesY<DesSizeY; DesY++) + for (DesY=DestRect->top; DesY<DestRect->bottom; DesY++) { sx = SourceRect->left; sx_dec = 0; - for (DesX=0; DesX<DesSizeX; DesX++) + for (DesX=DestRect->left; DesX<DestRect->right; DesX++) { color = XLATEOBJ_iXlate(ColorTranslation, DIB_32BPP_GetPixel(SourceSurf, sx, sy));
16 years, 1 month
1
0
0
0
[dchapyshev] 37167: - Move IsWow64Process to proc.c - Implement FatalAppExitW (based on Wine)
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Mon Nov 3 06:27:39 2008 New Revision: 37167 URL:
http://svn.reactos.org/svn/reactos?rev=37167&view=rev
Log: - Move IsWow64Process to proc.c - Implement FatalAppExitW (based on Wine) Modified: trunk/reactos/dll/win32/kernel32/misc/stubs.c trunk/reactos/dll/win32/kernel32/process/proc.c Modified: trunk/reactos/dll/win32/kernel32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/st…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] Mon Nov 3 06:27:39 2008 @@ -529,35 +529,6 @@ { STUB; return 0; -} - -/* - * @implemented - */ -BOOL -STDCALL -IsWow64Process( - HANDLE hProcess, - PBOOL Wow64Process - ) -{ - ULONG pbi; - NTSTATUS Status; - - Status = NtQueryInformationProcess(hProcess, - ProcessWow64Information, - &pbi, - sizeof(pbi), - NULL); - - if (Status != STATUS_SUCCESS) - { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } - - *Wow64Process = (pbi != 0); - return TRUE; } /* Modified: trunk/reactos/dll/win32/kernel32/process/proc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process…
============================================================================== --- trunk/reactos/dll/win32/kernel32/process/proc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/process/proc.c [iso-8859-1] Mon Nov 3 06:27:39 2008 @@ -16,6 +16,8 @@ #define NDEBUG #include <debug.h> + +typedef INT (WINAPI *MessageBoxW_Proc) (HWND, LPCWSTR, LPCWSTR, UINT); /* GLOBALS *******************************************************************/ @@ -617,8 +619,8 @@ * @unimplemented */ VOID STDCALL -FatalAppExitA (UINT uAction, - LPCSTR lpMessageText) +FatalAppExitA(UINT uAction, + LPCSTR lpMessageText) { UNICODE_STRING MessageTextU; ANSI_STRING MessageText; @@ -640,9 +642,24 @@ */ VOID STDCALL FatalAppExitW(UINT uAction, - LPCWSTR lpMessageText) -{ - return; + LPCWSTR lpMessageText) +{ + static const WCHAR szUser32[] = L"user32.dll\0"; + + HMODULE hModule = GetModuleHandleW(szUser32); + MessageBoxW_Proc pMessageBoxW = NULL; + + DPRINT1("AppExit\n"); + + if (hModule) + pMessageBoxW = (MessageBoxW_Proc) GetProcAddress(hModule, "MessageBoxW"); + + if (pMessageBoxW) + pMessageBoxW(0, lpMessageText, NULL, MB_SYSTEMMODAL | MB_OK); + else + DPRINT1("%s\n", lpMessageText); + + ExitProcess(0); } @@ -895,4 +912,34 @@ return FALSE; } + +/* + * @implemented + */ +BOOL +STDCALL +IsWow64Process( + HANDLE hProcess, + PBOOL Wow64Process + ) +{ + ULONG pbi; + NTSTATUS Status; + + Status = NtQueryInformationProcess(hProcess, + ProcessWow64Information, + &pbi, + sizeof(pbi), + NULL); + + if (!NT_SUCCESS(Status)) + { + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + + *Wow64Process = (pbi != 0); + return TRUE; +} + /* EOF */
16 years, 1 month
1
0
0
0
[pschweitzer] 37166: Fast mutex are allocated with non paged memory. Spotted by Alex
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Mon Nov 3 06:25:10 2008 New Revision: 37166 URL:
http://svn.reactos.org/svn/reactos?rev=37166&view=rev
Log: Fast mutex are allocated with non paged memory. Spotted by Alex Modified: branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c Modified: branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c URL:
http://svn.reactos.org/svn/reactos/branches/pierre-fsd/ntoskrnl/fsrtl/large…
============================================================================== --- branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c [iso-8859-1] (original) +++ branches/pierre-fsd/ntoskrnl/fsrtl/largemcb.c [iso-8859-1] Mon Nov 3 06:25:10 2008 @@ -16,7 +16,7 @@ /* GLOBALS *******************************************************************/ PAGED_LOOKASIDE_LIST FsRtlFirstMappingLookasideList; -PAGED_LOOKASIDE_LIST FsRtlFastMutexLookasideList; +NPAGED_LOOKASIDE_LIST FsRtlFastMutexLookasideList; /* PUBLIC FUNCTIONS **********************************************************/ @@ -129,7 +129,7 @@ FsRtlInitializeLargeMcb(IN PLARGE_MCB Mcb, IN POOL_TYPE PoolType) { - Mcb->FastMutex = ExAllocateFromPagedLookasideList(&FsRtlFastMutexLookasideList); + Mcb->FastMutex = ExAllocateFromNPagedLookasideList(&FsRtlFastMutexLookasideList); ExInitializeFastMutex(Mcb->FastMutex); FsRtlInitializeBaseMcb(&(Mcb->BaseMcb), PoolType); @@ -152,13 +152,13 @@ 0); /* FIXME: Should be 4 */ /* Initialize the list for the fast mutex */ - ExInitializePagedLookasideList(&FsRtlFastMutexLookasideList, - NULL, - NULL, - POOL_RAISE_IF_ALLOCATION_FAILURE, - sizeof(FAST_MUTEX), - IFS_POOL_TAG, - 0); /* FIXME: Should be 32 */ + ExInitializeNPagedLookasideList(&FsRtlFastMutexLookasideList, + NULL, + NULL, + POOL_RAISE_IF_ALLOCATION_FAILURE, + sizeof(FAST_MUTEX), + IFS_POOL_TAG, + 0); /* FIXME: Should be 32 */ } /* @@ -453,8 +453,8 @@ { if (Mcb->FastMutex) { - ExFreeToPagedLookasideList(&FsRtlFastMutexLookasideList, - Mcb->FastMutex); + ExFreeToNPagedLookasideList(&FsRtlFastMutexLookasideList, + Mcb->FastMutex); FsRtlUninitializeBaseMcb(&(Mcb->BaseMcb)); } }
16 years, 1 month
1
0
0
0
[dchapyshev] 37165: - Implement IsWow64Process (based on Wine)
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Mon Nov 3 05:46:02 2008 New Revision: 37165 URL:
http://svn.reactos.org/svn/reactos?rev=37165&view=rev
Log: - Implement IsWow64Process (based on Wine) Modified: trunk/reactos/dll/win32/kernel32/misc/stubs.c Modified: trunk/reactos/dll/win32/kernel32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/st…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/stubs.c [iso-8859-1] Mon Nov 3 05:46:02 2008 @@ -532,7 +532,7 @@ } /* - * @unimplemented + * @implemented */ BOOL STDCALL @@ -541,8 +541,22 @@ PBOOL Wow64Process ) { - STUB; - *Wow64Process = FALSE; + ULONG pbi; + NTSTATUS Status; + + Status = NtQueryInformationProcess(hProcess, + ProcessWow64Information, + &pbi, + sizeof(pbi), + NULL); + + if (Status != STATUS_SUCCESS) + { + SetLastError(RtlNtStatusToDosError(Status)); + return FALSE; + } + + *Wow64Process = (pbi != 0); return TRUE; }
16 years, 1 month
1
0
0
0
[dchapyshev] 37164: - Implement GetCPInfoExA/W (not fully) - Move CODEPAGE_ENTRY struct to header file - Small fix HeapWalk
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Mon Nov 3 05:27:17 2008 New Revision: 37164 URL:
http://svn.reactos.org/svn/reactos?rev=37164&view=rev
Log: - Implement GetCPInfoExA/W (not fully) - Move CODEPAGE_ENTRY struct to header file - Small fix HeapWalk Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h trunk/reactos/dll/win32/kernel32/mem/heap.c trunk/reactos/dll/win32/kernel32/misc/lang.c trunk/reactos/dll/win32/kernel32/misc/nls.c Modified: trunk/reactos/dll/win32/kernel32/include/kernel32.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/include…
============================================================================== --- trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/include/kernel32.h [iso-8859-1] Mon Nov 3 05:27:17 2008 @@ -37,6 +37,15 @@ #define SetLastErrorByStatus(__S__) \ ((void)SetLastError(RtlNtStatusToDosError(__S__))) + +typedef struct _CODEPAGE_ENTRY +{ + LIST_ENTRY Entry; + UINT CodePage; + HANDLE SectionHandle; + PBYTE SectionMapping; + CPTABLEINFO CodePageTable; +} CODEPAGE_ENTRY, *PCODEPAGE_ENTRY; typedef DWORD @@ -171,5 +180,8 @@ OUT PHANDLE hSection, IN PUNICODE_STRING ApplicationName); +PCODEPAGE_ENTRY FASTCALL +IntGetCodePageEntry(UINT CodePage); + #endif /* ndef _KERNEL32_INCLUDE_KERNEL32_H */ Modified: trunk/reactos/dll/win32/kernel32/mem/heap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/hea…
============================================================================== --- trunk/reactos/dll/win32/kernel32/mem/heap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/mem/heap.c [iso-8859-1] Mon Nov 3 05:27:17 2008 @@ -262,10 +262,13 @@ Status = RtlWalkHeap(hHeap, lpEntry); - if (Status) + if (!NT_SUCCESS(Status)) + { SetLastError(RtlNtStatusToDosError(Status)); - - return !Status; + return FALSE; + } + + return TRUE; } /* EOF */ Modified: trunk/reactos/dll/win32/kernel32/misc/lang.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/la…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/lang.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/lang.c [iso-8859-1] Mon Nov 3 05:27:17 2008 @@ -1267,32 +1267,89 @@ /* - * @unimplemented + * @implemented */ BOOL STDCALL -GetCPInfoExW( - UINT CodePage, - DWORD dwFlags, - LPCPINFOEXW lpCPInfoEx) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; -} - - -/* - * @unimplemented +GetCPInfoExW(UINT CodePage, + DWORD dwFlags, + LPCPINFOEXW lpCPInfoEx) +{ + if (!GetCPInfo(CodePage, (LPCPINFO) lpCPInfoEx)) + return FALSE; + + switch(CodePage) + { + case CP_UTF7: + { + static const WCHAR utf7[] = L"Unicode (UTF-7)\0"; + + lpCPInfoEx->CodePage = CP_UTF7; + lpCPInfoEx->UnicodeDefaultChar = 0x3f; + wcscpy(lpCPInfoEx->CodePageName, utf7); + } + break; + + case CP_UTF8: + { + static const WCHAR utf8[] = L"Unicode (UTF-8)\0"; + + lpCPInfoEx->CodePage = CP_UTF8; + lpCPInfoEx->UnicodeDefaultChar = 0x3f; + wcscpy(lpCPInfoEx->CodePageName, utf8); + } + + default: + { + PCODEPAGE_ENTRY CodePageEntry; + + CodePageEntry = IntGetCodePageEntry(CodePage); + if (CodePageEntry == NULL) + { + DPRINT1("Could not get CodePage Entry! CodePageEntry = 0\n"); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + lpCPInfoEx->CodePage = CodePageEntry->CodePageTable.CodePage; + lpCPInfoEx->UnicodeDefaultChar = CodePageEntry->CodePageTable.UniDefaultChar; + /* FIXME: We need to get a codepage name */ + DPRINT1("FIXME: We need to get a codepage name!\n"); + wcscpy(lpCPInfoEx->CodePageName, L"Unknown\0"); + } + break; + } + + return TRUE; +} + + +/* + * @implemented */ BOOL STDCALL -GetCPInfoExA( - UINT CodePage, - DWORD dwFlags, - LPCPINFOEXA lpCPInfoEx) -{ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return 0; +GetCPInfoExA(UINT CodePage, + DWORD dwFlags, + LPCPINFOEXA lpCPInfoEx) +{ + CPINFOEXW CPInfo; + + if (!GetCPInfoExW(CodePage, dwFlags, &CPInfo)) + return FALSE; + + /* the layout is the same except for CodePageName */ + memcpy(lpCPInfoEx, &CPInfo, sizeof(CPINFOEXA)); + + WideCharToMultiByte(CP_ACP, + 0, + CPInfo.CodePageName, + -1, + lpCPInfoEx->CodePageName, + sizeof(lpCPInfoEx->CodePageName), + NULL, + NULL); + return TRUE; } static int Modified: trunk/reactos/dll/win32/kernel32/misc/nls.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/misc/nl…
============================================================================== --- trunk/reactos/dll/win32/kernel32/misc/nls.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/misc/nls.c [iso-8859-1] Mon Nov 3 05:27:17 2008 @@ -20,15 +20,6 @@ /* GLOBAL VARIABLES ***********************************************************/ -typedef struct _CODEPAGE_ENTRY -{ - LIST_ENTRY Entry; - UINT CodePage; - HANDLE SectionHandle; - PBYTE SectionMapping; - CPTABLEINFO CodePageTable; -} CODEPAGE_ENTRY, *PCODEPAGE_ENTRY; - /* Sequence length based on the first character. */ static const char UTF8Length[128] = { @@ -185,7 +176,7 @@ * @return Code page entry. */ -static PCODEPAGE_ENTRY FASTCALL +PCODEPAGE_ENTRY FASTCALL IntGetCodePageEntry(UINT CodePage) { CHAR SectionName[40];
16 years, 1 month
1
0
0
0
[jimtabor] 37163: - Cleanup UnrealizeObject and set dvNumAxes in CreateFontIndirect.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Nov 3 02:39:08 2008 New Revision: 37163 URL:
http://svn.reactos.org/svn/reactos?rev=37163&view=rev
Log: - Cleanup UnrealizeObject and set dvNumAxes in CreateFontIndirect. Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c trunk/reactos/dll/win32/gdi32/objects/font.c trunk/reactos/subsystems/win32/win32k/objects/color.c Modified: trunk/reactos/dll/win32/gdi32/misc/stubs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/stubs…
============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/stubs.c [iso-8859-1] Mon Nov 3 02:39:08 2008 @@ -546,7 +546,19 @@ UnrealizeObject(HGDIOBJ hgdiobj) { BOOL retValue = TRUE; - +/* + Win 2k Graphics API, Black Book. by
coriolis.com
+ Page 62, Note that Steps 3, 5, and 6 are not required for Windows NT(tm) + and Windows 2000(tm). + + Step 5. UnrealizeObject(hTrackBrush); + */ +/* +
msdn.microsoft.com
, + "Windows 2000/XP: If hgdiobj is a brush, UnrealizeObject does nothing, + and the function returns TRUE. Use SetBrushOrgEx to set the origin of + a brush." + */ if (GDI_HANDLE_GET_TYPE(hgdiobj) != GDI_OBJECT_TYPE_BRUSH) { retValue = NtGdiUnrealizeObject(hgdiobj); Modified: trunk/reactos/dll/win32/gdi32/objects/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/fo…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] Mon Nov 3 02:39:08 2008 @@ -1355,6 +1355,8 @@ RtlZeroMemory( &Logfont.elfEnumLogfontEx.elfScript, sizeof(Logfont.elfEnumLogfontEx.elfScript)); + Logfont.elfDesignVector.dvNumAxes = 0; // No more than MM_MAX_NUMAXES + RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR)); return CreateFontIndirectExW(&Logfont); Modified: trunk/reactos/subsystems/win32/win32k/objects/color.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/color.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/color.c [iso-8859-1] Mon Nov 3 02:39:08 2008 @@ -685,52 +685,27 @@ return old; } -/* - Win 2k Graphics API, Black Book. by
coriolis.com
- Page 62, Note that Steps 3, 5, and 6 are not required for Windows NT(tm) - and Windows 2000(tm). - - Step 5. UnrealizeObject(hTrackBrush); - */ -BOOL STDCALL +BOOL +STDCALL NtGdiUnrealizeObject(HGDIOBJ hgdiobj) { - - POBJ pObject; - DWORD objectType; BOOL Ret = FALSE; - - /* From Wine: UnrealizeObject does not SetLastError() on a null object */ - if(!hgdiobj) - return Ret; - - pObject = GDIOBJ_LockObj(hgdiobj, GDI_OBJECT_TYPE_DONTCARE); - if (pObject == NULL) - { - SetLastWin32Error(ERROR_INVALID_HANDLE); + PPALGDI palGDI; + + if ( !hgdiobj || + ((UINT)hgdiobj & GDI_HANDLE_STOCK_MASK) || + !GDI_HANDLE_IS_TYPE(hgdiobj, GDI_OBJECT_TYPE_PALETTE) ) return Ret; - } - objectType = GDIOBJ_GetObjectType(hgdiobj); - switch(objectType) - { -/* -
msdn.microsoft.com
, - "Windows 2000/XP: If hgdiobj is a brush, UnrealizeObject does nothing, - and the function returns TRUE. Use SetBrushOrgEx to set the origin of - a brush." - */ - case GDI_OBJECT_TYPE_BRUSH: - { - DPRINT("GDI_OBJECT_TYPE_BRUSH\n"); - Ret = TRUE; - break; - } - default: - DPRINT1("Magic 0x%08x not implemented\n", objectType); - break; - } - - GDIOBJ_UnlockObjByPtr(pObject); + + palGDI = PALETTE_LockPalette(hgdiobj); + if (!palGDI) return FALSE; + + // FIXME!! + // Need to do something!!! + // Zero out Current and Old Translated pointers? + // + Ret = TRUE; + PALETTE_UnlockPalette(palGDI); return Ret; }
16 years, 1 month
1
0
0
0
[dchapyshev] 37162: - Implement HeapWalk (based on Wine)
by dchapyshev@svn.reactos.org
Author: dchapyshev Date: Mon Nov 3 02:37:50 2008 New Revision: 37162 URL:
http://svn.reactos.org/svn/reactos?rev=37162&view=rev
Log: - Implement HeapWalk (based on Wine) Modified: trunk/reactos/dll/win32/kernel32/mem/heap.c Modified: trunk/reactos/dll/win32/kernel32/mem/heap.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/mem/hea…
============================================================================== --- trunk/reactos/dll/win32/kernel32/mem/heap.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/mem/heap.c [iso-8859-1] Mon Nov 3 02:37:50 2008 @@ -251,16 +251,21 @@ } /* - * @unimplemented + * @implemented */ BOOL STDCALL -HeapWalk(HANDLE hHeap, +HeapWalk(HANDLE hHeap, LPPROCESS_HEAP_ENTRY lpEntry) { - /* Not implemented */ - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + NTSTATUS Status; + + Status = RtlWalkHeap(hHeap, lpEntry); + + if (Status) + SetLastError(RtlNtStatusToDosError(Status)); + + return !Status; } /* EOF */
16 years, 1 month
1
0
0
0
[jimtabor] 37161: - Fix C in RealizeFontInit.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Nov 3 01:04:04 2008 New Revision: 37161 URL:
http://svn.reactos.org/svn/reactos?rev=37161&view=rev
Log: - Fix C in RealizeFontInit. Modified: trunk/reactos/subsystems/win32/win32k/objects/font.c Modified: trunk/reactos/subsystems/win32/win32k/objects/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/font.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/font.c [iso-8859-1] Mon Nov 3 01:04:04 2008 @@ -64,7 +64,7 @@ pTextObj = TEXTOBJ_LockText(hFont); - if ( pTextObj && !pTextObj->fl & TEXTOBJECT_INIT) + if ( pTextObj && !(pTextObj->fl & TEXTOBJECT_INIT)) { Status = TextIntRealizeFont(hFont, pTextObj); if (!NT_SUCCESS(Status))
16 years, 1 month
1
0
0
0
[jimtabor] 37160: - Remove locking in gdi batch.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Mon Nov 3 00:52:42 2008 New Revision: 37160 URL:
http://svn.reactos.org/svn/reactos?rev=37160&view=rev
Log: - Remove locking in gdi batch. Modified: trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c Modified: trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c [iso-8859-1] Mon Nov 3 00:52:42 2008 @@ -64,7 +64,7 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr) { PDC_ATTR Dc_Attr = NULL; - UserEnterExclusive(); + if (dc) { Dc_Attr = dc->pDc_Attr; @@ -109,7 +109,7 @@ default: break; } - UserLeave(); + return pHdr->Size; // Return the full size of the structure. }
16 years, 1 month
1
0
0
0
[jimtabor] 37159: - Add new function for locking text font objects when realized. This is for batching support. - Batching works for selected fonts, due to a system initialization bug this is disabled. - Miscellaneous changes and updates.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Sun Nov 2 23:38:02 2008 New Revision: 37159 URL:
http://svn.reactos.org/svn/reactos?rev=37159&view=rev
Log: - Add new function for locking text font objects when realized. This is for batching support. - Batching works for selected fonts, due to a system initialization bug this is disabled. - Miscellaneous changes and updates. Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c trunk/reactos/subsystems/win32/win32k/include/text.h trunk/reactos/subsystems/win32/win32k/objects/dc.c trunk/reactos/subsystems/win32/win32k/objects/font.c trunk/reactos/subsystems/win32/win32k/objects/freetype.c trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c trunk/reactos/subsystems/win32/win32k/objects/text.c Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc…
============================================================================== --- trunk/reactos/dll/win32/gdi32/objects/dc.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/objects/dc.c [iso-8859-1] Sun Nov 2 23:38:02 2008 @@ -1535,7 +1535,7 @@ HGDIOBJ hGdiObj) { PDC_ATTR pDc_Attr; -// HGDIOBJ hOldObj = NULL; + HGDIOBJ hOldObj = NULL; // PTEB pTeb; if(!GdiGetHandleUserData(hDC, GDI_OBJECT_TYPE_DC, (PVOID)&pDc_Attr)) @@ -1580,10 +1580,15 @@ return NtGdiSelectPen(hDC, hGdiObj); case GDI_OBJECT_TYPE_FONT: + hOldObj = pDc_Attr->hlfntNew; + if (hOldObj == hGdiObj) return hOldObj; #if 0 + pDc_Attr->ulDirty_ &= ~SLOW_WIDTHS; + pDc_Attr->ulDirty_ |= DIRTY_CHARSET; + pDc_Attr->hlfntNew = hGdiObj; pTeb = NtCurrentTeb(); if (((pTeb->GdiTebBatch.HDC == 0) || - (pTeb->GdiTebBatch.HDC == (ULONG)hDC)) && + (pTeb->GdiTebBatch.HDC == hDC)) && ((pTeb->GdiTebBatch.Offset + sizeof(GDIBSOBJECT)) <= GDIBATCHBUFSIZE) && (!(pDc_Attr->ulDirty_ & DC_DIBSECTION))) { @@ -1594,14 +1599,15 @@ pgO->hgdiobj = hGdiObj; pTeb->GdiTebBatch.Offset += sizeof(GDIBSOBJECT); - pTeb->GdiTebBatch.HDC = (ULONG)hDC; + pTeb->GdiTebBatch.HDC = hDC; pTeb->GdiBatchCount++; if (pTeb->GdiBatchCount >= GDI_BatchLimit) NtGdiFlush(); - return pDc_Attr->hlfntNew; + return hOldObj; } #endif // default for select object font return NtGdiSelectFont(hDC, hGdiObj); + #if 0 case GDI_OBJECT_TYPE_METADC: return MFDRV_SelectObject( hDC, hGdiObj); Modified: trunk/reactos/subsystems/win32/win32k/include/text.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/text.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/text.h [iso-8859-1] Sun Nov 2 23:38:02 2008 @@ -54,6 +54,8 @@ ULONG acFaceNameGlyphs[8]; } STRGDI, *PSTRGDI; +#define TEXTOBJECT_INIT 0x00010000 + /* GDI logical font object */ typedef struct { @@ -62,9 +64,13 @@ BASEOBJECT BaseObject; LFTYPE lft; FLONG fl; - ENUMLOGFONTEXDVW logfont; //LOGFONTW logfont; FONTOBJ *Font; - BOOLEAN Initialized; /* Don't reinitialize for each DC */ + WCHAR FullName[LF_FULLFACESIZE]; + WCHAR Style[LF_FACESIZE]; + WCHAR FaceName[LF_FACESIZE]; + DWORD dwOffsetEndArray; +// Fixed: + ENUMLOGFONTEXDVW logfont; } TEXTOBJ, *PTEXTOBJ; /* Internal interface */ @@ -76,7 +82,8 @@ #define TEXTOBJ_LockText(hBMObj) ((PTEXTOBJ) GDIOBJ_LockObj ((HGDIOBJ) hBMObj, GDI_OBJECT_TYPE_FONT)) #define TEXTOBJ_UnlockText(pBMObj) GDIOBJ_UnlockObjByPtr ((POBJ)pBMObj) -NTSTATUS FASTCALL TextIntRealizeFont(HFONT FontHandle); +PTEXTOBJ FASTCALL RealizeFontInit(HFONT); +NTSTATUS FASTCALL TextIntRealizeFont(HFONT,PTEXTOBJ); NTSTATUS FASTCALL TextIntCreateFontIndirect(CONST LPLOGFONTW lf, HFONT *NewFont); BOOL FASTCALL InitFontSupport(VOID); BOOL FASTCALL IntIsFontRenderingEnabled(VOID); Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Sun Nov 2 23:38:02 2008 @@ -2216,7 +2216,7 @@ if(!pDc_Attr) pDc_Attr = &pDC->Dc_Attr; /* FIXME: what if not successful? */ - if(NT_SUCCESS(TextIntRealizeFont((HFONT)hFont))) + if(NT_SUCCESS(TextIntRealizeFont((HFONT)hFont,NULL))) { hOrgFont = pDc_Attr->hlfntNew; pDc_Attr->hlfntNew = hFont; @@ -2668,7 +2668,7 @@ Dc_Attr->hpen = NtGdiGetStockObject( BLACK_PEN ); //// Dc_Attr->hlfntNew = NtGdiGetStockObject(SYSTEM_FONT); - TextIntRealizeFont(Dc_Attr->hlfntNew); + TextIntRealizeFont(Dc_Attr->hlfntNew,NULL); NewDC->DcLevel.hpal = NtGdiGetStockObject(DEFAULT_PALETTE); NewDC->DcLevel.laPath.eMiterLimit = 10.0; Modified: trunk/reactos/subsystems/win32/win32k/objects/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/font.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/font.c [iso-8859-1] Sun Nov 2 23:38:02 2008 @@ -55,6 +55,27 @@ return Count; } +PTEXTOBJ +FASTCALL +RealizeFontInit(HFONT hFont) +{ + NTSTATUS Status = STATUS_SUCCESS; + PTEXTOBJ pTextObj; + + pTextObj = TEXTOBJ_LockText(hFont); + + if ( pTextObj && !pTextObj->fl & TEXTOBJECT_INIT) + { + Status = TextIntRealizeFont(hFont, pTextObj); + if (!NT_SUCCESS(Status)) + { + TEXTOBJ_UnlockText(pTextObj); + return NULL; + } + } + return pTextObj; +} + /** Functions ******************************************************************/ INT @@ -146,7 +167,7 @@ if(!Dc_Attr) Dc_Attr = &Dc->Dc_Attr; hFont = Dc_Attr->hlfntNew; - TextObj = TEXTOBJ_LockText(hFont); + TextObj = RealizeFontInit(hFont); DC_UnlockDc(Dc); if (TextObj == NULL) @@ -193,7 +214,7 @@ if(!Dc_Attr) Dc_Attr = &pDc->Dc_Attr; hFont = Dc_Attr->hlfntNew; - TextObj = TEXTOBJ_LockText(hFont); + TextObj = RealizeFontInit(hFont); if ( TextObj == NULL) { @@ -363,7 +384,7 @@ Dc_Attr = dc->pDc_Attr; if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; hFont = Dc_Attr->hlfntNew; - TextObj = TEXTOBJ_LockText(hFont); + TextObj = RealizeFontInit(hFont); DC_UnlockDc(dc); if (TextObj == NULL) { @@ -543,7 +564,7 @@ } hNewFont = TextObj->BaseObject.hHmgr; - TextObj->lft = cjElfw; + TextObj->lft = lft; TextObj->fl = fl; RtlCopyMemory (&TextObj->logfont, &SafeLogfont, sizeof(ENUMLOGFONTEXDVW)); Modified: trunk/reactos/subsystems/win32/win32k/objects/freetype.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/freetype.c [iso-8859-1] Sun Nov 2 23:38:02 2008 @@ -1488,7 +1488,7 @@ eM11 = xForm.eM11; hFont = Dc_Attr->hlfntNew; - TextObj = TEXTOBJ_LockText(hFont); + TextObj = RealizeFontInit(hFont); if (!TextObj) { @@ -2249,7 +2249,7 @@ Dc_Attr = Dc->pDc_Attr; if(!Dc_Attr) Dc_Attr = &Dc->Dc_Attr; hFont = Dc_Attr->hlfntNew; - TextObj = TEXTOBJ_LockText(hFont); + TextObj = RealizeFontInit(hFont); if ( TextObj == NULL) { @@ -2465,7 +2465,7 @@ } Dc_Attr = dc->pDc_Attr; if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - TextObj = TEXTOBJ_LockText(Dc_Attr->hlfntNew); + TextObj = RealizeFontInit(Dc_Attr->hlfntNew); if (NULL != TextObj) { FontGDI = ObjToGDI(TextObj->Font, FONT); @@ -2743,7 +2743,7 @@ NTSTATUS FASTCALL -TextIntRealizeFont(HFONT FontHandle) +TextIntRealizeFont(HFONT FontHandle, PTEXTOBJ pTextObj) { NTSTATUS Status = STATUS_SUCCESS; PTEXTOBJ TextObj; @@ -2751,21 +2751,26 @@ PW32PROCESS Win32Process; UINT MatchScore; - TextObj = TEXTOBJ_LockText(FontHandle); - if (NULL == TextObj) - { - return STATUS_INVALID_HANDLE; - } - - if (TextObj->Initialized) - { - TEXTOBJ_UnlockText(TextObj); - return STATUS_SUCCESS; - } + if (!pTextObj) + { + TextObj = TEXTOBJ_LockText(FontHandle); + if (NULL == TextObj) + { + return STATUS_INVALID_HANDLE; + } + + if (TextObj->fl & TEXTOBJECT_INIT) + { + TEXTOBJ_UnlockText(TextObj); + return STATUS_SUCCESS; + } + } + else + TextObj = pTextObj; if (! RtlCreateUnicodeString(&FaceName, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName)) { - TEXTOBJ_UnlockText(TextObj); + if (!pTextObj) TEXTOBJ_UnlockText(TextObj); return STATUS_NO_MEMORY; } SubstituteFontFamily(&FaceName, 0); @@ -2803,12 +2808,12 @@ FontGdi->flRealizedType = 0; FontGdi->Underline = TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfUnderline ? 0xff : 0; FontGdi->StrikeOut = TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfStrikeOut ? 0xff : 0; - TextObj->Initialized = TRUE; + TextObj->fl |= TEXTOBJECT_INIT; Status = STATUS_SUCCESS; } RtlFreeUnicodeString(&FaceName); - TEXTOBJ_UnlockText(TextObj); + if (!pTextObj) TEXTOBJ_UnlockText(TextObj); ASSERT((NT_SUCCESS(Status) ^ (NULL == TextObj->Font)) != 0); @@ -3040,7 +3045,7 @@ } -//////////////// +////////////////// // // Functions needing sorting. // @@ -3343,7 +3348,7 @@ } } - TextObj = TEXTOBJ_LockText(Dc_Attr->hlfntNew); + TextObj = RealizeFontInit(Dc_Attr->hlfntNew); if(TextObj == NULL) { goto fail; @@ -3796,7 +3801,7 @@ Dc_Attr = dc->pDc_Attr; if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; hFont = Dc_Attr->hlfntNew; - TextObj = TEXTOBJ_LockText(hFont); + TextObj = RealizeFontInit(hFont); DC_UnlockDc(dc); if (TextObj == NULL) @@ -3964,7 +3969,7 @@ Dc_Attr = dc->pDc_Attr; if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; hFont = Dc_Attr->hlfntNew; - TextObj = TEXTOBJ_LockText(hFont); + TextObj = RealizeFontInit(hFont); DC_UnlockDc(dc); if (TextObj == NULL) @@ -4076,7 +4081,7 @@ Dc_Attr = dc->pDc_Attr; if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; hFont = Dc_Attr->hlfntNew; - TextObj = TEXTOBJ_LockText(hFont); + TextObj = RealizeFontInit(hFont); DC_UnlockDc(dc); if (!TextObj) { Modified: trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c [iso-8859-1] Sun Nov 2 23:38:02 2008 @@ -64,6 +64,7 @@ GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr) { PDC_ATTR Dc_Attr = NULL; + UserEnterExclusive(); if (dc) { Dc_Attr = dc->pDc_Attr; @@ -95,8 +96,8 @@ PGDIBSOBJECT pgO; if(!dc) break; pgO = (PGDIBSOBJECT) pHdr; - if(NT_SUCCESS(TextIntRealizeFont((HFONT) pgO->hgdiobj))) - Dc_Attr->hlfntNew = (HFONT) pgO->hgdiobj; + TextIntRealizeFont((HFONT) pgO->hgdiobj, NULL); + Dc_Attr->ulDirty_ &= ~(DIRTY_CHARSET); } case GdiBCDelObj: case GdiBCDelRgn: @@ -108,7 +109,7 @@ default: break; } - + UserLeave(); return pHdr->Size; // Return the full size of the structure. } Modified: trunk/reactos/subsystems/win32/win32k/objects/text.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
============================================================================== --- trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/objects/text.c [iso-8859-1] Sun Nov 2 23:38:02 2008 @@ -209,7 +209,7 @@ } Dc_Attr = dc->pDc_Attr; if(!Dc_Attr) Dc_Attr = &dc->Dc_Attr; - TextObj = TEXTOBJ_LockText(Dc_Attr->hlfntNew); + TextObj = RealizeFontInit(Dc_Attr->hlfntNew); if ( TextObj ) { Result = TextIntGetTextExtentPoint(dc, TextObj, String, Count, MaxExtent, @@ -339,7 +339,7 @@ hFont = Dc_Attr->hlfntNew; DC_UnlockDc(Dc); - TextObj = TEXTOBJ_LockText(hFont); + TextObj = RealizeFontInit(hFont); ASSERT(TextObj != NULL); Count = min(Count, wcslen(TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName)); Status = MmCopyToCaller(FaceName, TextObj->logfont.elfEnumLogfontEx.elfLogFont.lfFaceName, Count * sizeof(WCHAR));
16 years, 1 month
1
0
0
0
← Newer
1
...
59
60
61
62
63
64
65
66
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Results per page:
10
25
50
100
200