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
July 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
826 discussions
Start a n
N
ew thread
Zebediah Figura : devenum: Call DMOGetTypes() until less types are returned than were allocated.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 58c3b5c100046395670ee986b99d5be849c29048 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=58c3b5c100046395670ee986…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jul 13 09:38:05 2020 -0500 devenum: Call DMOGetTypes() until less types are returned than were allocated. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/devenum/mediacatenum.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/dlls/devenum/mediacatenum.c b/dlls/devenum/mediacatenum.c index 16b729ab1f..ab675b5656 100644 --- a/dlls/devenum/mediacatenum.c +++ b/dlls/devenum/mediacatenum.c @@ -147,28 +147,27 @@ static HRESULT WINAPI property_bag_Read(IPropertyBag *iface, }; unsigned int count = 1, input_count, output_count, i; - DMO_PARTIAL_MEDIATYPE *types = NULL; + DMO_PARTIAL_MEDIATYPE *types = NULL, *new_array; REGPINTYPES *reg_types; HRESULT hr; - if (!(types = malloc(2 * count * sizeof(*types)))) - return E_OUTOFMEMORY; - - while ((hr = DMOGetTypes(&moniker->clsid, count, &input_count, types, - count, &output_count, types + count)) == S_FALSE) + do { count *= 2; - if (!(types = realloc(types, count * sizeof(*types)))) + if (!(new_array = realloc(types, 2 * count * sizeof(*types)))) { free(types); return E_OUTOFMEMORY; } - } - if (hr != S_OK) - { - free(types); - return hr; - } + types = new_array; + + if (FAILED(hr = DMOGetTypes(&moniker->clsid, count, &input_count, types, + count, &output_count, types + count))) + { + free(types); + return hr; + } + } while (input_count == count || output_count == count); if (!(reg_types = malloc(2 * count * sizeof(*reg_types)))) {
1
0
0
0
Zebediah Figura : msdmo: Avoid leaking key handles in DMOGetTypes().
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 78d2a0919ebf7936e424effb5f54c3ff04469330 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=78d2a0919ebf7936e424effb…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jul 13 09:38:04 2020 -0500 msdmo: Avoid leaking key handles in DMOGetTypes(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msdmo/dmoreg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/msdmo/dmoreg.c b/dlls/msdmo/dmoreg.c index 8c32a8f59f..8e0680931f 100644 --- a/dlls/msdmo/dmoreg.c +++ b/dlls/msdmo/dmoreg.c @@ -741,5 +741,7 @@ HRESULT WINAPI DMOGetTypes(REFCLSID clsid, ULONG input_count, ULONG *ret_input_c if (!ret || ret == ERROR_MORE_DATA) *ret_output_count = min(output_count, size / sizeof(DMO_PARTIAL_MEDIATYPE)); + RegCloseKey(key); + RegCloseKey(root); return S_OK; }
1
0
0
0
Zebediah Figura : msdmo: Return the number of media types retrieved from DMOGetTypes().
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 37b926b8fe57e3242b0729598f33f0ad69a2c55f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=37b926b8fe57e3242b072959…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jul 13 09:38:03 2020 -0500 msdmo: Return the number of media types retrieved from DMOGetTypes(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msdmo/dmoreg.c | 22 ++++++++-------------- dlls/msdmo/tests/msdmo.c | 2 +- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/dlls/msdmo/dmoreg.c b/dlls/msdmo/dmoreg.c index cd253c3e9a..8c32a8f59f 100644 --- a/dlls/msdmo/dmoreg.c +++ b/dlls/msdmo/dmoreg.c @@ -730,22 +730,16 @@ HRESULT WINAPI DMOGetTypes(REFCLSID clsid, ULONG input_count, ULONG *ret_input_c } *ret_input_count = 0; - if (input_count > 0) - { - size = input_count * sizeof(DMO_PARTIAL_MEDIATYPE); - ret = RegQueryValueExW(key, L"InputTypes", NULL, NULL, (BYTE *)input, &size); - if (!ret || ret == ERROR_MORE_DATA) - *ret_input_count = size / sizeof(DMO_PARTIAL_MEDIATYPE); - } + size = input_count * sizeof(DMO_PARTIAL_MEDIATYPE); + ret = RegQueryValueExW(key, L"InputTypes", NULL, NULL, (BYTE *)input, &size); + if (!ret || ret == ERROR_MORE_DATA) + *ret_input_count = min(input_count, size / sizeof(DMO_PARTIAL_MEDIATYPE)); *ret_output_count = 0; - if (output_count > 0) - { - size = output_count * sizeof(DMO_PARTIAL_MEDIATYPE); - ret = RegQueryValueExW(key, L"OutputTypes", NULL, NULL, (BYTE *)output, &size); - if (!ret || ret == ERROR_MORE_DATA) - *ret_output_count = size / sizeof(DMO_PARTIAL_MEDIATYPE); - } + size = output_count * sizeof(DMO_PARTIAL_MEDIATYPE); + ret = RegQueryValueExW(key, L"OutputTypes", NULL, NULL, (BYTE *)output, &size); + if (!ret || ret == ERROR_MORE_DATA) + *ret_output_count = min(output_count, size / sizeof(DMO_PARTIAL_MEDIATYPE)); return S_OK; } diff --git a/dlls/msdmo/tests/msdmo.c b/dlls/msdmo/tests/msdmo.c index 2afa56e5a6..a1ab8ee00d 100644 --- a/dlls/msdmo/tests/msdmo.c +++ b/dlls/msdmo/tests/msdmo.c @@ -144,7 +144,7 @@ static void test_DMOGetTypes(void) memset(types, 0, sizeof(types)); hr = DMOGetTypes(&GUID_unknowndmo, 1, &input_count, types, 0, &output_count, NULL); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(input_count == 1, "Got input count %u.\n", input_count); + ok(input_count == 1, "Got input count %u.\n", input_count); ok(!output_count, "Got output count %u.\n", output_count); todo_wine ok(!memcmp(types, input_types, sizeof(DMO_PARTIAL_MEDIATYPE)), "Types didn't match.\n");
1
0
0
0
Zebediah Figura : msdmo: Return S_OK from DMOGetTypes() even if the buffer is too short.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 03a2191449ab9bbcc118e46e5bac3a7483d509dd URL:
https://source.winehq.org/git/wine.git/?a=commit;h=03a2191449ab9bbcc118e46e…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jul 13 09:38:02 2020 -0500 msdmo: Return S_OK from DMOGetTypes() even if the buffer is too short. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msdmo/dmoreg.c | 92 ++++++++++++++++++++---------------------------- dlls/msdmo/tests/msdmo.c | 2 +- 2 files changed, 39 insertions(+), 55 deletions(-) diff --git a/dlls/msdmo/dmoreg.c b/dlls/msdmo/dmoreg.c index a23bd95512..cd253c3e9a 100644 --- a/dlls/msdmo/dmoreg.c +++ b/dlls/msdmo/dmoreg.c @@ -706,62 +706,46 @@ static const IEnumDMOVtbl edmovt = IEnumDMO_fnClone, }; - -HRESULT read_types(HKEY root, LPCWSTR key, ULONG *supplied, ULONG requested, DMO_PARTIAL_MEDIATYPE* types ) -{ - DWORD len = requested * sizeof(DMO_PARTIAL_MEDIATYPE); - LONG ret = RegQueryValueExW(root, key, NULL, NULL, (BYTE *)types, &len); - - *supplied = len / sizeof(DMO_PARTIAL_MEDIATYPE); - return HRESULT_FROM_WIN32(ret); -} - /*************************************************************** * DMOGetTypes (MSDMO.@) */ -HRESULT WINAPI DMOGetTypes(REFCLSID clsidDMO, - ULONG ulInputTypesRequested, - ULONG* pulInputTypesSupplied, - DMO_PARTIAL_MEDIATYPE* pInputTypes, - ULONG ulOutputTypesRequested, - ULONG* pulOutputTypesSupplied, - DMO_PARTIAL_MEDIATYPE* pOutputTypes) +HRESULT WINAPI DMOGetTypes(REFCLSID clsid, ULONG input_count, ULONG *ret_input_count, DMO_PARTIAL_MEDIATYPE *input, + ULONG output_count, ULONG *ret_output_count, DMO_PARTIAL_MEDIATYPE *output) { - HKEY root,hkey; - HRESULT ret = S_OK; - WCHAR szguid[64]; - - TRACE ("(%s,%u,%p,%p,%u,%p,%p)\n", debugstr_guid(clsidDMO), ulInputTypesRequested, - pulInputTypesSupplied, pInputTypes, ulOutputTypesRequested, pulOutputTypesSupplied, - pOutputTypes); - - if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"DirectShow\\MediaObjects", 0, KEY_READ, &root)) - return E_FAIL; - - if (ERROR_SUCCESS != RegOpenKeyExW(root,GUIDToString(szguid,clsidDMO) , 0, - KEY_READ, &hkey)) - { - RegCloseKey(root); - return E_FAIL; - } - - if (ulInputTypesRequested > 0) - { - ret = read_types(hkey, L"InputTypes", pulInputTypesSupplied, ulInputTypesRequested, pInputTypes ); - } - else - *pulInputTypesSupplied = 0; - - if (ulOutputTypesRequested > 0) - { - HRESULT ret2; - ret2 = read_types(hkey, L"OutputTypes", pulOutputTypesSupplied, ulOutputTypesRequested, pOutputTypes ); - - if (ret == S_OK) - ret = ret2; - } - else - *pulOutputTypesSupplied = 0; - - return ret; + WCHAR guidstr[64]; + HKEY root, key; + LSTATUS ret; + DWORD size; + + TRACE("clsid %s, input_count %u, ret_input_count %p, input %p, output_count %u, ret_output_count %p, output %p.\n", + debugstr_guid(clsid), input_count, ret_input_count, input, output_count, ret_output_count, output); + + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, L"DirectShow\\MediaObjects", 0, KEY_READ, &root)) + return E_FAIL; + + if (RegOpenKeyExW(root, GUIDToString(guidstr, clsid), 0, KEY_READ, &key)) + { + RegCloseKey(root); + return E_FAIL; + } + + *ret_input_count = 0; + if (input_count > 0) + { + size = input_count * sizeof(DMO_PARTIAL_MEDIATYPE); + ret = RegQueryValueExW(key, L"InputTypes", NULL, NULL, (BYTE *)input, &size); + if (!ret || ret == ERROR_MORE_DATA) + *ret_input_count = size / sizeof(DMO_PARTIAL_MEDIATYPE); + } + + *ret_output_count = 0; + if (output_count > 0) + { + size = output_count * sizeof(DMO_PARTIAL_MEDIATYPE); + ret = RegQueryValueExW(key, L"OutputTypes", NULL, NULL, (BYTE *)output, &size); + if (!ret || ret == ERROR_MORE_DATA) + *ret_output_count = size / sizeof(DMO_PARTIAL_MEDIATYPE); + } + + return S_OK; } diff --git a/dlls/msdmo/tests/msdmo.c b/dlls/msdmo/tests/msdmo.c index 14653ea8d7..2afa56e5a6 100644 --- a/dlls/msdmo/tests/msdmo.c +++ b/dlls/msdmo/tests/msdmo.c @@ -143,7 +143,7 @@ static void test_DMOGetTypes(void) memset(types, 0, sizeof(types)); hr = DMOGetTypes(&GUID_unknowndmo, 1, &input_count, types, 0, &output_count, NULL); - todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(hr == S_OK, "Got hr %#x.\n", hr); todo_wine ok(input_count == 1, "Got input count %u.\n", input_count); ok(!output_count, "Got output count %u.\n", output_count); todo_wine ok(!memcmp(types, input_types, sizeof(DMO_PARTIAL_MEDIATYPE)), "Types didn't match.\n");
1
0
0
0
Zebediah Figura : msdmo/tests: Add tests for DMOGetTypes().
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: d36553f290cdaaee58e1d4c63c2848776fb65f0a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d36553f290cdaaee58e1d4c6…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Jul 13 09:38:01 2020 -0500 msdmo/tests: Add tests for DMOGetTypes(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msdmo/tests/msdmo.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/dlls/msdmo/tests/msdmo.c b/dlls/msdmo/tests/msdmo.c index 68de11f21a..14653ea8d7 100644 --- a/dlls/msdmo/tests/msdmo.c +++ b/dlls/msdmo/tests/msdmo.c @@ -117,9 +117,59 @@ static void test_DMOEnum(void) IEnumDMO_Release(enum_dmo); } +static void test_DMOGetTypes(void) +{ + static const DMO_PARTIAL_MEDIATYPE input_types[] = + { + {{0x1111}, {0x2222}}, + {{0x1111}, {0x3333}}, + }; + ULONG input_count, output_count; + DMO_PARTIAL_MEDIATYPE types[3]; + HRESULT hr; + + hr = DMOGetTypes(&GUID_unknowndmo, 0, &input_count, types, 0, &output_count, NULL); + ok(hr == E_FAIL, "Got hr %#x.\n", hr); + + hr = DMORegister(L"testdmo", &GUID_unknowndmo, &GUID_unknowncategory, 0, + ARRAY_SIZE(input_types), input_types, 0, NULL); + if (hr != S_OK) + return; + + hr = DMOGetTypes(&GUID_unknowndmo, 0, &input_count, types, 0, &output_count, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(!input_count, "Got input count %u.\n", input_count); + ok(!output_count, "Got output count %u.\n", output_count); + + memset(types, 0, sizeof(types)); + hr = DMOGetTypes(&GUID_unknowndmo, 1, &input_count, types, 0, &output_count, NULL); + todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); + todo_wine ok(input_count == 1, "Got input count %u.\n", input_count); + ok(!output_count, "Got output count %u.\n", output_count); + todo_wine ok(!memcmp(types, input_types, sizeof(DMO_PARTIAL_MEDIATYPE)), "Types didn't match.\n"); + + memset(types, 0, sizeof(types)); + hr = DMOGetTypes(&GUID_unknowndmo, 2, &input_count, types, 0, &output_count, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(input_count == 2, "Got input count %u.\n", input_count); + ok(!output_count, "Got output count %u.\n", output_count); + ok(!memcmp(types, input_types, 2 * sizeof(DMO_PARTIAL_MEDIATYPE)), "Types didn't match.\n"); + + memset(types, 0, sizeof(types)); + hr = DMOGetTypes(&GUID_unknowndmo, 2, &input_count, types, 0, &output_count, NULL); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(input_count == 2, "Got input count %u.\n", input_count); + ok(!output_count, "Got output count %u.\n", output_count); + ok(!memcmp(types, input_types, 2 * sizeof(DMO_PARTIAL_MEDIATYPE)), "Types didn't match.\n"); + + hr = DMOUnregister(&GUID_unknowndmo, &GUID_unknowncategory); + ok(hr == S_OK, "Got hr %#x.\n", hr); +} + START_TEST(msdmo) { test_DMOUnregister(); test_DMOGetName(); test_DMOEnum(); + test_DMOGetTypes(); }
1
0
0
0
Serge Gautherie : msvcrt: Remove extra pointers on lldiv() implementation and test.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 0a835c8da9e7aa5bc1d9f43ae785ce441757d18d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0a835c8da9e7aa5bc1d9f43a…
Author: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr> Date: Sat Jul 11 20:02:45 2020 +0200 msvcrt: Remove extra pointers on lldiv() implementation and test. Signed-off-by: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr> Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/math.c | 9 +++++---- dlls/ucrtbase/tests/misc.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 2e9154795d..ae4a267e03 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -2114,11 +2114,12 @@ MSVCRT_ldiv_t CDECL MSVCRT_ldiv(MSVCRT_long num, MSVCRT_long denom) /********************************************************************* * lldiv (MSVCR100.@) */ -MSVCRT_lldiv_t* CDECL MSVCRT_lldiv(MSVCRT_lldiv_t *ret, - MSVCRT_longlong num, MSVCRT_longlong denom) +MSVCRT_lldiv_t CDECL MSVCRT_lldiv(MSVCRT_longlong num, MSVCRT_longlong denom) { - ret->quot = num / denom; - ret->rem = num % denom; + MSVCRT_lldiv_t ret; + + ret.quot = num / denom; + ret.rem = num % denom; return ret; } diff --git a/dlls/ucrtbase/tests/misc.c b/dlls/ucrtbase/tests/misc.c index cd100cf1a9..e4928b194f 100644 --- a/dlls/ucrtbase/tests/misc.c +++ b/dlls/ucrtbase/tests/misc.c @@ -520,12 +520,19 @@ static void test__sopen_s(void) static void test_lldiv(void) { - static lldiv_t* (CDECL *p_lldiv)(lldiv_t*,LONGLONG,LONGLONG) = (void*)lldiv; lldiv_t r; - p_lldiv(&r, (LONGLONG)0x111 << 32 | 0x222, (LONGLONG)1 << 32); + r = lldiv(((LONGLONG)0x111 << 32) + 0x222, (LONGLONG)1 << 32); ok(r.quot == 0x111, "quot = %s\n", wine_dbgstr_longlong(r.quot)); ok(r.rem == 0x222, "rem = %s\n", wine_dbgstr_longlong(r.rem)); + + r = lldiv(((LONGLONG)0x69CF0012 << 32) + 0x0033E78A, 0x30); + ok(r.quot == ((LONGLONG)0x02345000 << 32) + 0x600114D2, "quot = %s\n", wine_dbgstr_longlong(r.quot)); + ok(r.rem == 0x2A, "rem = %s\n", wine_dbgstr_longlong(r.rem)); + + r = lldiv(((LONGLONG)0x243A5678 << 32) + 0x9ABCDEF0, (LONGLONG)0x12 << 48); + ok(r.quot == 0x0203, "quot = %s\n", wine_dbgstr_longlong(r.quot)); + ok(r.rem == ((LONGLONG)0x00045678 << 32) + 0x9ABCDEF0, "rem = %s\n", wine_dbgstr_longlong(r.rem)); } static void test_isblank(void)
1
0
0
0
Piotr Caban : ucrtbase: Add more printf tests.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: d5f1c549503e2800d94c251edd27087f570ae104 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d5f1c549503e2800d94c251e…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat Jul 11 18:44:23 2020 +0200 ucrtbase: Add more printf tests. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ucrtbase/tests/printf.c | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/dlls/ucrtbase/tests/printf.c b/dlls/ucrtbase/tests/printf.c index 9d925a06e1..7b754e13fd 100644 --- a/dlls/ucrtbase/tests/printf.c +++ b/dlls/ucrtbase/tests/printf.c @@ -758,6 +758,57 @@ static void test_printf_fp(void) { "%#.0a", -0.5, { "-0x1.p-1" }}, { "%#.0a", 0.5, { "0x1.p-1" }}, { "%#.0a", 1.5, { "0x1.p+0" }}, + + { "%f", 0, { "0.000000" }}, + { "%e", 0, { "0.000000e+00", NULL, "0.000000e+000" }}, + { "%g", 0, { "0" }}, + { "%21f", 0, { " 0.000000" }}, + { "%20e", 0, { " 0.000000e+00", NULL, " 0.000000e+000" }}, + { "%20g", 0, { " 0" }}, + { "%.21f", 0, { "0.000000000000000000000" }}, + { "%.20e", 0, { "0.00000000000000000000e+00", NULL, "0.00000000000000000000e+000" }}, + { "%.20g", 0, { "0" }}, + { "%.021f", 0, { "0.000000000000000000000" }}, + { "%.020e", 0, { "0.00000000000000000000e+00", NULL, "0.00000000000000000000e+000" }}, + { "%.020g", 0, { "0" }}, + { "%#.21f", 0, { "0.000000000000000000000" }}, + { "%#.20e", 0, { "0.00000000000000000000e+00", NULL, "0.00000000000000000000e+000" }}, + { "%#.20g", 0, { "0.00000000000000000000" }}, + + { "%f", 123, { "123.000000" }}, + { "%e", 123, { "1.230000e+02", NULL, "1.230000e+002" }}, + { "%g", 123, { "123" }}, + { "%21f", 123, { " 123.000000" }}, + { "%20e", 123, { " 1.230000e+02", NULL, " 1.230000e+002" }}, + { "%20g", 123, { " 123" }}, + { "%.21f", 123, { "123.000000000000000000000" }}, + { "%.20e", 123, { "1.23000000000000000000e+02", NULL, "1.23000000000000000000e+002" }}, + { "%.20g", 123, { "123" }}, + { "%.021f", 123, { "123.000000000000000000000" }}, + { "%.020e", 123, { "1.23000000000000000000e+02", NULL, "1.23000000000000000000e+002" }}, + { "%.020g", 123, { "123" }}, + { "%#.21f", 123, { "123.000000000000000000000" }}, + { "%#.20e", 123, { "1.23000000000000000000e+02", NULL, "1.23000000000000000000e+002" }}, + { "%#.20g", 123, { "123.00000000000000000" }}, + + { "%f", -765, { "-765.000000" }}, + { "%e", -765, { "-7.650000e+02", NULL, "-7.650000e+002" }}, + { "%g", -765, { "-765" }}, + { "%21f", -765, { " -765.000000" }}, + { "%20e", -765, { " -7.650000e+02", NULL, " -7.650000e+002" }}, + { "%20g", -765, { " -765" }}, + { "%.21f", -765, { "-765.000000000000000000000" }}, + { "%.20e", -765, { "-7.65000000000000000000e+02", NULL, "-7.65000000000000000000e+002" }}, + { "%.20g", -765, { "-765" }}, + { "%.021f", -765, { "-765.000000000000000000000" }}, + { "%.020e", -765, { "-7.65000000000000000000e+02", NULL, "-7.65000000000000000000e+002" }}, + { "%.020g", -765, { "-765" }}, + { "%#.21f", -765, { "-765.000000000000000000000" }}, + { "%#.20e", -765, { "-7.65000000000000000000e+02", NULL, "-7.65000000000000000000e+002" }}, + { "%#.20g", -765, { "-765.00000000000000000" }}, + { "%.30f", 1.0/3.0, { "0.333333333333333314829616256247" }}, + { "%.30lf", sqrt(2), { "1.414213562373095145474621858739" }}, + { "%.0g", 9.8949714229143402e-05, { "0.0001" }}, }; const char *res = NULL;
1
0
0
0
Piotr Caban : msvcrt: Reimplement floating point numbers printing.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 1bc6f0c86174cf1b5e47f1f1324a3f733e0658a1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1bc6f0c86174cf1b5e47f1f1…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat Jul 11 18:44:11 2020 +0200 msvcrt: Reimplement floating point numbers printing. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=37913
Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/printf.h | 413 +++++++++++++++++++++++++++++++++--------- dlls/msvcrt/tests/printf.c | 4 +- dlls/oleaut32/tests/vartype.c | 8 +- 3 files changed, 329 insertions(+), 96 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=1bc6f0c86174cf1b5e47…
1
0
0
0
Piotr Caban : msvcrt: Move big numbers implementation to new file.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: ec148864d6a6d47b319fe8bc79ae30d25d01c8ba URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ec148864d6a6d47b319fe8bc…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Sat Jul 11 18:41:13 2020 +0200 msvcrt: Move big numbers implementation to new file. Signed-off-by: Piotr Caban <piotr(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msvcrt/bnum.h | 136 +++++++++++++++++++++++++++++++++++++++++++++++++++ dlls/msvcrt/string.c | 116 +------------------------------------------ 2 files changed, 138 insertions(+), 114 deletions(-) diff --git a/dlls/msvcrt/bnum.h b/dlls/msvcrt/bnum.h new file mode 100644 index 0000000000..b66ebf04ec --- /dev/null +++ b/dlls/msvcrt/bnum.h @@ -0,0 +1,136 @@ +/* + * Copyright 2020 Piotr Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_BNUM_H +#define __WINE_BNUM_H + +#define EXP_BITS 11 +#define MANT_BITS 53 + +static const int p10s[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000 }; + +#define LIMB_DIGITS 9 /* each DWORD stores up to 9 digits */ +#define LIMB_MAX 1000000000 /* 10^9 */ +#define BNUM_IDX(i) ((i) & 127) +/* bnum represents real number with fixed decimal point (after 2 limbs) */ +struct bnum { + DWORD data[128]; /* circular buffer, base 10 number */ + int b; /* least significant digit position */ + int e; /* most significant digit position + 1 */ +}; + +/* Returns integral part of bnum */ +static inline ULONGLONG bnum_to_mant(struct bnum *b) +{ + ULONGLONG ret = (ULONGLONG)b->data[BNUM_IDX(b->e-1)] * LIMB_MAX; + if(b->b != b->e-1) ret += b->data[BNUM_IDX(b->e-2)]; + return ret; +} + +/* Returns TRUE if new most significant limb was added */ +static inline BOOL bnum_lshift(struct bnum *b, int shift) +{ + DWORD rest = 0; + ULONGLONG tmp; + int i; + + /* The limbs number can change by up to 1 so shift <= 29 */ + assert(shift <= 29); + + for(i=b->b; i<b->e; i++) { + tmp = ((ULONGLONG)b->data[BNUM_IDX(i)] << shift) + rest; + rest = tmp / LIMB_MAX; + b->data[BNUM_IDX(i)] = tmp % LIMB_MAX; + + if(i == b->b && !b->data[BNUM_IDX(i)]) + b->b++; + } + + if(rest) { + b->data[BNUM_IDX(b->e)] = rest; + b->e++; + + if(BNUM_IDX(b->b) == BNUM_IDX(b->e)) { + if(b->data[BNUM_IDX(b->b)]) b->data[BNUM_IDX(b->b+1)] |= 1; + b->b++; + } + return TRUE; + } + return FALSE; +} + +/* Returns TRUE if most significant limb was removed */ +static inline BOOL bnum_rshift(struct bnum *b, int shift) +{ + DWORD tmp, rest = 0; + BOOL ret = FALSE; + int i; + + /* Compute LIMB_MAX << shift without accuracy loss */ + assert(shift <= 9); + + for(i=b->e-1; i>=b->b; i--) { + tmp = b->data[BNUM_IDX(i)] & ((1<<shift)-1); + b->data[BNUM_IDX(i)] = (b->data[BNUM_IDX(i)] >> shift) + rest; + rest = (LIMB_MAX >> shift) * tmp; + if(i==b->e-1 && !b->data[BNUM_IDX(i)]) { + b->e--; + ret = TRUE; + } + } + + if(rest) { + if(BNUM_IDX(b->b-1) == BNUM_IDX(b->e)) { + if(rest) b->data[BNUM_IDX(b->b)] |= 1; + } else { + b->b--; + b->data[BNUM_IDX(b->b)] = rest; + } + } + return ret; +} + +static inline void bnum_mult(struct bnum *b, int mult) +{ + DWORD rest = 0; + ULONGLONG tmp; + int i; + + assert(mult <= LIMB_MAX); + + for(i=b->b; i<b->e; i++) { + tmp = ((ULONGLONG)b->data[BNUM_IDX(i)] * mult) + rest; + rest = tmp / LIMB_MAX; + b->data[BNUM_IDX(i)] = tmp % LIMB_MAX; + + if(i == b->b && !b->data[BNUM_IDX(i)]) + b->b++; + } + + if(rest) { + b->data[BNUM_IDX(b->e)] = rest; + b->e++; + + if(BNUM_IDX(b->b) == BNUM_IDX(b->e)) { + if(b->data[BNUM_IDX(b->b)]) b->data[BNUM_IDX(b->b+1)] |= 1; + b->b++; + } + } +} + +#endif /* __WINE_BNUM_H */ diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index 1e3e0d15bf..62ec54607e 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -32,6 +32,7 @@ #include <limits.h> #include <errno.h> #include "msvcrt.h" +#include "bnum.h" #include "winnls.h" #include "wine/debug.h" @@ -353,8 +354,6 @@ enum round { static double make_double(int sign, int exp, ULONGLONG m, enum round round, int *err) { -#define EXP_BITS 11 -#define MANT_BITS 53 ULONGLONG bits = 0; TRACE("%c %s *2^%d (round %d)\n", sign == -1 ? '-' : '+', wine_dbgstr_longlong(m), exp, round); @@ -572,120 +571,9 @@ static double strtod16(MSVCRT_wchar_t get(void *ctx), void unget(void *ctx), } #endif -#define LIMB_DIGITS 9 /* each DWORD stores up to 9 digits */ -#define LIMB_MAX 1000000000 /* 10^9 */ -#define BNUM_IDX(i) ((i) & 127) -/* bnum represents real number with fixed decimal point (after 2 limbs) */ -struct bnum { - DWORD data[128]; /* circular buffer, base 10 number */ - int b; /* least significant digit position */ - int e; /* most significant digit position + 1 */ -}; - -/* Returns integral part of bnum */ -static inline ULONGLONG bnum_to_mant(struct bnum *b) -{ - ULONGLONG ret = (ULONGLONG)b->data[BNUM_IDX(b->e-1)] * LIMB_MAX; - if(b->b != b->e-1) ret += b->data[BNUM_IDX(b->e-2)]; - return ret; -} - -/* Returns TRUE if new most significant limb was added */ -static inline BOOL bnum_lshift(struct bnum *b, int shift) -{ - DWORD rest = 0; - ULONGLONG tmp; - int i; - - /* The limbs number can change by up to 1 so shift <= 29 */ - assert(shift <= 29); - - for(i=b->b; i<b->e; i++) { - tmp = ((ULONGLONG)b->data[BNUM_IDX(i)] << shift) + rest; - rest = tmp / LIMB_MAX; - b->data[BNUM_IDX(i)] = tmp % LIMB_MAX; - - if(i == b->b && !b->data[BNUM_IDX(i)]) - b->b++; - } - - if(rest) { - b->data[BNUM_IDX(b->e)] = rest; - b->e++; - - if(BNUM_IDX(b->b) == BNUM_IDX(b->e)) { - if(b->data[BNUM_IDX(b->b)]) b->data[BNUM_IDX(b->b+1)] |= 1; - b->b++; - } - return TRUE; - } - return FALSE; -} - -/* Returns TRUE if most significant limb was removed */ -static inline BOOL bnum_rshift(struct bnum *b, int shift) -{ - DWORD tmp, rest = 0; - BOOL ret = FALSE; - int i; - - /* Compute LIMB_MAX << shift without accuracy loss */ - assert(shift <= 9); - - for(i=b->e-1; i>=b->b; i--) { - tmp = b->data[BNUM_IDX(i)] & ((1<<shift)-1); - b->data[BNUM_IDX(i)] = (b->data[BNUM_IDX(i)] >> shift) + rest; - rest = (LIMB_MAX >> shift) * tmp; - if(i==b->e-1 && !b->data[BNUM_IDX(i)]) { - b->e--; - ret = TRUE; - } - } - - if(rest) { - if(BNUM_IDX(b->b-1) == BNUM_IDX(b->e)) { - if(rest) b->data[BNUM_IDX(b->b)] |= 1; - } else { - b->b--; - b->data[BNUM_IDX(b->b)] = rest; - } - } - return ret; -} - -static inline void bnum_mult(struct bnum *b, int mult) -{ - DWORD rest = 0; - ULONGLONG tmp; - int i; - - assert(mult <= LIMB_MAX); - - for(i=b->b; i<b->e; i++) { - tmp = ((ULONGLONG)b->data[BNUM_IDX(i)] * mult) + rest; - rest = tmp / LIMB_MAX; - b->data[BNUM_IDX(i)] = tmp % LIMB_MAX; - - if(i == b->b && !b->data[BNUM_IDX(i)]) - b->b++; - } - - if(rest) { - b->data[BNUM_IDX(b->e)] = rest; - b->e++; - - if(BNUM_IDX(b->b) == BNUM_IDX(b->e)) { - if(b->data[BNUM_IDX(b->b)]) b->data[BNUM_IDX(b->b+1)] |= 1; - b->b++; - } - } -} - double parse_double(MSVCRT_wchar_t (*get)(void *ctx), void (*unget)(void *ctx), void *ctx, MSVCRT_pthreadlocinfo locinfo, int *err) { - static const int p10s[] = { 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000 }; - #if _MSVCR_VER >= 140 MSVCRT_wchar_t _infinity[] = { 'i', 'n', 'f', 'i', 'n', 'i', 't', 'y', 0 }; MSVCRT_wchar_t _nan[] = { 'n', 'a', 'n', 0 }; @@ -869,7 +757,7 @@ double parse_double(MSVCRT_wchar_t (*get)(void *ctx), void (*unget)(void *ctx), return make_double(sign, 0, b.data[BNUM_IDX(b.e-1)], ROUND_ZERO, err); off = (dp - limb_digits) % LIMB_DIGITS; if(off < 0) off += LIMB_DIGITS; - if(off) bnum_mult(&b, p10s[off-1]); + if(off) bnum_mult(&b, p10s[off]); if(!err) err = MSVCRT__errno(); if(dp-1 > MSVCRT_DBL_MAX_10_EXP)
1
0
0
0
Michael Stefaniuc : dmime: Reimplement the reference list parser.
by Alexandre Julliard
13 Jul '20
13 Jul '20
Module: wine Branch: master Commit: 199af0b73286da8690ce6f40efd44b9ba54b57d0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=199af0b73286da8690ce6f40…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Sun Jul 12 23:40:22 2020 +0200 dmime: Reimplement the reference list parser. Bits and pieces from a patch by Alistair Leslie-Hughes. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmime/Makefile.in | 1 - dlls/dmime/dmobject.c | 41 +++++++++++ dlls/dmime/dmobject.h | 4 ++ dlls/dmime/dmutils.c | 163 ------------------------------------------- dlls/dmime/dmutils.h | 5 -- dlls/dmime/segtriggertrack.c | 10 ++- 6 files changed, 52 insertions(+), 172 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=199af0b73286da8690ce…
1
0
0
0
← Newer
1
...
54
55
56
57
58
59
60
...
83
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Results per page:
10
25
50
100
200