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
September 2022
----- 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
553 discussions
Start a n
N
ew thread
Rémi Bernon : mf/tests: Add some WMV decoder MFT / DMO decoding tests.
by Alexandre Julliard
30 Sep '22
30 Sep '22
Module: wine Branch: master Commit: f942a1109a0e26cfbbe8dfa530d2597bc7293873 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f942a1109a0e26cfbbe8dfa530d259…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Sep 21 20:01:29 2022 +0200 mf/tests: Add some WMV decoder MFT / DMO decoding tests. --- dlls/mf/tests/transform.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index dc3ae2b7201..e66baa6e7c9 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -4336,11 +4336,33 @@ static void test_wmv_decoder(void) .cbAlignment = 1, }; + const struct attribute_desc output_sample_attributes[] = + { + ATTR_UINT32(MFSampleExtension_CleanPoint, 1), + {0}, + }; + const struct buffer_desc output_buffer_desc_nv12 = + { + .length = actual_width * actual_height * 3 / 2, + .compare = compare_nv12, .dump = dump_nv12, .rect = {.right = 82, .bottom = 84}, + }; + const struct sample_desc output_sample_desc_nv12 = + { + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 333333, + .buffer_count = 1, .buffers = &output_buffer_desc_nv12, + }; + MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Video, MFVideoFormat_NV12}; MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Video, MFVideoFormat_WMV1}; + IMFSample *input_sample, *output_sample; + IMFCollection *output_samples; IMFMediaType *media_type; IMFTransform *transform; - ULONG i, ret; + const BYTE *wmvenc_data; + ULONG wmvenc_data_len; + DWORD output_status; + ULONG i, ret, ref; HRESULT hr; hr = CoInitialize(NULL); @@ -4425,6 +4447,44 @@ static void test_wmv_decoder(void) check_mft_get_input_stream_info(transform, S_OK, &expect_input_info); check_mft_get_output_stream_info(transform, S_OK, &expect_output_info); + load_resource(L"wmvencdata.bin", &wmvenc_data, &wmvenc_data_len); + + input_sample = create_sample(wmvenc_data + sizeof(DWORD), *(DWORD *)wmvenc_data); + wmvenc_data_len -= *(DWORD *)wmvenc_data + sizeof(DWORD); + wmvenc_data += *(DWORD *)wmvenc_data + sizeof(DWORD); + hr = IMFSample_SetSampleTime(input_sample, 0); + ok(hr == S_OK, "SetSampleTime returned %#lx\n", hr); + hr = IMFSample_SetSampleDuration(input_sample, 333333); + ok(hr == S_OK, "SetSampleDuration returned %#lx\n", hr); + hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0); + ok(hr == S_OK, "ProcessInput returned %#lx\n", hr); + ret = IMFSample_Release(input_sample); + ok(ret <= 1, "Release returned %ld\n", ret); + + hr = MFCreateCollection(&output_samples); + ok(hr == S_OK, "MFCreateCollection returned %#lx\n", hr); + + output_sample = create_sample(NULL, expect_output_info.cbSize); + for (i = 0; SUCCEEDED(hr = check_mft_process_output(transform, output_sample, &output_status)); i++) + { + winetest_push_context("%lu", i); + ok(hr == S_OK, "ProcessOutput returned %#lx\n", hr); + hr = IMFCollection_AddElement(output_samples, (IUnknown *)output_sample); + ok(hr == S_OK, "AddElement returned %#lx\n", hr); + ref = IMFSample_Release(output_sample); + ok(ref == 1, "Release returned %ld\n", ref); + output_sample = create_sample(NULL, expect_output_info.cbSize); + winetest_pop_context(); + } + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#lx\n", hr); + ret = IMFSample_Release(output_sample); + ok(ret == 0, "Release returned %lu\n", ret); + ok(i == 1, "got %lu output samples\n", i); + + ret = check_mf_sample_collection(output_samples, &output_sample_desc_nv12, L"nv12frame.bmp"); + ok(ret == 0, "got %lu%% diff\n", ret); + IMFCollection_Release(output_samples); + skip_tests: ret = IMFTransform_Release(transform); ok(ret == 0, "Release returned %lu\n", ret);
1
0
0
0
Rémi Bernon : mf/tests: Add some WMV encoder MFT / DMO encoding tests.
by Alexandre Julliard
30 Sep '22
30 Sep '22
Module: wine Branch: master Commit: cf59a6f9b64409716d4f0a974bdc9464e059e7a8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cf59a6f9b64409716d4f0a974bdc94…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Wed Sep 21 20:00:30 2022 +0200 mf/tests: Add some WMV encoder MFT / DMO encoding tests. --- dlls/mf/tests/resource.rc | 3 ++ dlls/mf/tests/transform.c | 94 ++++++++++++++++++++++++++++++++++++++++++- dlls/mf/tests/wmvencdata.bin | Bin 0 -> 911 bytes 3 files changed, 96 insertions(+), 1 deletion(-) diff --git a/dlls/mf/tests/resource.rc b/dlls/mf/tests/resource.rc index 08d123d5c8f..6cbf64d4528 100644 --- a/dlls/mf/tests/resource.rc +++ b/dlls/mf/tests/resource.rc @@ -38,6 +38,9 @@ wmaencdata.bin RCDATA wmaencdata.bin /* @makedep: wmadecdata.bin */ wmadecdata.bin RCDATA wmadecdata.bin +/* @makedep: wmvencdata.bin */ +wmvencdata.bin RCDATA wmvencdata.bin + /* Generated with: * gst-launch-1.0 filesrc location=dlls/mf/tests/audiodata.bin ! \ * audio/x-raw,format=F32LE,rate=22050,channels=2,layout=interleaved ! \ diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 8daa2ce1d3a..dc3ae2b7201 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -572,7 +572,7 @@ static HRESULT check_mft_process_output_(int line, IMFTransform *transform, IMFS { static const DWORD expect_flags = MFT_OUTPUT_DATA_BUFFER_INCOMPLETE | MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE | MFT_OUTPUT_DATA_BUFFER_STREAM_END | MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE; - MFT_OUTPUT_DATA_BUFFER output[2]; + MFT_OUTPUT_DATA_BUFFER output[3]; HRESULT hr, ret; DWORD status; @@ -3917,12 +3917,47 @@ static void test_wmv_encoder(void) .cbAlignment = 1, }; + const struct buffer_desc output_buffer_desc[] = + { + {.length = -1 /* variable */}, + }; + const struct attribute_desc output_sample_attributes_key[] = + { + ATTR_UINT32(MFSampleExtension_CleanPoint, 1), + {0}, + }; + const struct attribute_desc output_sample_attributes[] = + { + ATTR_UINT32(MFSampleExtension_CleanPoint, 0), + {0}, + }; + const struct sample_desc output_sample_desc[] = + { + { + .attributes = output_sample_attributes_key, + .sample_time = 0, .sample_duration = 333333, + .buffer_count = 1, .buffers = output_buffer_desc, + }, + { + .attributes = output_sample_attributes, + .sample_time = 333333, .sample_duration = 333333, + .buffer_count = 1, .buffers = output_buffer_desc, .repeat_count = 4 + }, + }; + MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Video, MFVideoFormat_WMV1}; MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Video, MFVideoFormat_NV12}; + IMFSample *input_sample, *output_sample; + DWORD status, length, output_status; + MFT_OUTPUT_DATA_BUFFER output; + IMFCollection *output_samples; + const BYTE *nv12frame_data; IMFMediaType *media_type; + ULONG nv12frame_data_len; IMFTransform *transform; ULONG i, ret; HRESULT hr; + LONG ref; hr = CoInitialize(NULL); ok(hr == S_OK, "Failed to initialize, hr %#lx.\n", hr); @@ -3986,6 +4021,63 @@ static void test_wmv_encoder(void) check_mft_get_input_stream_info(transform, S_OK, &expect_input_info); check_mft_get_output_stream_info(transform, S_OK, &expect_output_info); + if (!has_video_processor) + { + win_skip("Skipping WMV encoder tests on Win7\n"); + goto done; + } + + load_resource(L"nv12frame.bmp", &nv12frame_data, &nv12frame_data_len); + /* skip BMP header and RGB data from the dump */ + length = *(DWORD *)(nv12frame_data + 2); + nv12frame_data_len = nv12frame_data_len - length; + nv12frame_data = nv12frame_data + length; + ok(nv12frame_data_len == 13824, "got length %lu\n", nv12frame_data_len); + + hr = MFCreateCollection(&output_samples); + ok(hr == S_OK, "MFCreateCollection returned %#lx\n", hr); + + for (i = 0; i < 5; i++) + { + input_sample = create_sample(nv12frame_data, nv12frame_data_len); + hr = IMFSample_SetSampleTime(input_sample, i * 333333); + ok(hr == S_OK, "SetSampleTime returned %#lx\n", hr); + hr = IMFSample_SetSampleDuration(input_sample, 333333); + ok(hr == S_OK, "SetSampleDuration returned %#lx\n", hr); + hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0); + ok(hr == S_OK, "ProcessInput returned %#lx\n", hr); + ref = IMFSample_Release(input_sample); + ok(ref <= 1, "Release returned %ld\n", ref); + + output_sample = create_sample(NULL, expect_output_info.cbSize); + hr = check_mft_process_output(transform, output_sample, &output_status); + ok(hr == S_OK, "ProcessOutput returned %#lx\n", hr); + hr = IMFCollection_AddElement(output_samples, (IUnknown *)output_sample); + ok(hr == S_OK, "AddElement returned %#lx\n", hr); + ref = IMFSample_Release(output_sample); + ok(ref == 1, "Release returned %ld\n", ref); + } + + ret = check_mf_sample_collection(output_samples, output_sample_desc, L"wmvencdata.bin"); + ok(ret == 0, "got %lu%% diff\n", ret); + IMFCollection_Release(output_samples); + + output_sample = create_sample(NULL, expect_output_info.cbSize); + status = 0xdeadbeef; + memset(&output, 0, sizeof(output)); + output.pSample = output_sample; + hr = IMFTransform_ProcessOutput(transform, 0, 1, &output, &status); + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#lx\n", hr); + ok(output.pSample == output_sample, "got pSample %p\n", output.pSample); + ok(output.dwStatus == 0, "got dwStatus %#lx\n", output.dwStatus); + ok(status == 0, "got status %#lx\n", status); + hr = IMFSample_GetTotalLength(output.pSample, &length); + ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr); + ok(length == 0, "got length %lu\n", length); + ret = IMFSample_Release(output_sample); + ok(ret == 0, "Release returned %lu\n", ret); + +done: ret = IMFTransform_Release(transform); ok(ret == 0, "Release returned %lu\n", ret); diff --git a/dlls/mf/tests/wmvencdata.bin b/dlls/mf/tests/wmvencdata.bin new file mode 100644 index 00000000000..a409afaf143 Binary files /dev/null and b/dlls/mf/tests/wmvencdata.bin differ
1
0
0
0
Rémi Bernon : mf/tests: Test WMV encoder MFT / DMO presence and media types.
by Alexandre Julliard
30 Sep '22
30 Sep '22
Module: wine Branch: master Commit: a75e7d0d73091ee4717d2322e20a89c6223e8096 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a75e7d0d73091ee4717d2322e20a89…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 30 08:21:56 2022 +0200 mf/tests: Test WMV encoder MFT / DMO presence and media types. --- dlls/mf/tests/transform.c | 382 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 367 insertions(+), 15 deletions(-)
1
0
0
0
Rémi Bernon : mf/tests: Test WMV decoder MFT / DMO presence and media types.
by Alexandre Julliard
30 Sep '22
30 Sep '22
Module: wine Branch: master Commit: 24ca2bd2319996c7569e6e2b525b03d6d443545e URL:
https://gitlab.winehq.org/wine/wine/-/commit/24ca2bd2319996c7569e6e2b525b03…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Sep 8 10:22:27 2022 +0200 mf/tests: Test WMV decoder MFT / DMO presence and media types. --- dlls/mf/tests/transform.c | 481 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 416 insertions(+), 65 deletions(-)
1
0
0
0
Rémi Bernon : mf/tests: Avoid setting transform types while enumerating.
by Alexandre Julliard
30 Sep '22
30 Sep '22
Module: wine Branch: master Commit: 9652f6a2469d6151e4d09f5efd220b1f2ad93484 URL:
https://gitlab.winehq.org/wine/wine/-/commit/9652f6a2469d6151e4d09f5efd220b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Sep 22 14:22:22 2022 +0200 mf/tests: Avoid setting transform types while enumerating. Some transform do not handle the MFT_SET_TYPE_TEST_ONLY correctly, and setting the type may have undesired side effects. We already check the required attributes consistently now. --- dlls/mf/tests/transform.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 0e0ae2417d5..c494891c78a 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -1951,9 +1951,6 @@ static void test_aac_decoder(void) ok(hr == S_OK, "GetInputAvailableType returned %#lx\n", hr); check_media_type(media_type, expect_input_attributes, -1); check_media_type(media_type, expect_available_inputs[i], -1); - hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY); - if (i != 1) ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); - else ok(hr == MF_E_INVALIDMEDIATYPE, "SetInputType returned %#lx.\n", hr); ret = IMFMediaType_Release(media_type); ok(ret <= 1, "Release returned %lu\n", ret); winetest_pop_context(); @@ -1980,8 +1977,6 @@ static void test_aac_decoder(void) ok(hr == S_OK, "GetOutputAvailableType returned %#lx\n", hr); check_media_type(media_type, expect_output_attributes, -1); check_media_type(media_type, expect_available_outputs[i], -1); - hr = IMFTransform_SetOutputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY); - ok(hr == S_OK, "SetInputType returned %#lx.\n", hr); ret = IMFMediaType_Release(media_type); ok(ret <= 1, "Release returned %lu\n", ret); winetest_pop_context(); @@ -2542,8 +2537,6 @@ static void test_wma_decoder(void) winetest_push_context("in %lu", i); ok(hr == S_OK, "GetInputAvailableType returned %#lx\n", hr); check_media_type(media_type, expect_available_inputs[i], -1); - hr = IMFTransform_SetInputType(transform, 0, media_type, 0); - ok(hr == MF_E_INVALIDMEDIATYPE, "SetInputType returned %#lx.\n", hr); ret = IMFMediaType_Release(media_type); ok(ret == 0, "Release returned %lu\n", ret); winetest_pop_context(); @@ -3546,8 +3539,6 @@ static void test_audio_convert(void) winetest_push_context("in %lu", i); ok(hr == S_OK, "GetInputAvailableType returned %#lx\n", hr); check_media_type(media_type, expect_available_inputs[i], -1); - hr = IMFTransform_SetInputType(transform, 0, media_type, 0); - ok(hr == MF_E_INVALIDMEDIATYPE, "SetInputType returned %#lx.\n", hr); ret = IMFMediaType_Release(media_type); ok(ret == 0, "Release returned %lu\n", ret); winetest_pop_context(); @@ -3928,14 +3919,6 @@ static void test_color_convert(void) ok(hr == S_OK, "GetInputAvailableType returned %#lx\n", hr); check_media_type(media_type, expect_available_common, -1); check_media_type(media_type, expect_available_inputs[i], -1); - hr = IMFTransform_SetInputType(transform, 0, media_type, 0); - if (i == 12) - { - todo_wine - ok(hr == MF_E_INVALIDMEDIATYPE, "SetInputType returned %#lx.\n", hr); - } - else - ok(hr == E_INVALIDARG, "SetInputType returned %#lx.\n", hr); ret = IMFMediaType_Release(media_type); ok(ret == 0, "Release returned %lu\n", ret); winetest_pop_context(); @@ -4823,8 +4806,6 @@ static void test_mp3_decoder(void) winetest_push_context("in %lu", i); ok(hr == S_OK, "GetInputAvailableType returned %#lx\n", hr); check_media_type(media_type, expect_available_inputs[i], -1); - hr = IMFTransform_SetInputType(transform, 0, media_type, 0); - ok(hr == MF_E_INVALIDMEDIATYPE, "SetInputType returned %#lx.\n", hr); ret = IMFMediaType_Release(media_type); ok(ret == 0, "Release returned %lu\n", ret); winetest_pop_context();
1
0
0
0
Rémi Bernon : mf/tests: Add some AAC decoder MFT decoding tests.
by Alexandre Julliard
30 Sep '22
30 Sep '22
Module: wine Branch: master Commit: 802a3b6fcf45635a415fbce797ca992ecadd87c8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/802a3b6fcf45635a415fbce797ca99…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Thu Sep 22 14:17:07 2022 +0200 mf/tests: Add some AAC decoder MFT decoding tests. --- dlls/mf/tests/aacdecdata.bin | Bin 0 -> 2048 bytes dlls/mf/tests/resource.rc | 3 ++ dlls/mf/tests/transform.c | 84 ++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/dlls/mf/tests/aacdecdata.bin b/dlls/mf/tests/aacdecdata.bin new file mode 100644 index 00000000000..2ff06b66e40 Binary files /dev/null and b/dlls/mf/tests/aacdecdata.bin differ diff --git a/dlls/mf/tests/resource.rc b/dlls/mf/tests/resource.rc index 25ac6d2fe0c..08d123d5c8f 100644 --- a/dlls/mf/tests/resource.rc +++ b/dlls/mf/tests/resource.rc @@ -29,6 +29,9 @@ audioconvdata.bin RCDATA audioconvdata.bin /* @makedep: aacencdata.bin */ aacencdata.bin RCDATA aacencdata.bin +/* @makedep: aacdecdata.bin */ +aacdecdata.bin RCDATA aacdecdata.bin + /* @makedep: wmaencdata.bin */ wmaencdata.bin RCDATA wmaencdata.bin diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index f4148692489..0e0ae2417d5 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -1889,11 +1889,33 @@ static void test_aac_decoder(void) MFT_INPUT_STREAM_FIXED_SAMPLE_SIZE | MFT_INPUT_STREAM_HOLDS_BUFFERS, }; + const struct buffer_desc output_buffer_desc[] = + { + {.length = 0x800}, + }; + const struct attribute_desc output_sample_attributes[] = + { + ATTR_UINT32(MFSampleExtension_CleanPoint, 1), + {0}, + }; + const struct sample_desc output_sample_desc[] = + { + { + .attributes = output_sample_attributes + (has_video_processor ? 0 : 1) /* MFSampleExtension_CleanPoint missing on Win7 */, + .sample_time = 0, .sample_duration = 232200, + .buffer_count = 1, .buffers = output_buffer_desc, + }, + }; + MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_Float}; MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Audio, MFAudioFormat_AAC}; + IMFSample *input_sample, *output_sample; + ULONG i, ret, ref, aacenc_data_len; + IMFCollection *output_samples; + DWORD length, output_status; IMFMediaType *media_type; IMFTransform *transform; - ULONG i, ret; + const BYTE *aacenc_data; HRESULT hr; hr = CoInitialize(NULL); @@ -1974,6 +1996,66 @@ static void test_aac_decoder(void) check_mft_get_input_stream_info(transform, &input_info); check_mft_get_output_stream_info(transform, &output_info); + load_resource(L"aacencdata.bin", &aacenc_data, &aacenc_data_len); + ok(aacenc_data_len == 24861, "got length %lu\n", aacenc_data_len); + + input_sample = create_sample(aacenc_data + sizeof(DWORD), *(DWORD *)aacenc_data); + hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0); + ok(hr == S_OK, "ProcessInput returned %#lx\n", hr); + hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0); + ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#lx\n", hr); + + /* As output_info.dwFlags doesn't have MFT_OUTPUT_STREAM_CAN_PROVIDE_SAMPLES + * IMFTransform_ProcessOutput needs a sample or returns MF_E_TRANSFORM_NEED_MORE_INPUT */ + + hr = check_mft_process_output(transform, NULL, &output_status); + ok(hr == E_INVALIDARG, "ProcessOutput returned %#lx\n", hr); + ok(output_status == 0, "got output[0].dwStatus %#lx\n", output_status); + hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0); + ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#lx\n", hr); + + hr = IMFTransform_ProcessMessage(transform, MFT_MESSAGE_COMMAND_DRAIN, 0); + ok(hr == S_OK, "ProcessMessage returned %#lx\n", hr); + hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0); + ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#lx\n", hr); + + hr = MFCreateCollection(&output_samples); + ok(hr == S_OK, "MFCreateCollection returned %#lx\n", hr); + + output_sample = create_sample(NULL, output_info.cbSize); + for (i = 0; SUCCEEDED(hr = check_mft_process_output(transform, output_sample, &output_status)); i++) + { + winetest_push_context("%lu", i); + ok(hr == S_OK, "ProcessOutput returned %#lx\n", hr); + hr = IMFCollection_AddElement(output_samples, (IUnknown *)output_sample); + ok(hr == S_OK, "AddElement returned %#lx\n", hr); + ref = IMFSample_Release(output_sample); + ok(ref == 1, "Release returned %ld\n", ref); + output_sample = create_sample(NULL, output_info.cbSize); + winetest_pop_context(); + } + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#lx\n", hr); + ok(output_status == MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE, "got output[0].dwStatus %#lx\n", output_status); + ret = IMFSample_Release(output_sample); + ok(ret == 0, "Release returned %lu\n", ret); + ok(i == 1, "got %lu output samples\n", i); + + ret = check_mf_sample_collection(output_samples, output_sample_desc, L"aacdecdata.bin"); + ok(ret == 0, "got %lu%% diff\n", ret); + IMFCollection_Release(output_samples); + + output_sample = create_sample(NULL, output_info.cbSize); + hr = check_mft_process_output(transform, output_sample, &output_status); + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#lx\n", hr); + ok(output_status == MFT_OUTPUT_DATA_BUFFER_NO_SAMPLE, "got output[0].dwStatus %#lx\n", output_status); + hr = IMFSample_GetTotalLength(output_sample, &length); + ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr); + ok(length == 0, "got length %lu\n", length); + ret = IMFSample_Release(output_sample); + ok(ret == 0, "Release returned %lu\n", ret); + + ret = IMFSample_Release(input_sample); + ok(ret == 0, "Release returned %lu\n", ret); ret = IMFTransform_Release(transform); ok(ret == 0, "Release returned %lu\n", ret);
1
0
0
0
Rémi Bernon : mf/tests: Add some AAC encoder MFT encoding tests.
by Alexandre Julliard
30 Sep '22
30 Sep '22
Module: wine Branch: master Commit: cc8569dd656a028eb22bd3af029161aeeca96f3d URL:
https://gitlab.winehq.org/wine/wine/-/commit/cc8569dd656a028eb22bd3af029161…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 30 08:18:59 2022 +0200 mf/tests: Add some AAC encoder MFT encoding tests. --- dlls/mf/tests/aacencdata.bin | Bin 0 -> 24861 bytes dlls/mf/tests/resource.rc | 3 ++ dlls/mf/tests/transform.c | 108 ++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 105 insertions(+), 6 deletions(-) diff --git a/dlls/mf/tests/aacencdata.bin b/dlls/mf/tests/aacencdata.bin new file mode 100644 index 00000000000..355310632fa Binary files /dev/null and b/dlls/mf/tests/aacencdata.bin differ diff --git a/dlls/mf/tests/resource.rc b/dlls/mf/tests/resource.rc index 43493319046..25ac6d2fe0c 100644 --- a/dlls/mf/tests/resource.rc +++ b/dlls/mf/tests/resource.rc @@ -26,6 +26,9 @@ audiodata.bin RCDATA audiodata.bin /* @makedep: audioconvdata.bin */ audioconvdata.bin RCDATA audioconvdata.bin +/* @makedep: aacencdata.bin */ +aacencdata.bin RCDATA aacencdata.bin + /* @makedep: wmaencdata.bin */ wmaencdata.bin RCDATA wmaencdata.bin diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index d700f8a222b..f4148692489 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -894,6 +894,13 @@ static void dump_mf_media_buffer(IMFMediaBuffer *buffer, const struct buffer_des buffer_desc->dump(data, length, &buffer_desc->rect, output); else { + if (buffer_desc->length == -1) + { + ret = WriteFile(output, &length, sizeof(length), &written, NULL); + ok(ret, "WriteFile failed, error %lu\n", GetLastError()); + ok(written == sizeof(length), "written %lu bytes\n", written); + } + ret = WriteFile(output, data, length, &written, NULL); ok(ret, "WriteFile failed, error %lu\n", GetLastError()); ok(written == length, "written %lu bytes\n", written); @@ -930,14 +937,21 @@ static void dump_mf_sample_collection(IMFCollection *samples, const struct sampl static DWORD check_mf_media_buffer_(int line, IMFMediaBuffer *buffer, const struct buffer_desc *expect, const BYTE **expect_data, DWORD *expect_data_len) { - DWORD length, diff = 0; + DWORD length, diff = 0, expect_length = expect->length; HRESULT hr; BYTE *data; + if (expect_length == -1) + { + expect_length = *(DWORD *)*expect_data; + *expect_data = *expect_data + sizeof(DWORD); + *expect_data_len = *expect_data_len - sizeof(DWORD); + } + hr = IMFMediaBuffer_Lock(buffer, &data, NULL, &length); ok_(__FILE__, line)(hr == S_OK, "Lock returned %#lx\n", hr); todo_wine_if(expect->todo_length) - ok_(__FILE__, line)(length == expect->length, "got length %#lx\n", length); + ok_(__FILE__, line)(length == expect_length, "got length %#lx\n", length); if (*expect_data_len < length) todo_wine_if(expect->todo_length) @@ -968,8 +982,9 @@ struct check_mf_sample_context static void check_mf_sample_buffer(IMFMediaBuffer *buffer, const struct buffer_desc *expect, void *context) { struct check_mf_sample_context *ctx = context; + DWORD expect_length = expect->length == -1 ? *(DWORD *)ctx->data : expect->length; ctx->diff += check_mf_media_buffer_(ctx->line, buffer, expect, &ctx->data, &ctx->data_len); - ctx->total_length += expect->length; + ctx->total_length += expect_length; } #define check_mf_sample(a, b, c, d) check_mf_sample_(__LINE__, a, b, c, d) @@ -1021,8 +1036,8 @@ static DWORD check_mf_sample_(int line, IMFSample *sample, const struct sample_d ok_(__FILE__, line)(*expect_data_len >= ctx.total_length, "missing %#lx data\n", ctx.total_length - *expect_data_len); - *expect_data = *expect_data + min(total_length, *expect_data_len); - *expect_data_len = *expect_data_len - min(total_length, *expect_data_len); + *expect_data = ctx.data; + *expect_data_len = ctx.data_len; return ctx.diff / buffer_count; } @@ -1622,11 +1637,35 @@ static void test_aac_encoder(void) const MFT_OUTPUT_STREAM_INFO initial_output_info = {0}, output_info = {.cbSize = 0x600}; const MFT_INPUT_STREAM_INFO input_info = {0}; + const struct buffer_desc output_buffer_desc[] = + { + {.length = -1 /* variable */}, + }; + const struct attribute_desc output_sample_attributes[] = + { + ATTR_UINT32(MFSampleExtension_CleanPoint, 1), + {0}, + }; + const struct sample_desc output_sample_desc[] = + { + { + .repeat_count = 88, + .attributes = output_sample_attributes, + .sample_time = 0, .sample_duration = 113823, + .buffer_count = 1, .buffers = output_buffer_desc, + }, + }; + MFT_REGISTER_TYPE_INFO output_type = {MFMediaType_Audio, MFAudioFormat_AAC}; MFT_REGISTER_TYPE_INFO input_type = {MFMediaType_Audio, MFAudioFormat_PCM}; + IMFSample *input_sample, *output_sample; + IMFCollection *output_samples; + ULONG i, ret, audio_data_len; + DWORD length, output_status; IMFTransform *transform; + const BYTE *audio_data; HRESULT hr; - ULONG ret; + LONG ref; hr = CoInitialize(NULL); ok(hr == S_OK, "Failed to initialize, hr %#lx.\n", hr); @@ -1662,6 +1701,63 @@ static void test_aac_encoder(void) check_mft_get_input_stream_info(transform, &input_info); check_mft_get_output_stream_info(transform, &output_info); + if (!has_video_processor) + { + win_skip("Skipping AAC encoder tests on Win7\n"); + goto done; + } + + load_resource(L"audiodata.bin", &audio_data, &audio_data_len); + ok(audio_data_len == 179928, "got length %lu\n", audio_data_len); + + input_sample = create_sample(audio_data, audio_data_len); + hr = IMFSample_SetSampleTime(input_sample, 0); + ok(hr == S_OK, "SetSampleTime returned %#lx\n", hr); + hr = IMFSample_SetSampleDuration(input_sample, 10000000); + ok(hr == S_OK, "SetSampleDuration returned %#lx\n", hr); + hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0); + ok(hr == S_OK, "ProcessInput returned %#lx\n", hr); + hr = IMFTransform_ProcessMessage(transform, MFT_MESSAGE_COMMAND_DRAIN, 0); + ok(hr == S_OK, "ProcessMessage returned %#lx\n", hr); + hr = IMFTransform_ProcessInput(transform, 0, input_sample, 0); + ok(hr == MF_E_NOTACCEPTING, "ProcessInput returned %#lx\n", hr); + ref = IMFSample_Release(input_sample); + ok(ref <= 1, "Release returned %ld\n", ref); + + hr = MFCreateCollection(&output_samples); + ok(hr == S_OK, "MFCreateCollection returned %#lx\n", hr); + + output_sample = create_sample(NULL, output_info.cbSize); + for (i = 0; SUCCEEDED(hr = check_mft_process_output(transform, output_sample, &output_status)); i++) + { + winetest_push_context("%lu", i); + ok(hr == S_OK, "ProcessOutput returned %#lx\n", hr); + hr = IMFCollection_AddElement(output_samples, (IUnknown *)output_sample); + ok(hr == S_OK, "AddElement returned %#lx\n", hr); + ref = IMFSample_Release(output_sample); + ok(ref == 1, "Release returned %ld\n", ref); + output_sample = create_sample(NULL, output_info.cbSize); + winetest_pop_context(); + } + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#lx\n", hr); + ret = IMFSample_Release(output_sample); + ok(ret == 0, "Release returned %lu\n", ret); + ok(i == 88, "got %lu output samples\n", i); + + ret = check_mf_sample_collection(output_samples, output_sample_desc, L"aacencdata.bin"); + ok(ret == 0, "got %lu%% diff\n", ret); + IMFCollection_Release(output_samples); + + output_sample = create_sample(NULL, output_info.cbSize); + hr = check_mft_process_output(transform, output_sample, &output_status); + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "ProcessOutput returned %#lx\n", hr); + hr = IMFSample_GetTotalLength(output_sample, &length); + ok(hr == S_OK, "GetTotalLength returned %#lx\n", hr); + ok(length == 0, "got length %lu\n", length); + ret = IMFSample_Release(output_sample); + ok(ret == 0, "Release returned %lu\n", ret); + +done: ret = IMFTransform_Release(transform); ok(ret == 0, "Release returned %lu\n", ret);
1
0
0
0
Rémi Bernon : mf/tests: Factor transform (Get|Set)(Input|Output)CurrentType tests together.
by Alexandre Julliard
30 Sep '22
30 Sep '22
Module: wine Branch: master Commit: 4e4d31e1d55aac2ee26081ca489916186c22804d URL:
https://gitlab.winehq.org/wine/wine/-/commit/4e4d31e1d55aac2ee26081ca489916…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 30 09:42:53 2022 +0200 mf/tests: Factor transform (Get|Set)(Input|Output)CurrentType tests together. --- dlls/mf/tests/transform.c | 541 ++++++++++++++++++++++++++-------------------- 1 file changed, 306 insertions(+), 235 deletions(-)
1
0
0
0
Jacek Caban : winevulkan: Introduce conversion_context and use it for conversion memory allocation.
by Alexandre Julliard
30 Sep '22
30 Sep '22
Module: wine Branch: master Commit: e1d5337354942b97493e4ecaa06fd330d2101a7d URL:
https://gitlab.winehq.org/wine/wine/-/commit/e1d5337354942b97493e4ecaa06fd3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Sep 23 21:15:32 2022 +0200 winevulkan: Introduce conversion_context and use it for conversion memory allocation. --- dlls/winevulkan/make_vulkan | 401 ++-------- dlls/winevulkan/vulkan.c | 44 +- dlls/winevulkan/vulkan_private.h | 38 + dlls/winevulkan/vulkan_thunks.c | 1579 +++++++++++++------------------------- dlls/winevulkan/vulkan_thunks.h | 7 +- 5 files changed, 653 insertions(+), 1416 deletions(-)
1
0
0
0
Paul Gofman : crypt32: Set correct exponent length in decoded BCRYPT_RSAKEY_BLOB.
by Alexandre Julliard
30 Sep '22
30 Sep '22
Module: wine Branch: master Commit: cc3fc9a47d24a7afd2c7e6050e27bf291c98f3f1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/cc3fc9a47d24a7afd2c7e6050e27bf…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Thu Sep 29 16:51:16 2022 -0500 crypt32: Set correct exponent length in decoded BCRYPT_RSAKEY_BLOB. --- dlls/crypt32/decode.c | 31 +++++++++++++++++++++++-------- dlls/crypt32/tests/encode.c | 20 ++++++++++---------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index 60f9868ed67..22e15360cf3 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -3874,7 +3874,7 @@ static BOOL WINAPI CRYPT_AsnDecodeCertPolicyConstraints( struct DECODED_RSA_PUB_KEY { - DWORD pubexp; + CRYPT_INTEGER_BLOB pubexp; CRYPT_INTEGER_BLOB modulus; }; @@ -3893,12 +3893,23 @@ static BOOL CRYPT_raw_decode_rsa_pub_key(struct DECODED_RSA_PUB_KEY **decodedKey FALSE, TRUE, offsetof(struct DECODED_RSA_PUB_KEY, modulus.pbData), 0 }, { ASN_INTEGER, offsetof(struct DECODED_RSA_PUB_KEY, pubexp), - CRYPT_AsnDecodeIntInternal, sizeof(DWORD), FALSE, FALSE, 0, 0 }, + CRYPT_AsnDecodeUnsignedIntegerInternal, sizeof(CRYPT_INTEGER_BLOB), + FALSE, TRUE, offsetof(struct DECODED_RSA_PUB_KEY, pubexp.pbData), + 0 }, }; ret = CRYPT_AsnDecodeSequence(items, ARRAY_SIZE(items), pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, decodedKey, size, NULL, NULL); + + if (ret && (*decodedKey)->pubexp.cbData > sizeof(DWORD)) + { + WARN("Unexpected exponent length %lu.\n", (*decodedKey)->pubexp.cbData); + LocalFree(*decodedKey); + SetLastError(CRYPT_E_ASN1_LARGE); + ret = FALSE; + } + return ret; } @@ -3920,7 +3931,7 @@ static BOOL WINAPI CRYPT_AsnDecodeRsaPubKey_Bcrypt(DWORD dwCertEncodingType, if (ret) { /* Header, exponent, and modulus */ - DWORD bytesNeeded = sizeof(BCRYPT_RSAKEY_BLOB) + sizeof(DWORD) + + DWORD bytesNeeded = sizeof(BCRYPT_RSAKEY_BLOB) + decodedKey->pubexp.cbData + decodedKey->modulus.cbData; if (!pvStructInfo) @@ -3939,7 +3950,7 @@ static BOOL WINAPI CRYPT_AsnDecodeRsaPubKey_Bcrypt(DWORD dwCertEncodingType, hdr = pvStructInfo; hdr->Magic = BCRYPT_RSAPUBLIC_MAGIC; hdr->BitLength = decodedKey->modulus.cbData * 8; - hdr->cbPublicExp = sizeof(DWORD); + hdr->cbPublicExp = decodedKey->pubexp.cbData; hdr->cbModulus = decodedKey->modulus.cbData; hdr->cbPrime1 = 0; hdr->cbPrime2 = 0; @@ -3947,9 +3958,9 @@ static BOOL WINAPI CRYPT_AsnDecodeRsaPubKey_Bcrypt(DWORD dwCertEncodingType, * in big-endian format, so we need to convert from little-endian */ CRYPT_CopyReversed((BYTE *)pvStructInfo + sizeof(BCRYPT_RSAKEY_BLOB), - (BYTE *)&decodedKey->pubexp, sizeof(DWORD)); + decodedKey->pubexp.pbData, hdr->cbPublicExp); CRYPT_CopyReversed((BYTE *)pvStructInfo + sizeof(BCRYPT_RSAKEY_BLOB) + - sizeof(DWORD), decodedKey->modulus.pbData, + hdr->cbPublicExp, decodedKey->modulus.pbData, decodedKey->modulus.cbData); } LocalFree(decodedKey); @@ -3984,13 +3995,13 @@ static BOOL WINAPI CRYPT_AsnDecodeRsaPubKey(DWORD dwCertEncodingType, if (!pvStructInfo) { *pcbStructInfo = bytesNeeded; - ret = TRUE; } else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, pvStructInfo, pcbStructInfo, bytesNeeded))) { BLOBHEADER *hdr; RSAPUBKEY *rsaPubKey; + unsigned int i; if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) pvStructInfo = *(BYTE **)pvStructInfo; @@ -4002,7 +4013,11 @@ static BOOL WINAPI CRYPT_AsnDecodeRsaPubKey(DWORD dwCertEncodingType, rsaPubKey = (RSAPUBKEY *)((BYTE *)pvStructInfo + sizeof(BLOBHEADER)); rsaPubKey->magic = RSA1_MAGIC; - rsaPubKey->pubexp = decodedKey->pubexp; + rsaPubKey->pubexp = 0; + assert(decodedKey->pubexp.cbData <= sizeof(rsaPubKey->pubexp)); + for (i = 0; i < decodedKey->pubexp.cbData; ++i) + rsaPubKey->pubexp |= decodedKey->pubexp.pbData[i] << (i * 8); + rsaPubKey->bitlen = decodedKey->modulus.cbData * 8; memcpy((BYTE *)pvStructInfo + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY), decodedKey->modulus.pbData, diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index 3c37f41d504..565afb4c9e0 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -2315,10 +2315,10 @@ static const BYTE modulus1[] = { 0,0,0,1,1,1,1,1 }; static const BYTE modulus2[] = { 1,1,1,1,1,0,0,0 }; static const BYTE modulus3[] = { 0x80,1,1,1,1,0,0,0 }; static const BYTE modulus4[] = { 1,1,1,1,1,0,0,0x80 }; -static const BYTE mod1_encoded[] = { 0x30,0x0f,0x02,0x08,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x02,0x03,0x01,0x00,0x01 }; -static const BYTE mod2_encoded[] = { 0x30,0x0c,0x02,0x05,0x01,0x01,0x01,0x01,0x01,0x02,0x03,0x01,0x00,0x01 }; -static const BYTE mod3_encoded[] = { 0x30,0x0c,0x02,0x05,0x01,0x01,0x01,0x01,0x80,0x02,0x03,0x01,0x00,0x01 }; -static const BYTE mod4_encoded[] = { 0x30,0x10,0x02,0x09,0x00,0x80,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x02,0x03,0x01,0x00,0x01 }; +static const BYTE mod1_encoded[] = { 0x30,0x0f,0x02,0x08,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x02,0x03,0x02,0x00,0x01 }; +static const BYTE mod2_encoded[] = { 0x30,0x0c,0x02,0x05,0x01,0x01,0x01,0x01,0x01,0x02,0x03,0x02,0x00,0x01 }; +static const BYTE mod3_encoded[] = { 0x30,0x0c,0x02,0x05,0x01,0x01,0x01,0x01,0x80,0x02,0x03,0x02,0x00,0x01 }; +static const BYTE mod4_encoded[] = { 0x30,0x10,0x02,0x09,0x00,0x80,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x02,0x03,0x02,0x00,0x01 }; struct EncodedRSAPubKey { @@ -2351,7 +2351,7 @@ static void test_encodeRsaPublicKey(DWORD dwEncoding) hdr->aiKeyAlg = CALG_RSA_KEYX; rsaPubKey->magic = 0x31415352; rsaPubKey->bitlen = sizeof(modulus1) * 8; - rsaPubKey->pubexp = 65537; + rsaPubKey->pubexp = 131073; memcpy(toEncode + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY), modulus1, sizeof(modulus1)); @@ -2480,7 +2480,7 @@ static void test_decodeRsaPublicKey(DWORD dwEncoding) "Expected magic RSA1, got %08lx\n", rsaPubKey->magic); ok(rsaPubKey->bitlen == rsaPubKeys[i].decodedModulusLen * 8, "Wrong bit len %ld\n", rsaPubKey->bitlen); - ok(rsaPubKey->pubexp == 65537, "Expected pubexp 65537, got %ld\n", + ok(rsaPubKey->pubexp == 131073, "Expected pubexp 131073, got %ld\n", rsaPubKey->pubexp); ok(!memcmp(buf + sizeof(BLOBHEADER) + sizeof(RSAPUBKEY), rsaPubKeys[i].modulus, rsaPubKeys[i].decodedModulusLen), @@ -2497,7 +2497,7 @@ static void test_encodeRsaPublicKey_Bcrypt(DWORD dwEncoding) BOOL ret; BYTE *buf = NULL; DWORD bufSize = 0, i; - BYTE pubexp[] = {0x01,0x00,0x01,0x00}; /* 65537 */ + BYTE pubexp[] = {0x01,0x00,0x02,0x00}; /* 131073 */ /* Verify that the Magic value doesn't matter */ hdr->Magic = 1; @@ -2568,7 +2568,7 @@ static void test_decodeRsaPublicKey_Bcrypt(DWORD dwEncoding) if (ret) { BCRYPT_RSAKEY_BLOB *hdr = (BCRYPT_RSAKEY_BLOB *)buf; - BYTE pubexp[] = {0xff,0xff,0xff,0xff}, pubexp_expected[] = {0x01,0x00,0x01}; + BYTE pubexp[] = {0xff,0xff,0xff,0xcc}, pubexp_expected[] = {0x01,0x00,0x02}; /* CNG_RSA_PUBLIC_KEY_BLOB stores the exponent * in big-endian format, so we need to convert it to little-endian */ @@ -2584,13 +2584,13 @@ static void test_decodeRsaPublicKey_Bcrypt(DWORD dwEncoding) /* Windows decodes the exponent to 3 bytes, since it will fit. * Our implementation currently unconditionally decodes to a DWORD (4 bytes) */ - todo_wine ok(hdr->cbPublicExp == 3, "Expected cbPublicExp 3, got %ld\n", hdr->cbPublicExp); + ok(hdr->cbPublicExp == 3, "Expected cbPublicExp 3, got %ld\n", hdr->cbPublicExp); ok(hdr->cbModulus == rsaPubKeys[i].decodedModulusLen, "Wrong modulus len %ld\n", hdr->cbModulus); ok(hdr->cbPrime1 == 0,"Wrong cbPrime1 %ld\n", hdr->cbPrime1); ok(hdr->cbPrime2 == 0,"Wrong cbPrime2 %ld\n", hdr->cbPrime2); ok(!memcmp(pubexp, pubexp_expected, sizeof(pubexp_expected)), "Wrong exponent\n"); - todo_wine ok(pubexp[3] == 0xff, "Got %02x\n", pubexp[3]); + ok(pubexp[3] == 0xcc, "Got %02x\n", pubexp[3]); leModulus = malloc(hdr->cbModulus); /*
1
0
0
0
← Newer
1
2
3
4
5
...
56
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
Results per page:
10
25
50
100
200