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
June 2020
----- 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
947 discussions
Start a n
N
ew thread
Vijay Kiran Kamuju : include: Add IMarkupServices2, IMarkupContainer2 and IMarkupPointer2 related interfaces.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: cbf16e4c4c119eedcdf00bbd4706c563ef8a488e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cbf16e4c4c119eedcdf00bbd…
Author: Vijay Kiran Kamuju <infyquest(a)gmail.com> Date: Sun Jun 7 21:49:28 2020 +0200 include: Add IMarkupServices2, IMarkupContainer2 and IMarkupPointer2 related interfaces. Signed-off-by: Vijay Kiran Kamuju <infyquest(a)gmail.com> Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/mshtml.idl | 282 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 266 insertions(+), 16 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=cbf16e4c4c119eedcdf0…
1
0
0
0
Damjan Jovanovic : ntdll: Interpretation of l_addr depends on FreeBSD version.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: f728a5f3f9a4f1cad64aa3a1d3e9951940b0955c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f728a5f3f9a4f1cad64aa3a1…
Author: Damjan Jovanovic <damjan.jov(a)gmail.com> Date: Wed Jun 10 05:15:20 2020 +0200 ntdll: Interpretation of l_addr depends on FreeBSD version. FreeBSD changed l_addr to mean the relocation offset like it does on other OSes, and provided a dynamic linker symbol, "_rtld_version_laddr_offset", that can be used to check the meaning. Signed-off-by: Damjan Jovanovic <damjan.jov(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 0c8f05285c..c2e65c94ab 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1372,8 +1372,10 @@ static void call_constructors( WINE_MODREF *wm ) { caddr_t relocbase = (caddr_t)map->l_addr; -#ifdef __FreeBSD__ /* FreeBSD doesn't relocate l_addr */ - if (!get_relocbase(map->l_addr, &relocbase)) return; +#ifdef __FreeBSD__ + /* On older FreeBSD versions, l_addr was the absolute load address, now it's the relocation offset. */ + if (!dlsym(RTLD_DEFAULT, "_rtld_version_laddr_offset")) + if (!get_relocbase(map->l_addr, &relocbase)) return; #endif switch (dyn->d_tag) {
1
0
0
0
Ziqing Hui : windowscodecs: Implement DdsFrameDecode_Dds_CopyBlocks().
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: fed3784ab0721cb55189df0b0346353296d3eb57 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fed3784ab0721cb55189df0b…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Tue Jun 9 12:29:01 2020 +0800 windowscodecs: Implement DdsFrameDecode_Dds_CopyBlocks(). Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Esme Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/ddsformat.c | 42 ++++++++++++++++++++++++++++++++++-- dlls/windowscodecs/tests/ddsformat.c | 42 ++++++++++++++++++------------------ 2 files changed, 61 insertions(+), 23 deletions(-) diff --git a/dlls/windowscodecs/ddsformat.c b/dlls/windowscodecs/ddsformat.c index 54126c13d7..7a27c48dee 100644 --- a/dlls/windowscodecs/ddsformat.c +++ b/dlls/windowscodecs/ddsformat.c @@ -475,9 +475,47 @@ static HRESULT WINAPI DdsFrameDecode_Dds_CopyBlocks(IWICDdsFrameDecode *iface, const WICRect *boundsInBlocks, UINT stride, UINT bufferSize, BYTE *buffer) { - FIXME("(%p,%p,%u,%u,%p): stub.\n", iface, boundsInBlocks, stride, bufferSize, buffer); + DdsFrameDecode *This = impl_from_IWICDdsFrameDecode(iface); + int x, y, width, height; + UINT bytes_per_block, frame_stride, frame_size, i; + BYTE *data, *dst_buffer; + + TRACE("(%p,%p,%u,%u,%p)\n", iface, boundsInBlocks, stride, bufferSize, buffer); + + if (!buffer) return E_INVALIDARG; + + bytes_per_block = This->info.bytes_per_block; + frame_stride = This->info.width_in_blocks * bytes_per_block; + frame_size = frame_stride * This->info.height_in_blocks; + if (!boundsInBlocks) { + if (stride < frame_stride) return E_INVALIDARG; + if (bufferSize < frame_size) return E_INVALIDARG; + memcpy(buffer, This->data, frame_size); + return S_OK; + } - return E_NOTIMPL; + x = boundsInBlocks->X; + y = boundsInBlocks->Y; + width = boundsInBlocks->Width; + height = boundsInBlocks->Height; + if (x < 0 || y < 0 || width <= 0 || height <= 0 || + x + width > This->info.width_in_blocks || + y + height > This->info.height_in_blocks) { + return E_INVALIDARG; + } + if (stride < width * bytes_per_block) return E_INVALIDARG; + if (bufferSize < stride * height) return E_INVALIDARG; + + data = This->data + (x + y * This->info.width_in_blocks) * bytes_per_block; + dst_buffer = buffer; + for (i = 0; i < height; i++) + { + memcpy(dst_buffer, data, (size_t)width * bytes_per_block); + data += This->info.width_in_blocks * bytes_per_block; + dst_buffer += stride; + } + + return S_OK; } static const IWICDdsFrameDecodeVtbl DdsFrameDecode_Dds_Vtbl = { diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c index d718a07f96..a69ff35dcb 100644 --- a/dlls/windowscodecs/tests/ddsformat.c +++ b/dlls/windowscodecs/tests/ddsformat.c @@ -537,46 +537,46 @@ static void test_dds_decoder_frame_data(IWICDdsFrameDecode *dds_frame, UINT fram frame_size = frame_stride * height_in_blocks; hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, 0, 0, NULL); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_a, stride, sizeof(buffer), buffer); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_b, stride, sizeof(buffer), buffer); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_c, stride, sizeof(buffer), buffer); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_d, stride, sizeof(buffer), buffer); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride - 1, sizeof(buffer), buffer); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride * 2, sizeof(buffer), buffer); - todo_wine ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, sizeof(buffer), buffer); - todo_wine ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, frame_stride * height_in_blocks - 1, buffer); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, frame_stride * height_in_blocks, buffer); - todo_wine ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, 0, sizeof(buffer), buffer); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride - 1, sizeof(buffer), buffer); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride * 2, sizeof(buffer), buffer); - todo_wine ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, 0, buffer); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, 1, buffer); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, stride * rect.Height - 1, buffer); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, stride * rect.Height, buffer); - todo_wine ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, sizeof(buffer), NULL); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); block_offset = 128; /* DDS magic and header */ if (has_extended_header(test_data[i].data)) block_offset += 20; /* DDS extended header */ @@ -600,19 +600,19 @@ static void test_dds_decoder_frame_data(IWICDdsFrameDecode *dds_frame, UINT fram } hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, sizeof(buffer), buffer); - todo_wine ok (hr == S_OK, "%d: [frame %d] CopyBlocks failed, hr=%x\n", i, frame_index, hr); + ok (hr == S_OK, "%d: [frame %d] CopyBlocks failed, hr=%x\n", i, frame_index, hr); if (hr != S_OK) return; ok (!strncmp((const char *)test_data[i].data + block_offset, (const char *)buffer, format_info.BytesPerBlock), "%d: [frame %d] Block data mismatch\n", i, frame_index); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, sizeof(buffer), buffer); - todo_wine ok (hr == S_OK, "%d: [frame %d] CopyBlocks failed, hr=%x\n", i, frame_index, hr); + ok (hr == S_OK, "%d: [frame %d] CopyBlocks failed, hr=%x\n", i, frame_index, hr); if (hr != S_OK) return; ok (!strncmp((const char *)test_data[i].data + block_offset, (const char *)buffer, frame_size), "%d: [frame %d] Block data mismatch\n", i, frame_index); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride * 2, sizeof(buffer), buffer); - todo_wine ok (hr == S_OK, "%d: [frame %d] CopyBlocks failed, hr=%x\n", i, frame_index, hr); + ok (hr == S_OK, "%d: [frame %d] CopyBlocks failed, hr=%x\n", i, frame_index, hr); if (hr != S_OK) return; ok (!strncmp((const char *)test_data[i].data + block_offset, (const char *)buffer, frame_size), "%d: [frame %d] Block data mismatch\n", i, frame_index);
1
0
0
0
Ziqing Hui : windowscodecs/tests: Add more tests for DdsFrameDecode_Dds_CopyBlocks() when "boundsInBlocks" is NULL.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: e51a70748797726f91368f817673be8ea8f01d4e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e51a70748797726f91368f81…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Tue Jun 9 12:28:41 2020 +0800 windowscodecs/tests: Add more tests for DdsFrameDecode_Dds_CopyBlocks() when "boundsInBlocks" is NULL. The added tests shows that when boundsInBlocks parameter is NULL, stride parameter will be checked to ensure it is bigger or equal to frame stride, but it will be ignored in the call. This can be proved by: * CopyBlocks(NULL, frame_stride - 1, sizeof(buffer), buffer) return error. * CopyBlocks(NULL, frame_stride, sizeof(buffer), buffer) and CopyBlocks(NULL, frame_stride * 2, sizeof(buffer), buffer) works fine and result in same buffer content. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Esme Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/tests/ddsformat.c | 37 +++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c index a7fd8c1973..d718a07f96 100644 --- a/dlls/windowscodecs/tests/ddsformat.c +++ b/dlls/windowscodecs/tests/ddsformat.c @@ -521,7 +521,7 @@ static void test_dds_decoder_frame_data(IWICDdsFrameDecode *dds_frame, UINT fram WICRect rect = { 0, 0, 1, 1 }, rect_test_a = { 0, 0, 0, 0 }, rect_test_b = { 0, 0, 0xdeadbeaf, 0xdeadbeaf }; WICRect rect_test_c = { -0xdeadbeaf, -0xdeadbeaf, 1, 1 }, rect_test_d = { 0xdeadbeaf, 0xdeadbeaf, 1, 1 }; BYTE buffer[256]; - UINT stride, frame_stride, width_in_blocks, height_in_blocks; + UINT stride, frame_stride, frame_size, width_in_blocks, height_in_blocks; UINT width, height, depth, array_index; UINT block_offset; int slice_index; @@ -534,6 +534,10 @@ static void test_dds_decoder_frame_data(IWICDdsFrameDecode *dds_frame, UINT fram if (hr != S_OK) return; stride = rect.Width * format_info.BytesPerBlock; frame_stride = width_in_blocks * format_info.BytesPerBlock; + frame_size = frame_stride * height_in_blocks; + + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, 0, 0, NULL); + todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_a, stride, sizeof(buffer), buffer); todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); @@ -543,8 +547,17 @@ static void test_dds_decoder_frame_data(IWICDdsFrameDecode *dds_frame, UINT fram todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_d, stride, sizeof(buffer), buffer); todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride - 1, sizeof(buffer), buffer); + todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride * 2, sizeof(buffer), buffer); + todo_wine ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, sizeof(buffer), buffer); todo_wine ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, frame_stride * height_in_blocks - 1, buffer); + todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, frame_stride * height_in_blocks, buffer); + todo_wine ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, 0, sizeof(buffer), buffer); todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); @@ -565,12 +578,6 @@ static void test_dds_decoder_frame_data(IWICDdsFrameDecode *dds_frame, UINT fram hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, sizeof(buffer), NULL); todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); - hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, 0, 0, NULL); - todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); - hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, sizeof(buffer), buffer); - todo_wine ok (hr == S_OK, "%d: [frame %d] CopyBlocks failed, hr=%x\n", i, frame_index, hr); - if (hr != S_OK) return; - block_offset = 128; /* DDS magic and header */ if (has_extended_header(test_data[i].data)) block_offset += 20; /* DDS extended header */ width = params->Width; @@ -591,8 +598,24 @@ static void test_dds_decoder_frame_data(IWICDdsFrameDecode *dds_frame, UINT fram slice_index -= depth; if (depth > 1) depth /= 2; } + + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, sizeof(buffer), buffer); + todo_wine ok (hr == S_OK, "%d: [frame %d] CopyBlocks failed, hr=%x\n", i, frame_index, hr); + if (hr != S_OK) return; ok (!strncmp((const char *)test_data[i].data + block_offset, (const char *)buffer, format_info.BytesPerBlock), "%d: [frame %d] Block data mismatch\n", i, frame_index); + + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, sizeof(buffer), buffer); + todo_wine ok (hr == S_OK, "%d: [frame %d] CopyBlocks failed, hr=%x\n", i, frame_index, hr); + if (hr != S_OK) return; + ok (!strncmp((const char *)test_data[i].data + block_offset, (const char *)buffer, frame_size), + "%d: [frame %d] Block data mismatch\n", i, frame_index); + + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride * 2, sizeof(buffer), buffer); + todo_wine ok (hr == S_OK, "%d: [frame %d] CopyBlocks failed, hr=%x\n", i, frame_index, hr); + if (hr != S_OK) return; + ok (!strncmp((const char *)test_data[i].data + block_offset, (const char *)buffer, frame_size), + "%d: [frame %d] Block data mismatch\n", i, frame_index); } static void test_dds_decoder_frame(IWICBitmapDecoder *decoder, int i)
1
0
0
0
Ziqing Hui : windowscodecs/tests: Add a DXT3 test image for DDS decoder.
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: 71e92c029a056077bd9e2de6af34896791d29c34 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=71e92c029a056077bd9e2de6…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Tue Jun 9 12:28:09 2020 +0800 windowscodecs/tests: Add a DXT3 test image for DDS decoder. We only tested DXT1 images with 1 blocks before. That's not enough. Also, for CopyBlocks(), when boundsInBlocks parameter is NULL, the stride should be the stride of the frame itself. Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Esme Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/tests/ddsformat.c | 67 +++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 8 deletions(-) diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c index 5195dada13..a7fd8c1973 100644 --- a/dlls/windowscodecs/tests/ddsformat.c +++ b/dlls/windowscodecs/tests/ddsformat.c @@ -120,6 +120,50 @@ static BYTE test_dds_array[] = { 0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00 }; +/* 12x12 compressed(DXT3) texture array, arraySize=2, mipMapCount=4 */ +static BYTE test_dds_dxt3[] = { + 'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0A, 0x00, 0x0C, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 'D', 'X', '1', '0', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB5, 0xA7, 0xAD, 0x83, + 0x60, 0x60, 0xE0, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x12, 0x96, 0x6B, 0x72, + 0xD5, 0xD5, 0xAF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x30, 0x8D, 0x89, 0x69, + 0x57, 0x5F, 0x5E, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB4, 0xA7, 0xAD, 0x83, + 0x00, 0xAA, 0xFF, 0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF3, 0x9E, 0x6D, 0x83, + 0x00, 0x00, 0xAA, 0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x12, 0x96, 0xCD, 0x83, + 0x5C, 0xF8, 0xAA, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0x7A, 0xC9, 0x71, + 0x80, 0x60, 0x60, 0x60, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4A, 0x72, 0xA8, 0x68, + 0x28, 0xBE, 0xD7, 0xD7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0x8C, 0xEA, 0x71, + 0x0B, 0xAB, 0xAD, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x54, 0x9F, 0xCC, 0x7A, + 0x5C, 0xA8, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x50, 0x8D, 0x49, 0x69, + 0x77, 0xEE, 0x88, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0C, 0x7B, 0x08, 0x69, + 0xF8, 0x58, 0xF8, 0x58, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4E, 0x84, 0x6B, 0x72, + 0x33, 0x99, 0x33, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x14, 0x9F, 0x0A, 0x72, + 0xDC, 0xAA, 0x75, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0E, 0x84, 0x0E, 0x84, + 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB5, 0xA7, 0xAD, 0x83, + 0x60, 0x60, 0xE0, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x12, 0x96, 0x6B, 0x72, + 0xD5, 0xD5, 0xAF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x30, 0x8D, 0x89, 0x69, + 0x57, 0x5F, 0x5E, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB4, 0xA7, 0xAD, 0x83, + 0x00, 0xAA, 0xFF, 0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF3, 0x9E, 0x6D, 0x83, + 0x00, 0x00, 0xAA, 0x55, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x12, 0x96, 0xCD, 0x83, + 0x5C, 0xF8, 0xAA, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0x7A, 0xC9, 0x71, + 0x80, 0x60, 0x60, 0x60, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4A, 0x72, 0xA8, 0x68, + 0x28, 0xBE, 0xD7, 0xD7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0x8C, 0xEA, 0x71, + 0x0B, 0xAB, 0xAD, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x54, 0x9F, 0xCC, 0x7A, + 0x5C, 0xA8, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x50, 0x8D, 0x49, 0x69, + 0x77, 0xEE, 0x88, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0C, 0x7B, 0x08, 0x69, + 0xF8, 0x58, 0xF8, 0x58, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4E, 0x84, 0x6B, 0x72, + 0x33, 0x99, 0x33, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x14, 0x9F, 0x0A, 0x72, + 0xDC, 0xAA, 0x75, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0E, 0x84, 0x0E, 0x84, + 0x00, 0x00, 0x00, 0x00 +}; + static struct test_data { BYTE *data; UINT size; @@ -127,13 +171,15 @@ static struct test_data { WICDdsParameters expected_parameters; } test_data[] = { { test_dds_image, sizeof(test_dds_image), 1, - { 4, 4, 1, 1, 1, DXGI_FORMAT_BC1_UNORM, WICDdsTexture2D, WICDdsAlphaModePremultiplied } }, + { 4, 4, 1, 1, 1, DXGI_FORMAT_BC1_UNORM, WICDdsTexture2D, WICDdsAlphaModePremultiplied } }, { test_dds_mipmaps, sizeof(test_dds_mipmaps), 3, - { 4, 4, 1, 3, 1, DXGI_FORMAT_BC1_UNORM, WICDdsTexture2D, WICDdsAlphaModePremultiplied } }, + { 4, 4, 1, 3, 1, DXGI_FORMAT_BC1_UNORM, WICDdsTexture2D, WICDdsAlphaModePremultiplied } }, { test_dds_volume, sizeof(test_dds_volume), 7, - { 4, 4, 4, 3, 1, DXGI_FORMAT_BC1_UNORM, WICDdsTexture3D, WICDdsAlphaModePremultiplied } }, + { 4, 4, 4, 3, 1, DXGI_FORMAT_BC1_UNORM, WICDdsTexture3D, WICDdsAlphaModePremultiplied } }, { test_dds_array, sizeof(test_dds_array), 9, - { 4, 4, 1, 3, 3, DXGI_FORMAT_BC1_UNORM, WICDdsTexture2D, WICDdsAlphaModeUnknown } }, + { 4, 4, 1, 3, 3, DXGI_FORMAT_BC1_UNORM, WICDdsTexture2D, WICDdsAlphaModeUnknown } }, + { test_dds_dxt3, sizeof(test_dds_dxt3), 8, + { 12, 12, 1, 4, 2, DXGI_FORMAT_BC2_UNORM, WICDdsTexture2D, WICDdsAlphaModeUnknown } }, }; static IWICImagingFactory *factory = NULL; @@ -237,6 +283,7 @@ static void test_dds_decoder_initialize(void) { 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_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 }, @@ -472,9 +519,9 @@ static void test_dds_decoder_frame_data(IWICDdsFrameDecode *dds_frame, UINT fram HRESULT hr; WICDdsFormatInfo format_info; WICRect rect = { 0, 0, 1, 1 }, rect_test_a = { 0, 0, 0, 0 }, rect_test_b = { 0, 0, 0xdeadbeaf, 0xdeadbeaf }; - WICRect rect_test_c = { -0xdeadbeaf, -0xdeadbeaf, 1, 1 }, rect_test_d = { 1, 1, 1, 1 }; - BYTE buffer[32]; - UINT stride, width_in_blocks, height_in_blocks; + WICRect rect_test_c = { -0xdeadbeaf, -0xdeadbeaf, 1, 1 }, rect_test_d = { 0xdeadbeaf, 0xdeadbeaf, 1, 1 }; + BYTE buffer[256]; + UINT stride, frame_stride, width_in_blocks, height_in_blocks; UINT width, height, depth, array_index; UINT block_offset; int slice_index; @@ -482,7 +529,11 @@ static void test_dds_decoder_frame_data(IWICDdsFrameDecode *dds_frame, UINT fram hr = IWICDdsFrameDecode_GetFormatInfo(dds_frame, &format_info); ok (hr == S_OK, "%d: [frame %d] GetFormatInfo failed, hr=%x\n", i, frame_index, hr); if (hr != S_OK) return; + hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, &width_in_blocks, &height_in_blocks); + ok (hr == S_OK, "%d: [frame %d] GetSizeInBlocks failed, hr=%x\n", i, frame_index, hr); + if (hr != S_OK) return; stride = rect.Width * format_info.BytesPerBlock; + frame_stride = width_in_blocks * format_info.BytesPerBlock; hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_a, stride, sizeof(buffer), buffer); todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); @@ -492,7 +543,7 @@ static void test_dds_decoder_frame_data(IWICDdsFrameDecode *dds_frame, UINT fram todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_d, stride, sizeof(buffer), buffer); todo_wine ok (hr == E_INVALIDARG, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); - hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, stride, sizeof(buffer), buffer); + hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, sizeof(buffer), buffer); todo_wine ok (hr == S_OK, "%d: [frame %d] Got unexpected hr %x\n", i, frame_index, hr); hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, 0, sizeof(buffer), buffer);
1
0
0
0
Ziqing Hui : windowscodecs: Initialize block data in DdsDecoder_Dds_GetFrame().
by Alexandre Julliard
10 Jun '20
10 Jun '20
Module: wine Branch: master Commit: a805c1f198377de29e129241584df062764a56d4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a805c1f198377de29e129241…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Tue Jun 9 12:27:47 2020 +0800 windowscodecs: Initialize block data in DdsDecoder_Dds_GetFrame(). Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Esme Povirk <vincent(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/windowscodecs/ddsformat.c | 68 +++++++++++++++++++++++++++++++++--------- 1 file changed, 54 insertions(+), 14 deletions(-) diff --git a/dlls/windowscodecs/ddsformat.c b/dlls/windowscodecs/ddsformat.c index ce6cb9794c..54126c13d7 100644 --- a/dlls/windowscodecs/ddsformat.c +++ b/dlls/windowscodecs/ddsformat.c @@ -57,6 +57,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(wincodecs); #define DDS_RESOURCE_MISC_TEXTURECUBE 0x00000004 +#define DDS_BLOCK_WIDTH 4 +#define DDS_BLOCK_HEIGHT 4 + typedef struct { DWORD size; DWORD flags; @@ -132,6 +135,7 @@ typedef struct DdsFrameDecode { IWICBitmapFrameDecode IWICBitmapFrameDecode_iface; IWICDdsFrameDecode IWICDdsFrameDecode_iface; LONG ref; + BYTE *data; dds_frame_info info; } DdsFrameDecode; @@ -322,7 +326,10 @@ static ULONG WINAPI DdsFrameDecode_Release(IWICBitmapFrameDecode *iface) TRACE("(%p) refcount=%u\n", iface, ref); - if (ref == 0) HeapFree(GetProcessHeap(), 0, This); + if (ref == 0) { + HeapFree(GetProcessHeap(), 0, This->data); + HeapFree(GetProcessHeap(), 0, This); + } return ref; } @@ -811,9 +818,11 @@ static HRESULT WINAPI DdsDecoder_Dds_GetFrame(IWICDdsDecoder *iface, { DdsDecoder *This = impl_from_IWICDdsDecoder(iface); HRESULT hr; - UINT width = 0, height = 0; - int j; - DdsFrameDecode *frame_decode; + LARGE_INTEGER seek; + UINT width, height, depth, width_in_blocks, height_in_blocks, size; + UINT frame_width = 0, frame_height = 0, frame_width_in_blocks = 0, frame_height_in_blocks = 0, frame_size = 0; + UINT bytes_per_block, bytesread, i; + DdsFrameDecode *frame_decode = NULL; TRACE("(%p,%u,%u,%u,%p)\n", iface, arrayIndex, mipLevel, sliceIndex, bitmapFrame); @@ -825,31 +834,60 @@ static HRESULT WINAPI DdsDecoder_Dds_GetFrame(IWICDdsDecoder *iface, hr = WINCODEC_ERR_WRONGSTATE; goto end; } - if (arrayIndex >= This->info.array_size || mipLevel >= This->info.mip_levels || sliceIndex >= This->info.depth) { hr = E_INVALIDARG; goto end; } + 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); + width = This->info.width; height = This->info.height; - for (j = 0; j < mipLevel; j++) + depth = This->info.depth; + for (i = 0; i < This->info.mip_levels; i++) { + width_in_blocks = (width + DDS_BLOCK_WIDTH - 1) / DDS_BLOCK_WIDTH; + height_in_blocks = (height + DDS_BLOCK_HEIGHT - 1) / DDS_BLOCK_HEIGHT; + size = width_in_blocks * height_in_blocks * bytes_per_block; + + if (i < mipLevel) { + seek.QuadPart += size * depth; + } else if (i == mipLevel){ + seek.QuadPart += size * sliceIndex; + frame_width = width; + frame_height = height; + frame_width_in_blocks = width_in_blocks; + frame_height_in_blocks = height_in_blocks; + frame_size = frame_width_in_blocks * frame_height_in_blocks * bytes_per_block; + if (arrayIndex == 0) break; + } + seek.QuadPart += arrayIndex * size * depth; + if (width > 1) width /= 2; if (height > 1) height /= 2; + if (depth > 1) depth /= 2; } hr = DdsFrameDecode_CreateInstance(&frame_decode); if (hr != S_OK) goto end; - - frame_decode->info.width = width; - frame_decode->info.height = height; + frame_decode->info.width = frame_width; + frame_decode->info.height = frame_height; frame_decode->info.format = This->info.format; - frame_decode->info.bytes_per_block = get_bytes_per_block(This->info.format); - frame_decode->info.block_width = 4; - frame_decode->info.block_height = 4; - frame_decode->info.width_in_blocks = (width + frame_decode->info.block_width - 1) / frame_decode->info.block_width; - frame_decode->info.height_in_blocks = (width + frame_decode->info.block_height - 1) / frame_decode->info.block_height; + frame_decode->info.bytes_per_block = bytes_per_block; + frame_decode->info.block_width = DDS_BLOCK_WIDTH; + frame_decode->info.block_height = DDS_BLOCK_HEIGHT; + frame_decode->info.width_in_blocks = frame_width_in_blocks; + frame_decode->info.height_in_blocks = frame_height_in_blocks; + frame_decode->data = HeapAlloc(GetProcessHeap(), 0, frame_size); + hr = IStream_Seek(This->stream, seek, SEEK_SET, NULL); + if (hr != S_OK) goto end; + hr = IStream_Read(This->stream, frame_decode->data, frame_size, &bytesread); + if (hr != S_OK || bytesread != frame_size) { + hr = WINCODEC_ERR_STREAMREAD; + goto end; + } *bitmapFrame = &frame_decode->IWICBitmapFrameDecode_iface; hr = S_OK; @@ -857,6 +895,8 @@ static HRESULT WINAPI DdsDecoder_Dds_GetFrame(IWICDdsDecoder *iface, end: LeaveCriticalSection(&This->lock); + if (hr != S_OK && frame_decode) DdsFrameDecode_Release(&frame_decode->IWICBitmapFrameDecode_iface); + return hr; }
1
0
0
0
Piotr Caban : vcruntime140_1: Add support for pointer to object in unwind info.
by Alexandre Julliard
09 Jun '20
09 Jun '20
Module: wine Branch: master Commit: bf454cc39428fc5299e5c26d9c0ddc6a9277c7ae URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bf454cc39428fc5299e5c26d…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Mon Jun 8 20:29:39 2020 +0200 vcruntime140_1: Add support for pointer to object in unwind info. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49307
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/vcruntime140_1/except_x86_64.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/dlls/vcruntime140_1/except_x86_64.c b/dlls/vcruntime140_1/except_x86_64.c index b4b7bd2348..0e27b02db1 100644 --- a/dlls/vcruntime140_1/except_x86_64.c +++ b/dlls/vcruntime140_1/except_x86_64.c @@ -79,6 +79,7 @@ typedef struct #define UNWIND_TYPE_NO_HANDLER 0 #define UNWIND_TYPE_DTOR_OBJ 1 +#define UNWIND_TYPE_DTOR_PTR 2 #define UNWIND_TYPE_FRAME 3 typedef struct @@ -162,7 +163,7 @@ static inline void* rva_to_ptr(UINT rva, ULONG64 base) return rva ? (void*)(base+rva) : NULL; } -static BOOL read_unwind_info(BYTE **b, unwind_info *ui) +static void read_unwind_info(BYTE **b, unwind_info *ui) { BYTE *p = *b; @@ -174,17 +175,18 @@ static BOOL read_unwind_info(BYTE **b, unwind_info *ui) switch (ui->type) { case UNWIND_TYPE_NO_HANDLER: - return TRUE; + break; case UNWIND_TYPE_DTOR_OBJ: ui->handler = read_rva(b); - ui->object = decode_uint(b); /* frame offset */ - return TRUE; + ui->object = decode_uint(b); /* frame offset to object */ + break; + case UNWIND_TYPE_DTOR_PTR: + ui->handler = read_rva(b); + ui->object = decode_uint(b); /* frame offset to pointer to object */ + break; case UNWIND_TYPE_FRAME: ui->handler = read_rva(b); - return TRUE; - default: - FIXME("unknown type: %d\n", ui->type); - return FALSE; + break; } } @@ -277,7 +279,7 @@ static BOOL validate_cxx_function_descr4(const cxx_function_descr *descr, DISPAT BYTE *entry = unwind_map; unwind_info ui; - if (!read_unwind_info(&unwind_map, &ui)) return FALSE; + read_unwind_info(&unwind_map, &ui); if (ui.prev < (BYTE*)rva_to_ptr(descr->unwind_map, image_base)) ui.prev = NULL; TRACE(" %d (%p): type 0x%x prev %p func 0x%x(%p) object 0x%x\n", i, entry, ui.type, ui.prev, ui.handler, @@ -452,6 +454,8 @@ static void cxx_local_unwind4(ULONG64 frame, DISPATCHER_CONTEXT *dispatch, { handler_dtor = rva_to_ptr(ui.handler, dispatch->ImageBase); obj = rva_to_ptr(ui.object, frame); + if(ui.type == UNWIND_TYPE_DTOR_PTR) + obj = *(void**)obj; TRACE("handler: %p object: %p\n", handler_dtor, obj); handler_dtor(obj, frame); }
1
0
0
0
Paul Gofman : ntdll: Perform fsync() in client for files and directories.
by Alexandre Julliard
09 Jun '20
09 Jun '20
Module: wine Branch: master Commit: 3078f10d43d834b0498358fe0accb565191b7020 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3078f10d43d834b0498358fe…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Jun 9 20:00:07 2020 +0300 ntdll: Perform fsync() in client for files and directories. Fixes stuttering in Assetto Corsa Competizione (multiplayer mode). Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/file.c | 10 +++++++++- dlls/ntdll/tests/file.c | 21 +++++++++++++++++++++ server/file.c | 14 +------------- 3 files changed, 31 insertions(+), 14 deletions(-) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 1b70e47367..aba7b608f6 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -3584,7 +3584,15 @@ NTSTATUS WINAPI NtFlushBuffersFile( HANDLE hFile, IO_STATUS_BLOCK *io ) if (ret == STATUS_ACCESS_DENIED) ret = unix_funcs->server_get_unix_fd( hFile, FILE_APPEND_DATA, &fd, &needs_close, &type, NULL ); - if (!ret && type == FD_TYPE_SERIAL) + if (!ret && (type == FD_TYPE_FILE || type == FD_TYPE_DIR)) + { + if (fsync(fd)) + ret = FILE_GetNtStatus(); + + io->u.Status = ret; + io->Information = 0; + } + else if (!ret && type == FD_TYPE_SERIAL) { ret = COMM_FlushBuffersFile( fd ); } diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 1d0682a633..184b7cdad5 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -4860,14 +4860,26 @@ static void test_flush_buffers_file(void) status = pNtFlushBuffersFile(hfile, (IO_STATUS_BLOCK *)0xdeadbeaf); ok(status == STATUS_ACCESS_VIOLATION, "expected STATUS_ACCESS_VIOLATION, got %#x.\n", status); + io_status_block.Information = 0xdeadbeef; + io_status_block.Status = 0xdeadbeef; status = pNtFlushBuffersFile(hfile, &io_status_block); ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x.\n", status); + ok(io_status_block.Status == STATUS_SUCCESS, "Got unexpected io_status_block.Status %#x.\n", + io_status_block.Status); + ok(!io_status_block.Information, "Got unexpected io_status_block.Information %#lx.\n", + io_status_block.Information); status = pNtFlushBuffersFile(hfileread, &io_status_block); ok(status == STATUS_ACCESS_DENIED, "expected STATUS_ACCESS_DENIED, got %#x.\n", status); + io_status_block.Information = 0xdeadbeef; + io_status_block.Status = 0xdeadbeef; status = pNtFlushBuffersFile(NULL, &io_status_block); ok(status == STATUS_INVALID_HANDLE, "expected STATUS_INVALID_HANDLE, got %#x.\n", status); + ok(io_status_block.Status == 0xdeadbeef, "Got unexpected io_status_block.Status %#x.\n", + io_status_block.Status); + ok(io_status_block.Information == 0xdeadbeef, "Got unexpected io_status_block.Information %#lx.\n", + io_status_block.Information); CloseHandle(hfileread); CloseHandle(hfile); @@ -4878,6 +4890,15 @@ static void test_flush_buffers_file(void) status = pNtFlushBuffersFile(hfile, &io_status_block); ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x.\n", status); + io_status_block.Information = 0xdeadbeef; + io_status_block.Status = 0xdeadbeef; + status = pNtFlushBuffersFile((HANDLE)0xdeadbeef, &io_status_block); + ok(status == STATUS_INVALID_HANDLE, "expected STATUS_INVALID_HANDLE, got %#x.\n", status); + ok(io_status_block.Status == 0xdeadbeef, "Got unexpected io_status_block.Status %#x.\n", + io_status_block.Status); + ok(io_status_block.Information == 0xdeadbeef, "Got unexpected io_status_block.Information %#lx.\n", + io_status_block.Information); + CloseHandle(hfile); DeleteFileA(buffer); } diff --git a/server/file.c b/server/file.c index bce202138e..38260cfd2b 100644 --- a/server/file.c +++ b/server/file.c @@ -75,7 +75,6 @@ static struct list *file_get_kernel_obj_list( struct object *obj ); static void file_destroy( struct object *obj ); static int file_get_poll_events( struct fd *fd ); -static int file_flush( struct fd *fd, struct async *async ); static enum server_fd_type file_get_fd_type( struct fd *fd ); static const struct object_ops file_ops = @@ -108,7 +107,7 @@ static const struct fd_ops file_fd_ops = file_get_fd_type, /* get_fd_type */ no_fd_read, /* read */ no_fd_write, /* write */ - file_flush, /* flush */ + no_fd_flush, /* flush */ default_fd_get_file_info, /* get_file_info */ no_fd_get_volume_info, /* get_volume_info */ default_fd_ioctl, /* ioctl */ @@ -296,17 +295,6 @@ static int file_get_poll_events( struct fd *fd ) return events; } -static int file_flush( struct fd *fd, struct async *async ) -{ - int unix_fd = get_unix_fd( fd ); - if (unix_fd != -1 && fsync( unix_fd ) == -1) - { - file_set_error(); - return 0; - } - return 1; -} - static enum server_fd_type file_get_fd_type( struct fd *fd ) { struct file *file = get_fd_user( fd );
1
0
0
0
Jacek Caban : ntoskrnl: Use loader notification callback to perform relocations.
by Alexandre Julliard
09 Jun '20
09 Jun '20
Module: wine Branch: master Commit: 39a585ef8c7f9516b220aeb52a67bb672a4bcf23 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=39a585ef8c7f9516b220aeb5…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Jun 9 18:03:14 2020 +0200 ntoskrnl: Use loader notification callback to perform relocations. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=49093
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntoskrnl.exe/ntoskrnl.c | 182 +++++++++++++++++-------------------------- include/winternl.h | 2 + 2 files changed, 72 insertions(+), 112 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=39a585ef8c7f9516b220…
1
0
0
0
Jacek Caban : mshtml: Use proper compat mode in IHTMLWindow7::getComputedStyle.
by Alexandre Julliard
09 Jun '20
09 Jun '20
Module: wine Branch: master Commit: 77b24d25dbc71712ee2024301e1de090d51825ce URL:
https://source.winehq.org/git/wine.git/?a=commit;h=77b24d25dbc71712ee202430…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Jun 9 16:17:13 2020 +0200 mshtml: Use proper compat mode in IHTMLWindow7::getComputedStyle. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlstyle.c | 4 ++-- dlls/mshtml/htmlstyle.h | 2 +- dlls/mshtml/htmlwindow.c | 4 ++-- dlls/mshtml/tests/documentmode.js | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index 0971b22375..6df930e19a 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -10331,14 +10331,14 @@ static dispex_static_data_t HTMLW3CComputedStyle_dispex = { CSSStyle_init_dispex_info }; -HRESULT create_computed_style(nsIDOMCSSStyleDeclaration *nsstyle, IHTMLCSSStyleDeclaration **p) +HRESULT create_computed_style(nsIDOMCSSStyleDeclaration *nsstyle, compat_mode_t compat_mode, IHTMLCSSStyleDeclaration **p) { CSSStyle *style; if(!(style = heap_alloc_zero(sizeof(*style)))) return E_OUTOFMEMORY; - init_css_style(style, nsstyle, NULL, &HTMLW3CComputedStyle_dispex, COMPAT_MODE_IE11); + init_css_style(style, nsstyle, NULL, &HTMLW3CComputedStyle_dispex, compat_mode); *p = &style->IHTMLCSSStyleDeclaration_iface; return S_OK; } diff --git a/dlls/mshtml/htmlstyle.h b/dlls/mshtml/htmlstyle.h index f6154c9214..8746558fde 100644 --- a/dlls/mshtml/htmlstyle.h +++ b/dlls/mshtml/htmlstyle.h @@ -149,7 +149,7 @@ typedef enum { } styleid_t; HRESULT HTMLStyle_Create(HTMLElement*,HTMLStyle**) DECLSPEC_HIDDEN; -HRESULT create_computed_style(nsIDOMCSSStyleDeclaration*,IHTMLCSSStyleDeclaration**) DECLSPEC_HIDDEN; +HRESULT create_computed_style(nsIDOMCSSStyleDeclaration*,compat_mode_t,IHTMLCSSStyleDeclaration**) DECLSPEC_HIDDEN; void init_css_style(CSSStyle*,nsIDOMCSSStyleDeclaration*,style_qi_t, dispex_static_data_t*,compat_mode_t) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index c6ec26de55..a49cd4bd59 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -2332,7 +2332,7 @@ static HRESULT WINAPI HTMLWindow7_getComputedStyle(IHTMLWindow7 *iface, IHTMLDOM TRACE("(%p)->(%p %s %p)\n", This, node, debugstr_w(pseudo_elt), p); - if(!This->outer_window) + if(!This->outer_window || !This->inner_window) return E_UNEXPECTED; hres = IHTMLDOMNode_QueryInterface(node, &IID_IHTMLElement, (void**)&elem); @@ -2356,7 +2356,7 @@ static HRESULT WINAPI HTMLWindow7_getComputedStyle(IHTMLWindow7 *iface, IHTMLDOM return E_FAIL; } - hres = create_computed_style(nsstyle, p); + hres = create_computed_style(nsstyle, dispex_compat_mode(&This->inner_window->event_target.dispex), p); nsIDOMCSSStyleDeclaration_Release(nsstyle); return hres; } diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 82b163a13d..4b788c970b 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -184,6 +184,7 @@ function test_style_props() { test_exposed("setProperty", v >= 9); test_exposed("removeProperty", v >= 9); test_exposed("background-clip", v >= 9); + test_exposed("transform", v >= 10); } next_test();
1
0
0
0
← Newer
1
...
53
54
55
56
57
58
59
...
95
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
84
85
86
87
88
89
90
91
92
93
94
95
Results per page:
10
25
50
100
200