winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
770 discussions
Start a n
N
ew thread
Zebediah Figura : ws2_32/tests: Add some tests for opening the Afd device.
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: 4fe9055499315eca14fe9b0cfc06aa0b768b714a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4fe9055499315eca14fe9b0c…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 24 23:13:39 2021 -0500 ws2_32/tests: Add some tests for opening the Afd device. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ws2_32/tests/afd.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/dlls/ws2_32/tests/afd.c b/dlls/ws2_32/tests/afd.c index da42f878367..a02b4f3da27 100644 --- a/dlls/ws2_32/tests/afd.c +++ b/dlls/ws2_32/tests/afd.c @@ -39,6 +39,43 @@ static void set_blocking(SOCKET s, ULONG blocking) ok(!ret, "got error %u\n", WSAGetLastError()); } +static void test_open_device(void) +{ + OBJECT_BASIC_INFORMATION info; + OBJECT_ATTRIBUTES attr; + UNICODE_STRING string; + IO_STATUS_BLOCK io; + HANDLE handle; + SOCKET s; + int ret; + + RtlInitUnicodeString(&string, L"\\Device\\Afd"); + InitializeObjectAttributes(&attr, &string, 0, NULL, NULL); + ret = NtOpenFile(&handle, SYNCHRONIZE, &attr, &io, 0, 0); + ok(!ret, "got %#x\n", ret); + CloseHandle(handle); + + RtlInitUnicodeString(&string, L"\\Device\\Afd\\"); + InitializeObjectAttributes(&attr, &string, 0, NULL, NULL); + ret = NtOpenFile(&handle, SYNCHRONIZE, &attr, &io, 0, 0); + ok(!ret, "got %#x\n", ret); + CloseHandle(handle); + + RtlInitUnicodeString(&string, L"\\Device\\Afd\\foobar"); + InitializeObjectAttributes(&attr, &string, 0, NULL, NULL); + ret = NtOpenFile(&handle, SYNCHRONIZE, &attr, &io, 0, 0); + todo_wine ok(!ret, "got %#x\n", ret); + CloseHandle(handle); + + s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + ret = NtQueryObject((HANDLE)s, ObjectBasicInformation, &info, sizeof(info), NULL); + ok(!ret, "got %#x\n", ret); + todo_wine ok(info.Attributes == OBJ_INHERIT, "got attributes %#x\n", info.Attributes); + todo_wine ok(info.GrantedAccess == (FILE_GENERIC_READ | FILE_GENERIC_WRITE | WRITE_DAC), "got access %#x\n", info.GrantedAccess); + + closesocket(s); +} + static void test_recv(void) { const struct sockaddr_in bind_addr = {.sin_family = AF_INET, .sin_addr.s_addr = htonl(INADDR_LOOPBACK)}; @@ -397,6 +434,7 @@ START_TEST(afd) WSAStartup(MAKEWORD(2, 2), &data); + test_open_device(); test_recv(); WSACleanup();
1
0
0
0
Zebediah Figura : user32: Blit the right bitmap when stretching monochrome icons in CopyImage().
by Alexandre Julliard
25 May '21
25 May '21
Module: wine Branch: master Commit: d2259665b43817d13abe3c522ad69911467edd87 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d2259665b43817d13abe3c52…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 24 17:11:06 2021 -0500 user32: Blit the right bitmap when stretching monochrome icons in CopyImage(). Fixes: beb70a79e1d92ddb10a552dcc6c06a4139365566 Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/user32/cursoricon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index a923f2f8315..a225303f80f 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -3024,7 +3024,7 @@ HANDLE WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx, release_user_handle_ptr( icon ); return 0; } - stretch_bitmap( info.hbmColor, frame->color, desiredx, desiredy * 2, + stretch_bitmap( info.hbmMask, frame->mask, desiredx, desiredy * 2, frame->width, frame->height * 2 ); }
1
0
0
0
Zebediah Figura : d3d11/tests: Add some tests for UpdateSubresource() on a deferred context.
by Alexandre Julliard
24 May '21
24 May '21
Module: wine Branch: master Commit: 94eb8d36461f6eb380b95e58629ad4871e5efef4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=94eb8d36461f6eb380b95e58…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 24 11:05:51 2021 -0500 d3d11/tests: Add some tests for UpdateSubresource() on a deferred context. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 9315da55641..a88b2511d3d 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -32927,6 +32927,51 @@ static void test_deferred_context_map(void) ID3D11Buffer_Release(buffer2); ID3D11Buffer_Release(buffer); + + /* Test UpdateSubresource. */ + + for (i = 0; i < ARRAY_SIZE(data); ++i) + data[i] = i; + + buffer_desc.ByteWidth = sizeof(data); + buffer_desc.Usage = D3D11_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + buffer_desc.CPUAccessFlags = 0; + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer); + ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr); + hr = ID3D11Device_CreateBuffer(device, &buffer_desc, &resource_data, &buffer2); + ok(hr == S_OK, "Failed to create buffer, hr %#x.\n", hr); + + for (i = 0; i < ARRAY_SIZE(data); ++i) + data[i] = 2 * i; + ID3D11DeviceContext_UpdateSubresource(deferred, (ID3D11Resource *)buffer, 0, NULL, data, 0, 0); + + hr = ID3D11DeviceContext_FinishCommandList(deferred, FALSE, &list); + ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr); + + get_buffer_readback(buffer, &rb); + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + value = get_readback_float(&rb, i, 0); + ok(value == i, "Got unexpected value %.8e at %u.\n", value, i); + } + release_resource_readback(&rb); + + ID3D11DeviceContext_ExecuteCommandList(immediate, list, TRUE); + + get_buffer_readback(buffer, &rb); + for (i = 0; i < ARRAY_SIZE(data); ++i) + { + value = get_readback_float(&rb, i, 0); + ok(value == 2 * i, "Got unexpected value %.8e at %u.\n", value, i); + } + release_resource_readback(&rb); + + ID3D11CommandList_Release(list); + + ID3D11Buffer_Release(buffer2); + ID3D11Buffer_Release(buffer); + ID3D11DeviceContext_Release(deferred); release_test_context(&test_context); }
1
0
0
0
Zebediah Figura : d3d11/tests: Add some tests for Map() on deferred contexts.
by Alexandre Julliard
24 May '21
24 May '21
Module: wine Branch: master Commit: 7f181bba1d55c4dc226a49f3a9f89c99b1d4a74f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7f181bba1d55c4dc226a49f3…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 24 11:05:50 2021 -0500 d3d11/tests: Add some tests for Map() on deferred contexts. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 239 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 239 insertions(+) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=7f181bba1d55c4dc226a…
1
0
0
0
Zebediah Figura : wined3d: Check for SRV/RTV binding conflicts per wined3d_state.
by Alexandre Julliard
24 May '21
24 May '21
Module: wine Branch: master Commit: 57fc75b3ef547275342e76366da641bbc512bf4b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=57fc75b3ef547275342e7636…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 24 11:05:49 2021 -0500 wined3d: Check for SRV/RTV binding conflicts per wined3d_state. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 19 ++++++- dlls/wined3d/device.c | 23 +++++--- dlls/wined3d/resource.c | 1 - dlls/wined3d/wined3d_private.h | 125 +++++++++-------------------------------- 4 files changed, 61 insertions(+), 107 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=57fc75b3ef547275342e…
1
0
0
0
Zebediah Figura : d3d11/tests: Add a couple of extra tests for SRV/RTV conflict.
by Alexandre Julliard
24 May '21
24 May '21
Module: wine Branch: master Commit: 1a9400bcc9745e70dfe5e0518a4b22f6935b30be URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1a9400bcc9745e70dfe5e051…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon May 24 11:05:48 2021 -0500 d3d11/tests: Add a couple of extra tests for SRV/RTV conflict. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 421ad465d35..18c36a5908e 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -32351,6 +32351,15 @@ static void test_deferred_context_state(void) ID3D11DeviceContext_PSGetShaderResources(deferred, 0, 1, &ret_srv); ok(!ret_srv, "Got unexpected SRV %p.\n", ret_srv); + ID3D11DeviceContext_PSSetShaderResources(deferred, 0, 1, &srv); + ID3D11DeviceContext_PSGetShaderResources(deferred, 0, 1, &ret_srv); + ok(!ret_srv, "Got unexpected SRV %p.\n", ret_srv); + + ID3D11DeviceContext_PSSetShaderResources(immediate, 0, 1, &srv); + ID3D11DeviceContext_PSGetShaderResources(immediate, 0, 1, &ret_srv); + ok(ret_srv == srv, "Got unexpected SRV %p.\n", ret_srv); + ID3D11ShaderResourceView_Release(ret_srv); + ID3D11ShaderResourceView_Release(srv); ID3D11RenderTargetView_Release(rtv); ID3D11Texture2D_Release(texture);
1
0
0
0
Hans Leidekker : webservices: Properly initialize messages.
by Alexandre Julliard
24 May '21
24 May '21
Module: wine Branch: master Commit: ff5982fcf10624f76c7099d57901e04715b921d8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ff5982fcf10624f76c7099d5…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Mon May 24 15:53:49 2021 +0200 webservices: Properly initialize messages. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 6 +++- dlls/webservices/msg.c | 35 ++++++++++---------- dlls/webservices/tests/msg.c | 79 ++++++++++++++++++++++++++++++++++++-------- 3 files changed, 88 insertions(+), 32 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ff5982fcf10624f76c70…
1
0
0
0
Hans Leidekker : webservices: Buffer whole messages to be sent.
by Alexandre Julliard
24 May '21
24 May '21
Module: wine Branch: master Commit: be940a00d9cd626edb4c49de30b5d8d7f0fd88bf URL:
https://source.winehq.org/git/wine.git/?a=commit;h=be940a00d9cd626edb4c49de…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Mon May 24 15:53:48 2021 +0200 webservices: Buffer whole messages to be sent. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/webservices/channel.c | 132 ++++++++++++++++++++++++++++++--------------- 1 file changed, 89 insertions(+), 43 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=be940a00d9cd626edb4c…
1
0
0
0
Ziqing Hui : windowscodecs/tests: Add more test data for IWICDdsEncoder_SetParameters.
by Alexandre Julliard
24 May '21
24 May '21
Module: wine Branch: master Commit: 90b6051f4e81f077713d8164e9397a3ce73541be URL:
https://source.winehq.org/git/wine.git/?a=commit;h=90b6051f4e81f077713d8164…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Mon May 24 10:58:32 2021 +0800 windowscodecs/tests: Add more test data for IWICDdsEncoder_SetParameters. 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c index bd7672a558f..f369569104a 100644 --- a/dlls/windowscodecs/tests/ddsformat.c +++ b/dlls/windowscodecs/tests/ddsformat.c @@ -1352,6 +1352,7 @@ static void test_dds_encoder_params(void) IWICStream *stream = NULL; BYTE buffer[1024]; HRESULT hr; + UINT i; hr = create_and_init_encoder(buffer, sizeof(buffer), &encoder, &dds_encoder, &stream); if (hr != S_OK) goto end; @@ -1399,6 +1400,14 @@ static void test_dds_encoder_params(void) ok(params.AlphaMode == params_set.AlphaMode, "Expected AlphaMode %u, got %#x\n", params_set.AlphaMode, params.AlphaMode); + for (i = 0; i < ARRAY_SIZE(test_data); ++i) + { + hr = IWICDdsEncoder_SetParameters(dds_encoder, &test_data[i].expected_parameters); + todo_wine_if(test_data[i].init_hr != S_OK) + ok((hr == S_OK && test_data[i].init_hr == S_OK) || hr == WINCODEC_ERR_BADHEADER, + "Test %u: SetParameters got unexpected hr %#x\n", i, hr); + } + end: release_encoder(encoder, dds_encoder, stream); }
1
0
0
0
Ziqing Hui : windowscodecs/tests: Introduce create_and_init_encoder.
by Alexandre Julliard
24 May '21
24 May '21
Module: wine Branch: master Commit: 4da05a4f6d0201db37c2a412e7ec43e186a880ca URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4da05a4f6d0201db37c2a412…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Mon May 24 10:58:18 2021 +0800 windowscodecs/tests: Introduce create_and_init_encoder. We can't reuse same encoder object for all images. So we should create a new encoder object for each test. 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 | 77 ++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 30 deletions(-) diff --git a/dlls/windowscodecs/tests/ddsformat.c b/dlls/windowscodecs/tests/ddsformat.c index 52828e6bf43..bd7672a558f 100644 --- a/dlls/windowscodecs/tests/ddsformat.c +++ b/dlls/windowscodecs/tests/ddsformat.c @@ -546,6 +546,39 @@ static HRESULT init_decoder(IWICBitmapDecoder *decoder, IWICStream *stream, HRES return hr; } +static void release_encoder(IWICBitmapEncoder *encoder, IWICDdsEncoder *dds_encoder, IWICStream *stream) +{ + if (dds_encoder) IWICDdsEncoder_Release(dds_encoder); + if (stream) IWICStream_Release(stream); + if (encoder) IWICBitmapEncoder_Release(encoder); +} + +static HRESULT create_and_init_encoder(BYTE *image_buffer, UINT buffer_size, + IWICBitmapEncoder **encoder, IWICDdsEncoder **dds_encoder, IWICStream **stream) +{ + HRESULT hr; + + *encoder = create_encoder(); + if (!*encoder) goto fail; + + *stream = create_stream(image_buffer, buffer_size); + if (!*stream) goto fail; + + hr = IWICBitmapEncoder_Initialize(*encoder, (IStream *)*stream, WICBitmapEncoderNoCache); + ok(hr == S_OK, "Initialize failed, hr %#x\n", hr); + if (hr != S_OK) goto fail; + + hr = IWICBitmapEncoder_QueryInterface(*encoder, &IID_IWICDdsEncoder, (void **)dds_encoder); + ok(hr == S_OK, "QueryInterface failed, hr %#x\n", hr); + if (hr != S_OK) goto fail; + + return S_OK; + +fail: + release_encoder(*encoder, *dds_encoder, *stream); + return E_FAIL; +} + static BOOL is_compressed(DXGI_FORMAT format) { UINT i; @@ -1310,18 +1343,25 @@ end: if (encoder) IWICBitmapEncoder_Release(encoder); } -static void test_dds_encoder_params(IWICBitmapEncoder *encoder, IWICDdsEncoder *dds_encoder) +static void test_dds_encoder_params(void) { WICDdsParameters params, params_set = { 4, 4, 4, 3, 1, DXGI_FORMAT_BC1_UNORM, WICDdsTexture3D, WICDdsAlphaModePremultiplied }; + IWICDdsEncoder *dds_encoder = NULL; + IWICBitmapEncoder *encoder = NULL; + IWICStream *stream = NULL; + BYTE buffer[1024]; HRESULT hr; + hr = create_and_init_encoder(buffer, sizeof(buffer), &encoder, &dds_encoder, &stream); + if (hr != S_OK) goto end; + hr = IWICDdsEncoder_GetParameters(dds_encoder, NULL); ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#x\n", hr); hr = IWICDdsEncoder_GetParameters(dds_encoder, ¶ms); ok(hr == S_OK, "GetParameters failed, hr %#x\n", hr); - if (hr != S_OK) return; + if (hr != S_OK) goto end; /* default DDS parameters for encoder */ ok(params.Width == 1, "Got unexpected Width %u\n", params.Width); @@ -1338,7 +1378,7 @@ static void test_dds_encoder_params(IWICBitmapEncoder *encoder, IWICDdsEncoder * hr = IWICDdsEncoder_SetParameters(dds_encoder, ¶ms_set); ok(hr == S_OK, "SetParameters failed, hr %#x\n", hr); - if (hr != S_OK) return; + if (hr != S_OK) goto end; IWICDdsEncoder_GetParameters(dds_encoder, ¶ms); @@ -1358,38 +1398,15 @@ static void test_dds_encoder_params(IWICBitmapEncoder *encoder, IWICDdsEncoder * "Expected Dimension %u, got %#x\n", params_set.Dimension, params.Dimension); ok(params.AlphaMode == params_set.AlphaMode, "Expected AlphaMode %u, got %#x\n", params_set.AlphaMode, params.AlphaMode); + +end: + release_encoder(encoder, dds_encoder, stream); } static void test_dds_encoder(void) { - IWICDdsEncoder *dds_encoder = NULL; - IWICBitmapEncoder *encoder = NULL; - IWICStream *stream = NULL; - BYTE buffer[1024]; - HRESULT hr; - test_dds_encoder_initialize(); - - encoder = create_encoder(); - if (!encoder) goto end; - - stream = create_stream(buffer, sizeof(buffer)); - if (!stream) goto end; - - hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache); - ok(hr == S_OK, "Initialize failed, hr %#x\n", hr); - if (hr != S_OK) goto end; - - hr = IWICBitmapEncoder_QueryInterface(encoder, &IID_IWICDdsEncoder, (void **)&dds_encoder); - ok(hr == S_OK, "QueryInterface failed, hr %#x\n", hr); - if (hr != S_OK) goto end; - - test_dds_encoder_params(encoder, dds_encoder); - -end: - if (dds_encoder) IWICDdsEncoder_Release(dds_encoder); - if (stream) IWICStream_Release(stream); - if (encoder) IWICBitmapEncoder_Release(encoder); + test_dds_encoder_params(); } START_TEST(ddsformat)
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
77
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
Results per page:
10
25
50
100
200