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
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
October 2010
----- 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
2 participants
1174 discussions
Start a n
N
ew thread
Vincent Povirk : gdiplus: Don' t create a DIB section for non-alpha or reference bitmaps.
by Alexandre Julliard
01 Oct '10
01 Oct '10
Module: wine Branch: master Commit: c8a48f237e43174673fa3686ebe99e42f6a0d8a4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c8a48f237e43174673fa3686e…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Sep 30 16:07:53 2010 -0500 gdiplus: Don't create a DIB section for non-alpha or reference bitmaps. --- dlls/gdiplus/image.c | 14 +------------- dlls/gdiplus/tests/graphics.c | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 9b83d95..e17edde 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1630,7 +1630,6 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, INT row_size, dib_stride; HDC hdc; BYTE *bits=NULL, *own_bits=NULL; - int i; REAL xres, yres; GpStatus stat; @@ -1655,7 +1654,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, if(stride == 0) stride = dib_stride; - if (format & PixelFormatGDI) + if (format & PixelFormatGDI && !(format & (PixelFormatAlpha|PixelFormatIndexed)) && !scan0) { pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); if (!pbmi) @@ -1691,12 +1690,7 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, { /* Not a GDI format; don't try to make an HBITMAP. */ if (scan0) - { - /* FIXME: We should do this with GDI formats too when scan0 is - * provided, but for now we need the HDC for most drawing - * operations. */ bits = scan0; - } else { INT size = abs(stride) * height; @@ -1709,12 +1703,6 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, } } - /* copy bits to the dib if necessary */ - /* FIXME: should reference the bits instead of copying them */ - if (scan0 && bits != scan0) - for (i=0; i<height; i++) - memcpy(bits+i*dib_stride, scan0+i*stride, row_size); - *bitmap = GdipAlloc(sizeof(GpBitmap)); if(!*bitmap) { diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 9fae06c..940dbef 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -2194,7 +2194,7 @@ static void test_fromMemoryBitmap(void) GdipDeleteGraphics(graphics); - todo_wine expect(0x79, bits[0]); + expect(0x79, bits[0]); todo_wine expect(0x68, bits[3]); GdipDisposeImage((GpImage*)bitmap);
1
0
0
0
Vincent Povirk : gdiplus: Implement GdipGetRegionScansCount.
by Alexandre Julliard
01 Oct '10
01 Oct '10
Module: wine Branch: master Commit: 473afa4b8c3b8fdc17c800851964976536fbdcf9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=473afa4b8c3b8fdc17c800851…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Sep 30 14:59:04 2010 -0500 gdiplus: Implement GdipGetRegionScansCount. --- dlls/gdiplus/region.c | 76 ++++++++++++++++++++++++++++++++++++++++-- dlls/gdiplus/tests/region.c | 64 ++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 137 insertions(+), 4 deletions(-) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index 9b8ed18..2e895a8 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -1362,14 +1362,82 @@ GpStatus WINGDIPAPI GdipTranslateRegionI(GpRegion *region, INT dx, INT dy) return GdipTranslateRegion(region, (REAL)dx, (REAL)dy); } +static GpStatus get_region_scans_data(GpRegion *region, GpMatrix *matrix, LPRGNDATA *data) +{ + GpRegion *region_copy; + GpStatus stat; + HRGN hrgn; + DWORD data_size; + + stat = GdipCloneRegion(region, ®ion_copy); + + if (stat == Ok) + { + stat = GdipTransformRegion(region_copy, matrix); + + if (stat == Ok) + stat = GdipGetRegionHRgn(region_copy, NULL, &hrgn); + + if (stat == Ok) + { + if (hrgn) + { + data_size = GetRegionData(hrgn, 0, NULL); + + *data = GdipAlloc(data_size); + + if (*data) + GetRegionData(hrgn, data_size, *data); + else + stat = OutOfMemory; + + DeleteObject(hrgn); + } + else + { + data_size = sizeof(RGNDATAHEADER) + sizeof(RECT); + + *data = GdipAlloc(data_size); + + if (*data) + { + (*data)->rdh.dwSize = sizeof(RGNDATAHEADER); + (*data)->rdh.iType = RDH_RECTANGLES; + (*data)->rdh.nCount = 1; + (*data)->rdh.nRgnSize = sizeof(RECT); + (*data)->rdh.rcBound.left = (*data)->rdh.rcBound.top = -0x400000; + (*data)->rdh.rcBound.right = (*data)->rdh.rcBound.bottom = 0x400000; + + memcpy(&(*data)->Buffer, &(*data)->rdh.rcBound, sizeof(RECT)); + } + else + stat = OutOfMemory; + } + } + + GdipDeleteRegion(region_copy); + } + + return stat; +} + GpStatus WINGDIPAPI GdipGetRegionScansCount(GpRegion *region, UINT *count, GpMatrix *matrix) { - static int calls; + GpStatus stat; + LPRGNDATA data; TRACE("(%p, %p, %p)\n", region, count, matrix); - if (!(calls++)) - FIXME("not implemented\n"); + if (!region || !count || !matrix) + return InvalidParameter; - return NotImplemented; + stat = get_region_scans_data(region, matrix, &data); + + if (stat == Ok) + { + *count = data->rdh.nCount; + GdipFree(data); + } + + return stat; } diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 96ac40e..9d48b25 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -1230,6 +1230,69 @@ static void test_transform(void) ReleaseDC(0, hdc); } +static void test_scans(void) +{ + GpRegion *region; + GpMatrix *matrix; + GpRectF rectf; + GpStatus status; + ULONG count=80085; + + status = GdipCreateRegion(®ion); + expect(Ok, status); + + status = GdipCreateMatrix(&matrix); + expect(Ok, status); + + /* test NULL values */ + status = GdipGetRegionScansCount(NULL, &count, matrix); + expect(InvalidParameter, status); + + status = GdipGetRegionScansCount(region, NULL, matrix); + expect(InvalidParameter, status); + + status = GdipGetRegionScansCount(region, &count, NULL); + expect(InvalidParameter, status); + + /* infinite */ + status = GdipGetRegionScansCount(region, &count, matrix); + expect(Ok, status); + expect(1, count); + + /* empty */ + status = GdipSetEmpty(region); + expect(Ok, status); + + status = GdipGetRegionScansCount(region, &count, matrix); + expect(Ok, status); + expect(0, count); + + /* single rectangle */ + rectf.X = rectf.Y = 0.0; + rectf.Width = rectf.Height = 5.0; + status = GdipCombineRegionRect(region, &rectf, CombineModeReplace); + expect(Ok, status); + + status = GdipGetRegionScansCount(region, &count, matrix); + expect(Ok, status); + expect(1, count); + + /* two rectangles */ + rectf.X = rectf.Y = 5.0; + rectf.Width = rectf.Height = 5.0; + status = GdipCombineRegionRect(region, &rectf, CombineModeUnion); + expect(Ok, status); + + status = GdipGetRegionScansCount(region, &count, matrix); + expect(Ok, status); + expect(2, count); + + status = GdipDeleteRegion(region); + expect(Ok, status); + status = GdipDeleteMatrix(matrix); + expect(Ok, status); +} + static void test_getbounds(void) { GpRegion *region; @@ -1742,6 +1805,7 @@ START_TEST(region) test_isequal(); test_translate(); test_transform(); + test_scans(); test_getbounds(); test_isvisiblepoint(); test_isvisiblerect(); diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index c361d10..76549e7 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -643,6 +643,7 @@ GpStatus WINGDIPAPI GdipGetRegionBoundsI(GpRegion *, GpGraphics *, GpRect *); GpStatus WINGDIPAPI GdipGetRegionData(GpRegion *, BYTE *, UINT, UINT *); GpStatus WINGDIPAPI GdipGetRegionDataSize(GpRegion *, UINT *); GpStatus WINGDIPAPI GdipGetRegionHRgn(GpRegion *, GpGraphics *, HRGN *); +GpStatus WINGDIPAPI GdipGetRegionScansCount(GpRegion *, UINT *, GpMatrix *); GpStatus WINGDIPAPI GdipIsEmptyRegion(GpRegion *, GpGraphics *, BOOL *); GpStatus WINGDIPAPI GdipIsEqualRegion(GpRegion *, GpRegion *, GpGraphics *, BOOL *); GpStatus WINGDIPAPI GdipIsInfiniteRegion(GpRegion *, GpGraphics *, BOOL *);
1
0
0
0
Vincent Povirk : gdiplus: Implement GdipTransformRegion.
by Alexandre Julliard
01 Oct '10
01 Oct '10
Module: wine Branch: master Commit: 40d8876fc4ce90a07043b4b0b78d8b98c7a972f3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=40d8876fc4ce90a07043b4b0b…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Sep 30 14:39:27 2010 -0500 gdiplus: Implement GdipTransformRegion. --- dlls/gdiplus/region.c | 59 ++++++++++++++++++++++- dlls/gdiplus/tests/region.c | 108 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 165 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index decaaf9..9b8ed18 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -1248,11 +1248,66 @@ GpStatus WINGDIPAPI GdipSetInfinite(GpRegion *region) return stat; } +/* Transforms GpRegion elements with given matrix */ +static GpStatus transform_region_element(region_element* element, GpMatrix *matrix) +{ + GpStatus stat; + + switch(element->type) + { + case RegionDataEmptyRect: + case RegionDataInfiniteRect: + return Ok; + case RegionDataRect: + { + /* We can't transform a rectangle, so convert it to a path. */ + GpRegion *new_region; + GpPath *path; + + stat = GdipCreatePath(FillModeAlternate, &path); + if (stat == Ok) + { + stat = GdipAddPathRectangle(path, + element->elementdata.rect.X, element->elementdata.rect.Y, + element->elementdata.rect.Width, element->elementdata.rect.Height); + + if (stat == Ok) + stat = GdipCreateRegionPath(path, &new_region); + + GdipDeletePath(path); + } + + if (stat == Ok) + { + /* Steal the element from the created region. */ + memcpy(element, &new_region->node, sizeof(region_element)); + HeapFree(GetProcessHeap(), 0, new_region); + } + else + return stat; + } + /* Fall-through to do the actual conversion. */ + case RegionDataPath: + stat = GdipTransformMatrixPoints(matrix, + element->elementdata.pathdata.path->pathdata.Points, + element->elementdata.pathdata.path->pathdata.Count); + return stat; + default: + stat = transform_region_element(element->elementdata.combine.left, matrix); + if (stat == Ok) + stat = transform_region_element(element->elementdata.combine.right, matrix); + return stat; + } +} + GpStatus WINGDIPAPI GdipTransformRegion(GpRegion *region, GpMatrix *matrix) { - FIXME("(%p, %p): stub\n", region, matrix); + TRACE("(%p, %p)\n", region, matrix); - return NotImplemented; + if (!region || !matrix) + return InvalidParameter; + + return transform_region_element(®ion->node, matrix); } /* Translates GpRegion elements with specified offsets */ diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index efd2115..96ac40e 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -1123,6 +1123,113 @@ static void test_translate(void) ReleaseDC(0, hdc); } +static void test_transform(void) +{ + GpRegion *region, *region2; + GpMatrix *matrix; + GpGraphics *graphics; + GpPath *path; + GpRectF rectf; + GpStatus status; + HDC hdc = GetDC(0); + BOOL res; + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + + status = GdipCreatePath(FillModeAlternate, &path); + expect(Ok, status); + + status = GdipCreateRegion(®ion); + expect(Ok, status); + status = GdipCreateRegion(®ion2); + expect(Ok, status); + + status = GdipCreateMatrix(&matrix); + expect(Ok, status); + status = GdipScaleMatrix(matrix, 2.0, 3.0, MatrixOrderAppend); + expect(Ok, status); + + /* NULL */ + status = GdipTransformRegion(NULL, matrix); + expect(InvalidParameter, status); + + status = GdipTransformRegion(region, NULL); + expect(InvalidParameter, status); + + /* infinite */ + status = GdipTransformRegion(region, matrix); + expect(Ok, status); + + res = FALSE; + status = GdipIsEqualRegion(region, region2, graphics, &res); + expect(Ok, status); + ok(res, "Expected to be equal.\n"); + + /* empty */ + status = GdipSetEmpty(region); + expect(Ok, status); + status = GdipTransformRegion(region, matrix); + expect(Ok, status); + + status = GdipSetEmpty(region2); + expect(Ok, status); + + res = FALSE; + status = GdipIsEqualRegion(region, region2, graphics, &res); + expect(Ok, status); + ok(res, "Expected to be equal.\n"); + + /* rect */ + rectf.X = 10.0; + rectf.Y = 0.0; + rectf.Width = rectf.Height = 100.0; + status = GdipCombineRegionRect(region, &rectf, CombineModeReplace); + expect(Ok, status); + rectf.X = 20.0; + rectf.Y = 0.0; + rectf.Width = 200.0; + rectf.Height = 300.0; + status = GdipCombineRegionRect(region2, &rectf, CombineModeReplace); + expect(Ok, status); + status = GdipTransformRegion(region, matrix); + expect(Ok, status); + res = FALSE; + status = GdipIsEqualRegion(region, region2, graphics, &res); + expect(Ok, status); + ok(res, "Expected to be equal.\n"); + + /* path */ + status = GdipAddPathEllipse(path, 0.0, 10.0, 100.0, 150.0); + expect(Ok, status); + status = GdipCombineRegionPath(region, path, CombineModeReplace); + expect(Ok, status); + status = GdipResetPath(path); + expect(Ok, status); + status = GdipAddPathEllipse(path, 0.0, 30.0, 200.0, 450.0); + expect(Ok, status); + status = GdipCombineRegionPath(region2, path, CombineModeReplace); + expect(Ok, status); + status = GdipTransformRegion(region, matrix); + expect(Ok, status); + res = FALSE; + status = GdipIsEqualRegion(region, region2, graphics, &res); + expect(Ok, status); + ok(res, "Expected to be equal.\n"); + + status = GdipDeleteRegion(region); + expect(Ok, status); + status = GdipDeleteRegion(region2); + expect(Ok, status); + status = GdipDeleteGraphics(graphics); + expect(Ok, status); + status = GdipDeletePath(path); + expect(Ok, status); + status = GdipDeleteMatrix(matrix); + expect(Ok, status); + ReleaseDC(0, hdc); +} + static void test_getbounds(void) { GpRegion *region; @@ -1634,6 +1741,7 @@ START_TEST(region) test_gethrgn(); test_isequal(); test_translate(); + test_transform(); test_getbounds(); test_isvisiblepoint(); test_isvisiblerect();
1
0
0
0
Vincent Povirk : gdiplus: Return 0 from GdiplusShutdown.
by Alexandre Julliard
01 Oct '10
01 Oct '10
Module: wine Branch: master Commit: 1eb12cb08d29c8c823b72ec2b9a63d720a4e4349 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1eb12cb08d29c8c823b72ec2b…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Sep 30 13:02:22 2010 -0500 gdiplus: Return 0 from GdiplusShutdown. --- dlls/gdiplus/gdiplus.c | 8 ++++++++ dlls/gdiplus/gdiplus.spec | 2 +- 2 files changed, 9 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 9bb9fab..fb159be 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -121,6 +121,14 @@ void WINAPI GdiplusShutdown(ULONG_PTR token) /* FIXME: no object tracking */ } +/* "bricksntiles" expects a return value of 0, which native coincidentally gives */ +ULONG WINAPI GdiplusShutdown_wrapper(ULONG_PTR token) +{ + GdiplusShutdown(token); + + return 0; +} + /***************************************************** * GdipAlloc [GDIPLUS.@] */ diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index be1ec8c..b529d0d 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -626,5 +626,5 @@ @ stdcall GdipWindingModeOutline(ptr ptr float) @ stdcall GdiplusNotificationHook(ptr) @ stdcall GdiplusNotificationUnhook(ptr) -@ stdcall GdiplusShutdown(ptr) +@ stdcall GdiplusShutdown(ptr) GdiplusShutdown_wrapper @ stdcall GdiplusStartup(ptr ptr ptr)
1
0
0
0
Vincent Povirk : gdiplus: Don't try to free invalid or already-freed images .
by Alexandre Julliard
01 Oct '10
01 Oct '10
Module: wine Branch: master Commit: 9326fc13ca25a4c10bc122ef15041f90b636e6d3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9326fc13ca25a4c10bc122ef1…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Thu Sep 30 12:33:36 2010 -0500 gdiplus: Don't try to free invalid or already-freed images. --- dlls/gdiplus/image.c | 10 ++++++++-- dlls/gdiplus/tests/image.c | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 4ed226d..9b83d95 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -1958,8 +1958,6 @@ GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image) if(!image) return InvalidParameter; - if (image->picture) - IPicture_Release(image->picture); if (image->type == ImageTypeBitmap) { GdipFree(((GpBitmap*)image)->bitmapbits); @@ -1967,7 +1965,15 @@ GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image) DeleteDC(((GpBitmap*)image)->hdc); DeleteObject(((GpBitmap*)image)->hbitmap); } + else if (image->type != ImageTypeMetafile) + { + WARN("invalid image: %p\n", image); + return ObjectBusy; + } + if (image->picture) + IPicture_Release(image->picture); GdipFree(image->palette_entries); + image->type = ~0; GdipFree(image); return Ok; diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index f00d003..b2b1a0f 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -2250,6 +2250,29 @@ static void test_colorkey(void) GdipDisposeImageAttributes(imageattr); } +static void test_dispose(void) +{ + GpStatus stat; + GpImage *image; + char invalid_image[256]; + + stat = GdipDisposeImage(NULL); + expect(InvalidParameter, stat); + + stat = GdipCreateBitmapFromScan0(2, 2, 0, PixelFormat32bppARGB, NULL, (GpBitmap**)&image); + expect(Ok, stat); + + stat = GdipDisposeImage(image); + expect(Ok, stat); + + stat = GdipDisposeImage(image); + expect(ObjectBusy, stat); + + memset(invalid_image, 0, 256); + stat = GdipDisposeImage((GpImage*)invalid_image); + expect(ObjectBusy, stat); +} + START_TEST(image) { struct GdiplusStartupInput gdiplusStartupInput; @@ -2289,6 +2312,7 @@ START_TEST(image) test_rotateflip(); test_remaptable(); test_colorkey(); + test_dispose(); GdiplusShutdown(gdiplusToken); }
1
0
0
0
Juan Lang : winhttp: Set cipher strength bits when querying WINHTTP_OPTION_SECURITY_FLAGS.
by Alexandre Julliard
01 Oct '10
01 Oct '10
Module: wine Branch: master Commit: daa9d700def9ccc0abfc7ea11043e3c61fe09b5c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=daa9d700def9ccc0abfc7ea11…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Sep 29 10:36:00 2010 -0700 winhttp: Set cipher strength bits when querying WINHTTP_OPTION_SECURITY_FLAGS. --- dlls/winhttp/session.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index ef4ef08..5c13abd 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -580,6 +580,7 @@ static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buf case WINHTTP_OPTION_SECURITY_FLAGS: { DWORD flags; + int bits; if (!buffer || *buflen < sizeof(flags)) { @@ -591,7 +592,13 @@ static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buf flags = 0; if (hdr->flags & WINHTTP_FLAG_SECURE) flags |= SECURITY_FLAG_SECURE; flags |= request->netconn.security_flags; - /* FIXME: set connection cipher strength (SECURITY_FLAG_STRENGTH_*) */ + bits = netconn_get_cipher_strength( &request->netconn ); + if (bits >= 128) + flags |= SECURITY_FLAG_STRENGTH_STRONG; + else if (bits >= 56) + flags |= SECURITY_FLAG_STRENGTH_MEDIUM; + else + flags |= SECURITY_FLAG_STRENGTH_WEAK; *(DWORD *)buffer = flags; *buflen = sizeof(flags); return TRUE;
1
0
0
0
Juan Lang : winhttp: Support querying the cipher strength of an SSL connection.
by Alexandre Julliard
01 Oct '10
01 Oct '10
Module: wine Branch: master Commit: 4127062a3eaf9938aafc7b3c4909d3298e11a156 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4127062a3eaf9938aafc7b3c4…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Sep 29 09:54:34 2010 -0700 winhttp: Support querying the cipher strength of an SSL connection. --- dlls/winhttp/net.c | 19 +++++++++++++++++++ dlls/winhttp/session.c | 4 ++-- dlls/winhttp/winhttp_private.h | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index 4812979..7db7a66 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -124,6 +124,8 @@ MAKE_FUNCPTR( SSL_get_ex_data_X509_STORE_CTX_idx ); MAKE_FUNCPTR( SSL_get_peer_certificate ); MAKE_FUNCPTR( SSL_CTX_set_default_verify_paths ); MAKE_FUNCPTR( SSL_CTX_set_verify ); +MAKE_FUNCPTR( SSL_get_current_cipher ); +MAKE_FUNCPTR( SSL_CIPHER_get_bits ); MAKE_FUNCPTR( CRYPTO_num_locks ); MAKE_FUNCPTR( CRYPTO_set_id_callback ); @@ -464,6 +466,8 @@ BOOL netconn_init( netconn_t *conn, BOOL secure ) LOAD_FUNCPTR( SSL_get_peer_certificate ); LOAD_FUNCPTR( SSL_CTX_set_default_verify_paths ); LOAD_FUNCPTR( SSL_CTX_set_verify ); + LOAD_FUNCPTR( SSL_get_current_cipher ); + LOAD_FUNCPTR( SSL_CIPHER_get_bits ); #undef LOAD_FUNCPTR #define LOAD_FUNCPTR(x) \ @@ -1067,3 +1071,18 @@ const void *netconn_get_certificate( netconn_t *conn ) return NULL; #endif } + +int netconn_get_cipher_strength( netconn_t *conn ) +{ +#ifdef SONAME_LIBSSL + SSL_CIPHER *cipher; + int bits = 0; + + if (!conn->secure) return 0; + if (!(cipher = pSSL_get_current_cipher( conn->ssl_conn ))) return 0; + pSSL_CIPHER_get_bits( cipher, &bits ); + return bits; +#else + return 0; +#endif +} diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 7f6350f..ef4ef08 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -641,7 +641,7 @@ static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buf else ci->lpszSignatureAlgName = NULL; ci->lpszEncryptionAlgName = NULL; - ci->dwKeySize = 128; + ci->dwKeySize = netconn_get_cipher_strength( &request->netconn ); CertFreeCertificateContext( cert ); *buflen = sizeof(*ci); @@ -656,7 +656,7 @@ static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buf return FALSE; } - *(DWORD *)buffer = 128; /* FIXME */ + *(DWORD *)buffer = netconn_get_cipher_strength( &request->netconn ); *buflen = sizeof(DWORD); return TRUE; } diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index c2dfdbe..5da3ae1 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -229,6 +229,7 @@ BOOL netconn_secure_connect( netconn_t *, WCHAR * ); BOOL netconn_send( netconn_t *, const void *, size_t, int, int * ); DWORD netconn_set_timeout( netconn_t *, BOOL, int ); const void *netconn_get_certificate( netconn_t * ); +int netconn_get_cipher_strength( netconn_t * ); BOOL set_cookies( request_t *, const WCHAR * ); BOOL add_cookie_headers( request_t * );
1
0
0
0
Juan Lang : winhttp: Return signature algorithm name in WINHTTP_CERTIFICATE_INFO.
by Alexandre Julliard
01 Oct '10
01 Oct '10
Module: wine Branch: master Commit: 302dd345fed576b70ba4d0b49fa6f6773fd682bb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=302dd345fed576b70ba4d0b49…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Sep 29 09:34:04 2010 -0700 winhttp: Return signature algorithm name in WINHTTP_CERTIFICATE_INFO. --- dlls/winhttp/session.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index bed19a1..7f6350f 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -615,6 +615,7 @@ static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buf case WINHTTP_OPTION_SECURITY_CERTIFICATE_STRUCT: { const CERT_CONTEXT *cert; + const CRYPT_OID_INFO *oidInfo; WINHTTP_CERTIFICATE_INFO *ci = buffer; FIXME("partial stub\n"); @@ -632,7 +633,13 @@ static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buf ci->lpszSubjectInfo = blob_to_str( cert->dwCertEncodingType, &cert->pCertInfo->Subject ); ci->lpszIssuerInfo = blob_to_str( cert->dwCertEncodingType, &cert->pCertInfo->Issuer ); ci->lpszProtocolName = NULL; - ci->lpszSignatureAlgName = NULL; + oidInfo = CryptFindOIDInfo( CRYPT_OID_INFO_OID_KEY, + cert->pCertInfo->SignatureAlgorithm.pszObjId, + 0 ); + if (oidInfo) + ci->lpszSignatureAlgName = (LPWSTR)oidInfo->pwszName; + else + ci->lpszSignatureAlgName = NULL; ci->lpszEncryptionAlgName = NULL; ci->dwKeySize = 128;
1
0
0
0
Juan Lang : winhttp: More completely implement querying WINHTTP_OPTION_SECURITY_FLAGS.
by Alexandre Julliard
01 Oct '10
01 Oct '10
Module: wine Branch: master Commit: b4851a8e4a8645c8f2695164b498061d392869af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b4851a8e4a8645c8f2695164b…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Sep 29 09:22:26 2010 -0700 winhttp: More completely implement querying WINHTTP_OPTION_SECURITY_FLAGS. --- dlls/winhttp/session.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index e0c1c2f..bed19a1 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -590,6 +590,8 @@ static BOOL request_query_option( object_header_t *hdr, DWORD option, LPVOID buf flags = 0; if (hdr->flags & WINHTTP_FLAG_SECURE) flags |= SECURITY_FLAG_SECURE; + flags |= request->netconn.security_flags; + /* FIXME: set connection cipher strength (SECURITY_FLAG_STRENGTH_*) */ *(DWORD *)buffer = flags; *buflen = sizeof(flags); return TRUE;
1
0
0
0
Juan Lang : winhttp: Verify SSL policy of chains whose errors were ignored.
by Alexandre Julliard
01 Oct '10
01 Oct '10
Module: wine Branch: master Commit: ee2e9cc339784a9dfbed920cb692b811f7faad9b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ee2e9cc339784a9dfbed920cb…
Author: Juan Lang <juan.lang(a)gmail.com> Date: Wed Sep 29 08:24:07 2010 -0700 winhttp: Verify SSL policy of chains whose errors were ignored. --- dlls/winhttp/net.c | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index 398c0b7..4812979 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -308,12 +308,19 @@ static DWORD netconn_verify_cert( PCCERT_CONTEXT cert, HCERTSTORE store, else if (chain->TrustStatus.dwErrorStatus & ~supportedErrors) err = ERROR_WINHTTP_SECURE_INVALID_CERT; } - else + if (!err) { CERT_CHAIN_POLICY_PARA policyPara; SSL_EXTRA_CERT_CHAIN_POLICY_PARA sslExtraPolicyPara; CERT_CHAIN_POLICY_STATUS policyStatus; + CERT_CHAIN_CONTEXT chainCopy; + /* Clear chain->TrustStatus.dwErrorStatus so + * CertVerifyCertificateChainPolicy will verify additional checks + * rather than stopping with an existing, ignored error. + */ + memcpy(&chainCopy, chain, sizeof(chainCopy)); + chainCopy.TrustStatus.dwErrorStatus = 0; sslExtraPolicyPara.u.cbSize = sizeof(sslExtraPolicyPara); sslExtraPolicyPara.dwAuthType = AUTHTYPE_SERVER; sslExtraPolicyPara.pwszServerName = server; @@ -321,7 +328,7 @@ static DWORD netconn_verify_cert( PCCERT_CONTEXT cert, HCERTSTORE store, policyPara.dwFlags = 0; policyPara.pvExtraPolicyPara = &sslExtraPolicyPara; ret = CertVerifyCertificateChainPolicy( CERT_CHAIN_POLICY_SSL, - chain, &policyPara, + &chainCopy, &policyPara, &policyStatus ); /* Any error in the policy status indicates that the * policy couldn't be verified.
1
0
0
0
← Newer
1
...
112
113
114
115
116
117
118
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
Results per page:
10
25
50
100
200