winehq.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
2025
July
June
May
April
March
February
January
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
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
July 2021
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 2025
February 2025
January 2025
----- 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
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
728 discussions
Start a n
N
ew thread
Jacek Caban : gdi32: Use NtGdiInvertRgn for InvertRgn implementation.
by Alexandre Julliard
26 Jul '21
26 Jul '21
Module: wine Branch: master Commit: 23f6b8b47371302f1fafb4fa7ba5d5034ef1b1c4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=23f6b8b47371302f1fafb4fa…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jul 25 10:57:12 2021 +0200 gdi32: Use NtGdiInvertRgn for InvertRgn implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/enhmfdrv/graphics.c | 17 +++++++++++++---- dlls/gdi32/gdi_private.h | 2 ++ dlls/gdi32/gdidc.c | 15 +++++++++++++++ dlls/gdi32/mfdrv/graphics.c | 10 ++++++---- dlls/gdi32/mfdrv/init.c | 2 +- dlls/gdi32/mfdrv/metafiledrv.h | 1 - dlls/gdi32/painting.c | 6 ++---- 7 files changed, 39 insertions(+), 14 deletions(-) diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c index aba44bc5215..2b61b706560 100644 --- a/dlls/gdi32/enhmfdrv/graphics.c +++ b/dlls/gdi32/enhmfdrv/graphics.c @@ -902,11 +902,11 @@ BOOL CDECL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, IN } /********************************************************************* - * EMFDRV_PaintInvertRgn + * EMF_PaintInvertRgn * * Helper for EMFDRV_{Paint|Invert}Rgn */ -static BOOL EMFDRV_PaintInvertRgn( PHYSDEV dev, HRGN hrgn, DWORD iType ) +static BOOL EMF_PaintInvertRgn( PHYSDEV dev, HRGN hrgn, DWORD iType ) { EMRINVERTRGN *emr; DWORD size, rgnsize; @@ -939,15 +939,24 @@ static BOOL EMFDRV_PaintInvertRgn( PHYSDEV dev, HRGN hrgn, DWORD iType ) */ BOOL EMFDC_PaintRgn( DC_ATTR *dc_attr, HRGN hrgn ) { - return EMFDRV_PaintInvertRgn( dc_attr->emf, hrgn, EMR_PAINTRGN ); + return EMF_PaintInvertRgn( dc_attr->emf, hrgn, EMR_PAINTRGN ); } /********************************************************************** + * EMF_InvertRgn + */ +BOOL EMFDC_InvertRgn( DC_ATTR *dc_attr, HRGN hrgn ) +{ + return EMF_PaintInvertRgn( dc_attr->emf, hrgn, EMR_INVERTRGN ); +} + +/********************************************************************* * EMFDRV_InvertRgn */ BOOL CDECL EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) { - return EMFDRV_PaintInvertRgn( dev, hrgn, EMR_INVERTRGN ); + /* FIXME: update bounding rect */ + return TRUE; } /********************************************************************** diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index c3093d56d2d..378d85a0c19 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -51,6 +51,7 @@ extern BOOL METADC_ExtTextOut( HDC hdc, INT x, INT y, UINT flags, const RECT *re const WCHAR *str, UINT count, const INT *dx ) DECLSPEC_HIDDEN; extern BOOL METADC_FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; extern BOOL METADC_FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL METADC_InvertRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL METADC_LineTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_MoveTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_PaintRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN; @@ -82,6 +83,7 @@ extern BOOL EMFDC_ExtTextOut( DC_ATTR *dc_attr, INT x, INT y, UINT flags, const extern BOOL EMFDC_FillRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; extern BOOL EMFDC_FrameRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush, INT width, INT height ) DECLSPEC_HIDDEN; +extern BOOL EMFDC_InvertRgn( DC_ATTR *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL EMFDC_LineTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_MoveTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_PaintRgn( DC_ATTR *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index 094074291cf..64a5cb06ff0 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -428,6 +428,21 @@ BOOL WINAPI FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT width, INT height ) return NtGdiFrameRgn( hdc, hrgn, hbrush, width, height ); } +/*********************************************************************** + * InvertRgn (GDI32.@) + */ +BOOL WINAPI InvertRgn( HDC hdc, HRGN hrgn ) +{ + DC_ATTR *dc_attr; + + TRACE( "%p, %p\n", hdc, hrgn ); + + if (is_meta_dc( hdc )) return METADC_InvertRgn( hdc, hrgn ); + if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + if (dc_attr->emf && !EMFDC_InvertRgn( dc_attr, hrgn )) return FALSE; + return NtGdiInvertRgn( hdc, hrgn ); +} + /*********************************************************************** * ExtTextOutW (GDI32.@) */ diff --git a/dlls/gdi32/mfdrv/graphics.c b/dlls/gdi32/mfdrv/graphics.c index 6d6e61f8da6..a240f193a52 100644 --- a/dlls/gdi32/mfdrv/graphics.c +++ b/dlls/gdi32/mfdrv/graphics.c @@ -369,15 +369,17 @@ BOOL METADC_PaintRgn( HDC hdc, HRGN hrgn ) /********************************************************************** - * MFDRV_InvertRgn + * METADC_InvertRgn */ -BOOL CDECL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) +BOOL METADC_InvertRgn( HDC hdc, HRGN hrgn ) { + METAFILEDRV_PDEVICE *mf; INT16 index; - index = MFDRV_CreateRegion( dev, hrgn ); + if (!(mf = get_metadc_ptr( hdc ))) return FALSE; + index = MFDRV_CreateRegion( &mf->dev, hrgn ); if(index == -1) return FALSE; - return MFDRV_MetaParam1( dev, META_INVERTREGION, index ); + return MFDRV_MetaParam1( &mf->dev, META_INVERTREGION, index ); } diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index b4859507e5d..877f19ed1d7 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -158,7 +158,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs = NULL, /* pGetTextMetrics */ NULL, /* pGradientFill */ MFDRV_IntersectClipRect, /* pIntersectClipRect */ - MFDRV_InvertRgn, /* pInvertRgn */ + NULL, /* pInvertRgn */ NULL, /* pLineTo */ NULL, /* pModifyWorldTransform */ NULL, /* pMoveTo */ diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h index 7902574e136..214de5c52ad 100644 --- a/dlls/gdi32/mfdrv/metafiledrv.h +++ b/dlls/gdi32/mfdrv/metafiledrv.h @@ -86,7 +86,6 @@ extern BOOL CDECL MFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN; extern INT CDECL MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; -extern BOOL CDECL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; extern INT CDECL MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index 109f11aeba8..61d1505965d 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -509,16 +509,14 @@ BOOL WINAPI NtGdiFrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT width, INT hei /*********************************************************************** - * InvertRgn (GDI32.@) + * NtGdiInvertRgn (win32u.@) */ -BOOL WINAPI InvertRgn( HDC hdc, HRGN hrgn ) +BOOL WINAPI NtGdiInvertRgn( HDC hdc, HRGN hrgn ) { PHYSDEV physdev; BOOL ret; DC *dc = get_dc_ptr( hdc ); - TRACE( "%p, %p\n", hdc, hrgn ); - if (!dc) return FALSE; update_dc( dc ); physdev = GET_DC_PHYSDEV( dc, pInvertRgn );
1
0
0
0
Jacek Caban : gdi32: Use NtGdiFrameRgn for FrameRgn implementation.
by Alexandre Julliard
26 Jul '21
26 Jul '21
Module: wine Branch: master Commit: a4a27e5846b261789c6423a7fa7ee2a9169cc243 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a4a27e5846b261789c6423a7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jul 25 10:56:56 2021 +0200 gdi32: Use NtGdiFrameRgn for FrameRgn implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/enhmfdrv/graphics.c | 20 +++++++++++++++----- dlls/gdi32/gdi_private.h | 3 +++ dlls/gdi32/gdidc.c | 16 ++++++++++++++++ dlls/gdi32/mfdrv/graphics.c | 13 ++++++++----- dlls/gdi32/mfdrv/init.c | 2 +- dlls/gdi32/mfdrv/metafiledrv.h | 1 - dlls/gdi32/painting.c | 9 +++------ 7 files changed, 46 insertions(+), 18 deletions(-) diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c index 64b85c44cb1..aba44bc5215 100644 --- a/dlls/gdi32/enhmfdrv/graphics.c +++ b/dlls/gdi32/enhmfdrv/graphics.c @@ -856,15 +856,16 @@ BOOL CDECL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) /********************************************************************* - * EMFDRV_FrameRgn + * EMFDC_FrameRgn */ -BOOL CDECL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, INT height ) +BOOL EMFDC_FrameRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush, INT width, INT height ) { + EMFDRV_PDEVICE *emf = dc_attr->emf; EMRFRAMERGN *emr; DWORD size, rgnsize, index; BOOL ret; - index = EMFDRV_CreateBrushIndirect( dev, hbrush ); + index = EMFDRV_CreateBrushIndirect( &emf->dev, hbrush ); if(!index) return FALSE; rgnsize = NtGdiGetRegionData( hrgn, 0, NULL ); @@ -884,13 +885,22 @@ BOOL CDECL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, IN emr->szlStroke.cx = width; emr->szlStroke.cy = height; - ret = EMFDRV_WriteRecord( dev, &emr->emr ); + ret = EMFDRV_WriteRecord( &emf->dev, &emr->emr ); if(ret) - EMFDRV_UpdateBBox( dev, &emr->rclBounds ); + EMFDRV_UpdateBBox( &emf->dev, &emr->rclBounds ); HeapFree( GetProcessHeap(), 0, emr ); return ret; } +/********************************************************************* + * EMFDRV_FrameRgn + */ +BOOL CDECL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, INT height ) +{ + /* FIXME: update bounding rect */ + return TRUE; +} + /********************************************************************* * EMFDRV_PaintInvertRgn * diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index fcf0a1647b3..c3093d56d2d 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -50,6 +50,7 @@ extern BOOL METADC_Ellipse( HDC hdc, INT left, INT top, INT right, INT bottom ) extern BOOL METADC_ExtTextOut( HDC hdc, INT x, INT y, UINT flags, const RECT *rect, const WCHAR *str, UINT count, const INT *dx ) DECLSPEC_HIDDEN; extern BOOL METADC_FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; +extern BOOL METADC_FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_LineTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_MoveTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_PaintRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN; @@ -79,6 +80,8 @@ extern BOOL EMFDC_EndPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN; extern BOOL EMFDC_ExtTextOut( DC_ATTR *dc_attr, INT x, INT y, UINT flags, const RECT *rect, const WCHAR *str, UINT count, const INT *dx ) DECLSPEC_HIDDEN; extern BOOL EMFDC_FillRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; +extern BOOL EMFDC_FrameRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush, INT width, + INT height ) DECLSPEC_HIDDEN; extern BOOL EMFDC_LineTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_MoveTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_PaintRgn( DC_ATTR *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index 7ba1aecdca1..094074291cf 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -412,6 +412,22 @@ BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn ) return NtGdiFillRgn( hdc, hrgn, GetCurrentObject( hdc, OBJ_BRUSH )); } +/*********************************************************************** + * FrameRgn (GDI32.@) + */ +BOOL WINAPI FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT width, INT height ) +{ + DC_ATTR *dc_attr; + + TRACE( "%p, %p, %p, %dx%d\n", hdc, hrgn, hbrush, width, height ); + + if (is_meta_dc( hdc )) return METADC_FrameRgn( hdc, hrgn, hbrush, width, height ); + if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + if (dc_attr->emf && !EMFDC_FrameRgn( dc_attr, hrgn, hbrush, width, height )) + return FALSE; + return NtGdiFrameRgn( hdc, hrgn, hbrush, width, height ); +} + /*********************************************************************** * ExtTextOutW (GDI32.@) */ diff --git a/dlls/gdi32/mfdrv/graphics.c b/dlls/gdi32/mfdrv/graphics.c index dcfc481119f..6d6e61f8da6 100644 --- a/dlls/gdi32/mfdrv/graphics.c +++ b/dlls/gdi32/mfdrv/graphics.c @@ -409,18 +409,21 @@ BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) } /********************************************************************** - * MFDRV_FrameRgn + * METADC_FrameRgn */ -BOOL CDECL MFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) +BOOL METADC_FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) { + METAFILEDRV_PDEVICE *mf; INT16 iRgn, iBrush; - iRgn = MFDRV_CreateRegion( dev, hrgn ); + + if (!(mf = get_metadc_ptr( hdc ))) return FALSE; + iRgn = MFDRV_CreateRegion( &mf->dev, hrgn ); if(iRgn == -1) return FALSE; - iBrush = MFDRV_CreateBrushIndirect( dev, hbrush ); + iBrush = MFDRV_CreateBrushIndirect( &mf->dev, hbrush ); if(!iBrush) return FALSE; - return MFDRV_MetaParam4( dev, META_FRAMEREGION, iRgn, iBrush, x, y ); + return MFDRV_MetaParam4( &mf->dev, META_FRAMEREGION, iRgn, iBrush, x, y ); } diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index c40f892a9a1..b4859507e5d 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -130,7 +130,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs = MFDRV_FillRgn, /* pFillRgn */ MFDRV_FlattenPath, /* pFlattenPath */ NULL, /* pFontIsLinked */ - MFDRV_FrameRgn, /* pFrameRgn */ + NULL, /* pFrameRgn */ NULL, /* pGdiComment */ MFDRV_GetBoundsRect, /* pGetBoundsRect */ NULL, /* pGetCharABCWidths */ diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h index 09c9b793e43..7902574e136 100644 --- a/dlls/gdi32/mfdrv/metafiledrv.h +++ b/dlls/gdi32/mfdrv/metafiledrv.h @@ -85,7 +85,6 @@ extern INT CDECL MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) DEC extern BOOL CDECL MFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL CDECL MFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) DECLSPEC_HIDDEN; extern INT CDECL MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; extern INT CDECL MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index 6ff24f622c7..109f11aeba8 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -491,21 +491,18 @@ BOOL WINAPI NtGdiFillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) /*********************************************************************** - * FrameRgn (GDI32.@) + * NtGdiFrameRgn (win32u.@) */ -BOOL WINAPI FrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, - INT nWidth, INT nHeight ) +BOOL WINAPI NtGdiFrameRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush, INT width, INT height ) { PHYSDEV physdev; BOOL ret; DC *dc = get_dc_ptr( hdc ); - TRACE( "%p, %p, %p, %dx%d\n", hdc, hrgn, hbrush, nWidth, nHeight ); - if (!dc) return FALSE; update_dc( dc ); physdev = GET_DC_PHYSDEV( dc, pFrameRgn ); - ret = physdev->funcs->pFrameRgn( physdev, hrgn, hbrush, nWidth, nHeight ); + ret = physdev->funcs->pFrameRgn( physdev, hrgn, hbrush, width, height ); release_dc_ptr( dc ); return ret; }
1
0
0
0
Jacek Caban : gdi32: Use NtGdiFillRgn for PaintRgn implementation.
by Alexandre Julliard
26 Jul '21
26 Jul '21
Module: wine Branch: master Commit: a3a5c7048fca8a489f5f903478a1c9e404248fbd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a3a5c7048fca8a489f5f9034…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jul 25 10:56:36 2021 +0200 gdi32: Use NtGdiFillRgn for PaintRgn implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/enhmfdrv/enhmetafiledrv.h | 1 - dlls/gdi32/enhmfdrv/graphics.c | 6 +++--- dlls/gdi32/enhmfdrv/init.c | 2 +- dlls/gdi32/gdi_private.h | 2 ++ dlls/gdi32/gdidc.c | 15 +++++++++++++++ dlls/gdi32/mfdrv/graphics.c | 10 ++++++---- dlls/gdi32/mfdrv/init.c | 2 +- dlls/gdi32/mfdrv/metafiledrv.h | 2 -- dlls/gdi32/painting.c | 27 +++------------------------ 9 files changed, 31 insertions(+), 36 deletions(-) diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h index e9ef3159888..fd2f85ba1d1 100644 --- a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h +++ b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h @@ -90,7 +90,6 @@ extern BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xfo extern INT CDECL EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; -extern BOOL CDECL EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN; extern BOOL CDECL EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c index eadf9a1a4b9..64b85c44cb1 100644 --- a/dlls/gdi32/enhmfdrv/graphics.c +++ b/dlls/gdi32/enhmfdrv/graphics.c @@ -925,11 +925,11 @@ static BOOL EMFDRV_PaintInvertRgn( PHYSDEV dev, HRGN hrgn, DWORD iType ) } /********************************************************************** - * EMFDRV_PaintRgn + * EMFDC_PaintRgn */ -BOOL CDECL EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) +BOOL EMFDC_PaintRgn( DC_ATTR *dc_attr, HRGN hrgn ) { - return EMFDRV_PaintInvertRgn( dev, hrgn, EMR_PAINTRGN ); + return EMFDRV_PaintInvertRgn( dc_attr->emf, hrgn, EMR_PAINTRGN ); } /********************************************************************** diff --git a/dlls/gdi32/enhmfdrv/init.c b/dlls/gdi32/enhmfdrv/init.c index b57bb2d2f64..ad5e05a534d 100644 --- a/dlls/gdi32/enhmfdrv/init.c +++ b/dlls/gdi32/enhmfdrv/init.c @@ -102,7 +102,7 @@ static const struct gdi_dc_funcs emfdrv_driver = EMFDRV_OffsetClipRgn, /* pOffsetClipRgn */ EMFDRV_OffsetViewportOrgEx, /* pOffsetViewportOrgEx */ EMFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */ - EMFDRV_PaintRgn, /* pPaintRgn */ + NULL, /* pPaintRgn */ EMFDRV_PatBlt, /* pPatBlt */ EMFDRV_Pie, /* pPie */ EMFDRV_PolyBezier, /* pPolyBezier */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 5714aee0099..fcf0a1647b3 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -52,6 +52,7 @@ extern BOOL METADC_ExtTextOut( HDC hdc, INT x, INT y, UINT flags, const RECT *re extern BOOL METADC_FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; extern BOOL METADC_LineTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_MoveTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL METADC_PaintRgn( HDC hdc, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL METADC_Pie( HDC hdc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN; extern BOOL METADC_PolyPolygon( HDC hdc, const POINT *points, const INT *counts, @@ -80,6 +81,7 @@ extern BOOL EMFDC_ExtTextOut( DC_ATTR *dc_attr, INT x, INT y, UINT flags, const extern BOOL EMFDC_FillRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; extern BOOL EMFDC_LineTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_MoveTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL EMFDC_PaintRgn( DC_ATTR *dc_attr, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL EMFDC_PolyBezier( DC_ATTR *dc_attr, const POINT *points, DWORD count ) DECLSPEC_HIDDEN; extern BOOL EMFDC_PolyBezierTo( DC_ATTR *dc_attr, const POINT *points, DWORD count ) DECLSPEC_HIDDEN; extern BOOL EMFDC_PolyDraw( DC_ATTR *dc_attr, const POINT *points, const BYTE *types, diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index 956326b7c14..7ba1aecdca1 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -397,6 +397,21 @@ BOOL WINAPI FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) return NtGdiFillRgn( hdc, hrgn, hbrush ); } +/*********************************************************************** + * PaintRgn (GDI32.@) + */ +BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn ) +{ + DC_ATTR *dc_attr; + + TRACE( "%p, %p\n", hdc, hrgn ); + + if (is_meta_dc( hdc )) return METADC_PaintRgn( hdc, hrgn ); + if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + if (dc_attr->emf && !EMFDC_PaintRgn( dc_attr, hrgn )) return FALSE; + return NtGdiFillRgn( hdc, hrgn, GetCurrentObject( hdc, OBJ_BRUSH )); +} + /*********************************************************************** * ExtTextOutW (GDI32.@) */ diff --git a/dlls/gdi32/mfdrv/graphics.c b/dlls/gdi32/mfdrv/graphics.c index 56f93aa860d..dcfc481119f 100644 --- a/dlls/gdi32/mfdrv/graphics.c +++ b/dlls/gdi32/mfdrv/graphics.c @@ -354,15 +354,17 @@ static INT16 MFDRV_CreateRegion(PHYSDEV dev, HRGN hrgn) /********************************************************************** - * MFDRV_PaintRgn + * METADC_PaintRgn */ -BOOL CDECL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) +BOOL METADC_PaintRgn( HDC hdc, HRGN hrgn ) { + METAFILEDRV_PDEVICE *mf; INT16 index; - index = MFDRV_CreateRegion( dev, hrgn ); + if (!(mf = get_metadc_ptr( hdc ))) return FALSE; + index = MFDRV_CreateRegion( &mf->dev, hrgn ); if(index == -1) return FALSE; - return MFDRV_MetaParam1( dev, META_PAINTREGION, index ); + return MFDRV_MetaParam1( &mf->dev, META_PAINTREGION, index ); } diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 5d32c5563de..c40f892a9a1 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -165,7 +165,7 @@ static const struct gdi_dc_funcs MFDRV_Funcs = MFDRV_OffsetClipRgn, /* pOffsetClipRgn */ MFDRV_OffsetViewportOrgEx, /* pOffsetViewportOrgEx */ MFDRV_OffsetWindowOrgEx, /* pOffsetWindowOrgEx */ - MFDRV_PaintRgn, /* pPaintRgn */ + NULL, /* pPaintRgn */ MFDRV_PatBlt, /* pPatBlt */ NULL, /* pPie */ MFDRV_PolyBezier, /* pPolyBezier */ diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h index 9809f3e2a11..09c9b793e43 100644 --- a/dlls/gdi32/mfdrv/metafiledrv.h +++ b/dlls/gdi32/mfdrv/metafiledrv.h @@ -91,7 +91,6 @@ extern BOOL CDECL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; extern INT CDECL MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_OffsetViewportOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_OffsetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; -extern BOOL CDECL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_PolyBezier( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_PolyBezierTo( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN; @@ -127,7 +126,6 @@ extern BOOL CDECL MFDRV_SetWindowExtEx( PHYSDEV dev, INT x, INT y, SIZE *size ) extern BOOL CDECL MFDRV_SetWindowOrgEx( PHYSDEV dev, INT x, INT y, POINT *pt ) DECLSPEC_HIDDEN; extern BOOL CDECL MFDRV_StretchBlt( PHYSDEV devDst, struct bitblt_coords *dst, PHYSDEV devSrc, struct bitblt_coords *src, DWORD rop ) DECLSPEC_HIDDEN; -extern BOOL CDECL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; extern INT CDECL MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx, DWORD cy, INT xSrc, INT ySrc, UINT startscan, UINT lines, LPCVOID bits, diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index eb537a44574..6ff24f622c7 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -76,7 +76,8 @@ BOOL CDECL nulldrv_FillRgn( PHYSDEV dev, HRGN rgn, HBRUSH brush ) if ((prev = NtGdiSelectBrush( dev->hdc, brush ))) { - ret = PaintRgn( dev->hdc, rgn ); + PHYSDEV physdev = GET_DC_PHYSDEV( get_physdev_dc( dev ), pPaintRgn ); + ret = physdev->funcs->pPaintRgn( physdev, rgn ); NtGdiSelectBrush( dev->hdc, prev ); } return ret; @@ -98,10 +99,8 @@ BOOL CDECL nulldrv_FrameRgn( PHYSDEV dev, HRGN rgn, HBRUSH brush, INT width, INT BOOL CDECL nulldrv_InvertRgn( PHYSDEV dev, HRGN rgn ) { - HBRUSH prev_brush = NtGdiSelectBrush( dev->hdc, GetStockObject(BLACK_BRUSH) ); INT prev_rop = SetROP2( dev->hdc, R2_NOT ); - BOOL ret = PaintRgn( dev->hdc, rgn ); - NtGdiSelectBrush( dev->hdc, prev_brush ); + BOOL ret = NtGdiFillRgn( dev->hdc, rgn, GetStockObject(BLACK_BRUSH) ); SetROP2( dev->hdc, prev_rop ); return ret; } @@ -473,26 +472,6 @@ BOOL WINAPI NtGdiSwapBuffers( HDC hdc ) } -/*********************************************************************** - * PaintRgn (GDI32.@) - */ -BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn ) -{ - PHYSDEV physdev; - BOOL ret; - DC * dc = get_dc_ptr( hdc ); - - TRACE( "%p, %p\n", hdc, hrgn ); - - if (!dc) return FALSE; - update_dc( dc ); - physdev = GET_DC_PHYSDEV( dc, pPaintRgn ); - ret = physdev->funcs->pPaintRgn( physdev, hrgn ); - release_dc_ptr( dc ); - return ret; -} - - /*********************************************************************** * NtGdiFillRgn (win32u.@) */
1
0
0
0
Jacek Caban : gdi32: Use NtGdiFillRgn for FillRgn implementation.
by Alexandre Julliard
26 Jul '21
26 Jul '21
Module: wine Branch: master Commit: d552d7ef68d1593244e06a85df1be23f842b58c2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d552d7ef68d1593244e06a85…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jul 25 10:56:11 2021 +0200 gdi32: Use NtGdiFillRgn for FillRgn implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/enhmfdrv/graphics.c | 23 ++++++++++++++++++----- dlls/gdi32/gdi_private.h | 2 ++ dlls/gdi32/gdidc.c | 15 +++++++++++++++ dlls/gdi32/mfdrv/graphics.c | 22 +++++++++++++++++----- dlls/gdi32/mfdrv/init.c | 2 +- dlls/gdi32/mfdrv/metafiledrv.h | 1 + dlls/gdi32/painting.c | 9 ++++----- 7 files changed, 58 insertions(+), 16 deletions(-) diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c index fcaf432b57e..eadf9a1a4b9 100644 --- a/dlls/gdi32/enhmfdrv/graphics.c +++ b/dlls/gdi32/enhmfdrv/graphics.c @@ -810,15 +810,16 @@ BOOL CDECL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT /********************************************************************* - * EMFDRV_FillRgn + * EMFDC_FillRgn */ -BOOL CDECL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) +BOOL EMFDC_FillRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush ) { + EMFDRV_PDEVICE *emf = dc_attr->emf; EMRFILLRGN *emr; DWORD size, rgnsize, index; BOOL ret; - index = EMFDRV_CreateBrushIndirect( dev, hbrush ); + index = EMFDRV_CreateBrushIndirect( &emf->dev, hbrush ); if(!index) return FALSE; rgnsize = NtGdiGetRegionData( hrgn, 0, NULL ); @@ -836,12 +837,24 @@ BOOL CDECL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) emr->cbRgnData = rgnsize; emr->ihBrush = index; - ret = EMFDRV_WriteRecord( dev, &emr->emr ); + ret = EMFDRV_WriteRecord( &emf->dev, &emr->emr ); if(ret) - EMFDRV_UpdateBBox( dev, &emr->rclBounds ); + EMFDRV_UpdateBBox( &emf->dev, &emr->rclBounds ); HeapFree( GetProcessHeap(), 0, emr ); return ret; } + + +/********************************************************************* + * EMFDRV_FillRgn + */ +BOOL CDECL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) +{ + /* FIXME: update bounding rect */ + return TRUE; +} + + /********************************************************************* * EMFDRV_FrameRgn */ diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 481bc14d7f3..5714aee0099 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -49,6 +49,7 @@ extern BOOL METADC_Chord( HDC hdc, INT left, INT top, INT right, INT bottom, INT extern BOOL METADC_Ellipse( HDC hdc, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; extern BOOL METADC_ExtTextOut( HDC hdc, INT x, INT y, UINT flags, const RECT *rect, const WCHAR *str, UINT count, const INT *dx ) DECLSPEC_HIDDEN; +extern BOOL METADC_FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; extern BOOL METADC_LineTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_MoveTo( HDC hdc, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL METADC_Pie( HDC hdc, INT left, INT top, INT right, INT bottom, @@ -76,6 +77,7 @@ extern BOOL EMFDC_Ellipse( DC_ATTR *dc_attr, INT left, INT top, INT right, extern BOOL EMFDC_EndPath( DC_ATTR *dc_attr ) DECLSPEC_HIDDEN; extern BOOL EMFDC_ExtTextOut( DC_ATTR *dc_attr, INT x, INT y, UINT flags, const RECT *rect, const WCHAR *str, UINT count, const INT *dx ) DECLSPEC_HIDDEN; +extern BOOL EMFDC_FillRgn( DC_ATTR *dc_attr, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; extern BOOL EMFDC_LineTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_MoveTo( DC_ATTR *dc_attr, INT x, INT y ) DECLSPEC_HIDDEN; extern BOOL EMFDC_PolyBezier( DC_ATTR *dc_attr, const POINT *points, DWORD count ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index 209591ad0c2..956326b7c14 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -382,6 +382,21 @@ BOOL WINAPI PolyDraw( HDC hdc, const POINT *points, const BYTE *types, DWORD cou return NtGdiPolyDraw( hdc, points, types, count ); } +/*********************************************************************** + * FillRgn (GDI32.@) + */ +BOOL WINAPI FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) +{ + DC_ATTR *dc_attr; + + TRACE( "%p, %p, %p\n", hdc, hrgn, hbrush ); + + if (is_meta_dc( hdc )) return METADC_FillRgn( hdc, hrgn, hbrush ); + if (!(dc_attr = get_dc_attr( hdc ))) return FALSE; + if (dc_attr->emf && !EMFDC_FillRgn( dc_attr, hrgn, hbrush )) return FALSE; + return NtGdiFillRgn( hdc, hrgn, hbrush ); +} + /*********************************************************************** * ExtTextOutW (GDI32.@) */ diff --git a/dlls/gdi32/mfdrv/graphics.c b/dlls/gdi32/mfdrv/graphics.c index 8b74c1a3696..56f93aa860d 100644 --- a/dlls/gdi32/mfdrv/graphics.c +++ b/dlls/gdi32/mfdrv/graphics.c @@ -380,18 +380,30 @@ BOOL CDECL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) /********************************************************************** - * MFDRV_FillRgn + * METADC_FillRgn */ -BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) +BOOL METADC_FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) { + METAFILEDRV_PDEVICE *mf; INT16 iRgn, iBrush; - iRgn = MFDRV_CreateRegion( dev, hrgn ); + + if (!(mf = get_metadc_ptr( hdc ))) return FALSE; + + iRgn = MFDRV_CreateRegion( &mf->dev, hrgn ); if(iRgn == -1) return FALSE; - iBrush = MFDRV_CreateBrushIndirect( dev, hbrush ); + iBrush = MFDRV_CreateBrushIndirect( &mf->dev, hbrush ); if(!iBrush) return FALSE; - return MFDRV_MetaParam2( dev, META_FILLREGION, iRgn, iBrush ); + return MFDRV_MetaParam2( &mf->dev, META_FILLREGION, iRgn, iBrush ); +} + +/********************************************************************** + * MFDRV_FillRgn + */ +BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) +{ + return TRUE; } /********************************************************************** diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index f53f8304a8e..5d32c5563de 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -597,7 +597,7 @@ BOOL MFDRV_MetaParam8(PHYSDEV dev, short func, short param1, short param2, return MFDRV_WriteRecord( dev, mr, mr->rdSize * 2); } -static METAFILEDRV_PDEVICE *get_metadc_ptr( HDC hdc ) +METAFILEDRV_PDEVICE *get_metadc_ptr( HDC hdc ) { METAFILEDRV_PDEVICE *metafile = get_gdi_client_ptr( hdc, NTGDI_OBJ_METADC ); if (!metafile) SetLastError( ERROR_INVALID_HANDLE ); diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h index 6b4984854ed..9809f3e2a11 100644 --- a/dlls/gdi32/mfdrv/metafiledrv.h +++ b/dlls/gdi32/mfdrv/metafiledrv.h @@ -59,6 +59,7 @@ extern UINT MFDRV_AddHandle( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN; extern BOOL MFDRV_RemoveHandle( PHYSDEV dev, UINT index ) DECLSPEC_HIDDEN; extern INT16 MFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_HIDDEN; +extern METAFILEDRV_PDEVICE *get_metadc_ptr( HDC hdc ) DECLSPEC_HIDDEN; extern BOOL metadc_param2( HDC hdc, short func, short param1, short param2 ) DECLSPEC_HIDDEN; extern BOOL metadc_param4( HDC hdc, short func, short param1, short param2, short param3, short param4 ) DECLSPEC_HIDDEN; diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index 1c99167e8ad..eb537a44574 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -89,7 +89,8 @@ BOOL CDECL nulldrv_FrameRgn( PHYSDEV dev, HRGN rgn, HBRUSH brush, INT width, INT if (tmp) { - if (REGION_FrameRgn( tmp, rgn, width, height )) ret = FillRgn( dev->hdc, tmp, brush ); + if (REGION_FrameRgn( tmp, rgn, width, height )) + ret = NtGdiFillRgn( dev->hdc, tmp, brush ); DeleteObject( tmp ); } return ret; @@ -493,16 +494,14 @@ BOOL WINAPI PaintRgn( HDC hdc, HRGN hrgn ) /*********************************************************************** - * FillRgn (GDI32.@) + * NtGdiFillRgn (win32u.@) */ -BOOL WINAPI FillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) +BOOL WINAPI NtGdiFillRgn( HDC hdc, HRGN hrgn, HBRUSH hbrush ) { PHYSDEV physdev; BOOL retval; DC * dc = get_dc_ptr( hdc ); - TRACE( "%p, %p, %p\n", hdc, hrgn, hbrush ); - if (!dc) return FALSE; update_dc( dc ); physdev = GET_DC_PHYSDEV( dc, pFillRgn );
1
0
0
0
Jacek Caban : gdi32: Use ntgdi names for stubs in painting.c.
by Alexandre Julliard
26 Jul '21
26 Jul '21
Module: wine Branch: master Commit: 382d5f769b36122efa30743175433b80ef919198 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=382d5f769b36122efa307431…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jul 25 10:55:55 2021 +0200 gdi32: Use ntgdi names for stubs in painting.c. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/gdi32.spec | 6 +++--- dlls/gdi32/painting.c | 17 ++++++----------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 299b84268a5..aef85c88d7d 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -181,9 +181,9 @@ @ stub GdiDeleteLocalDC @ stub GdiDeleteLocalObject # @ stub GdiDeleteSpoolFileHandle -@ stdcall GdiDescribePixelFormat(long long long ptr) +@ stdcall GdiDescribePixelFormat(long long long ptr) NtGdiDescribePixelFormat @ stdcall GdiDllInitialize(ptr long ptr) -@ stdcall GdiDrawStream(long long ptr) +@ stdcall GdiDrawStream(long long ptr) NtGdiDrawStream # @ stub GdiEndDocEMF # @ stub GdiEndPageEMF @ stdcall GdiEntry13() @@ -230,7 +230,7 @@ @ stub GdiSetServerAttr # @ stub GdiStartDocEMF # @ stub GdiStartPageEMF -@ stdcall GdiSwapBuffers(long) +@ stdcall GdiSwapBuffers(long) NtGdiSwapBuffers @ stdcall GdiTransparentBlt(long long long long long long long long long long long) # @ stub GdiValidateHandle @ stub GdiWinWatchClose diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index 725a8490f39..1c99167e8ad 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -453,11 +453,9 @@ BOOL WINAPI NtGdiSetPixelFormat( HDC hdc, INT format ) /****************************************************************************** - * GdiDescribePixelFormat [GDI32.@] - * - * Probably not the correct semantics, it's supposed to be an internal backend for DescribePixelFormat. + * NtGdiDescribePixelFormat (win32u.@) */ -INT WINAPI GdiDescribePixelFormat( HDC hdc, INT format, UINT size, PIXELFORMATDESCRIPTOR *descr ) +INT WINAPI NtGdiDescribePixelFormat( HDC hdc, INT format, UINT size, PIXELFORMATDESCRIPTOR *descr ) { FIXME( "(%p,%d,%d,%p): stub\n", hdc, format, size, descr ); return 0; @@ -465,11 +463,9 @@ INT WINAPI GdiDescribePixelFormat( HDC hdc, INT format, UINT size, PIXELFORMATDE /****************************************************************************** - * GdiSwapBuffers [GDI32.@] - * - * Probably not the correct semantics, it's supposed to be an internal backend for SwapBuffers. + * NtGdiSwapBuffers (win32u.@) */ -BOOL WINAPI GdiSwapBuffers( HDC hdc ) +BOOL WINAPI NtGdiSwapBuffers( HDC hdc ) { FIXME( "(%p): stub\n", hdc ); return FALSE; @@ -993,10 +989,9 @@ BOOL WINAPI GdiGradientFill( HDC hdc, TRIVERTEX *vert_array, ULONG nvert, } /****************************************************************************** - * GdiDrawStream (GDI32.@) - * + * NtGdiDrawStream (win32u.@) */ -BOOL WINAPI GdiDrawStream( HDC hdc, ULONG in, void * pvin ) +BOOL WINAPI NtGdiDrawStream( HDC hdc, ULONG in, void *pvin ) { FIXME("stub: %p, %d, %p\n", hdc, in, pvin); return FALSE;
1
0
0
0
Jacek Caban : gdi32: Use NtGdiSetPixelFormat for GdiSetPixelFormat implementation.
by Alexandre Julliard
26 Jul '21
26 Jul '21
Module: wine Branch: master Commit: 275325686273a2c6332e95adcd3734fbae06c6d7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=275325686273a2c6332e95ad…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Sun Jul 25 10:55:31 2021 +0200 gdi32: Use NtGdiSetPixelFormat for GdiSetPixelFormat implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/gdi32/gdidc.c | 9 +++++++++ dlls/gdi32/painting.c | 6 ++---- include/ntgdi.h | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dlls/gdi32/gdidc.c b/dlls/gdi32/gdidc.c index 74280bc34b5..209591ad0c2 100644 --- a/dlls/gdi32/gdidc.c +++ b/dlls/gdi32/gdidc.c @@ -444,3 +444,12 @@ BOOL WINAPI CloseFigure( HDC hdc ) if (dc_attr->emf && !EMFDC_CloseFigure( dc_attr )) return FALSE; return NtGdiCloseFigure( hdc ); } + +/*********************************************************************** + * GdiSetPixelFormat (GDI32.@) + */ +BOOL WINAPI GdiSetPixelFormat( HDC hdc, INT format, const PIXELFORMATDESCRIPTOR *descr ) +{ + TRACE( "(%p,%d,%p)\n", hdc, format, descr ); + return NtGdiSetPixelFormat( hdc, format ); +} diff --git a/dlls/gdi32/painting.c b/dlls/gdi32/painting.c index c879aeb9582..725a8490f39 100644 --- a/dlls/gdi32/painting.c +++ b/dlls/gdi32/painting.c @@ -434,17 +434,15 @@ COLORREF WINAPI NtGdiGetPixel( HDC hdc, INT x, INT y ) /****************************************************************************** - * GdiSetPixelFormat [GDI32.@] + * NtGdiSetPixelFormat (win32u.@) * * Probably not the correct semantics, it's supposed to be an internal backend for SetPixelFormat. */ -BOOL WINAPI GdiSetPixelFormat( HDC hdc, INT format, const PIXELFORMATDESCRIPTOR *descr ) +BOOL WINAPI NtGdiSetPixelFormat( HDC hdc, INT format ) { DC *dc; BOOL ret = TRUE; - TRACE("(%p,%d,%p)\n", hdc, format, descr); - if (!(dc = get_dc_ptr( hdc ))) return FALSE; if (!dc->pixel_format) dc->pixel_format = format; diff --git a/include/ntgdi.h b/include/ntgdi.h index 2cf0a6f681e..a85fec66723 100644 --- a/include/ntgdi.h +++ b/include/ntgdi.h @@ -220,7 +220,7 @@ DWORD WINAPI NtGdiSetLayout( HDC hdc, DWORD layout ); INT WINAPI NtGdiSetMetaRgn( HDC hdc ); BOOL WINAPI NtGdiSetMiterLimit( HDC hdc, FLOAT limit, FLOAT *prev_limit ); COLORREF WINAPI NtGdiSetPixel( HDC hdc, INT x, INT y, COLORREF color ); -BOOL WINAPI NtGdiSetPixelFormat( HDC hdc, INT format, const PIXELFORMATDESCRIPTOR *descr ); +BOOL WINAPI NtGdiSetPixelFormat( HDC hdc, INT format ); BOOL WINAPI NtGdiSetRectRgn( HRGN hrgn, INT left, INT top, INT right, INT bottom ); BOOL WINAPI NtGdiSetTextJustification( HDC hdc, INT extra, INT breaks ); BOOL WINAPI NtGdiSetVirtualResolution( HDC hdc, DWORD horz_res, DWORD vert_res,
1
0
0
0
Hugh McMaster : reg/tests: Test use of registry views when copying registry data.
by Alexandre Julliard
26 Jul '21
26 Jul '21
Module: wine Branch: master Commit: d92f26ed1264ec80f97c0a45a59b986f0b9cae38 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d92f26ed1264ec80f97c0a45…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Sun Jul 25 13:17:05 2021 +1000 reg/tests: Test use of registry views when copying registry data. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/reg/tests/copy.c | 172 ++++++++++++++++++++++++++++++++++++++++++ programs/reg/tests/export.c | 18 ++--- programs/reg/tests/reg_test.h | 1 + 3 files changed, 182 insertions(+), 9 deletions(-) diff --git a/programs/reg/tests/copy.c b/programs/reg/tests/copy.c index e9542a67f5e..0f9e1221200 100644 --- a/programs/reg/tests/copy.c +++ b/programs/reg/tests/copy.c @@ -588,6 +588,166 @@ static void test_copy_overwrite(void) delete_key(HKEY_CURRENT_USER, KEY_BASE, 0); } +static void create_test_key(REGSAM sam) +{ + HKEY hkey, subkey; + DWORD dword = 0x100; + + add_key(HKEY_LOCAL_MACHINE, COPY_SRC, sam, &hkey); + add_value(hkey, "DWORD", REG_DWORD, &dword, sizeof(dword)); + add_value(hkey, "String", REG_SZ, "Your text here...", 18); + + add_key(hkey, "Subkey1", sam, &subkey); + add_value(subkey, "Binary", REG_BINARY, "\x11\x22\x33\x44", 4); + add_value(subkey, "Undefined hex", 0x100, "%PATH%", 7); + close_key(subkey); + + close_key(hkey); +} + +static void test_registry_view_win32(void) +{ + DWORD r; + BOOL is_wow64, is_win32; + + IsWow64Process(GetCurrentProcess(), &is_wow64); + is_win32 = !is_wow64 && (sizeof(void *) == sizeof(int)); + + if (!is_win32) return; + + delete_tree(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_32KEY); + delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); + + /* Try copying registry data in the 32-bit registry view (32-bit Windows) */ + create_test_key(KEY_WOW64_32KEY); + + run_reg_exe("reg copy HKLM\\" COPY_SRC " HKLM\\" KEY_BASE " /s /f /reg:32", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + run_reg_exe("reg export HKLM\\" KEY_BASE " file.reg /y /reg:32", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", registry_view_test, 0), "compare_export() failed\n"); + + delete_tree(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_32KEY); + delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); + + /* Try copying registry data in the 64-bit registry view, which doesn't exist on 32-bit Windows */ + create_test_key(KEY_WOW64_64KEY); + + run_reg_exe("reg copy HKLM\\" COPY_SRC " HKLM\\" KEY_BASE " /s /f /reg:64", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + run_reg_exe("reg export HKLM\\" KEY_BASE " file.reg /y /reg:64", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", registry_view_test, 0), "compare_export() failed\n"); + + delete_tree(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_64KEY); + delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY); +} + +static void test_registry_view_win64(void) +{ + DWORD r; + BOOL is_wow64, is_win64; + + IsWow64Process(GetCurrentProcess(), &is_wow64); + is_win64 = !is_wow64 && (sizeof(void *) > sizeof(int)); + + if (!is_win64) return; + + delete_tree(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_32KEY); + delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); + delete_tree(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_64KEY); + delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY); + + /* Try copying registry data in the 32-bit registry view (64-bit Windows) */ + create_test_key(KEY_WOW64_32KEY); + verify_key_nonexist(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_64KEY); + verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY); + + run_reg_exe("reg copy HKLM\\" COPY_SRC " HKLM\\" KEY_BASE " /s /f /reg:32", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + run_reg_exe("reg export HKLM\\" KEY_BASE " file.reg /y /reg:32", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", registry_view_test, 0), "compare_export() failed\n"); + + run_reg_exe("reg copy HKLM\\" COPY_SRC " HKLM\\" KEY_BASE " /s /f /reg:64", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + delete_tree(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_32KEY); + delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); + + /* Try copying registry data in the 64-bit registry view (64-bit Windows) */ + create_test_key(KEY_WOW64_64KEY); + verify_key_nonexist(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_32KEY); + verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); + + run_reg_exe("reg copy HKLM\\" COPY_SRC " HKLM\\" KEY_BASE " /s /f /reg:64", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + run_reg_exe("reg export HKLM\\" KEY_BASE " file.reg /y /reg:64", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", registry_view_test, 0), "compare_export() failed\n"); + + run_reg_exe("reg copy HKLM\\" COPY_SRC " HKLM\\" KEY_BASE " /s /f /reg:32", &r); + todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + delete_tree(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_64KEY); + delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY); +} + +static void test_registry_view_wow64(void) +{ + DWORD r; + BOOL is_wow64; + + IsWow64Process(GetCurrentProcess(), &is_wow64); + + if (!is_wow64) return; + + delete_tree(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_32KEY); + delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); + delete_tree(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_64KEY); + delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY); + + /* Try copying registry data in the 32-bit registry view (WOW64) */ + create_test_key(KEY_WOW64_32KEY); + verify_key_nonexist(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_64KEY); + verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY); + + run_reg_exe("reg copy HKLM\\" COPY_SRC " HKLM\\" KEY_BASE " /s /f /reg:32", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + run_reg_exe("reg export HKLM\\" KEY_BASE " file.reg /y /reg:32", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + ok(compare_export("file.reg", registry_view_test, 0), "compare_export() failed\n"); + + run_reg_exe("reg copy HKLM\\" COPY_SRC " HKLM\\" KEY_BASE " /s /f /reg:64", &r); + todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + delete_tree(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_32KEY); + delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); + + /* Try copying registry data in the 64-bit registry view (WOW64) */ + create_test_key(KEY_WOW64_64KEY); + verify_key_nonexist(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_32KEY); + verify_key_nonexist(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_32KEY); + + run_reg_exe("reg copy HKLM\\" COPY_SRC " HKLM\\" KEY_BASE " /s /f /reg:64", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + run_reg_exe("reg export HKLM\\" KEY_BASE " file.reg /y /reg:64", &r); + todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + todo_wine ok(compare_export("file.reg", registry_view_test, 0), "compare_export() failed\n"); + + run_reg_exe("reg copy HKLM\\" COPY_SRC " HKLM\\" KEY_BASE " /s /f /reg:32", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + delete_tree(HKEY_LOCAL_MACHINE, COPY_SRC, KEY_WOW64_64KEY); + delete_tree(HKEY_LOCAL_MACHINE, KEY_BASE, KEY_WOW64_64KEY); +} + START_TEST(copy) { DWORD r; @@ -609,4 +769,16 @@ START_TEST(copy) test_copy_escaped_null_values(); test_copy_key_class(); test_copy_overwrite(); + + /* Check if reg.exe is running with elevated privileges */ + if (!is_elevated_process()) + { + win_skip("reg.exe is not running with elevated privileges; " + "skipping registry view tests\n"); + return; + } + + test_registry_view_win32(); + test_registry_view_win64(); + test_registry_view_wow64(); } diff --git a/programs/reg/tests/export.c b/programs/reg/tests/export.c index 7d352519690..3061783ca06 100644 --- a/programs/reg/tests/export.c +++ b/programs/reg/tests/export.c @@ -165,6 +165,15 @@ const char *escaped_null_test = "\"Wine5e\"=\"Value3\\\\0Value4\"\r\n" "\"Wine5f\"=\"\\\\0Value5\"\r\n\r\n"; +const char *registry_view_test = + "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" + "[HKEY_LOCAL_MACHINE\\" KEY_BASE "]\r\n" + "\"DWORD\"=dword:00000100\r\n" + "\"String\"=\"Your text here...\"\r\n\r\n" + "[HKEY_LOCAL_MACHINE\\" KEY_BASE "\\Subkey1]\r\n" + "\"Binary\"=hex:11,22,33,44\r\n" + "\"Undefined hex\"=hex(100):25,50,41,54,48,25,00\r\n\r\n"; + /* Unit tests */ @@ -463,15 +472,6 @@ static void create_test_key(REGSAM sam) close_key(hkey); } -static const char *registry_view_test = - "\xef\xbb\xbfWindows Registry Editor Version 5.00\r\n\r\n" - "[HKEY_LOCAL_MACHINE\\" KEY_BASE "]\r\n" - "\"DWORD\"=dword:00000100\r\n" - "\"String\"=\"Your text here...\"\r\n\r\n" - "[HKEY_LOCAL_MACHINE\\" KEY_BASE "\\Subkey1]\r\n" - "\"Binary\"=hex:11,22,33,44\r\n" - "\"Undefined hex\"=hex(100):25,50,41,54,48,25,00\r\n\r\n"; - static void test_registry_view_win32(void) { DWORD r; diff --git a/programs/reg/tests/reg_test.h b/programs/reg/tests/reg_test.h index 45d480cda49..8fd7704751a 100644 --- a/programs/reg/tests/reg_test.h +++ b/programs/reg/tests/reg_test.h @@ -89,6 +89,7 @@ extern const char *hex_types_test; extern const char *slashes_test; extern const char *embedded_null_test; extern const char *escaped_null_test; +extern const char *registry_view_test; /* import.c */ BOOL is_elevated_process(void);
1
0
0
0
Alexandre Julliard : Revert "winegcc: Support -Wl,foo=... style linker options."
by Alexandre Julliard
26 Jul '21
26 Jul '21
Module: wine Branch: master Commit: de4c91e0a1ac65017190bead4c053ae65db8f80e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=de4c91e0a1ac65017190bead…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 26 11:33:43 2021 +0200 Revert "winegcc: Support -Wl,foo=... style linker options." This reverts commit fcda0afdd429e11d75dc61f628e40a6c8973ce44. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=51413
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tools/winegcc/winegcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c index 8c1e0d088ac..fd2d2c2a794 100644 --- a/tools/winegcc/winegcc.c +++ b/tools/winegcc/winegcc.c @@ -1982,7 +1982,7 @@ int main(int argc, char **argv) if (strncmp("-Wl,", opts.args->base[i], 4) == 0) { unsigned int j; - strarray* Wl = strarray_fromstring(opts.args->base[i] + 4, ",="); + strarray* Wl = strarray_fromstring(opts.args->base[i] + 4, ","); for (j = 0; j < Wl->size; j++) { if (!strcmp(Wl->base[j], "--image-base") && j < Wl->size - 1)
1
0
0
0
Zebediah Figura : vkd3d-shader: Track bytecode buffer size in bytes.
by Alexandre Julliard
26 Jul '21
26 Jul '21
Module: vkd3d Branch: master Commit: 9f0b475583ca85d3aac9f53725a3648776100c96 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=9f0b475583ca85d3aac9f53…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Jul 8 21:13:19 2021 -0500 vkd3d-shader: Track bytecode buffer size in bytes. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.h | 4 +- libs/vkd3d-shader/hlsl_codegen.c | 101 +++++++++++++++++---------------------- 2 files changed, 47 insertions(+), 58 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index e0045ac..54273ac 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -126,7 +126,7 @@ struct hlsl_type } e; unsigned int reg_size; - unsigned int bytecode_offset; + size_t bytecode_offset; }; struct hlsl_semantic @@ -144,7 +144,7 @@ struct hlsl_struct_field struct hlsl_semantic semantic; unsigned int reg_offset; - unsigned int name_bytecode_offset; + size_t name_bytecode_offset; }; struct hlsl_reg diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 778d9df..51cb789 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -1324,72 +1324,57 @@ static struct hlsl_reg hlsl_reg_from_deref(const struct hlsl_deref *deref, const struct bytecode_buffer { struct hlsl_ctx *ctx; - uint32_t *data; - size_t count, size; + uint8_t *data; + size_t size, capacity; int status; }; -/* Returns the token index. */ -static unsigned int put_dword(struct bytecode_buffer *buffer, uint32_t value) +static size_t put_bytes(struct bytecode_buffer *buffer, const void *bytes, size_t size) { - unsigned int index = buffer->count; + size_t aligned_size = align(size, 4); + size_t offset = buffer->size; if (buffer->status) - return index; + return offset; - if (!hlsl_array_reserve(buffer->ctx, (void **)&buffer->data, &buffer->size, - buffer->count + 1, sizeof(*buffer->data))) + if (!hlsl_array_reserve(buffer->ctx, (void **)&buffer->data, &buffer->capacity, offset + aligned_size, 1)) { buffer->status = VKD3D_ERROR_OUT_OF_MEMORY; - return index; + return offset; } - buffer->data[buffer->count++] = value; + memcpy(buffer->data + offset, bytes, size); + memset(buffer->data + offset + size, 0xab, aligned_size - size); + buffer->size = offset + aligned_size; + return offset; +} - return index; +static size_t put_dword(struct bytecode_buffer *buffer, uint32_t value) +{ + return put_bytes(buffer, &value, sizeof(value)); } -/* Returns the token index. */ -static unsigned int put_float(struct bytecode_buffer *buffer, float value) +static size_t put_float(struct bytecode_buffer *buffer, float value) { - union - { - float f; - uint32_t u; - } u; - u.f = value; - return put_dword(buffer, u.u); + return put_bytes(buffer, &value, sizeof(value)); } -static void set_dword(struct bytecode_buffer *buffer, unsigned int index, uint32_t value) +static void set_dword(struct bytecode_buffer *buffer, size_t offset, uint32_t value) { if (buffer->status) return; - assert(index < buffer->count); - buffer->data[index] = value; + assert(offset + sizeof(value) <= buffer->size); + memcpy(buffer->data + offset, &value, sizeof(value)); } -/* Returns the token index. */ -static unsigned int put_string(struct bytecode_buffer *buffer, const char *str) +static size_t put_string(struct bytecode_buffer *buffer, const char *string) { - unsigned int index = buffer->count; - size_t len = strlen(str) + 1; - unsigned int token_count = (len + 3) / sizeof(*buffer->data); - - if (buffer->status) - return index; - - if (!hlsl_array_reserve(buffer->ctx, (void **)&buffer->data, &buffer->size, - buffer->count + token_count, sizeof(*buffer->data))) - { - buffer->status = E_OUTOFMEMORY; - return index; - } + return put_bytes(buffer, string, strlen(string) + 1); +} - buffer->data[buffer->count + token_count - 1] = 0xabababab; - memcpy(buffer->data + buffer->count, str, len); - buffer->count += token_count; - return index; +static size_t get_buffer_size(struct bytecode_buffer *buffer) +{ + return buffer->size; } static uint32_t sm1_version(enum vkd3d_shader_type type, unsigned int major, unsigned int minor) @@ -1505,9 +1490,10 @@ static unsigned int get_array_size(const struct hlsl_type *type) static void write_sm1_type(struct bytecode_buffer *buffer, struct hlsl_type *type, unsigned int ctab_start) { const struct hlsl_type *array_type = get_array_type(type); - unsigned int fields_offset = 0, field_count = 0; unsigned int array_size = get_array_size(type); struct hlsl_struct_field *field; + unsigned int field_count = 0; + size_t fields_offset = 0; if (type->bytecode_offset) return; @@ -1520,12 +1506,12 @@ static void write_sm1_type(struct bytecode_buffer *buffer, struct hlsl_type *typ write_sm1_type(buffer, field->type, ctab_start); } - fields_offset = (buffer->count - ctab_start) * sizeof(*buffer->data); + fields_offset = get_buffer_size(buffer) - ctab_start; LIST_FOR_EACH_ENTRY(field, array_type->e.elements, struct hlsl_struct_field, entry) { - put_dword(buffer, (field->name_bytecode_offset - ctab_start) * sizeof(*buffer->data)); - put_dword(buffer, (field->type->bytecode_offset - ctab_start) * sizeof(*buffer->data)); + put_dword(buffer, field->name_bytecode_offset - ctab_start); + put_dword(buffer, field->type->bytecode_offset - ctab_start); ++field_count; } } @@ -1567,7 +1553,7 @@ static void sm1_sort_externs(struct hlsl_ctx *ctx) static void write_sm1_uniforms(struct hlsl_ctx *ctx, struct bytecode_buffer *buffer, struct hlsl_ir_function_decl *entry_func) { - unsigned int ctab_start, vars_start, size_offset, creator_offset, offset; + size_t ctab_offset, ctab_start, ctab_end, vars_start, size_offset, creator_offset, offset; unsigned int uniform_count = 0; struct hlsl_ir_var *var; @@ -1597,7 +1583,7 @@ static void write_sm1_uniforms(struct hlsl_ctx *ctx, struct bytecode_buffer *buf sm1_sort_externs(ctx); size_offset = put_dword(buffer, 0); - put_dword(buffer, MAKEFOURCC('C','T','A','B')); + ctab_offset = put_dword(buffer, MAKEFOURCC('C','T','A','B')); ctab_start = put_dword(buffer, sizeof(D3DXSHADER_CONSTANTTABLE)); creator_offset = put_dword(buffer, 0); @@ -1607,7 +1593,7 @@ static void write_sm1_uniforms(struct hlsl_ctx *ctx, struct bytecode_buffer *buf put_dword(buffer, 0); /* FIXME: flags */ put_dword(buffer, 0); /* FIXME: target string */ - vars_start = buffer->count; + vars_start = get_buffer_size(buffer); LIST_FOR_EACH_ENTRY(var, &ctx->extern_vars, struct hlsl_ir_var, extern_entry) { @@ -1627,20 +1613,23 @@ static void write_sm1_uniforms(struct hlsl_ctx *ctx, struct bytecode_buffer *buf { if (!var->semantic.name && var->reg.allocated) { - set_dword(buffer, vars_start + (uniform_count * 5), (buffer->count - ctab_start) * sizeof(*buffer->data)); - put_string(buffer, var->name); + size_t var_offset = vars_start + (uniform_count * 5 * sizeof(uint32_t)); + size_t name_offset; + + name_offset = put_string(buffer, var->name); + set_dword(buffer, var_offset, name_offset - ctab_start); write_sm1_type(buffer, var->data_type, ctab_start); - set_dword(buffer, vars_start + (uniform_count * 5) + 3, - (var->data_type->bytecode_offset - ctab_start) * sizeof(*buffer->data)); + set_dword(buffer, var_offset + 3 * sizeof(uint32_t), var->data_type->bytecode_offset - ctab_start); ++uniform_count; } } offset = put_string(buffer, vkd3d_shader_get_version(NULL, NULL)); - set_dword(buffer, creator_offset, (offset - ctab_start) * sizeof(*buffer->data)); + set_dword(buffer, creator_offset, offset - ctab_start); - set_dword(buffer, size_offset, D3DSIO_COMMENT | ((buffer->count - (ctab_start - 1)) << 16)); + ctab_end = get_buffer_size(buffer); + set_dword(buffer, size_offset, D3DSIO_COMMENT | (((ctab_end - ctab_offset) / sizeof(uint32_t)) << 16)); } static uint32_t sm1_encode_register_type(D3DSHADER_PARAM_REGISTER_TYPE type) @@ -2078,7 +2067,7 @@ static int write_sm1_shader(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl * if (!(ret = buffer.status)) { out->code = buffer.data; - out->size = buffer.count * sizeof(*buffer.data); + out->size = buffer.size; } return ret; }
1
0
0
0
Zebediah Figura : vkd3d-shader: Allocate the $Params buffer in hlsl_ctx_init().
by Alexandre Julliard
26 Jul '21
26 Jul '21
Module: vkd3d Branch: master Commit: 1ed82b9fc4d2e360600ae3db3b282de686d35e9c URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=1ed82b9fc4d2e360600ae3d…
Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu Jul 8 21:13:18 2021 -0500 vkd3d-shader: Allocate the $Params buffer in hlsl_ctx_init(). For clarity. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/hlsl.c | 3 +++ libs/vkd3d-shader/hlsl.h | 2 +- libs/vkd3d-shader/hlsl_codegen.c | 15 ++------------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c index 0b8c660..bc593f8 100644 --- a/libs/vkd3d-shader/hlsl.c +++ b/libs/vkd3d-shader/hlsl.c @@ -1664,6 +1664,9 @@ static bool hlsl_ctx_init(struct hlsl_ctx *ctx, const struct hlsl_profile_info * if (!(ctx->globals_buffer = hlsl_new_buffer(ctx, HLSL_BUFFER_CONSTANT, hlsl_strdup(ctx, "$Globals"), NULL, ctx->location))) return false; + if (!(ctx->params_buffer = hlsl_new_buffer(ctx, HLSL_BUFFER_CONSTANT, + hlsl_strdup(ctx, "$Params"), NULL, ctx->location))) + return false; ctx->cur_buffer = ctx->globals_buffer; return true; diff --git a/libs/vkd3d-shader/hlsl.h b/libs/vkd3d-shader/hlsl.h index b62e781..e0045ac 100644 --- a/libs/vkd3d-shader/hlsl.h +++ b/libs/vkd3d-shader/hlsl.h @@ -456,7 +456,7 @@ struct hlsl_ctx struct list extern_vars; struct list buffers; - struct hlsl_buffer *cur_buffer, *globals_buffer; + struct hlsl_buffer *cur_buffer, *globals_buffer, *params_buffer; struct list types; struct rb_tree functions; const struct hlsl_ir_function_decl *cur_function; diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 6336ddf..778d9df 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -1142,27 +1142,16 @@ static void calculate_buffer_offset(struct hlsl_ir_var *var) static void allocate_buffers(struct hlsl_ctx *ctx) { - struct hlsl_buffer *buffer, *params_buffer; + struct hlsl_buffer *buffer; struct hlsl_ir_var *var; uint32_t index = 0; - if (!(params_buffer = hlsl_new_buffer(ctx, HLSL_BUFFER_CONSTANT, - hlsl_strdup(ctx, "$Params"), NULL, ctx->location))) - return; - - /* The $Globals and $Params buffers should be allocated first, before all - * explicit buffers. */ - list_remove(¶ms_buffer->entry); - list_add_head(&ctx->buffers, ¶ms_buffer->entry); - list_remove(&ctx->globals_buffer->entry); - list_add_head(&ctx->buffers, &ctx->globals_buffer->entry); - LIST_FOR_EACH_ENTRY(var, &ctx->extern_vars, struct hlsl_ir_var, extern_entry) { if (var->is_uniform) { if (var->is_param) - var->buffer = params_buffer; + var->buffer = ctx->params_buffer; calculate_buffer_offset(var); }
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
73
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
67
68
69
70
71
72
73
Results per page:
10
25
50
100
200