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
May 2012
----- 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
737 discussions
Start a n
N
ew thread
Dmitry Timoshkov : gdiplus: Create 'const' friendly internal entries for font APIs.
by Alexandre Julliard
14 May '12
14 May '12
Module: wine Branch: master Commit: 5e4d64d18ed02639d4fec534f5d9cf6f1425b9f8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5e4d64d18ed02639d4fec534f…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Sat May 12 15:23:12 2012 +0900 gdiplus: Create 'const' friendly internal entries for font APIs. --- dlls/gdiplus/font.c | 102 +++++++++++++++++++++++++-------------- dlls/gdiplus/gdiplus_private.h | 2 + dlls/gdiplus/graphics.c | 5 +- dlls/gdiplus/graphicspath.c | 3 +- 4 files changed, 70 insertions(+), 42 deletions(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index 4b059a0..70ddef6 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -116,6 +116,8 @@ typedef struct #define MS_OS2_TAG MS_MAKE_TAG('O','S','/','2') #define MS_HHEA_TAG MS_MAKE_TAG('h','h','e','a') +static GpStatus clone_font_family(const GpFontFamily *, GpFontFamily **); + static const REAL mm_per_inch = 25.4; static const REAL inch_per_point = 1.0/72.0; @@ -216,7 +218,7 @@ GpStatus WINGDIPAPI GdipCreateFont(GDIPCONST GpFontFamily *fontFamily, (*font)->emSize = emSize; (*font)->otm = otm; - stat = GdipCloneFontFamily((GpFontFamily *)fontFamily, &(*font)->family); + stat = clone_font_family(fontFamily, &(*font)->family); if (stat != Ok) { GdipFree(*font); @@ -355,6 +357,11 @@ GpStatus WINGDIPAPI GdipGetFamily(GpFont *font, GpFontFamily **family) return GdipCloneFontFamily(font->family, family); } +static REAL get_font_size(const GpFont *font) +{ + return font->emSize; +} + /****************************************************************************** * GdipGetFontSize [GDIPLUS.@] * @@ -377,12 +384,30 @@ GpStatus WINGDIPAPI GdipGetFontSize(GpFont *font, REAL *size) if (!(font && size)) return InvalidParameter; - *size = font->emSize; + *size = get_font_size(font); TRACE("%s,%d => %f\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *size); return Ok; } +static INT get_font_style(const GpFont *font) +{ + INT style; + + if (font->otm.otmTextMetrics.tmWeight > FW_REGULAR) + style = FontStyleBold; + else + style = FontStyleRegular; + if (font->otm.otmTextMetrics.tmItalic) + style |= FontStyleItalic; + if (font->otm.otmTextMetrics.tmUnderlined) + style |= FontStyleUnderline; + if (font->otm.otmTextMetrics.tmStruckOut) + style |= FontStyleStrikeout; + + return style; +} + /******************************************************************************* * GdipGetFontStyle [GDIPLUS.@] * @@ -403,16 +428,8 @@ GpStatus WINGDIPAPI GdipGetFontStyle(GpFont *font, INT *style) if (!(font && style)) return InvalidParameter; - if (font->otm.otmTextMetrics.tmWeight > FW_REGULAR) - *style = FontStyleBold; - else - *style = FontStyleRegular; - if (font->otm.otmTextMetrics.tmItalic) - *style |= FontStyleItalic; - if (font->otm.otmTextMetrics.tmUnderlined) - *style |= FontStyleUnderline; - if (font->otm.otmTextMetrics.tmStruckOut) - *style |= FontStyleStrikeout; + *style = get_font_style(font); + TRACE("%s,%d => %d\n", debugstr_w(font->family->FamilyName), font->otm.otmTextMetrics.tmHeight, *style); return Ok; } @@ -463,6 +480,25 @@ GpStatus WINGDIPAPI GdipGetLogFontA(GpFont *font, GpGraphics *graphics, return Ok; } +void get_log_fontW(const GpFont *font, GpGraphics *graphics, LOGFONTW *lf) +{ + /* FIXME: use graphics */ + lf->lfHeight = -font->otm.otmTextMetrics.tmAscent; + lf->lfWidth = 0; + lf->lfEscapement = 0; + lf->lfOrientation = 0; + lf->lfWeight = font->otm.otmTextMetrics.tmWeight; + lf->lfItalic = font->otm.otmTextMetrics.tmItalic ? 1 : 0; + lf->lfUnderline = font->otm.otmTextMetrics.tmUnderlined ? 1 : 0; + lf->lfStrikeOut = font->otm.otmTextMetrics.tmStruckOut ? 1 : 0; + lf->lfCharSet = font->otm.otmTextMetrics.tmCharSet; + lf->lfOutPrecision = OUT_DEFAULT_PRECIS; + lf->lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf->lfQuality = DEFAULT_QUALITY; + lf->lfPitchAndFamily = 0; + strcpyW(lf->lfFaceName, font->family->FamilyName); +} + /******************************************************************************* * GdipGetLogFontW [GDIPLUS.@] */ @@ -471,25 +507,10 @@ GpStatus WINGDIPAPI GdipGetLogFontW(GpFont *font, GpGraphics *graphics, { TRACE("(%p, %p, %p)\n", font, graphics, lfw); - /* FIXME: use graphics */ if(!font || !graphics || !lfw) return InvalidParameter; - lfw->lfHeight = -font->otm.otmTextMetrics.tmAscent; - lfw->lfWidth = 0; - lfw->lfEscapement = 0; - lfw->lfOrientation = 0; - lfw->lfWeight = font->otm.otmTextMetrics.tmWeight; - lfw->lfItalic = font->otm.otmTextMetrics.tmItalic ? 1 : 0; - lfw->lfUnderline = font->otm.otmTextMetrics.tmUnderlined ? 1 : 0; - lfw->lfStrikeOut = font->otm.otmTextMetrics.tmStruckOut ? 1 : 0; - lfw->lfCharSet = font->otm.otmTextMetrics.tmCharSet; - lfw->lfOutPrecision = OUT_DEFAULT_PRECIS; - lfw->lfClipPrecision = CLIP_DEFAULT_PRECIS; - lfw->lfQuality = DEFAULT_QUALITY; - lfw->lfPitchAndFamily = 0; - strcpyW(lfw->lfFaceName, font->family->FamilyName); - + get_log_fontW(font, graphics, lfw); TRACE("=> %s,%d\n", debugstr_w(lfw->lfFaceName), lfw->lfHeight); return Ok; @@ -576,10 +597,8 @@ GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI(GDIPCONST GpFont *font, REAL dpi, TRACE("%p (%s), %f, %p\n", font, debugstr_w(font->family->FamilyName), dpi, height); - stat = GdipGetFontSize((GpFont *)font, &font_size); - if (stat != Ok) return stat; - stat = GdipGetFontStyle((GpFont *)font, &style); - if (stat != Ok) return stat; + font_size = get_font_size(font); + style = get_font_style(font); stat = GdipGetLineSpacing(font->family, style, &line_spacing); if (stat != Ok) return stat; stat = GdipGetEmHeight(font->family, style, &em_height); @@ -764,6 +783,16 @@ GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name, return Ok; } +static GpStatus clone_font_family(const GpFontFamily *family, GpFontFamily **clone) +{ + *clone = GdipAlloc(sizeof(GpFontFamily)); + if (!*clone) return OutOfMemory; + + **clone = *family; + + return Ok; +} + /******************************************************************************* * GdipCloneFontFamily [GDIPLUS.@] * @@ -778,16 +807,15 @@ GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name, */ GpStatus WINGDIPAPI GdipCloneFontFamily(GpFontFamily* FontFamily, GpFontFamily** clonedFontFamily) { + GpStatus status; + if (!(FontFamily && clonedFontFamily)) return InvalidParameter; TRACE("%p (%s), %p\n", FontFamily, debugstr_w(FontFamily->FamilyName), clonedFontFamily); - *clonedFontFamily = GdipAlloc(sizeof(GpFontFamily)); - if (!*clonedFontFamily) return OutOfMemory; - - **clonedFontFamily = *FontFamily; - lstrcpyW((*clonedFontFamily)->FamilyName, FontFamily->FamilyName); + status = clone_font_family(FontFamily, clonedFontFamily); + if (status != Ok) return status; TRACE("<-- %p\n", *clonedFontFamily); diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 1adfe09..df66903 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -436,4 +436,6 @@ GpStatus gdip_format_string(HDC hdc, GDIPCONST RectF *rect, GDIPCONST GpStringFormat *format, gdip_format_string_callback callback, void *user_data) DECLSPEC_HIDDEN; +void get_log_fontW(const GpFont *, GpGraphics *, LOGFONTW *) DECLSPEC_HIDDEN; + #endif diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 38335a8..e352e42 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2136,7 +2136,7 @@ void get_font_hfont(GpGraphics *graphics, GDIPCONST GpFont *font, HFONT *hfont) rel_height = sqrt((pt[2].Y-pt[0].Y)*(pt[2].Y-pt[0].Y)+ (pt[2].X-pt[0].X)*(pt[2].X-pt[0].X)); - GdipGetLogFontW((GpFont *)font, graphics, &lfw); + get_log_fontW(font, graphics, &lfw); lfw.lfHeight = roundr(lfw.lfHeight * rel_height); unscaled_font = CreateFontIndirectW(&lfw); @@ -4931,8 +4931,7 @@ GpStatus WINGDIPAPI GdipMeasureCharacterRanges(GpGraphics* graphics, if (regionCount < stringFormat->range_count) return InvalidParameter; - stat = GdipGetLogFontW((GpFont *)font, graphics, &lfw); - if (stat != Ok) return stat; + get_log_fontW(font, graphics, &lfw); if(!graphics->hdc) { diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 5da53b2..25cf6be 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -957,8 +957,7 @@ GpStatus WINGDIPAPI GdipAddPathString(GpPath* path, GDIPCONST WCHAR* string, INT if (status != Ok) return status; - status = GdipGetLogFontW((GpFont *)font, NULL, &lfw); - if (status != Ok) return status; + get_log_fontW(font, NULL, &lfw); hfont = CreateFontIndirectW(&lfw); if (!hfont) {
1
0
0
0
Owen Rudge : user32: Return Unicode length instead of ANSI in GetUserObjectInformationA.
by Alexandre Julliard
14 May '12
14 May '12
Module: wine Branch: master Commit: fecde1ead8260ddb89b74c00b367721cccd76173 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fecde1ead8260ddb89b74c00b…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Mon May 14 15:25:03 2012 +0100 user32: Return Unicode length instead of ANSI in GetUserObjectInformationA. --- dlls/user32/tests/winstation.c | 4 ++-- dlls/user32/winstation.c | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c index bd042f2..23a4311 100644 --- a/dlls/user32/tests/winstation.c +++ b/dlls/user32/tests/winstation.c @@ -397,7 +397,7 @@ static void test_getuserobjectinformation(void) ok(!ret, "GetUserObjectInformationA returned %x", ret); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); - todo_wine ok(size == 22, "size is set to %d\n", size); /* Windows returns Unicode length (11*2) */ + ok(size == 22, "size is set to %d\n", size); /* Windows returns Unicode length (11*2) */ /* Get string */ SetLastError(0xdeadbeef); @@ -439,7 +439,7 @@ static void test_getuserobjectinformation(void) ok(!ret, "GetUserObjectInformationA returned %x", ret); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); - todo_wine ok(size == 16, "size is set to %d\n", size); /* Windows returns Unicode length (8*2) */ + ok(size == 16, "size is set to %d\n", size); /* Windows returns Unicode length (8*2) */ /* Get string */ SetLastError(0xdeadbeef); diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c index 770245d..96b51179 100644 --- a/dlls/user32/winstation.c +++ b/dlls/user32/winstation.c @@ -477,13 +477,17 @@ BOOL WINAPI GetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DW if (index == UOI_TYPE || index == UOI_NAME) { WCHAR buffer[MAX_PATH]; - DWORD lenA; + DWORD lenA, lenW; - if (!GetUserObjectInformationW( handle, index, buffer, sizeof(buffer), NULL )) return FALSE; + if (!GetUserObjectInformationW( handle, index, buffer, sizeof(buffer), &lenW )) return FALSE; lenA = WideCharToMultiByte( CP_ACP, 0, buffer, -1, NULL, 0, NULL, NULL ); if (needed) *needed = lenA; if (lenA > len) { + /* If the buffer length supplied by the caller is insufficient, Windows returns a + 'needed' length based upon the Unicode byte length, so we should do similarly. */ + if (needed) *needed = lenW; + SetLastError( ERROR_INSUFFICIENT_BUFFER ); return FALSE; }
1
0
0
0
Owen Rudge : user32: Correct return value when buffer too short in GetUserObjectInformation.
by Alexandre Julliard
14 May '12
14 May '12
Module: wine Branch: master Commit: 83f67ff998097c92cb5d3eef128969d25c6588e5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=83f67ff998097c92cb5d3eef1…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Mon May 14 15:23:29 2012 +0100 user32: Correct return value when buffer too short in GetUserObjectInformation. --- dlls/user32/tests/winstation.c | 8 ++++---- dlls/user32/winstation.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c index e3836d3..bd042f2 100644 --- a/dlls/user32/tests/winstation.c +++ b/dlls/user32/tests/winstation.c @@ -396,7 +396,7 @@ static void test_getuserobjectinformation(void) ret = GetUserObjectInformationA(desk, UOI_NAME, NULL, 0, &size); ok(!ret, "GetUserObjectInformationA returned %x", ret); - todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); todo_wine ok(size == 22, "size is set to %d\n", size); /* Windows returns Unicode length (11*2) */ /* Get string */ @@ -416,7 +416,7 @@ static void test_getuserobjectinformation(void) ret = GetUserObjectInformationW(desk, UOI_NAME, NULL, 0, &size); ok(!ret, "GetUserObjectInformationW returned %x", ret); - todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); ok(size == 22, "size is set to %d\n", size); /* 22 bytes in 'foobarTest\0' in Unicode */ /* Get string (Unicode) */ @@ -438,7 +438,7 @@ static void test_getuserobjectinformation(void) ret = GetUserObjectInformationA(desk, UOI_TYPE, NULL, 0, &size); ok(!ret, "GetUserObjectInformationA returned %x", ret); - todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); todo_wine ok(size == 16, "size is set to %d\n", size); /* Windows returns Unicode length (8*2) */ /* Get string */ @@ -458,7 +458,7 @@ static void test_getuserobjectinformation(void) ret = GetUserObjectInformationW(desk, UOI_TYPE, NULL, 0, &size); ok(!ret, "GetUserObjectInformationW returned %x", ret); - todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); ok(size == 16, "size is set to %d\n", size); /* 16 bytes in 'Desktop\0' in Unicode */ /* Get string (Unicode) */ diff --git a/dlls/user32/winstation.c b/dlls/user32/winstation.c index 8126b31..770245d 100644 --- a/dlls/user32/winstation.c +++ b/dlls/user32/winstation.c @@ -484,7 +484,7 @@ BOOL WINAPI GetUserObjectInformationA( HANDLE handle, INT index, LPVOID info, DW if (needed) *needed = lenA; if (lenA > len) { - SetLastError( ERROR_MORE_DATA ); + SetLastError( ERROR_INSUFFICIENT_BUFFER ); return FALSE; } if (info) WideCharToMultiByte( CP_ACP, 0, buffer, -1, info, len, NULL, NULL ); @@ -541,7 +541,7 @@ BOOL WINAPI GetUserObjectInformationW( HANDLE handle, INT index, LPVOID info, DW if (needed) *needed = size; if (len < size) { - SetLastError( ERROR_MORE_DATA ); + SetLastError( ERROR_INSUFFICIENT_BUFFER ); ret = FALSE; } else memcpy( info, reply->is_desktop ? desktopW : winstationW, size ); @@ -567,7 +567,7 @@ BOOL WINAPI GetUserObjectInformationW( HANDLE handle, INT index, LPVOID info, DW if (needed) *needed = size; if (len < size) { - SetLastError( ERROR_MORE_DATA ); + SetLastError( ERROR_INSUFFICIENT_BUFFER ); ret = FALSE; } else memcpy( info, buffer, size );
1
0
0
0
Owen Rudge : user32/tests: Add GetUserObjectInformation tests.
by Alexandre Julliard
14 May '12
14 May '12
Module: wine Branch: master Commit: f443f29150e3381f57b289680f479465e8723e7e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f443f29150e3381f57b289680…
Author: Owen Rudge <owen(a)owenrudge.net> Date: Mon May 14 15:23:22 2012 +0100 user32/tests: Add GetUserObjectInformation tests. --- dlls/user32/tests/winstation.c | 105 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-) diff --git a/dlls/user32/tests/winstation.c b/dlls/user32/tests/winstation.c index 30eeff1..e3836d3 100644 --- a/dlls/user32/tests/winstation.c +++ b/dlls/user32/tests/winstation.c @@ -371,6 +371,110 @@ static void test_enumdesktops(void) ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n", GetLastError()); } +/* Miscellaneous tests */ + +static void test_getuserobjectinformation(void) +{ + HDESK desk; + WCHAR bufferW[20]; + char buffer[20]; + WCHAR foobarTestW[] = {'f','o','o','b','a','r','T','e','s','t',0}; + WCHAR DesktopW[] = {'D','e','s','k','t','o','p',0}; + DWORD size; + BOOL ret; + + desk = CreateDesktop("foobarTest", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL); + ok(desk != 0, "open foobarTest desktop failed\n"); + + strcpy(buffer, "blahblah"); + + /** Tests for UOI_NAME **/ + + /* Get size, test size and return value/error code */ + SetLastError(0xdeadbeef); + size = 0xdeadbeef; + ret = GetUserObjectInformationA(desk, UOI_NAME, NULL, 0, &size); + + ok(!ret, "GetUserObjectInformationA returned %x", ret); + todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); + todo_wine ok(size == 22, "size is set to %d\n", size); /* Windows returns Unicode length (11*2) */ + + /* Get string */ + SetLastError(0xdeadbeef); + size = 0xdeadbeef; + ret = GetUserObjectInformationA(desk, UOI_NAME, buffer, sizeof(buffer), &size); + + ok(ret, "GetUserObjectInformationA returned %x", ret); + ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n", GetLastError()); + + ok(strcmp(buffer, "foobarTest") == 0, "Buffer is set to '%s'\n", buffer); + ok(size == 11, "size is set to %d\n", size); /* 11 bytes in 'foobarTest\0' */ + + /* Get size, test size and return value/error code (Unicode) */ + SetLastError(0xdeadbeef); + size = 0xdeadbeef; + ret = GetUserObjectInformationW(desk, UOI_NAME, NULL, 0, &size); + + ok(!ret, "GetUserObjectInformationW returned %x", ret); + todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); + ok(size == 22, "size is set to %d\n", size); /* 22 bytes in 'foobarTest\0' in Unicode */ + + /* Get string (Unicode) */ + SetLastError(0xdeadbeef); + size = 0xdeadbeef; + ret = GetUserObjectInformationW(desk, UOI_NAME, bufferW, sizeof(bufferW), &size); + + ok(ret, "GetUserObjectInformationW returned %x", ret); + ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n", GetLastError()); + + ok(lstrcmpW(bufferW, foobarTestW) == 0, "Buffer is not set to 'foobarTest'\n"); + ok(size == 22, "size is set to %d\n", size); /* 22 bytes in 'foobarTest\0' in Unicode */ + + /** Tests for UOI_TYPE **/ + + /* Get size, test size and return value/error code */ + SetLastError(0xdeadbeef); + size = 0xdeadbeef; + ret = GetUserObjectInformationA(desk, UOI_TYPE, NULL, 0, &size); + + ok(!ret, "GetUserObjectInformationA returned %x", ret); + todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); + todo_wine ok(size == 16, "size is set to %d\n", size); /* Windows returns Unicode length (8*2) */ + + /* Get string */ + SetLastError(0xdeadbeef); + size = 0xdeadbeef; + ret = GetUserObjectInformationA(desk, UOI_TYPE, buffer, sizeof(buffer), &size); + + ok(ret, "GetUserObjectInformationA returned %x", ret); + ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n", GetLastError()); + + ok(strcmp(buffer, "Desktop") == 0, "Buffer is set to '%s'\n", buffer); + ok(size == 8, "size is set to %d\n", size); /* 8 bytes in 'Desktop\0' */ + + /* Get size, test size and return value/error code (Unicode) */ + size = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = GetUserObjectInformationW(desk, UOI_TYPE, NULL, 0, &size); + + ok(!ret, "GetUserObjectInformationW returned %x", ret); + todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "LastError is set to %08x\n", GetLastError()); + ok(size == 16, "size is set to %d\n", size); /* 16 bytes in 'Desktop\0' in Unicode */ + + /* Get string (Unicode) */ + SetLastError(0xdeadbeef); + size = 0xdeadbeef; + ret = GetUserObjectInformationW(desk, UOI_TYPE, bufferW, sizeof(bufferW), &size); + + ok(ret, "GetUserObjectInformationW returned %x", ret); + ok(GetLastError() == 0xdeadbeef, "LastError is set to %08x\n", GetLastError()); + + ok(lstrcmpW(bufferW, DesktopW) == 0, "Buffer is not set to 'Desktop'\n"); + ok(size == 16, "size is set to %d\n", size); /* 16 bytes in 'Desktop\0' in Unicode */ + + ok(CloseDesktop(desk), "CloseDesktop failed\n"); +} + START_TEST(winstation) { /* Check whether this platform supports WindowStation calls */ @@ -386,4 +490,5 @@ START_TEST(winstation) test_enumstations(); test_enumdesktops(); test_handles(); + test_getuserobjectinformation(); }
1
0
0
0
Vincent Povirk : windowscodecs: Add wrapper functions for IWICBitmapDecoder methods.
by Alexandre Julliard
14 May '12
14 May '12
Module: wine Branch: master Commit: 6ca8e889d04c312d8cc0b006bc5c660d091d4fe1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6ca8e889d04c312d8cc0b006b…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue May 8 11:23:25 2012 -0500 windowscodecs: Add wrapper functions for IWICBitmapDecoder methods. --- dlls/windowscodecs/proxy.c | 48 +++++++++++++++++++++++++++++++++ dlls/windowscodecs/windowscodecs.spec | 16 +++++----- 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/dlls/windowscodecs/proxy.c b/dlls/windowscodecs/proxy.c index 150983f..082bc0c 100644 --- a/dlls/windowscodecs/proxy.c +++ b/dlls/windowscodecs/proxy.c @@ -84,6 +84,54 @@ HRESULT WINAPI IWICBitmapCodecInfo_DoesSupportMultiframe_Proxy_W(IWICBitmapCodec return IWICBitmapCodecInfo_DoesSupportMultiframe(iface, pfSupportMultiframe); } +HRESULT WINAPI IWICBitmapDecoder_GetDecoderInfo_Proxy_W(IWICBitmapDecoder *iface, + IWICBitmapDecoderInfo **ppIDecoderInfo) +{ + return IWICBitmapDecoder_GetDecoderInfo(iface, ppIDecoderInfo); +} + +HRESULT WINAPI IWICBitmapDecoder_CopyPalette_Proxy_W(IWICBitmapDecoder *iface, + IWICPalette *pIPalette) +{ + return IWICBitmapDecoder_CopyPalette(iface, pIPalette); +} + +HRESULT WINAPI IWICBitmapDecoder_GetMetadataQueryReader_Proxy_W(IWICBitmapDecoder *iface, + IWICMetadataQueryReader **ppIMetadataQueryReader) +{ + return IWICBitmapDecoder_GetMetadataQueryReader(iface, ppIMetadataQueryReader); +} + +HRESULT WINAPI IWICBitmapDecoder_GetPreview_Proxy_W(IWICBitmapDecoder *iface, + IWICBitmapSource **ppIBitmapSource) +{ + return IWICBitmapDecoder_GetPreview(iface, ppIBitmapSource); +} + +HRESULT WINAPI IWICBitmapDecoder_GetColorContexts_Proxy_W(IWICBitmapDecoder *iface, + UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount) +{ + return IWICBitmapDecoder_GetColorContexts(iface, cCount, ppIColorContexts, pcActualCount); +} + +HRESULT WINAPI IWICBitmapDecoder_GetThumbnail_Proxy_W(IWICBitmapDecoder *iface, + IWICBitmapSource **ppIThumbnail) +{ + return IWICBitmapDecoder_GetThumbnail(iface, ppIThumbnail); +} + +HRESULT WINAPI IWICBitmapDecoder_GetFrameCount_Proxy_W(IWICBitmapDecoder *iface, + UINT *pCount) +{ + return IWICBitmapDecoder_GetFrameCount(iface, pCount); +} + +HRESULT WINAPI IWICBitmapDecoder_GetFrame_Proxy_W(IWICBitmapDecoder *iface, + UINT index, IWICBitmapFrameDecode **ppIBitmapFrame) +{ + return IWICBitmapDecoder_GetFrame(iface, index, ppIBitmapFrame); +} + HRESULT WINAPI IWICBitmapFlipRotator_Initialize_Proxy_W(IWICBitmapFlipRotator *iface, IWICBitmapSource *pISource, WICBitmapTransformOptions options) { diff --git a/dlls/windowscodecs/windowscodecs.spec b/dlls/windowscodecs/windowscodecs.spec index aecd87f..4ae0c41 100644 --- a/dlls/windowscodecs/windowscodecs.spec +++ b/dlls/windowscodecs/windowscodecs.spec @@ -14,14 +14,14 @@ @ stdcall IWICBitmapCodecInfo_GetDeviceModels_Proxy(ptr long ptr ptr) IWICBitmapCodecInfo_GetDeviceModels_Proxy_W @ stdcall IWICBitmapCodecInfo_GetFileExtensions_Proxy(ptr long ptr ptr) IWICBitmapCodecInfo_GetFileExtensions_Proxy_W @ stdcall IWICBitmapCodecInfo_GetMimeTypes_Proxy(ptr long ptr ptr) IWICBitmapCodecInfo_GetMimeTypes_Proxy_W -@ stub IWICBitmapDecoder_CopyPalette_Proxy -@ stub IWICBitmapDecoder_GetColorContexts_Proxy -@ stub IWICBitmapDecoder_GetDecoderInfo_Proxy -@ stub IWICBitmapDecoder_GetFrameCount_Proxy -@ stub IWICBitmapDecoder_GetFrame_Proxy -@ stub IWICBitmapDecoder_GetMetadataQueryReader_Proxy -@ stub IWICBitmapDecoder_GetPreview_Proxy -@ stub IWICBitmapDecoder_GetThumbnail_Proxy +@ stdcall IWICBitmapDecoder_CopyPalette_Proxy(ptr ptr) IWICBitmapDecoder_CopyPalette_Proxy_W +@ stdcall IWICBitmapDecoder_GetColorContexts_Proxy(ptr long ptr ptr) IWICBitmapDecoder_GetColorContexts_Proxy_W +@ stdcall IWICBitmapDecoder_GetDecoderInfo_Proxy(ptr ptr) IWICBitmapDecoder_GetDecoderInfo_Proxy_W +@ stdcall IWICBitmapDecoder_GetFrameCount_Proxy(ptr ptr) IWICBitmapDecoder_GetFrameCount_Proxy_W +@ stdcall IWICBitmapDecoder_GetFrame_Proxy(ptr long ptr) IWICBitmapDecoder_GetFrame_Proxy_W +@ stdcall IWICBitmapDecoder_GetMetadataQueryReader_Proxy(ptr ptr) IWICBitmapDecoder_GetMetadataQueryReader_Proxy_W +@ stdcall IWICBitmapDecoder_GetPreview_Proxy(ptr ptr) IWICBitmapDecoder_GetPreview_Proxy_W +@ stdcall IWICBitmapDecoder_GetThumbnail_Proxy(ptr ptr) IWICBitmapDecoder_GetThumbnail_Proxy_W @ stub IWICBitmapEncoder_Commit_Proxy @ stub IWICBitmapEncoder_CreateNewFrame_Proxy @ stub IWICBitmapEncoder_GetEncoderInfo_Proxy
1
0
0
0
Vincent Povirk : windowscodecs: Add wrapper functions for IWICBitmapCodecInfo methods.
by Alexandre Julliard
14 May '12
14 May '12
Module: wine Branch: master Commit: 1d9106bafc66fc9c909365d0e42980f962853390 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1d9106bafc66fc9c909365d0e…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue May 8 11:16:12 2012 -0500 windowscodecs: Add wrapper functions for IWICBitmapCodecInfo methods. --- dlls/windowscodecs/proxy.c | 48 +++++++++++++++++++++++++++++++++ dlls/windowscodecs/windowscodecs.spec | 16 +++++----- 2 files changed, 56 insertions(+), 8 deletions(-) diff --git a/dlls/windowscodecs/proxy.c b/dlls/windowscodecs/proxy.c index 68f0eff..150983f 100644 --- a/dlls/windowscodecs/proxy.c +++ b/dlls/windowscodecs/proxy.c @@ -36,6 +36,54 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); +HRESULT WINAPI IWICBitmapCodecInfo_GetContainerFormat_Proxy_W(IWICBitmapCodecInfo *iface, + GUID *pguidContainerFormat) +{ + return IWICBitmapCodecInfo_GetContainerFormat(iface, pguidContainerFormat); +} + +HRESULT WINAPI IWICBitmapCodecInfo_GetDeviceManufacturer_Proxy_W(IWICBitmapCodecInfo *iface, + UINT cchDeviceManufacturer, WCHAR *wzDeviceManufacturer, UINT *pcchActual) +{ + return IWICBitmapCodecInfo_GetDeviceManufacturer(iface, cchDeviceManufacturer, wzDeviceManufacturer, pcchActual); +} + +HRESULT WINAPI IWICBitmapCodecInfo_GetDeviceModels_Proxy_W(IWICBitmapCodecInfo *iface, + UINT cchDeviceModels, WCHAR *wzDeviceModels, UINT *pcchActual) +{ + return IWICBitmapCodecInfo_GetDeviceModels(iface, cchDeviceModels, wzDeviceModels, pcchActual); +} + +HRESULT WINAPI IWICBitmapCodecInfo_GetMimeTypes_Proxy_W(IWICBitmapCodecInfo *iface, + UINT cchMimeTypes, WCHAR *wzMimeTypes, UINT *pcchActual) +{ + return IWICBitmapCodecInfo_GetMimeTypes(iface, cchMimeTypes, wzMimeTypes, pcchActual); +} + +HRESULT WINAPI IWICBitmapCodecInfo_GetFileExtensions_Proxy_W(IWICBitmapCodecInfo *iface, + UINT cchFileExtensions, WCHAR *wzFileExtensions, UINT *pcchActual) +{ + return IWICBitmapCodecInfo_GetFileExtensions(iface, cchFileExtensions, wzFileExtensions, pcchActual); +} + +HRESULT WINAPI IWICBitmapCodecInfo_DoesSupportAnimation_Proxy_W(IWICBitmapCodecInfo *iface, + BOOL *pfSupportAnimation) +{ + return IWICBitmapCodecInfo_DoesSupportAnimation(iface, pfSupportAnimation); +} + +HRESULT WINAPI IWICBitmapCodecInfo_DoesSupportLossless_Proxy_W(IWICBitmapCodecInfo *iface, + BOOL *pfSupportLossless) +{ + return IWICBitmapCodecInfo_DoesSupportLossless(iface, pfSupportLossless); +} + +HRESULT WINAPI IWICBitmapCodecInfo_DoesSupportMultiframe_Proxy_W(IWICBitmapCodecInfo *iface, + BOOL *pfSupportMultiframe) +{ + return IWICBitmapCodecInfo_DoesSupportMultiframe(iface, pfSupportMultiframe); +} + HRESULT WINAPI IWICBitmapFlipRotator_Initialize_Proxy_W(IWICBitmapFlipRotator *iface, IWICBitmapSource *pISource, WICBitmapTransformOptions options) { diff --git a/dlls/windowscodecs/windowscodecs.spec b/dlls/windowscodecs/windowscodecs.spec index 37c365c..aecd87f 100644 --- a/dlls/windowscodecs/windowscodecs.spec +++ b/dlls/windowscodecs/windowscodecs.spec @@ -6,14 +6,14 @@ @ stub IEnumString_Reset_WIC_Proxy @ stub IPropertyBag2_Write_Proxy @ stub IWICBitmapClipper_Initialize_Proxy -@ stub IWICBitmapCodecInfo_DoesSupportAnimation_Proxy -@ stub IWICBitmapCodecInfo_DoesSupportLossless_Proxy -@ stub IWICBitmapCodecInfo_DoesSupportMultiframe_Proxy -@ stub IWICBitmapCodecInfo_GetContainerFormat_Proxy -@ stub IWICBitmapCodecInfo_GetDeviceManufacturer_Proxy -@ stub IWICBitmapCodecInfo_GetDeviceModels_Proxy -@ stub IWICBitmapCodecInfo_GetFileExtensions_Proxy -@ stub IWICBitmapCodecInfo_GetMimeTypes_Proxy +@ stdcall IWICBitmapCodecInfo_DoesSupportAnimation_Proxy(ptr ptr) IWICBitmapCodecInfo_DoesSupportAnimation_Proxy_W +@ stdcall IWICBitmapCodecInfo_DoesSupportLossless_Proxy(ptr ptr) IWICBitmapCodecInfo_DoesSupportLossless_Proxy_W +@ stdcall IWICBitmapCodecInfo_DoesSupportMultiframe_Proxy(ptr ptr) IWICBitmapCodecInfo_DoesSupportMultiframe_Proxy_W +@ stdcall IWICBitmapCodecInfo_GetContainerFormat_Proxy(ptr ptr) IWICBitmapCodecInfo_GetContainerFormat_Proxy_W +@ stdcall IWICBitmapCodecInfo_GetDeviceManufacturer_Proxy(ptr long ptr ptr) IWICBitmapCodecInfo_GetDeviceManufacturer_Proxy_W +@ stdcall IWICBitmapCodecInfo_GetDeviceModels_Proxy(ptr long ptr ptr) IWICBitmapCodecInfo_GetDeviceModels_Proxy_W +@ stdcall IWICBitmapCodecInfo_GetFileExtensions_Proxy(ptr long ptr ptr) IWICBitmapCodecInfo_GetFileExtensions_Proxy_W +@ stdcall IWICBitmapCodecInfo_GetMimeTypes_Proxy(ptr long ptr ptr) IWICBitmapCodecInfo_GetMimeTypes_Proxy_W @ stub IWICBitmapDecoder_CopyPalette_Proxy @ stub IWICBitmapDecoder_GetColorContexts_Proxy @ stub IWICBitmapDecoder_GetDecoderInfo_Proxy
1
0
0
0
Vincent Povirk : windowscodecs: Add wrapper functions for IWICBitmapFrameDecode methods.
by Alexandre Julliard
14 May '12
14 May '12
Module: wine Branch: master Commit: c498a0b0761397d77261d9864747a925c401a385 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c498a0b0761397d77261d9864…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue May 8 11:08:14 2012 -0500 windowscodecs: Add wrapper functions for IWICBitmapFrameDecode methods. --- dlls/windowscodecs/proxy.c | 18 ++++++++++++++++++ dlls/windowscodecs/windowscodecs.spec | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/dlls/windowscodecs/proxy.c b/dlls/windowscodecs/proxy.c index 969fdcb..68f0eff 100644 --- a/dlls/windowscodecs/proxy.c +++ b/dlls/windowscodecs/proxy.c @@ -149,6 +149,24 @@ HRESULT WINAPI IWICFastMetadataEncoder_GetMetadataQueryWriter_Proxy_W(IWICFastMe return IWICFastMetadataEncoder_GetMetadataQueryWriter(iface, ppIMetadataQueryWriter); } +HRESULT WINAPI IWICBitmapFrameDecode_GetMetadataQueryReader_Proxy_W(IWICBitmapFrameDecode *iface, + IWICMetadataQueryReader **ppIMetadataQueryReader) +{ + return IWICBitmapFrameDecode_GetMetadataQueryReader(iface, ppIMetadataQueryReader); +} + +HRESULT WINAPI IWICBitmapFrameDecode_GetColorContexts_Proxy_W(IWICBitmapFrameDecode *iface, + UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount) +{ + return IWICBitmapFrameDecode_GetColorContexts(iface, cCount, ppIColorContexts, pcActualCount); +} + +HRESULT WINAPI IWICBitmapFrameDecode_GetThumbnail_Proxy_W(IWICBitmapFrameDecode *iface, + IWICBitmapSource **ppIThumbnail) +{ + return IWICBitmapFrameDecode_GetThumbnail(iface, ppIThumbnail); +} + HRESULT WINAPI IWICImagingFactory_CreateBitmapClipper_Proxy_W(IWICImagingFactory *pFactory, IWICBitmapClipper **ppIBitmapClipper) { diff --git a/dlls/windowscodecs/windowscodecs.spec b/dlls/windowscodecs/windowscodecs.spec index c0dfead..37c365c 100644 --- a/dlls/windowscodecs/windowscodecs.spec +++ b/dlls/windowscodecs/windowscodecs.spec @@ -30,9 +30,9 @@ @ stub IWICBitmapEncoder_SetPalette_Proxy @ stub IWICBitmapEncoder_SetThumbnail_Proxy @ stdcall IWICBitmapFlipRotator_Initialize_Proxy(ptr ptr long) IWICBitmapFlipRotator_Initialize_Proxy_W -@ stub IWICBitmapFrameDecode_GetColorContexts_Proxy -@ stub IWICBitmapFrameDecode_GetMetadataQueryReader_Proxy -@ stub IWICBitmapFrameDecode_GetThumbnail_Proxy +@ stdcall IWICBitmapFrameDecode_GetColorContexts_Proxy(ptr long ptr ptr) IWICBitmapFrameDecode_GetColorContexts_Proxy_W +@ stdcall IWICBitmapFrameDecode_GetMetadataQueryReader_Proxy(ptr ptr) IWICBitmapFrameDecode_GetMetadataQueryReader_Proxy_W +@ stdcall IWICBitmapFrameDecode_GetThumbnail_Proxy(ptr ptr) IWICBitmapFrameDecode_GetThumbnail_Proxy_W @ stub IWICBitmapFrameEncode_Commit_Proxy @ stub IWICBitmapFrameEncode_GetMetadataQueryWriter_Proxy @ stub IWICBitmapFrameEncode_Initialize_Proxy
1
0
0
0
Vincent Povirk : windowscodecs: Add wrapper functions for IWICMetadataQueryWriter methods.
by Alexandre Julliard
14 May '12
14 May '12
Module: wine Branch: master Commit: 3d647659f541fcdd29b38f425241de8101708120 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3d647659f541fcdd29b38f425…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue May 8 11:04:29 2012 -0500 windowscodecs: Add wrapper functions for IWICMetadataQueryWriter methods. --- dlls/windowscodecs/proxy.c | 12 ++++++++++++ dlls/windowscodecs/windowscodecs.spec | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/proxy.c b/dlls/windowscodecs/proxy.c index aa1f08b..969fdcb 100644 --- a/dlls/windowscodecs/proxy.c +++ b/dlls/windowscodecs/proxy.c @@ -301,6 +301,18 @@ HRESULT WINAPI IWICMetadataQueryReader_GetEnumerator_Proxy_W(IWICMetadataQueryRe return IWICMetadataQueryReader_GetEnumerator(iface, ppIEnumString); } +HRESULT WINAPI IWICMetadataQueryWriter_SetMetadataByName_Proxy_W(IWICMetadataQueryWriter *iface, + LPCWSTR wzName, const PROPVARIANT *pvarValue) +{ + return IWICMetadataQueryWriter_SetMetadataByName(iface, wzName, pvarValue); +} + +HRESULT WINAPI IWICMetadataQueryWriter_RemoveMetadataByName_Proxy_W(IWICMetadataQueryWriter *iface, + LPCWSTR wzName) +{ + return IWICMetadataQueryWriter_RemoveMetadataByName(iface, wzName); +} + HRESULT WINAPI IWICPalette_InitializePredefined_Proxy_W(IWICPalette *iface, WICBitmapPaletteType ePaletteType, BOOL fAddTransparentColor) { diff --git a/dlls/windowscodecs/windowscodecs.spec b/dlls/windowscodecs/windowscodecs.spec index 3629bad..c0dfead 100644 --- a/dlls/windowscodecs/windowscodecs.spec +++ b/dlls/windowscodecs/windowscodecs.spec @@ -89,8 +89,8 @@ @ stdcall IWICMetadataQueryReader_GetEnumerator_Proxy(ptr ptr) IWICMetadataQueryReader_GetEnumerator_Proxy_W @ stdcall IWICMetadataQueryReader_GetLocation_Proxy(ptr long ptr ptr) IWICMetadataQueryReader_GetLocation_Proxy_W @ stdcall IWICMetadataQueryReader_GetMetadataByName_Proxy(ptr wstr ptr) IWICMetadataQueryReader_GetMetadataByName_Proxy_W -@ stub IWICMetadataQueryWriter_RemoveMetadataByName_Proxy -@ stub IWICMetadataQueryWriter_SetMetadataByName_Proxy +@ stdcall IWICMetadataQueryWriter_RemoveMetadataByName_Proxy(ptr wstr) IWICMetadataQueryWriter_RemoveMetadataByName_Proxy_W +@ stdcall IWICMetadataQueryWriter_SetMetadataByName_Proxy(ptr wstr ptr) IWICMetadataQueryWriter_SetMetadataByName_Proxy_W @ stdcall IWICPalette_GetColorCount_Proxy(ptr ptr) IWICPalette_GetColorCount_Proxy_W @ stdcall IWICPalette_GetColors_Proxy(ptr long ptr ptr) IWICPalette_GetColors_Proxy_W @ stdcall IWICPalette_GetType_Proxy(ptr ptr) IWICPalette_GetType_Proxy_W
1
0
0
0
Vincent Povirk : windowscodecs: Add wrapper functions for IWICMetadataQueryReader methods.
by Alexandre Julliard
14 May '12
14 May '12
Module: wine Branch: master Commit: 536b208cb1bb985a1f96ea3c957cd335fd5f99f0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=536b208cb1bb985a1f96ea3c9…
Author: Vincent Povirk <vincent(a)codeweavers.com> Date: Tue May 8 11:01:10 2012 -0500 windowscodecs: Add wrapper functions for IWICMetadataQueryReader methods. --- dlls/windowscodecs/proxy.c | 24 ++++++++++++++++++++++++ dlls/windowscodecs/windowscodecs.spec | 8 ++++---- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/dlls/windowscodecs/proxy.c b/dlls/windowscodecs/proxy.c index c1c99ca..aa1f08b 100644 --- a/dlls/windowscodecs/proxy.c +++ b/dlls/windowscodecs/proxy.c @@ -277,6 +277,30 @@ HRESULT WINAPI IWICImagingFactory_CreateStream_Proxy_W(IWICImagingFactory *pFact return IWICImagingFactory_CreateStream(pFactory, ppIWICStream); } +HRESULT WINAPI IWICMetadataQueryReader_GetContainerFormat_Proxy_W(IWICMetadataQueryReader *iface, + GUID *pguidContainerFormat) +{ + return IWICMetadataQueryReader_GetContainerFormat(iface, pguidContainerFormat); +} + +HRESULT WINAPI IWICMetadataQueryReader_GetLocation_Proxy_W(IWICMetadataQueryReader *iface, + UINT cchMaxLength, WCHAR *wzNamespace, UINT *pcchActualLength) +{ + return IWICMetadataQueryReader_GetLocation(iface, cchMaxLength, wzNamespace, pcchActualLength); +} + +HRESULT WINAPI IWICMetadataQueryReader_GetMetadataByName_Proxy_W(IWICMetadataQueryReader *iface, + LPCWSTR wzName, PROPVARIANT *pvarValue) +{ + return IWICMetadataQueryReader_GetMetadataByName(iface, wzName, pvarValue); +} + +HRESULT WINAPI IWICMetadataQueryReader_GetEnumerator_Proxy_W(IWICMetadataQueryReader *iface, + IEnumString **ppIEnumString) +{ + return IWICMetadataQueryReader_GetEnumerator(iface, ppIEnumString); +} + HRESULT WINAPI IWICPalette_InitializePredefined_Proxy_W(IWICPalette *iface, WICBitmapPaletteType ePaletteType, BOOL fAddTransparentColor) { diff --git a/dlls/windowscodecs/windowscodecs.spec b/dlls/windowscodecs/windowscodecs.spec index 930f2c4..3629bad 100644 --- a/dlls/windowscodecs/windowscodecs.spec +++ b/dlls/windowscodecs/windowscodecs.spec @@ -85,10 +85,10 @@ @ stdcall IWICImagingFactory_CreateStream_Proxy(ptr ptr) IWICImagingFactory_CreateStream_Proxy_W @ stub IWICMetadataBlockReader_GetCount_Proxy @ stub IWICMetadataBlockReader_GetReaderByIndex_Proxy -@ stub IWICMetadataQueryReader_GetContainerFormat_Proxy -@ stub IWICMetadataQueryReader_GetEnumerator_Proxy -@ stub IWICMetadataQueryReader_GetLocation_Proxy -@ stub IWICMetadataQueryReader_GetMetadataByName_Proxy +@ stdcall IWICMetadataQueryReader_GetContainerFormat_Proxy(ptr ptr) IWICMetadataQueryReader_GetContainerFormat_Proxy_W +@ stdcall IWICMetadataQueryReader_GetEnumerator_Proxy(ptr ptr) IWICMetadataQueryReader_GetEnumerator_Proxy_W +@ stdcall IWICMetadataQueryReader_GetLocation_Proxy(ptr long ptr ptr) IWICMetadataQueryReader_GetLocation_Proxy_W +@ stdcall IWICMetadataQueryReader_GetMetadataByName_Proxy(ptr wstr ptr) IWICMetadataQueryReader_GetMetadataByName_Proxy_W @ stub IWICMetadataQueryWriter_RemoveMetadataByName_Proxy @ stub IWICMetadataQueryWriter_SetMetadataByName_Proxy @ stdcall IWICPalette_GetColorCount_Proxy(ptr ptr) IWICPalette_GetColorCount_Proxy_W
1
0
0
0
Nikolay Sivov : msxml3: Support iso-8859-x encodings in writer.
by Alexandre Julliard
14 May '12
14 May '12
Module: wine Branch: master Commit: 320d419be1fe713c50eac7d53e4dc52481fad8b7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=320d419be1fe713c50eac7d53…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon May 14 16:46:32 2012 +0400 msxml3: Support iso-8859-x encodings in writer. --- dlls/msxml3/mxwriter.c | 35 ++++++++++++++++++-- dlls/msxml3/tests/saxreader.c | 70 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+), 4 deletions(-) diff --git a/dlls/msxml3/mxwriter.c b/dlls/msxml3/mxwriter.c index c5ecf37..81d498e 100644 --- a/dlls/msxml3/mxwriter.c +++ b/dlls/msxml3/mxwriter.c @@ -46,7 +46,16 @@ static const WCHAR quotW[] = {'\"'}; /* should be ordered as encoding names are sorted */ typedef enum { - XmlEncoding_UTF16 = 0, + XmlEncoding_ISO_8859_1 = 0, + XmlEncoding_ISO_8859_13, + XmlEncoding_ISO_8859_15, + XmlEncoding_ISO_8859_2, + XmlEncoding_ISO_8859_3, + XmlEncoding_ISO_8859_4, + XmlEncoding_ISO_8859_5, + XmlEncoding_ISO_8859_7, + XmlEncoding_ISO_8859_9, + XmlEncoding_UTF16, XmlEncoding_UTF8, XmlEncoding_Unknown } xml_encoding; @@ -58,12 +67,30 @@ struct xml_encoding_data UINT cp; }; +static const WCHAR iso_8859_1W[] = {'i','s','o','-','8','8','5','9','-','1',0}; +static const WCHAR iso_8859_2W[] = {'i','s','o','-','8','8','5','9','-','2',0}; +static const WCHAR iso_8859_3W[] = {'i','s','o','-','8','8','5','9','-','3',0}; +static const WCHAR iso_8859_4W[] = {'i','s','o','-','8','8','5','9','-','4',0}; +static const WCHAR iso_8859_5W[] = {'i','s','o','-','8','8','5','9','-','5',0}; +static const WCHAR iso_8859_7W[] = {'i','s','o','-','8','8','5','9','-','7',0}; +static const WCHAR iso_8859_9W[] = {'i','s','o','-','8','8','5','9','-','9',0}; +static const WCHAR iso_8859_13W[] = {'i','s','o','-','8','8','5','9','-','1','3',0}; +static const WCHAR iso_8859_15W[] = {'i','s','o','-','8','8','5','9','-','1','5',0}; static const WCHAR utf16W[] = {'U','T','F','-','1','6',0}; static const WCHAR utf8W[] = {'U','T','F','-','8',0}; static const struct xml_encoding_data xml_encoding_map[] = { - { utf16W, XmlEncoding_UTF16, ~0 }, /* there's no codepage for this case */ - { utf8W, XmlEncoding_UTF8, CP_UTF8 } + { iso_8859_1W, XmlEncoding_ISO_8859_1, 28591 }, + { iso_8859_13W, XmlEncoding_ISO_8859_13, 28603 }, + { iso_8859_15W, XmlEncoding_ISO_8859_15, 28605 }, + { iso_8859_2W, XmlEncoding_ISO_8859_2, 28592 }, + { iso_8859_3W, XmlEncoding_ISO_8859_3, 28593 }, + { iso_8859_4W, XmlEncoding_ISO_8859_4, 28594 }, + { iso_8859_5W, XmlEncoding_ISO_8859_5, 28595 }, + { iso_8859_7W, XmlEncoding_ISO_8859_7, 28597 }, + { iso_8859_9W, XmlEncoding_ISO_8859_9, 28599 }, + { utf16W, XmlEncoding_UTF16, ~0 }, + { utf8W, XmlEncoding_UTF8, CP_UTF8 } }; typedef enum @@ -300,7 +327,7 @@ static HRESULT write_output_buffer_mode(output_buffer *buffer, output_mode mode, char *ptr; if (mode & (OutputBuffer_Encoded | OutputBuffer_Both)) { - if (buffer->code_page == CP_UTF8) + if (buffer->code_page != ~0) { length = WideCharToMultiByte(buffer->code_page, 0, data, len, NULL, 0, NULL, NULL); grow_buffer(&buffer->encoded, length); diff --git a/dlls/msxml3/tests/saxreader.c b/dlls/msxml3/tests/saxreader.c index 0a0651b..1b19c3c 100644 --- a/dlls/msxml3/tests/saxreader.c +++ b/dlls/msxml3/tests/saxreader.c @@ -3647,16 +3647,31 @@ static void test_mxwriter_stream(void) free_bstrs(); } +static const char *encoding_names[] = { + "iso-8859-1", + "iso-8859-2", + "iso-8859-3", + "iso-8859-4", + "iso-8859-5", + "iso-8859-7", + "iso-8859-9", + "iso-8859-13", + "iso-8859-15", + NULL +}; + static void test_mxwriter_encoding(void) { ISAXContentHandler *content; IMXWriter *writer; IStream *stream; + const char *enc; VARIANT dest; HRESULT hr; HGLOBAL g; char *ptr; BSTR s; + int i; hr = CoCreateInstance(&CLSID_MXXMLWriter, NULL, CLSCTX_INPROC_SERVER, &IID_IMXWriter, (void**)&writer); @@ -3726,6 +3741,61 @@ static void test_mxwriter_encoding(void) IStream_Release(stream); + i = 0; + enc = encoding_names[i]; + while (enc) + { + char expectedA[200]; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + EXPECT_HR(hr, S_OK); + + V_VT(&dest) = VT_UNKNOWN; + V_UNKNOWN(&dest) = (IUnknown*)stream; + hr = IMXWriter_put_output(writer, dest); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_put_encoding(writer, _bstr_(enc)); + ok(hr == S_OK || broken(hr != S_OK) /* old win versions do not support certain encodings */, + "%s: encoding not accepted\n", enc); + if (hr != S_OK) + { + enc = encoding_names[i++]; + IStream_Release(stream); + continue; + } + + hr = ISAXContentHandler_startDocument(content); + EXPECT_HR(hr, S_OK); + + hr = ISAXContentHandler_endDocument(content); + EXPECT_HR(hr, S_OK); + + hr = IMXWriter_flush(writer); + EXPECT_HR(hr, S_OK); + + /* prepare expected string */ + *expectedA = 0; + strcat(expectedA, "<?xml version=\"1.0\" encoding=\""); + strcat(expectedA, enc); + strcat(expectedA, "\" standalone=\"no\"?>\r\n"); + + hr = GetHGlobalFromStream(stream, &g); + EXPECT_HR(hr, S_OK); + + ptr = GlobalLock(g); + ok(!strncmp(ptr, expectedA, strlen(expectedA)), "%s: got %s, expected %.50s\n", enc, ptr, expectedA); + GlobalUnlock(g); + + V_VT(&dest) = VT_EMPTY; + hr = IMXWriter_put_output(writer, dest); + EXPECT_HR(hr, S_OK); + + IStream_Release(stream); + + enc = encoding_names[++i]; + } + ISAXContentHandler_Release(content); IMXWriter_Release(writer);
1
0
0
0
← Newer
1
...
42
43
44
45
46
47
48
...
74
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Results per page:
10
25
50
100
200