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
December 2018
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
352 discussions
Start a n
N
ew thread
Dmitry Timoshkov : windowscodecs: Implement IWICBitmapEncoderInfo:: GetFileExtensions.
by Alexandre Julliard
06 Dec '18
06 Dec '18
Module: wine Branch: master Commit: 7533f251e32f6f6040d269cf7928af4dd6c11247 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7533f251e32f6f6040d269cf…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Dec 6 12:05:59 2018 +0300 windowscodecs: Implement IWICBitmapEncoderInfo::GetFileExtensions. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/info.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c index 86707e1..d0c2c69 100644 --- a/dlls/windowscodecs/info.c +++ b/dlls/windowscodecs/info.c @@ -898,8 +898,12 @@ static HRESULT WINAPI BitmapEncoderInfo_GetMimeTypes(IWICBitmapEncoderInfo *ifac static HRESULT WINAPI BitmapEncoderInfo_GetFileExtensions(IWICBitmapEncoderInfo *iface, UINT cchFileExtensions, WCHAR *wzFileExtensions, UINT *pcchActual) { - FIXME("(%p,%u,%p,%p): stub\n", iface, cchFileExtensions, wzFileExtensions, pcchActual); - return E_NOTIMPL; + BitmapEncoderInfo *This = impl_from_IWICBitmapEncoderInfo(iface); + + TRACE("(%p,%u,%p,%p)\n", iface, cchFileExtensions, wzFileExtensions, pcchActual); + + return ComponentInfo_GetStringValue(This->classkey, fileextensions_valuename, + cchFileExtensions, wzFileExtensions, pcchActual); } static HRESULT WINAPI BitmapEncoderInfo_DoesSupportAnimation(IWICBitmapEncoderInfo *iface,
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for palette image formats to BMP encoder.
by Alexandre Julliard
06 Dec '18
06 Dec '18
Module: wine Branch: master Commit: ee6dd81e922145ca7b70cb1de01a8795119b824b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ee6dd81e922145ca7b70cb1d…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Dec 6 12:05:55 2018 +0300 windowscodecs: Add support for palette image formats to BMP encoder. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/bmpencode.c | 47 +++++++++++++++++++++++++++++------- dlls/windowscodecs/info.c | 8 +++++- dlls/windowscodecs/regsvr.c | 4 +++ dlls/windowscodecs/tests/converter.c | 11 ++++++--- 4 files changed, 57 insertions(+), 13 deletions(-) diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c index b8783a4..8e2bbe8 100644 --- a/dlls/windowscodecs/bmpencode.c +++ b/dlls/windowscodecs/bmpencode.c @@ -1,5 +1,6 @@ /* * Copyright 2009 Vincent Povirk for CodeWeavers + * Copyright 2016 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -37,6 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); struct bmp_pixelformat { const WICPixelFormatGUID *guid; UINT bpp; + UINT colors; /* palette size */ DWORD compression; DWORD redmask; DWORD greenmask; @@ -45,13 +47,18 @@ struct bmp_pixelformat { }; static const struct bmp_pixelformat formats[] = { - {&GUID_WICPixelFormat24bppBGR, 24, BI_RGB}, - {&GUID_WICPixelFormat16bppBGR555, 16, BI_RGB}, - {&GUID_WICPixelFormat16bppBGR565, 16, BI_BITFIELDS, 0xf800, 0x7e0, 0x1f, 0}, - {&GUID_WICPixelFormat32bppBGR, 32, BI_RGB}, + {&GUID_WICPixelFormat24bppBGR, 24, 0, BI_RGB}, + {&GUID_WICPixelFormatBlackWhite, 1, 2, BI_RGB}, + {&GUID_WICPixelFormat1bppIndexed, 1, 2, BI_RGB}, + {&GUID_WICPixelFormat2bppIndexed, 2, 4, BI_RGB}, + {&GUID_WICPixelFormat4bppIndexed, 4, 16, BI_RGB}, + {&GUID_WICPixelFormat8bppIndexed, 8, 256, BI_RGB}, + {&GUID_WICPixelFormat16bppBGR555, 16, 0, BI_RGB}, + {&GUID_WICPixelFormat16bppBGR565, 16, 0, BI_BITFIELDS, 0xf800, 0x7e0, 0x1f, 0}, + {&GUID_WICPixelFormat32bppBGR, 32, 0, BI_RGB}, #if 0 /* Windows doesn't seem to support this one. */ - {&GUID_WICPixelFormat32bppBGRA, 32, BI_BITFIELDS, 0xff0000, 0xff00, 0xff, 0xff000000}, + {&GUID_WICPixelFormat32bppBGRA, 32, 0, BI_BITFIELDS, 0xff0000, 0xff00, 0xff, 0xff000000}, #endif {NULL} }; @@ -182,9 +189,14 @@ static HRESULT WINAPI BmpFrameEncode_SetPixelFormat(IWICBitmapFrameEncode *iface if (!This->initialized || This->bits) return WINCODEC_ERR_WRONGSTATE; + if (IsEqualGUID(pPixelFormat, &GUID_WICPixelFormatBlackWhite)) + *pPixelFormat = GUID_WICPixelFormat1bppIndexed; + else if (IsEqualGUID(pPixelFormat, &GUID_WICPixelFormat2bppIndexed)) + *pPixelFormat = GUID_WICPixelFormat4bppIndexed; + for (i=0; formats[i].guid; i++) { - if (memcmp(formats[i].guid, pPixelFormat, sizeof(GUID)) == 0) + if (IsEqualGUID(formats[i].guid, pPixelFormat)) break; } @@ -207,6 +219,7 @@ static HRESULT WINAPI BmpFrameEncode_SetPalette(IWICBitmapFrameEncode *iface, IWICPalette *palette) { BmpFrameEncode *This = impl_from_IWICBitmapFrameEncode(iface); + HRESULT hr; TRACE("(%p,%p)\n", iface, palette); @@ -215,7 +228,14 @@ static HRESULT WINAPI BmpFrameEncode_SetPalette(IWICBitmapFrameEncode *iface, if (!This->initialized) return WINCODEC_ERR_NOTINITIALIZED; - return IWICPalette_GetColors(palette, 256, This->palette, &This->colors); + hr = IWICPalette_GetColors(palette, 256, This->palette, &This->colors); + if (hr == S_OK) + { + UINT i; + for (i = 0; i < This->colors; i++) + This->palette[i] |= 0xff000000; /* BMP palette has no alpha */ + } + return hr; } static HRESULT WINAPI BmpFrameEncode_SetThumbnail(IWICBitmapFrameEncode *iface, @@ -330,8 +350,8 @@ static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface) bih.bV5SizeImage = This->stride*This->height; bih.bV5XPelsPerMeter = (This->xres+0.0127) / 0.0254; bih.bV5YPelsPerMeter = (This->yres+0.0127) / 0.0254; - bih.bV5ClrUsed = 0; - bih.bV5ClrImportant = 0; + bih.bV5ClrUsed = (This->format->bpp <= 8) ? This->colors : 0; + bih.bV5ClrImportant = bih.bV5ClrUsed; if (This->format->compression == BI_BITFIELDS) { @@ -348,6 +368,7 @@ static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface) bfh.bfSize = sizeof(BITMAPFILEHEADER) + info_size + bih.bV5SizeImage; bfh.bfOffBits = sizeof(BITMAPFILEHEADER) + info_size; + bfh.bfOffBits += bih.bV5ClrUsed * sizeof(WICColor); pos.QuadPart = 0; hr = IStream_Seek(This->stream, pos, STREAM_SEEK_SET, NULL); @@ -361,6 +382,14 @@ static HRESULT WINAPI BmpFrameEncode_Commit(IWICBitmapFrameEncode *iface) if (FAILED(hr)) return hr; if (byteswritten != info_size) return E_FAIL; + /* write the palette */ + if (This->format->colors) + { + hr = IStream_Write(This->stream, This->palette, This->colors * sizeof(WICColor), &byteswritten); + if (FAILED(hr)) return hr; + if (byteswritten != This->colors * sizeof(WICColor)) return E_FAIL; + } + hr = IStream_Write(This->stream, This->bits, bih.bV5SizeImage, &byteswritten); if (FAILED(hr)) return hr; if (byteswritten != bih.bV5SizeImage) return E_FAIL; diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c index e131107..86707e1 100644 --- a/dlls/windowscodecs/info.c +++ b/dlls/windowscodecs/info.c @@ -2461,6 +2461,12 @@ HRESULT CreateComponentEnumerator(DWORD componentTypes, DWORD options, IEnumUnkn return hr; } +static BOOL is_1bpp_format(const WICPixelFormatGUID *format) +{ + return IsEqualGUID(format, &GUID_WICPixelFormatBlackWhite) || + IsEqualGUID(format, &GUID_WICPixelFormat1bppIndexed); +} + HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst) { HRESULT res; @@ -2476,7 +2482,7 @@ HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitma res = IWICBitmapSource_GetPixelFormat(pISrc, &srcFormat); if (FAILED(res)) return res; - if (IsEqualGUID(&srcFormat, dstFormat)) + if (IsEqualGUID(&srcFormat, dstFormat) || (is_1bpp_format(&srcFormat) && is_1bpp_format(dstFormat))) { IWICBitmapSource_AddRef(pISrc); *ppIDst = pISrc; diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c index ca02ff9..7b0fbf8 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/windowscodecs/regsvr.c @@ -1347,6 +1347,10 @@ static GUID const * const bmp_encode_formats[] = { &GUID_WICPixelFormat16bppBGR565, &GUID_WICPixelFormat24bppBGR, &GUID_WICPixelFormat32bppBGR, + &GUID_WICPixelFormatBlackWhite, + &GUID_WICPixelFormat1bppIndexed, + &GUID_WICPixelFormat4bppIndexed, + &GUID_WICPixelFormat8bppIndexed, NULL }; diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c index 44a2c08..8e0fb77 100644 --- a/dlls/windowscodecs/tests/converter.c +++ b/dlls/windowscodecs/tests/converter.c @@ -804,6 +804,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format) if (IsEqualGUID(format, &GUID_WICPixelFormat1bppIndexed)) { + ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %02x\n", bfh.bfOffBits); + ok(bih.bV5Width == 32, "wrong width %u\n", bih.bV5Width); ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height); @@ -814,6 +816,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format) } else if (IsEqualGUID(format, &GUID_WICPixelFormat4bppIndexed)) { + ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %02x\n", bfh.bfOffBits); + ok(bih.bV5Width == 8, "wrong width %u\n", bih.bV5Width); ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height); @@ -824,6 +828,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format) } else if (IsEqualGUID(format, &GUID_WICPixelFormat8bppIndexed)) { + ok(bfh.bfOffBits == 0x0436, "wrong bfOffBits %02x\n", bfh.bfOffBits); + ok(bih.bV5Width == 4, "wrong width %u\n", bih.bV5Width); ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height); @@ -834,6 +840,8 @@ static void check_bmp_format(IStream *stream, const WICPixelFormatGUID *format) } else if (IsEqualGUID(format, &GUID_WICPixelFormat32bppBGR)) { + ok(bfh.bfOffBits == 0x0036, "wrong bfOffBits %02x\n", bfh.bfOffBits); + ok(bih.bV5Width == 4, "wrong width %u\n", bih.bV5Width); ok(bih.bV5Height == 2, "wrong height %u\n", bih.bV5Height); @@ -1492,8 +1500,6 @@ START_TEST(converter) test_encoder(&testdata_24bppBGR, &CLSID_WICPngEncoder, &testdata_24bppBGR, &CLSID_WICPngDecoder, "PNG encoder 24bppBGR"); -if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in Wine */ -{ test_encoder(&testdata_BlackWhite, &CLSID_WICBmpEncoder, &testdata_1bppIndexed, &CLSID_WICBmpDecoder, "BMP encoder BlackWhite"); test_encoder(&testdata_1bppIndexed, &CLSID_WICBmpEncoder, @@ -1504,7 +1510,6 @@ if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in &testdata_4bppIndexed, &CLSID_WICBmpDecoder, "BMP encoder 4bppIndexed"); test_encoder(&testdata_8bppIndexed, &CLSID_WICBmpEncoder, &testdata_8bppIndexed, &CLSID_WICBmpDecoder, "BMP encoder 8bppIndexed"); -} test_encoder(&testdata_32bppBGR, &CLSID_WICBmpEncoder, &testdata_32bppBGR, &CLSID_WICBmpDecoder, "BMP encoder 32bppBGR");
1
0
0
0
Dmitry Timoshkov : windowscodecs: Add support for palette image formats to TIFF encoder.
by Alexandre Julliard
06 Dec '18
06 Dec '18
Module: wine Branch: master Commit: d13d34d10194c087af4dfa05e0fb9c2be31d9d1f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d13d34d10194c087af4dfa05…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Dec 6 12:05:53 2018 +0300 windowscodecs: Add support for palette image formats to TIFF encoder. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/main.c | 2 +- dlls/windowscodecs/regsvr.c | 5 +++++ dlls/windowscodecs/tests/converter.c | 3 --- dlls/windowscodecs/tiffformat.c | 32 ++++++++++++++++++++++++++++++-- 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/dlls/windowscodecs/main.c b/dlls/windowscodecs/main.c index 6f781b8..7650c75 100644 --- a/dlls/windowscodecs/main.c +++ b/dlls/windowscodecs/main.c @@ -182,7 +182,7 @@ HRESULT write_source(IWICBitmapFrameEncode *iface, if (FAILED(hr)) { ERR("Failed to convert source, target format %s, %#x\n", debugstr_guid(format), hr); - return hr; + return E_NOTIMPL; } stride = (bpp * width + 7)/8; diff --git a/dlls/windowscodecs/regsvr.c b/dlls/windowscodecs/regsvr.c index 3f53591..ca02ff9 100644 --- a/dlls/windowscodecs/regsvr.c +++ b/dlls/windowscodecs/regsvr.c @@ -1211,6 +1211,8 @@ static GUID const * const tiff_decode_formats[] = { &GUID_WICPixelFormatBlackWhite, &GUID_WICPixelFormat4bppGray, &GUID_WICPixelFormat8bppGray, + &GUID_WICPixelFormat1bppIndexed, + &GUID_WICPixelFormat2bppIndexed, &GUID_WICPixelFormat4bppIndexed, &GUID_WICPixelFormat8bppIndexed, &GUID_WICPixelFormat24bppBGR, @@ -1370,6 +1372,9 @@ static GUID const * const tiff_encode_formats[] = { &GUID_WICPixelFormatBlackWhite, &GUID_WICPixelFormat4bppGray, &GUID_WICPixelFormat8bppGray, + &GUID_WICPixelFormat1bppIndexed, + &GUID_WICPixelFormat4bppIndexed, + &GUID_WICPixelFormat8bppIndexed, &GUID_WICPixelFormat24bppBGR, &GUID_WICPixelFormat32bppBGRA, &GUID_WICPixelFormat32bppPBGRA, diff --git a/dlls/windowscodecs/tests/converter.c b/dlls/windowscodecs/tests/converter.c index df3cf3b..44a2c08 100644 --- a/dlls/windowscodecs/tests/converter.c +++ b/dlls/windowscodecs/tests/converter.c @@ -1510,8 +1510,6 @@ if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in test_encoder(&testdata_BlackWhite, &CLSID_WICTiffEncoder, &testdata_BlackWhite, &CLSID_WICTiffDecoder, "TIFF encoder BlackWhite"); -if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in Wine */ -{ test_encoder(&testdata_1bppIndexed, &CLSID_WICTiffEncoder, &testdata_1bppIndexed, &CLSID_WICTiffDecoder, "TIFF encoder 1bppIndexed"); test_encoder(&testdata_2bppIndexed, &CLSID_WICTiffEncoder, @@ -1520,7 +1518,6 @@ if (!strcmp(winetest_platform, "windows")) /* FIXME: enable once implemented in &testdata_4bppIndexed, &CLSID_WICTiffDecoder, "TIFF encoder 4bppIndexed"); test_encoder(&testdata_8bppIndexed, &CLSID_WICTiffEncoder, &testdata_8bppIndexed, &CLSID_WICTiffDecoder, "TIFF encoder 8bppIndexed"); -} test_encoder(&testdata_24bppBGR, &CLSID_WICTiffEncoder, &testdata_24bppBGR, &CLSID_WICTiffDecoder, "TIFF encoder 24bppBGR"); diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c index 81c6394..01d62d9 100644 --- a/dlls/windowscodecs/tiffformat.c +++ b/dlls/windowscodecs/tiffformat.c @@ -1,5 +1,6 @@ /* * Copyright 2010 Vincent Povirk for CodeWeavers + * Copyright 2016 Dmitry Timoshkov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -461,6 +462,12 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) decode_info->bpp = bps; switch (bps) { + case 1: + decode_info->format = &GUID_WICPixelFormat1bppIndexed; + break; + case 2: + decode_info->format = &GUID_WICPixelFormat2bppIndexed; + break; case 4: decode_info->format = &GUID_WICPixelFormat4bppIndexed; break; @@ -469,7 +476,7 @@ static HRESULT tiff_get_decode_info(TIFF *tiff, tiff_decode_info *decode_info) break; default: FIXME("unhandled indexed bit count %u\n", bps); - return E_FAIL; + return E_NOTIMPL; } break; case 4: /* Transparency mask */ @@ -1408,6 +1415,9 @@ static const struct tiff_encode_format formats[] = { {&GUID_WICPixelFormat48bppRGB, 2, 16, 3, 48, 0, 0, 0}, {&GUID_WICPixelFormat64bppRGBA, 2, 16, 4, 64, 1, 2, 0}, {&GUID_WICPixelFormat64bppPRGBA, 2, 16, 4, 64, 1, 1, 0}, + {&GUID_WICPixelFormat1bppIndexed, 3, 1, 1, 1, 0, 0, 0}, + {&GUID_WICPixelFormat4bppIndexed, 3, 4, 1, 4, 0, 0, 0}, + {&GUID_WICPixelFormat8bppIndexed, 3, 8, 1, 8, 0, 0, 0}, {0} }; @@ -1579,9 +1589,12 @@ static HRESULT WINAPI TiffFrameEncode_SetPixelFormat(IWICBitmapFrameEncode *ifac return WINCODEC_ERR_WRONGSTATE; } + if (IsEqualGUID(pPixelFormat, &GUID_WICPixelFormat2bppIndexed)) + *pPixelFormat = GUID_WICPixelFormat4bppIndexed; + for (i=0; formats[i].guid; i++) { - if (memcmp(formats[i].guid, pPixelFormat, sizeof(GUID)) == 0) + if (IsEqualGUID(formats[i].guid, pPixelFormat)) break; } @@ -1690,6 +1703,21 @@ static HRESULT WINAPI TiffFrameEncode_WritePixels(IWICBitmapFrameEncode *iface, pTIFFSetField(This->parent->tiff, TIFFTAG_YRESOLUTION, (float)This->yres); } + if (This->format->bpp <= 8 && This->colors && !IsEqualGUID(This->format->guid, &GUID_WICPixelFormatBlackWhite)) + { + uint16 red[256], green[256], blue[256]; + UINT i; + + for (i = 0; i < This->colors; i++) + { + red[i] = (This->palette[i] >> 8) & 0xff00; + green[i] = This->palette[i] & 0xff00; + blue[i] = (This->palette[i] << 8) & 0xff00; + } + + pTIFFSetField(This->parent->tiff, TIFFTAG_COLORMAP, red, green, blue); + } + This->info_written = TRUE; }
1
0
0
0
Dmitry Timoshkov : windowscodecs/tests: Add tests for encoding 2bpp/ 4bpp images with a palette.
by Alexandre Julliard
06 Dec '18
06 Dec '18
Module: wine Branch: master Commit: 1d7da01ff109500583433cc386a7128476f885cd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1d7da01ff109500583433cc3…
Author: Dmitry Timoshkov <dmitry(a)baikal.ru> Date: Thu Dec 6 12:05:49 2018 +0300 windowscodecs/tests: Add tests for encoding 2bpp/4bpp images with a palette. Signed-off-by: Dmitry Timoshkov <dmitry(a)baikal.ru> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/tests/converter.c | 323 +++++++++++++++++++++++++++++------ 1 file changed, 267 insertions(+), 56 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=1d7da01ff10950058343…
1
0
0
0
Pierre Schweitzer : mpr: Implement support for deleting persistent connections.
by Alexandre Julliard
06 Dec '18
06 Dec '18
Module: wine Branch: master Commit: 773ff2e83b0547540639c6d4aeb9f817b621fb2f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=773ff2e83b0547540639c6d4…
Author: Pierre Schweitzer <pierre(a)reactos.org> Date: Thu Dec 6 08:39:37 2018 +0100 mpr: Implement support for deleting persistent connections. Signed-off-by: Pierre Schweitzer <pierre(a)reactos.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mpr/wnet.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dlls/mpr/wnet.c b/dlls/mpr/wnet.c index 3db0ab1..df8aef2 100644 --- a/dlls/mpr/wnet.c +++ b/dlls/mpr/wnet.c @@ -2290,6 +2290,23 @@ DWORD WINAPI WNetCancelConnection2W( LPCWSTR lpName, DWORD dwFlags, BOOL fForce } } } + + if (ret == WN_SUCCESS && dwFlags & CONNECT_UPDATE_PROFILE) + { + HKEY user_profile; + + /* FIXME: Only remove it if that's a drive letter */ + if (isalphaW(lpName[0]) && lpName[1] == ':' && + RegOpenCurrentUser(KEY_ALL_ACCESS, &user_profile) == ERROR_SUCCESS) + { + WCHAR subkey[10] = {'N', 'e', 't', 'w', 'o', 'r', 'k', '\\', lpName[0], 0}; + + RegDeleteKeyW(user_profile, subkey); + + RegCloseKey(user_profile); + } + } + return ret; }
1
0
0
0
Pierre Schweitzer : mpr: Implement support for making connections persistent.
by Alexandre Julliard
06 Dec '18
06 Dec '18
Module: wine Branch: master Commit: 23a232fce8899a24e76207518175235b7b0f00cd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=23a232fce8899a24e7620751…
Author: Pierre Schweitzer <pierre(a)reactos.org> Date: Tue Nov 27 19:54:48 2018 +0100 mpr: Implement support for making connections persistent. Signed-off-by: Pierre Schweitzer <pierre(a)reactos.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mpr/wnet.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/dlls/mpr/wnet.c b/dlls/mpr/wnet.c index d0b4ba8..3db0ab1 100644 --- a/dlls/mpr/wnet.c +++ b/dlls/mpr/wnet.c @@ -2004,9 +2004,12 @@ static DWORD wnet_use_provider( struct use_connection_context *ctxt, NETRESOURCE return ret; } +static const WCHAR providerType[] = { 'P','r','o','v','i','d','e','r','T','y','p','e',0 }; +static const WCHAR userName[] = { 'U','s','e','r','N','a','m','e',0 }; + static DWORD wnet_use_connection( struct use_connection_context *ctxt ) { - WNetProvider *provider; + WNetProvider *provider = NULL; DWORD index, ret = WN_NO_NETWORK; BOOL redirect = FALSE; WCHAR letter[3] = {'Z', ':', 0}; @@ -2060,6 +2063,42 @@ static DWORD wnet_use_connection( struct use_connection_context *ctxt ) } } + if (ret == WN_SUCCESS && ctxt->flags & CONNECT_UPDATE_PROFILE) + { + HKEY user_profile; + + if (netres.dwType == RESOURCETYPE_PRINT) + { + FIXME("Persistent connection are not supported for printers\n"); + return ret; + } + + if (RegOpenCurrentUser(KEY_ALL_ACCESS, &user_profile) == ERROR_SUCCESS) + { + HKEY network; + WCHAR subkey[10] = {'N', 'e', 't', 'w', 'o', 'r', 'k', '\\', netres.lpLocalName[0], 0}; + + if (RegCreateKeyExW(user_profile, subkey, 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, NULL, &network, NULL) == ERROR_SUCCESS) + { + DWORD dword_arg = RESOURCETYPE_DISK; + DWORD len = (strlenW(provider->name) + 1) * sizeof(WCHAR); + static const WCHAR empty[1] = {0}; + + RegSetValueExW(network, connectionType, 0, REG_DWORD, (const BYTE *)&dword_arg, sizeof(DWORD)); + RegSetValueExW(network, providerName, 0, REG_SZ, (const BYTE *)provider->name, len); + RegSetValueExW(network, providerType, 0, REG_DWORD, (const BYTE *)&provider->dwNetType, sizeof(DWORD)); + len = (strlenW(netres.lpRemoteName) + 1) * sizeof(WCHAR); + RegSetValueExW(network, remotePath, 0, REG_SZ, (const BYTE *)netres.lpRemoteName, len); + len = sizeof(empty); + RegSetValueExW(network, userName, 0, REG_SZ, (const BYTE *)empty, len); + RegCloseKey(network); + } + + RegCloseKey(user_profile); + } + } + return ret; }
1
0
0
0
Alistair Leslie-Hughes : ext-ms-win-ntuser-misc-l1-2-0: Add dll.
by Alexandre Julliard
06 Dec '18
06 Dec '18
Module: wine Branch: master Commit: 9b81989bca798543515c43c2ad1ab845d7067628 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9b81989bca798543515c43c2…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Wed Dec 5 23:48:34 2018 +0000 ext-ms-win-ntuser-misc-l1-2-0: Add dll. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 2 + configure.ac | 1 + dlls/ext-ms-win-ntuser-misc-l1-2-0/Makefile.in | 1 + .../ext-ms-win-ntuser-misc-l1-2-0.spec | 48 ++++++++++++++++++++++ tools/make_specfiles | 1 + 5 files changed, 53 insertions(+) diff --git a/configure b/configure index 23ba36c..9a9a5e6 100755 --- a/configure +++ b/configure @@ -1272,6 +1272,7 @@ enable_ext_ms_win_ntuser_draw_l1_1_0 enable_ext_ms_win_ntuser_gui_l1_3_0 enable_ext_ms_win_ntuser_keyboard_l1_3_0 enable_ext_ms_win_ntuser_message_l1_1_1 +enable_ext_ms_win_ntuser_misc_l1_2_0 enable_ext_ms_win_ntuser_misc_l1_5_1 enable_ext_ms_win_ntuser_mouse_l1_1_0 enable_ext_ms_win_ntuser_private_l1_1_1 @@ -19461,6 +19462,7 @@ wine_fn_config_makefile dlls/ext-ms-win-ntuser-draw-l1-1-0 enable_ext_ms_win_ntu wine_fn_config_makefile dlls/ext-ms-win-ntuser-gui-l1-3-0 enable_ext_ms_win_ntuser_gui_l1_3_0 wine_fn_config_makefile dlls/ext-ms-win-ntuser-keyboard-l1-3-0 enable_ext_ms_win_ntuser_keyboard_l1_3_0 wine_fn_config_makefile dlls/ext-ms-win-ntuser-message-l1-1-1 enable_ext_ms_win_ntuser_message_l1_1_1 +wine_fn_config_makefile dlls/ext-ms-win-ntuser-misc-l1-2-0 enable_ext_ms_win_ntuser_misc_l1_2_0 wine_fn_config_makefile dlls/ext-ms-win-ntuser-misc-l1-5-1 enable_ext_ms_win_ntuser_misc_l1_5_1 wine_fn_config_makefile dlls/ext-ms-win-ntuser-mouse-l1-1-0 enable_ext_ms_win_ntuser_mouse_l1_1_0 wine_fn_config_makefile dlls/ext-ms-win-ntuser-private-l1-1-1 enable_ext_ms_win_ntuser_private_l1_1_1 diff --git a/configure.ac b/configure.ac index 8ec69fe..aa1291d 100644 --- a/configure.ac +++ b/configure.ac @@ -3301,6 +3301,7 @@ WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-ntuser-draw-l1-1-0) WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-ntuser-gui-l1-3-0) WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-ntuser-keyboard-l1-3-0) WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-ntuser-message-l1-1-1) +WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-ntuser-misc-l1-2-0) WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-ntuser-misc-l1-5-1) WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-ntuser-mouse-l1-1-0) WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-ntuser-private-l1-1-1) diff --git a/dlls/ext-ms-win-ntuser-misc-l1-2-0/Makefile.in b/dlls/ext-ms-win-ntuser-misc-l1-2-0/Makefile.in new file mode 100755 index 0000000..fcf9e0a --- /dev/null +++ b/dlls/ext-ms-win-ntuser-misc-l1-2-0/Makefile.in @@ -0,0 +1 @@ +MODULE = ext-ms-win-ntuser-misc-l1-2-0.dll diff --git a/dlls/ext-ms-win-ntuser-misc-l1-2-0/ext-ms-win-ntuser-misc-l1-2-0.spec b/dlls/ext-ms-win-ntuser-misc-l1-2-0/ext-ms-win-ntuser-misc-l1-2-0.spec new file mode 100644 index 0000000..917984a --- /dev/null +++ b/dlls/ext-ms-win-ntuser-misc-l1-2-0/ext-ms-win-ntuser-misc-l1-2-0.spec @@ -0,0 +1,48 @@ +@ stdcall AttachThreadInput(long long long) user32.AttachThreadInput +@ stdcall CloseClipboard() user32.CloseClipboard +@ stub CloseGestureInfoHandle +@ stdcall DrawTextExW(long wstr long ptr long ptr) user32.DrawTextExW +@ stdcall DrawTextW(long wstr long ptr long) user32.DrawTextW +@ stdcall EmptyClipboard() user32.EmptyClipboard +@ stdcall EnableScrollBar(long long long) user32.EnableScrollBar +@ stdcall ExitWindowsEx(long long) user32.ExitWindowsEx +@ stdcall GetClipboardData(long) user32.GetClipboardData +@ stdcall GetClipboardFormatNameW(long ptr long) user32.GetClipboardFormatNameW +@ stdcall GetClipboardOwner() user32.GetClipboardOwner +@ stdcall GetGestureConfig(long long long ptr ptr long) user32.GetGestureConfig +@ stdcall GetGestureInfo(long ptr) user32.GetGestureInfo +@ stdcall GetGuiResources(long long) user32.GetGuiResources +@ stdcall GetRawInputData(ptr long ptr ptr long) user32.GetRawInputData +@ stdcall GetRawInputDeviceInfoW(ptr long ptr ptr) user32.GetRawInputDeviceInfoW +@ stdcall GetRawInputDeviceList(ptr ptr long) user32.GetRawInputDeviceList +@ stdcall GetScrollBarInfo(long long ptr) user32.GetScrollBarInfo +@ stdcall GetScrollInfo(long long ptr) user32.GetScrollInfo +@ stdcall GetScrollPos(long long) user32.GetScrollPos +@ stdcall GetTouchInputInfo(long long ptr long) user32.GetTouchInputInfo +@ stdcall GetUserObjectSecurity(long ptr ptr long ptr) user32.GetUserObjectSecurity +@ stub GetWindowFeedbackSetting +@ stdcall IsClipboardFormatAvailable(long) user32.IsClipboardFormatAvailable +@ stdcall IsTouchWindow(long ptr) user32.IsTouchWindow +@ stdcall KillTimer(long long) user32.KillTimer +@ stdcall MessageBeep(long) user32.MessageBeep +@ stdcall OpenClipboard(long) user32.OpenClipboard +@ stdcall RegisterClipboardFormatA(str) user32.RegisterClipboardFormatA +@ stdcall RegisterClipboardFormatW(wstr) user32.RegisterClipboardFormatW +@ stdcall RegisterDeviceNotificationW(long ptr long) user32.RegisterDeviceNotificationW +@ stdcall RegisterRawInputDevices(ptr long long) user32.RegisterRawInputDevices +@ stdcall ScrollWindowEx(long long long ptr ptr long ptr long) user32.ScrollWindowEx +@ stdcall SetClipboardData(long long) user32.SetClipboardData +@ stdcall SetCoalescableTimer(long long long ptr long) user32.SetCoalescableTimer +@ stdcall SetScrollInfo(long long ptr long) user32.SetScrollInfo +@ stdcall SetScrollPos(long long long long) user32.SetScrollPos +@ stdcall SetScrollRange(long long long long long) user32.SetScrollRange +@ stdcall SetTimer(long long long ptr) user32.SetTimer +@ stdcall SetUserObjectSecurity(long ptr ptr) user32.SetUserObjectSecurity +@ stub SetWindowFeedbackSetting +@ stdcall ShowScrollBar(long long long) user32.ShowScrollBar +@ stdcall ShutdownBlockReasonCreate(long wstr) user32.ShutdownBlockReasonCreate +@ stdcall ShutdownBlockReasonDestroy(long) user32.ShutdownBlockReasonDestroy +@ stdcall TabbedTextOutW(long long long wstr long long ptr long) user32.TabbedTextOutW +@ stdcall UnregisterDeviceNotification(long) user32.UnregisterDeviceNotification +@ stdcall WaitForInputIdle(long long) user32.WaitForInputIdle +@ stdcall WinHelpW(long wstr long long) user32.WinHelpW diff --git a/tools/make_specfiles b/tools/make_specfiles index 2b38aed..edc317d 100755 --- a/tools/make_specfiles +++ b/tools/make_specfiles @@ -384,6 +384,7 @@ my @dll_groups = "ext-ms-win-ntuser-gui-l1-3-0", "ext-ms-win-ntuser-keyboard-l1-3-0", "ext-ms-win-ntuser-message-l1-1-1", + "ext-ms-win-ntuser-misc-l1-2-0", "ext-ms-win-ntuser-misc-l1-5-1", "ext-ms-win-ntuser-mouse-l1-1-0", "ext-ms-win-ntuser-private-l1-1-1",
1
0
0
0
Ken Thomases : loader: Check if the preloader overlaps the reserved range on the Mac.
by Alexandre Julliard
06 Dec '18
06 Dec '18
Module: wine Branch: master Commit: cc24255da430c9b23a8e379dd38564e9359b3cee URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cc24255da430c9b23a8e379d…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Wed Dec 5 16:21:36 2018 -0600 loader: Check if the preloader overlaps the reserved range on the Mac. Signed-off-by: Ken Thomases <ken(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- loader/preloader_mac.c | 48 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/loader/preloader_mac.c b/loader/preloader_mac.c index 1d88062..83d24af 100644 --- a/loader/preloader_mac.c +++ b/loader/preloader_mac.c @@ -48,6 +48,7 @@ #ifdef HAVE_MACH_O_LOADER_H #include <mach/thread_status.h> #include <mach-o/loader.h> +#include <mach-o/ldsyms.h> #endif #include "main.h" @@ -98,6 +99,8 @@ void __stack_chk_fail(void) { return; } static const size_t page_size = 0x1000; static const size_t page_mask = 0xfff; #define target_mach_header mach_header +#define target_segment_command segment_command +#define TARGET_LC_SEGMENT LC_SEGMENT #define target_thread_state_t i386_thread_state_t #ifdef __DARWIN_UNIX03 #define target_thread_ip(x) (x)->__eip @@ -184,6 +187,8 @@ __ASM_GLOBAL_FUNC( start, static const size_t page_size = 0x1000; static const size_t page_mask = 0xfff; #define target_mach_header mach_header_64 +#define target_segment_command segment_command_64 +#define TARGET_LC_SEGMENT LC_SEGMENT_64 #define target_thread_state_t x86_thread_state64_t #ifdef __DARWIN_UNIX03 #define target_thread_ip(x) (x)->__rip @@ -376,6 +381,36 @@ static __attribute__((noreturn,format(printf,1,2))) void fatal_error(const char wld_exit(1); } +static int preloader_overlaps_range( const void *start, const void *end ) +{ + intptr_t slide = p_dyld_get_image_slide(&_mh_execute_header); + struct load_command *cmd = (struct load_command*)(&_mh_execute_header + 1); + int i; + + for (i = 0; i < _mh_execute_header.ncmds; ++i) + { + if (cmd->cmd == TARGET_LC_SEGMENT) + { + struct target_segment_command *seg = (struct target_segment_command*)cmd; + const void *seg_start = (const void*)(seg->vmaddr + slide); + const void *seg_end = (const char*)seg_start + seg->vmsize; + + if (end > seg_start && start <= seg_end) + { + char segname[sizeof(seg->segname) + 1]; + memcpy(segname, seg->segname, sizeof(seg->segname)); + segname[sizeof(segname) - 1] = 0; + wld_printf( "WINEPRELOADRESERVE range %p-%p overlaps preloader %s segment %p-%p\n", + start, end, segname, seg_start, seg_end ); + return 1; + } + } + cmd = (struct load_command*)((char*)cmd + cmd->cmdsize); + } + + return 0; +} + /* * preload_reserve * @@ -406,7 +441,8 @@ static void preload_reserve( const char *str ) else if (result) goto error; /* single value '0' is allowed */ /* sanity checks */ - if (end <= start) start = end = NULL; + if (end <= start || preloader_overlaps_range(start, end)) + start = end = NULL; /* check for overlap with low memory areas */ for (i = 0; preload_info[i].size; i++) @@ -562,6 +598,11 @@ void *wld_start( void *stack, int *is_unix_thread ) p++; } + LOAD_POSIX_DYLD_FUNC( dlopen ); + LOAD_POSIX_DYLD_FUNC( dlsym ); + LOAD_POSIX_DYLD_FUNC( dladdr ); + LOAD_MACHO_DYLD_FUNC( _dyld_get_image_slide ); + /* reserve memory that Wine needs */ if (reserve) preload_reserve( reserve ); for (i = 0; preload_info[i].size; i++) @@ -576,11 +617,6 @@ void *wld_start( void *stack, int *is_unix_thread ) if (!map_region( &builtin_dlls )) builtin_dlls.size = 0; - LOAD_POSIX_DYLD_FUNC( dlopen ); - LOAD_POSIX_DYLD_FUNC( dlsym ); - LOAD_POSIX_DYLD_FUNC( dladdr ); - LOAD_MACHO_DYLD_FUNC( _dyld_get_image_slide ); - /* load the main binary */ if (!(mod = pdlopen( argv[1], RTLD_NOW ))) fatal_error( "%s: could not load binary\n", argv[1] );
1
0
0
0
Nikolay Sivov : shlwapi: Remove unused fields.
by Alexandre Julliard
06 Dec '18
06 Dec '18
Module: wine Branch: master Commit: 72c28cdb53033805ac4c3c1f3a229900d2ac8014 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=72c28cdb53033805ac4c3c1f…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Dec 6 08:00:37 2018 +0300 shlwapi: Remove unused fields. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shlwapi/regstream.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/dlls/shlwapi/regstream.c b/dlls/shlwapi/regstream.c index 31df82a..decc1f6 100644 --- a/dlls/shlwapi/regstream.c +++ b/dlls/shlwapi/regstream.c @@ -39,16 +39,10 @@ typedef struct { IStream IStream_iface; LONG ref; - HKEY hKey; LPBYTE pbBuffer; DWORD dwLength; DWORD dwPos; DWORD dwMode; - union { - LPSTR keyNameA; - LPWSTR keyNameW; - }u; - BOOL bUnicode; } ISHRegStream; static inline ISHRegStream *impl_from_IStream(IStream *iface) @@ -105,35 +99,6 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface) if (!refCount) { - TRACE(" destroying SHReg IStream (%p)\n",This); - - if (This->hKey) - { - /* write back data in REG_BINARY */ - if (This->dwMode == STGM_READWRITE || This->dwMode == STGM_WRITE) - { - if (This->dwLength) - { - if (This->bUnicode) - RegSetValueExW(This->hKey, This->u.keyNameW, 0, REG_BINARY, - (const BYTE *) This->pbBuffer, This->dwLength); - else - RegSetValueExA(This->hKey, This->u.keyNameA, 0, REG_BINARY, - (const BYTE *) This->pbBuffer, This->dwLength); - } - else - { - if (This->bUnicode) - RegDeleteValueW(This->hKey, This->u.keyNameW); - else - RegDeleteValueA(This->hKey, This->u.keyNameA); - } - } - - RegCloseKey(This->hKey); - } - - HeapFree(GetProcessHeap(),0,This->u.keyNameA); HeapFree(GetProcessHeap(),0,This->pbBuffer); HeapFree(GetProcessHeap(),0,This); return 0; @@ -384,13 +349,10 @@ static ISHRegStream *IStream_Create(HKEY hKey, LPBYTE pbBuffer, DWORD dwLength) { regStream->IStream_iface.lpVtbl = &rstvt; regStream->ref = 1; - regStream->hKey = hKey; regStream->pbBuffer = pbBuffer; regStream->dwLength = dwLength; regStream->dwPos = 0; regStream->dwMode = STGM_READWRITE; - regStream->u.keyNameA = NULL; - regStream->bUnicode = FALSE; } TRACE ("Returning %p\n", regStream); return regStream;
1
0
0
0
Michael Müller : setupapi: Always return device info from SetupDiGetDeviceInterfaceDetail() if requested.
by Alexandre Julliard
06 Dec '18
06 Dec '18
Module: wine Branch: master Commit: 2d6704ba99a7c4e7ec0b4a9384827f328599dd54 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2d6704ba99a7c4e7ec0b4a93…
Author: Michael Müller <michael(a)fds-team.de> Date: Wed Dec 5 21:08:11 2018 -0600 setupapi: Always return device info from SetupDiGetDeviceInterfaceDetail() if requested. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/setupapi/devinst.c | 14 ++++++++------ dlls/setupapi/tests/devinst.c | 7 +++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index 38da640..5574656 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -2702,9 +2702,6 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA(HDEVINFO devinfo, SP_DEVICE_INTERFA else DeviceInterfaceDetailData->DevicePath[0] = '\0'; - if (device_data && device_data->cbSize == sizeof(SP_DEVINFO_DATA)) - copy_device_data(device_data, iface->device); - ret = TRUE; } else @@ -2713,6 +2710,10 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA(HDEVINFO devinfo, SP_DEVICE_INTERFA *RequiredSize = bytesNeeded; SetLastError(ERROR_INSUFFICIENT_BUFFER); } + + if (device_data && device_data->cbSize == sizeof(SP_DEVINFO_DATA)) + copy_device_data(device_data, iface->device); + return ret; } @@ -2757,9 +2758,6 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailW(HDEVINFO devinfo, SP_DEVICE_INTERFA else DeviceInterfaceDetailData->DevicePath[0] = '\0'; - if (device_data && device_data->cbSize == sizeof(SP_DEVINFO_DATA)) - copy_device_data(device_data, iface->device); - ret = TRUE; } else @@ -2768,6 +2766,10 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailW(HDEVINFO devinfo, SP_DEVICE_INTERFA *RequiredSize = bytesNeeded; SetLastError(ERROR_INSUFFICIENT_BUFFER); } + + if (device_data && device_data->cbSize == sizeof(SP_DEVINFO_DATA)) + copy_device_data(device_data, iface->device); + return ret; } diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c index 55fe104..bfffcb9 100644 --- a/dlls/setupapi/tests/devinst.c +++ b/dlls/setupapi/tests/devinst.c @@ -752,6 +752,13 @@ static void test_device_iface_detail(void) ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected error %#x.\n", GetLastError()); ok(size == expectedsize, "Got unexpected size %d.\n", size); + memset(&device, 0, sizeof(device)); + device.cbSize = sizeof(device); + ret = SetupDiGetDeviceInterfaceDetailW(set, &iface, NULL, 0, &size, &device); + ok(!ret, "Expected failure.\n"); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Got unexpected error %#x.\n", GetLastError()); + ok(IsEqualGUID(&device.ClassGuid, &guid), "Got unexpected class %s.\n", wine_dbgstr_guid(&device.ClassGuid)); + heap_free(detail); SetupDiDestroyDeviceInfoList(set); }
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
36
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
Results per page:
10
25
50
100
200