ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
April 2014
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
15 participants
492 discussions
Start a n
N
ew thread
[akhaldi] 62888: [GDIPLUS] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 15:42:03 2014 New Revision: 62888 URL:
http://svn.reactos.org/svn/reactos?rev=62888&view=rev
Log: [GDIPLUS] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/gdiplus/brush.c trunk/reactos/dll/win32/gdiplus/font.c trunk/reactos/dll/win32/gdiplus/gdiplus.c trunk/reactos/dll/win32/gdiplus/gdiplus_private.h trunk/reactos/dll/win32/gdiplus/graphics.c trunk/reactos/dll/win32/gdiplus/graphicspath.c trunk/reactos/dll/win32/gdiplus/image.c trunk/reactos/dll/win32/gdiplus/metafile.c trunk/reactos/dll/win32/gdiplus/pathiterator.c trunk/reactos/dll/win32/gdiplus/region.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/gdiplus/brush.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/brush.c?…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/brush.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/brush.c [iso-8859-1] Tue Apr 22 15:42:03 2014 @@ -756,8 +756,6 @@ /****************************************************************************** * GdipCreateTextureIA [GDIPLUS.@] - * - * FIXME: imageattr ignored */ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image, GDIPCONST GpImageAttributes *imageattr, REAL x, REAL y, REAL width, @@ -855,6 +853,7 @@ imageattr->wrap = wrapmode; stat = GdipCreateTextureIA(image, imageattr, x, y, width, height, texture); + GdipDisposeImageAttributes(imageattr); } return stat; Modified: trunk/reactos/dll/win32/gdiplus/font.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/font.c?r…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/font.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/font.c [iso-8859-1] Tue Apr 22 15:42:03 2014 @@ -1112,15 +1112,39 @@ /***************************************************************************** * GdipPrivateAddFontFile [GDIPLUS.@] */ -GpStatus WINGDIPAPI GdipPrivateAddFontFile(GpFontCollection* fontCollection, - GDIPCONST WCHAR* filename) -{ - FIXME("stub: %p, %s\n", fontCollection, debugstr_w(filename)); - - if (!(fontCollection && filename)) - return InvalidParameter; - - return NotImplemented; +GpStatus WINGDIPAPI GdipPrivateAddFontFile(GpFontCollection *collection, GDIPCONST WCHAR *name) +{ + HANDLE file, mapping; + LARGE_INTEGER size; + void *mem; + GpStatus status; + + TRACE("%p, %s\n", collection, debugstr_w(name)); + + if (!collection || !name) return InvalidParameter; + + file = CreateFileW(name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); + if (file == INVALID_HANDLE_VALUE) return InvalidParameter; + + if (!GetFileSizeEx(file, &size) || size.u.HighPart) + { + CloseHandle(file); + return InvalidParameter; + } + + mapping = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, NULL); + CloseHandle(file); + if (!mapping) return InvalidParameter; + + mem = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0); + CloseHandle(mapping); + if (!mem) return InvalidParameter; + + /* GdipPrivateAddMemoryFont creates a copy of the memory block */ + status = GdipPrivateAddMemoryFont(collection, mem, size.u.LowPart); + UnmapViewOfFile(mem); + + return status; } #define TT_PLATFORM_APPLE_UNICODE 0 Modified: trunk/reactos/dll/win32/gdiplus/gdiplus.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus.…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/gdiplus.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/gdiplus.c [iso-8859-1] Tue Apr 22 15:42:03 2014 @@ -357,7 +357,7 @@ } /* Calculates Bezier points from cardinal spline points. */ -void calc_curve_bezier(CONST GpPointF *pts, REAL tension, REAL *x1, +void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1, REAL *y1, REAL *x2, REAL *y2) { REAL xdiff, ydiff; @@ -442,7 +442,7 @@ case RegionDataRect: break; case RegionDataPath: - GdipDeletePath(element->elementdata.pathdata.path); + GdipDeletePath(element->elementdata.path); break; case RegionDataEmptyRect: case RegionDataInfiniteRect: @@ -456,13 +456,13 @@ } } -const char *debugstr_rectf(CONST RectF* rc) +const char *debugstr_rectf(const RectF* rc) { if (!rc) return "(null)"; return wine_dbg_sprintf("(%0.2f,%0.2f,%0.2f,%0.2f)", rc->X, rc->Y, rc->Width, rc->Height); } -const char *debugstr_pointf(CONST PointF* pt) +const char *debugstr_pointf(const PointF* pt) { if (!pt) return "(null)"; return wine_dbg_sprintf("(%0.2f,%0.2f)", pt->X, pt->Y); Modified: trunk/reactos/dll/win32/gdiplus/gdiplus_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/gdiplus_…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/gdiplus_private.h [iso-8859-1] Tue Apr 22 15:42:03 2014 @@ -65,10 +65,12 @@ extern GpStatus METAFILE_GetGraphicsContext(GpMetafile* metafile, GpGraphics **result) DECLSPEC_HIDDEN; extern GpStatus METAFILE_GetDC(GpMetafile* metafile, HDC *hdc) DECLSPEC_HIDDEN; extern GpStatus METAFILE_ReleaseDC(GpMetafile* metafile, HDC hdc) DECLSPEC_HIDDEN; +extern GpStatus METAFILE_FillRectangles(GpMetafile* metafile, GpBrush* brush, + GDIPCONST GpRectF* rects, INT count) DECLSPEC_HIDDEN; +extern GpStatus METAFILE_SetPageTransform(GpMetafile* metafile, GpUnit unit, REAL scale) DECLSPEC_HIDDEN; extern GpStatus METAFILE_GraphicsDeleted(GpMetafile* metafile) DECLSPEC_HIDDEN; -extern MetafileType METAFILE_GetEmfType(HENHMETAFILE hemf) DECLSPEC_HIDDEN; - -extern void calc_curve_bezier(CONST GpPointF *pts, REAL tension, REAL *x1, + +extern void calc_curve_bezier(const GpPointF *pts, REAL tension, REAL *x1, REAL *y1, REAL *x2, REAL *y2) DECLSPEC_HIDDEN; extern void calc_curve_bezier_endp(REAL xend, REAL yend, REAL xadj, REAL yadj, REAL tension, REAL *x, REAL *y) DECLSPEC_HIDDEN; @@ -122,9 +124,9 @@ return (a<<24)|(r<<16)|(g<<8)|b; } -extern const char *debugstr_rectf(CONST RectF* rc) DECLSPEC_HIDDEN; - -extern const char *debugstr_pointf(CONST PointF* pt) DECLSPEC_HIDDEN; +extern const char *debugstr_rectf(const RectF* rc) DECLSPEC_HIDDEN; + +extern const char *debugstr_pointf(const PointF* pt) DECLSPEC_HIDDEN; extern void convert_32bppARGB_to_32bppPARGB(UINT width, UINT height, BYTE *dst_bits, INT dst_stride, const BYTE *src_bits, INT src_stride) DECLSPEC_HIDDEN; @@ -304,8 +306,12 @@ GpGraphics *playback_graphics; HDC playback_dc; GpPointF playback_points[3]; + GpRectF src_rect; HANDLETABLE *handle_table; int handle_count; + GpMatrix *world_transform; + GpUnit page_unit; + REAL page_scale; }; struct GpBitmap{ @@ -412,17 +418,7 @@ union { GpRectF rect; - struct - { - GpPath* path; - struct - { - DWORD size; - DWORD magic; - DWORD count; - DWORD flags; - } pathheader; - } pathdata; + GpPath *path; struct { struct region_element *left; /* the original region */ @@ -432,13 +428,7 @@ }; struct GpRegion{ - struct - { - DWORD size; - DWORD checksum; - DWORD magic; - DWORD num_children; - } header; + DWORD num_children; region_element node; }; Modified: trunk/reactos/dll/win32/gdiplus/graphics.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] Tue Apr 22 15:42:03 2014 @@ -617,7 +617,7 @@ return (a << 24) | (r << 16) | (g << 8) | b; } -static int color_is_gray(ARGB color) +static BOOL color_is_gray(ARGB color) { unsigned char r, g, b; @@ -940,12 +940,12 @@ return (p1->X - p2->X) * (p2->Y - y) / (p2->Y - p1->Y) + p2->X; } -static INT brush_can_fill_path(GpBrush *brush) +static BOOL brush_can_fill_path(GpBrush *brush) { switch (brush->bt) { case BrushTypeSolidColor: - return 1; + return TRUE; case BrushTypeHatchFill: { GpHatch *hatch = (GpHatch*)brush; @@ -956,7 +956,7 @@ case BrushTypeTextureFill: /* Gdi32 isn't much help with these, so we should use brush_fill_pixels instead. */ default: - return 0; + return FALSE; } } @@ -1008,7 +1008,7 @@ } } -static INT brush_can_fill_pixels(GpBrush *brush) +static BOOL brush_can_fill_pixels(GpBrush *brush) { switch (brush->bt) { @@ -1017,9 +1017,9 @@ case BrushTypeLinearGradient: case BrushTypeTextureFill: case BrushTypePathGradient: - return 1; + return TRUE; default: - return 0; + return FALSE; } } @@ -1239,7 +1239,7 @@ INT min_y, max_y, min_x, max_x; INT x, y; ARGB outer_color; - static int transform_fixme_once; + static BOOL transform_fixme_once; if (fill->focus.X != 0.0 || fill->focus.Y != 0.0) { @@ -1276,7 +1276,7 @@ if (!is_identity) { FIXME("path gradient transform not implemented\n"); - transform_fixme_once = 1; + transform_fixme_once = TRUE; } } @@ -1310,7 +1310,7 @@ for (i=0; i<flat_path->pathdata.Count; i++) { int start_center_line=0, end_center_line=0; - int seen_start=0, seen_end=0, seen_center=0; + BOOL seen_start = FALSE, seen_end = FALSE, seen_center = FALSE; REAL center_distance; ARGB start_color, end_color; REAL dy, dx; @@ -1370,17 +1370,17 @@ if (!seen_start && yf >= start_point.Y) { - seen_start = 1; + seen_start = TRUE; start_center_line ^= 1; } if (!seen_end && yf >= end_point.Y) { - seen_end = 1; + seen_end = TRUE; end_center_line ^= 1; } if (!seen_center && yf >= center_point.Y) { - seen_center = 1; + seen_center = TRUE; start_center_line ^= 1; end_center_line ^= 1; } @@ -2243,120 +2243,6 @@ return GdipCreateFromHWND(hwnd, graphics); } -GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE hemf, BOOL delete, - GpMetafile **metafile) -{ - ENHMETAHEADER header; - MetafileType metafile_type; - - TRACE("(%p,%i,%p)\n", hemf, delete, metafile); - - if(!hemf || !metafile) - return InvalidParameter; - - if (GetEnhMetaFileHeader(hemf, sizeof(header), &header) == 0) - return GenericError; - - metafile_type = METAFILE_GetEmfType(hemf); - - if (metafile_type == MetafileTypeInvalid) - return GenericError; - - *metafile = GdipAlloc(sizeof(GpMetafile)); - if (!*metafile) - return OutOfMemory; - - (*metafile)->image.type = ImageTypeMetafile; - (*metafile)->image.format = ImageFormatEMF; - (*metafile)->image.frame_count = 1; - (*metafile)->image.xres = (REAL)header.szlDevice.cx; - (*metafile)->image.yres = (REAL)header.szlDevice.cy; - (*metafile)->bounds.X = (REAL)header.rclBounds.left; - (*metafile)->bounds.Y = (REAL)header.rclBounds.top; - (*metafile)->bounds.Width = (REAL)(header.rclBounds.right - header.rclBounds.left); - (*metafile)->bounds.Height = (REAL)(header.rclBounds.bottom - header.rclBounds.top); - (*metafile)->unit = UnitPixel; - (*metafile)->metafile_type = metafile_type; - (*metafile)->hemf = hemf; - (*metafile)->preserve_hemf = !delete; - - TRACE("<-- %p\n", *metafile); - - return Ok; -} - -GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete, - GDIPCONST WmfPlaceableFileHeader * placeable, GpMetafile **metafile) -{ - UINT read; - BYTE *copy; - HENHMETAFILE hemf; - GpStatus retval = Ok; - - TRACE("(%p, %d, %p, %p)\n", hwmf, delete, placeable, metafile); - - if(!hwmf || !metafile || !placeable) - return InvalidParameter; - - *metafile = NULL; - read = GetMetaFileBitsEx(hwmf, 0, NULL); - if(!read) - return GenericError; - copy = GdipAlloc(read); - GetMetaFileBitsEx(hwmf, read, copy); - - hemf = SetWinMetaFileBits(read, copy, NULL, NULL); - GdipFree(copy); - - /* FIXME: We should store and use hwmf instead of converting to hemf */ - retval = GdipCreateMetafileFromEmf(hemf, TRUE, metafile); - - if (retval == Ok) - { - (*metafile)->image.xres = (REAL)placeable->Inch; - (*metafile)->image.yres = (REAL)placeable->Inch; - (*metafile)->bounds.X = ((REAL)placeable->BoundingBox.Left) / ((REAL)placeable->Inch); - (*metafile)->bounds.Y = ((REAL)placeable->BoundingBox.Top) / ((REAL)placeable->Inch); - (*metafile)->bounds.Width = (REAL)(placeable->BoundingBox.Right - - placeable->BoundingBox.Left); - (*metafile)->bounds.Height = (REAL)(placeable->BoundingBox.Bottom - - placeable->BoundingBox.Top); - (*metafile)->metafile_type = MetafileTypeWmfPlaceable; - (*metafile)->image.format = ImageFormatWMF; - - if (delete) DeleteMetaFile(hwmf); - } - else - DeleteEnhMetaFile(hemf); - return retval; -} - -GpStatus WINGDIPAPI GdipCreateMetafileFromWmfFile(GDIPCONST WCHAR *file, - GDIPCONST WmfPlaceableFileHeader * placeable, GpMetafile **metafile) -{ - HMETAFILE hmf = GetMetaFileW(file); - - TRACE("(%s, %p, %p)\n", debugstr_w(file), placeable, metafile); - - if(!hmf) return InvalidParameter; - - return GdipCreateMetafileFromWmf(hmf, TRUE, placeable, metafile); -} - -GpStatus WINGDIPAPI GdipCreateMetafileFromFile(GDIPCONST WCHAR *file, - GpMetafile **metafile) -{ - FIXME("(%p, %p): stub\n", file, metafile); - return NotImplemented; -} - -GpStatus WINGDIPAPI GdipCreateMetafileFromStream(IStream *stream, - GpMetafile **metafile) -{ - FIXME("(%p, %p): stub\n", stream, metafile); - return NotImplemented; -} - GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR * filename, UINT access, IStream **stream) { @@ -2405,6 +2291,12 @@ } GdipDeleteRegion(graphics->clip); + + /* Native returns ObjectBusy on the second free, instead of crashing as we'd + * do otherwise, but we can't have that in the test suite because it means + * accessing freed memory. */ + graphics->busy = TRUE; + GdipFree(graphics); return Ok; @@ -2885,9 +2777,33 @@ debugstr_pointf(&points[2])); memcpy(ptf, points, 3 * sizeof(GpPointF)); + + /* Ensure source width/height is positive */ + if (srcwidth < 0) + { + GpPointF tmp = ptf[1]; + srcx = srcx + srcwidth; + srcwidth = -srcwidth; + ptf[2].X = ptf[2].X + ptf[1].X - ptf[0].X; + ptf[2].Y = ptf[2].Y + ptf[1].Y - ptf[0].Y; + ptf[1] = ptf[0]; + ptf[0] = tmp; + } + + if (srcheight < 0) + { + GpPointF tmp = ptf[2]; + srcy = srcy + srcheight; + srcheight = -srcheight; + ptf[1].X = ptf[1].X + ptf[2].X - ptf[0].X; + ptf[1].Y = ptf[1].Y + ptf[2].Y - ptf[0].Y; + ptf[2] = ptf[0]; + ptf[0] = tmp; + } + ptf[3].X = ptf[2].X + ptf[1].X - ptf[0].X; ptf[3].Y = ptf[2].Y + ptf[1].Y - ptf[0].Y; - if (!srcwidth || !srcheight || ptf[3].X == ptf[0].X || ptf[3].Y == ptf[0].Y) + if (!srcwidth || !srcheight || (ptf[3].X == ptf[0].X && ptf[3].Y == ptf[0].Y)) return Ok; transform_and_round_points(graphics, pti, ptf, 4); @@ -2919,7 +2835,7 @@ else if (image->type == ImageTypeBitmap) { GpBitmap* bitmap = (GpBitmap*)image; - int use_software=0; + BOOL use_software = FALSE; TRACE("graphics: %.2fx%.2f dpi, fmt %#x, scale %f, image: %.2fx%.2f dpi, fmt %#x, color %08x\n", graphics->xres, graphics->yres, @@ -2933,11 +2849,12 @@ ptf[1].X - ptf[0].X != srcwidth || ptf[2].Y - ptf[0].Y != srcheight || srcx < 0 || srcy < 0 || srcx + srcwidth > bitmap->width || srcy + srcheight > bitmap->height) - use_software = 1; + use_software = TRUE; if (use_software) { RECT dst_area; + GpRectF graphics_bounds; GpRect src_area; int i, x, y, src_stride, dst_stride; GpMatrix dst_to_src; @@ -2963,7 +2880,17 @@ if (dst_area.bottom < pti[i].y) dst_area.bottom = pti[i].y; } + stat = get_graphics_bounds(graphics, &graphics_bounds); + if (stat != Ok) return stat; + + if (graphics_bounds.X > dst_area.left) dst_area.left = floorf(graphics_bounds.X); + if (graphics_bounds.Y > dst_area.top) dst_area.top = floorf(graphics_bounds.Y); + if (graphics_bounds.X + graphics_bounds.Width < dst_area.right) dst_area.right = ceilf(graphics_bounds.X + graphics_bounds.Width); + if (graphics_bounds.Y + graphics_bounds.Height < dst_area.bottom) dst_area.bottom = ceilf(graphics_bounds.Y + graphics_bounds.Height); + TRACE("dst_area: %s\n", wine_dbgstr_rect(&dst_area)); + + if (IsRectEmpty(&dst_area)) return Ok; m11 = (ptf[1].X - ptf[0].X) / srcwidth; m21 = (ptf[2].X - ptf[0].X) / srcheight; @@ -3010,8 +2937,7 @@ if (stat != Ok) { - if (src_data != dst_data) - GdipFree(src_data); + GdipFree(src_data); GdipFree(dst_data); return stat; } @@ -3060,7 +2986,7 @@ else { HDC hdc; - int temp_hdc=0, temp_bitmap=0; + BOOL temp_hdc = FALSE, temp_bitmap = FALSE; HBITMAP hbitmap, old_hbm=NULL; if (!(bitmap->format == PixelFormat16bppRGB555 || @@ -3074,8 +3000,8 @@ /* we can't draw a bitmap of this format directly */ hdc = CreateCompatibleDC(0); - temp_hdc = 1; - temp_bitmap = 1; + temp_hdc = TRUE; + temp_bitmap = TRUE; bih.biSize = sizeof(BITMAPINFOHEADER); bih.biWidth = bitmap->width; @@ -3109,7 +3035,7 @@ else { GdipCreateHBITMAPFromBitmap(bitmap, &hbitmap, 0); - temp_bitmap = 1; + temp_bitmap = TRUE; } hdc = bitmap->hdc; @@ -3338,6 +3264,7 @@ { INT save_state; GpStatus retval; + HRGN hrgn=NULL; TRACE("(%p, %p, %p)\n", graphics, pen, path); @@ -3355,10 +3282,20 @@ save_state = prepare_dc(graphics, pen); + retval = get_clip_hrgn(graphics, &hrgn); + + if (retval != Ok) + goto end; + + if (hrgn) + ExtSelectClipRgn(graphics->hdc, hrgn, RGN_AND); + retval = draw_poly(graphics, pen, path->pathdata.Points, path->pathdata.Types, path->pathdata.Count, TRUE); +end: restore_dc(graphics, save_state); + DeleteObject(hrgn); return retval; } @@ -3603,6 +3540,7 @@ { INT save_state; GpStatus retval; + HRGN hrgn=NULL; if(!graphics->hdc || !brush_can_fill_path(brush)) return NotImplemented; @@ -3612,6 +3550,14 @@ SetPolyFillMode(graphics->hdc, (path->fill == FillModeAlternate ? ALTERNATE : WINDING)); + retval = get_clip_hrgn(graphics, &hrgn); + + if (retval != Ok) + goto end; + + if (hrgn) + ExtSelectClipRgn(graphics->hdc, hrgn, RGN_AND); + BeginPath(graphics->hdc); retval = draw_poly(graphics, NULL, path->pathdata.Points, path->pathdata.Types, path->pathdata.Count, FALSE); @@ -3626,6 +3572,7 @@ end: RestoreDC(graphics->hdc, save_state); + DeleteObject(hrgn); return retval; } @@ -3795,38 +3742,31 @@ GpStatus WINGDIPAPI GdipFillRectangle(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height) { - GpStatus stat; - GpPath *path; + GpRectF rect; TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, brush, x, y, width, height); - if(!graphics || !brush) - return InvalidParameter; - - if(graphics->busy) - return ObjectBusy; - - stat = GdipCreatePath(FillModeAlternate, &path); - - if (stat == Ok) - { - stat = GdipAddPathRectangle(path, x, y, width, height); - - if (stat == Ok) - stat = GdipFillPath(graphics, brush, path); - - GdipDeletePath(path); - } - - return stat; + rect.X = x; + rect.Y = y; + rect.Width = width; + rect.Height = height; + + return GdipFillRectangles(graphics, brush, &rect, 1); } GpStatus WINGDIPAPI GdipFillRectangleI(GpGraphics *graphics, GpBrush *brush, INT x, INT y, INT width, INT height) { + GpRectF rect; + TRACE("(%p, %p, %d, %d, %d, %d)\n", graphics, brush, x, y, width, height); - return GdipFillRectangle(graphics, brush, x, y, width, height); + rect.X = (REAL)x; + rect.Y = (REAL)y; + rect.Width = (REAL)width; + rect.Height = (REAL)height; + + return GdipFillRectangles(graphics, brush, &rect, 1); } GpStatus WINGDIPAPI GdipFillRectangles(GpGraphics *graphics, GpBrush *brush, GDIPCONST GpRectF *rects, @@ -3837,8 +3777,15 @@ TRACE("(%p, %p, %p, %d)\n", graphics, brush, rects, count); - if(!rects) - return InvalidParameter; + if(!graphics || !brush || !rects || count <= 0) + return InvalidParameter; + + if (graphics->image && graphics->image->type == ImageTypeMetafile) + { + status = METAFILE_FillRectangles((GpMetafile*)graphics->image, brush, rects, count); + /* FIXME: Add gdi32 drawing. */ + return status; + } status = GdipCreatePath(FillModeAlternate, &path); if (status != Ok) return status; @@ -4440,12 +4387,24 @@ INT *hotkeyprefix_offsets=NULL; INT hotkeyprefix_count=0; INT hotkeyprefix_pos=0, hotkeyprefix_end_pos=0; - int seen_prefix=0; + BOOL seen_prefix = FALSE; + GpStringFormat *dyn_format=NULL; if(length == -1) length = lstrlenW(string); stringdup = GdipAlloc((length + 1) * sizeof(WCHAR)); if(!stringdup) return OutOfMemory; + + if (!format) + { + stat = GdipStringFormatGetGenericDefault(&dyn_format); + if (stat != Ok) + { + GdipFree(stringdup); + return stat; + } + format = dyn_format; + } nwidth = rect->Width; nheight = rect->Height; @@ -4455,10 +4414,7 @@ if (!nheight) nheight = INT_MAX; } - if (format) - hkprefix = format->hkprefix; - else - hkprefix = HotkeyPrefixNone; + hkprefix = format->hkprefix; if (hkprefix == HotkeyPrefixShow) { @@ -4487,11 +4443,11 @@ hotkeyprefix_offsets[hotkeyprefix_count++] = j; else if (!seen_prefix && hkprefix != HotkeyPrefixNone && string[i] == '&') { - seen_prefix = 1; + seen_prefix = TRUE; continue; } - seen_prefix = 0; + seen_prefix = FALSE; stringdup[j] = string[i]; j++; @@ -4499,8 +4455,7 @@ length = j; - if (format) halign = format->align; - else halign = StringAlignmentNear; + halign = format->align; while(sum < length){ GetTextExtentExPointW(hdc, stringdup + sum, length - sum, @@ -4547,7 +4502,11 @@ bounds.Width = size.cx; if(height + size.cy > nheight) + { + if (format->attr & StringFormatFlagsLineLimit) + break; bounds.Height = nheight - (height + size.cy); + } else bounds.Height = size.cy; @@ -4589,13 +4548,13 @@ break; /* Stop if this was a linewrap (but not if it was a linebreak). */ - if ((lret == fitcpy) && format && - (format->attr & (StringFormatFlagsNoWrap | StringFormatFlagsLineLimit))) + if ((lret == fitcpy) && (format->attr & StringFormatFlagsNoWrap)) break; } GdipFree(stringdup); GdipFree(hotkeyprefix_offsets); + GdipDeleteStringFormat(dyn_format); return stat; } @@ -5239,6 +5198,8 @@ GpStatus WINGDIPAPI GdipSetPageScale(GpGraphics *graphics, REAL scale) { + GpStatus stat; + TRACE("(%p, %.2f)\n", graphics, scale); if(!graphics || (scale <= 0.0)) @@ -5247,6 +5208,13 @@ if(graphics->busy) return ObjectBusy; + if (graphics->image && graphics->image->type == ImageTypeMetafile) + { + stat = METAFILE_SetPageTransform((GpMetafile*)graphics->image, graphics->unit, scale); + if (stat != Ok) + return stat; + } + graphics->scale = scale; return Ok; @@ -5254,6 +5222,8 @@ GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics *graphics, GpUnit unit) { + GpStatus stat; + TRACE("(%p, %d)\n", graphics, unit); if(!graphics) @@ -5264,6 +5234,13 @@ if(unit == UnitWorld) return InvalidParameter; + + if (graphics->image && graphics->image->type == ImageTypeMetafile) + { + stat = METAFILE_SetPageTransform((GpMetafile*)graphics->image, unit, graphics->scale); + if (stat != Ok) + return stat; + } graphics->unit = unit; @@ -5526,19 +5503,6 @@ GdipDeleteRegion(clip); } return status; -} - -GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit(GpMetafile *metafile, - UINT limitDpi) -{ - static int calls; - - TRACE("(%p,%u)\n", metafile, limitDpi); - - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; } GpStatus WINGDIPAPI GdipDrawPolygon(GpGraphics *graphics,GpPen *pen,GDIPCONST GpPointF *points, @@ -6204,15 +6168,18 @@ if (glyphsize > max_glyphsize) max_glyphsize = glyphsize; - left = pti[i].x + glyphmetrics.gmptGlyphOrigin.x; - top = pti[i].y - glyphmetrics.gmptGlyphOrigin.y; - right = pti[i].x + glyphmetrics.gmptGlyphOrigin.x + glyphmetrics.gmBlackBoxX; - bottom = pti[i].y - glyphmetrics.gmptGlyphOrigin.y + glyphmetrics.gmBlackBoxY; - - if (left < min_x) min_x = left; - if (top < min_y) min_y = top; - if (right > max_x) max_x = right; - if (bottom > max_y) max_y = bottom; + if (glyphsize != 0) + { + left = pti[i].x + glyphmetrics.gmptGlyphOrigin.x; + top = pti[i].y - glyphmetrics.gmptGlyphOrigin.y; + right = pti[i].x + glyphmetrics.gmptGlyphOrigin.x + glyphmetrics.gmBlackBoxX; + bottom = pti[i].y - glyphmetrics.gmptGlyphOrigin.y + glyphmetrics.gmBlackBoxY; + + if (left < min_x) min_x = left; + if (top < min_y) min_y = top; + if (right > max_x) max_x = right; + if (bottom > max_y) max_y = bottom; + } if (i+1 < length && (flags & DriverStringOptionsRealizedAdvance) == DriverStringOptionsRealizedAdvance) { @@ -6220,6 +6187,10 @@ pti[i+1].y = pti[i].y + glyphmetrics.gmCellIncY; } } + + if (max_glyphsize == 0) + /* Nothing to draw. */ + return Ok; glyph_mask = GdipAlloc(max_glyphsize); text_mask = GdipAlloc((max_x - min_x) * (max_y - min_y)); @@ -6238,10 +6209,14 @@ /* Generate a mask for the text */ for (i=0; i<length; i++) { + DWORD ret; int left, top, stride; - GetGlyphOutlineW(hdc, text[i], ggo_flags, + ret = GetGlyphOutlineW(hdc, text[i], ggo_flags, &glyphmetrics, max_glyphsize, glyph_mask, &identity); + + if (ret == GDI_ERROR || ret == 0) + continue; /* empty glyph */ left = pti[i].x + glyphmetrics.gmptGlyphOrigin.x; top = pti[i].y - glyphmetrics.gmptGlyphOrigin.y; Modified: trunk/reactos/dll/win32/gdiplus/graphicspath.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/graphicspath.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/graphicspath.c [iso-8859-1] Tue Apr 22 15:42:03 2014 @@ -854,7 +854,7 @@ for (i = index; i < length; ++i) { GLYPHMETRICS gm; - TTPOLYGONHEADER *ph = NULL; + TTPOLYGONHEADER *ph = NULL, *origph; char *start; DWORD len, ofs = 0; len = GetGlyphOutlineW(dc, string[i], GGO_BEZIER, &gm, 0, NULL, &identity); @@ -863,7 +863,7 @@ status = GenericError; break; } - ph = GdipAlloc(len); + origph = ph = GdipAlloc(len); start = (char *)ph; if (!ph || !lengthen_path(path, len / sizeof(POINTFX))) { @@ -917,7 +917,7 @@ x += gm.gmCellIncX * args->scale; y += gm.gmCellIncY * args->scale; - GdipFree(ph); + GdipFree(origph); if (status != Ok) break; } @@ -1837,8 +1837,9 @@ } } -static void widen_open_figure(GpPath *path, GpPen *pen, int start, int end, - path_list_node_t **last_point) +static void widen_open_figure(const GpPointF *points, GpPen *pen, int start, int end, + GpLineCap start_cap, GpCustomLineCap *start_custom, GpLineCap end_cap, + GpCustomLineCap *end_custom, path_list_node_t **last_point) { int i; path_list_node_t *prev_point; @@ -1848,67 +1849,195 @@ prev_point = *last_point; - widen_cap(&path->pathdata.Points[start], &path->pathdata.Points[start+1], - pen, pen->startcap, pen->customstart, FALSE, TRUE, last_point); + widen_cap(&points[start], &points[start+1], + pen, start_cap, start_custom, FALSE, TRUE, last_point); + + for (i=start+1; i<end; i++) + widen_joint(&points[i-1], &points[i], + &points[i+1], pen, last_point); + + widen_cap(&points[end], &points[end-1], + pen, end_cap, end_custom, TRUE, TRUE, last_point); + + for (i=end-1; i>start; i--) + widen_joint(&points[i+1], &points[i], + &points[i-1], pen, last_point); + + widen_cap(&points[start], &points[start+1], + pen, start_cap, start_custom, TRUE, FALSE, last_point); + + prev_point->next->type = PathPointTypeStart; + (*last_point)->type |= PathPointTypeCloseSubpath; +} + +static void widen_closed_figure(GpPath *path, GpPen *pen, int start, int end, + path_list_node_t **last_point) +{ + int i; + path_list_node_t *prev_point; + + if (end <= start+1) + return; + + /* left outline */ + prev_point = *last_point; + + widen_joint(&path->pathdata.Points[end], &path->pathdata.Points[start], + &path->pathdata.Points[start+1], pen, last_point); for (i=start+1; i<end; i++) widen_joint(&path->pathdata.Points[i-1], &path->pathdata.Points[i], &path->pathdata.Points[i+1], pen, last_point); - widen_cap(&path->pathdata.Points[end], &path->pathdata.Points[end-1], - pen, pen->endcap, pen->customend, TRUE, TRUE, last_point); + widen_joint(&path->pathdata.Points[end-1], &path->pathdata.Points[end], + &path->pathdata.Points[start], pen, last_point); + + prev_point->next->type = PathPointTypeStart; + (*last_point)->type |= PathPointTypeCloseSubpath; + + /* right outline */ + prev_point = *last_point; + + widen_joint(&path->pathdata.Points[start], &path->pathdata.Points[end], + &path->pathdata.Points[end-1], pen, last_point); for (i=end-1; i>start; i--) widen_joint(&path->pathdata.Points[i+1], &path->pathdata.Points[i], &path->pathdata.Points[i-1], pen, last_point); - widen_cap(&path->pathdata.Points[start], &path->pathdata.Points[start+1], - pen, pen->startcap, pen->customstart, TRUE, FALSE, last_point); + widen_joint(&path->pathdata.Points[start+1], &path->pathdata.Points[start], + &path->pathdata.Points[end], pen, last_point); prev_point->next->type = PathPointTypeStart; (*last_point)->type |= PathPointTypeCloseSubpath; } -static void widen_closed_figure(GpPath *path, GpPen *pen, int start, int end, - path_list_node_t **last_point) -{ - int i; - path_list_node_t *prev_point; - - if (end <= start+1) +static void widen_dashed_figure(GpPath *path, GpPen *pen, int start, int end, + int closed, path_list_node_t **last_point) +{ + int i, j; + REAL dash_pos=0.0; + int dash_index=0; + const REAL *dash_pattern; + int dash_count; + GpPointF *tmp_points; + REAL segment_dy; + REAL segment_dx; + REAL segment_length; + REAL segment_pos; + int num_tmp_points=0; + int draw_start_cap=0; + static const REAL dash_dot_dot[6] = { 3.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; + + if (end <= start) return; - /* left outline */ - prev_point = *last_point; - - widen_joint(&path->pathdata.Points[end], &path->pathdata.Points[start], - &path->pathdata.Points[start+1], pen, last_point); - - for (i=start+1; i<end; i++) - widen_joint(&path->pathdata.Points[i-1], &path->pathdata.Points[i], - &path->pathdata.Points[i+1], pen, last_point); - - widen_joint(&path->pathdata.Points[end-1], &path->pathdata.Points[end], - &path->pathdata.Points[start], pen, last_point); - - prev_point->next->type = PathPointTypeStart; - (*last_point)->type |= PathPointTypeCloseSubpath; - - /* right outline */ - prev_point = *last_point; - - widen_joint(&path->pathdata.Points[start], &path->pathdata.Points[end], - &path->pathdata.Points[end-1], pen, last_point); - - for (i=end-1; i>start; i--) - widen_joint(&path->pathdata.Points[i+1], &path->pathdata.Points[i], - &path->pathdata.Points[i-1], pen, last_point); - - widen_joint(&path->pathdata.Points[start+1], &path->pathdata.Points[start], - &path->pathdata.Points[end], pen, last_point); - - prev_point->next->type = PathPointTypeStart; - (*last_point)->type |= PathPointTypeCloseSubpath; + switch (pen->dash) + { + case DashStyleDash: + default: + dash_pattern = dash_dot_dot; + dash_count = 2; + break; + case DashStyleDot: + dash_pattern = &dash_dot_dot[2]; + dash_count = 2; + break; + case DashStyleDashDot: + dash_pattern = dash_dot_dot; + dash_count = 4; + break; + case DashStyleDashDotDot: + dash_pattern = dash_dot_dot; + dash_count = 6; + break; + case DashStyleCustom: + dash_pattern = pen->dashes; + dash_count = pen->numdashes; + break; + } + + tmp_points = GdipAlloc((end - start + 2) * sizeof(GpPoint)); + if (!tmp_points) return; /* FIXME */ + + if (!closed) + draw_start_cap = 1; + + for (j=start; j <= end; j++) + { + if (j == start) + { + if (closed) + i = end; + else + continue; + } + else + i = j-1; + + segment_dy = path->pathdata.Points[j].Y - path->pathdata.Points[i].Y; + segment_dx = path->pathdata.Points[j].X - path->pathdata.Points[i].X; + segment_length = sqrtf(segment_dy*segment_dy + segment_dx*segment_dx); + segment_pos = 0.0; + + while (1) + { + if (dash_pos == 0.0) + { + if ((dash_index % 2) == 0) + { + /* start dash */ + num_tmp_points = 1; + tmp_points[0].X = path->pathdata.Points[i].X + segment_dx * segment_pos / segment_length; + tmp_points[0].Y = path->pathdata.Points[i].Y + segment_dy * segment_pos / segment_length; + } + else + { + /* end dash */ + tmp_points[num_tmp_points].X = path->pathdata.Points[i].X + segment_dx * segment_pos / segment_length; + tmp_points[num_tmp_points].Y = path->pathdata.Points[i].Y + segment_dy * segment_pos / segment_length; + + widen_open_figure(tmp_points, pen, 0, num_tmp_points, + draw_start_cap ? pen->startcap : LineCapFlat, pen->customstart, + LineCapFlat, NULL, last_point); + draw_start_cap = 0; + num_tmp_points = 0; + } + } + + if (dash_pattern[dash_index] - dash_pos > segment_length - segment_pos) + { + /* advance to next segment */ + if ((dash_index % 2) == 0) + { + tmp_points[num_tmp_points] = path->pathdata.Points[j]; + num_tmp_points++; + } + dash_pos += segment_length - segment_pos; + break; + } + else + { + /* advance to next dash in pattern */ + segment_pos += dash_pattern[dash_index] - dash_pos; + dash_pos = 0.0; + if (++dash_index == dash_count) + dash_index = 0; + continue; + } + } + } + + if (dash_index % 2 == 0 && num_tmp_points != 0) + { + /* last dash overflows last segment */ + tmp_points[num_tmp_points] = path->pathdata.Points[end]; + widen_open_figure(tmp_points, pen, 0, num_tmp_points, + draw_start_cap ? pen->startcap : LineCapFlat, pen->customstart, + closed ? LineCapFlat : pen->endcap, pen->customend, last_point); + } + + GdipFree(tmp_points); } GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, @@ -1952,9 +2081,6 @@ if (pen->join == LineJoinRound) FIXME("unimplemented line join %d\n", pen->join); - if (pen->dash != DashStyleSolid) - FIXME("unimplemented dash style %d\n", pen->dash); - if (pen->align != PenAlignmentCenter) FIXME("unimplemented pen alignment %d\n", pen->align); @@ -1967,12 +2093,18 @@ if ((type&PathPointTypeCloseSubpath) == PathPointTypeCloseSubpath) { - widen_closed_figure(flat_path, pen, subpath_start, i, &last_point); + if (pen->dash != DashStyleSolid) + widen_dashed_figure(flat_path, pen, subpath_start, i, 1, &last_point); + else + widen_closed_figure(flat_path, pen, subpath_start, i, &last_point); } else if (i == flat_path->pathdata.Count-1 || (flat_path->pathdata.Types[i+1]&PathPointTypePathTypeMask) == PathPointTypeStart) { - widen_open_figure(flat_path, pen, subpath_start, i, &last_point); + if (pen->dash != DashStyleSolid) + widen_dashed_figure(flat_path, pen, subpath_start, i, 0, &last_point); + else + widen_open_figure(flat_path->pathdata.Points, pen, subpath_start, i, pen->startcap, pen->customstart, pen->endcap, pen->customend, &last_point); } } Modified: trunk/reactos/dll/win32/gdiplus/image.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/image.c?…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] Tue Apr 22 15:42:03 2014 @@ -1105,12 +1105,12 @@ if (flags & ImageLockModeRead) { - static int fixme=0; + static BOOL fixme = FALSE; if (!fixme && (PIXELFORMATBPP(bitmap->format) * act_rect.X) % 8 != 0) { FIXME("Cannot copy rows that don't start at a whole byte.\n"); - fixme = 1; + fixme = TRUE; } stat = convert_pixels(act_rect.Width, act_rect.Height, @@ -1152,7 +1152,7 @@ BitmapData* lockeddata) { GpStatus stat; - static int fixme=0; + static BOOL fixme = FALSE; TRACE("(%p,%p)\n", bitmap, lockeddata); @@ -1182,7 +1182,7 @@ if (!fixme && (PIXELFORMATBPP(bitmap->format) * bitmap->lockx) % 8 != 0) { FIXME("Cannot copy rows that don't start at a whole byte.\n"); - fixme = 1; + fixme = TRUE; } stat = convert_pixels(lockeddata->Width, lockeddata->Height, @@ -1207,9 +1207,6 @@ GpStatus WINGDIPAPI GdipCloneBitmapArea(REAL x, REAL y, REAL width, REAL height, PixelFormat format, GpBitmap* srcBitmap, GpBitmap** dstBitmap) { - BitmapData lockeddata_src, lockeddata_dst; - int i; - UINT row_size; Rect area; GpStatus stat; @@ -1231,39 +1228,41 @@ area.Width = gdip_round(width); area.Height = gdip_round(height); - stat = GdipBitmapLockBits(srcBitmap, &area, ImageLockModeRead, format, - &lockeddata_src); - if (stat != Ok) return stat; - - stat = GdipCreateBitmapFromScan0(lockeddata_src.Width, lockeddata_src.Height, - 0, lockeddata_src.PixelFormat, NULL, dstBitmap); + stat = GdipCreateBitmapFromScan0(area.Width, area.Height, 0, format, NULL, dstBitmap); if (stat == Ok) { - stat = GdipBitmapLockBits(*dstBitmap, NULL, ImageLockModeWrite, - lockeddata_src.PixelFormat, &lockeddata_dst); - - if (stat == Ok) - { - /* copy the image data */ - row_size = (lockeddata_src.Width * PIXELFORMATBPP(lockeddata_src.PixelFormat) +7)/8; - for (i=0; i<lockeddata_src.Height; i++) - memcpy((BYTE*)lockeddata_dst.Scan0+lockeddata_dst.Stride*i, - (BYTE*)lockeddata_src.Scan0+lockeddata_src.Stride*i, - row_size); - - GdipBitmapUnlockBits(*dstBitmap, &lockeddata_dst); + stat = convert_pixels(area.Width, area.Height, (*dstBitmap)->stride, (*dstBitmap)->bits, (*dstBitmap)->format, + srcBitmap->stride, + srcBitmap->bits + srcBitmap->stride * area.Y + PIXELFORMATBPP(srcBitmap->format) * area.X / 8, + srcBitmap->format, srcBitmap->image.palette); + + if (stat == Ok && srcBitmap->image.palette) + { + ColorPalette *src_palette, *dst_palette; + + src_palette = srcBitmap->image.palette; + + dst_palette = GdipAlloc(sizeof(UINT) * 2 + sizeof(ARGB) * src_palette->Count); + + if (dst_palette) + { + dst_palette->Flags = src_palette->Flags; + dst_palette->Count = src_palette->Count; + memcpy(dst_palette->Entries, src_palette->Entries, sizeof(ARGB) * src_palette->Count); + + GdipFree((*dstBitmap)->image.palette); + (*dstBitmap)->image.palette = dst_palette; + } + else + stat = OutOfMemory; } if (stat != Ok) GdipDisposeImage((GpImage*)*dstBitmap); } - GdipBitmapUnlockBits(srcBitmap, &lockeddata_src); - if (stat != Ok) - { *dstBitmap = NULL; - } return stat; } @@ -1318,47 +1317,10 @@ } else if (image->type == ImageTypeBitmap) { - GpBitmap *bitmap = (GpBitmap*)image; - BitmapData lockeddata_src, lockeddata_dst; - int i; - UINT row_size; - - stat = GdipBitmapLockBits(bitmap, NULL, ImageLockModeRead, bitmap->format, - &lockeddata_src); - if (stat != Ok) return stat; - - stat = GdipCreateBitmapFromScan0(lockeddata_src.Width, lockeddata_src.Height, - 0, lockeddata_src.PixelFormat, NULL, (GpBitmap**)cloneImage); - if (stat == Ok) - { - stat = GdipBitmapLockBits((GpBitmap*)*cloneImage, NULL, ImageLockModeWrite, - lockeddata_src.PixelFormat, &lockeddata_dst); - - if (stat == Ok) - { - /* copy the image data */ - row_size = (lockeddata_src.Width * PIXELFORMATBPP(lockeddata_src.PixelFormat) +7)/8; - for (i=0; i<lockeddata_src.Height; i++) - memcpy((BYTE*)lockeddata_dst.Scan0+lockeddata_dst.Stride*i, - (BYTE*)lockeddata_src.Scan0+lockeddata_src.Stride*i, - row_size); - - GdipBitmapUnlockBits((GpBitmap*)*cloneImage, &lockeddata_dst); - } - - if (stat != Ok) - GdipDisposeImage(*cloneImage); - } - - GdipBitmapUnlockBits(bitmap, &lockeddata_src); - - if (stat != Ok) - { - *cloneImage = NULL; - } - else memcpy(&(*cloneImage)->format, &image->format, sizeof(GUID)); - - return stat; + GpBitmap *bitmap = (GpBitmap *)image; + + return GdipCloneBitmapAreaI(0, 0, bitmap->width, bitmap->height, + bitmap->format, bitmap, (GpBitmap **)cloneImage); } else if (image->type == ImageTypeMetafile && ((GpMetafile*)image)->hemf) { @@ -1557,27 +1519,6 @@ return stat; } -GpStatus WINGDIPAPI GdipConvertToEmfPlus(const GpGraphics* ref, - GpMetafile* metafile, BOOL* succ, EmfType emfType, - const WCHAR* description, GpMetafile** out_metafile) -{ - static int calls; - - TRACE("(%p,%p,%p,%u,%s,%p)\n", ref, metafile, succ, emfType, - debugstr_w(description), out_metafile); - - if(!ref || !metafile || !out_metafile) - return InvalidParameter; - - *succ = FALSE; - *out_metafile = NULL; - - if(!(calls++)) - FIXME("not implemented\n"); - - return NotImplemented; -} - GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT width, INT height, GpGraphics* target, GpBitmap** bitmap) { @@ -1799,7 +1740,6 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap) { - BITMAPINFO* pbmi; HBITMAP hbitmap=NULL; INT row_size, dib_stride; BYTE *bits=NULL, *own_bits=NULL; @@ -1829,9 +1769,8 @@ if (format & PixelFormatGDI && !(format & (PixelFormatAlpha|PixelFormatIndexed)) && !scan0) { - pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); - if (!pbmi) - return OutOfMemory; + char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors) + 256 * sizeof(RGBQUAD)]; + BITMAPINFO *pbmi = (BITMAPINFO *)bmibuf; pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pbmi->bmiHeader.biWidth = width; @@ -1847,8 +1786,6 @@ pbmi->bmiHeader.biClrImportant = 0; hbitmap = CreateDIBSection(0, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); - - GdipFree(pbmi); if (!hbitmap) return GenericError; @@ -2070,13 +2007,6 @@ return InvalidParameter; return GdipDrawImage(graphics, cachedbmp->image, (REAL)x, (REAL)y); -} - -GpStatus WINGDIPAPI GdipEmfToWmfBits(HENHMETAFILE hemf, UINT cbData16, - LPBYTE pData16, INT iMapMode, INT eFlags) -{ - FIXME("(%p, %d, %p, %d, %d): stub\n", hemf, cbData16, pData16, iMapMode, eFlags); - return NotImplemented; } /* Internal utility function: Replace the image data of dst with that of src, @@ -2419,76 +2349,6 @@ *width = ipicture_pixel_width(image->picture); TRACE("returning %d\n", *width); - - return Ok; -} - -GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile * metafile, - MetafileHeader * header) -{ - static int calls; - - TRACE("(%p, %p)\n", metafile, header); - - if(!metafile || !header) - return InvalidParameter; - - if(!(calls++)) - FIXME("not implemented\n"); - - memset(header, 0, sizeof(MetafileHeader)); - - return Ok; -} - -GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf(HENHMETAFILE hEmf, - MetafileHeader *header) -{ - static int calls; - - if(!hEmf || !header) - return InvalidParameter; - - if(!(calls++)) - FIXME("not implemented\n"); - - memset(header, 0, sizeof(MetafileHeader)); - - return Ok; -} - -GpStatus WINGDIPAPI GdipGetMetafileHeaderFromFile(GDIPCONST WCHAR *filename, - MetafileHeader *header) -{ - static int calls; - - TRACE("(%s,%p)\n", debugstr_w(filename), header); - - if(!filename || !header) - return InvalidParameter; - - if(!(calls++)) - FIXME("not implemented\n"); - - memset(header, 0, sizeof(MetafileHeader)); - - return Ok; -} - -GpStatus WINGDIPAPI GdipGetMetafileHeaderFromStream(IStream *stream, - MetafileHeader *header) -{ - static int calls; - - TRACE("(%p,%p)\n", stream, header); - - if(!stream || !header) - return InvalidParameter; - - if(!(calls++)) - FIXME("not implemented\n"); - - memset(header, 0, sizeof(MetafileHeader)); return Ok; } @@ -3989,6 +3849,7 @@ HRESULT hr; UINT width, height; PixelFormat gdipformat=0; + const WICPixelFormatGUID *desired_wicformat; WICPixelFormatGUID wicformat; GpRect rc; BitmapData lockeddata; @@ -4041,18 +3902,38 @@ { if (pixel_formats[i].gdip_format == bitmap->format) { - memcpy(&wicformat, pixel_formats[i].wic_format, sizeof(GUID)); + desired_wicformat = pixel_formats[i].wic_format; gdipformat = bitmap->format; break; } } if (!gdipformat) { - memcpy(&wicformat, &GUID_WICPixelFormat32bppBGRA, sizeof(GUID)); + desired_wicformat = &GUID_WICPixelFormat32bppBGRA; gdipformat = PixelFormat32bppARGB; } + memcpy(&wicformat, desired_wicformat, sizeof(GUID)); hr = IWICBitmapFrameEncode_SetPixelFormat(frameencode, &wicformat); + } + + if (SUCCEEDED(hr) && !IsEqualGUID(desired_wicformat, &wicformat)) + { + /* Encoder doesn't support this bitmap's format. */ + gdipformat = 0; + for (i=0; pixel_formats[i].wic_format; i++) + { + if (IsEqualGUID(&wicformat, pixel_formats[i].wic_format)) + { + gdipformat = pixel_formats[i].gdip_format; + break; + } + } + if (!gdipformat) + { + ERR("Cannot support encoder format %s\n", debugstr_guid(&wicformat)); + hr = E_FAIL; + } } if (SUCCEEDED(hr)) @@ -4652,28 +4533,21 @@ if (retval == Ok) { HDC hdc; - BITMAPINFO *pbmi; + char bmibuf[FIELD_OFFSET(BITMAPINFO, bmiColors) + 256 * sizeof(RGBQUAD)]; + BITMAPINFO *pbmi = (BITMAPINFO *)bmibuf; INT src_height; hdc = CreateCompatibleDC(NULL); - pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)); - - if (pbmi) - { - pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - pbmi->bmiHeader.biBitCount = 0; - - GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); - - src_height = abs(pbmi->bmiHeader.biHeight); - pbmi->bmiHeader.biHeight = -src_height; - - GetDIBits(hdc, hbm, 0, src_height, lockeddata.Scan0, pbmi, DIB_RGB_COLORS); - - GdipFree(pbmi); - } - else - retval = OutOfMemory; + + pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + pbmi->bmiHeader.biBitCount = 0; + + GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS); + + src_height = abs(pbmi->bmiHeader.biHeight); + pbmi->bmiHeader.biHeight = -src_height; + + GetDIBits(hdc, hbm, 0, src_height, lockeddata.Scan0, pbmi, DIB_RGB_COLORS); DeleteDC(hdc); @@ -4779,27 +4653,6 @@ } return Ok; -} - -GpStatus WINGDIPAPI GdipRecordMetafileFileName(GDIPCONST WCHAR* fileName, - HDC hdc, EmfType type, GDIPCONST GpRectF *pFrameRect, - MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, - GpMetafile **metafile) -{ - FIXME("%s %p %d %p %d %s %p stub!\n", debugstr_w(fileName), hdc, type, pFrameRect, - frameUnit, debugstr_w(desc), metafile); - - return NotImplemented; -} - -GpStatus WINGDIPAPI GdipRecordMetafileFileNameI(GDIPCONST WCHAR* fileName, HDC hdc, EmfType type, - GDIPCONST GpRect *pFrameRect, MetafileFrameUnit frameUnit, - GDIPCONST WCHAR *desc, GpMetafile **metafile) -{ - FIXME("%s %p %d %p %d %s %p stub!\n", debugstr_w(fileName), hdc, type, pFrameRect, - frameUnit, debugstr_w(desc), metafile); - - return NotImplemented; } GpStatus WINGDIPAPI GdipImageForceValidation(GpImage *image) @@ -4866,7 +4719,7 @@ GpBitmap *new_bitmap; GpBitmap *bitmap; int bpp, bytesperpixel; - int rotate_90, flip_x, flip_y; + BOOL rotate_90, flip_x, flip_y; int src_x_offset, src_y_offset; LPBYTE src_origin; UINT x, y, width, height; @@ -4975,16 +4828,3 @@ return stat; } - -/***************************************************************************** - * GdipConvertToEmfPlusToFile [GDIPLUS.@] - */ - -GpStatus WINGDIPAPI GdipConvertToEmfPlusToFile(const GpGraphics* refGraphics, - GpMetafile* metafile, BOOL* conversionSuccess, - const WCHAR* filename, EmfType emfType, - const WCHAR* description, GpMetafile** out_metafile) -{ - FIXME("stub: %p, %p, %p, %p, %u, %p, %p\n", refGraphics, metafile, conversionSuccess, filename, emfType, description, out_metafile); - return NotImplemented; -} Modified: trunk/reactos/dll/win32/gdiplus/metafile.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/metafile…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/metafile.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/metafile.c [iso-8859-1] Tue Apr 22 15:42:03 2014 @@ -34,6 +34,27 @@ DWORD LogicalDpiX; DWORD LogicalDpiY; } EmfPlusHeader; + +typedef struct EmfPlusFillRects +{ + EmfPlusRecordHeader Header; + DWORD BrushID; + DWORD Count; +} EmfPlusFillRects; + +typedef struct EmfPlusSetPageTransform +{ + EmfPlusRecordHeader Header; + REAL PageScale; +} EmfPlusSetPageTransform; + +typedef struct EmfPlusRect +{ + SHORT X; + SHORT Y; + SHORT Width; + SHORT Height; +} EmfPlusRect; static GpStatus METAFILE_AllocateRecord(GpMetafile *metafile, DWORD size, void **result) { @@ -211,6 +232,8 @@ (*metafile)->image.picture = NULL; (*metafile)->image.flags = ImageFlagsNone; (*metafile)->image.palette = NULL; + (*metafile)->image.xres = 72.0; + (*metafile)->image.yres = 72.0; (*metafile)->bounds = *frameRect; (*metafile)->unit = frameUnit; (*metafile)->metafile_type = type; @@ -267,7 +290,11 @@ stat = graphics_from_image((GpImage*)metafile, &metafile->record_graphics); if (stat == Ok) + { *result = metafile->record_graphics; + metafile->record_graphics->xres = 96.0; + metafile->record_graphics->yres = 96.0; + } return stat; } @@ -290,6 +317,108 @@ } *hdc = metafile->record_dc; + + return Ok; +} + +static BOOL is_integer_rect(const GpRectF *rect) +{ + SHORT x, y, width, height; + x = rect->X; + y = rect->Y; + width = rect->Width; + height = rect->Height; + if (rect->X != (REAL)x || rect->Y != (REAL)y || + rect->Width != (REAL)width || rect->Height != (REAL)height) + return FALSE; + return TRUE; +} + +GpStatus METAFILE_FillRectangles(GpMetafile* metafile, GpBrush* brush, + GDIPCONST GpRectF* rects, INT count) +{ + if (metafile->metafile_type == MetafileTypeEmfPlusOnly || metafile->metafile_type == MetafileTypeEmfPlusDual) + { + EmfPlusFillRects *record; + GpStatus stat; + BOOL integer_rects = TRUE; + int i; + DWORD brushid; + int flags = 0; + + if (brush->bt == BrushTypeSolidColor) + { + flags |= 0x8000; + brushid = ((GpSolidFill*)brush)->color; + } + else + { + FIXME("brush serialization not implemented\n"); + return NotImplemented; + } + + for (i=0; i<count; i++) + { + if (!is_integer_rect(&rects[i])) + { + integer_rects = FALSE; + break; + } + } + + if (integer_rects) + flags |= 0x4000; + + stat = METAFILE_AllocateRecord(metafile, + sizeof(EmfPlusFillRects) + count * (integer_rects ? sizeof(EmfPlusRect) : sizeof(GpRectF)), + (void**)&record); + if (stat != Ok) + return stat; + + record->Header.Type = EmfPlusRecordTypeFillRects; + record->Header.Flags = flags; + record->BrushID = brushid; + record->Count = count; + + if (integer_rects) + { + EmfPlusRect *record_rects = (EmfPlusRect*)(record+1); + for (i=0; i<count; i++) + { + record_rects[i].X = (SHORT)rects[i].X; + record_rects[i].Y = (SHORT)rects[i].Y; + record_rects[i].Width = (SHORT)rects[i].Width; + record_rects[i].Height = (SHORT)rects[i].Height; + } + } + else + memcpy(record+1, rects, sizeof(GpRectF) * count); + + METAFILE_WriteRecords(metafile); + } + + return Ok; +} + +GpStatus METAFILE_SetPageTransform(GpMetafile* metafile, GpUnit unit, REAL scale) +{ + if (metafile->metafile_type == MetafileTypeEmfPlusOnly || metafile->metafile_type == MetafileTypeEmfPlusDual) + { + EmfPlusSetPageTransform *record; + GpStatus stat; + + stat = METAFILE_AllocateRecord(metafile, + sizeof(EmfPlusSetPageTransform), + (void**)&record); + if (stat != Ok) + return stat; + + record->Header.Type = EmfPlusRecordTypeSetPageTransform; + record->Header.Flags = unit; + record->PageScale = scale; + + METAFILE_WriteRecords(metafile); + } return Ok; } @@ -368,9 +497,40 @@ } } +static GpStatus METAFILE_PlaybackUpdateWorldTransform(GpMetafile *metafile) +{ + GpMatrix *real_transform; + GpStatus stat; + + stat = GdipCreateMatrix3(&metafile->src_rect, metafile->playback_points, &real_transform); + + if (stat == Ok) + { + REAL scale = units_to_pixels(1.0, metafile->page_unit, 96.0); + + if (metafile->page_unit != UnitDisplay) + scale *= metafile->page_scale; + + stat = GdipScaleMatrix(real_transform, scale, scale, MatrixOrderPrepend); + + if (stat == Ok) + stat = GdipMultiplyMatrix(real_transform, metafile->world_transform, MatrixOrderPrepend); + + if (stat == Ok) + stat = GdipSetWorldTransform(metafile->playback_graphics, real_transform); + + GdipDeleteMatrix(real_transform); + } + + return stat; +} + GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile, EmfPlusRecordType recordType, UINT flags, UINT dataSize, GDIPCONST BYTE *data) { + GpStatus stat; + GpMetafile *real_metafile = (GpMetafile*)metafile; + TRACE("(%p,%x,%x,%d,%p)\n", metafile, recordType, flags, dataSize, data); if (!metafile || (dataSize && !data) || !metafile->playback_graphics) @@ -402,6 +562,8 @@ } else { + EmfPlusRecordHeader *header = (EmfPlusRecordHeader*)(data)-1; + METAFILE_PlaybackReleaseDC((GpMetafile*)metafile); switch(recordType) @@ -412,6 +574,85 @@ case EmfPlusRecordTypeGetDC: METAFILE_PlaybackGetDC((GpMetafile*)metafile); break; + case EmfPlusRecordTypeFillRects: + { + EmfPlusFillRects *record = (EmfPlusFillRects*)header; + GpBrush *brush, *temp_brush=NULL; + GpRectF *rects, *temp_rects=NULL; + + if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects)) + return InvalidParameter; + + if (flags & 0x4000) + { + if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects) + sizeof(EmfPlusRect) * record->Count) + return InvalidParameter; + } + else + { + if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusFillRects) + sizeof(GpRectF) * record->Count) + return InvalidParameter; + } + + if (flags & 0x8000) + { + stat = GdipCreateSolidFill((ARGB)record->BrushID, (GpSolidFill**)&temp_brush); + brush = temp_brush; + } + else + { + FIXME("brush deserialization not implemented\n"); + return NotImplemented; + } + + if (stat == Ok) + { + if (flags & 0x4000) + { + EmfPlusRect *int_rects = (EmfPlusRect*)(record+1); + int i; + + rects = temp_rects = GdipAlloc(sizeof(GpRectF) * record->Count); + if (rects) + { + for (i=0; i<record->Count; i++) + { + rects[i].X = int_rects[i].X; + rects[i].Y = int_rects[i].Y; + rects[i].Width = int_rects[i].Width; + rects[i].Height = int_rects[i].Height; + } + } + else + stat = OutOfMemory; + } + else + rects = (GpRectF*)(record+1); + } + + if (stat == Ok) + { + stat = GdipFillRectangles(metafile->playback_graphics, brush, rects, record->Count); + } + + GdipDeleteBrush(temp_brush); + GdipFree(temp_rects); + + return stat; + } + case EmfPlusRecordTypeSetPageTransform: + { + EmfPlusSetPageTransform *record = (EmfPlusSetPageTransform*)header; + GpUnit unit = (GpUnit)flags; + + if (dataSize + sizeof(EmfPlusRecordHeader) < sizeof(EmfPlusSetPageTransform)) + return InvalidParameter; + + real_metafile->page_unit = unit; + real_metafile->page_scale = record->PageScale; + + return METAFILE_PlaybackUpdateWorldTransform(real_metafile); + } default: FIXME("Not implemented for record type %x\n", recordType); return NotImplemented; @@ -486,6 +727,7 @@ struct enum_metafile_data data; GpStatus stat; GpMetafile *real_metafile = (GpMetafile*)metafile; /* whoever made this const was joking */ + GraphicsContainer state; TRACE("(%p,%p,%p,%i,%p,%i,%p,%p,%p)\n", graphics, metafile, destPoints, count, srcRect, srcUnit, callback, callbackData, @@ -510,19 +752,46 @@ real_metafile->playback_graphics = graphics; real_metafile->playback_dc = NULL; + real_metafile->src_rect = *srcRect; memcpy(real_metafile->playback_points, destPoints, sizeof(PointF) * 3); stat = GdipTransformPoints(graphics, CoordinateSpaceDevice, CoordinateSpaceWorld, real_metafile->playback_points, 3); - if (stat == Ok && (metafile->metafile_type == MetafileTypeEmf || - metafile->metafile_type == MetafileTypeWmfPlaceable || - metafile->metafile_type == MetafileTypeWmf)) - stat = METAFILE_PlaybackGetDC((GpMetafile*)metafile); - if (stat == Ok) - EnumEnhMetaFile(0, metafile->hemf, enum_metafile_proc, &data, NULL); - - METAFILE_PlaybackReleaseDC((GpMetafile*)metafile); + stat = GdipBeginContainer2(graphics, &state); + + if (stat == Ok) + { + stat = GdipSetPageScale(graphics, 1.0); + + if (stat == Ok) + stat = GdipSetPageUnit(graphics, UnitPixel); + + if (stat == Ok) + stat = GdipCreateMatrix(&real_metafile->world_transform); + + if (stat == Ok) + { + real_metafile->page_unit = UnitDisplay; + real_metafile->page_scale = 1.0; + stat = METAFILE_PlaybackUpdateWorldTransform(real_metafile); + } + + if (stat == Ok && (metafile->metafile_type == MetafileTypeEmf || + metafile->metafile_type == MetafileTypeWmfPlaceable || + metafile->metafile_type == MetafileTypeWmf)) + stat = METAFILE_PlaybackGetDC(real_metafile); + + if (stat == Ok) + EnumEnhMetaFile(0, metafile->hemf, enum_metafile_proc, &data, NULL); + + METAFILE_PlaybackReleaseDC(real_metafile); + + GdipDeleteMatrix(real_metafile->world_transform); + real_metafile->world_transform = NULL; + + GdipEndContainer(graphics, state); + } real_metafile->playback_graphics = NULL; @@ -623,9 +892,268 @@ return FALSE; } -MetafileType METAFILE_GetEmfType(HENHMETAFILE hemf) +static MetafileType METAFILE_GetEmfType(HENHMETAFILE hemf) { MetafileType result = MetafileTypeInvalid; EnumEnhMetaFile(NULL, hemf, get_metafile_type_proc, &result, NULL); return result; } + +GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile * metafile, + MetafileHeader * header) +{ + static int calls; + + TRACE("(%p, %p)\n", metafile, header); + + if(!metafile || !header) + return InvalidParameter; + + if(!(calls++)) + FIXME("not implemented\n"); + + memset(header, 0, sizeof(MetafileHeader)); + + return Ok; +} + +GpStatus WINGDIPAPI GdipGetMetafileHeaderFromEmf(HENHMETAFILE hEmf, + MetafileHeader *header) +{ + static int calls; + + if(!hEmf || !header) + return InvalidParameter; + + if(!(calls++)) + FIXME("not implemented\n"); + + memset(header, 0, sizeof(MetafileHeader)); + + return Ok; +} + +GpStatus WINGDIPAPI GdipGetMetafileHeaderFromFile(GDIPCONST WCHAR *filename, + MetafileHeader *header) +{ + static int calls; + + TRACE("(%s,%p)\n", debugstr_w(filename), header); + + if(!filename || !header) + return InvalidParameter; + + if(!(calls++)) + FIXME("not implemented\n"); + + memset(header, 0, sizeof(MetafileHeader)); + + return Ok; +} + +GpStatus WINGDIPAPI GdipGetMetafileHeaderFromStream(IStream *stream, + MetafileHeader *header) +{ + static int calls; + + TRACE("(%p,%p)\n", stream, header); + + if(!stream || !header) + return InvalidParameter; + + if(!(calls++)) + FIXME("not implemented\n"); + + memset(header, 0, sizeof(MetafileHeader)); + + return Ok; +} + +GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE hemf, BOOL delete, + GpMetafile **metafile) +{ + ENHMETAHEADER header; + MetafileType metafile_type; + + TRACE("(%p,%i,%p)\n", hemf, delete, metafile); + + if(!hemf || !metafile) + return InvalidParameter; + + if (GetEnhMetaFileHeader(hemf, sizeof(header), &header) == 0) + return GenericError; + + metafile_type = METAFILE_GetEmfType(hemf); + + if (metafile_type == MetafileTypeInvalid) + return GenericError; + + *metafile = GdipAlloc(sizeof(GpMetafile)); + if (!*metafile) + return OutOfMemory; + + (*metafile)->image.type = ImageTypeMetafile; + (*metafile)->image.format = ImageFormatEMF; + (*metafile)->image.frame_count = 1; + (*metafile)->image.xres = (REAL)header.szlDevice.cx; + (*metafile)->image.yres = (REAL)header.szlDevice.cy; + (*metafile)->bounds.X = (REAL)header.rclBounds.left; + (*metafile)->bounds.Y = (REAL)header.rclBounds.top; + (*metafile)->bounds.Width = (REAL)(header.rclBounds.right - header.rclBounds.left); + (*metafile)->bounds.Height = (REAL)(header.rclBounds.bottom - header.rclBounds.top); + (*metafile)->unit = UnitPixel; + (*metafile)->metafile_type = metafile_type; + (*metafile)->hemf = hemf; + (*metafile)->preserve_hemf = !delete; + + TRACE("<-- %p\n", *metafile); + + return Ok; +} + +GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE hwmf, BOOL delete, + GDIPCONST WmfPlaceableFileHeader * placeable, GpMetafile **metafile) +{ + UINT read; + BYTE *copy; + HENHMETAFILE hemf; + GpStatus retval = Ok; + + TRACE("(%p, %d, %p, %p)\n", hwmf, delete, placeable, metafile); + + if(!hwmf || !metafile || !placeable) + return InvalidParameter; + + *metafile = NULL; + read = GetMetaFileBitsEx(hwmf, 0, NULL); + if(!read) + return GenericError; + copy = GdipAlloc(read); + GetMetaFileBitsEx(hwmf, read, copy); + + hemf = SetWinMetaFileBits(read, copy, NULL, NULL); + GdipFree(copy); + + /* FIXME: We should store and use hwmf instead of converting to hemf */ + retval = GdipCreateMetafileFromEmf(hemf, TRUE, metafile); + + if (retval == Ok) + { + (*metafile)->image.xres = (REAL)placeable->Inch; + (*metafile)->image.yres = (REAL)placeable->Inch; + (*metafile)->bounds.X = ((REAL)placeable->BoundingBox.Left) / ((REAL)placeable->Inch); + (*metafile)->bounds.Y = ((REAL)placeable->BoundingBox.Top) / ((REAL)placeable->Inch); + (*metafile)->bounds.Width = (REAL)(placeable->BoundingBox.Right - + placeable->BoundingBox.Left); + (*metafile)->bounds.Height = (REAL)(placeable->BoundingBox.Bottom - + placeable->BoundingBox.Top); + (*metafile)->metafile_type = MetafileTypeWmfPlaceable; + (*metafile)->image.format = ImageFormatWMF; + + if (delete) DeleteMetaFile(hwmf); + } + else + DeleteEnhMetaFile(hemf); + return retval; +} + +GpStatus WINGDIPAPI GdipCreateMetafileFromWmfFile(GDIPCONST WCHAR *file, + GDIPCONST WmfPlaceableFileHeader * placeable, GpMetafile **metafile) +{ + HMETAFILE hmf = GetMetaFileW(file); + + TRACE("(%s, %p, %p)\n", debugstr_w(file), placeable, metafile); + + if(!hmf) return InvalidParameter; + + return GdipCreateMetafileFromWmf(hmf, TRUE, placeable, metafile); +} + +GpStatus WINGDIPAPI GdipCreateMetafileFromFile(GDIPCONST WCHAR *file, + GpMetafile **metafile) +{ + FIXME("(%p, %p): stub\n", file, metafile); + return NotImplemented; +} + +GpStatus WINGDIPAPI GdipCreateMetafileFromStream(IStream *stream, + GpMetafile **metafile) +{ + FIXME("(%p, %p): stub\n", stream, metafile); + return NotImplemented; +} + +GpStatus WINGDIPAPI GdipSetMetafileDownLevelRasterizationLimit(GpMetafile *metafile, + UINT limitDpi) +{ + static int calls; + + TRACE("(%p,%u)\n", metafile, limitDpi); + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} + +GpStatus WINGDIPAPI GdipConvertToEmfPlus(const GpGraphics* ref, + GpMetafile* metafile, BOOL* succ, EmfType emfType, + const WCHAR* description, GpMetafile** out_metafile) +{ + static int calls; + + TRACE("(%p,%p,%p,%u,%s,%p)\n", ref, metafile, succ, emfType, + debugstr_w(description), out_metafile); + + if(!ref || !metafile || !out_metafile) + return InvalidParameter; + + *succ = FALSE; + *out_metafile = NULL; + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} + +GpStatus WINGDIPAPI GdipEmfToWmfBits(HENHMETAFILE hemf, UINT cbData16, + LPBYTE pData16, INT iMapMode, INT eFlags) +{ + FIXME("(%p, %d, %p, %d, %d): stub\n", hemf, cbData16, pData16, iMapMode, eFlags); + return NotImplemented; +} + +GpStatus WINGDIPAPI GdipRecordMetafileFileName(GDIPCONST WCHAR* fileName, + HDC hdc, EmfType type, GDIPCONST GpRectF *pFrameRect, + MetafileFrameUnit frameUnit, GDIPCONST WCHAR *desc, + GpMetafile **metafile) +{ + FIXME("%s %p %d %p %d %s %p stub!\n", debugstr_w(fileName), hdc, type, pFrameRect, + frameUnit, debugstr_w(desc), metafile); + + return NotImplemented; +} + +GpStatus WINGDIPAPI GdipRecordMetafileFileNameI(GDIPCONST WCHAR* fileName, HDC hdc, EmfType type, + GDIPCONST GpRect *pFrameRect, MetafileFrameUnit frameUnit, + GDIPCONST WCHAR *desc, GpMetafile **metafile) +{ + FIXME("%s %p %d %p %d %s %p stub!\n", debugstr_w(fileName), hdc, type, pFrameRect, + frameUnit, debugstr_w(desc), metafile); + + return NotImplemented; +} + +/***************************************************************************** + * GdipConvertToEmfPlusToFile [GDIPLUS.@] + */ + +GpStatus WINGDIPAPI GdipConvertToEmfPlusToFile(const GpGraphics* refGraphics, + GpMetafile* metafile, BOOL* conversionSuccess, + const WCHAR* filename, EmfType emfType, + const WCHAR* description, GpMetafile** out_metafile) +{ + FIXME("stub: %p, %p, %p, %p, %u, %p, %p\n", refGraphics, metafile, conversionSuccess, filename, emfType, description, out_metafile); + return NotImplemented; +} Modified: trunk/reactos/dll/win32/gdiplus/pathiterator.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/pathiter…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/pathiterator.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/pathiterator.c [iso-8859-1] Tue Apr 22 15:42:03 2014 @@ -205,7 +205,7 @@ if(iterator->subpath_pos == count){ *startIndex = *endIndex = *resultCount = 0; - *isClosed = 1; + *isClosed = TRUE; return Ok; } Modified: trunk/reactos/dll/win32/gdiplus/region.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/region.c…
============================================================================== --- trunk/reactos/dll/win32/gdiplus/region.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdiplus/region.c [iso-8859-1] Tue Apr 22 15:42:03 2014 @@ -75,6 +75,24 @@ short Y; } packed_point; +/* Test to see if the path could be stored as an array of shorts */ +static BOOL is_integer_path(const GpPath *path) +{ + int i; + + if (!path->pathdata.Count) return FALSE; + + for (i = 0; i < path->pathdata.Count; i++) + { + short x, y; + x = gdip_round(path->pathdata.Points[i].X); + y = gdip_round(path->pathdata.Points[i].Y); + if (path->pathdata.Points[i].X != (REAL)x || path->pathdata.Points[i].Y != (REAL)y) + return FALSE; + } + return TRUE; +} + /* Everything is measured in DWORDS; round up if there's a remainder */ static inline INT get_pathtypes_size(const GpPath* path) { @@ -94,9 +112,20 @@ case RegionDataRect: return needed + sizeof(GpRect); case RegionDataPath: - needed += element->elementdata.pathdata.pathheader.size; - needed += sizeof(DWORD); /* Extra DWORD for pathheader.size */ - return needed; + { + const GpPath *path = element->elementdata.path; + DWORD flags = is_integer_path(path) ? FLAGS_INTPATH : FLAGS_NOFLAGS; + /* 3 for headers, once again size doesn't count itself */ + needed += sizeof(DWORD) * 3; + if (flags & FLAGS_INTPATH) + needed += 2 * sizeof(SHORT) * path->pathdata.Count; + else + needed += 2 * sizeof(FLOAT) * path->pathdata.Count; + + needed += get_pathtypes_size(path); + needed += sizeof(DWORD); /* Extra DWORD for pathheader.size */ + return needed; + } case RegionDataEmptyRect: case RegionDataInfiniteRect: return needed; @@ -112,11 +141,8 @@ /* Does not check parameters, caller must do that */ static inline GpStatus init_region(GpRegion* region, const RegionType type) { - region->node.type = type; - region->header.checksum = 0xdeadbeef; - region->header.magic = VERSION_MAGIC; - region->header.num_children = 0; - region->header.size = sizeheader_size + get_element_size(®ion->node); + region->node.type = type; + region->num_children = 0; return Ok; } @@ -144,9 +170,7 @@ case RegionDataInfiniteRect: return Ok; case RegionDataPath: - (*element2)->elementdata.pathdata.pathheader = element->elementdata.pathdata.pathheader; - stat = GdipClonePath(element->elementdata.pathdata.path, - &(*element2)->elementdata.pathdata.path); + stat = GdipClonePath(element->elementdata.path, &(*element2)->elementdata.path); if (stat == Ok) return Ok; break; default: @@ -178,9 +202,7 @@ region->node.type = mode; region->node.elementdata.combine.left = left; region->node.elementdata.combine.right = right; - - region->header.size = sizeheader_size + get_element_size(®ion->node); - region->header.num_children += 2; + region->num_children += 2; } /***************************************************************************** @@ -210,7 +232,7 @@ return OutOfMemory; element = &(*clone)->node; - (*clone)->header = region->header; + (*clone)->num_children = region->num_children; return clone_element(®ion->node, &element); } @@ -367,7 +389,7 @@ } fuse_region(region1, left, right, mode); - region1->header.num_children += region2->header.num_children; + region1->num_children += region2->num_children; return Ok; } @@ -413,12 +435,7 @@ GpStatus WINGDIPAPI GdipCreateRegionPath(GpPath *path, GpRegion **region) { region_element* element; - GpPoint *pointsi; - GpPointF *pointsf; - - GpStatus stat; - DWORD flags = FLAGS_INTPATH; - INT count, i; + GpStatus stat; TRACE("%p, %p\n", path, region); @@ -435,76 +452,13 @@ return stat; } element = &(*region)->node; - count = path->pathdata.Count; - - /* Test to see if the path is an Integer path */ - if (count) - { - pointsi = GdipAlloc(sizeof(GpPoint) * count); - pointsf = GdipAlloc(sizeof(GpPointF) * count); - if (!(pointsi && pointsf)) - { - GdipFree(pointsi); - GdipFree(pointsf); - GdipDeleteRegion(*region); - return OutOfMemory; - } - - stat = GdipGetPathPointsI(path, pointsi, count); - if (stat != Ok) - { - GdipDeleteRegion(*region); - return stat; - } - stat = GdipGetPathPoints(path, pointsf, count); - if (stat != Ok) - { - GdipDeleteRegion(*region); - return stat; - } - - for (i = 0; i < count; i++) - { - if (!(pointsi[i].X == pointsf[i].X && - pointsi[i].Y == pointsf[i].Y )) - { - flags = FLAGS_NOFLAGS; - break; - } - } - GdipFree(pointsi); - GdipFree(pointsf); - } - - stat = GdipClonePath(path, &element->elementdata.pathdata.path); + + stat = GdipClonePath(path, &element->elementdata.path); if (stat != Ok) { GdipDeleteRegion(*region); return stat; } - - /* 3 for headers, once again size doesn't count itself */ - element->elementdata.pathdata.pathheader.size = ((sizeof(DWORD) * 3)); - switch(flags) - { - /* Floats, sent out as floats */ - case FLAGS_NOFLAGS: - element->elementdata.pathdata.pathheader.size += - (sizeof(DWORD) * count * 2); - break; - /* INTs, sent out as packed shorts */ - case FLAGS_INTPATH: - element->elementdata.pathdata.pathheader.size += - (sizeof(DWORD) * count); - break; - default: - FIXME("Unhandled flags (%08x). Expect wrong results.\n", flags); - } - element->elementdata.pathdata.pathheader.size += get_pathtypes_size(path); - element->elementdata.pathdata.pathheader.magic = VERSION_MAGIC; - element->elementdata.pathdata.pathheader.count = count; - element->elementdata.pathdata.pathheader.flags = flags; - (*region)->header.size = sizeheader_size + get_element_size(element); return Ok; } @@ -727,25 +681,24 @@ static inline void write_packed_point(DWORD* location, INT* offset, const GpPointF* write) { - packed_point point; - - point.X = write->X; - point.Y = write->Y; - memcpy(location + *offset, &point, sizeof(packed_point)); + packed_point *point = (packed_point *)(location + *offset); + point->X = gdip_round(write->X); + point->Y = gdip_round(write->Y); (*offset)++; } static inline void write_path_types(DWORD* location, INT* offset, const GpPath* path) { + INT rounded_size = get_pathtypes_size(path); + memcpy(location + *offset, path->pathdata.Types, path->pathdata.Count); /* The unwritten parts of the DWORD (if any) must be cleared */ - if (path->pathdata.Count % sizeof(DWORD)) + if (rounded_size - path->pathdata.Count) ZeroMemory(((BYTE*)location) + (*offset * sizeof(DWORD)) + - path->pathdata.Count, - sizeof(DWORD) - path->pathdata.Count % sizeof(DWORD)); - *offset += (get_pathtypes_size(path) / sizeof(DWORD)); + path->pathdata.Count, rounded_size - path->pathdata.Count); + *offset += rounded_size / sizeof(DWORD); } static void write_element(const region_element* element, DWORD *buffer, @@ -772,12 +725,31 @@ case RegionDataPath: { INT i; - const GpPath* path = element->elementdata.pathdata.path; - - memcpy(buffer + *filled, &element->elementdata.pathdata.pathheader, - sizeof(element->elementdata.pathdata.pathheader)); - *filled += sizeof(element->elementdata.pathdata.pathheader) / sizeof(DWORD); - switch (element->elementdata.pathdata.pathheader.flags) + const GpPath* path = element->elementdata.path; + struct _pathheader + { + DWORD size; + DWORD magic; + DWORD count; + DWORD flags; + } *pathheader; + + pathheader = (struct _pathheader *)(buffer + *filled); + + pathheader->flags = is_integer_path(path) ? FLAGS_INTPATH : FLAGS_NOFLAGS; + /* 3 for headers, once again size doesn't count itself */ + pathheader->size = sizeof(DWORD) * 3; + if (pathheader->flags & FLAGS_INTPATH) + pathheader->size += 2 * sizeof(SHORT) * path->pathdata.Count; + else + pathheader->size += 2 * sizeof(FLOAT) * path->pathdata.Count; + pathheader->size += get_pathtypes_size(path); + pathheader->magic = VERSION_MAGIC; + pathheader->count = path->pathdata.Count; + + *filled += 4; + + switch (pathheader->flags & FLAGS_INTPATH) { case FLAGS_NOFLAGS: for (i = 0; i < path->pathdata.Count; i++) @@ -792,6 +764,7 @@ write_packed_point(buffer, filled, &path->pathdata.Points[i]); } + break; } write_path_types(buffer, filled, path); break; @@ -838,15 +811,36 @@ GpStatus WINGDIPAPI GdipGetRegionData(GpRegion *region, BYTE *buffer, UINT size, UINT *needed) { + struct _region_header + { + DWORD size; + DWORD checksum; + DWORD magic; + DWORD num_children; + } *region_header; INT filled = 0; + UINT required; + GpStatus status; TRACE("%p, %p, %d, %p\n", region, buffer, size, needed); - if (!(region && buffer && size)) - return InvalidParameter; - - memcpy(buffer, ®ion->header, sizeof(region->header)); - filled += sizeof(region->header) / sizeof(DWORD); + if (!region || !buffer || !size) + return InvalidParameter; + + status = GdipGetRegionDataSize(region, &required); + if (status != Ok) return status; + if (size < required) + { + if (needed) *needed = size; + return InsufficientBuffer; + } + + region_header = (struct _region_header *)buffer; + region_header->size = sizeheader_size + get_element_size(®ion->node); + region_header->checksum = 0; + region_header->magic = VERSION_MAGIC; + region_header->num_children = region->num_children; + filled += 4; /* With few exceptions, everything written is DWORD aligned, * so use that as our base */ write_element(®ion->node, (DWORD*)buffer, &filled); @@ -868,7 +862,7 @@ return InvalidParameter; /* header.size doesn't count header.size and header.checksum */ - *needed = region->header.size + sizeof(DWORD) * 2; + *needed = sizeof(DWORD) * 2 + sizeheader_size + get_element_size(®ion->node); return Ok; } @@ -938,7 +932,7 @@ *hrgn = CreateRectRgn(0, 0, 0, 0); return *hrgn ? Ok : OutOfMemory; case RegionDataPath: - return get_path_hrgn(element->elementdata.pathdata.path, graphics, hrgn); + return get_path_hrgn(element->elementdata.path, graphics, hrgn); case RegionDataRect: { GpPath* path; @@ -982,8 +976,8 @@ case CombineModeIntersect: return get_region_hrgn(element->elementdata.combine.right, graphics, hrgn); case CombineModeXor: case CombineModeExclude: - FIXME("cannot exclude from an infinite region\n"); - /* fall-through */ + left = CreateRectRgn(-4194304, -4194304, 4194304, 4194304); + break; case CombineModeUnion: case CombineModeComplement: *hrgn = NULL; return Ok; @@ -1007,8 +1001,8 @@ *hrgn = left; return Ok; case CombineModeXor: case CombineModeComplement: - FIXME("cannot exclude from an infinite region\n"); - /* fall-through */ + right = CreateRectRgn(-4194304, -4194304, 4194304, 4194304); + break; case CombineModeUnion: case CombineModeExclude: DeleteObject(left); *hrgn = NULL; @@ -1291,16 +1285,19 @@ { /* Steal the element from the created region. */ memcpy(element, &new_region->node, sizeof(region_element)); - HeapFree(GetProcessHeap(), 0, new_region); + GdipFree(new_region); } else return stat; } /* Fall-through to do the actual conversion. */ case RegionDataPath: + if (!element->elementdata.path->pathdata.Count) + return Ok; + stat = GdipTransformMatrixPoints(matrix, - element->elementdata.pathdata.path->pathdata.Points, - element->elementdata.pathdata.path->pathdata.Count); + element->elementdata.path->pathdata.Points, + element->elementdata.path->pathdata.Count); return stat; default: stat = transform_region_element(element->elementdata.combine.left, matrix); @@ -1335,9 +1332,9 @@ element->elementdata.rect.Y += dy; return; case RegionDataPath: - for(i = 0; i < element->elementdata.pathdata.path->pathdata.Count; i++){ - element->elementdata.pathdata.path->pathdata.Points[i].X += dx; - element->elementdata.pathdata.path->pathdata.Points[i].Y += dy; + for(i = 0; i < element->elementdata.path->pathdata.Count; i++){ + element->elementdata.path->pathdata.Points[i].X += dx; + element->elementdata.path->pathdata.Points[i].Y += dy; } return; default: Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Apr 22 15:42:03 2014 @@ -74,7 +74,7 @@ reactos/dll/win32/dwmapi # Synced to Wine-1.7.17 reactos/dll/win32/faultrep # Synced to Wine-1.7.1 reactos/dll/win32/fusion # Synced to Wine-1.7.1 -reactos/dll/win32/gdiplus # Synced to Wine-1.7.1 +reactos/dll/win32/gdiplus # Synced to Wine-1.7.17 reactos/dll/win32/hhctrl.ocx # Synced to Wine-1.7.1 reactos/dll/win32/hlink # Synced to Wine-1.7.1 reactos/dll/win32/hnetcfg # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
[akhaldi] 62887: [DWMAPI] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 15:28:25 2014 New Revision: 62887 URL:
http://svn.reactos.org/svn/reactos?rev=62887&view=rev
Log: [DWMAPI] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/dwmapi/dwmapi_main.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/dwmapi/dwmapi_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dwmapi/dwmapi_ma…
============================================================================== --- trunk/reactos/dll/win32/dwmapi/dwmapi_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/dwmapi/dwmapi_main.c [iso-8859-1] Tue Apr 22 15:28:25 2014 @@ -116,7 +116,9 @@ */ HRESULT WINAPI DwmSetWindowAttribute(HWND hwnd, DWORD attributenum, LPCVOID attribute, DWORD size) { - FIXME("(%p, %x, %p, %x) stub\n", hwnd, attributenum, attribute, size); + static BOOL once; + + if (!once++) FIXME("(%p, %x, %p, %x) stub\n", hwnd, attributenum, attribute, size); return E_NOTIMPL; } Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Apr 22 15:28:25 2014 @@ -71,7 +71,7 @@ reactos/dll/win32/cryptui # Synced to Wine-1.7.1 reactos/dll/win32/dbghelp # Synced to Wine-1.7.1 reactos/dll/win32/dciman32 # Synced to Wine-1.7.1 -reactos/dll/win32/dwmapi # Synced to Wine-1.7.1 +reactos/dll/win32/dwmapi # Synced to Wine-1.7.17 reactos/dll/win32/faultrep # Synced to Wine-1.7.1 reactos/dll/win32/fusion # Synced to Wine-1.7.1 reactos/dll/win32/gdiplus # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
[akhaldi] 62886: [CRYPTNET_WINETEST] * Remove redundant define.
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 15:25:37 2014 New Revision: 62886 URL:
http://svn.reactos.org/svn/reactos?rev=62886&view=rev
Log: [CRYPTNET_WINETEST] * Remove redundant define. Modified: trunk/rostests/winetests/cryptnet/CMakeLists.txt Modified: trunk/rostests/winetests/cryptnet/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/cryptnet/CMakeL…
============================================================================== --- trunk/rostests/winetests/cryptnet/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/cryptnet/CMakeLists.txt [iso-8859-1] Tue Apr 22 15:25:37 2014 @@ -1,5 +1,4 @@ -add_definitions(-D__ROS_LONG64__) add_executable(cryptnet_winetest cryptnet.c testlist.c) set_module_type(cryptnet_winetest win32cui) add_importlibs(cryptnet_winetest cryptnet crypt32 msvcrt kernel32)
10 years, 8 months
1
0
0
0
[akhaldi] 62885: [CRYPTNET] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 15:25:04 2014 New Revision: 62885 URL:
http://svn.reactos.org/svn/reactos?rev=62885&view=rev
Log: [CRYPTNET] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/cryptnet/cryptnet_main.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/cryptnet/cryptnet_main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/cryptnet/cryptne…
============================================================================== --- trunk/reactos/dll/win32/cryptnet/cryptnet_main.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/cryptnet/cryptnet_main.c [iso-8859-1] Tue Apr 22 15:25:04 2014 @@ -466,7 +466,6 @@ blob.pbData = CryptMemAlloc(size.u.LowPart); if (blob.pbData) { - blob.cbData = size.u.LowPart; ret = ReadFile(hFile, blob.pbData, size.u.LowPart, &blob.cbData, NULL); if (ret) @@ -1427,61 +1426,24 @@ return ret; } -typedef BOOL (*get_object_expiration_func)(const void *pvContext, - FILETIME *expiration); - -static BOOL CRYPT_GetExpirationFromCert(const void *pvObject, FILETIME *expiration) -{ - PCCERT_CONTEXT cert = pvObject; - - *expiration = cert->pCertInfo->NotAfter; - return TRUE; -} - -static BOOL CRYPT_GetExpirationFromCRL(const void *pvObject, FILETIME *expiration) -{ - PCCRL_CONTEXT cert = pvObject; - - *expiration = cert->pCrlInfo->NextUpdate; - return TRUE; -} - -static BOOL CRYPT_GetExpirationFromCTL(const void *pvObject, FILETIME *expiration) -{ - PCCTL_CONTEXT cert = pvObject; - - *expiration = cert->pCtlInfo->NextUpdate; - return TRUE; -} - -static BOOL CRYPT_GetExpirationFunction(LPCSTR pszObjectOid, - get_object_expiration_func *getExpiration) -{ - BOOL ret; - - if (IS_INTOID(pszObjectOid)) - { - switch (LOWORD(pszObjectOid)) - { - case LOWORD(CONTEXT_OID_CERTIFICATE): - *getExpiration = CRYPT_GetExpirationFromCert; - ret = TRUE; - break; - case LOWORD(CONTEXT_OID_CRL): - *getExpiration = CRYPT_GetExpirationFromCRL; - ret = TRUE; - break; - case LOWORD(CONTEXT_OID_CTL): - *getExpiration = CRYPT_GetExpirationFromCTL; - ret = TRUE; - break; - default: - ret = FALSE; - } - } - else - ret = FALSE; - return ret; +static BOOL CRYPT_GetExpiration(const void *object, const char *pszObjectOid, FILETIME *expiration) +{ + if (!IS_INTOID(pszObjectOid)) + return FALSE; + + switch (LOWORD(pszObjectOid)) { + case LOWORD(CONTEXT_OID_CERTIFICATE): + *expiration = ((const CERT_CONTEXT*)object)->pCertInfo->NotAfter; + return TRUE; + case LOWORD(CONTEXT_OID_CRL): + *expiration = ((const CRL_CONTEXT*)object)->pCrlInfo->NextUpdate; + return TRUE; + case LOWORD(CONTEXT_OID_CTL): + *expiration = ((const CTL_CONTEXT*)object)->pCtlInfo->NextUpdate; + return TRUE; + } + + return FALSE; } /*********************************************************************** @@ -1514,22 +1476,18 @@ CRYPT_BLOB_ARRAY object = { 0, NULL }; PFN_FREE_ENCODED_OBJECT_FUNC freeObject; void *freeContext; + FILETIME expires; ret = retrieve(pszURL, pszObjectOid, dwRetrievalFlags, dwTimeout, &object, &freeObject, &freeContext, hAsyncRetrieve, pCredentials, pAuxInfo); if (ret) { - get_object_expiration_func getExpiration; - ret = create(pszObjectOid, dwRetrievalFlags, &object, ppvObject); if (ret && !(dwRetrievalFlags & CRYPT_DONT_CACHE_RESULT) && - CRYPT_GetExpirationFunction(pszObjectOid, &getExpiration)) - { - FILETIME expires; - - if (getExpiration(*ppvObject, &expires)) - CRYPT_CacheURL(pszURL, &object, dwRetrievalFlags, expires); + CRYPT_GetExpiration(*ppvObject, pszObjectOid, &expires)) + { + CRYPT_CacheURL(pszURL, &object, dwRetrievalFlags, expires); } freeObject(pszObjectOid, &object, freeContext); } @@ -1814,14 +1772,14 @@ HCERTSTORE *rgCertStore; HCERTSTORE hCrlStore; LPFILETIME pftTimeToUse; -} CERT_REVOCATION_PARA_NO_EXTRA_FIELDS, *PCERT_REVOCATION_PARA_NO_EXTRA_FIELDS; +} CERT_REVOCATION_PARA_NO_EXTRA_FIELDS; typedef struct _OLD_CERT_REVOCATION_STATUS { DWORD cbSize; DWORD dwIndex; DWORD dwError; DWORD dwReason; -} OLD_CERT_REVOCATION_STATUS, *POLD_CERT_REVOCATION_STATUS; +} OLD_CERT_REVOCATION_STATUS; /*********************************************************************** * CertDllVerifyRevocation (CRYPTNET.@) Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Apr 22 15:25:04 2014 @@ -67,7 +67,7 @@ reactos/dll/win32/crypt32 # Synced to Wine-1.7.17 reactos/dll/win32/cryptdlg # Synced to Wine-1.7.1 reactos/dll/win32/cryptdll # Synced to Wine-1.7.1 -reactos/dll/win32/cryptnet # Synced to Wine-1.7.1 +reactos/dll/win32/cryptnet # Synced to Wine-1.7.17 reactos/dll/win32/cryptui # Synced to Wine-1.7.1 reactos/dll/win32/dbghelp # Synced to Wine-1.7.1 reactos/dll/win32/dciman32 # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
[akhaldi] 62884: [CRYPT32_WINETEST] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 15:11:03 2014 New Revision: 62884 URL:
http://svn.reactos.org/svn/reactos?rev=62884&view=rev
Log: [CRYPT32_WINETEST] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/rostests/winetests/crypt32/cert.c trunk/rostests/winetests/crypt32/chain.c trunk/rostests/winetests/crypt32/crl.c trunk/rostests/winetests/crypt32/ctl.c trunk/rostests/winetests/crypt32/encode.c trunk/rostests/winetests/crypt32/sip.c trunk/rostests/winetests/crypt32/store.c trunk/rostests/winetests/crypt32/testlist.c Modified: trunk/rostests/winetests/crypt32/cert.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/cert.c?…
============================================================================== --- trunk/rostests/winetests/crypt32/cert.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/cert.c [iso-8859-1] Tue Apr 22 15:11:03 2014 @@ -351,7 +351,7 @@ dwSizeWithNull,size); } -static CHAR cspNameA[] = "WineCryptTemp"; +static const CHAR cspNameA[] = "WineCryptTemp"; static WCHAR cspNameW[] = { 'W','i','n','e','C','r','y','p','t','T','e','m','p',0 }; static const BYTE v1CertWithPubKey[] = { 0x30,0x81,0x95,0x02,0x01,0x01,0x30,0x02,0x06,0x00,0x30,0x15,0x31,0x13,0x30, @@ -660,7 +660,6 @@ selfSignedCert, sizeof(selfSignedCert)); ok(cert != NULL, "creating cert failed: %08x\n", GetLastError()); /* Even in-memory certs are expected to have a store associated with them */ - todo_wine ok(cert->hCertStore != NULL, "expected created cert to have a store\n"); /* The cert doesn't have the archived property set (which would imply it * doesn't show up in enumerations.) @@ -681,8 +680,8 @@ static void testDupCert(void) { - HCERTSTORE store; - PCCERT_CONTEXT context, dupContext; + PCCERT_CONTEXT context, dupContext, storeContext, storeContext2, context2; + HCERTSTORE store, store2; BOOL ret; store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, @@ -720,9 +719,86 @@ } CertCloseStore(store, 0); + context = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, sizeof(bigCert)); + ok(context != NULL, "CertCreateCertificateContext failed\n"); + + dupContext = CertDuplicateCertificateContext(context); + ok(dupContext == context, "context != dupContext\n"); + + ret = CertFreeCertificateContext(dupContext); + ok(ret, "CertFreeCertificateContext failed\n"); + + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != NULL, "CertOpenStore failed: %d\n", GetLastError()); + + ret = CertAddCertificateContextToStore(store, context, CERT_STORE_ADD_NEW, &storeContext); + ok(ret, "CertAddCertificateContextToStore failed\n"); + ok(storeContext != NULL && storeContext != context, "unexpected storeContext\n"); + ok(storeContext->hCertStore == store, "unexpected hCertStore\n"); + + ok(storeContext->pbCertEncoded != context->pbCertEncoded, "unexpected pbCertEncoded\n"); + ok(storeContext->cbCertEncoded == context->cbCertEncoded, "unexpected cbCertEncoded\n"); + ok(storeContext->pCertInfo != context->pCertInfo, "unexpected pCertInfo\n"); + + store2 = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store2 != NULL, "CertOpenStore failed: %d\n", GetLastError()); + + ret = CertAddCertificateContextToStore(store2, storeContext, CERT_STORE_ADD_NEW, &storeContext2); + ok(ret, "CertAddCertificateContextToStore failed\n"); + ok(storeContext2 != NULL && storeContext2 != storeContext, "unexpected storeContext\n"); + ok(storeContext2->hCertStore == store2, "unexpected hCertStore\n"); + + ok(storeContext2->pbCertEncoded != storeContext->pbCertEncoded, "unexpected pbCertEncoded\n"); + ok(storeContext2->cbCertEncoded == storeContext->cbCertEncoded, "unexpected cbCertEncoded\n"); + ok(storeContext2->pCertInfo != storeContext->pCertInfo, "unexpected pCertInfo\n"); + + CertFreeCertificateContext(storeContext2); + CertFreeCertificateContext(storeContext); + + context2 = CertCreateCertificateContext(X509_ASN_ENCODING, certWithUsage, sizeof(certWithUsage)); + ok(context2 != NULL, "CertCreateCertificateContext failed\n"); + + ok(context2->hCertStore == context->hCertStore, "Unexpected hCertStore\n"); + + CertFreeCertificateContext(context2); + ret = CertFreeCertificateContext(context); + ok(ret, "CertFreeCertificateContext failed\n"); + + CertCloseStore(store, 0); + CertCloseStore(store2, 0); + SetLastError(0xdeadbeef); context = CertDuplicateCertificateContext(NULL); ok(context == NULL, "Expected context to be NULL\n"); + + ret = CertFreeCertificateContext(NULL); + ok(ret, "CertFreeCertificateContext failed\n"); +} + +static void testLinkCert(void) +{ + const CERT_CONTEXT *context, *link; + HCERTSTORE store; + BOOL ret; + + context = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, sizeof(bigCert)); + ok(context != NULL, "CertCreateCertificateContext failed\n"); + + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != NULL, "CertOpenStore failed: %d\n", GetLastError()); + + ret = CertAddCertificateLinkToStore(store, context, CERT_STORE_ADD_NEW, &link); + ok(ret, "CertAddCertificateContextToStore failed\n"); + ok(link != NULL && link != context, "unexpected storeContext\n"); + ok(link->hCertStore == store, "unexpected hCertStore\n"); + + ok(link->pbCertEncoded == context->pbCertEncoded, "unexpected pbCertEncoded\n"); + ok(link->cbCertEncoded == context->cbCertEncoded, "unexpected cbCertEncoded\n"); + ok(link->pCertInfo == context->pCertInfo, "unexpected pCertInfo\n"); + + CertFreeCertificateContext(link); + + CertCloseStore(store, 0); } static BYTE subjectName3[] = { 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, @@ -3648,7 +3724,7 @@ &keyProvInfo); ret = pCryptAcquireCertificatePrivateKey(cert, 0, NULL, &csp, &keySpec, &callerFree); - ok(!ret && GetLastError() == CRYPT_E_NO_KEY_PROPERTY, + ok(!ret && (GetLastError() == CRYPT_E_NO_KEY_PROPERTY || GetLastError() == NTE_BAD_KEYSET /* win8 */), "Expected CRYPT_E_NO_KEY_PROPERTY, got %08x\n", GetLastError()); pCryptAcquireContextA(&csp, cspNameA, MS_DEF_PROV_A, PROV_RSA_FULL, @@ -3903,6 +3979,7 @@ testFindCert(); testGetSubjectCert(); testGetIssuerCert(); + testLinkCert(); testCryptHashCert(); testCertSigs(); Modified: trunk/rostests/winetests/crypt32/chain.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/chain.c…
============================================================================== --- trunk/rostests/winetests/crypt32/chain.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/chain.c [iso-8859-1] Tue Apr 22 15:11:03 2014 @@ -3880,9 +3880,8 @@ ok(ret, "CertGetCertificateChain failed: %08x\n", GetLastError()); if (ret) { - ok(!(chain->TrustStatus.dwErrorStatus & - CERT_TRUST_IS_NOT_VALID_FOR_USAGE), - "didn't expect CERT_TRUST_IS_NOT_VALID_FOR_USAGE\n"); + ok(!(chain->TrustStatus.dwErrorStatus & CERT_TRUST_IS_NOT_VALID_FOR_USAGE), + "didn't expect CERT_TRUST_IS_NOT_VALID_FOR_USAGE, got %x\n", chain->TrustStatus.dwErrorStatus); pCertFreeCertificateChain(chain); } oids[1] = one_two_three; @@ -3998,13 +3997,14 @@ ok(ret, "CertGetCertificateChain failed: %u\n", GetLastError()); if(chain->TrustStatus.dwErrorStatus == CERT_TRUST_IS_PARTIAL_CHAIN) { /* win2k */ - todo_wine win_skip("winehq cert reported as partial chain, skipping its tests\n"); + win_skip("winehq cert reported as partial chain, skipping its tests\n"); pCertFreeCertificateChain(chain); CertCloseStore(store, 0); return; } ok(!chain->TrustStatus.dwErrorStatus, "chain->TrustStatus.dwErrorStatus = %x\n", chain->TrustStatus.dwErrorStatus); + todo_wine ok(chain->TrustStatus.dwInfoStatus == CERT_TRUST_HAS_PREFERRED_ISSUER, "chain->TrustStatus.dwInfoStatus = %x\n", chain->TrustStatus.dwInfoStatus); @@ -4016,6 +4016,7 @@ ok(simple_chain->cbSize == sizeof(*simple_chain), "simple_chain->cbSize = %u\n", simple_chain->cbSize); ok(!simple_chain->TrustStatus.dwErrorStatus, "simple_chain->TrustStatus.dwErrorStatus = %x\n", simple_chain->TrustStatus.dwErrorStatus); + todo_wine ok(simple_chain->TrustStatus.dwInfoStatus == CERT_TRUST_HAS_PREFERRED_ISSUER, "simple_chain->TrustStatus.dwInfoStatus = %x\n", simple_chain->TrustStatus.dwInfoStatus); ok(simple_chain->cElement == 3, "simple_chain->cElement = %u\n", simple_chain->cElement); @@ -4039,6 +4040,13 @@ test_name_blob(&simple_chain->rgpElement[2]->pCertContext->pCertInfo->Subject, "US, GeoTrust Inc., GeoTrust Global CA"); pCertFreeCertificateChain(chain); + + /* Test HCCE_LOCAL_MACHINE */ + ret = CertGetCertificateChain(HCCE_LOCAL_MACHINE, cert, &fileTime, store, ¶, 0, NULL, &chain); + ok(ret, "CertGetCertificateChain failed: %u\n", GetLastError()); + pCertFreeCertificateChain(chain); + + CertFreeCertificateContext(cert); CertCloseStore(store, 0); } Modified: trunk/rostests/winetests/crypt32/crl.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/crl.c?r…
============================================================================== --- trunk/rostests/winetests/crypt32/crl.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/crl.c [iso-8859-1] Tue Apr 22 15:11:03 2014 @@ -120,6 +120,7 @@ static void testDupCRL(void) { PCCRL_CONTEXT context, dupContext; + BOOL res; context = CertDuplicateCRLContext(NULL); ok(context == NULL, "expected NULL\n"); @@ -128,15 +129,22 @@ dupContext = CertDuplicateCRLContext(context); ok(dupContext != NULL, "expected a context\n"); ok(dupContext == context, "expected identical context addresses\n"); - CertFreeCRLContext(dupContext); - CertFreeCRLContext(context); + + res = CertFreeCRLContext(dupContext); + ok(res, "CertFreeCRLContext failed\n"); + + res = CertFreeCRLContext(context); + ok(res, "CertFreeCRLContext failed\n"); + + res = CertFreeCRLContext(NULL); + ok(res, "CertFreeCRLContext failed\n"); } static void testAddCRL(void) { HCERTSTORE store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); - PCCRL_CONTEXT context; + PCCRL_CONTEXT context, context2; BOOL ret; DWORD GLE; @@ -220,6 +228,24 @@ sizeof(newerCRL), CERT_STORE_ADD_NEWER, NULL); ok(ret, "CertAddEncodedCRLToStore failed: %08x\n", GetLastError()); + CertCloseStore(store, 0); + + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != NULL, "CertOpenStore failed\n"); + + context = CertCreateCRLContext(X509_ASN_ENCODING, CRL, sizeof(CRL)); + ok(context != NULL, "CertCreateCRLContext failed\n"); + + ret = CertAddCRLContextToStore(store, context, CERT_STORE_ADD_NEW, &context2); + ok(ret, "CertAddCRLContextToStore failed\n"); + ok(context2 != NULL && context2 != context, "unexpected context2\n"); + + ok(context->pbCrlEncoded != context2->pbCrlEncoded, "Unexpected pbCrlEncoded\n"); + ok(context->cbCrlEncoded == context2->cbCrlEncoded, "Unexpected cbCrlEncoded\n"); + ok(context->pCrlInfo != context2->pCrlInfo, "Unexpected pCrlInfo\n"); + + CertFreeCRLContext(context2); + CertFreeCRLContext(context); CertCloseStore(store, 0); } Modified: trunk/rostests/winetests/crypt32/ctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/ctl.c?r…
============================================================================== --- trunk/rostests/winetests/crypt32/ctl.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/ctl.c [iso-8859-1] Tue Apr 22 15:11:03 2014 @@ -190,6 +190,7 @@ static void testDupCTL(void) { PCCTL_CONTEXT context, dupContext; + BOOL res; context = CertDuplicateCTLContext(NULL); ok(context == NULL, "expected NULL\n"); @@ -198,8 +199,15 @@ dupContext = CertDuplicateCTLContext(context); ok(dupContext != NULL, "expected a context\n"); ok(dupContext == context, "expected identical context addresses\n"); - CertFreeCTLContext(dupContext); - CertFreeCTLContext(context); + + res = CertFreeCTLContext(dupContext); + ok(res, "CertFreeCTLContext failed\n"); + + res = CertFreeCTLContext(context); + ok(res, "CertFreeCTLContext failed\n"); + + res = CertFreeCTLContext(NULL); + ok(res, "CertFreeCTLContext failed\n"); } static void checkHash(const BYTE *data, DWORD dataLen, ALG_ID algID, Modified: trunk/rostests/winetests/crypt32/encode.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/encode.…
============================================================================== --- trunk/rostests/winetests/crypt32/encode.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/encode.c [iso-8859-1] Tue Apr 22 15:11:03 2014 @@ -849,7 +849,7 @@ { ok(size == sizeof(encodedTwoRDNs), "Unexpected size %d\n", size); ok(!memcmp(buf, encodedTwoRDNs, size), - "Unexpected value for re-endoded two RDN array\n"); + "Unexpected value for re-encoded two RDN array\n"); LocalFree(buf); } /* CERT_RDN_ANY_TYPE is too vague for X509_NAMEs, check the return */ @@ -973,7 +973,7 @@ { ok(size == sizeof(encodedTwoRDNs), "Unexpected size %d\n", size); ok(!memcmp(buf, encodedTwoRDNs, size), - "Unexpected value for re-endoded two RDN array\n"); + "Unexpected value for re-encoded two RDN array\n"); LocalFree(buf); } /* Unicode names infer the type for CERT_RDN_ANY_TYPE */ @@ -1003,7 +1003,8 @@ ok(got->dwValueType == expected->dwValueType, "Expected string type %d, got %d\n", expected->dwValueType, got->dwValueType); - ok(got->Value.cbData == expected->Value.cbData, + ok(got->Value.cbData == expected->Value.cbData || + got->Value.cbData == expected->Value.cbData - sizeof(WCHAR) /* Win8 */, "String type %d: unexpected data size, got %d, expected %d\n", expected->dwValueType, got->Value.cbData, expected->Value.cbData); if (got->Value.cbData && got->Value.pbData) @@ -4581,7 +4582,8 @@ v1CRLWithIssuerAndEmptyEntry, v1CRLWithIssuerAndEmptyEntry[1] + 2, CRYPT_DECODE_ALLOC_FLAG, NULL, &buf, &size); ok(!ret && (GetLastError() == CRYPT_E_ASN1_CORRUPT || - GetLastError() == OSS_DATA_ERROR /* Win9x */), + GetLastError() == OSS_DATA_ERROR /* Win9x */ || + GetLastError() == CRYPT_E_BAD_ENCODE /* Win8 */), "Expected CRYPT_E_ASN1_CORRUPT or OSS_DATA_ERROR, got %08x\n", GetLastError()); /* with a real CRL entry */ @@ -6765,7 +6767,7 @@ ok(GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", GetLastError()); /* To be encoded, a signer must have a valid cert ID, where a valid ID may - * be a key id or a issuer serial number with at least the issuer set, and + * be a key id or an issuer serial number with at least the issuer set, and * the encoding must include PKCS_7_ASN_ENCODING. * (That isn't enough to be decoded, see decoding tests.) */ @@ -6909,7 +6911,7 @@ LPBYTE buf = NULL; DWORD size = 0; CMSG_CMS_SIGNER_INFO *info; - static char oid1[] = "1.2.3", oid2[] = "1.5.6"; + static const char oid1[] = "1.2.3", oid2[] = "1.5.6"; /* A CMS signer can't be decoded without a serial number. */ SetLastError(0xdeadbeef); @@ -8054,9 +8056,9 @@ PCERT_PUBLIC_KEY_INFO info = NULL; /* Just in case a previous run failed, delete this thing */ - CryptAcquireContextA(&csp, cspName, MS_DEF_PROV, PROV_RSA_FULL, + CryptAcquireContextA(&csp, cspName, MS_DEF_PROV_A, PROV_RSA_FULL, CRYPT_DELETEKEYSET); - ret = CryptAcquireContextA(&csp, cspName, MS_DEF_PROV, PROV_RSA_FULL, + ret = CryptAcquireContextA(&csp, cspName, MS_DEF_PROV_A, PROV_RSA_FULL, CRYPT_NEWKEYSET); ok(ret,"CryptAcquireContextA failed\n"); @@ -8065,7 +8067,7 @@ HeapFree(GetProcessHeap(), 0, info); CryptReleaseContext(csp, 0); - ret = CryptAcquireContextA(&csp, cspName, MS_DEF_PROV, PROV_RSA_FULL, + ret = CryptAcquireContextA(&csp, cspName, MS_DEF_PROV_A, PROV_RSA_FULL, CRYPT_DELETEKEYSET); ok(ret,"CryptAcquireContextA failed\n"); } Modified: trunk/rostests/winetests/crypt32/sip.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/sip.c?r…
============================================================================== --- trunk/rostests/winetests/crypt32/sip.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/sip.c [iso-8859-1] Tue Apr 22 15:11:03 2014 @@ -36,17 +36,6 @@ static BOOL (WINAPI * funcCryptSIPVerifyIndirectData)(SIP_SUBJECTINFO *,SIP_INDIRECT_DATA *); static BOOL (WINAPI * funcCryptSIPRemoveSignedDataMsg)(SIP_SUBJECTINFO *,DWORD); -static char *show_guid(const GUID *guid, char *buf) -{ - sprintf(buf, - "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - guid->Data1, guid->Data2, guid->Data3, - guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], - guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] ); - - return buf; -} - static void test_AddRemoveProvider(void) { BOOL ret; @@ -165,7 +154,6 @@ static CHAR path[MAX_PATH]; static CHAR tempfile[MAX_PATH]; static WCHAR tempfileW[MAX_PATH]; - static char guid1[39], guid2[39]; DWORD written; /* NULL check */ @@ -186,7 +174,7 @@ "Expected ERROR_FILE_NOT_FOUND or ERROR_PATH_NOT_FOUND, got %d.\n", GetLastError()); ok ( !memcmp(&subject, &nullSubject, sizeof(GUID)), - "Expected a NULL GUID for c:\\deadbeef.dbf, not %s\n", show_guid(&subject, guid1)); + "Expected a NULL GUID for c:\\deadbeef.dbf, not %s\n", wine_dbgstr_guid(&subject)); /* Now with an executable that should exist * @@ -205,7 +193,7 @@ ret = CryptSIPRetrieveSubjectGuid(regeditPathW, NULL, &subject); ok ( ret, "Expected CryptSIPRetrieveSubjectGuid to succeed\n"); ok ( !memcmp(&subject, &unknownGUID, sizeof(GUID)), - "Expected (%s), got (%s).\n", show_guid(&unknownGUID, guid1), show_guid(&subject, guid2)); + "Expected (%s), got (%s).\n", wine_dbgstr_guid(&unknownGUID), wine_dbgstr_guid(&subject)); /* The same thing but now with a handle instead of a filename */ file = CreateFileA(regeditPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -214,7 +202,7 @@ ret = CryptSIPRetrieveSubjectGuid(NULL, file, &subject); ok ( ret, "Expected CryptSIPRetrieveSubjectGuid to succeed\n"); ok ( !memcmp(&subject, &unknownGUID, sizeof(GUID)), - "Expected (%s), got (%s).\n", show_guid(&unknownGUID, guid1), show_guid(&subject, guid2)); + "Expected (%s), got (%s).\n", wine_dbgstr_guid(&unknownGUID), wine_dbgstr_guid(&subject)); CloseHandle(file); /* And both */ @@ -224,7 +212,7 @@ ret = CryptSIPRetrieveSubjectGuid(regeditPathW, file, &subject); ok ( ret, "Expected CryptSIPRetrieveSubjectGuid to succeed\n"); ok ( !memcmp(&subject, &unknownGUID, sizeof(GUID)), - "Expected (%s), got (%s).\n", show_guid(&unknownGUID, guid1), show_guid(&subject, guid2)); + "Expected (%s), got (%s).\n", wine_dbgstr_guid(&unknownGUID), wine_dbgstr_guid(&subject)); CloseHandle(file); /* Now with an empty file */ @@ -244,7 +232,7 @@ GetLastError() == TRUST_E_SUBJECT_FORM_UNKNOWN /* some Win98 */, "Expected ERROR_FILE_INVALID, ERROR_INVALID_PARAMETER, ERROR_SUCCESS or TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x\n", GetLastError()); ok ( !memcmp(&subject, &nullSubject, sizeof(GUID)), - "Expected a NULL GUID for empty file %s, not %s\n", tempfile, show_guid(&subject, guid1)); + "Expected a NULL GUID for empty file %s, not %s\n", tempfile, wine_dbgstr_guid(&subject)); /* Use a file with a size of 3 (at least < 4) */ file = CreateFileA(tempfile, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -260,7 +248,7 @@ GetLastError() == TRUST_E_SUBJECT_FORM_UNKNOWN /* some Win98 */, "Expected ERROR_INVALID_PARAMETER, ERROR_SUCCESS or TRUST_E_SUBJECT_FORM_UNKNOWN, got 0x%08x\n", GetLastError()); ok ( !memcmp(&subject, &nullSubject, sizeof(GUID)), - "Expected a NULL GUID for empty file %s, not %s\n", tempfile, show_guid(&subject, guid1)); + "Expected a NULL GUID for empty file %s, not %s\n", tempfile, wine_dbgstr_guid(&subject)); /* And now >= 4 */ file = CreateFileA(tempfile, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -275,7 +263,7 @@ GetLastError() == ERROR_SUCCESS /* Win98 */, "Expected TRUST_E_SUBJECT_FORM_UNKNOWN or ERROR_SUCCESS, got 0x%08x\n", GetLastError()); ok ( !memcmp(&subject, &nullSubject, sizeof(GUID)), - "Expected a NULL GUID for empty file %s, not %s\n", tempfile, show_guid(&subject, guid1)); + "Expected a NULL GUID for empty file %s, not %s\n", tempfile, wine_dbgstr_guid(&subject)); /* Clean up */ DeleteFileA(tempfile); @@ -293,7 +281,7 @@ ok( ret, "CryptSIPRetrieveSubjectGuid failed: %d (0x%08x)\n", GetLastError(), GetLastError() ); ok ( !memcmp(&subject, &cabGUID, sizeof(GUID)), - "Expected GUID %s for cabinet file, not %s\n", show_guid(&cabGUID, guid1), show_guid(&subject, guid2)); + "Expected GUID %s for cabinet file, not %s\n", wine_dbgstr_guid(&cabGUID), wine_dbgstr_guid(&subject)); /* Clean up */ DeleteFileA(tempfile); @@ -311,7 +299,7 @@ ok( ret, "CryptSIPRetrieveSubjectGuid failed: %d (0x%08x)\n", GetLastError(), GetLastError() ); ok ( !memcmp(&subject, &cabGUID, sizeof(GUID)), - "Expected GUID %s for cabinet file, not %s\n", show_guid(&cabGUID, guid1), show_guid(&subject, guid2)); + "Expected GUID %s for cabinet file, not %s\n", wine_dbgstr_guid(&cabGUID), wine_dbgstr_guid(&subject)); /* Clean up */ DeleteFileA(tempfile); Modified: trunk/rostests/winetests/crypt32/store.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/store.c…
============================================================================== --- trunk/rostests/winetests/crypt32/store.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/store.c [iso-8859-1] Tue Apr 22 15:11:03 2014 @@ -93,6 +93,26 @@ 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x30, 0x07, 0x30, 0x02, 0x06, 0x00, 0x03, 0x01, 0x00, 0xa3, 0x16, 0x30, 0x14, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x01 }; +static const BYTE signedCTLWithCTLInnerContent[] = { +0x30,0x82,0x01,0x0f,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x01,0x07,0x02, +0xa0,0x82,0x01,0x00,0x30,0x81,0xfd,0x02,0x01,0x01,0x31,0x0e,0x30,0x0c,0x06, +0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0x30,0x30,0x06,0x09, +0x2b,0x06,0x01,0x04,0x01,0x82,0x37,0x0a,0x01,0xa0,0x23,0x30,0x21,0x30,0x00, +0x18,0x0f,0x31,0x36,0x30,0x31,0x30,0x31,0x30,0x31,0x30,0x30,0x30,0x30,0x30, +0x30,0x5a,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48,0x86,0xf7,0x0d,0x02,0x05,0x05, +0x00,0x31,0x81,0xb5,0x30,0x81,0xb2,0x02,0x01,0x01,0x30,0x1a,0x30,0x15,0x31, +0x13,0x30,0x11,0x06,0x03,0x55,0x04,0x03,0x13,0x0a,0x4a,0x75,0x61,0x6e,0x20, +0x4c,0x61,0x6e,0x67,0x00,0x02,0x01,0x01,0x30,0x0c,0x06,0x08,0x2a,0x86,0x48, +0x86,0xf7,0x0d,0x02,0x05,0x05,0x00,0xa0,0x3b,0x30,0x18,0x06,0x09,0x2a,0x86, +0x48,0x86,0xf7,0x0d,0x01,0x09,0x03,0x31,0x0b,0x06,0x09,0x2b,0x06,0x01,0x04, +0x01,0x82,0x37,0x0a,0x01,0x30,0x1f,0x06,0x09,0x2a,0x86,0x48,0x86,0xf7,0x0d, +0x01,0x09,0x04,0x31,0x12,0x04,0x10,0x54,0x71,0xbc,0xe1,0x56,0x31,0xa2,0xf9, +0x65,0x70,0x34,0xf8,0xe2,0xe9,0xb4,0xf4,0x30,0x04,0x06,0x00,0x05,0x00,0x04, +0x40,0x2f,0x1b,0x9f,0x5a,0x4a,0x15,0x73,0xfa,0xb1,0x93,0x3d,0x09,0x52,0xdf, +0x6b,0x98,0x4b,0x13,0x5e,0xe7,0xbf,0x65,0xf4,0x9c,0xc2,0xb1,0x77,0x09,0xb1, +0x66,0x4d,0x72,0x0d,0xb1,0x1a,0x50,0x20,0xe0,0x57,0xa2,0x39,0xc7,0xcd,0x7f, +0x8e,0xe7,0x5f,0x76,0x2b,0xd1,0x6a,0x82,0xb3,0x30,0x25,0x61,0xf6,0x25,0x23, +0x57,0x6c,0x0b,0x47,0xb8 }; static BOOL (WINAPI *pCertAddStoreToCollection)(HCERTSTORE,HCERTSTORE,DWORD,DWORD); @@ -103,6 +123,15 @@ static void (WINAPI *pCertRemoveStoreFromCollection)(HCERTSTORE,HCERTSTORE); static BOOL (WINAPI *pCertSetStoreProperty)(HCERTSTORE,DWORD,DWORD,const void*); static BOOL (WINAPI *pCertAddCertificateLinkToStore)(HCERTSTORE,PCCERT_CONTEXT,DWORD,PCCERT_CONTEXT*); + +#define test_store_is_empty(store) _test_store_is_empty(__LINE__,store) +static void _test_store_is_empty(unsigned line, HCERTSTORE store) +{ + const CERT_CONTEXT *cert; + + cert = CertEnumCertificatesInStore(store, NULL); + ok_(__FILE__,line)(!cert && GetLastError() == CRYPT_E_NOT_FOUND, "store is not empty\n"); +} static void testMemStore(void) { @@ -2498,6 +2527,176 @@ return crls; } +static void testEmptyStore(void) +{ + const CERT_CONTEXT *cert, *cert2, *cert3; + const CRL_CONTEXT *crl; + const CTL_CONTEXT *ctl; + HCERTSTORE store; + BOOL res; + + cert = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert, sizeof(bigCert)); + ok(cert != NULL, "CertCreateCertificateContext failed\n"); + ok(cert->hCertStore != NULL, "cert->hCertStore == NULL\n"); + if(!cert->hCertStore) { + CertFreeCertificateContext(cert); + return; + } + + test_store_is_empty(cert->hCertStore); + + cert2 = CertCreateCertificateContext(X509_ASN_ENCODING, bigCert2, sizeof(bigCert2)); + ok(cert2 != NULL, "CertCreateCertificateContext failed\n"); + ok(cert2->hCertStore == cert->hCertStore, "Unexpected hCertStore\n"); + + test_store_is_empty(cert2->hCertStore); + + res = CertAddCertificateContextToStore(cert->hCertStore, cert2, CERT_STORE_ADD_NEW, &cert3); + ok(res, "CertAddCertificateContextToStore failed\n"); + todo_wine + ok(cert3 && cert3 != cert2, "Unexpected cert3\n"); + ok(cert3->hCertStore == cert->hCertStore, "Unexpected hCertStore\n"); + + test_store_is_empty(cert->hCertStore); + + res = CertDeleteCertificateFromStore(cert3); + ok(res, "CertDeleteCertificateContextFromStore failed\n"); + ok(cert3->hCertStore == cert->hCertStore, "Unexpected hCertStore\n"); + + CertFreeCertificateContext(cert3); + + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != NULL, "CertOpenStore failed\n"); + + res = CertAddCertificateContextToStore(store, cert2, CERT_STORE_ADD_NEW, &cert3); + ok(res, "CertAddCertificateContextToStore failed\n"); + ok(cert3 && cert3 != cert2, "Unexpected cert3\n"); + ok(cert3->hCertStore == store, "Unexpected hCertStore\n"); + + res = CertDeleteCertificateFromStore(cert3); + ok(res, "CertDeleteCertificateContextFromStore failed\n"); + ok(cert3->hCertStore == store, "Unexpected hCertStore\n"); + + CertFreeCertificateContext(cert3); + + CertCloseStore(store, 0); + + res = CertCloseStore(cert->hCertStore, CERT_CLOSE_STORE_CHECK_FLAG); + ok(!res && GetLastError() == E_UNEXPECTED, "CertCloseStore returned: %x(%x)\n", res, GetLastError()); + + res = CertCloseStore(cert->hCertStore, 0); + ok(!res && GetLastError() == E_UNEXPECTED, "CertCloseStore returned: %x(%x)\n", res, GetLastError()); + + CertFreeCertificateContext(cert2); + + crl = CertCreateCRLContext(X509_ASN_ENCODING, signedCRL, sizeof(signedCRL)); + ok(crl != NULL, "CertCreateCRLContext failed\n"); + ok(crl->hCertStore == cert->hCertStore, "unexpected hCertStore\n"); + + CertFreeCRLContext(crl); + + ctl = CertCreateCTLContext(X509_ASN_ENCODING, signedCTLWithCTLInnerContent, sizeof(signedCTLWithCTLInnerContent)); + ok(ctl != NULL, "CertCreateCTLContext failed\n"); + ok(ctl->hCertStore == cert->hCertStore, "unexpected hCertStore\n"); + + CertFreeCTLContext(ctl); + + CertFreeCertificateContext(cert); +} + +static void testCloseStore(void) +{ + const CERT_CONTEXT *cert; + const CRL_CONTEXT *crl; + const CTL_CONTEXT *ctl; + HCERTSTORE store, store2; + BOOL res; + + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != NULL, "CertOpenStore failed\n"); + + res = CertCloseStore(store, CERT_CLOSE_STORE_CHECK_FLAG); + ok(res, "CertCloseStore failed\n"); + + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != NULL, "CertOpenStore failed\n"); + + store2 = CertDuplicateStore(store); + ok(store2 != NULL, "CertCloneStore failed\n"); + ok(store2 == store, "unexpected store2\n"); + + res = CertCloseStore(store, CERT_CLOSE_STORE_CHECK_FLAG); + ok(!res && GetLastError() == CRYPT_E_PENDING_CLOSE, "CertCloseStore failed\n"); + + res = CertCloseStore(store2, CERT_CLOSE_STORE_CHECK_FLAG); + ok(res, "CertCloseStore failed\n"); + + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != NULL, "CertOpenStore failed\n"); + + res = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, bigCert, + sizeof(bigCert), CERT_STORE_ADD_ALWAYS, &cert); + ok(res, "CertAddEncodedCertificateToStore failed\n"); + + /* There is still a reference from cert */ + res = CertCloseStore(store, CERT_CLOSE_STORE_CHECK_FLAG); + ok(!res && GetLastError() == CRYPT_E_PENDING_CLOSE, "CertCloseStore failed\n"); + + res = CertFreeCertificateContext(cert); + ok(res, "CertFreeCertificateContext failed\n"); + + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != NULL, "CertOpenStore failed\n"); + + res = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, signedCRL, + sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, &crl); + ok(res, "CertAddEncodedCRLToStore failed\n"); + + /* There is still a reference from CRL */ + res = CertCloseStore(store, CERT_CLOSE_STORE_CHECK_FLAG); + ok(!res && GetLastError() == CRYPT_E_PENDING_CLOSE, "CertCloseStore failed\n"); + + res = CertFreeCRLContext(crl); + ok(res, "CertFreeCRLContext failed\n"); + + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != NULL, "CertOpenStore failed\n"); + + res = CertAddEncodedCTLToStore(store, X509_ASN_ENCODING, signedCTLWithCTLInnerContent, + sizeof(signedCTLWithCTLInnerContent), CERT_STORE_ADD_ALWAYS, &ctl); + ok(res, "CertAddEncodedCTLToStore failed\n"); + + /* There is still a reference from CTL */ + res = CertCloseStore(store, CERT_CLOSE_STORE_CHECK_FLAG); + ok(!res && GetLastError() == CRYPT_E_PENDING_CLOSE, "CertCloseStore returned: %x(%u)\n", res, GetLastError()); + + res = CertFreeCTLContext(ctl); + ok(res, "CertFreeCTLContext failed\n"); + + /* Add all kinds of contexts, then release external references and make sure that store is properly closed. */ + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, CERT_STORE_CREATE_NEW_FLAG, NULL); + ok(store != NULL, "CertOpenStore failed\n"); + + res = CertAddEncodedCertificateToStore(store, X509_ASN_ENCODING, bigCert, + sizeof(bigCert), CERT_STORE_ADD_ALWAYS, &cert); + ok(res, "CertAddEncodedCertificateToStore failed\n"); + + res = CertAddEncodedCRLToStore(store, X509_ASN_ENCODING, signedCRL, + sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, &crl); + ok(res, "CertAddEncodedCRLToStore failed\n"); + + res = CertAddEncodedCTLToStore(store, X509_ASN_ENCODING, signedCTLWithCTLInnerContent, + sizeof(signedCTLWithCTLInnerContent), CERT_STORE_ADD_ALWAYS, &ctl); + ok(res, "CertAddEncodedCTLToStore failed\n"); + + CertFreeCertificateContext(cert); + CertFreeCRLContext(crl); + CertFreeCTLContext(ctl); + + res = CertCloseStore(store, CERT_CLOSE_STORE_CHECK_FLAG); + ok(res, "CertCloseStore failed\n"); +} + static void test_I_UpdateStore(void) { HMODULE lib = GetModuleHandleA("crypt32"); @@ -2596,6 +2795,7 @@ testFileNameStore(); testMessageStore(); testSerializedStore(); + testCloseStore(); testCertOpenSystemStore(); testCertEnumSystemStore(); @@ -2604,5 +2804,7 @@ testAddSerialized(); testAddCertificateLink(); + testEmptyStore(); + test_I_UpdateStore(); } Modified: trunk/rostests/winetests/crypt32/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/crypt32/testlis…
============================================================================== --- trunk/rostests/winetests/crypt32/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/crypt32/testlist.c [iso-8859-1] Tue Apr 22 15:11:03 2014 @@ -26,15 +26,15 @@ { "chain", func_chain }, { "crl", func_crl }, { "ctl", func_ctl }, - { "encode", func_encode }, - { "main", func_main }, - { "message", func_message }, - { "msg", func_msg }, - { "object", func_object }, - { "oid", func_oid }, - { "protectdata", func_protectdata }, - { "sip", func_sip }, - { "store", func_store }, - { "str", func_str }, - { 0, 0 } + { "encode", func_encode }, + { "main", func_main }, + { "message", func_message }, + { "msg", func_msg }, + { "object", func_object }, + { "oid", func_oid }, + { "protectdata", func_protectdata }, + { "sip", func_sip }, + { "store", func_store }, + { "str", func_str }, + { 0, 0 } };
10 years, 8 months
1
0
0
0
[akhaldi] 62883: [CRYPT32] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 15:10:43 2014 New Revision: 62883 URL:
http://svn.reactos.org/svn/reactos?rev=62883&view=rev
Log: [CRYPT32] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/crypt32/CMakeLists.txt trunk/reactos/dll/win32/crypt32/cert.c trunk/reactos/dll/win32/crypt32/chain.c trunk/reactos/dll/win32/crypt32/collectionstore.c trunk/reactos/dll/win32/crypt32/context.c trunk/reactos/dll/win32/crypt32/crl.c trunk/reactos/dll/win32/crypt32/crypt32_private.h trunk/reactos/dll/win32/crypt32/ctl.c trunk/reactos/dll/win32/crypt32/encode.c trunk/reactos/dll/win32/crypt32/filestore.c trunk/reactos/dll/win32/crypt32/main.c trunk/reactos/dll/win32/crypt32/msg.c trunk/reactos/dll/win32/crypt32/object.c trunk/reactos/dll/win32/crypt32/oid.c trunk/reactos/dll/win32/crypt32/proplist.c trunk/reactos/dll/win32/crypt32/provstore.c trunk/reactos/dll/win32/crypt32/regstore.c trunk/reactos/dll/win32/crypt32/rootstore.c trunk/reactos/dll/win32/crypt32/serialize.c trunk/reactos/dll/win32/crypt32/store.c trunk/reactos/dll/win32/crypt32/str.c trunk/reactos/media/doc/README.WINE [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/dll/win32/crypt32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/CMakeLis…
Modified: trunk/reactos/dll/win32/crypt32/cert.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/cert.c?r…
Modified: trunk/reactos/dll/win32/crypt32/chain.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/chain.c?…
Modified: trunk/reactos/dll/win32/crypt32/collectionstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/collecti…
Modified: trunk/reactos/dll/win32/crypt32/context.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/context.…
Modified: trunk/reactos/dll/win32/crypt32/crl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/crl.c?re…
Modified: trunk/reactos/dll/win32/crypt32/crypt32_private.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/crypt32_…
Modified: trunk/reactos/dll/win32/crypt32/ctl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/ctl.c?re…
Modified: trunk/reactos/dll/win32/crypt32/encode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/encode.c…
Modified: trunk/reactos/dll/win32/crypt32/filestore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/filestor…
Modified: trunk/reactos/dll/win32/crypt32/main.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/main.c?r…
Modified: trunk/reactos/dll/win32/crypt32/msg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/msg.c?re…
Modified: trunk/reactos/dll/win32/crypt32/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/object.c…
Modified: trunk/reactos/dll/win32/crypt32/oid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/oid.c?re…
Modified: trunk/reactos/dll/win32/crypt32/proplist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/proplist…
Modified: trunk/reactos/dll/win32/crypt32/provstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/provstor…
Modified: trunk/reactos/dll/win32/crypt32/regstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/regstore…
Modified: trunk/reactos/dll/win32/crypt32/rootstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/rootstor…
Modified: trunk/reactos/dll/win32/crypt32/serialize.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/serializ…
Modified: trunk/reactos/dll/win32/crypt32/store.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/store.c?…
Modified: trunk/reactos/dll/win32/crypt32/str.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/crypt32/str.c?re…
Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
10 years, 8 months
1
0
0
0
[akhaldi] 62882: [COMDLG32_WINETEST] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 14:40:38 2014 New Revision: 62882 URL:
http://svn.reactos.org/svn/reactos?rev=62882&view=rev
Log: [COMDLG32_WINETEST] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/rostests/winetests/comdlg32/filedlg.c trunk/rostests/winetests/comdlg32/finddlg.c trunk/rostests/winetests/comdlg32/printdlg.c Modified: trunk/rostests/winetests/comdlg32/filedlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comdlg32/filedl…
============================================================================== --- trunk/rostests/winetests/comdlg32/filedlg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comdlg32/filedlg.c [iso-8859-1] Tue Apr 22 14:40:38 2014 @@ -39,7 +39,7 @@ /* ##### */ -static int resizesupported = TRUE; +static BOOL resizesupported = TRUE; static void toolbarcheck( HWND hDlg) { @@ -52,14 +52,14 @@ for( ctrl = GetWindow( hDlg, GW_CHILD); ctrl ; ctrl = GetWindow( ctrl, GW_HWNDNEXT)) { - GetClassName( ctrl, classname, 10); + GetClassNameA( ctrl, classname, 10); classname[7] = '\0'; if( !strcmp( classname, "Toolbar")) break; } ok( ctrl != NULL, "could not get the toolbar control\n"); - ret = SendMessage( ctrl, TB_ADDSTRING, 0, (LPARAM)"winetestwinetest\0\0"); + ret = SendMessageA( ctrl, TB_ADDSTRINGA, 0, (LPARAM)"winetestwinetest\0\0"); ok( ret == 0, "addstring returned %d (expected 0)\n", ret); - maxtextrows = SendMessage( ctrl, TB_GETTEXTROWS, 0, 0); + maxtextrows = SendMessageA( ctrl, TB_GETTEXTROWS, 0, 0); ok( maxtextrows == 0 || broken(maxtextrows == 1), /* Win2k and below */ "Get(Max)TextRows returned %d (expected 0)\n", maxtextrows); } @@ -74,14 +74,14 @@ nmh = (LPNMHDR) lParam; if( nmh->code == CDN_INITDONE) { - PostMessage( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE); + PostMessageA( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE); } else if (nmh->code == CDN_FOLDERCHANGE ) { char buf[1024]; int ret; memset(buf, 0x66, sizeof(buf)); - ret = SendMessage( GetParent(hDlg), CDM_GETFOLDERIDLIST, 5, (LPARAM)buf); + ret = SendMessageA( GetParent(hDlg), CDM_GETFOLDERIDLIST, 5, (LPARAM)buf); ok(ret > 0, "CMD_GETFOLDERIDLIST not implemented\n"); if (ret > 5) ok(buf[0] == 0x66 && buf[1] == 0x66, "CMD_GETFOLDERIDLIST: The buffer was touched on failure\n"); @@ -100,7 +100,7 @@ char szFileName[MAX_PATH] = ""; char szInitialDir[MAX_PATH]; - GetWindowsDirectory(szInitialDir, MAX_PATH); + GetWindowsDirectoryA(szInitialDir, MAX_PATH); ZeroMemory(&ofn, sizeof(ofn)); @@ -119,7 +119,7 @@ "expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError()); result = GetOpenFileNameA(&ofn); - ok(0 == result, "expected 0, got %d\n", result); + ok(FALSE == result, "expected FALSE, got %d\n", result); ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError()); @@ -128,7 +128,7 @@ "expected CDERR_INITIALIZATION, got %d\n", CommDlgExtendedError()); result = GetSaveFileNameA(&ofn); - ok(0 == result, "expected 0, got %d\n", result); + ok(FALSE == result, "expected FALSE, got %d\n", result); ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError()); @@ -151,7 +151,7 @@ win_skip("GetOpenFileNameW is not implemented\n"); else { - ok(0 == result, "expected 0, got %d\n", result); + ok(FALSE == result, "expected FALSE, got %d\n", result); ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError()); } @@ -161,7 +161,7 @@ win_skip("GetSaveFileNameW is not implemented\n"); else { - ok(0 == result, "expected 0, got %d\n", result); + ok(FALSE == result, "expected FALSE, got %d\n", result); ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError()); } } @@ -172,7 +172,7 @@ { if (((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE) { - IShellBrowser *shell_browser = (IShellBrowser *)SendMessage(GetParent(dlg), WM_USER + 7 /* WM_GETISHELLBROWSER */, 0, 0); + IShellBrowser *shell_browser = (IShellBrowser *)SendMessageA(GetParent(dlg), WM_USER + 7 /* WM_GETISHELLBROWSER */, 0, 0); IShellView *shell_view = NULL; IShellView2 *shell_view2 = NULL; SV2CVW2_PARAMS view_params; @@ -244,7 +244,7 @@ cleanup: if (shell_view2) IShellView2_Release(shell_view2); if (shell_view) IShellView_Release(shell_view); - PostMessage(GetParent(dlg), WM_COMMAND, IDCANCEL, 0); + PostMessageA(GetParent(dlg), WM_COMMAND, IDCANCEL, 0); } } return 0; @@ -260,13 +260,13 @@ ok(p!=NULL, "Failed to get parent of template\n"); cb = GetDlgItem(p,0x470); ok(cb!=NULL, "Failed to get filter combobox\n"); - sel = SendMessage(cb, CB_GETCURSEL, 0, 0); + sel = SendMessageA(cb, CB_GETCURSEL, 0, 0); ok (sel != -1, "Failed to get selection from filter listbox\n"); } if (msg == WM_NOTIFY) { if (((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE) - PostMessage(GetParent(dlg), WM_COMMAND, IDCANCEL, 0); + PostMessageA(GetParent(dlg), WM_COMMAND, IDCANCEL, 0); } return 0; } @@ -333,7 +333,7 @@ { static RECT initrc, rc; static int index, count; - static int gotSWP_bottom, gotShowWindow; + static BOOL gotSWP_bottom, gotShowWindow; HWND parent = GetParent( dlg); int resize; #define MAXNRCTRLS 30 @@ -348,16 +348,16 @@ { DWORD style; - index = ((OPENFILENAME*)lParam)->lCustData; + index = ((OPENFILENAMEA*)lParam)->lCustData; count = 0; - gotSWP_bottom = gotShowWindow = 0; + gotSWP_bottom = gotShowWindow = FALSE; /* test style */ - style = GetWindowLong( parent, GWL_STYLE); + style = GetWindowLongA( parent, GWL_STYLE); if( resize_testcases[index].flags & OFN_ENABLESIZING) if( !(style & WS_SIZEBOX)) { win_skip( "OFN_ENABLESIZING flag not supported.\n"); resizesupported = FALSE; - PostMessage( parent, WM_COMMAND, IDCANCEL, 0); + PostMessageA( parent, WM_COMMAND, IDCANCEL, 0); } else ok( style & WS_SIZEBOX, "testid %d: dialog should have a WS_SIZEBOX style.\n", index); @@ -514,7 +514,7 @@ } } KillTimer( dlg, 0); - PostMessage( parent, WM_COMMAND, IDCANCEL, 0); + PostMessageA( parent, WM_COMMAND, IDCANCEL, 0); } count++; } @@ -523,16 +523,16 @@ { WINDOWPOS *pwp = (WINDOWPOS *)lParam; if( !index && pwp->hwndInsertAfter == HWND_BOTTOM){ - gotSWP_bottom = 1; - ok( gotShowWindow == 0, "The WM_WINDOWPOSCHANGING message came after a WM_SHOWWINDOW message\n"); + gotSWP_bottom = TRUE; + ok(!gotShowWindow, "The WM_WINDOWPOSCHANGING message came after a WM_SHOWWINDOW message\n"); } } break; case WM_SHOWWINDOW: { if( !index){ - gotShowWindow = 1; - ok( gotSWP_bottom == 1, "No WM_WINDOWPOSCHANGING message came before a WM_SHOWWINDOW message\n"); + gotShowWindow = TRUE; + ok(gotSWP_bottom, "No WM_WINDOWPOSCHANGING message came before a WM_SHOWWINDOW message\n"); } } break; @@ -542,7 +542,7 @@ static void test_resize(void) { - OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; + OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A }; char filename[1024] = {0}; DWORD ret; int i; @@ -550,13 +550,13 @@ ofn.lpstrFile = filename; ofn.nMaxFile = 1024; ofn.lpfnHook = resize_template_hook; - ofn.hInstance = GetModuleHandle(NULL); + ofn.hInstance = GetModuleHandleA(NULL); ofn.lpTemplateName = "template_sz"; for( i = 0; resize_testcases[i].flags != 0xffffffff; i++) { ofn.lCustData = i; ofn.Flags = resize_testcases[i].flags | OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE | OFN_SHOWHELP ; - ret = GetOpenFileName(&ofn); + ret = GetOpenFileNameA(&ofn); ok(!ret, "GetOpenFileName returned %#x\n", ret); ret = CommDlgExtendedError(); ok(!ret, "CommDlgExtendedError returned %#x\n", ret); @@ -599,14 +599,14 @@ static UINT msgFILEOKSTRING; if (msg == WM_INITDIALOG) { - testcase = (ok_wndproc_testcase*)((OPENFILENAME*)lParam)->lCustData; + testcase = (ok_wndproc_testcase*)((OPENFILENAMEA*)lParam)->lCustData; testcase->actclose = TRUE; - msgFILEOKSTRING = RegisterWindowMessageA( FILEOKSTRING); + msgFILEOKSTRING = RegisterWindowMessageA( FILEOKSTRINGA); } if( msg == WM_NOTIFY) { if(((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE) { SetTimer( dlg, 0, 100, 0); - PostMessage( parent, WM_COMMAND, IDOK, 0); + PostMessageA( parent, WM_COMMAND, IDOK, 0); return FALSE; } else if(((LPNMHDR)lParam)->code == CDN_FILEOK) { if( testcase->usemsgokstr) @@ -627,11 +627,11 @@ /* the dialog did not close automatically */ testcase->actclose = FALSE; KillTimer( dlg, 0); - PostMessage( parent, WM_COMMAND, IDCANCEL, 0); + PostMessageA( parent, WM_COMMAND, IDCANCEL, 0); return FALSE; } if( testcase && testcase->do_subclass) - return DefWindowProc( dlg, msg, wParam, lParam); + return DefWindowProcA( dlg, msg, wParam, lParam); return FALSE; } @@ -644,7 +644,7 @@ static void test_ok(void) { - OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; + OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A }; char filename[1024] = {0}; char tmpfilename[ MAX_PATH]; char curdir[MAX_PATH]; @@ -660,7 +660,7 @@ } ofn.lpstrFile = filename; ofn.nMaxFile = 1024; - ofn.hInstance = GetModuleHandle(NULL); + ofn.hInstance = GetModuleHandleA(NULL); ofn.lpTemplateName = "template1"; ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE ; for( i = 0; ok_testcases[i].retval != -1; i++) { @@ -725,7 +725,7 @@ dlgParent = GetParent( dlgChild); if (msg == WM_INITDIALOG) { - index = ((OPENFILENAME*)lParam)->lCustData; + index = ((OPENFILENAMEA*)lParam)->lCustData; /* get the positions before rearrangement */ GetClientRect( dlgParent, &clrcParent); GetClientRect( dlgChild, &clrcChild); @@ -780,7 +780,7 @@ else expectx += clrcChild.right - ( rcStc32.right - rcStc32.left) ; } - style = GetWindowLong( dlgParent, GWL_STYLE); + style = GetWindowLongA( dlgParent, GWL_STYLE); if( !(style & WS_SIZEBOX)) { /* without the OFN_ENABLESIZING flag */ ok( wrcParent.bottom - wrcParent.top == expecty, @@ -800,7 +800,7 @@ } } - PostMessage( dlgParent, WM_COMMAND, IDCANCEL, 0); + PostMessageA( dlgParent, WM_COMMAND, IDCANCEL, 0); } return 0; } @@ -818,8 +818,8 @@ int i; /* load subdialog template into memory */ - hRes = FindResource( GetModuleHandle(NULL), "template_stc32", (LPSTR)RT_DIALOG); - hDlgTmpl = LoadResource( GetModuleHandle(NULL), hRes ); + hRes = FindResourceA( GetModuleHandleA(NULL), "template_stc32", (LPSTR)RT_DIALOG); + hDlgTmpl = LoadResource( GetModuleHandleA(NULL), hRes ); /* get pointers to the structures for the dialog and the controls */ pv = LockResource( hDlgTmpl ); template = (DLGTEMPLATE*)pv; @@ -893,7 +893,7 @@ nmh = (LPNMHDR) lParam; if( nmh->code == CDN_INITDONE) { - PostMessage( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE); + PostMessageA( GetParent(hDlg), WM_COMMAND, IDCANCEL, FALSE); } else if ( nmh->code == CDN_FOLDERCHANGE) { @@ -920,7 +920,7 @@ /* We need to pick a different directory as the other tests because of new * Windows 7 behavior. */ - GetSystemDirectory(szInitialDir, MAX_PATH); + GetSystemDirectoryA(szInitialDir, MAX_PATH); lstrcpyA(SYSDIR, szInitialDir); ZeroMemory(&ofn, sizeof(ofn)); @@ -936,12 +936,12 @@ ofn.lpstrInitialDir = szInitialDir; result = GetOpenFileNameA(&ofn); - ok(0 == result, "expected 0, got %d\n", result); + ok(FALSE == result, "expected FALSE, got %d\n", result); ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError()); result = GetSaveFileNameA(&ofn); - ok(0 == result, "expected 0, got %d\n", result); + ok(FALSE == result, "expected FALSE, got %d\n", result); ok(0 == CommDlgExtendedError(), "expected 0, got %d\n", CommDlgExtendedError()); } @@ -964,7 +964,7 @@ ofn.hInstance = GetModuleHandleA(NULL); ofn.lpTemplateName = "template1"; ofn.Flags = OFN_EXPLORER; -#define ISSIZABLE 1 +#define ISSIZABLE TRUE ret = GetOpenFileNameA(&ofn); ok( ret == ISSIZABLE, "File Dialog should have been sizable\n"); ret = CommDlgExtendedError(); @@ -975,7 +975,7 @@ ret = CommDlgExtendedError(); ok(!ret, "CommDlgExtendedError returned %#x\n", ret); ofn.Flags = OFN_EXPLORER | OFN_ENABLETEMPLATEHANDLE; - ofn.hInstance = LoadResource( GetModuleHandle(NULL), FindResource( GetModuleHandle(NULL), "template1", (LPSTR)RT_DIALOG)); + ofn.hInstance = LoadResource( GetModuleHandleA(NULL), FindResourceA( GetModuleHandleA(NULL), "template1", (LPSTR)RT_DIALOG)); ofn.lpTemplateName = NULL; ret = GetOpenFileNameA(&ofn); ok( ret != ISSIZABLE, "File Dialog should NOT have been sizable\n"); @@ -992,7 +992,7 @@ static void test_mru(void) { ok_wndproc_testcase testcase = {0}; - OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; + OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A }; const char *test_dir_name = "C:\\mru_test"; const char *test_file_name = "test.txt"; const char *test_full_path = "C:\\mru_test\\test.txt"; @@ -1002,7 +1002,7 @@ ofn.lpstrFile = filename_buf; ofn.nMaxFile = sizeof(filename_buf); ofn.lpTemplateName = "template1"; - ofn.hInstance = GetModuleHandle(NULL); + ofn.hInstance = GetModuleHandleA(NULL); ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER | OFN_ENABLETEMPLATE | OFN_NOCHANGEDIR; ofn.lCustData = (LPARAM)&testcase; ofn.lpfnHook = test_ok_wndproc; @@ -1043,19 +1043,19 @@ HWND parent = GetParent( dlg); if( msg == WM_NOTIFY) { SetTimer( dlg, 0, 1000, 0); - PostMessage( parent, WM_COMMAND, IDOK, 0); + PostMessageA( parent, WM_COMMAND, IDOK, 0); } if( msg == WM_TIMER) { /* the dialog did not close automatically */ KillTimer( dlg, 0); - PostMessage( parent, WM_COMMAND, IDCANCEL, 0); + PostMessageA( parent, WM_COMMAND, IDCANCEL, 0); } return FALSE; } #define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0])) -static void test_extension_helper(OPENFILENAME* ofn, const char *filter, +static void test_extension_helper(OPENFILENAMEA* ofn, const char *filter, const char *expected_filename) { char *filename_ptr; @@ -1078,7 +1078,7 @@ static void test_extension(void) { - OPENFILENAME ofn = { OPENFILENAME_SIZE_VERSION_400 }; + OPENFILENAMEA ofn = { OPENFILENAME_SIZE_VERSION_400A }; char filename[1024] = {0}; char curdir[MAX_PATH]; unsigned int i; @@ -1150,7 +1150,7 @@ CHAR className[20]; if(GetClassNameA(hwnd, className, sizeof(className)) > 0 && !strcmp("Edit",className)) { - SetWindowText(hwnd, "testfile"); + SetWindowTextA(hwnd, "testfile"); return FALSE; /* break window enumeration */ } return TRUE; @@ -1166,11 +1166,11 @@ } if( msg == WM_TIMER) { if(!wParam) - PostMessage( parent, WM_COMMAND, IDOK, 0); + PostMessageA( parent, WM_COMMAND, IDOK, 0); else { /* the dialog did not close automatically */ KillTimer( dlg, 0); - PostMessage( parent, WM_COMMAND, IDCANCEL, 0); + PostMessageA( parent, WM_COMMAND, IDCANCEL, 0); } } return FALSE; Modified: trunk/rostests/winetests/comdlg32/finddlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comdlg32/finddl…
============================================================================== --- trunk/rostests/winetests/comdlg32/finddlg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comdlg32/finddlg.c [iso-8859-1] Tue Apr 22 14:40:38 2014 @@ -42,7 +42,7 @@ if(msg == ID_FINDMSGSTRING) { return handle_findmsg((FINDREPLACEA*)lParam); } - return DefWindowProc(hwnd, msg, wParam, lParam); + return DefWindowProcA(hwnd, msg, wParam, lParam); } static void test_param_check(void) @@ -133,7 +133,7 @@ CHECK_FINDREPLACE_FAIL(CDERR_FINDRESFAILURE); fr.Flags = FR_ENABLETEMPLATEHANDLE; CHECK_FINDREPLACE_FAIL(CDERR_NOHINSTANCE); - fr.hInstance = GetModuleHandle(NULL); + fr.hInstance = GetModuleHandleA(NULL); /* invalid lpTemplateName (NULL) when Flags has FR_ENABLETEMPLATE */ fr.Flags = FR_ENABLETEMPLATE; Modified: trunk/rostests/winetests/comdlg32/printdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comdlg32/printd…
============================================================================== --- trunk/rostests/winetests/comdlg32/printdlg.c [iso-8859-1] (original) +++ trunk/rostests/winetests/comdlg32/printdlg.c [iso-8859-1] Tue Apr 22 14:40:38 2014 @@ -52,18 +52,6 @@ static const CHAR emptyA[] = ""; static const CHAR PrinterPortsA[] = "PrinterPorts"; -static const char *debugstr_guid(const GUID *guid) -{ - static char buf[50]; - - if (!guid) return "(null)"; - sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], - guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], - guid->Data4[5], guid->Data4[6], guid->Data4[7]); - return buf; -} - /* ########################### */ static void test_PageSetupDlgA(void) @@ -133,7 +121,7 @@ /* some driver popup a dialog and hung the test or silently limit the number of copies, when trying to set more than 999 copies */ SetDlgItemInt(hdlg, edt3, 123, FALSE); - PostMessage(hdlg, WM_COMMAND, IDOK, FALSE); + PostMessageA(hdlg, WM_COMMAND, IDOK, FALSE); } return 0; } @@ -148,7 +136,7 @@ LPCSTR port; CHAR buffer[MAX_PATH]; LPSTR ptr; - DEVMODE *dm; + DEVMODEA *dm; pDlg = HeapAlloc(GetProcessHeap(), 0, (sizeof(PRINTDLGA)) * 2); if (!pDlg) return; @@ -232,7 +220,7 @@ ok( lstrcmpiA(driver, buffer) == 0, "got driver '%s' (expected '%s')\n", driver, buffer); - n_copies = DeviceCapabilities(device, port, DC_COPIES, NULL, NULL); + n_copies = DeviceCapabilitiesA(device, port, DC_COPIES, NULL, NULL); ok(n_copies > 0, "DeviceCapabilities(DC_COPIES) failed\n"); } @@ -251,7 +239,7 @@ pDlg->lStructSize = sizeof(*pDlg); pDlg->Flags = PD_ENABLEPRINTHOOK; pDlg->lpfnPrintHook = print_hook_proc; - res = PrintDlg(pDlg); + res = PrintDlgA(pDlg); ok(res, "PrintDlg error %#x\n", CommDlgExtendedError()); /* Version of Microsoft XPS Document Writer driver shipped before Win7 * reports that it can print multiple copies, but returns 1. @@ -270,7 +258,7 @@ pDlg->lStructSize = sizeof(*pDlg); pDlg->Flags = PD_ENABLEPRINTHOOK | PD_USEDEVMODECOPIES; pDlg->lpfnPrintHook = print_hook_proc; - res = PrintDlg(pDlg); + res = PrintDlgA(pDlg); ok(res, "PrintDlg error %#x\n", CommDlgExtendedError()); ok(pDlg->nCopies == 1, "expected nCopies 1, got %d\n", pDlg->nCopies); ok(pDlg->hDevMode != 0, "hDevMode should not be 0\n"); @@ -289,7 +277,7 @@ static HRESULT WINAPI callback_QueryInterface(IPrintDialogCallback *iface, REFIID riid, void **ppv) { - ok(0, "callback_QueryInterface(%s): unexpected call\n", debugstr_guid(riid)); + ok(0, "callback_QueryInterface(%s): unexpected call\n", wine_dbgstr_guid(riid)); return E_NOINTERFACE; } @@ -339,7 +327,7 @@ static HRESULT WINAPI unknown_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) { - trace("unknown_QueryInterface %s\n", debugstr_guid(riid)); + trace("unknown_QueryInterface %s\n", wine_dbgstr_guid(riid)); if (IsEqualGUID(riid, &IID_IPrintDialogCallback)) { @@ -352,7 +340,7 @@ return E_NOINTERFACE; } - ok(0, "unexpected IID %s\n", debugstr_guid(riid)); + ok(0, "unexpected IID %s\n", wine_dbgstr_guid(riid)); *ppv = NULL; return E_NOINTERFACE; } @@ -392,7 +380,7 @@ } /* Set CommDlgExtendedError != 0 */ - PrintDlg(NULL); + PrintDlgA(NULL); SetLastError(0xdeadbeef); res = pPrintDlgExW(NULL); ok( (res == E_INVALIDARG), @@ -406,7 +394,7 @@ /* lStructSize must be exact */ ZeroMemory(pDlg, sizeof(PRINTDLGEXW)); pDlg->lStructSize = sizeof(PRINTDLGEXW) - 1; - PrintDlg(NULL); + PrintDlgA(NULL); SetLastError(0xdeadbeef); res = pPrintDlgExW(pDlg); ok( (res == E_INVALIDARG), @@ -416,7 +404,7 @@ ZeroMemory(pDlg, sizeof(PRINTDLGEXW)); pDlg->lStructSize = sizeof(PRINTDLGEXW) + 1; - PrintDlg(NULL); + PrintDlgA(NULL); SetLastError(0xdeadbeef); res = pPrintDlgExW(pDlg); ok( (res == E_INVALIDARG),
10 years, 8 months
1
0
0
0
[akhaldi] 62881: [COMDLG32] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 14:40:19 2014 New Revision: 62881 URL:
http://svn.reactos.org/svn/reactos?rev=62881&view=rev
Log: [COMDLG32] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/comdlg32/colordlg.c trunk/reactos/dll/win32/comdlg32/comdlg32_classes.idl trunk/reactos/dll/win32/comdlg32/comdlg32_ros.diff trunk/reactos/dll/win32/comdlg32/filedlg.c trunk/reactos/dll/win32/comdlg32/filedlg31.c trunk/reactos/dll/win32/comdlg32/fontdlg.c trunk/reactos/dll/win32/comdlg32/printdlg.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/comdlg32/colordlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/colordl…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/colordlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/colordlg.c [iso-8859-1] Tue Apr 22 14:40:19 2014 @@ -244,9 +244,9 @@ /*********************************************************************** * CC_MouseCheckPredefColorArray [internal] - * returns 1 if one of the predefined colors is clicked - */ -static int CC_MouseCheckPredefColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam) + * returns TRUE if one of the predefined colors is clicked + */ +static BOOL CC_MouseCheckPredefColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam) { HWND hwnd; POINT point; @@ -269,17 +269,17 @@ y = point.y / dy; lpp->lpcc->rgbResult = predefcolors[y][x]; CC_DrawFocusRect(lpp, hwnd, x, y, rows, cols); - return 1; + return TRUE; } } - return 0; + return FALSE; } /*********************************************************************** * CC_MouseCheckUserColorArray [internal] - * return 1 if the user clicked a color - */ -static int CC_MouseCheckUserColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam) + * return TRUE if the user clicked a color + */ +static BOOL CC_MouseCheckUserColorArray(CCPRIV *lpp, int rows, int cols, LPARAM lParam) { HWND hwnd; POINT point; @@ -303,10 +303,10 @@ y = point.y / dy; lpp->lpcc->rgbResult = crarr[x + (cols * y) ]; CC_DrawFocusRect(lpp, hwnd, x, y, rows, cols); - return 1; + return TRUE; } } - return 0; + return FALSE; } #define MAXVERT 240 @@ -322,7 +322,7 @@ /*********************************************************************** * CC_MouseCheckColorGraph [internal] */ -static int CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert, LPARAM lParam ) +static BOOL CC_MouseCheckColorGraph( HWND hDlg, int dlgitem, int *hori, int *vert, LPARAM lParam ) { HWND hwnd; POINT point; @@ -335,7 +335,7 @@ GetWindowRect(hwnd, &rect); if (!PtInRect(&rect, point)) - return 0; + return FALSE; GetClientRect(hwnd, &rect); ScreenToClient(hwnd, &point); @@ -355,13 +355,13 @@ if (vert) *vert = y; - return 1; + return TRUE; } /*********************************************************************** * CC_MouseCheckResultWindow [internal] * test if double click one of the result colors */ -static int CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam ) +static BOOL CC_MouseCheckResultWindow( HWND hDlg, LPARAM lParam ) { HWND hwnd; POINT point; @@ -374,9 +374,9 @@ if (PtInRect(&rect, point)) { PostMessageA(hDlg, WM_COMMAND, IDC_COLOR_RES, 0); - return 1; - } - return 0; + return TRUE; + } + return FALSE; } /*********************************************************************** Modified: trunk/reactos/dll/win32/comdlg32/comdlg32_classes.idl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/comdlg3…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/comdlg32_classes.idl [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/comdlg32_classes.idl [iso-8859-1] Tue Apr 22 14:40:19 2014 @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("File Open Dialog"), threading(apartment), Modified: trunk/reactos/dll/win32/comdlg32/comdlg32_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/comdlg3…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/comdlg32_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/comdlg32_ros.diff [iso-8859-1] Tue Apr 22 14:40:19 2014 @@ -1,71 +1,66 @@ -Index: filedlg.c -=================================================================== ---- filedlg.c (Revision 56893) -+++ filedlg.c (Arbeitskopie) -@@ -260,6 +260,8 @@ - HRSRC hRes; - HANDLE hDlgTmpl = 0; - HRESULT hr; -+ DWORD dwSize; -+ LPDLGTEMPLATE hDialogTemplate; - - /* test for missing functionality */ - if (fodInfos->ofnInfos->Flags & UNIMPLEMENTED_FLAGS) -@@ -276,12 +278,17 @@ - return FALSE; - } - if (!(hDlgTmpl = LoadResource(COMDLG32_hInstance, hRes )) || -+ !(dwSize = SizeofResource(COMDLG32_hInstance, hRes )) || -+ !(hDialogTemplate = malloc(dwSize)) || - !(template = LockResource( hDlgTmpl ))) - { - COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); - return FALSE; - } - -+ /* Copy the read only resource */ -+ memcpy(hDialogTemplate, template, dwSize); -+ - /* msdn: explorer style dialogs permit sizing by default. - * The OFN_ENABLESIZING flag is only needed when a hook or - * custom tmeplate is provided */ -@@ -291,12 +298,12 @@ - - if (fodInfos->ofnInfos->Flags & OFN_ENABLESIZING) - { -- ((LPDLGTEMPLATEW)template)->style |= WS_SIZEBOX; -+ hDialogTemplate->style |= WS_SIZEBOX; - fodInfos->sizedlg.cx = fodInfos->sizedlg.cy = 0; - fodInfos->initial_size.x = fodInfos->initial_size.y = 0; - } - else -- ((LPDLGTEMPLATEW)template)->style &= ~WS_SIZEBOX; -+ hDialogTemplate->style &= ~WS_SIZEBOX; - - - /* old style hook messages */ -@@ -313,19 +320,21 @@ - - if (fodInfos->unicode) - lRes = DialogBoxIndirectParamW(COMDLG32_hInstance, -- template, -+ hDialogTemplate, - fodInfos->ofnInfos->hwndOwner, - FileOpenDlgProc95, - (LPARAM) fodInfos); - else - lRes = DialogBoxIndirectParamA(COMDLG32_hInstance, -- template, -+ hDialogTemplate, - fodInfos->ofnInfos->hwndOwner, - FileOpenDlgProc95, - (LPARAM) fodInfos); -- if (SUCCEEDED(hr)) -+ if (SUCCEEDED(hr)) - OleUninitialize(); - -+ free(hDialogTemplate); -+ - /* Unable to create the dialog */ - if( lRes == -1) - return FALSE; +diff -prudN e:\Wine\dlls\comdlg32/cdlg32.c e:\reactos\dll\win32\comdlg32/cdlg32.c +--- e:\Wine\dlls\comdlg32/cdlg32.c 2013-10-26 22:24:27.508648000 +0100 ++++ e:\reactos\dll\win32\comdlg32/cdlg32.c 2014-03-05 11:46:06.260510700 +0100 +@@ -174,6 +157,8 @@ DWORD WINAPI CommDlgExtendedError(void) + return 0; /* we never set an error, so there isn't one */ + } + ++#ifndef __REACTOS__ /* Win 7 */ ++ + /************************************************************************* + * Implement the CommDlg32 class factory + * +@@ -283,7 +268,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSI + */ + HRESULT WINAPI DllRegisterServer(void) + { +- return __wine_register_resources(COMDLG32_hInstance); ++ return E_FAIL; // FIXME: __wine_register_resources(COMDLG32_hInstance); + } + + /*********************************************************************** +@@ -291,5 +276,7 @@ HRESULT WINAPI DllRegisterServer(void) + */ + HRESULT WINAPI DllUnregisterServer(void) + { +- return __wine_unregister_resources(COMDLG32_hInstance); ++ return E_FAIL; // FIXME: __wine_unregister_resources(COMDLG32_hInstance); + } ++ ++#endif /* Win 7 */ + +diff -prudN e:\Wine\dlls\comdlg32/comdlg32.spec e:\reactos\dll\win32\comdlg32/comdlg32.spec +--- e:\Wine\dlls\comdlg32/comdlg32.spec 2011-09-16 23:22:36.026770600 +0100 ++++ e:\reactos\dll\win32\comdlg32/comdlg32.spec 2012-02-15 22:32:22.456422900 +0100 +@@ -3,9 +3,9 @@ + @ stdcall ChooseFontA(ptr) + @ stdcall ChooseFontW(ptr) + @ stdcall CommDlgExtendedError() +-@ stdcall -private DllGetClassObject(ptr ptr ptr) +-@ stdcall -private DllRegisterServer() +-@ stdcall -private DllUnregisterServer() ++;@ stdcall -private DllGetClassObject(ptr ptr ptr) ; Win 7 ++;@ stdcall -private DllRegisterServer() ; Win 7 ++;@ stdcall -private DllUnregisterServer() ; Win 7 + @ stdcall FindTextA(ptr) + @ stdcall FindTextW(ptr) + @ stdcall GetFileTitleA(str ptr long) + +diff -prudN e:\Wine\dlls\comdlg32/itemdlg.c e:\reactos\dll\win32\comdlg32/itemdlg.c +--- e:\Wine\dlls\comdlg32/itemdlg.c 2013-10-26 22:24:27.515652700 +0100 ++++ e:\reactos\dll\win32\comdlg32/itemdlg.c 2013-10-15 19:32:27.803008200 +0100 +@@ -18,6 +18,8 @@ + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + ++#ifndef __REACTOS__ /* Win 7 */ ++ + #include <stdarg.h> + + #define COBJMACROS +@@ -3660,3 +3662,5 @@ HRESULT FileSaveDialog_Constructor(IUnkn + { + return FileDialog_constructor(pUnkOuter, riid, ppv, ITEMDLG_TYPE_SAVE); + } ++ ++#endif /* Win 7 */ Modified: trunk/reactos/dll/win32/comdlg32/filedlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/filedlg.c [iso-8859-1] Tue Apr 22 14:40:19 2014 @@ -431,7 +431,7 @@ ret = GetFileName95(&fodInfos); break; default : - ret = 0; + ret = FALSE; } if (lpstrSavDir) @@ -523,7 +523,7 @@ ret = GetFileName95(&fodInfos); break; default : - ret = 0; + ret = FALSE; } if (lpstrSavDir) @@ -1401,9 +1401,9 @@ */ static LRESULT FILEDLG95_InitControls(HWND hwnd) { - int win2000plus = 0; - int win98plus = 0; - int handledPath = FALSE; + BOOL win2000plus = FALSE; + BOOL win98plus = FALSE; + BOOL handledPath = FALSE; OSVERSIONINFOW osVi; static const WCHAR szwSlash[] = { '\\', 0 }; static const WCHAR szwStar[] = { '*',0 }; @@ -1554,12 +1554,11 @@ } /* 2. (All platforms) If initdir is not null, then use it */ - if ((handledPath == FALSE) && (fodInfos->initdir!=NULL) && - (*fodInfos->initdir!=0x00)) + if (!handledPath && fodInfos->initdir && *fodInfos->initdir) { /* Work out the proper path as supplied one might be relative */ /* (Here because supplying '.' as dir browses to My Computer) */ - if (handledPath==FALSE) { + if (!handledPath) { WCHAR tmpBuf[MAX_PATH]; WCHAR tmpBuf2[MAX_PATH]; WCHAR *nameBit; @@ -1594,8 +1593,7 @@ } } - if ((handledPath == FALSE) && ((fodInfos->initdir==NULL) || - (*fodInfos->initdir==0x00))) + if (!handledPath && (!fodInfos->initdir || !*fodInfos->initdir)) { /* 3. All except w2k+: if filename contains a path use it */ if (!win2000plus && fodInfos->filename && @@ -1627,7 +1625,7 @@ } /* 4. Win2000+: Recently used */ - if (handledPath == FALSE && win2000plus) { + if (!handledPath && win2000plus) { fodInfos->initdir = MemAlloc(MAX_PATH * sizeof(WCHAR)); fodInfos->initdir[0] = '\0'; @@ -1643,8 +1641,7 @@ /* 5. win98+ and win2000+ if any files of specified filter types in current directory, use it */ - if ( win98plus && handledPath == FALSE && - fodInfos->filter && *fodInfos->filter) { + if (win98plus && !handledPath && fodInfos->filter && *fodInfos->filter) { LPCWSTR lpstrPos = fodInfos->filter; WIN32_FIND_DATAW FindFileData; @@ -1683,7 +1680,7 @@ } /* 6. Win98+ and 2000+: Use personal files dir, others use current dir */ - if (handledPath == FALSE && (win2000plus || win98plus)) { + if (!handledPath && (win2000plus || win98plus)) { fodInfos->initdir = MemAlloc(MAX_PATH*sizeof(WCHAR)); if(!COMDLG32_SHGetFolderPathW(hwnd, CSIDL_PERSONAL, 0, 0, fodInfos->initdir)) @@ -1700,7 +1697,7 @@ TRACE("No initial dir specified, using personal files dir of %s\n", debugstr_w(fodInfos->initdir)); } handledPath = TRUE; - } else if (handledPath==FALSE) { + } else if (!handledPath) { fodInfos->initdir = MemAlloc(MAX_PATH*sizeof(WCHAR)); GetCurrentDirectoryW(MAX_PATH, fodInfos->initdir); handledPath = TRUE; Modified: trunk/reactos/dll/win32/comdlg32/filedlg31.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/filedlg…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/filedlg31.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/filedlg31.c [iso-8859-1] Tue Apr 22 14:40:19 2014 @@ -58,7 +58,7 @@ */ static BOOL FD31_Init(void) { - static BOOL initialized = 0; + static BOOL initialized = FALSE; if (!initialized) { hFolder = LoadImageA( COMDLG32_hInstance, "FOLDER", IMAGE_ICON, 16, 16, LR_SHARED ); @@ -70,7 +70,7 @@ if (hFolder == 0 || hFolder2 == 0 || hFloppy == 0 || hHDisk == 0 || hCDRom == 0 || hNet == 0) { - ERR("Error loading icons !\n"); + ERR("Error loading icons!\n"); return FALSE; } initialized = TRUE; Modified: trunk/reactos/dll/win32/comdlg32/fontdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/fontdlg…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/fontdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/fontdlg.c [iso-8859-1] Tue Apr 22 14:40:19 2014 @@ -345,7 +345,7 @@ * * Fill font style information into combobox (without using font.c directly) */ -static int SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf) +static BOOL SetFontStylesToCombo2(HWND hwnd, HDC hdc, const LOGFONTW *lplf) { #define FSTYLES 4 struct FONTSTYLE @@ -384,19 +384,19 @@ WCHAR name[64]; LoadStringW(COMDLG32_hInstance, fontstyles[i].resId, name, 64); j=SendMessageW(hwnd,CB_ADDSTRING,0,(LPARAM)name ); - if (j==CB_ERR) return 1; + if (j==CB_ERR) return TRUE; j=SendMessageW(hwnd, CB_SETITEMDATA, j, MAKELONG(tm.tmWeight,fontstyles[i].italic)); - if (j==CB_ERR) return 1; - } - } - return 0; + if (j==CB_ERR) return TRUE; + } + } + return FALSE; } /************************************************************************* * AddFontSizeToCombo3 [internal] */ -static int AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf) +static BOOL AddFontSizeToCombo3(HWND hwnd, UINT h, const CHOOSEFONTW *lpcf) { int j; WCHAR buffer[20]; @@ -411,23 +411,23 @@ { j=SendMessageW(hwnd, CB_ADDSTRING, 0, (LPARAM)buffer); if (j!=CB_ERR) j = SendMessageW(hwnd, CB_SETITEMDATA, j, h); - if (j==CB_ERR) return 1; - } - } - return 0; + if (j==CB_ERR) return TRUE; + } + } + return FALSE; } /************************************************************************* * SetFontSizesToCombo3 [internal] */ -static int SetFontSizesToCombo3(HWND hwnd, const CHOOSEFONTW *lpcf) +static BOOL SetFontSizesToCombo3(HWND hwnd, const CHOOSEFONTW *lpcf) { static const BYTE sizes[]={6,7,8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72}; unsigned int i; for (i = 0; i < sizeof(sizes)/sizeof(sizes[0]); i++) - if (AddFontSizeToCombo3(hwnd, sizes[i], lpcf)) return 1; - return 0; + if (AddFontSizeToCombo3(hwnd, sizes[i], lpcf)) return TRUE; + return FALSE; } /************************************************************************* @@ -490,16 +490,17 @@ INT points; points = MulDiv( lpNTM->ntmTm.tmHeight - lpNTM->ntmTm.tmInternalLeading, 72, GetScreenDPI()); - i = AddFontSizeToCombo3(hcmb3, points, lpcf); - if(i) return 0; + if (AddFontSizeToCombo3(hcmb3, points, lpcf)) + return 0; } else if (SetFontSizesToCombo3(hcmb3, lpcf)) return 0; if (!SendMessageW(hcmb2, CB_GETCOUNT, 0, 0)) { + BOOL res; if(!(hdc = CFn_GetDC(lpcf))) return 0; - i=SetFontStylesToCombo2(hcmb2,hdc,lplf); + res = SetFontStylesToCombo2(hcmb2,hdc,lplf); CFn_ReleaseDC(lpcf, hdc); - if (i) + if (res) return 0; } if (!( hcmb5 = GetDlgItem(hDlg, cmb5))) return 1; @@ -514,10 +515,10 @@ return 1 ; } -static INT CFn_FitFontSize( HWND hDlg, int points) +static BOOL CFn_FitFontSize( HWND hDlg, int points) { int i,n; - int ret = 0; + BOOL ret = FALSE; /* look for fitting font size in combobox3 */ n=SendDlgItemMessageW(hDlg, cmb3, CB_GETCOUNT, 0, 0); for (i=0;i<n;i++) @@ -529,17 +530,18 @@ SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb3, CBN_SELCHANGE), (LPARAM)GetDlgItem(hDlg,cmb3)); - ret = 1; + ret = TRUE; break; } } return ret; } -static INT CFn_FitFontStyle( HWND hDlg, LONG packedstyle ) +static BOOL CFn_FitFontStyle( HWND hDlg, LONG packedstyle ) { LONG id; - int i, ret = 0; + int i; + BOOL ret = FALSE; /* look for fitting font style in combobox2 */ for (i=0;i<TEXT_EXTRAS;i++) { @@ -549,7 +551,7 @@ SendDlgItemMessageW(hDlg, cmb2, CB_SETCURSEL, i, 0); SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb2, CBN_SELCHANGE), (LPARAM)GetDlgItem(hDlg,cmb2)); - ret = 1; + ret = TRUE; break; } } @@ -557,7 +559,7 @@ } -static INT CFn_FitCharSet( HWND hDlg, int charset ) +static BOOL CFn_FitCharSet( HWND hDlg, int charset ) { int i,n,cs; /* look for fitting char set in combobox5 */ @@ -570,14 +572,14 @@ SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, i, 0); SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE), (LPARAM)GetDlgItem(hDlg,cmb2)); - return 1; + return TRUE; } } /* no charset fits: select the first one in the list */ SendDlgItemMessageW(hDlg, cmb5, CB_SETCURSEL, 0, 0); SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb5, CBN_SELCHANGE), (LPARAM)GetDlgItem(hDlg,cmb2)); - return 0; + return FALSE; } /*********************************************************************** @@ -600,7 +602,8 @@ static LRESULT CFn_WMInitDialog(HWND hDlg, LPARAM lParam, LPCHOOSEFONTW lpcf) { HDC hdc; - int i,j,init=0; + int i,j; + BOOL init = FALSE; long pstyle; CFn_ENUMSTRUCT s; LPLOGFONTW lpxx; @@ -613,7 +616,7 @@ if (lpcf->lStructSize != sizeof(CHOOSEFONTW)) { - ERR("structure size failure !!!\n"); + ERR("structure size failure!!!\n"); EndDialog (hDlg, 0); return FALSE; } @@ -711,7 +714,7 @@ SendDlgItemMessageW(hDlg, cmb1, CB_SETCURSEL, j, 0); SendMessageW(hDlg, WM_COMMAND, MAKEWPARAM(cmb1, CBN_SELCHANGE), (LPARAM)GetDlgItem(hDlg,cmb1)); - init=1; + init = TRUE; /* look for fitting font style in combobox2 */ CFn_FitFontStyle(hDlg, pstyle); /* look for fitting font size in combobox3 */ Modified: trunk/reactos/dll/win32/comdlg32/printdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comdlg32/printdl…
============================================================================== --- trunk/reactos/dll/win32/comdlg32/printdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comdlg32/printdlg.c [iso-8859-1] Tue Apr 22 14:40:19 2014 @@ -1473,7 +1473,7 @@ PrintStructures->hNoCollateIcon == 0 || PrintStructures->hPortraitIcon == 0 || PrintStructures->hLandscapeIcon == 0) { - ERR("no icon in resourcefile\n"); + ERR("no icon in resource file\n"); COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); EndDialog(hDlg, FALSE); } @@ -1581,7 +1581,7 @@ PrintStructures->hNoCollateIcon == 0 || PrintStructures->hPortraitIcon == 0 || PrintStructures->hLandscapeIcon == 0) { - ERR("no icon in resourcefile\n"); + ERR("no icon in resource file\n"); COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); EndDialog(hDlg, FALSE); } @@ -2241,7 +2241,7 @@ } if(lppd->lStructSize != sizeof(PRINTDLGA)) { - WARN("structure size failure !!!\n"); + WARN("structure size failure!!!\n"); COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE); return FALSE; } @@ -2392,7 +2392,7 @@ } if(lppd->lStructSize != sizeof(PRINTDLGW)) { - WARN("structure size failure !!!\n"); + WARN("structure size failure!!!\n"); COMDLG32_SetCommDlgExtendedError(CDERR_STRUCTSIZE); return FALSE; } Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Apr 22 14:40:19 2014 @@ -61,7 +61,7 @@ reactos/dll/win32/clusapi # Synced to Wine-1.7.1 reactos/dll/win32/comcat # Synced to Wine-1.7.1 reactos/dll/win32/comctl32 # Synced to Wine 1.7.17 -reactos/dll/win32/comdlg32 # Synced to Wine 1.7.1 +reactos/dll/win32/comdlg32 # Synced to Wine 1.7.17 reactos/dll/win32/compstui # Synced to Wine-1.7.1 reactos/dll/win32/credui # Synced to Wine-1.7.1 reactos/dll/win32/crypt32 # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
[akhaldi] 62880: [COMCTL32_WINETEST] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 14:05:48 2014 New Revision: 62880 URL:
http://svn.reactos.org/svn/reactos?rev=62880&view=rev
Log: [COMCTL32_WINETEST] * Sync with Wine 1.7.17. CORE-8080 Added: trunk/rostests/winetests/comctl32/button.c (with props) Modified: trunk/rostests/winetests/comctl32/CMakeLists.txt trunk/rostests/winetests/comctl32/comboex.c trunk/rostests/winetests/comctl32/datetime.c trunk/rostests/winetests/comctl32/dpa.c trunk/rostests/winetests/comctl32/header.c trunk/rostests/winetests/comctl32/imagelist.c trunk/rostests/winetests/comctl32/ipaddress.c trunk/rostests/winetests/comctl32/listview.c trunk/rostests/winetests/comctl32/misc.c trunk/rostests/winetests/comctl32/monthcal.c trunk/rostests/winetests/comctl32/mru.c trunk/rostests/winetests/comctl32/msg.h trunk/rostests/winetests/comctl32/pager.c trunk/rostests/winetests/comctl32/progress.c trunk/rostests/winetests/comctl32/propsheet.c trunk/rostests/winetests/comctl32/rebar.c trunk/rostests/winetests/comctl32/status.c trunk/rostests/winetests/comctl32/subclass.c trunk/rostests/winetests/comctl32/syslink.c trunk/rostests/winetests/comctl32/tab.c trunk/rostests/winetests/comctl32/testlist.c trunk/rostests/winetests/comctl32/toolbar.c trunk/rostests/winetests/comctl32/tooltips.c trunk/rostests/winetests/comctl32/trackbar.c trunk/rostests/winetests/comctl32/treeview.c trunk/rostests/winetests/comctl32/updown.c trunk/rostests/winetests/comctl32/v6util.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/rostests/winetests/comctl32/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/CMakeL…
Added: trunk/rostests/winetests/comctl32/button.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/button…
Modified: trunk/rostests/winetests/comctl32/comboex.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/comboe…
Modified: trunk/rostests/winetests/comctl32/datetime.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/dateti…
Modified: trunk/rostests/winetests/comctl32/dpa.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/dpa.c?…
Modified: trunk/rostests/winetests/comctl32/header.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/header…
Modified: trunk/rostests/winetests/comctl32/imagelist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/imagel…
Modified: trunk/rostests/winetests/comctl32/ipaddress.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/ipaddr…
Modified: trunk/rostests/winetests/comctl32/listview.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/listvi…
Modified: trunk/rostests/winetests/comctl32/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/misc.c…
Modified: trunk/rostests/winetests/comctl32/monthcal.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/monthc…
Modified: trunk/rostests/winetests/comctl32/mru.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/mru.c?…
Modified: trunk/rostests/winetests/comctl32/msg.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/msg.h?…
Modified: trunk/rostests/winetests/comctl32/pager.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/pager.…
Modified: trunk/rostests/winetests/comctl32/progress.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/progre…
Modified: trunk/rostests/winetests/comctl32/propsheet.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/propsh…
Modified: trunk/rostests/winetests/comctl32/rebar.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/rebar.…
Modified: trunk/rostests/winetests/comctl32/status.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/status…
Modified: trunk/rostests/winetests/comctl32/subclass.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/subcla…
Modified: trunk/rostests/winetests/comctl32/syslink.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/syslin…
Modified: trunk/rostests/winetests/comctl32/tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/tab.c?…
Modified: trunk/rostests/winetests/comctl32/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/testli…
Modified: trunk/rostests/winetests/comctl32/toolbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/toolba…
Modified: trunk/rostests/winetests/comctl32/tooltips.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/toolti…
Modified: trunk/rostests/winetests/comctl32/trackbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/trackb…
Modified: trunk/rostests/winetests/comctl32/treeview.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/treevi…
Modified: trunk/rostests/winetests/comctl32/updown.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/updown…
Modified: trunk/rostests/winetests/comctl32/v6util.h URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/comctl32/v6util…
10 years, 8 months
1
0
0
0
[akhaldi] 62879: [COMCTL32] * Sync with Wine 1.7.17. CORE-8080
by akhaldi@svn.reactos.org
Author: akhaldi Date: Tue Apr 22 14:04:22 2014 New Revision: 62879 URL:
http://svn.reactos.org/svn/reactos?rev=62879&view=rev
Log: [COMCTL32] * Sync with Wine 1.7.17. CORE-8080 Modified: trunk/reactos/dll/win32/comctl32/comboex.c trunk/reactos/dll/win32/comctl32/comctl32_ros.diff trunk/reactos/dll/win32/comctl32/commctrl.c trunk/reactos/dll/win32/comctl32/datetime.c trunk/reactos/dll/win32/comctl32/dpa.c trunk/reactos/dll/win32/comctl32/dsa.c trunk/reactos/dll/win32/comctl32/header.c trunk/reactos/dll/win32/comctl32/imagelist.c trunk/reactos/dll/win32/comctl32/listview.c trunk/reactos/dll/win32/comctl32/propsheet.c trunk/reactos/dll/win32/comctl32/rebar.c trunk/reactos/dll/win32/comctl32/status.c trunk/reactos/dll/win32/comctl32/tab.c trunk/reactos/dll/win32/comctl32/toolbar.c trunk/reactos/dll/win32/comctl32/tooltips.c trunk/reactos/dll/win32/comctl32/trackbar.c trunk/reactos/dll/win32/comctl32/treeview.c trunk/reactos/dll/win32/comctl32/updown.c trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/dll/win32/comctl32/comboex.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comboex…
============================================================================== --- trunk/reactos/dll/win32/comctl32/comboex.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/comboex.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -986,7 +986,7 @@ } /* Native version of ComboEx creates the ComboBox with DROPDOWNLIST */ - /* specified. It then creates it's own version of the EDIT control */ + /* specified. It then creates its own version of the EDIT control */ /* and makes the ComboBox the parent. This is because a normal */ /* DROPDOWNLIST does not have an EDIT control, but we need one. */ /* We also need to place the edit control at the proper location */ @@ -1580,7 +1580,7 @@ if (lParam == NF_REQUERY) { INT i = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY); - infoPtr->NtfUnicode = (i == NFR_UNICODE) ? 1 : 0; + infoPtr->NtfUnicode = (i == NFR_UNICODE); } return infoPtr->NtfUnicode ? NFR_UNICODE : NFR_ANSI; } Modified: trunk/reactos/dll/win32/comctl32/comctl32_ros.diff URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/comctl3…
============================================================================== --- trunk/reactos/dll/win32/comctl32/comctl32_ros.diff [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/comctl32_ros.diff [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -1,6 +1,6 @@ diff -prudN e:\Wine\dlls\comctl32/comctl32.spec e:\reactos\dll\win32\comctl32/comctl32.spec ---- e:\Wine\dlls\comctl32/comctl32.spec 2011-09-16 23:22:35.964767000 +0100 -+++ e:\reactos\dll\win32\comctl32/comctl32.spec 2012-06-04 11:26:55.545450700 +0100 +--- e:\Wine\dlls\comctl32/comctl32.spec 2014-04-04 14:12:39.665980800 +0100 ++++ e:\reactos\dll\win32\comctl32/comctl32.spec 2014-03-27 14:27:25.808903400 +0100 @@ -15,7 +15,7 @@ 11 stdcall -noname DPA_Merge(ptr ptr long ptr ptr long) #12 stub Cctl1632_ThunkData32 @@ -21,9 +21,9 @@ 167 stdcall -noname AddMRUData(long ptr long) 169 stdcall -noname FindMRUData(long ptr long ptr) 233 stdcall -noname Str_GetPtrA(str str long) -@@ -88,13 +88,13 @@ - 376 stdcall -noname IntlStrEqWorkerA(long str str long) - 377 stdcall -noname IntlStrEqWorkerW(long wstr wstr long) +@@ -89,13 +89,13 @@ + 376 stdcall -noname -private IntlStrEqWorkerA(long str str long) + 377 stdcall -noname -private IntlStrEqWorkerW(long wstr wstr long) 382 stdcall -noname SmoothScrollWindow(ptr) -383 stub -noname DoReaderMode +383 stdcall -noname DoReaderMode(ptr) @@ -37,31 +37,25 @@ 390 stdcall -noname ImageList_SetColorTable(ptr long long ptr) 400 stdcall -ordinal CreateMRUListW(ptr) 401 stdcall -ordinal AddMRUStringW(long wstr) -@@ -188,6 +188,7 @@ +@@ -189,5 +189,6 @@ @ stdcall PropertySheet(ptr) PropertySheetA @ stdcall PropertySheetA(ptr) @ stdcall PropertySheetW(ptr) +@ stdcall RegisterClassNameW(wstr) - @ stdcall TaskDialogIndirect(ptr ptr ptr ptr) @ stdcall UninitializeFlatSB(long) @ stdcall _TrackMouseEvent(ptr) diff -prudN e:\Wine\dlls\comctl32/commctrl.c e:\reactos\dll\win32\comctl32/commctrl.c ---- e:\Wine\dlls\comctl32/commctrl.c 2011-11-24 17:55:01.900415100 +0100 -+++ e:\reactos\dll\win32\comctl32/commctrl.c 2013-01-25 14:12:39.829654200 +0100 -@@ -52,25 +52,42 @@ +--- e:\Wine\dlls\comctl32/commctrl.c 2014-04-04 14:12:39.666981500 +0100 ++++ e:\reactos\dll\win32\comctl32/commctrl.c 2014-04-06 12:07:15.451048000 +0100 +@@ -52,25 +52,26 @@ * -- ICC_WIN95_CLASSES */ -+#define WIN32_NO_STATUS -+#define _INC_WINDOWS -+#define COM_NO_WINDOWS_H -+ - #include <stdarg.h> +-#include <stdarg.h> -#include <string.h> -#include <stdlib.h> -+//#include <string.h> -+//#include <stdlib.h> ++#include "comctl32.h" -#include "windef.h" -#include "winbase.h" @@ -71,20 +65,11 @@ -#include "commctrl.h" -#include "winerror.h" -#include "winreg.h" -+#include <windef.h> -+#include <winbase.h> -+//#include "wingdi.h" -+//#include "winuser.h" -+#include <winnls.h> -+//#include "commctrl.h" -+//#include "winerror.h" -+#include <winreg.h> #define NO_SHLWAPI_STREAM -#include "shlwapi.h" +-#include "comctl32.h" +-#include "wine/debug.h" +#include <shlwapi.h> - #include "comctl32.h" --#include "wine/debug.h" -+#include <wine/debug.h> WINE_DEFAULT_DEBUG_CHANNEL(commctrl); @@ -104,7 +89,7 @@ static LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); -@@ -92,6 +109,67 @@ static const WCHAR strCC32SubclassInfo[] +@@ -92,6 +93,67 @@ static const WCHAR strCC32SubclassInfo[] 'C','C','3','2','S','u','b','c','l','a','s','s','I','n','f','o',0 }; @@ -118,7 +103,7 @@ + HANDLE hFile; + BOOL bRet = FALSE; + -+ hResInfo = FindResourceW(COMCTL32_hModule, L"WINE_MANIFEST", RT_MANIFEST); ++ hResInfo = FindResourceW(COMCTL32_hModule, L"WINE_MANIFEST", (LPWSTR)RT_MANIFEST); + if (!hResInfo) + return FALSE; + @@ -172,7 +157,7 @@ /*********************************************************************** * DllMain [Internal] -@@ -930,6 +1008,12 @@ HRESULT WINAPI DllGetVersion (DLLVERSION +@@ -928,6 +990,12 @@ HRESULT WINAPI DllGetVersion (DLLVERSION HRESULT WINAPI DllInstall(BOOL bInstall, LPCWSTR cmdline) { TRACE("(%u, %s): stub\n", bInstall, debugstr_w(cmdline)); @@ -181,11 +166,11 @@ + ERR("create_manifest failed!\n"); + return HRESULT_FROM_WIN32(GetLastError()); + } -+ ++ return S_OK; } -@@ -1593,12 +1677,114 @@ LRESULT WINAPI SetPathWordBreakProc(HWND +@@ -1591,12 +1659,114 @@ LRESULT WINAPI SetPathWordBreakProc(HWND * * Draw text with shadow. */ @@ -304,7 +289,7 @@ } /*********************************************************************** -@@ -1639,3 +1825,15 @@ HRESULT WINAPI TaskDialogIndirect(const +@@ -1637,3 +1807,15 @@ HRESULT WINAPI TaskDialogIndirect(const if (pfVerificationFlagChecked) *pfVerificationFlagChecked = TRUE; return S_OK; } @@ -322,9 +307,9 @@ +} diff -prudN e:\Wine\dlls\comctl32/listview.c e:\reactos\dll\win32\comctl32/listview.c ---- e:\Wine\dlls\comctl32/listview.c 2013-03-16 11:54:52.374454400 +0100 -+++ e:\reactos\dll\win32\comctl32/listview.c 2013-03-17 19:12:46.522399200 +0100 -@@ -314,6 +314,7 @@ typedef struct tagLISTVIEW_INFO +--- e:\Wine\dlls\comctl32/listview.c 2014-04-18 20:39:25.506861000 +0100 ++++ e:\reactos\dll\win32\comctl32/listview.c 2014-04-22 13:09:20.504496900 +0100 +@@ -307,6 +288,7 @@ typedef struct tagLISTVIEW_INFO COLORREF clrBk; COLORREF clrText; COLORREF clrTextBk; @@ -332,7 +317,7 @@ /* font */ HFONT hDefaultFont; -@@ -1700,8 +1701,19 @@ static inline BOOL LISTVIEW_GetItemW(con +@@ -1693,8 +1675,19 @@ static inline BOOL LISTVIEW_GetItemW(con /* used to handle collapse main item column case */ static inline BOOL LISTVIEW_DrawFocusRect(const LISTVIEW_INFO *infoPtr, HDC hdc) { @@ -354,19 +339,21 @@ } /* Listview invalidation functions: use _only_ these functions to invalidate */ -@@ -4734,7 +4746,10 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_I +@@ -4727,7 +4720,12 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_I if (infoPtr->uView == LV_VIEW_DETAILS && infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) rcLabel.bottom--; - DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat); ++#ifdef __REACTOS__ + if ((!(lvItem.state & LVIS_SELECTED) || !infoPtr->bFocus) && (infoPtr->dwLvExStyle & LVS_EX_TRANSPARENTSHADOWTEXT)) + DrawShadowText(hdc, lvItem.pszText, -1, &rcLabel, uFormat, RGB(255, 255, 255), RGB(0, 0, 0), 2, 2); + else ++#endif + DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat); postpaint: if (cdsubitemmode & CDRF_NOTIFYPOSTPAINT) -@@ -5143,7 +5158,11 @@ enddraw: +@@ -5136,7 +5134,11 @@ enddraw: /* Draw marquee rectangle if appropriate */ if (infoPtr->bMarqueeSelect) @@ -378,7 +365,7 @@ if (cdmode & CDRF_NOTIFYPOSTPAINT) notify_postpaint(infoPtr, &nmlvcd); -@@ -7952,6 +7971,7 @@ static BOOL LISTVIEW_SetBkColor(LISTVIEW +@@ -7939,6 +7941,7 @@ static BOOL LISTVIEW_SetBkColor(LISTVIEW { TRACE("(color=%x)\n", color); @@ -386,7 +373,27 @@ if(infoPtr->clrBk != color) { if (infoPtr->clrBk != CLR_NONE) DeleteObject(infoPtr->hBkBrush); infoPtr->clrBk = color; -@@ -9362,6 +9382,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hw +@@ -8600,7 +8603,7 @@ static DWORD LISTVIEW_SetIconSpacing(LIS + return oldspacing; + } + +-static inline void set_icon_size(SIZE *size, HIMAGELIST himl, BOOL small) ++static inline void set_icon_size(SIZE *size, HIMAGELIST himl, BOOL is_small) + { + INT cx, cy; + +@@ -8611,8 +8614,8 @@ static inline void set_icon_size(SIZE *s + } + else + { +- size->cx = GetSystemMetrics(small ? SM_CXSMICON : SM_CXICON); +- size->cy = GetSystemMetrics(small ? SM_CYSMICON : SM_CYICON); ++ size->cx = GetSystemMetrics(is_small ? SM_CXSMICON : SM_CXICON); ++ size->cy = GetSystemMetrics(is_small ? SM_CYSMICON : SM_CYICON); + } + } + +@@ -9349,6 +9352,7 @@ static LRESULT LISTVIEW_NCCreate(HWND hw infoPtr->clrText = CLR_DEFAULT; infoPtr->clrTextBk = CLR_DEFAULT; LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow); @@ -394,7 +401,7 @@ /* set default values */ infoPtr->nFocusedItem = -1; -@@ -11644,6 +11665,12 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg +@@ -11631,6 +11635,12 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); @@ -409,41 +416,42 @@ /* case WM_TIMER: */ diff -prudN e:\Wine\dlls\comctl32/propsheet.c e:\reactos\dll\win32\comctl32/propsheet.c ---- e:\Wine\dlls\comctl32/propsheet.c 2013-03-02 14:17:59.122793000 +0100 -+++ e:\reactos\dll\win32\comctl32/propsheet.c 2013-03-16 12:21:47.383897000 +0100 -@@ -2430,6 +2430,9 @@ static void PROPSHEET_SetWizButtons(HWND +--- e:\Wine\dlls\comctl32/propsheet.c 2014-04-04 14:12:39.676987100 +0100 ++++ e:\reactos\dll\win32\comctl32/propsheet.c 2014-04-22 13:11:33.830045900 +0100 +@@ -2430,6 +2414,11 @@ static void PROPSHEET_SetWizButtons(HWND HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON); HWND hwndNext = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON); HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON); ++#ifdef __REACTOS__ + HWND hwndCancel = GetDlgItem(hwndDlg, IDCANCEL); + INT iDefItem = 0; + HWND hwndFocus; ++#endif TRACE("%d\n", dwFlags); -@@ -2437,17 +2440,6 @@ static void PROPSHEET_SetWizButtons(HWND +@@ -2437,6 +2426,7 @@ static void PROPSHEET_SetWizButtons(HWND EnableWindow(hwndNext, FALSE); EnableWindow(hwndFinish, FALSE); -- /* set the default pushbutton to an enabled button */ -- if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) -- SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0); -- else if (dwFlags & PSWIZB_NEXT) -- SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0); -- else if (dwFlags & PSWIZB_BACK) -- SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0); -- else -- SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0); -- -- ++#ifndef __REACTOS__ + /* set the default pushbutton to an enabled button */ + if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) + SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0); +@@ -2446,6 +2436,7 @@ static void PROPSHEET_SetWizButtons(HWND + SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0); + else + SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0); ++#endif + + if (dwFlags & PSWIZB_BACK) - EnableWindow(hwndBack, TRUE); - -@@ -2477,6 +2469,22 @@ static void PROPSHEET_SetWizButtons(HWND +@@ -2477,6 +2468,25 @@ static void PROPSHEET_SetWizButtons(HWND } else if (!(dwFlags & PSWIZB_DISABLEDFINISH)) EnableWindow(hwndFinish, TRUE); + ++#ifdef __REACTOS__ + /* set the default pushbutton to an enabled button */ + if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) + iDefItem = IDC_FINISH_BUTTON; @@ -459,13 +467,15 @@ + hwndFocus = GetFocus(); + if (!hwndFocus || hwndFocus == hwndCancel) + SetFocus(GetDlgItem(hwndDlg, iDefItem)); ++#endif ++ } /****************************************************************************** diff -prudN e:\Wine\dlls\comctl32/rebar.c e:\reactos\dll\win32\comctl32/rebar.c ---- e:\Wine\dlls\comctl32/rebar.c 2013-03-02 14:17:59.125795000 +0100 -+++ e:\reactos\dll\win32\comctl32/rebar.c 2013-09-02 13:40:15.983276500 +0100 -@@ -51,7 +51,6 @@ +--- e:\Wine\dlls\comctl32/rebar.c 2014-04-04 14:12:39.678989500 +0100 ++++ e:\reactos\dll\win32\comctl32/rebar.c 2014-04-22 13:17:59.092589800 +0100 +@@ -50,7 +50,6 @@ * - WM_QUERYNEWPALETTE * - WM_RBUTTONDOWN * - WM_RBUTTONUP @@ -473,21 +483,7 @@ * - WM_VKEYTOITEM * - WM_WININICHANGE * Notifications: - -@@ -2544,10 +2543,8 @@ REBAR_InsertBandT(REBAR_INFO *infoPtr, I - - /* initialize band */ - memset(lpBand, 0, sizeof(*lpBand)); -- lpBand->clrFore = infoPtr->clrText == CLR_NONE ? infoPtr->clrBtnText : -- infoPtr->clrText; -- lpBand->clrBack = infoPtr->clrBk == CLR_NONE ? infoPtr->clrBtnFace : -- infoPtr->clrBk; -+ lpBand->clrFore = infoPtr->clrText; -+ lpBand->clrBack = infoPtr->clrBk; - lpBand->iImage = -1; - - REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand); -@@ -2927,12 +2924,20 @@ REBAR_ShowBand (REBAR_INFO *infoPtr, INT +@@ -2912,12 +2896,22 @@ REBAR_ShowBand (REBAR_INFO *infoPtr, INT static LRESULT @@ -499,6 +495,7 @@ TRACE("[%s]\n", wine_dbgstr_rect(lpRect)); REBAR_SizeToHeight(infoPtr, get_rect_cy(infoPtr, lpRect)); + ++#ifdef __REACTOS__ + /* Note that this undocumented flag is available on comctl32 v6 or later */ + if ((flags & RBSTR_CHANGERECT) != 0) + { @@ -506,10 +503,11 @@ + GetClientRect(infoPtr->hwndSelf, &rcRebar); + lpRect->bottom = lpRect->top + (rcRebar.bottom - rcRebar.top); + } ++#endif return TRUE; } -@@ -3713,7 +3718,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, +@@ -3675,7 +3669,7 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, return REBAR_ShowBand (infoPtr, wParam, lParam); case RB_SIZETORECT: @@ -518,165 +516,23 @@ /* Messages passed to parent */ -@@ -3797,6 +3802,8 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, +@@ -3758,6 +3752,11 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); ++#ifdef __REACTOS__ ++ /* r51522 - Properly support WM_SYSCOLORCHANGE */ + infoPtr->clrBtnText = comctl32_color.clrBtnText; + infoPtr->clrBtnFace = comctl32_color.clrBtnFace; ++#endif return 0; /* case WM_VKEYTOITEM: supported according to ControlSpy */ ---- e:\Wine\dlls\comctl32/tests/v6util.h 2011-09-16 23:22:36.002769200 +0100 -+++ e:\reactos\dll\win32\comctl32/tests/v6util.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,142 +0,0 @@ --/* -- * Utility routines for comctl32 v6 tests -- * -- * Copyright 2006 Mike McCormack for CodeWeavers -- * Copyright 2007 George Gov -- * Copyright 2009 Owen Rudge for CodeWeavers -- * -- * This library is free software; you can redistribute it and/or -- * modify it under the terms of the GNU Lesser General Public -- * License as published by the Free Software Foundation; either -- * version 2.1 of the License, or (at your option) any later version. -- * -- * This library is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * Lesser General Public License for more details. -- * -- * You should have received a copy of the GNU Lesser General Public -- * License along with this library; if not, write to the Free Software -- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA -- */ -- --#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got) -- --#ifdef __i386__ --#define ARCH "x86" --#elif defined __x86_64__ --#define ARCH "amd64" --#else --#define ARCH "none" --#endif -- --static const CHAR manifest_name[] = "cc6.manifest"; -- --static const CHAR manifest[] = -- "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" -- "<assembly xmlns=\"urn:schemas-microsoft-com:asm.v1\" manifestVersion=\"1.0\">\n" -- " <assemblyIdentity\n" -- " type=\"win32\"\n" -- " name=\"Wine.ComCtl32.Tests\"\n" -- " version=\"1.0.0.0\"\n" -- " processorArchitecture=\"" ARCH "\"\n" -- " />\n" -- "<description>Wine comctl32 test suite</description>\n" -- "<dependency>\n" -- " <dependentAssembly>\n" -- " <assemblyIdentity\n" -- " type=\"win32\"\n" -- " name=\"microsoft.windows.common-controls\"\n" -- " version=\"6.0.0.0\"\n" -- " processorArchitecture=\"" ARCH "\"\n" -- " publicKeyToken=\"6595b64144ccf1df\"\n" -- " language=\"*\"\n" -- " />\n" -- "</dependentAssembly>\n" -- "</dependency>\n" -- "</assembly>\n"; -- --static void unload_v6_module(ULONG_PTR cookie, HANDLE hCtx) --{ -- HANDLE hKernel32; -- BOOL (WINAPI *pDeactivateActCtx)(DWORD, ULONG_PTR); -- VOID (WINAPI *pReleaseActCtx)(HANDLE); -- -- hKernel32 = GetModuleHandleA("kernel32.dll"); -- pDeactivateActCtx = (void*)GetProcAddress(hKernel32, "DeactivateActCtx"); -- pReleaseActCtx = (void*)GetProcAddress(hKernel32, "ReleaseActCtx"); -- if (!pDeactivateActCtx || !pReleaseActCtx) -- { -- win_skip("Activation contexts unsupported\n"); -- return; -- } -- -- pDeactivateActCtx(0, cookie); -- pReleaseActCtx(hCtx); -- -- DeleteFileA(manifest_name); --} -- --static BOOL load_v6_module(ULONG_PTR *pcookie, HANDLE *hCtx) --{ -- HANDLE hKernel32; -- HANDLE (WINAPI *pCreateActCtxA)(ACTCTXA*); -- BOOL (WINAPI *pActivateActCtx)(HANDLE, ULONG_PTR*); -- -- ACTCTXA ctx; -- BOOL ret; -- HANDLE file; -- DWORD written; -- -- hKernel32 = GetModuleHandleA("kernel32.dll"); -- pCreateActCtxA = (void*)GetProcAddress(hKernel32, "CreateActCtxA"); -- pActivateActCtx = (void*)GetProcAddress(hKernel32, "ActivateActCtx"); -- if (!(pCreateActCtxA && pActivateActCtx)) -- { -- win_skip("Activation contexts unsupported. No version 6 tests possible.\n"); -- return FALSE; -- } -- -- /* create manifest */ -- file = CreateFileA( manifest_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL ); -- if (file != INVALID_HANDLE_VALUE) -- { -- ret = (WriteFile( file, manifest, sizeof(manifest)-1, &written, NULL ) && -- written == sizeof(manifest)-1); -- CloseHandle( file ); -- if (!ret) -- { -- DeleteFileA( manifest_name ); -- skip("Failed to fill manifest file. Skipping comctl32 V6 tests.\n"); -- return FALSE; -- } -- else -- trace("created %s\n", manifest_name); -- } -- else -- { -- skip("Failed to create manifest file. Skipping comctl32 V6 tests.\n"); -- return FALSE; -- } -- -- memset(&ctx, 0, sizeof(ctx)); -- ctx.cbSize = sizeof(ctx); -- ctx.lpSource = manifest_name; -- -- *hCtx = pCreateActCtxA(&ctx); -- ok(*hCtx != 0, "Expected context handle\n"); -- -- ret = pActivateActCtx(*hCtx, pcookie); -- expect(TRUE, ret); -- -- if (!ret) -- { -- win_skip("A problem during context activation occurred.\n"); -- DeleteFileA(manifest_name); -- } -- -- return ret; --} -- --#undef expect --#undef ARCH diff -prudN e:\Wine\dlls\comctl32/tooltips.c e:\reactos\dll\win32\comctl32/tooltips.c ---- e:\Wine\dlls\comctl32/tooltips.c 2013-03-02 14:17:59.178196600 +0100 -+++ e:\reactos\dll\win32\comctl32/tooltips.c 2013-03-16 12:24:45.122483600 +0100 -@@ -2002,7 +2002,32 @@ TOOLTIPS_NCHitTest (const TOOLTIPS_INFO +--- e:\Wine\dlls\comctl32/tooltips.c 2014-04-04 14:12:39.707008100 +0100 ++++ e:\reactos\dll\win32\comctl32/tooltips.c 2014-04-06 12:20:33.342535700 +0100 +@@ -2007,7 +1994,32 @@ TOOLTIPS_NCHitTest (const TOOLTIPS_INFO static LRESULT TOOLTIPS_NotifyFormat (TOOLTIPS_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { @@ -710,11 +566,10 @@ return 0; } - diff -prudN e:\Wine\dlls\comctl32/treeview.c e:\reactos\dll\win32\comctl32/treeview.c ---- e:\Wine\dlls\comctl32/treeview.c 2013-03-02 14:17:59.181198600 +0100 -+++ e:\reactos\dll\win32\comctl32/treeview.c 2013-03-16 12:26:03.285023200 +0100 -@@ -2921,7 +2921,12 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, +--- e:\Wine\dlls\comctl32/treeview.c 2014-04-04 14:12:39.709009500 +0100 ++++ e:\reactos\dll\win32\comctl32/treeview.c 2014-04-06 12:22:08.977839700 +0100 +@@ -2921,7 +2899,12 @@ TREEVIEW_Refresh(TREEVIEW_INFO *infoPtr, } } Modified: trunk/reactos/dll/win32/comctl32/commctrl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/commctr…
============================================================================== --- trunk/reactos/dll/win32/comctl32/commctrl.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/commctrl.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -929,7 +929,7 @@ * Failure: 0 * * NOTES - * Do not use this functions anymore. Use CreateToolbarEx instead. + * Do not use this function anymore. Use CreateToolbarEx instead. */ HWND WINAPI @@ -1560,7 +1560,7 @@ * identifies them. * * Some of the codes are in the CCM_FIRST..CCM_LAST range, but there is no - * colision with defined CCM_ codes. + * collision with defined CCM_ codes. */ BOOL COMCTL32_IsReflectedMessage(UINT uMsg) { @@ -1609,7 +1609,7 @@ return FALSE; } -static inline int IsDelimiter(WCHAR c) +static inline BOOL IsDelimiter(WCHAR c) { switch(c) { Modified: trunk/reactos/dll/win32/comctl32/datetime.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/datetim…
============================================================================== --- trunk/reactos/dll/win32/comctl32/datetime.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/datetime.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -60,7 +60,7 @@ RECT checkbox; /* checkbox allowing the control to be enabled/disabled */ RECT calbutton; /* button that toggles the dropdown of the monthcal control */ BOOL bCalDepressed; /* TRUE = cal button is depressed */ - int bDropdownEnabled; + BOOL bDropdownEnabled; int select; WCHAR charsEntered[4]; int nCharsEntered; @@ -186,7 +186,7 @@ static BOOL DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *systime) { - if (!systime) return 0; + if (!systime) return FALSE; TRACE("%04d/%02d/%02d %02d:%02d:%02d\n", systime->wYear, systime->wMonth, systime->wDay, @@ -205,7 +205,7 @@ return FALSE; /* Windows returns true if the date is valid but outside the limits set */ - if (DATETIME_IsDateInValidRange(infoPtr, systime) == FALSE) + if (!DATETIME_IsDateInValidRange(infoPtr, systime)) return TRUE; infoPtr->dateValid = TRUE; @@ -819,8 +819,8 @@ return DTHT_NONE; } -/* Returns index of a closest date field from given counting to left - or -1 if there's no such fields at left */ +/* Returns index of the nearest preceding date field from given, + or -1 if none was found */ static int DATETIME_GetPrevDateField(const DATETIME_INFO *infoPtr, int i) { for(--i; i >= 0; i--) @@ -834,7 +834,8 @@ DATETIME_ApplySelectedField (DATETIME_INFO *infoPtr) { int fieldNum = infoPtr->select & DTHT_DATEFIELD; - int i, val=0, clamp_day=0; + int i, val = 0; + BOOL clamp_day = FALSE; SYSTEMTIME date = infoPtr->date; int oldyear; @@ -858,7 +859,7 @@ date.wYear = date.wYear - (date.wYear%100) + val; if (DATETIME_IsDateInValidRange(infoPtr, &date)) - clamp_day = 1; + clamp_day = TRUE; else date.wYear = oldyear; @@ -869,7 +870,7 @@ date.wYear = val; if (DATETIME_IsDateInValidRange(infoPtr, &date)) - clamp_day = 1; + clamp_day = TRUE; else date.wYear = oldyear; @@ -877,7 +878,7 @@ case ONEDIGITMONTH: case TWODIGITMONTH: date.wMonth = val; - clamp_day = 1; + clamp_day = TRUE; break; case ONEDIGITDAY: case TWODIGITDAY: Modified: trunk/reactos/dll/win32/comctl32/dpa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/dpa.c?r…
============================================================================== --- trunk/reactos/dll/win32/comctl32/dpa.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/dpa.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -117,8 +117,10 @@ if (!hDpa) return E_OUTOFMEMORY; - if (!DPA_Grow (hDpa, streamData.dwItems)) + if (!DPA_Grow (hDpa, streamData.dwItems)) { + DPA_Destroy (hDpa); return E_OUTOFMEMORY; + } /* load data from the stream into the dpa */ ptr = hDpa->ptrs; @@ -162,7 +164,7 @@ * NOTES * No more information available yet! */ -HRESULT WINAPI DPA_SaveStream (const HDPA hDpa, PFNDPASTREAM saveProc, +HRESULT WINAPI DPA_SaveStream (HDPA hDpa, PFNDPASTREAM saveProc, IStream *pStream, LPVOID pData) { LARGE_INTEGER position; @@ -257,7 +259,7 @@ INT nResult, i; INT nIndex; - TRACE("%p %p %08x %p %p %08lx)\n", + TRACE("(%p %p %08x %p %p %08lx)\n", hdpa1, hdpa2, dwFlags, pfnCompare, pfnMerge, lParam); if (IsBadWritePtr (hdpa1, sizeof(*hdpa1))) @@ -385,7 +387,7 @@ * Success: TRUE * Failure: FALSE */ -BOOL WINAPI DPA_Destroy (const HDPA hdpa) +BOOL WINAPI DPA_Destroy (HDPA hdpa) { TRACE("(%p)\n", hdpa); @@ -455,11 +457,11 @@ * * NOTES * - If the 'hdpaNew' is a NULL-Pointer, a copy of the source pointer - * array will be created and it's handle (pointer) is returned. + * array will be created and its handle (pointer) is returned. * - If 'hdpa' is a NULL-Pointer, the original implementation crashes, * this implementation just returns NULL. */ -HDPA WINAPI DPA_Clone (const HDPA hdpa, const HDPA hdpaNew) +HDPA WINAPI DPA_Clone (const HDPA hdpa, HDPA hdpaNew) { INT nNewItems, nSize; HDPA hdpaTemp; @@ -516,7 +518,7 @@ * Success: pointer * Failure: NULL */ -LPVOID WINAPI DPA_GetPtr (const HDPA hdpa, INT nIndex) +LPVOID WINAPI DPA_GetPtr (HDPA hdpa, INT nIndex) { TRACE("(%p %d)\n", hdpa, nIndex); @@ -580,7 +582,7 @@ * Success: index of the inserted pointer * Failure: -1 */ -INT WINAPI DPA_InsertPtr (const HDPA hdpa, INT i, LPVOID p) +INT WINAPI DPA_InsertPtr (HDPA hdpa, INT i, LPVOID p) { TRACE("(%p %d %p)\n", hdpa, i, p); @@ -615,7 +617,7 @@ * Success: TRUE * Failure: FALSE */ -BOOL WINAPI DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p) +BOOL WINAPI DPA_SetPtr (HDPA hdpa, INT i, LPVOID p) { LPVOID *lpTemp; @@ -666,7 +668,7 @@ * Success: deleted pointer * Failure: NULL */ -LPVOID WINAPI DPA_DeletePtr (const HDPA hdpa, INT i) +LPVOID WINAPI DPA_DeletePtr (HDPA hdpa, INT i) { LPVOID *lpDest, *lpSrc, lpTemp = NULL; INT nSize; @@ -719,7 +721,7 @@ * Success: TRUE * Failure: FALSE */ -BOOL WINAPI DPA_DeleteAllPtrs (const HDPA hdpa) +BOOL WINAPI DPA_DeleteAllPtrs (HDPA hdpa) { TRACE("(%p)\n", hdpa); @@ -802,7 +804,7 @@ * Success: TRUE * Failure: FALSE */ -BOOL WINAPI DPA_Sort (const HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam) +BOOL WINAPI DPA_Sort (HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam) { if (!hdpa || !pfnCompare) return FALSE; @@ -834,7 +836,7 @@ * Success: index of the pointer in the array. * Failure: -1 */ -INT WINAPI DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart, +INT WINAPI DPA_Search (HDPA hdpa, LPVOID pFind, INT nStart, PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions) { if (!hdpa || !pfnCompare || !pFind) Modified: trunk/reactos/dll/win32/comctl32/dsa.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/dsa.c?r…
============================================================================== --- trunk/reactos/dll/win32/comctl32/dsa.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/dsa.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -92,7 +92,7 @@ * Success: TRUE * Failure: FALSE */ -BOOL WINAPI DSA_Destroy (const HDSA hdsa) +BOOL WINAPI DSA_Destroy (HDSA hdsa) { TRACE("(%p)\n", hdsa); @@ -120,7 +120,7 @@ * Success: TRUE * Failure: FALSE */ -BOOL WINAPI DSA_GetItem (const HDSA hdsa, INT nIndex, LPVOID pDest) +BOOL WINAPI DSA_GetItem (HDSA hdsa, INT nIndex, LPVOID pDest) { LPVOID pSrc; @@ -151,7 +151,7 @@ * Success: pointer to an item * Failure: NULL */ -LPVOID WINAPI DSA_GetItemPtr (const HDSA hdsa, INT nIndex) +LPVOID WINAPI DSA_GetItemPtr (HDSA hdsa, INT nIndex) { LPVOID pSrc; @@ -184,7 +184,7 @@ * Success: TRUE * Failure: FALSE */ -BOOL WINAPI DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc) +BOOL WINAPI DSA_SetItem (HDSA hdsa, INT nIndex, LPVOID pSrc) { INT nSize, nNewItems; LPVOID pDest, lpTemp; @@ -240,7 +240,7 @@ * Success: position of the new item * Failure: -1 */ -INT WINAPI DSA_InsertItem (const HDSA hdsa, INT nIndex, LPVOID pSrc) +INT WINAPI DSA_InsertItem (HDSA hdsa, INT nIndex, LPVOID pSrc) { INT nNewItems, nSize; LPVOID lpTemp, lpDest; @@ -301,7 +301,7 @@ * Success: number of the deleted element * Failure: -1 */ -INT WINAPI DSA_DeleteItem (const HDSA hdsa, INT nIndex) +INT WINAPI DSA_DeleteItem (HDSA hdsa, INT nIndex) { LPVOID lpDest,lpSrc; INT nSize; @@ -353,7 +353,7 @@ * Success: TRUE * Failure: FALSE */ -BOOL WINAPI DSA_DeleteAllItems (const HDSA hdsa) +BOOL WINAPI DSA_DeleteAllItems (HDSA hdsa) { TRACE("(%p)\n", hdsa); Modified: trunk/reactos/dll/win32/comctl32/header.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/header.…
============================================================================== --- trunk/reactos/dll/win32/comctl32/header.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/header.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -872,7 +872,7 @@ * Prepare callback items * depends on NMHDDISPINFOW having same structure as NMHDDISPINFOA * (so we handle the two cases only doing a specific cast for pszText). - * Checks if any of the required field are callback. If there are sends a + * Checks if any of the required fields is a callback. If this is the case sends a * NMHDISPINFO notify to retrieve these items. The items are stored in the * HEADER_ITEM pszText and iImage fields. They should be freed with * HEADER_FreeCallbackItems. Modified: trunk/reactos/dll/win32/comctl32/imagelist.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/imageli…
============================================================================== --- trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/imagelist.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -196,7 +196,7 @@ for (n = 0; n < count; n++) { - int has_alpha = 0; + BOOL has_alpha = FALSE; imagelist_point_from_index( himl, pos + n, &pt ); @@ -2876,7 +2876,7 @@ himl->hbmImage = hbmNewBitmap; } else - ERR("Could not create new image bitmap !\n"); + ERR("Could not create new image bitmap!\n"); if (himl->hbmMask) { @@ -3147,7 +3147,7 @@ */ UINT WINAPI -ImageList_SetColorTable (HIMAGELIST himl, UINT uStartIndex, UINT cEntries, CONST RGBQUAD * prgb) +ImageList_SetColorTable(HIMAGELIST himl, UINT uStartIndex, UINT cEntries, const RGBQUAD *prgb) { return SetDIBColorTable(himl->hdcImage, uStartIndex, cEntries, prgb); } Modified: trunk/reactos/dll/win32/comctl32/listview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/listvie…
============================================================================== --- trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/listview.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -1118,7 +1118,7 @@ * ITERATOR DOCUMENTATION * * The iterator functions allow for easy, and convenient iteration - * over items of interest in the list. Typically, you create a + * over items of interest in the list. Typically, you create an * iterator, use it, and destroy it, as such: * ITERATOR i; * @@ -3670,8 +3670,8 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem, BOOL space) { /* FIXME: pass in the state */ - WORD wShift = HIWORD(GetKeyState(VK_SHIFT)); - WORD wCtrl = HIWORD(GetKeyState(VK_CONTROL)); + WORD wShift = GetKeyState(VK_SHIFT) & 0x8000; + WORD wCtrl = GetKeyState(VK_CONTROL) & 0x8000; BOOL bResult = FALSE; TRACE("nItem=%d, wShift=%d, wCtrl=%d\n", nItem, wShift, wCtrl); @@ -4720,9 +4720,11 @@ if (infoPtr->uView == LV_VIEW_DETAILS && infoPtr->dwLvExStyle & LVS_EX_GRIDLINES) rcLabel.bottom--; +#ifdef __REACTOS__ if ((!(lvItem.state & LVIS_SELECTED) || !infoPtr->bFocus) && (infoPtr->dwLvExStyle & LVS_EX_TRANSPARENTSHADOWTEXT)) DrawShadowText(hdc, lvItem.pszText, -1, &rcLabel, uFormat, RGB(255, 255, 255), RGB(0, 0, 0), 2, 2); else +#endif DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat); postpaint: @@ -5383,9 +5385,8 @@ */ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy) { - NMLISTVIEW nmlv; HDPA hdpaSubItems = NULL; - BOOL bSuppress; + BOOL suppress = FALSE; ITEMHDR *hdrItem; ITEM_INFO *lpItem; ITEM_ID *lpID; @@ -5400,11 +5401,15 @@ SetRectEmpty(&infoPtr->rcFocus); /* But we are supposed to leave nHotItem as is! */ - /* send LVN_DELETEALLITEMS notification */ - ZeroMemory(&nmlv, sizeof(NMLISTVIEW)); - nmlv.iItem = -1; - bSuppress = notify_listview(infoPtr, LVN_DELETEALLITEMS, &nmlv); + if (!(infoPtr->dwStyle & LVS_OWNERDATA) || !destroy) + { + NMLISTVIEW nmlv; + + memset(&nmlv, 0, sizeof(NMLISTVIEW)); + nmlv.iItem = -1; + suppress = notify_listview(infoPtr, LVN_DELETEALLITEMS, &nmlv); + } for (i = infoPtr->nItemCount - 1; i >= 0; i--) { @@ -5412,7 +5417,7 @@ { /* send LVN_DELETEITEM notification, if not suppressed and if it is not a virtual listview */ - if (!bSuppress) notify_deleteitem(infoPtr, i); + if (!suppress) notify_deleteitem(infoPtr, i); hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, i); lpItem = DPA_GetPtr(hdpaSubItems, 0); /* free id struct */ @@ -7500,6 +7505,7 @@ WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' }; RECT rcBox, rcBounds, rcState, rcIcon, rcLabel, rcSearch; POINT Origin, Position, opt; + BOOL is_fullrow; LVITEMW lvItem; ITERATOR i; INT iItem; @@ -7623,15 +7629,17 @@ TRACE("rcBounds=%s\n", wine_dbgstr_rect(&rcBounds)); if (!PtInRect(&rcBounds, opt)) return -1; + /* That's a special case - row rectangle is used as item rectangle and + returned flags contain all item parts. */ + is_fullrow = (infoPtr->uView == LV_VIEW_DETAILS) && ((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) || (infoPtr->dwStyle & LVS_OWNERDRAWFIXED)); + if (PtInRect(&rcIcon, opt)) lpht->flags |= LVHT_ONITEMICON; else if (PtInRect(&rcLabel, opt)) lpht->flags |= LVHT_ONITEMLABEL; else if (infoPtr->himlState && PtInRect(&rcState, opt)) lpht->flags |= LVHT_ONITEMSTATEICON; - /* special case for LVS_EX_FULLROWSELECT */ - if (infoPtr->uView == LV_VIEW_DETAILS && infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT && - !(lpht->flags & LVHT_ONITEM)) + if (is_fullrow && !(lpht->flags & LVHT_ONITEM)) { lpht->flags = LVHT_ONITEM | LVHT_ABOVE; } @@ -7639,9 +7647,7 @@ lpht->flags &= ~LVHT_NOWHERE; TRACE("lpht->flags=0x%x\n", lpht->flags); - if (select && !(infoPtr->uView == LV_VIEW_DETAILS && - ((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) || - (infoPtr->dwStyle & LVS_OWNERDRAWFIXED)))) + if (select && !is_fullrow) { if (infoPtr->uView == LV_VIEW_DETAILS) { @@ -8247,7 +8253,7 @@ INT max_cx = 0; HDITEMW hdi; - TRACE("(nColumn=%d, cx=%d\n", nColumn, cx); + TRACE("(nColumn=%d, cx=%d)\n", nColumn, cx); /* set column width only if in report or list mode */ if (infoPtr->uView != LV_VIEW_DETAILS && infoPtr->uView != LV_VIEW_LIST) return FALSE; @@ -8631,7 +8637,7 @@ INT oldHeight = infoPtr->nItemHeight; HIMAGELIST himlOld = 0; - TRACE("(nType=%d, himl=%p\n", nType, himl); + TRACE("(nType=%d, himl=%p)\n", nType, himl); switch (nType) { @@ -8786,7 +8792,7 @@ { POINT Origin, Pt; - TRACE("(nItem=%d, pt=%s\n", nItem, wine_dbgstr_point(pt)); + TRACE("(nItem=%d, pt=%s)\n", nItem, wine_dbgstr_point(pt)); if (!pt || nItem < 0 || nItem >= infoPtr->nItemCount || !(infoPtr->uView == LV_VIEW_ICON || infoPtr->uView == LV_VIEW_SMALLICON)) return FALSE; Modified: trunk/reactos/dll/win32/comctl32/propsheet.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/propshe…
============================================================================== --- trunk/reactos/dll/win32/comctl32/propsheet.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/propsheet.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -1872,7 +1872,7 @@ if (psInfo->proppage[i].hwndPage == hwndCleanPage) psInfo->proppage[i].isDirty = FALSE; - /* look to see if there's any dirty pages */ + /* look to see if there are any dirty pages */ if (psInfo->proppage[i].isDirty) noPageDirty = FALSE; } @@ -2414,15 +2414,30 @@ HWND hwndBack = GetDlgItem(hwndDlg, IDC_BACK_BUTTON); HWND hwndNext = GetDlgItem(hwndDlg, IDC_NEXT_BUTTON); HWND hwndFinish = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON); +#ifdef __REACTOS__ HWND hwndCancel = GetDlgItem(hwndDlg, IDCANCEL); INT iDefItem = 0; HWND hwndFocus; +#endif TRACE("%d\n", dwFlags); EnableWindow(hwndBack, FALSE); EnableWindow(hwndNext, FALSE); EnableWindow(hwndFinish, FALSE); + +#ifndef __REACTOS__ + /* set the default pushbutton to an enabled button */ + if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) + SendMessageW(hwndDlg, DM_SETDEFID, IDC_FINISH_BUTTON, 0); + else if (dwFlags & PSWIZB_NEXT) + SendMessageW(hwndDlg, DM_SETDEFID, IDC_NEXT_BUTTON, 0); + else if (dwFlags & PSWIZB_BACK) + SendMessageW(hwndDlg, DM_SETDEFID, IDC_BACK_BUTTON, 0); + else + SendMessageW(hwndDlg, DM_SETDEFID, IDCANCEL, 0); +#endif + if (dwFlags & PSWIZB_BACK) EnableWindow(hwndBack, TRUE); @@ -2454,6 +2469,7 @@ else if (!(dwFlags & PSWIZB_DISABLEDFINISH)) EnableWindow(hwndFinish, TRUE); +#ifdef __REACTOS__ /* set the default pushbutton to an enabled button */ if (((dwFlags & PSWIZB_FINISH) || psInfo->hasFinish) && !(dwFlags & PSWIZB_DISABLEDFINISH)) iDefItem = IDC_FINISH_BUTTON; @@ -2469,6 +2485,8 @@ hwndFocus = GetFocus(); if (!hwndFocus || hwndFocus == hwndCancel) SetFocus(GetDlgItem(hwndDlg, iDefItem)); +#endif + } /****************************************************************************** Modified: trunk/reactos/dll/win32/comctl32/rebar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/rebar.c…
============================================================================== --- trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/rebar.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -50,7 +50,6 @@ * - WM_QUERYNEWPALETTE * - WM_RBUTTONDOWN * - WM_RBUTTONUP - * - WM_SYSCOLORCHANGE * - WM_VKEYTOITEM * - WM_WININICHANGE * Notifications: @@ -2904,6 +2903,7 @@ TRACE("[%s]\n", wine_dbgstr_rect(lpRect)); REBAR_SizeToHeight(infoPtr, get_rect_cy(infoPtr, lpRect)); +#ifdef __REACTOS__ /* Note that this undocumented flag is available on comctl32 v6 or later */ if ((flags & RBSTR_CHANGERECT) != 0) { @@ -2911,6 +2911,7 @@ GetClientRect(infoPtr->hwndSelf, &rcRebar); lpRect->bottom = lpRect->top + (rcRebar.bottom - rcRebar.top); } +#endif return TRUE; } @@ -3378,7 +3379,7 @@ ERR("wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n", i); i = NFR_ANSI; } - infoPtr->bUnicode = (i == NFR_UNICODE) ? 1 : 0; + infoPtr->bUnicode = (i == NFR_UNICODE); return (LRESULT)i; } return (LRESULT)((infoPtr->bUnicode) ? NFR_UNICODE : NFR_ANSI); @@ -3751,8 +3752,11 @@ case WM_SYSCOLORCHANGE: COMCTL32_RefreshSysColors(); +#ifdef __REACTOS__ + /* r51522 - Properly support WM_SYSCOLORCHANGE */ infoPtr->clrBtnText = comctl32_color.clrBtnText; infoPtr->clrBtnFace = comctl32_color.clrBtnFace; +#endif return 0; /* case WM_VKEYTOITEM: supported according to ControlSpy */ Modified: trunk/reactos/dll/win32/comctl32/status.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/status.…
============================================================================== --- trunk/reactos/dll/win32/comctl32/status.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/status.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -687,10 +687,12 @@ if (infoPtr->hwndToolTip) { INT nTipCount; TTTOOLINFOW ti; + WCHAR wEmpty = 0; ZeroMemory (&ti, sizeof(TTTOOLINFOW)); ti.cbSize = sizeof(TTTOOLINFOW); ti.hwnd = infoPtr->Self; + ti.lpszText = &wEmpty; nTipCount = SendMessageW (infoPtr->hwndToolTip, TTM_GETTOOLCOUNT, 0, 0); if (nTipCount < infoPtr->numParts) { Modified: trunk/reactos/dll/win32/comctl32/tab.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/tab.c?r…
============================================================================== --- trunk/reactos/dll/win32/comctl32/tab.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/tab.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -238,22 +238,29 @@ TRACE("(%p %d)\n", infoPtr, iItem); - if (iItem < 0) - infoPtr->iSelected = -1; - else if (iItem >= infoPtr->uNumItem) + if (iItem >= (INT)infoPtr->uNumItem) return -1; - else { - if (prevItem != iItem) { - if (prevItem != -1) - TAB_GetItem(infoPtr, prevItem)->dwState &= ~TCIS_BUTTONPRESSED; + + if (prevItem != iItem) { + if (prevItem != -1) + TAB_GetItem(infoPtr, prevItem)->dwState &= ~TCIS_BUTTONPRESSED; + + if (iItem >= 0) + { TAB_GetItem(infoPtr, iItem)->dwState |= TCIS_BUTTONPRESSED; - infoPtr->iSelected = iItem; infoPtr->uFocus = iItem; - TAB_EnsureSelectionVisible(infoPtr); - TAB_InvalidateTabArea(infoPtr); } - } + else + { + infoPtr->iSelected = -1; + infoPtr->uFocus = -1; + } + + TAB_EnsureSelectionVisible(infoPtr); + TAB_InvalidateTabArea(infoPtr); + } + return prevItem; } Modified: trunk/reactos/dll/win32/comctl32/toolbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/toolbar…
============================================================================== --- trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/toolbar.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -80,8 +80,8 @@ INT idCommand; BYTE fsState; BYTE fsStyle; - BYTE bHot; - BYTE bDropDownPressed; + BOOL bHot; + BOOL bDropDownPressed; DWORD_PTR dwData; INT_PTR iString; INT nRow; Modified: trunk/reactos/dll/win32/comctl32/tooltips.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/tooltip…
============================================================================== --- trunk/reactos/dll/win32/comctl32/tooltips.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/tooltips.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -613,7 +613,7 @@ TOOLTIPS_CalcTipSize (infoPtr, &size); TRACE("size %d x %d\n", size.cx, size.cy); - if (track_activate) + if (track_activate && (toolPtr->uFlags & TTF_TRACK)) { rect.left = infoPtr->xTrackPos; rect.top = infoPtr->yTrackPos; @@ -1024,6 +1024,9 @@ infoPtr->hwndSelf, ti->hwnd, ti->uId, (ti->uFlags & TTF_IDISHWND) ? " TTF_IDISHWND" : ""); + if (ti->cbSize >= TTTOOLINFOW_V2_SIZE && !ti->lpszText && isW) + return FALSE; + if (infoPtr->uNumTools == 0) { infoPtr->tools = Alloc (sizeof(TTTOOL_INFO)); toolPtr = infoPtr->tools; @@ -1047,27 +1050,29 @@ toolPtr->rect = ti->rect; toolPtr->hinst = ti->hinst; - if (IS_INTRESOURCE(ti->lpszText)) { - TRACE("add string id %x\n", LOWORD(ti->lpszText)); - toolPtr->lpszText = ti->lpszText; - } - else if (ti->lpszText) { - if (TOOLTIPS_IsCallbackString(ti->lpszText, isW)) { - TRACE("add CALLBACK!\n"); - toolPtr->lpszText = LPSTR_TEXTCALLBACKW; - } - else if (isW) { - INT len = lstrlenW (ti->lpszText); - TRACE("add text %s!\n", debugstr_w(ti->lpszText)); - toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR)); - strcpyW (toolPtr->lpszText, ti->lpszText); - } - else { - INT len = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, NULL, 0); - TRACE("add text \"%s\"!\n", (LPSTR)ti->lpszText); - toolPtr->lpszText = Alloc (len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, toolPtr->lpszText, len); - } + if (ti->cbSize >= TTTOOLINFOW_V1_SIZE) { + if (IS_INTRESOURCE(ti->lpszText)) { + TRACE("add string id %x\n", LOWORD(ti->lpszText)); + toolPtr->lpszText = ti->lpszText; + } + else if (ti->lpszText) { + if (TOOLTIPS_IsCallbackString(ti->lpszText, isW)) { + TRACE("add CALLBACK!\n"); + toolPtr->lpszText = LPSTR_TEXTCALLBACKW; + } + else if (isW) { + INT len = lstrlenW (ti->lpszText); + TRACE("add text %s!\n", debugstr_w(ti->lpszText)); + toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR)); + strcpyW (toolPtr->lpszText, ti->lpszText); + } + else { + INT len = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, NULL, 0); + TRACE("add text \"%s\"!\n", (LPSTR)ti->lpszText); + toolPtr->lpszText = Alloc (len * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, toolPtr->lpszText, len); + } + } } if (ti->cbSize >= TTTOOLINFOW_V2_SIZE) Modified: trunk/reactos/dll/win32/comctl32/trackbar.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/trackba…
============================================================================== --- trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/trackbar.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -597,7 +597,6 @@ } } -#define POINT_COUNT 6 static int TRACKBAR_FillThumb (const TRACKBAR_INFO *infoPtr, HDC hdc, HBRUSH hbrush) { @@ -1511,11 +1510,13 @@ hwnd, 0, 0, 0); if (infoPtr->hwndToolTip) { - TTTOOLINFOW ti; + TTTOOLINFOW ti; + WCHAR wEmpty = 0; ZeroMemory (&ti, sizeof(ti)); ti.cbSize = sizeof(ti); ti.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE; ti.hwnd = hwnd; + ti.lpszText = &wEmpty; SendMessageW (infoPtr->hwndToolTip, TTM_ADDTOOLW, 0, (LPARAM)&ti); } Modified: trunk/reactos/dll/win32/comctl32/treeview.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/treevie…
============================================================================== --- trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/treeview.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -2926,6 +2926,62 @@ InvalidateRect(infoPtr->hwnd, NULL, TRUE); } +static void +TREEVIEW_InitCheckboxes(TREEVIEW_INFO *infoPtr) +{ + RECT rc; + HBITMAP hbm, hbmOld; + HDC hdc, hdcScreen; + int nIndex; + + infoPtr->himlState = ImageList_Create(16, 16, ILC_COLOR | ILC_MASK, 3, 0); + + hdcScreen = GetDC(0); + + hdc = CreateCompatibleDC(hdcScreen); + hbm = CreateCompatibleBitmap(hdcScreen, 48, 16); + hbmOld = SelectObject(hdc, hbm); + + SetRect(&rc, 0, 0, 48, 16); + FillRect(hdc, &rc, (HBRUSH)(COLOR_WINDOW+1)); + + SetRect(&rc, 18, 2, 30, 14); + DrawFrameControl(hdc, &rc, DFC_BUTTON, + DFCS_BUTTONCHECK|DFCS_FLAT); + + SetRect(&rc, 34, 2, 46, 14); + DrawFrameControl(hdc, &rc, DFC_BUTTON, + DFCS_BUTTONCHECK|DFCS_FLAT|DFCS_CHECKED); + + SelectObject(hdc, hbmOld); + nIndex = ImageList_AddMasked(infoPtr->himlState, hbm, + comctl32_color.clrWindow); + TRACE("checkbox index %d\n", nIndex); + + DeleteObject(hbm); + DeleteDC(hdc); + ReleaseDC(0, hdcScreen); + + infoPtr->stateImageWidth = 16; + infoPtr->stateImageHeight = 16; +} + +static void +TREEVIEW_ResetImageStateIndex(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) +{ + TREEVIEW_ITEM *child = item->firstChild; + + item->state &= ~TVIS_STATEIMAGEMASK; + item->state |= INDEXTOSTATEIMAGEMASK(1); + + while (child) + { + TREEVIEW_ITEM *next = child->nextSibling; + TREEVIEW_ResetImageStateIndex(infoPtr, child); + child = next; + } +} + static LRESULT TREEVIEW_Paint(TREEVIEW_INFO *infoPtr, HDC hdc_ref) { @@ -2934,6 +2990,17 @@ RECT rc; TRACE("(%p %p)\n", infoPtr, hdc_ref); + + if ((infoPtr->dwStyle & TVS_CHECKBOXES) && !infoPtr->himlState) + { + TREEVIEW_InitCheckboxes(infoPtr); + TREEVIEW_ResetImageStateIndex(infoPtr, infoPtr->root); + + TREEVIEW_EndEditLabelNow(infoPtr, TRUE); + TREEVIEW_UpdateSubTree(infoPtr, infoPtr->root); + TREEVIEW_UpdateScrollBars(infoPtr); + TREEVIEW_Invalidate(infoPtr, NULL); + } if (hdc_ref) { @@ -3344,7 +3411,7 @@ TREEVIEW_ITEM *nextItem, *tmpItem; BOOL sendsNotifications; - TRACE("(%p, %p, partial=%d, %d\n", infoPtr, item, partial, user); + TRACE("(%p, %p, partial=%d, %d)\n", infoPtr, item, partial, user); if (!TREEVIEW_HasChildren(infoPtr, item)) return FALSE; @@ -4955,46 +5022,6 @@ /* Create/Destroy *******************************************************/ -static void -TREEVIEW_InitCheckboxes(TREEVIEW_INFO *infoPtr) -{ - RECT rc; - HBITMAP hbm, hbmOld; - HDC hdc, hdcScreen; - int nIndex; - - infoPtr->himlState = ImageList_Create(16, 16, ILC_COLOR | ILC_MASK, 3, 0); - - hdcScreen = GetDC(0); - - hdc = CreateCompatibleDC(hdcScreen); - hbm = CreateCompatibleBitmap(hdcScreen, 48, 16); - hbmOld = SelectObject(hdc, hbm); - - SetRect(&rc, 0, 0, 48, 16); - FillRect(hdc, &rc, (HBRUSH)(COLOR_WINDOW+1)); - - SetRect(&rc, 18, 2, 30, 14); - DrawFrameControl(hdc, &rc, DFC_BUTTON, - DFCS_BUTTONCHECK|DFCS_FLAT); - - SetRect(&rc, 34, 2, 46, 14); - DrawFrameControl(hdc, &rc, DFC_BUTTON, - DFCS_BUTTONCHECK|DFCS_FLAT|DFCS_CHECKED); - - SelectObject(hdc, hbmOld); - nIndex = ImageList_AddMasked(infoPtr->himlState, hbm, - comctl32_color.clrWindow); - TRACE("checkbox index %d\n", nIndex); - - DeleteObject(hbm); - DeleteDC(hdc); - ReleaseDC(0, hdcScreen); - - infoPtr->stateImageWidth = 16; - infoPtr->stateImageHeight = 16; -} - static LRESULT TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) { @@ -5092,9 +5119,6 @@ infoPtr->hwndToolTip = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, WS_POPUP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hwnd, 0, 0, 0); - - if (infoPtr->dwStyle & TVS_CHECKBOXES) - TREEVIEW_InitCheckboxes(infoPtr); /* Make sure actual scrollbar state is consistent with uInternalStatus */ ShowScrollBar(hwnd, SB_VERT, FALSE); @@ -5434,21 +5458,6 @@ return 0; } -static void TREEVIEW_ResetImageStateIndex(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item) -{ - TREEVIEW_ITEM *child = item->firstChild; - - item->state &= ~TVIS_STATEIMAGEMASK; - item->state |= INDEXTOSTATEIMAGEMASK(1); - - while (child) - { - TREEVIEW_ITEM *next = child->nextSibling; - TREEVIEW_ResetImageStateIndex(infoPtr, child); - child = next; - } -} - static LRESULT TREEVIEW_StyleChanged(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam) { @@ -5492,6 +5501,7 @@ infoPtr->dwStyle = dwNewStyle; } + TREEVIEW_EndEditLabelNow(infoPtr, TRUE); TREEVIEW_UpdateSubTree(infoPtr, infoPtr->root); TREEVIEW_UpdateScrollBars(infoPtr); TREEVIEW_Invalidate(infoPtr, NULL); Modified: trunk/reactos/dll/win32/comctl32/updown.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/comctl32/updown.…
============================================================================== --- trunk/reactos/dll/win32/comctl32/updown.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/comctl32/updown.c [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -135,11 +135,16 @@ (infoPtr->MaxVal < infoPtr->MinVal ? -1 : 1) * (infoPtr->MinVal - infoPtr->MaxVal) + (delta < 0 ? 1 : -1); - } else return FALSE; + } else if ((infoPtr->MaxVal > infoPtr->MinVal && infoPtr->CurVal+delta > infoPtr->MaxVal) + || (infoPtr->MaxVal < infoPtr->MinVal && infoPtr->CurVal+delta < infoPtr->MaxVal)) { + delta = infoPtr->MaxVal - infoPtr->CurVal; + } else { + delta = infoPtr->MinVal - infoPtr->CurVal; + } } infoPtr->CurVal += delta; - return TRUE; + return delta != 0; } /*********************************************************************** @@ -334,7 +339,7 @@ /* if nothing changed exit earlier */ GetWindowTextW(infoPtr->Buddy, txt_old, sizeof(txt_old)/sizeof(WCHAR)); - if (lstrcmpiW(txt_old, txt) == 0) return 0; + if (lstrcmpiW(txt_old, txt) == 0) return FALSE; return SetWindowTextW(infoPtr->Buddy, txt); } @@ -462,6 +467,51 @@ return 0; } +static int UPDOWN_GetPos(UPDOWN_INFO *infoPtr, BOOL *err) +{ + BOOL succ = UPDOWN_GetBuddyInt(infoPtr); + int val = infoPtr->CurVal; + + if(!UPDOWN_InBounds(infoPtr, val)) { + if((infoPtr->MinVal < infoPtr->MaxVal && val < infoPtr->MinVal) + || (infoPtr->MinVal > infoPtr->MaxVal && val > infoPtr->MinVal)) + val = infoPtr->MinVal; + else + val = infoPtr->MaxVal; + + succ = FALSE; + } + + if(err) *err = !succ; + return val; +} + +static int UPDOWN_SetPos(UPDOWN_INFO *infoPtr, int pos) +{ + int ret = infoPtr->CurVal; + + if(!UPDOWN_InBounds(infoPtr, pos)) { + if((infoPtr->MinVal < infoPtr->MaxVal && pos < infoPtr->MinVal) + || (infoPtr->MinVal > infoPtr->MaxVal && pos > infoPtr->MinVal)) + pos = infoPtr->MinVal; + else + pos = infoPtr->MaxVal; + } + + infoPtr->CurVal = pos; + UPDOWN_SetBuddyInt(infoPtr); + + if(!UPDOWN_InBounds(infoPtr, ret)) { + if((infoPtr->MinVal < infoPtr->MaxVal && ret < infoPtr->MinVal) + || (infoPtr->MinVal > infoPtr->MaxVal && ret > infoPtr->MinVal)) + ret = infoPtr->MinVal; + else + ret = infoPtr->MaxVal; + } + return ret; +} + + /*********************************************************************** * UPDOWN_SetRange * @@ -1044,22 +1094,15 @@ case UDM_GETPOS: { - BOOL ret = UPDOWN_GetBuddyInt (infoPtr); - return MAKELONG(infoPtr->CurVal, ret ? 0 : 1); + BOOL err; + int pos; + + pos = UPDOWN_GetPos(infoPtr, &err); + return MAKELONG(pos, err); } case UDM_SETPOS: { - int temp = (short)LOWORD(lParam); - - TRACE("UpDown Ctrl new value(%d), hwnd=%p\n", temp, hwnd); - if(!UPDOWN_InBounds(infoPtr, temp)) { - if(temp < infoPtr->MinVal) temp = infoPtr->MinVal; - if(temp > infoPtr->MaxVal) temp = infoPtr->MaxVal; - } - wParam = infoPtr->CurVal; - infoPtr->CurVal = temp; - UPDOWN_SetBuddyInt (infoPtr); - return wParam; /* return prev value */ + return UPDOWN_SetPos(infoPtr, (short)LOWORD(lParam)); } case UDM_GETRANGE: return MAKELONG(infoPtr->MaxVal, infoPtr->MinVal); @@ -1083,22 +1126,11 @@ case UDM_GETPOS32: { - BOOL ret = UPDOWN_GetBuddyInt (infoPtr); - if ((LPBOOL)lParam) *((LPBOOL)lParam) = !ret; - return infoPtr->CurVal; + return UPDOWN_GetPos(infoPtr, (BOOL*)lParam); } case UDM_SETPOS32: { - int temp; - - if(!UPDOWN_InBounds(infoPtr, (int)lParam)) { - if((int)lParam < infoPtr->MinVal) lParam = infoPtr->MinVal; - if((int)lParam > infoPtr->MaxVal) lParam = infoPtr->MaxVal; - } - temp = infoPtr->CurVal; /* save prev value */ - infoPtr->CurVal = (int)lParam; /* set the new value */ - UPDOWN_SetBuddyInt (infoPtr); - return temp; /* return prev value */ + return UPDOWN_SetPos(infoPtr, (int)lParam); } case UDM_GETUNICODEFORMAT: /* we lie a bit here, we're always using Unicode internally */ Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Tue Apr 22 14:04:22 2014 @@ -60,7 +60,7 @@ reactos/dll/win32/cabinet # Synced to Wine-1.7.17 reactos/dll/win32/clusapi # Synced to Wine-1.7.1 reactos/dll/win32/comcat # Synced to Wine-1.7.1 -reactos/dll/win32/comctl32 # Synced to Wine 1.7.1 +reactos/dll/win32/comctl32 # Synced to Wine 1.7.17 reactos/dll/win32/comdlg32 # Synced to Wine 1.7.1 reactos/dll/win32/compstui # Synced to Wine-1.7.1 reactos/dll/win32/credui # Synced to Wine-1.7.1
10 years, 8 months
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
50
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
Results per page:
10
25
50
100
200