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
July
June
May
April
March
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
July 2020
----- 2025 -----
July 2025
June 2025
May 2025
April 2025
March 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
826 discussions
Start a n
N
ew thread
Paul Gofman : ntdll: Use MAP_FIXED_NOREPLACE flag in try_map_free_area() if available.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: fdb3d9ae320363c1bd9fa716b167a7ad313e638b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fdb3d9ae320363c1bd9fa716…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Jul 10 14:39:21 2020 +0300 ntdll: Use MAP_FIXED_NOREPLACE flag in try_map_free_area() if available. Avoids actual mapping followed by unmapping back if the memory range is already mapped. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/virtual.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 20bf5ff066..63efb74382 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -175,6 +175,9 @@ static struct list teb_list = LIST_INIT( teb_list ); #ifndef MAP_TRYFIXED #define MAP_TRYFIXED 0 #endif +#ifndef MAP_FIXED_NOREPLACE +#define MAP_FIXED_NOREPLACE 0 +#endif #ifdef _WIN64 /* on 64-bit the page protection bytes use a 2-level table */ static const size_t pages_vprot_shift = 20; @@ -1005,18 +1008,19 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step, while (start && base <= start && (char*)start + size <= (char*)end) { - if ((ptr = wine_anon_mmap( start, size, unix_prot, 0 )) == start) + if ((ptr = wine_anon_mmap( start, size, unix_prot, MAP_FIXED_NOREPLACE )) == start) return start; TRACE( "Found free area is already mapped, start %p.\n", start ); - if (ptr == (void *)-1) + if (ptr == (void *)-1 && errno != EEXIST) { ERR( "wine_anon_mmap() error %s, range %p-%p, unix_prot %#x.\n", strerror(errno), start, (char *)start + size, unix_prot ); return NULL; } - munmap( ptr, size ); + if (ptr != (void *)-1) + munmap( ptr, size ); if ((step > 0 && (char *)end - (char *)start < step) || (step < 0 && (char *)start - (char *)base < -step) ||
1
0
0
0
Paul Gofman : ntdll: Stop search on mmap() error in try_map_free_area().
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 5498ebd8c0aaa651ce6823cccdf572a3f551deba URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5498ebd8c0aaa651ce6823cc…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Jul 10 14:39:20 2020 +0300 ntdll: Stop search on mmap() error in try_map_free_area(). The anon mmap errors do not depend on start address hint. Ignoring them makes the search take incredible time until it fails. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/virtual.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c index 4e5b1acf0b..20bf5ff066 100644 --- a/dlls/ntdll/unix/virtual.c +++ b/dlls/ntdll/unix/virtual.c @@ -1009,8 +1009,14 @@ static void* try_map_free_area( void *base, void *end, ptrdiff_t step, return start; TRACE( "Found free area is already mapped, start %p.\n", start ); - if (ptr != (void *)-1) - munmap( ptr, size ); + if (ptr == (void *)-1) + { + ERR( "wine_anon_mmap() error %s, range %p-%p, unix_prot %#x.\n", + strerror(errno), start, (char *)start + size, unix_prot ); + return NULL; + } + + munmap( ptr, size ); if ((step > 0 && (char *)end - (char *)start < step) || (step < 0 && (char *)start - (char *)base < -step) ||
1
0
0
0
Ziqing Hui : windowscodecs/tests: Add tests for DdsDecoder_Wine_Initialize().
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 2b2341cb3663bc8970612b856f51250a891bb6d3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2b2341cb3663bc8970612b85…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Fri Jul 10 17:09:20 2020 +0800 windowscodecs/tests: Add tests for DdsDecoder_Wine_Initialize(). Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Esme Povirk <esme(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/tests/ddsformat.c | 38 +++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c index 9bdf0bdb94..ecf7de0bc4 100644 --- a/dlls/windowscodecs/tests/ddsformat.c +++ b/dlls/windowscodecs/tests/ddsformat.c @@ -170,6 +170,7 @@ static struct test_data { UINT expected_frame_count; const GUID *expected_pixel_format; WICDdsParameters expected_parameters; + BOOL wine_init; } test_data[] = { { test_dds_image, sizeof(test_dds_image), 1, &GUID_WICPixelFormat32bppPBGRA, { 4, 4, 1, 1, 1, DXGI_FORMAT_BC1_UNORM, WICDdsTexture2D, WICDdsAlphaModePremultiplied } }, @@ -227,17 +228,39 @@ static IWICBitmapDecoder *create_decoder(void) return decoder; } -static HRESULT init_decoder(IWICBitmapDecoder *decoder, IWICStream *stream, HRESULT expected, int index) +static HRESULT init_decoder(IWICBitmapDecoder *decoder, IWICStream *stream, HRESULT expected, int index, BOOL wine_init) { HRESULT hr; + IWICWineDecoder *wine_decoder; hr = IWICBitmapDecoder_Initialize(decoder, (IStream*)stream, WICDecodeMetadataCacheOnDemand); if (index == -1) { ok(hr == S_OK, "Decoder initialize failed, hr %#x\n", hr); } else { - todo_wine_if(index == 1 || index == 3) + todo_wine_if(wine_init) ok(hr == expected, "Test %u: Expected hr %#x, got %#x\n", index, expected, hr); } + + if (hr != S_OK && wine_init) { + hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICWineDecoder, (void **)&wine_decoder); + if (index == -1) { + ok(hr == S_OK || broken(hr != S_OK), "QueryInterface failed, hr %#x\n", hr); + } else { + ok(hr == S_OK || broken(hr != S_OK), "Test %u: QueryInterface failed, hr %#x\n", index, hr); + } + if (hr == S_OK) { + hr = IWICWineDecoder_Initialize(wine_decoder, (IStream*)stream, WICDecodeMetadataCacheOnDemand); + if (index == -1) { + todo_wine + ok(hr == S_OK, "Initialize failed, hr %#x\n", hr); + } else { + todo_wine + ok(hr == S_OK, "Test %u: Initialize failed, hr %#x\n", index, hr); + } + + } + } + return hr; } @@ -279,14 +302,15 @@ static void test_dds_decoder_initialize(void) void *data; UINT size; HRESULT expected; + BOOL wine_init; } test_data[] = { { test_dds_image, sizeof(test_dds_image), S_OK }, - { test_dds_uncompressed, sizeof(test_dds_uncompressed), WINCODEC_ERR_BADHEADER }, { test_dds_mipmaps, sizeof(test_dds_mipmaps), S_OK }, - { test_dds_cube, sizeof(test_dds_cube), WINCODEC_ERR_BADHEADER }, { test_dds_volume, sizeof(test_dds_volume), S_OK }, { test_dds_array, sizeof(test_dds_array), S_OK }, { test_dds_dxt3, sizeof(test_dds_dxt3), S_OK }, + { test_dds_uncompressed, sizeof(test_dds_uncompressed), WINCODEC_ERR_BADHEADER, TRUE }, + { test_dds_cube, sizeof(test_dds_cube), WINCODEC_ERR_BADHEADER, TRUE }, { test_dds_bad_magic, sizeof(test_dds_bad_magic), WINCODEC_ERR_UNKNOWNIMAGEFORMAT }, { test_dds_bad_header, sizeof(test_dds_bad_header), WINCODEC_ERR_BADHEADER }, { &byte, sizeof(byte), WINCODEC_ERR_STREAMREAD }, @@ -313,7 +337,7 @@ static void test_dds_decoder_initialize(void) decoder = create_decoder(); if (!decoder) goto next; - init_decoder(decoder, stream, test_data[i].expected, i); + init_decoder(decoder, stream, test_data[i].expected, i, test_data[i].wine_init); next: if (decoder) IWICBitmapDecoder_Release(decoder); @@ -399,7 +423,7 @@ static void test_dds_decoder_image_parameters(void) hr = IWICDdsDecoder_GetParameters(dds_decoder, NULL); ok(hr == E_INVALIDARG, "Test %u: GetParameters got unexpected hr %#x\n", i, hr); - hr = init_decoder(decoder, stream, S_OK, -1); + hr = init_decoder(decoder, stream, S_OK, -1, test_data[i].wine_init); if (hr != S_OK) goto next; hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count); @@ -690,7 +714,7 @@ static void test_dds_decoder(void) if (!stream) goto next; decoder = create_decoder(); if (!decoder) goto next; - hr = init_decoder(decoder, stream, S_OK, -1); + hr = init_decoder(decoder, stream, S_OK, -1, test_data[i].wine_init); if (hr != S_OK) goto next; test_dds_decoder_global_properties(decoder);
1
0
0
0
Ziqing Hui : windowscodecs: Add IWICWineDecoder stub for DDS decoder.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: d7ef1cd82c8892c530d375e59dbf6e1e4cd3e3c2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d7ef1cd82c8892c530d375e5…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Fri Jul 10 17:08:49 2020 +0800 windowscodecs: Add IWICWineDecoder stub for DDS decoder. Initializing cube map and uncompressed DDS is not supported in WIC. But we would like to use them in other part of wine. So we introduce a Wine-specific interface to initialize them. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Esme Povirk <esme(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/ddsformat.c | 40 ++++++++++++++++++++++++++++++++++++++++ include/wincodec.idl | 10 ++++++++++ 2 files changed, 50 insertions(+) diff --git a/dlls/windowscodecs/ddsformat.c b/dlls/windowscodecs/ddsformat.c index 7a28b82e3d..295b935a26 100644 --- a/dlls/windowscodecs/ddsformat.c +++ b/dlls/windowscodecs/ddsformat.c @@ -125,6 +125,7 @@ typedef struct dds_frame_info { typedef struct DdsDecoder { IWICBitmapDecoder IWICBitmapDecoder_iface; IWICDdsDecoder IWICDdsDecoder_iface; + IWICWineDecoder IWICWineDecoder_iface; LONG ref; BOOL initialized; IStream *stream; @@ -281,6 +282,11 @@ static inline DdsDecoder *impl_from_IWICDdsDecoder(IWICDdsDecoder *iface) return CONTAINING_RECORD(iface, DdsDecoder, IWICDdsDecoder_iface); } +static inline DdsDecoder *impl_from_IWICWineDecoder(IWICWineDecoder *iface) +{ + return CONTAINING_RECORD(iface, DdsDecoder, IWICWineDecoder_iface); +} + static inline DdsFrameDecode *impl_from_IWICBitmapFrameDecode(IWICBitmapFrameDecode *iface) { return CONTAINING_RECORD(iface, DdsFrameDecode, IWICBitmapFrameDecode_iface); @@ -566,6 +572,8 @@ static HRESULT WINAPI DdsDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID *ppv = &This->IWICBitmapDecoder_iface; } else if (IsEqualIID(&IID_IWICDdsDecoder, iid)) { *ppv = &This->IWICDdsDecoder_iface; + } else if (IsEqualIID(&IID_IWICWineDecoder, iid)) { + *ppv = &This->IWICWineDecoder_iface; } else { *ppv = NULL; return E_NOINTERFACE; @@ -959,6 +967,37 @@ static const IWICDdsDecoderVtbl DdsDecoder_Dds_Vtbl = { DdsDecoder_Dds_GetFrame }; +static HRESULT WINAPI DdsDecoder_Wine_QueryInterface(IWICWineDecoder *iface, REFIID iid, void **ppv) +{ + DdsDecoder *This = impl_from_IWICWineDecoder(iface); + return DdsDecoder_QueryInterface(&This->IWICBitmapDecoder_iface, iid, ppv); +} + +static ULONG WINAPI DdsDecoder_Wine_AddRef(IWICWineDecoder *iface) +{ + DdsDecoder *This = impl_from_IWICWineDecoder(iface); + return DdsDecoder_AddRef(&This->IWICBitmapDecoder_iface); +} + +static ULONG WINAPI DdsDecoder_Wine_Release(IWICWineDecoder *iface) +{ + DdsDecoder *This = impl_from_IWICWineDecoder(iface); + return DdsDecoder_Release(&This->IWICBitmapDecoder_iface); +} + +static HRESULT WINAPI DdsDecoder_Wine_Initialize(IWICWineDecoder *iface, IStream *stream, WICDecodeOptions options) +{ + FIXME("(This %p, stream %p, options %#x)\n", iface, stream, options); + return E_NOTIMPL; +} + +static const IWICWineDecoderVtbl DdsDecoder_Wine_Vtbl = { + DdsDecoder_Wine_QueryInterface, + DdsDecoder_Wine_AddRef, + DdsDecoder_Wine_Release, + DdsDecoder_Wine_Initialize +}; + HRESULT DdsDecoder_CreateInstance(REFIID iid, void** ppv) { DdsDecoder *This; @@ -973,6 +1012,7 @@ HRESULT DdsDecoder_CreateInstance(REFIID iid, void** ppv) This->IWICBitmapDecoder_iface.lpVtbl = &DdsDecoder_Vtbl; This->IWICDdsDecoder_iface.lpVtbl = &DdsDecoder_Dds_Vtbl; + This->IWICWineDecoder_iface.lpVtbl = &DdsDecoder_Wine_Vtbl; This->ref = 1; This->initialized = FALSE; This->stream = NULL; diff --git a/include/wincodec.idl b/include/wincodec.idl index e64d9ed3f1..88e183d579 100644 --- a/include/wincodec.idl +++ b/include/wincodec.idl @@ -1216,6 +1216,16 @@ interface IWICDdsFrameDecode : IUnknown [out, size_is(bufferSize)] BYTE *buffer); }; +[ + object, + uuid(b9bd430d-28a8-41d3-a1f5-f36ee02840bf) +] +interface IWICWineDecoder : IUnknown +{ + HRESULT Initialize( + [in] IStream *stream, + [in] WICDecodeOptions options); +}; cpp_quote("HRESULT WINAPI WICConvertBitmapSource(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst);") cpp_quote("HRESULT WINAPI WICCreateBitmapFromSection(UINT width, UINT height, REFWICPixelFormatGUID format, HANDLE section, UINT stride, UINT offset, IWICBitmap **bitmap);")
1
0
0
0
Ziqing Hui : windowscodecs: Remove header and header_dxt10 in struct DdsDecoder.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 43788707ce33235ae216407027c72ffdd275479b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=43788707ce33235ae2164070…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Fri Jul 10 17:08:18 2020 +0800 windowscodecs: Remove header and header_dxt10 in struct DdsDecoder. This make dds_info become the only dependence of implementation. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Esme Povirk <esme(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/ddsformat.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/dlls/windowscodecs/ddsformat.c b/dlls/windowscodecs/ddsformat.c index 43fb87dfb1..7a28b82e3d 100644 --- a/dlls/windowscodecs/ddsformat.c +++ b/dlls/windowscodecs/ddsformat.c @@ -103,6 +103,7 @@ typedef struct dds_info { UINT mip_levels; UINT array_size; UINT frame_count; + UINT data_offset; DXGI_FORMAT format; WICDdsDimension dimension; WICDdsAlphaMode alpha_mode; @@ -128,8 +129,6 @@ typedef struct DdsDecoder { BOOL initialized; IStream *stream; CRITICAL_SECTION lock; - DDS_HEADER header; - DDS_HEADER_DXT10 header_dxt10; dds_info info; } DdsDecoder; @@ -226,10 +225,12 @@ static void get_dds_info(dds_info* info, DDS_HEADER *header, DDS_HEADER_DXT10 *h info->format = header_dxt10->dxgiFormat; info->dimension = get_dimension(NULL, header_dxt10); info->alpha_mode = header_dxt10->miscFlags2 & 0x00000008; + info->data_offset = sizeof(DWORD) + sizeof(*header) + sizeof(*header_dxt10); } else { info->format = get_format_from_fourcc(header->ddspf.fourCC); info->dimension = get_dimension(header, NULL); info->alpha_mode = get_alpha_mode_from_fourcc(header->ddspf.fourCC); + info->data_offset = sizeof(DWORD) + sizeof(*header); } info->pixel_format = (info->alpha_mode == WICDdsAlphaModePremultiplied) ? &GUID_WICPixelFormat32bppPBGRA : &GUID_WICPixelFormat32bppBGRA; @@ -614,6 +615,8 @@ static HRESULT WINAPI DdsDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p WICDecodeOptions cacheOptions) { DdsDecoder *This = impl_from_IWICBitmapDecoder(iface); + DDS_HEADER_DXT10 header_dxt10; + DDS_HEADER header; HRESULT hr; LARGE_INTEGER seek; DWORD magic; @@ -643,27 +646,27 @@ static HRESULT WINAPI DdsDecoder_Initialize(IWICBitmapDecoder *iface, IStream *p goto end; } - hr = IStream_Read(pIStream, &This->header, sizeof(This->header), &bytesread); + hr = IStream_Read(pIStream, &header, sizeof(header), &bytesread); if (FAILED(hr)) goto end; - if (bytesread != sizeof(This->header)) { + if (bytesread != sizeof(header)) { hr = WINCODEC_ERR_STREAMREAD; goto end; } - if (This->header.size != sizeof(This->header)) { + if (header.size != sizeof(header)) { hr = WINCODEC_ERR_BADHEADER; goto end; } - if (has_extended_header(&This->header)) { - hr = IStream_Read(pIStream, &This->header_dxt10, sizeof(This->header_dxt10), &bytesread); + if (has_extended_header(&header)) { + hr = IStream_Read(pIStream, &header_dxt10, sizeof(header_dxt10), &bytesread); if (FAILED(hr)) goto end; - if (bytesread != sizeof(This->header_dxt10)) { + if (bytesread != sizeof(header_dxt10)) { hr = WINCODEC_ERR_STREAMREAD; goto end; } } - get_dds_info(&This->info, &This->header, &This->header_dxt10); + get_dds_info(&This->info, &header, &header_dxt10); This->initialized = TRUE; This->stream = pIStream; @@ -888,8 +891,7 @@ static HRESULT WINAPI DdsDecoder_Dds_GetFrame(IWICDdsDecoder *iface, } bytes_per_block = get_bytes_per_block(This->info.format); - seek.QuadPart = sizeof(DWORD) + sizeof(DDS_HEADER); - if (has_extended_header(&This->header)) seek.QuadPart += sizeof(DDS_HEADER_DXT10); + seek.QuadPart = This->info.data_offset; width = This->info.width; height = This->info.height;
1
0
0
0
Alexandre Julliard : ntdll: Use a pthread mutex for the wait on address section.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 052e8dbf5985ffa5875067491b03a523257752f9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=052e8dbf5985ffa587506749…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 13 18:48:21 2020 +0200 ntdll: Use a pthread mutex for the wait on address section. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/server.c | 8 ++++---- dlls/ntdll/unix/sync.c | 25 +++++++++---------------- dlls/ntdll/unix/unix_private.h | 2 +- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c index 9a593f7725..faca7da5c9 100644 --- a/dlls/ntdll/unix/server.c +++ b/dlls/ntdll/unix/server.c @@ -590,7 +590,7 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result ) * server_select */ unsigned int server_select( const select_op_t *select_op, data_size_t size, UINT flags, - timeout_t abs_timeout, CONTEXT *context, RTL_CRITICAL_SECTION *cs, + timeout_t abs_timeout, CONTEXT *context, pthread_mutex_t *mutex, user_apc_t *user_apc ) { unsigned int ret; @@ -649,10 +649,10 @@ unsigned int server_select( const select_op_t *select_op, data_size_t size, UINT size = offsetof( select_op_t, signal_and_wait.signal ); } pthread_sigmask( SIG_SETMASK, &old_set, NULL ); - if (cs) + if (mutex) { - RtlLeaveCriticalSection( cs ); - cs = NULL; + pthread_mutex_unlock( mutex ); + mutex = NULL; } if (ret != STATUS_PENDING) break; diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c index 5080caef52..69263efa0e 100644 --- a/dlls/ntdll/unix/sync.c +++ b/dlls/ntdll/unix/sync.c @@ -78,15 +78,7 @@ HANDLE keyed_event = 0; static const LARGE_INTEGER zero_timeout; -static RTL_CRITICAL_SECTION addr_section; -static RTL_CRITICAL_SECTION_DEBUG addr_section_debug = -{ - 0, 0, &addr_section, - { &addr_section_debug.ProcessLocksList, &addr_section_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": addr_section") } -}; -static RTL_CRITICAL_SECTION addr_section = { &addr_section_debug, -1, 0, 0, 0, 0 }; - +static pthread_mutex_t addr_mutex = PTHREAD_MUTEX_INITIALIZER; /* return a monotonic time counter, in Win32 ticks */ static inline ULONGLONG monotonic_counter(void) @@ -2253,10 +2245,10 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size if ((ret = fast_wait_addr( addr, cmp, size, timeout )) != STATUS_NOT_IMPLEMENTED) return ret; - RtlEnterCriticalSection( &addr_section ); + pthread_mutex_lock( &addr_mutex ); if (!compare_addr( addr, cmp, size )) { - RtlLeaveCriticalSection( &addr_section ); + pthread_mutex_unlock( &addr_mutex ); return STATUS_SUCCESS; } @@ -2272,7 +2264,8 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size select_op.keyed_event.handle = wine_server_obj_handle( keyed_event ); select_op.keyed_event.key = wine_server_client_ptr( addr ); - return server_select( &select_op, sizeof(select_op.keyed_event), SELECT_INTERRUPTIBLE, abs_timeout, NULL, &addr_section, NULL ); + return server_select( &select_op, sizeof(select_op.keyed_event), SELECT_INTERRUPTIBLE, + abs_timeout, NULL, &addr_mutex, NULL ); } /*********************************************************************** @@ -2282,9 +2275,9 @@ void WINAPI RtlWakeAddressAll( const void *addr ) { if (fast_wake_addr( addr ) != STATUS_NOT_IMPLEMENTED) return; - RtlEnterCriticalSection( &addr_section ); + pthread_mutex_lock( &addr_mutex ); while (NtReleaseKeyedEvent( 0, addr, 0, &zero_timeout ) == STATUS_SUCCESS) {} - RtlLeaveCriticalSection( &addr_section ); + pthread_mutex_unlock( &addr_mutex ); } /*********************************************************************** @@ -2294,7 +2287,7 @@ void WINAPI RtlWakeAddressSingle( const void *addr ) { if (fast_wake_addr( addr ) != STATUS_NOT_IMPLEMENTED) return; - RtlEnterCriticalSection( &addr_section ); + pthread_mutex_lock( &addr_mutex ); NtReleaseKeyedEvent( 0, addr, 0, &zero_timeout ); - RtlLeaveCriticalSection( &addr_section ); + pthread_mutex_unlock( &addr_mutex ); } diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h index 2a73f17e10..3d56ea5d40 100644 --- a/dlls/ntdll/unix/unix_private.h +++ b/dlls/ntdll/unix/unix_private.h @@ -162,7 +162,7 @@ extern unsigned int server_call_unlocked( void *req_ptr ) DECLSPEC_HIDDEN; extern void server_enter_uninterrupted_section( pthread_mutex_t *mutex, sigset_t *sigset ) DECLSPEC_HIDDEN; extern void server_leave_uninterrupted_section( pthread_mutex_t *mutex, sigset_t *sigset ) DECLSPEC_HIDDEN; extern unsigned int server_select( const select_op_t *select_op, data_size_t size, UINT flags, - timeout_t abs_timeout, CONTEXT *context, RTL_CRITICAL_SECTION *cs, + timeout_t abs_timeout, CONTEXT *context, pthread_mutex_t *mutex, user_apc_t *user_apc ) DECLSPEC_HIDDEN; extern unsigned int server_wait( const select_op_t *select_op, data_size_t size, UINT flags, const LARGE_INTEGER *timeout ) DECLSPEC_HIDDEN;
1
0
0
0
Alexandre Julliard : ntdll: Use a pthread mutex for the current directory section.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 85db4f7ec28a5d68fecba624f518dc1d2a07e359 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=85db4f7ec28a5d68fecba624…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 13 18:45:15 2020 +0200 ntdll: Use a pthread mutex for the current directory section. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/file.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index c90fac156a..085052225d 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -240,15 +240,7 @@ static const BOOL is_case_sensitive = FALSE; static struct file_identity windir; -static RTL_CRITICAL_SECTION dir_section; -static RTL_CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &dir_section, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": dir_section") } -}; -static RTL_CRITICAL_SECTION dir_section = { &critsect_debug, -1, 0, 0, 0, 0 }; - +static pthread_mutex_t dir_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t mnt_mutex = PTHREAD_MUTEX_INITIALIZER; /* check if a given Unicode char is OK in a DOS short name */ @@ -2473,7 +2465,7 @@ NTSTATUS WINAPI NtQueryDirectoryFile( HANDLE handle, HANDLE event, PIO_APC_ROUTI io->Information = 0; - RtlEnterCriticalSection( &dir_section ); + pthread_mutex_lock( &dir_mutex ); cwd = open( ".", O_RDONLY ); if (fchdir( fd ) != -1) @@ -2500,7 +2492,7 @@ NTSTATUS WINAPI NtQueryDirectoryFile( HANDLE handle, HANDLE event, PIO_APC_ROUTI } else status = STATUS_ACCESS_DENIED; - RtlLeaveCriticalSection( &dir_section ); + pthread_mutex_unlock( &dir_mutex ); if (needs_close) close( fd ); if (cwd != -1) close( cwd ); @@ -3064,7 +3056,7 @@ static NTSTATUS file_id_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char * goto done; } - RtlEnterCriticalSection( &dir_section ); + pthread_mutex_lock( &dir_mutex ); if ((old_cwd = open( ".", O_RDONLY )) != -1 && fchdir( root_fd ) != -1) { /* shortcut for ".." */ @@ -3085,7 +3077,7 @@ static NTSTATUS file_id_to_unix_file_name( const OBJECT_ATTRIBUTES *attr, char * if (fchdir( old_cwd ) == -1) chdir( "/" ); } else status = STATUS_ACCESS_DENIED; - RtlLeaveCriticalSection( &dir_section ); + pthread_mutex_unlock( &dir_mutex ); if (old_cwd != -1) close( old_cwd ); done: @@ -3258,7 +3250,7 @@ static NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, char * } else { - RtlEnterCriticalSection( &dir_section ); + pthread_mutex_lock( &dir_mutex ); if ((old_cwd = open( ".", O_RDONLY )) != -1 && fchdir( root_fd ) != -1) { status = lookup_unix_name( name, name_len, &unix_name, unix_len, 1, @@ -3266,7 +3258,7 @@ static NTSTATUS nt_to_unix_file_name_attr( const OBJECT_ATTRIBUTES *attr, char * if (fchdir( old_cwd ) == -1) chdir( "/" ); } else status = STATUS_ACCESS_DENIED; - RtlLeaveCriticalSection( &dir_section ); + pthread_mutex_unlock( &dir_mutex ); if (old_cwd != -1) close( old_cwd ); if (needs_close) close( root_fd ); }
1
0
0
0
Alexandre Julliard : ntdll: Use a pthread mutex for the drive info section.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: d7ef680e950431d868e6d52418513472af7edbb3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d7ef680e950431d868e6d524…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 13 18:45:04 2020 +0200 ntdll: Use a pthread mutex for the drive info section. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index c5ffd0166d..c90fac156a 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -1871,13 +1871,14 @@ static NTSTATUS server_get_file_info( HANDLE handle, IO_STATUS_BLOCK *io, void * /* retrieve device/inode number for all the drives */ static unsigned int get_drives_info( struct file_identity info[MAX_DOS_DRIVES] ) { + static pthread_mutex_t cache_mutex = PTHREAD_MUTEX_INITIALIZER; static struct file_identity cache[MAX_DOS_DRIVES]; static time_t last_update; static unsigned int nb_drives; unsigned int ret; time_t now = time(NULL); - RtlEnterCriticalSection( &dir_section ); + pthread_mutex_lock( &cache_mutex ); if (now != last_update) { char *buffer, *p; @@ -1912,7 +1913,7 @@ static unsigned int get_drives_info( struct file_identity info[MAX_DOS_DRIVES] ) } memcpy( info, cache, sizeof(cache) ); ret = nb_drives; - RtlLeaveCriticalSection( &dir_section ); + pthread_mutex_unlock( &cache_mutex ); return ret; }
1
0
0
0
Alexandre Julliard : ntdll: Use a pthread mutex for the mount info section.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 3b745f17b5553f88011a50a7b355f0eb3f5084b9 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3b745f17b5553f88011a50a7…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 13 18:44:47 2020 +0200 ntdll: Use a pthread mutex for the mount info section. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/file.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 3368d2105c..c5ffd0166d 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -249,6 +249,7 @@ static RTL_CRITICAL_SECTION_DEBUG critsect_debug = }; static RTL_CRITICAL_SECTION dir_section = { &critsect_debug, -1, 0, 0, 0, 0 }; +static pthread_mutex_t mnt_mutex = PTHREAD_MUTEX_INITIALIZER; /* check if a given Unicode char is OK in a DOS short name */ static inline BOOL is_invalid_dos_char( WCHAR ch ) @@ -567,7 +568,7 @@ static inline char *get_field( char **str ) * * getmntent replacement for Android. * - * NB returned static buffer is not thread safe; protect with dir_section. + * NB returned static buffer is not thread safe; protect with mnt_mutex. */ static struct mntent *getmntent_replacement( FILE *f ) { @@ -775,7 +776,7 @@ static char *get_default_drive_device( const char *root ) if (res == -1) res = stat( root, &st ); if (res == -1) return NULL; - RtlEnterCriticalSection( &dir_section ); + pthread_mutex_lock( &mnt_mutex ); #ifdef __ANDROID__ if ((f = fopen( "/proc/mounts", "r" ))) @@ -801,7 +802,7 @@ static char *get_default_drive_device( const char *root ) ret = RtlAllocateHeap( GetProcessHeap(), 0, strlen(device) + 1 ); if (ret) strcpy( ret, device ); } - RtlLeaveCriticalSection( &dir_section ); + pthread_mutex_unlock( &mnt_mutex ); #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__ ) || defined(__DragonFly__) char *device = NULL; @@ -818,7 +819,7 @@ static char *get_default_drive_device( const char *root ) if (res == -1) res = stat( root, &st ); if (res == -1) return NULL; - RtlEnterCriticalSection( &dir_section ); + pthread_mutex_lock( &mnt_mutex ); /* The FreeBSD parse_mount_entries doesn't require a file argument, so just * pass NULL. Leave the argument in for symmetry. @@ -829,7 +830,7 @@ static char *get_default_drive_device( const char *root ) ret = RtlAllocateHeap( GetProcessHeap(), 0, strlen(device) + 1 ); if (ret) strcpy( ret, device ); } - RtlLeaveCriticalSection( &dir_section ); + pthread_mutex_unlock( &mnt_mutex ); #elif defined( sun ) FILE *f; @@ -847,7 +848,7 @@ static char *get_default_drive_device( const char *root ) if (res == -1) res = stat( root, &st ); if (res == -1) return NULL; - RtlEnterCriticalSection( &dir_section ); + pthread_mutex_lock( &mnt_mutex ); if ((f = fopen( "/etc/mnttab", "r" ))) { @@ -865,7 +866,7 @@ static char *get_default_drive_device( const char *root ) ret = RtlAllocateHeap( GetProcessHeap(), 0, strlen(device) + 1 ); if (ret) strcpy( ret, device ); } - RtlLeaveCriticalSection( &dir_section ); + pthread_mutex_unlock( &mnt_mutex ); #elif defined(__APPLE__) struct statfs *mntStat; @@ -883,7 +884,7 @@ static char *get_default_drive_device( const char *root ) dev = st.st_dev; ino = st.st_ino; - RtlEnterCriticalSection( &dir_section ); + pthread_mutex_lock( &mnt_mutex ); mntSize = getmntinfo(&mntStat, MNT_NOWAIT); @@ -904,7 +905,7 @@ static char *get_default_drive_device( const char *root ) } } } - RtlLeaveCriticalSection( &dir_section ); + pthread_mutex_unlock( &mnt_mutex ); #else static int warned; if (!warned++) FIXME( "auto detection of DOS devices not supported on this platform\n" ); @@ -925,7 +926,7 @@ static char *get_device_mount_point( dev_t dev ) #ifdef linux FILE *f; - RtlEnterCriticalSection( &dir_section ); + pthread_mutex_lock( &mnt_mutex ); #ifdef __ANDROID__ if ((f = fopen( "/proc/mounts", "r" ))) @@ -973,13 +974,13 @@ static char *get_device_mount_point( dev_t dev ) } fclose( f ); } - RtlLeaveCriticalSection( &dir_section ); + pthread_mutex_unlock( &mnt_mutex ); #elif defined(__APPLE__) struct statfs *entry; struct stat st; int i, size; - RtlEnterCriticalSection( &dir_section ); + pthread_mutex_lock( &mnt_mutex ); size = getmntinfo( &entry, MNT_NOWAIT ); for (i = 0; i < size; i++) @@ -992,7 +993,7 @@ static char *get_device_mount_point( dev_t dev ) break; } } - RtlLeaveCriticalSection( &dir_section ); + pthread_mutex_unlock( &mnt_mutex ); #else static int warned; if (!warned++) FIXME( "unmounting devices not supported on this platform\n" );
1
0
0
0
Alexandre Julliard : ntdll: Use a pthread mutex for the timezone section.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 99520e1997b92155b9e389513960b0bdacfab9b2 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=99520e1997b92155b9e38951…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Jul 13 18:44:02 2020 +0200 ntdll: Use a pthread mutex for the timezone section. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/system.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/dlls/ntdll/unix/system.c b/dlls/ntdll/unix/system.c index c3dca7ffe2..3557df6108 100644 --- a/dlls/ntdll/unix/system.c +++ b/dlls/ntdll/unix/system.c @@ -1876,17 +1876,9 @@ static time_t find_dst_change(unsigned long min, unsigned long max, int *is_dst) return min; } -static RTL_CRITICAL_SECTION TIME_tz_section; -static RTL_CRITICAL_SECTION_DEBUG critsect_debug = -{ - 0, 0, &TIME_tz_section, - { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, - 0, 0, { (DWORD_PTR)(__FILE__ ": TIME_tz_section") } -}; -static RTL_CRITICAL_SECTION TIME_tz_section = { &critsect_debug, -1, 0, 0, 0, 0 }; - static void get_timezone_info( RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi ) { + static pthread_mutex_t tz_mutex = PTHREAD_MUTEX_INITIALIZER; static RTL_DYNAMIC_TIME_ZONE_INFORMATION cached_tzi; static int current_year = -1, current_bias = 65535; struct tm *tm; @@ -1894,7 +1886,7 @@ static void get_timezone_info( RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi ) time_t year_start, year_end, tmp, dlt = 0, std = 0; int is_dst, bias; - RtlEnterCriticalSection( &TIME_tz_section ); + pthread_mutex_lock( &tz_mutex ); year_start = time(NULL); tm = gmtime(&year_start); @@ -1904,7 +1896,7 @@ static void get_timezone_info( RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi ) if (current_year == tm->tm_year && current_bias == bias) { *tzi = cached_tzi; - RtlLeaveCriticalSection( &TIME_tz_section ); + pthread_mutex_unlock( &tz_mutex ); return; } @@ -1997,7 +1989,7 @@ static void get_timezone_info( RTL_DYNAMIC_TIME_ZONE_INFORMATION *tzi ) find_reg_tz_info(tzi, tz_name, current_year + 1900); cached_tzi = *tzi; - RtlLeaveCriticalSection( &TIME_tz_section ); + pthread_mutex_unlock( &tz_mutex ); }
1
0
0
0
← Newer
1
...
52
53
54
55
56
57
58
...
83
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Results per page:
10
25
50
100
200