winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
March 2013
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
531 discussions
Start a n
N
ew thread
Dmitry Timoshkov : gdiplus: Add some tests for string format alignment.
by Alexandre Julliard
04 Mar '13
04 Mar '13
Module: wine Branch: master Commit: 464b8b4160862076aa2fad3cb58c7a49f62267e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=464b8b4160862076aa2fad3cb…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Mar 4 17:52:59 2013 +0900 gdiplus: Add some tests for string format alignment. --- dlls/gdiplus/tests/graphics.c | 142 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 142 insertions(+), 0 deletions(-) diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index c37d33f..08b2465 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -3909,16 +3909,24 @@ static void test_measure_string(void) static const WCHAR string[] = { 'A','0','1',0 }; HDC hdc; GpStringFormat *format; + CharacterRange range = { 0, 3 }; + GpRegion *region; GpGraphics *graphics; GpFontFamily *family; GpFont *font; GpStatus status; RectF bounds, rect; REAL width, height, width_1, width_2; + REAL margin_x, margin_y, width_rgn, height_rgn; int lines, glyphs; status = GdipCreateStringFormat(StringFormatFlagsNoWrap, LANG_NEUTRAL, &format); expect(Ok, status); + expect(Ok, status); + status = GdipSetStringFormatMeasurableCharacterRanges(format, 1, &range); + expect(Ok, status); + status = GdipCreateRegion(®ion); + expect(Ok, status); status = GdipCreateFontFamilyFromName(tahomaW, NULL, &family); expect(Ok, status); @@ -3929,12 +3937,17 @@ static void test_measure_string(void) status = GdipCreateFont(family, 20, FontStyleRegular, UnitPixel, &font); expect(Ok, status); + margin_x = 20.0 / 6.0; + margin_y = 20.0 / 8.0; + set_rect_empty(&rect); set_rect_empty(&bounds); status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, &glyphs, &lines); expect(Ok, status); expect(3, glyphs); expect(1, lines); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); width = bounds.Width; height = bounds.Height; @@ -3945,16 +3958,35 @@ static void test_measure_string(void) expect(Ok, status); expect(3, glyphs); expect(1, lines); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); expectf(width, bounds.Width); todo_wine expectf(height / 2.0, bounds.Height); + status = GdipSetStringFormatFlags(format, StringFormatFlagsNoWrap | StringFormatFlagsNoClip); + + set_rect_empty(&rect); + rect.Height = height / 2.0; + set_rect_empty(&bounds); + status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, &glyphs, &lines); + expect(Ok, status); + expect(3, glyphs); + expect(1, lines); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); + expectf(width, bounds.Width); +todo_wine + expectf(height, bounds.Height); + set_rect_empty(&rect); set_rect_empty(&bounds); status = GdipMeasureString(graphics, string, 1, font, &rect, format, &bounds, &glyphs, &lines); expect(Ok, status); expect(1, glyphs); expect(1, lines); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); ok(bounds.Width < width / 2.0, "width of 1 glyph is wrong\n"); expectf(height, bounds.Height); width_1 = bounds.Width; @@ -3965,6 +3997,8 @@ todo_wine expect(Ok, status); expect(2, glyphs); expect(1, lines); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); ok(bounds.Width < width, "width of 2 glyphs is wrong\n"); ok(bounds.Width > width_1, "width of 2 glyphs is wrong\n"); expectf(height, bounds.Height); @@ -3977,6 +4011,8 @@ todo_wine expect(Ok, status); expect(1, glyphs); expect(1, lines); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); expectf_(width_1, bounds.Width, 0.01); expectf(height, bounds.Height); @@ -3988,6 +4024,8 @@ todo_wine expect(Ok, status); expect(2, glyphs); expect(1, lines); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); expectf_(width_2, bounds.Width, 0.01); expectf(height, bounds.Height); @@ -3999,9 +4037,112 @@ todo_wine expect(Ok, status); expect(1, glyphs); expect(1, lines); + expectf(0.0, bounds.X); + expectf(0.0, bounds.Y); expectf_(width_1, bounds.Width, 0.01); expectf(height, bounds.Height); + rect.X = 5.0; + rect.Y = 5.0; + rect.Width = width * 2.0; + rect.Height = height * 2.0; + set_rect_empty(&bounds); + status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, &glyphs, &lines); + expect(Ok, status); + expect(3, glyphs); + expect(1, lines); + expectf(5.0, bounds.X); + expectf(5.0, bounds.Y); + expectf(width, bounds.Width); + expectf(height, bounds.Height); + + rect.X = 5.0; + rect.Y = 5.0; + rect.Width = 32000.0; + rect.Height = 32000.0; + status = GdipMeasureCharacterRanges(graphics, string, -1, font, &rect, format, 1, ®ion); + expect(Ok, status); + set_rect_empty(&bounds); + status = GdipGetRegionBounds(region, graphics, &bounds); + expect(Ok, status); + expectf_(5.0 + margin_x, bounds.X, 1.0); + expectf(5.0, bounds.Y); + expectf_(width - margin_x*2.0, bounds.Width, 1.0); +todo_wine + expectf_(height - margin_y, bounds.Height, 1.0); + + width_rgn = bounds.Width; + height_rgn = bounds.Height; + + GdipSetStringFormatAlign(format, StringAlignmentCenter); + GdipSetStringFormatLineAlign(format, StringAlignmentCenter); + + rect.X = 5.0; + rect.Y = 5.0; + rect.Width = width * 2.0; + rect.Height = height * 2.0; + set_rect_empty(&bounds); + status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, &glyphs, &lines); + expect(Ok, status); + expect(3, glyphs); + expect(1, lines); +todo_wine + expectf_(5.0 + width/2.0, bounds.X, 0.01); +todo_wine + expectf(5.0 + height/2.0, bounds.Y); + expectf(width, bounds.Width); + expectf(height, bounds.Height); + + rect.X = 5.0; + rect.Y = 5.0; + rect.Width = width_rgn * 2.0; + rect.Height = height_rgn * 2.0; + status = GdipMeasureCharacterRanges(graphics, string, -1, font, &rect, format, 1, ®ion); + expect(Ok, status); + set_rect_empty(&bounds); + status = GdipGetRegionBounds(region, graphics, &bounds); + expect(Ok, status); + expectf_(5.0 + width_rgn/2.0, bounds.X, 1.0); +todo_wine + expectf_(5.0 + height_rgn/2.0, bounds.Y, 1.0); + expectf_(width_rgn, bounds.Width, 1.0); + expectf_(height_rgn, bounds.Height, 1.0); + + GdipSetStringFormatAlign(format, StringAlignmentFar); + GdipSetStringFormatLineAlign(format, StringAlignmentFar); + + rect.X = 5.0; + rect.Y = 5.0; + rect.Width = width * 2.0; + rect.Height = height * 2.0; + set_rect_empty(&bounds); + status = GdipMeasureString(graphics, string, -1, font, &rect, format, &bounds, &glyphs, &lines); + expect(Ok, status); + expect(3, glyphs); + expect(1, lines); +todo_wine + expectf(5.0 + width, bounds.X); +todo_wine + expectf(5.0 + height, bounds.Y); + expectf(width, bounds.Width); + expectf(height, bounds.Height); + + rect.X = 5.0; + rect.Y = 5.0; + rect.Width = width_rgn * 2.0; + rect.Height = height_rgn * 2.0; + status = GdipMeasureCharacterRanges(graphics, string, -1, font, &rect, format, 1, ®ion); + expect(Ok, status); + set_rect_empty(&bounds); + status = GdipGetRegionBounds(region, graphics, &bounds); + expect(Ok, status); +todo_wine + expectf_(5.0 + width_rgn, bounds.X, 2.0); +todo_wine + expectf_(5.0 + height_rgn, bounds.Y, 1.0); + expectf_(width_rgn, bounds.Width, 1.0); + expectf_(height_rgn, bounds.Height, 1.0); + status = GdipDeleteFont(font); expect(Ok, status); @@ -4010,6 +4151,7 @@ todo_wine DeleteDC(hdc); GdipDeleteFontFamily(family); + GdipDeleteRegion(region); GdipDeleteStringFormat(format); }
1
0
0
0
Dmitry Timoshkov : Revert "gdiplus: Add support for StringFormatFlagsNoClip .".
by Alexandre Julliard
04 Mar '13
04 Mar '13
Module: wine Branch: master Commit: 737790603cc1dd6697ec4b8fbd0c24a002904214 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=737790603cc1dd6697ec4b8fb…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Mon Mar 4 17:51:41 2013 +0900 Revert "gdiplus: Add support for StringFormatFlagsNoClip.". This reverts commit bfa35f37a7687cdae338ad9837fc595afb2df2b6. This patch breaks string alignment. --- dlls/gdiplus/graphics.c | 33 +++++---------------------------- 1 files changed, 5 insertions(+), 28 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 1150675..806cfa9 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -4682,16 +4682,8 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics, scaled_rect.X = (layoutRect->X + margin_x) * args.rel_width; scaled_rect.Y = layoutRect->Y * args.rel_height; - if (stringFormat->attr & StringFormatFlagsNoClip) - { - scaled_rect.Width = (REAL)(1 << 23); - scaled_rect.Height = (REAL)(1 << 23); - } - else - { - scaled_rect.Width = layoutRect->Width * args.rel_width; - scaled_rect.Height = layoutRect->Height * args.rel_height; - } + scaled_rect.Width = layoutRect->Width * args.rel_width; + scaled_rect.Height = layoutRect->Height * args.rel_height; if (scaled_rect.Width >= 0.5) { scaled_rect.Width -= margin_x * 2.0 * args.rel_width; @@ -4771,7 +4763,7 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, GpPointF pt[3]; RectF scaled_rect; REAL margin_x; - INT lines, glyphs, format_flags = format ? format->attr : 0; + INT lines, glyphs; TRACE("(%p, %s, %i, %p, %s, %p, %p, %p, %p)\n", graphics, debugstr_wn(string, length), length, font, debugstr_rectf(rect), format, @@ -4813,12 +4805,6 @@ GpStatus WINGDIPAPI GdipMeasureString(GpGraphics *graphics, scaled_rect.Y = rect->Y * args.rel_height; scaled_rect.Width = rect->Width * args.rel_width; scaled_rect.Height = rect->Height * args.rel_height; - - if ((format_flags & StringFormatFlagsNoClip) || - scaled_rect.Width >= 1 << 23 || scaled_rect.Width < 0.5) scaled_rect.Width = 1 << 23; - if ((format_flags & StringFormatFlagsNoClip) || - scaled_rect.Height >= 1 << 23 || scaled_rect.Height < 0.5) scaled_rect.Height = 1 << 23; - if (scaled_rect.Width >= 0.5) { scaled_rect.Width -= margin_x * 2.0 * args.rel_width; @@ -4921,7 +4907,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string GpPointF pt[3], rectcpy[4]; POINT corners[4]; REAL rel_width, rel_height, margin_x; - INT save_state, format_flags = 0; + INT save_state; REAL offsety = 0.0; struct draw_string_args args; RectF scaled_rect; @@ -4946,8 +4932,6 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string if(format){ TRACE("may be ignoring some format flags: attr %x\n", format->attr); - format_flags = format->attr; - /* Should be no need to explicitly test for StringAlignmentNear as * that is default behavior if no alignment is passed. */ if(format->vertalign != StringAlignmentNear){ @@ -4992,12 +4976,6 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string scaled_rect.Y = 0.0; scaled_rect.Width = rel_width * rect->Width; scaled_rect.Height = rel_height * rect->Height; - - if ((format_flags & StringFormatFlagsNoClip) || - scaled_rect.Width >= 1 << 23 || scaled_rect.Width < 0.5) scaled_rect.Width = 1 << 23; - if ((format_flags & StringFormatFlagsNoClip) || - scaled_rect.Height >= 1 << 23 || scaled_rect.Height < 0.5) scaled_rect.Height = 1 << 23; - if (scaled_rect.Width >= 0.5) { scaled_rect.Width -= margin_x * 2.0 * rel_width; @@ -5007,8 +4985,7 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string if (scaled_rect.Width >= 1 << 23 || scaled_rect.Width < 0.5) scaled_rect.Width = 1 << 23; if (scaled_rect.Height >= 1 << 23 || scaled_rect.Height < 0.5) scaled_rect.Height = 1 << 23; - if (!(format_flags & StringFormatFlagsNoClip) && - scaled_rect.Width != 1 << 23 && scaled_rect.Height != 1 << 23) + if (scaled_rect.Width != 1 << 23 && scaled_rect.Height != 1 << 23) { /* FIXME: If only the width or only the height is 0, we should probably still clip */ rgn = CreatePolygonRgn(corners, 4, ALTERNATE);
1
0
0
0
Michael Stefaniuc : inetcomm: COM cleanup for the IStream iface.
by Alexandre Julliard
04 Mar '13
04 Mar '13
Module: wine Branch: master Commit: 9a436a98f4ca6a24c320c4fcb7a5d81da3919e21 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9a436a98f4ca6a24c320c4fcb…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Mar 4 00:36:06 2013 +0100 inetcomm: COM cleanup for the IStream iface. --- dlls/inetcomm/mimeole.c | 62 +++++++++++++++++++---------------------------- 1 files changed, 25 insertions(+), 37 deletions(-) diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c index 62d42b9..4c61f72 100644 --- a/dlls/inetcomm/mimeole.c +++ b/dlls/inetcomm/mimeole.c @@ -572,19 +572,14 @@ static HRESULT WINAPI MimeBody_IsDirty( return E_NOTIMPL; } -static HRESULT WINAPI MimeBody_Load( - IMimeBody* iface, - LPSTREAM pStm) +static HRESULT WINAPI MimeBody_Load(IMimeBody *iface, IStream *pStm) { MimeBody *This = impl_from_IMimeBody(iface); TRACE("(%p)->(%p)\n", iface, pStm); return parse_headers(This, pStm); } -static HRESULT WINAPI MimeBody_Save( - IMimeBody* iface, - LPSTREAM pStm, - BOOL fClearDirty) +static HRESULT WINAPI MimeBody_Save(IMimeBody *iface, IStream *pStm, BOOL fClearDirty) { FIXME("stub\n"); return E_NOTIMPL; @@ -1150,62 +1145,58 @@ HRESULT MimeBody_create(IUnknown *outer, void **ppv) typedef struct { - IStreamVtbl *lpVtbl; - LONG refs; - + IStream IStream_iface; + LONG ref; IStream *base; ULARGE_INTEGER pos, start, length; } sub_stream_t; -static inline sub_stream_t *impl_from_IStream( IStream *iface ) +static inline sub_stream_t *impl_from_IStream(IStream *iface) { - return (sub_stream_t *)((char*)iface - FIELD_OFFSET(sub_stream_t, lpVtbl)); + return CONTAINING_RECORD(iface, sub_stream_t, IStream_iface); } -static HRESULT WINAPI sub_stream_QueryInterface( - IStream* iface, - REFIID riid, - void **ppvObject) +static HRESULT WINAPI sub_stream_QueryInterface(IStream *iface, REFIID riid, void **ppv) { sub_stream_t *This = impl_from_IStream(iface); - TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppvObject); - *ppvObject = NULL; + TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv); + *ppv = NULL; if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ISequentialStream) || IsEqualIID(riid, &IID_IStream)) { IStream_AddRef(iface); - *ppvObject = iface; + *ppv = iface; return S_OK; } return E_NOINTERFACE; } -static ULONG WINAPI sub_stream_AddRef( - IStream* iface) +static ULONG WINAPI sub_stream_AddRef(IStream *iface) { sub_stream_t *This = impl_from_IStream(iface); + LONG ref = InterlockedIncrement(&This->ref); - TRACE("(%p)\n", This); - return InterlockedIncrement(&This->refs); + TRACE("(%p) ref=%d\n", This, ref); + + return ref; } -static ULONG WINAPI sub_stream_Release( - IStream* iface) +static ULONG WINAPI sub_stream_Release(IStream *iface) { sub_stream_t *This = impl_from_IStream(iface); - LONG refs; + LONG ref = InterlockedDecrement(&This->ref); - TRACE("(%p)\n", This); - refs = InterlockedDecrement(&This->refs); - if(!refs) + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) { IStream_Release(This->base); HeapFree(GetProcessHeap(), 0, This); } - return refs; + return ref; } static HRESULT WINAPI sub_stream_Read( @@ -1422,15 +1413,15 @@ static HRESULT create_sub_stream(IStream *stream, ULARGE_INTEGER start, ULARGE_I This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); if(!This) return E_OUTOFMEMORY; - This->lpVtbl = &sub_stream_vtbl; - This->refs = 1; + This->IStream_iface.lpVtbl = &sub_stream_vtbl; + This->ref = 1; This->start = start; This->length = length; This->pos.QuadPart = 0; IStream_AddRef(stream); This->base = stream; - *out = (IStream*)&This->lpVtbl; + *out = &This->IStream_iface; return S_OK; } @@ -1733,10 +1724,7 @@ static HRESULT WINAPI MimeMessage_Load(IMimeMessage *iface, IStream *pStm) return S_OK; } -static HRESULT WINAPI MimeMessage_Save( - IMimeMessage *iface, - LPSTREAM pStm, - BOOL fClearDirty) +static HRESULT WINAPI MimeMessage_Save(IMimeMessage *iface, IStream *pStm, BOOL fClearDirty) { FIXME("(%p)->(%p, %s)\n", iface, pStm, fClearDirty ? "TRUE" : "FALSE"); return E_NOTIMPL;
1
0
0
0
Michael Stefaniuc : inetcomm: Include the object instead of IMimeBody in struct body_t.
by Alexandre Julliard
04 Mar '13
04 Mar '13
Module: wine Branch: master Commit: c7d05df81d524a66d35ab0d48cdb6f4603d627a7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c7d05df81d524a66d35ab0d48…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Mar 4 00:35:05 2013 +0100 inetcomm: Include the object instead of IMimeBody in struct body_t. Avoids COM interface to COM object transitions. --- dlls/inetcomm/mimeole.c | 63 ++++++++++++++++++++++++++++++---------------- 1 files changed, 41 insertions(+), 22 deletions(-) diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c index 58a4a5f..62d42b9 100644 --- a/dlls/inetcomm/mimeole.c +++ b/dlls/inetcomm/mimeole.c @@ -1099,17 +1099,14 @@ static HRESULT MimeBody_set_offsets(MimeBody *body, const BODYOFFSETS *offsets) #define FIRST_CUSTOM_PROP_ID 0x100 -HRESULT MimeBody_create(IUnknown *outer, void **obj) +MimeBody *mimebody_create(void) { MimeBody *This; BODYOFFSETS body_offsets; - *obj = NULL; - - if(outer) return CLASS_E_NOAGGREGATION; - This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); - if (!This) return E_OUTOFMEMORY; + if (!This) + return NULL; This->IMimeBody_iface.lpVtbl = &body_vtbl; This->ref = 1; @@ -1127,10 +1124,30 @@ HRESULT MimeBody_create(IUnknown *outer, void **obj) body_offsets.cbBodyStart = body_offsets.cbBodyEnd = 0; MimeBody_set_offsets(This, &body_offsets); - *obj = &This->IMimeBody_iface; - return S_OK; + return This; } +HRESULT MimeBody_create(IUnknown *outer, void **ppv) +{ + MimeBody *mb; + + if(outer) + return CLASS_E_NOAGGREGATION; + + if ((mb = mimebody_create())) + { + *ppv = &mb->IMimeBody_iface; + return S_OK; + } + else + { + *ppv = NULL; + return E_OUTOFMEMORY; + } +} + + + typedef struct { IStreamVtbl *lpVtbl; @@ -1422,7 +1439,7 @@ typedef struct body_t { struct list entry; DWORD index; - IMimeBody *mime_body; + MimeBody *mime_body; struct body_t *parent; struct list children; @@ -1480,7 +1497,7 @@ static void empty_body_list(struct list *list) { empty_body_list(&body->children); list_remove(&body->entry); - IMimeBody_Release(body->mime_body); + IMimeBody_Release(&body->mime_body->IMimeBody_iface); HeapFree(GetProcessHeap(), 0, body); } } @@ -1520,7 +1537,7 @@ static HRESULT WINAPI MimeMessage_IsDirty( return E_NOTIMPL; } -static body_t *new_body_entry(IMimeBody *mime_body, DWORD index, body_t *parent) +static body_t *new_body_entry(MimeBody *mime_body, DWORD index, body_t *parent) { body_t *body = HeapAlloc(GetProcessHeap(), 0, sizeof(*body)); if(body) @@ -1625,28 +1642,29 @@ end: static body_t *create_sub_body(MimeMessage *msg, IStream *pStm, BODYOFFSETS *offset, body_t *parent) { - IMimeBody *mime_body; + MimeBody *mime_body; HRESULT hr; body_t *body; ULARGE_INTEGER cur; LARGE_INTEGER zero; - MimeBody_create(NULL, (void**)&mime_body); - IMimeBody_Load(mime_body, pStm); + mime_body = mimebody_create(); + IMimeBody_Load(&mime_body->IMimeBody_iface, pStm); zero.QuadPart = 0; hr = IStream_Seek(pStm, zero, STREAM_SEEK_CUR, &cur); offset->cbBodyStart = cur.u.LowPart + offset->cbHeaderStart; - if(parent) MimeBody_set_offsets(impl_from_IMimeBody(mime_body), offset); - IMimeBody_SetData(mime_body, IET_BINARY, NULL, NULL, &IID_IStream, pStm); + if (parent) MimeBody_set_offsets(mime_body, offset); + IMimeBody_SetData(&mime_body->IMimeBody_iface, IET_BINARY, NULL, NULL, &IID_IStream, pStm); body = new_body_entry(mime_body, msg->next_index++, parent); - if(IMimeBody_IsContentType(mime_body, "multipart", NULL) == S_OK) + if(IMimeBody_IsContentType(&mime_body->IMimeBody_iface, "multipart", NULL) == S_OK) { MIMEPARAMINFO *param_info; ULONG count, i; IMimeAllocator *alloc; - hr = IMimeBody_GetParameters(mime_body, "Content-Type", &count, ¶m_info); + hr = IMimeBody_GetParameters(&mime_body->IMimeBody_iface, "Content-Type", &count, + ¶m_info); if(hr != S_OK || count == 0) return body; MimeOleGetAllocator(&alloc); @@ -1708,7 +1726,7 @@ static HRESULT WINAPI MimeMessage_Load(IMimeMessage *iface, IStream *pStm) zero.QuadPart = 0; IStream_Seek(pStm, zero, STREAM_SEEK_END, &cur); offsets.cbBodyEnd = cur.u.LowPart; - MimeBody_set_offsets(impl_from_IMimeBody(root_body->mime_body), &offsets); + MimeBody_set_offsets(root_body->mime_body, &offsets); list_add_head(&This->body_tree, &root_body->entry); @@ -1842,8 +1860,8 @@ static HRESULT WINAPI MimeMessage_BindToObject(IMimeMessage *iface, const HBODY if(IsEqualIID(riid, &IID_IMimeBody)) { - IMimeBody_AddRef(body->mime_body); - *ppvObject = body->mime_body; + IMimeBody_AddRef(&body->mime_body->IMimeBody_iface); + *ppvObject = &body->mime_body->IMimeBody_iface; return S_OK; } @@ -2019,7 +2037,8 @@ static HRESULT find_next(MimeMessage *This, body_t *body, FINDBODY *find, HBODY body = LIST_ENTRY( ptr, body_t, entry ); next = UlongToHandle( body->index ); find->dwReserved = body->index; - if (IMimeBody_IsContentType(body->mime_body, find->pszPriType, find->pszSubType) == S_OK) + if (IMimeBody_IsContentType(&body->mime_body->IMimeBody_iface, find->pszPriType, + find->pszSubType) == S_OK) { *out = next; return S_OK;
1
0
0
0
Michael Stefaniuc : inetcomm: COM cleanup for the IMimeBody iface.
by Alexandre Julliard
04 Mar '13
04 Mar '13
Module: wine Branch: master Commit: 4e35ec47773ed9bb84180ec867a2a39b6278e4cb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4e35ec47773ed9bb84180ec86…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Mar 4 00:33:16 2013 +0100 inetcomm: COM cleanup for the IMimeBody iface. --- dlls/inetcomm/mimeole.c | 34 ++++++++++++++++++---------------- 1 files changed, 18 insertions(+), 16 deletions(-) diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c index c1fed51..58a4a5f 100644 --- a/dlls/inetcomm/mimeole.c +++ b/dlls/inetcomm/mimeole.c @@ -94,8 +94,8 @@ typedef struct typedef struct MimeBody { - const IMimeBodyVtbl *lpVtbl; - LONG refs; + IMimeBody IMimeBody_iface; + LONG ref; HBODY handle; @@ -110,9 +110,9 @@ typedef struct MimeBody BODYOFFSETS body_offsets; } MimeBody; -static inline MimeBody *impl_from_IMimeBody( IMimeBody *iface ) +static inline MimeBody *impl_from_IMimeBody(IMimeBody *iface) { - return (MimeBody *)((char*)iface - FIELD_OFFSET(MimeBody, lpVtbl)); + return CONTAINING_RECORD(iface, MimeBody, IMimeBody_iface); } static LPSTR strdupA(LPCSTR str) @@ -523,22 +523,24 @@ static HRESULT WINAPI MimeBody_QueryInterface(IMimeBody* iface, return E_NOINTERFACE; } -static ULONG WINAPI MimeBody_AddRef(IMimeBody* iface) +static ULONG WINAPI MimeBody_AddRef(IMimeBody *iface) { MimeBody *This = impl_from_IMimeBody(iface); - TRACE("(%p)->()\n", iface); - return InterlockedIncrement(&This->refs); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; } -static ULONG WINAPI MimeBody_Release(IMimeBody* iface) +static ULONG WINAPI MimeBody_Release(IMimeBody *iface) { MimeBody *This = impl_from_IMimeBody(iface); - ULONG refs; + LONG ref = InterlockedDecrement(&This->ref); - TRACE("(%p)->()\n", iface); + TRACE("(%p) ref=%d\n", This, ref); - refs = InterlockedDecrement(&This->refs); - if (!refs) + if (!ref) { empty_header_list(&This->headers); empty_new_prop_list(&This->new_props); @@ -551,7 +553,7 @@ static ULONG WINAPI MimeBody_Release(IMimeBody* iface) HeapFree(GetProcessHeap(), 0, This); } - return refs; + return ref; } static HRESULT WINAPI MimeBody_GetClassID( @@ -1109,8 +1111,8 @@ HRESULT MimeBody_create(IUnknown *outer, void **obj) This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &body_vtbl; - This->refs = 1; + This->IMimeBody_iface.lpVtbl = &body_vtbl; + This->ref = 1; This->handle = NULL; list_init(&This->headers); list_init(&This->new_props); @@ -1125,7 +1127,7 @@ HRESULT MimeBody_create(IUnknown *outer, void **obj) body_offsets.cbBodyStart = body_offsets.cbBodyEnd = 0; MimeBody_set_offsets(This, &body_offsets); - *obj = &This->lpVtbl; + *obj = &This->IMimeBody_iface; return S_OK; }
1
0
0
0
Michael Stefaniuc : inetcomm: Use a static interface instance for IMimeAllocator.
by Alexandre Julliard
04 Mar '13
04 Mar '13
Module: wine Branch: master Commit: 3a9d744f126c8bc0ab2708ef312149faecac8ad0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a9d744f126c8bc0ab2708ef3…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Mar 4 00:32:40 2013 +0100 inetcomm: Use a static interface instance for IMimeAllocator. --- dlls/inetcomm/mimeole.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c index 2b7a0f3..c1fed51 100644 --- a/dlls/inetcomm/mimeole.c +++ b/dlls/inetcomm/mimeole.c @@ -2778,11 +2778,6 @@ HRESULT WINAPI MimeOleCreateSecurity(IMimeSecurity **ppSecurity) return MimeSecurity_create(NULL, (void **)ppSecurity); } -typedef struct -{ - IMimeAllocatorVtbl *lpVtbl; -} MimeAllocator; - static HRESULT WINAPI MimeAlloc_QueryInterface( IMimeAllocator* iface, REFIID riid, @@ -2964,7 +2959,7 @@ static IMimeAllocatorVtbl mime_alloc_vtbl = MimeAlloc_PropVariantClear }; -static MimeAllocator mime_allocator = +static IMimeAllocator mime_allocator = { &mime_alloc_vtbl };
1
0
0
0
Michael Stefaniuc : inetcomm: COM cleanup for the IMimeSecurity iface.
by Alexandre Julliard
04 Mar '13
04 Mar '13
Module: wine Branch: master Commit: f44d66c6175240ad037021b9f15f39c652449112 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f44d66c6175240ad037021b9f…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Mar 4 00:31:56 2013 +0100 inetcomm: COM cleanup for the IMimeSecurity iface. --- dlls/inetcomm/mimeole.c | 55 +++++++++++++++++++++++------------------------ 1 files changed, 27 insertions(+), 28 deletions(-) diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c index d897d38..2b7a0f3 100644 --- a/dlls/inetcomm/mimeole.c +++ b/dlls/inetcomm/mimeole.c @@ -2592,54 +2592,53 @@ HRESULT WINAPI MimeOleCreateVirtualStream(IStream **ppStream) typedef struct MimeSecurity { - const IMimeSecurityVtbl *lpVtbl; - - LONG refs; + IMimeSecurity IMimeSecurity_iface; + LONG ref; } MimeSecurity; -static HRESULT WINAPI MimeSecurity_QueryInterface( - IMimeSecurity* iface, - REFIID riid, - void** obj) +static inline MimeSecurity *impl_from_IMimeSecurity(IMimeSecurity *iface) { - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), obj); + return CONTAINING_RECORD(iface, MimeSecurity, IMimeSecurity_iface); +} + +static HRESULT WINAPI MimeSecurity_QueryInterface(IMimeSecurity *iface, REFIID riid, void **ppv) +{ + TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IMimeSecurity)) { - *obj = iface; + *ppv = iface; IMimeSecurity_AddRef(iface); return S_OK; } FIXME("no interface for %s\n", debugstr_guid(riid)); - *obj = NULL; + *ppv = NULL; return E_NOINTERFACE; } -static ULONG WINAPI MimeSecurity_AddRef( - IMimeSecurity* iface) +static ULONG WINAPI MimeSecurity_AddRef(IMimeSecurity *iface) { - MimeSecurity *This = (MimeSecurity *)iface; - TRACE("(%p)->()\n", iface); - return InterlockedIncrement(&This->refs); + MimeSecurity *This = impl_from_IMimeSecurity(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; } -static ULONG WINAPI MimeSecurity_Release( - IMimeSecurity* iface) +static ULONG WINAPI MimeSecurity_Release(IMimeSecurity *iface) { - MimeSecurity *This = (MimeSecurity *)iface; - ULONG refs; + MimeSecurity *This = impl_from_IMimeSecurity(iface); + LONG ref = InterlockedDecrement(&This->ref); - TRACE("(%p)->()\n", iface); + TRACE("(%p) ref=%d\n", This, ref); - refs = InterlockedDecrement(&This->refs); - if (!refs) - { + if (!ref) HeapFree(GetProcessHeap(), 0, This); - } - return refs; + return ref; } static HRESULT WINAPI MimeSecurity_InitNew( @@ -2764,10 +2763,10 @@ HRESULT MimeSecurity_create(IUnknown *outer, void **obj) This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &MimeSecurityVtbl; - This->refs = 1; + This->IMimeSecurity_iface.lpVtbl = &MimeSecurityVtbl; + This->ref = 1; - *obj = &This->lpVtbl; + *obj = &This->IMimeSecurity_iface; return S_OK; }
1
0
0
0
Michael Stefaniuc : inetcomm: Pass the object instead of an iface to a helper function.
by Alexandre Julliard
04 Mar '13
04 Mar '13
Module: wine Branch: master Commit: d50b3b20682822d61a4605398723648b92fb0c64 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d50b3b20682822d61a4605398…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Mar 4 00:29:53 2013 +0100 inetcomm: Pass the object instead of an iface to a helper function. --- dlls/inetcomm/mimeole.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c index 3e23fc0..d897d38 100644 --- a/dlls/inetcomm/mimeole.c +++ b/dlls/inetcomm/mimeole.c @@ -1996,9 +1996,8 @@ static HRESULT WINAPI MimeMessage_CountBodies(IMimeMessage *iface, HBODY hParent return S_OK; } -static HRESULT find_next(IMimeMessage *msg, body_t *body, LPFINDBODY find, HBODY *out) +static HRESULT find_next(MimeMessage *This, body_t *body, FINDBODY *find, HBODY *out) { - MimeMessage *This = (MimeMessage *)msg; struct list *ptr; HBODY next; @@ -2027,15 +2026,14 @@ static HRESULT find_next(IMimeMessage *msg, body_t *body, LPFINDBODY find, HBODY return MIME_E_NOT_FOUND; } -static HRESULT WINAPI MimeMessage_FindFirst( - IMimeMessage *iface, - LPFINDBODY pFindBody, - LPHBODY phBody) +static HRESULT WINAPI MimeMessage_FindFirst(IMimeMessage *iface, FINDBODY *pFindBody, HBODY *phBody) { + MimeMessage *This = impl_from_IMimeMessage(iface); + TRACE("(%p)->(%p, %p)\n", iface, pFindBody, phBody); pFindBody->dwReserved = 0; - return find_next( iface, NULL, pFindBody, phBody ); + return find_next(This, NULL, pFindBody, phBody); } static HRESULT WINAPI MimeMessage_FindNext(IMimeMessage *iface, FINDBODY *pFindBody, HBODY *phBody) @@ -2048,7 +2046,7 @@ static HRESULT WINAPI MimeMessage_FindNext(IMimeMessage *iface, FINDBODY *pFindB hr = find_body( &This->body_tree, UlongToHandle( pFindBody->dwReserved ), &body ); if (hr != S_OK) return MIME_E_NOT_FOUND; - return find_next( iface, body, pFindBody, phBody ); + return find_next(This, body, pFindBody, phBody); } static HRESULT WINAPI MimeMessage_ResolveURL(
1
0
0
0
Michael Stefaniuc : inetcomm: COM cleanup for the IMimeMessage iface.
by Alexandre Julliard
04 Mar '13
04 Mar '13
Module: wine Branch: master Commit: f18d156352e9b7f9d7675fdd5846c8cbd7846c59 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f18d156352e9b7f9d7675fdd5…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Mon Mar 4 00:28:47 2013 +0100 inetcomm: COM cleanup for the IMimeMessage iface. --- dlls/inetcomm/mimeole.c | 85 +++++++++++++++++++++-------------------------- 1 files changed, 38 insertions(+), 47 deletions(-) diff --git a/dlls/inetcomm/mimeole.c b/dlls/inetcomm/mimeole.c index ac4142a..3e23fc0 100644 --- a/dlls/inetcomm/mimeole.c +++ b/dlls/inetcomm/mimeole.c @@ -1428,15 +1428,19 @@ typedef struct body_t typedef struct MimeMessage { - const IMimeMessageVtbl *lpVtbl; - - LONG refs; + IMimeMessage IMimeMessage_iface; + LONG ref; IStream *stream; struct list body_tree; DWORD next_index; } MimeMessage; +static inline MimeMessage *impl_from_IMimeMessage(IMimeMessage *iface) +{ + return CONTAINING_RECORD(iface, MimeMessage, IMimeMessage_iface); +} + static HRESULT WINAPI MimeMessage_QueryInterface(IMimeMessage *iface, REFIID riid, void **ppv) { TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); @@ -1459,9 +1463,12 @@ static HRESULT WINAPI MimeMessage_QueryInterface(IMimeMessage *iface, REFIID rii static ULONG WINAPI MimeMessage_AddRef(IMimeMessage *iface) { - MimeMessage *This = (MimeMessage *)iface; - TRACE("(%p)->()\n", iface); - return InterlockedIncrement(&This->refs); + MimeMessage *This = impl_from_IMimeMessage(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; } static void empty_body_list(struct list *list) @@ -1478,13 +1485,12 @@ static void empty_body_list(struct list *list) static ULONG WINAPI MimeMessage_Release(IMimeMessage *iface) { - MimeMessage *This = (MimeMessage *)iface; - ULONG refs; + MimeMessage *This = impl_from_IMimeMessage(iface); + ULONG ref = InterlockedDecrement(&This->ref); - TRACE("(%p)->()\n", iface); + TRACE("(%p) ref=%d\n", This, ref); - refs = InterlockedDecrement(&This->refs); - if (!refs) + if (!ref) { empty_body_list(&This->body_tree); @@ -1492,7 +1498,7 @@ static ULONG WINAPI MimeMessage_Release(IMimeMessage *iface) HeapFree(GetProcessHeap(), 0, This); } - return refs; + return ref; } /*** IPersist methods ***/ @@ -1674,11 +1680,9 @@ static body_t *create_sub_body(MimeMessage *msg, IStream *pStm, BODYOFFSETS *off return body; } -static HRESULT WINAPI MimeMessage_Load( - IMimeMessage *iface, - LPSTREAM pStm) +static HRESULT WINAPI MimeMessage_Load(IMimeMessage *iface, IStream *pStm) { - MimeMessage *This = (MimeMessage *)iface; + MimeMessage *This = impl_from_IMimeMessage(iface); body_t *root_body; BODYOFFSETS offsets; ULARGE_INTEGER cur; @@ -1734,12 +1738,11 @@ static HRESULT WINAPI MimeMessage_InitNew( } /*** IMimeMessageTree methods ***/ -static HRESULT WINAPI MimeMessage_GetMessageSource( - IMimeMessage *iface, - IStream **ppStream, - DWORD dwFlags) +static HRESULT WINAPI MimeMessage_GetMessageSource(IMimeMessage *iface, IStream **ppStream, + DWORD dwFlags) { - MimeMessage *This = (MimeMessage *)iface; + MimeMessage *This = impl_from_IMimeMessage(iface); + FIXME("(%p)->(%p, 0x%x)\n", iface, ppStream, dwFlags); IStream_AddRef(This->stream); @@ -1822,13 +1825,10 @@ static HRESULT find_body(struct list *list, HBODY hbody, body_t **body) return S_FALSE; } -static HRESULT WINAPI MimeMessage_BindToObject( - IMimeMessage *iface, - const HBODY hBody, - REFIID riid, - void **ppvObject) +static HRESULT WINAPI MimeMessage_BindToObject(IMimeMessage *iface, const HBODY hBody, REFIID riid, + void **ppvObject) { - MimeMessage *This = (MimeMessage *)iface; + MimeMessage *This = impl_from_IMimeMessage(iface); HRESULT hr; body_t *body; @@ -1933,13 +1933,10 @@ static HRESULT WINAPI MimeMessage_InsertBody( return E_NOTIMPL; } -static HRESULT WINAPI MimeMessage_GetBody( - IMimeMessage *iface, - BODYLOCATION location, - HBODY hPivot, - LPHBODY phBody) +static HRESULT WINAPI MimeMessage_GetBody(IMimeMessage *iface, BODYLOCATION location, HBODY hPivot, + HBODY *phBody) { - MimeMessage *This = (MimeMessage *)iface; + MimeMessage *This = impl_from_IMimeMessage(iface); body_t *body; HRESULT hr; @@ -1981,14 +1978,11 @@ static void count_children(body_t *body, boolean recurse, ULONG *count) } } -static HRESULT WINAPI MimeMessage_CountBodies( - IMimeMessage *iface, - HBODY hParent, - boolean fRecurse, - ULONG *pcBodies) +static HRESULT WINAPI MimeMessage_CountBodies(IMimeMessage *iface, HBODY hParent, boolean fRecurse, + ULONG *pcBodies) { HRESULT hr; - MimeMessage *This = (MimeMessage *)iface; + MimeMessage *This = impl_from_IMimeMessage(iface); body_t *body; TRACE("(%p)->(%p, %s, %p)\n", iface, hParent, fRecurse ? "TRUE" : "FALSE", pcBodies); @@ -2044,12 +2038,9 @@ static HRESULT WINAPI MimeMessage_FindFirst( return find_next( iface, NULL, pFindBody, phBody ); } -static HRESULT WINAPI MimeMessage_FindNext( - IMimeMessage *iface, - LPFINDBODY pFindBody, - LPHBODY phBody) +static HRESULT WINAPI MimeMessage_FindNext(IMimeMessage *iface, FINDBODY *pFindBody, HBODY *phBody) { - MimeMessage *This = (MimeMessage *)iface; + MimeMessage *This = impl_from_IMimeMessage(iface); body_t *body; HRESULT hr; @@ -2561,13 +2552,13 @@ HRESULT MimeMessage_create(IUnknown *outer, void **obj) This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); if (!This) return E_OUTOFMEMORY; - This->lpVtbl = &MimeMessageVtbl; - This->refs = 1; + This->IMimeMessage_iface.lpVtbl = &MimeMessageVtbl; + This->ref = 1; This->stream = NULL; list_init(&This->body_tree); This->next_index = 1; - *obj = &This->lpVtbl; + *obj = &This->IMimeMessage_iface; return S_OK; }
1
0
0
0
Nikolay Sivov : msxml3: CDATA nodes can't have children.
by Alexandre Julliard
04 Mar '13
04 Mar '13
Module: wine Branch: master Commit: 431e77bec4a022dbed0dc2ead80d20250193fdaf URL:
http://source.winehq.org/git/wine.git/?a=commit;h=431e77bec4a022dbed0dc2ead…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Mar 3 21:38:27 2013 +0400 msxml3: CDATA nodes can't have children. --- dlls/msxml3/cdata.c | 20 ++++++++++---------- dlls/msxml3/tests/domdoc.c | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c index 6b3c065..7fd4a37 100644 --- a/dlls/msxml3/cdata.c +++ b/dlls/msxml3/cdata.c @@ -290,10 +290,9 @@ static HRESULT WINAPI domcdata_insertBefore( IXMLDOMNode** outOldNode) { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); - - FIXME("(%p)->(%p %s %p) needs test\n", This, newNode, debugstr_variant(&refChild), outOldNode); - - return node_insert_before(&This->node, newNode, &refChild, outOldNode); + TRACE("(%p)->(%p %s %p)\n", This, newNode, debugstr_variant(&refChild), outOldNode); + if (outOldNode) *outOldNode = NULL; + return E_FAIL; } static HRESULT WINAPI domcdata_replaceChild( @@ -303,10 +302,9 @@ static HRESULT WINAPI domcdata_replaceChild( IXMLDOMNode** outOldNode) { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); - - FIXME("(%p)->(%p %p %p) needs tests\n", This, newNode, oldNode, outOldNode); - - return node_replace_child(&This->node, newNode, oldNode, outOldNode); + TRACE("(%p)->(%p %p %p)\n", This, newNode, oldNode, outOldNode); + if (outOldNode) *outOldNode = NULL; + return E_FAIL; } static HRESULT WINAPI domcdata_removeChild( @@ -315,7 +313,8 @@ static HRESULT WINAPI domcdata_removeChild( { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); TRACE("(%p)->(%p %p)\n", This, child, oldChild); - return node_remove_child(&This->node, child, oldChild); + if (oldChild) *oldChild = NULL; + return E_FAIL; } static HRESULT WINAPI domcdata_appendChild( @@ -324,7 +323,8 @@ static HRESULT WINAPI domcdata_appendChild( { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); TRACE("(%p)->(%p %p)\n", This, child, outChild); - return node_append_child(&This->node, child, outChild); + if (outChild) *outChild = NULL; + return E_FAIL; } static HRESULT WINAPI domcdata_hasChildNodes( diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 794df03..d69547f 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -8370,6 +8370,22 @@ static void test_insertBefore(void) ok(hr == S_OK, "got 0x%08x\n", hr); ok(cdata != NULL, "got %p\n", cdata); + EXPECT_NO_CHILDREN(cdata); + + /* attribute to cdata */ + V_VT(&v) = VT_NULL; + node = (void*)0xdeadbeef; + hr = IXMLDOMNode_insertBefore(cdata, (IXMLDOMNode*)attr, v, &node); + ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(node == NULL, "got %p\n", node); + + /* document to cdata */ + V_VT(&v) = VT_NULL; + node = (void*)0xdeadbeef; + hr = IXMLDOMNode_insertBefore(cdata, (IXMLDOMNode*)doc, v, &node); + ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(node == NULL, "got %p\n", node); + V_VT(&v) = VT_NULL; node = (void*)0xdeadbeef; hr = IXMLDOMDocument_insertBefore(doc3, cdata, v, &node);
1
0
0
0
← Newer
1
...
46
47
48
49
50
51
52
53
54
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Results per page:
10
25
50
100
200