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
November 2023
----- 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
989 discussions
Start a n
N
ew thread
Paul Gofman : winepulse.drv: Change device description.
by Alexandre Julliard
16 Nov '23
16 Nov '23
Module: wine Branch: master Commit: 00e1eaffd2b6ae810381ebd15ca7e4eb5a39b8df URL:
https://gitlab.winehq.org/wine/wine/-/commit/00e1eaffd2b6ae810381ebd15ca7e4…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Oct 13 21:55:21 2023 -0600 winepulse.drv: Change device description. --- dlls/winepulse.drv/pulse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index 0ddddb00185..62658fc98e6 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c @@ -833,8 +833,9 @@ static NTSTATUS pulse_test_connect(void *args) list_init(&g_phys_speakers); list_init(&g_phys_sources); - pulse_add_device(&g_phys_speakers, NULL, 0, Speakers, 0, "", "PulseAudio"); - pulse_add_device(&g_phys_sources, NULL, 0, Microphone, 0, "", "PulseAudio"); + /* Burnout Paradise Remastered expects device name to have a space. */ + pulse_add_device(&g_phys_speakers, NULL, 0, Speakers, 0, "", "PulseAudio Output"); + pulse_add_device(&g_phys_sources, NULL, 0, Microphone, 0, "", "PulseAudio Input"); o = pa_context_get_sink_info_list(pulse_ctx, &pulse_phys_speakers_cb, NULL); if (o) {
1
0
0
0
Paul Gofman : combase: Ensure MTA existence in RoGetActivationFactory().
by Alexandre Julliard
16 Nov '23
16 Nov '23
Module: wine Branch: master Commit: b46eafe3d29889a30904b5dfaa5c4ef35155766d URL:
https://gitlab.winehq.org/wine/wine/-/commit/b46eafe3d29889a30904b5dfaa5c4e…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Sep 12 12:53:27 2023 -0600 combase: Ensure MTA existence in RoGetActivationFactory(). --- dlls/combase/apartment.c | 31 +++++++++++++++++++++++++++++++ dlls/combase/combase.c | 3 +++ dlls/combase/combase_private.h | 2 ++ dlls/combase/roapi.c | 5 +++++ dlls/combase/tests/roapi.c | 12 ++++++------ dlls/ole32/compobj_private.h | 1 + 6 files changed, 48 insertions(+), 6 deletions(-) diff --git a/dlls/combase/apartment.c b/dlls/combase/apartment.c index d679ef3407a..92f1e32c502 100644 --- a/dlls/combase/apartment.c +++ b/dlls/combase/apartment.c @@ -1157,6 +1157,11 @@ void leave_apartment(struct tlsdata *data) if (data->ole_inits) WARN( "Uninitializing apartment while Ole is still initialized\n" ); apartment_release(data->apt); + if (data->implicit_mta_cookie) + { + apartment_decrement_mta_usage(data->implicit_mta_cookie); + data->implicit_mta_cookie = NULL; + } data->apt = NULL; data->flags &= ~(OLETLS_DISABLE_OLE1DDE | OLETLS_APARTMENTTHREADED | OLETLS_MULTITHREADED); } @@ -1288,3 +1293,29 @@ void apartment_global_cleanup(void) apartment_release_dlls(); DeleteCriticalSection(&apt_cs); } + +HRESULT ensure_mta(void) +{ + struct apartment *apt; + struct tlsdata *data; + HRESULT hr; + + if (FAILED(hr = com_get_tlsdata(&data))) + return hr; + if ((apt = data->apt) && (data->implicit_mta_cookie || apt->multi_threaded)) + return S_OK; + + EnterCriticalSection(&apt_cs); + if (apt || mta) + hr = apartment_increment_mta_usage(&data->implicit_mta_cookie); + else + hr = CO_E_NOTINITIALIZED; + LeaveCriticalSection(&apt_cs); + + if (FAILED(hr)) + { + ERR("Failed, hr %#lx.\n", hr); + return hr; + } + return S_OK; +} diff --git a/dlls/combase/combase.c b/dlls/combase/combase.c index f1b5828e0f8..e072c169953 100644 --- a/dlls/combase/combase.c +++ b/dlls/combase/combase.c @@ -407,6 +407,9 @@ static void com_cleanup_tlsdata(void) if (tlsdata->apt) apartment_release(tlsdata->apt); + if (tlsdata->implicit_mta_cookie) + apartment_decrement_mta_usage(tlsdata->implicit_mta_cookie); + if (tlsdata->errorinfo) IErrorInfo_Release(tlsdata->errorinfo); if (tlsdata->state) diff --git a/dlls/combase/combase_private.h b/dlls/combase/combase_private.h index 53932e9a357..04d251962ec 100644 --- a/dlls/combase/combase_private.h +++ b/dlls/combase/combase_private.h @@ -92,6 +92,7 @@ struct tlsdata struct list spies; /* Spies installed with CoRegisterInitializeSpy */ DWORD spies_lock; DWORD cancelcount; + CO_MTA_USAGE_COOKIE implicit_mta_cookie; /* mta referenced by roapi from sta thread */ }; extern HRESULT WINAPI InternalTlsAllocData(struct tlsdata **data); @@ -161,6 +162,7 @@ void apartment_release(struct apartment *apt); struct apartment * apartment_get_current_or_mta(void); HRESULT apartment_increment_mta_usage(CO_MTA_USAGE_COOKIE *cookie); void apartment_decrement_mta_usage(CO_MTA_USAGE_COOKIE cookie); +HRESULT ensure_mta(void); struct apartment * apartment_get_mta(void); HRESULT apartment_get_inproc_class_object(struct apartment *apt, const struct class_reg_data *regdata, REFCLSID rclsid, REFIID riid, DWORD class_context, void **ppv); diff --git a/dlls/combase/roapi.c b/dlls/combase/roapi.c index b80ca2e8325..e1017f1f3fd 100644 --- a/dlls/combase/roapi.c +++ b/dlls/combase/roapi.c @@ -24,6 +24,8 @@ #include "roerrorapi.h" #include "winstring.h" +#include "combase_private.h" + #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(combase); @@ -154,6 +156,9 @@ HRESULT WINAPI RoGetActivationFactory(HSTRING classid, REFIID iid, void **class_ if (!iid || !class_factory) return E_INVALIDARG; + if (FAILED(hr = ensure_mta())) + return hr; + hr = get_library_for_classid(WindowsGetStringRawBuffer(classid, NULL), &library); if (FAILED(hr)) { diff --git a/dlls/combase/tests/roapi.c b/dlls/combase/tests/roapi.c index 4887cb60ef6..abc03176db0 100644 --- a/dlls/combase/tests/roapi.c +++ b/dlls/combase/tests/roapi.c @@ -211,7 +211,7 @@ static void test_implicit_mta(void) ok(hr == S_OK, "got %#lx.\n", hr); /* RoGetActivationFactory doesn't implicitly initialize COM. */ hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory); - todo_wine ok(hr == CO_E_NOTINITIALIZED, "got %#lx.\n", hr); + ok(hr == CO_E_NOTINITIALIZED, "got %#lx.\n", hr); check_thread_apartment(CO_E_NOTINITIALIZED); @@ -227,10 +227,10 @@ static void test_implicit_mta(void) check_thread_apartment(tests[i].mta ? S_OK : CO_E_NOTINITIALIZED); hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory); ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr); - todo_wine_if(!tests[i].mta) check_thread_apartment_broken(S_OK); /* Broken on Win8. */ + check_thread_apartment_broken(S_OK); /* Broken on Win8. */ hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory); ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr); - todo_wine_if(!tests[i].mta) check_thread_apartment_broken(S_OK); /* Broken on Win8. */ + check_thread_apartment_broken(S_OK); /* Broken on Win8. */ if (tests[i].ro_init) RoUninitialize(); else @@ -270,7 +270,7 @@ static void test_implicit_mta(void) SetEvent(mta_init_thread_done_event); WaitForSingleObject(thread, INFINITE); CloseHandle(thread); - todo_wine check_thread_apartment_broken(S_OK); /* Broken on Win8. */ + check_thread_apartment_broken(S_OK); /* Broken on Win8. */ CoUninitialize(); check_thread_apartment(CO_E_NOTINITIALIZED); @@ -292,7 +292,7 @@ static void test_implicit_mta(void) SetEvent(mta_init_thread_done_event); WaitForSingleObject(thread, INFINITE); CloseHandle(thread); - todo_wine check_thread_apartment_broken(S_OK); /* Broken on Win8. */ + check_thread_apartment_broken(S_OK); /* Broken on Win8. */ CoUninitialize(); check_thread_apartment(CO_E_NOTINITIALIZED); @@ -300,7 +300,7 @@ static void test_implicit_mta(void) thread = CreateThread(NULL, 0, mta_init_implicit_thread, NULL, 0, NULL); ok(!!thread, "failed.\n"); WaitForSingleObject(mta_init_thread_init_done_event, INFINITE); - todo_wine check_thread_apartment_broken(S_OK); /* Broken on Win8. */ + check_thread_apartment_broken(S_OK); /* Broken on Win8. */ SetEvent(mta_init_thread_done_event); WaitForSingleObject(thread, INFINITE); CloseHandle(thread); diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index eae1a5998c0..2daadb617c5 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -63,6 +63,7 @@ struct oletls struct list spies; /* Spies installed with CoRegisterInitializeSpy */ DWORD spies_lock; DWORD cancelcount; + CO_MTA_USAGE_COOKIE implicit_mta_cookie; /* mta referenced by roapi from sta thread */ }; /* Global Interface Table Functions */
1
0
0
0
Paul Gofman : combase/tests: Add tests for implicit MTA with RoGetActivationFactory().
by Alexandre Julliard
16 Nov '23
16 Nov '23
Module: wine Branch: master Commit: 2f1b288a3f0fe3f99f63e883c83d32fc477722b1 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2f1b288a3f0fe3f99f63e883c83d32…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Sep 12 14:47:07 2023 -0600 combase/tests: Add tests for implicit MTA with RoGetActivationFactory(). --- dlls/combase/tests/roapi.c | 196 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) diff --git a/dlls/combase/tests/roapi.c b/dlls/combase/tests/roapi.c index f10cbb4507b..4887cb60ef6 100644 --- a/dlls/combase/tests/roapi.c +++ b/dlls/combase/tests/roapi.c @@ -116,12 +116,208 @@ static void test_ActivationFactories(void) RoUninitialize(); } +static APTTYPE check_thread_apttype; +static APTTYPEQUALIFIER check_thread_aptqualifier; +static HRESULT check_thread_hr; + +static DWORD WINAPI check_apartment_thread(void *dummy) +{ + check_thread_apttype = 0xdeadbeef; + check_thread_aptqualifier = 0xdeadbeef; + check_thread_hr = CoGetApartmentType(&check_thread_apttype, &check_thread_aptqualifier); + return 0; +} + +#define check_thread_apartment(a) check_thread_apartment_(__LINE__, FALSE, a) +#define check_thread_apartment_broken(a) check_thread_apartment_(__LINE__, TRUE, a) +static void check_thread_apartment_(unsigned int line, BOOL broken_fail, HRESULT expected_hr_thread) +{ + HANDLE thread; + + check_thread_hr = 0xdeadbeef; + thread = CreateThread(NULL, 0, check_apartment_thread, NULL, 0, NULL); + WaitForSingleObject(thread, INFINITE); + CloseHandle(thread); + ok_(__FILE__, line)(check_thread_hr == expected_hr_thread + || broken(broken_fail && expected_hr_thread == S_OK && check_thread_hr == CO_E_NOTINITIALIZED), + "got %#lx, expected %#lx.\n", check_thread_hr, expected_hr_thread); + if (SUCCEEDED(check_thread_hr)) + { + ok_(__FILE__, line)(check_thread_apttype == APTTYPE_MTA, "got %d.\n", check_thread_apttype); + ok_(__FILE__, line)(check_thread_aptqualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, "got %d.\n", check_thread_aptqualifier); + } +} + +static HANDLE mta_init_thread_init_done_event, mta_init_thread_done_event; + +static DWORD WINAPI mta_init_thread(void *dummy) +{ + HRESULT hr; + + hr = CoInitializeEx(NULL, COINIT_MULTITHREADED); + ok(hr == S_OK, "got %#lx.\n", hr); + SetEvent(mta_init_thread_init_done_event); + + WaitForSingleObject(mta_init_thread_done_event, INFINITE); + CoUninitialize(); + return 0; +} + +static DWORD WINAPI mta_init_implicit_thread(void *dummy) +{ + IActivationFactory *factory; + HSTRING str; + HRESULT hr; + + hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = WindowsCreateString(L"Does.Not.Exist", ARRAY_SIZE(L"Does.Not.Exist") - 1, &str); + ok(hr == S_OK, "got %#lx.\n", hr); + hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory); + ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr); + WindowsDeleteString(str); + + SetEvent(mta_init_thread_init_done_event); + WaitForSingleObject(mta_init_thread_done_event, INFINITE); + + /* No CoUninitialize(), testing cleanup on thread exit. */ + return 0; +} + +static void test_implicit_mta(void) +{ + static const struct + { + BOOL ro_init; + BOOL mta; + } + tests[] = + { + { FALSE, FALSE }, + { FALSE, TRUE }, + { TRUE, FALSE }, + { TRUE, TRUE }, + }; + APTTYPEQUALIFIER aptqualifier; + IActivationFactory *factory; + APTTYPE apttype; + unsigned int i; + HANDLE thread; + HSTRING str; + HRESULT hr; + + hr = WindowsCreateString(L"Does.Not.Exist", ARRAY_SIZE(L"Does.Not.Exist") - 1, &str); + ok(hr == S_OK, "got %#lx.\n", hr); + /* RoGetActivationFactory doesn't implicitly initialize COM. */ + hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory); + todo_wine ok(hr == CO_E_NOTINITIALIZED, "got %#lx.\n", hr); + + check_thread_apartment(CO_E_NOTINITIALIZED); + + /* RoGetActivationFactory initializes implicit MTA. */ + for (i = 0; i < ARRAY_SIZE(tests); ++i) + { + winetest_push_context("test %u", i); + if (tests[i].ro_init) + hr = RoInitialize(tests[i].mta ? RO_INIT_MULTITHREADED : RO_INIT_SINGLETHREADED); + else + hr = CoInitializeEx(NULL, tests[i].mta ? COINIT_MULTITHREADED : COINIT_APARTMENTTHREADED); + ok(hr == S_OK, "got %#lx.\n", hr); + check_thread_apartment(tests[i].mta ? S_OK : CO_E_NOTINITIALIZED); + hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory); + ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr); + todo_wine_if(!tests[i].mta) check_thread_apartment_broken(S_OK); /* Broken on Win8. */ + hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory); + ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr); + todo_wine_if(!tests[i].mta) check_thread_apartment_broken(S_OK); /* Broken on Win8. */ + if (tests[i].ro_init) + RoUninitialize(); + else + CoUninitialize(); + check_thread_apartment(CO_E_NOTINITIALIZED); + winetest_pop_context(); + } + + mta_init_thread_init_done_event = CreateEventW(NULL, FALSE, FALSE, NULL); + mta_init_thread_done_event = CreateEventW(NULL, FALSE, FALSE, NULL); + + /* RoGetActivationFactory references implicit MTA in a current thread + * even if implicit MTA was already initialized: check with STA init + * after RoGetActivationFactory(). */ + thread = CreateThread(NULL, 0, mta_init_thread, NULL, 0, NULL); + ok(!!thread, "failed.\n"); + WaitForSingleObject(mta_init_thread_init_done_event, INFINITE); + check_thread_apartment(S_OK); + + hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory); + ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr); + check_thread_apartment(S_OK); + + hr = CoGetApartmentType(&apttype, &aptqualifier); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(apttype == APTTYPE_MTA, "got %d.\n", apttype); + ok(aptqualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, "got %d.\n", aptqualifier); + + hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = CoGetApartmentType(&apttype, &aptqualifier); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(apttype == APTTYPE_MAINSTA, "got %d.\n", apttype); + ok(aptqualifier == APTTYPEQUALIFIER_NONE, "got %d.\n", aptqualifier); + + SetEvent(mta_init_thread_done_event); + WaitForSingleObject(thread, INFINITE); + CloseHandle(thread); + todo_wine check_thread_apartment_broken(S_OK); /* Broken on Win8. */ + CoUninitialize(); + check_thread_apartment(CO_E_NOTINITIALIZED); + + /* RoGetActivationFactory references implicit MTA in a current thread + * even if implicit MTA was already initialized: check with STA init + * before RoGetActivationFactory(). */ + thread = CreateThread(NULL, 0, mta_init_thread, NULL, 0, NULL); + ok(!!thread, "failed.\n"); + WaitForSingleObject(mta_init_thread_init_done_event, INFINITE); + check_thread_apartment(S_OK); + + hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = RoGetActivationFactory(str, &IID_IActivationFactory, (void **)&factory); + ok(hr == REGDB_E_CLASSNOTREG, "got %#lx.\n", hr); + check_thread_apartment(S_OK); + + SetEvent(mta_init_thread_done_event); + WaitForSingleObject(thread, INFINITE); + CloseHandle(thread); + todo_wine check_thread_apartment_broken(S_OK); /* Broken on Win8. */ + CoUninitialize(); + check_thread_apartment(CO_E_NOTINITIALIZED); + + /* Test implicit MTA apartment thread exit. */ + thread = CreateThread(NULL, 0, mta_init_implicit_thread, NULL, 0, NULL); + ok(!!thread, "failed.\n"); + WaitForSingleObject(mta_init_thread_init_done_event, INFINITE); + todo_wine check_thread_apartment_broken(S_OK); /* Broken on Win8. */ + SetEvent(mta_init_thread_done_event); + WaitForSingleObject(thread, INFINITE); + CloseHandle(thread); + check_thread_apartment(CO_E_NOTINITIALIZED); + + CloseHandle(mta_init_thread_init_done_event); + CloseHandle(mta_init_thread_done_event); + WindowsDeleteString(str); +} + START_TEST(roapi) { BOOL ret; load_resource(L"wine.combase.test.dll"); + test_implicit_mta(); test_ActivationFactories(); SetLastError(0xdeadbeef);
1
0
0
0
Jactry Zeng : msvcp140: Add codecvt<char32> class stub.
by Alexandre Julliard
16 Nov '23
16 Nov '23
Module: wine Branch: master Commit: 49547f8bb90644bb8c41ca71c30bf9227df4e36e URL:
https://gitlab.winehq.org/wine/wine/-/commit/49547f8bb90644bb8c41ca71c30bf9…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Wed Nov 15 08:00:56 2023 +0100 msvcp140: Add codecvt<char32> class stub. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47609
--- dlls/msvcp140/msvcp140.spec | 108 +++++++++--------- dlls/msvcp90/locale.c | 255 ++++++++++++++++++++++++++++++++++++++++++ dlls/msvcp90/msvcp90.h | 14 +++ dlls/msvcp_win/msvcp_win.spec | 108 +++++++++--------- 4 files changed, 377 insertions(+), 108 deletions(-)
1
0
0
0
Anton Baskanov : dmsynth: Use FLUID_MOD_KEY for CONN_SRC_KEYNUMBER.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: b0ad8b8cfb6e664cc6cfdd87ddb28af077149417 URL:
https://gitlab.winehq.org/wine/wine/-/commit/b0ad8b8cfb6e664cc6cfdd87ddb28a…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Wed Nov 15 15:25:32 2023 +0700 dmsynth: Use FLUID_MOD_KEY for CONN_SRC_KEYNUMBER. Fixes incorrect EG key number scale and offset that caused missing lower notes of some instruments (e.g. Acoustic Grand Piano). --- dlls/dmsynth/synth.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index ec9785c4218..bbe77e43cc9 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -1483,17 +1483,6 @@ static BOOL set_gen_from_connection(fluid_voice_t *fluid_voice, const CONNECTION { if (!gen_from_connection(conn, &gen)) return FALSE; } - else if (conn->usSource == CONN_SRC_KEYNUMBER) - { - switch (conn->usDestination) - { - case CONN_DST_EG2_HOLDTIME: gen = GEN_KEYTOMODENVHOLD; break; - case CONN_DST_EG2_DECAYTIME: gen = GEN_KEYTOMODENVDECAY; break; - case CONN_DST_EG1_HOLDTIME: gen = GEN_KEYTOVOLENVHOLD; break; - case CONN_DST_EG1_DECAYTIME: gen = GEN_KEYTOVOLENVDECAY; break; - default: return FALSE; - } - } else if (conn->usSource == CONN_SRC_LFO) { switch (conn->usDestination) @@ -1588,10 +1577,6 @@ static void add_mod_from_connection(fluid_voice_t *fluid_voice, const CONNECTION case MAKELONG(CONN_SRC_LFO, CONN_DST_FILTER_CUTOFF): gen = GEN_MODLFOTOFILTERFC; break; case MAKELONG(CONN_SRC_EG2, CONN_DST_FILTER_CUTOFF): gen = GEN_MODENVTOFILTERFC; break; case MAKELONG(CONN_SRC_LFO, CONN_DST_GAIN): gen = GEN_MODLFOTOVOL; break; - case MAKELONG(CONN_SRC_KEYNUMBER, CONN_DST_EG2_HOLDTIME): gen = GEN_KEYTOMODENVHOLD; break; - case MAKELONG(CONN_SRC_KEYNUMBER, CONN_DST_EG2_DECAYTIME): gen = GEN_KEYTOMODENVDECAY; break; - case MAKELONG(CONN_SRC_KEYNUMBER, CONN_DST_EG1_HOLDTIME): gen = GEN_KEYTOVOLENVHOLD; break; - case MAKELONG(CONN_SRC_KEYNUMBER, CONN_DST_EG1_DECAYTIME): gen = GEN_KEYTOVOLENVDECAY; break; } if (conn->usControl != CONN_SRC_NONE && gen != -1)
1
0
0
0
Anton Baskanov : dmsynth: Fall back to the Standard drum set when there is no matching instrument or region.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: 02853687c204d63877294482427f3f98b62346bb URL:
https://gitlab.winehq.org/wine/wine/-/commit/02853687c204d63877294482427f3f…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Wed Nov 15 15:16:28 2023 +0700 dmsynth: Fall back to the Standard drum set when there is no matching instrument or region. --- dlls/dmsynth/synth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index c4a19607544..ec9785c4218 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -1814,6 +1814,8 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui EnterCriticalSection(&synth->cs); find_region(synth, preset->bank, preset->patch, key, vel, &instrument, ®ion); + if (!region && preset->bank == 128) + find_region(synth, preset->bank, 0, key, vel, &instrument, ®ion); if (!instrument) {
1
0
0
0
Anton Baskanov : dmsynth: Factor out instrument and region search.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: f58bdd865d427af71812de605358d89a43872757 URL:
https://gitlab.winehq.org/wine/wine/-/commit/f58bdd865d427af71812de605358d8…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Wed Nov 15 15:12:08 2023 +0700 dmsynth: Factor out instrument and region search. --- dlls/dmsynth/synth.c | 149 +++++++++++++++++++++++++++++---------------------- 1 file changed, 86 insertions(+), 63 deletions(-) diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 05f5b0e354e..c4a19607544 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -1411,6 +1411,35 @@ static int synth_preset_get_num(fluid_preset_t *fluid_preset) return preset->patch; } +static void find_region(struct synth *synth, int bank, int patch, int key, int vel, + struct instrument **out_instrument, struct region **out_region) +{ + struct instrument *instrument; + struct region *region; + + *out_instrument = NULL; + *out_region = NULL; + + LIST_FOR_EACH_ENTRY(instrument, &synth->instruments, struct instrument, entry) + { + if (bank == 128 && instrument->patch == (0x80000000 | patch)) break; + else if (instrument->patch == ((bank << 8) | patch)) break; + } + + if (&instrument->entry == &synth->instruments) + return; + + *out_instrument = instrument; + + LIST_FOR_EACH_ENTRY(region, &instrument->regions, struct region, entry) + { + if (key < region->key_range.usLow || key > region->key_range.usHigh) continue; + if (vel < region->vel_range.usLow || vel > region->vel_range.usHigh) continue; + *out_region = region; + break; + } +} + static BOOL gen_from_connection(const CONNECTION *conn, UINT *gen) { switch (conn->usDestination) @@ -1773,99 +1802,93 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui { struct preset *preset = fluid_preset_get_data(fluid_preset); struct synth *synth = preset->synth; + struct articulation *articulation; struct instrument *instrument; fluid_voice_t *fluid_voice; struct region *region; + struct voice *voice; + struct wave *wave; TRACE("(%p, %p, %u, %u, %u)\n", fluid_preset, fluid_synth, chan, key, vel); EnterCriticalSection(&synth->cs); - LIST_FOR_EACH_ENTRY(instrument, &synth->instruments, struct instrument, entry) - { - if (preset->bank == 128 && instrument->patch == (0x80000000 | preset->patch)) break; - else if (instrument->patch == ((preset->bank << 8) | preset->patch)) break; - } + find_region(synth, preset->bank, preset->patch, key, vel, &instrument, ®ion); - if (&instrument->entry == &synth->instruments) + if (!instrument) { WARN("Could not find instrument with patch %#x\n", preset->patch); LeaveCriticalSection(&synth->cs); return FLUID_FAILED; } + if (!region) + { + WARN("Failed to find instrument matching note / velocity\n"); + LeaveCriticalSection(&synth->cs); + return FLUID_FAILED; + } - LIST_FOR_EACH_ENTRY(region, &instrument->regions, struct region, entry) + wave = region->wave; + + if (!(fluid_voice = fluid_synth_alloc_voice(synth->fluid_synth, wave->fluid_sample, chan, key, vel))) { - struct articulation *articulation; - struct wave *wave = region->wave; - struct voice *voice; + WARN("Failed to allocate FluidSynth voice\n"); + LeaveCriticalSection(&synth->cs); + return FLUID_FAILED; + } - if (key < region->key_range.usLow || key > region->key_range.usHigh) continue; - if (vel < region->vel_range.usLow || vel > region->vel_range.usHigh) continue; + LIST_FOR_EACH_ENTRY(voice, &synth->voices, struct voice, entry) + { + if (voice->fluid_voice == fluid_voice) + { + wave_release(voice->wave); + break; + } + } - if (!(fluid_voice = fluid_synth_alloc_voice(synth->fluid_synth, wave->fluid_sample, chan, key, vel))) + if (&voice->entry == &synth->voices) + { + if (!(voice = calloc(1, sizeof(struct voice)))) { - WARN("Failed to allocate FluidSynth voice\n"); LeaveCriticalSection(&synth->cs); return FLUID_FAILED; } + voice->fluid_voice = fluid_voice; + list_add_tail(&synth->voices, &voice->entry); + } - LIST_FOR_EACH_ENTRY(voice, &synth->voices, struct voice, entry) - { - if (voice->fluid_voice == fluid_voice) - { - wave_release(voice->wave); - break; - } - } + voice->wave = wave; + wave_addref(voice->wave); - if (&voice->entry == &synth->voices) - { - if (!(voice = calloc(1, sizeof(struct voice)))) - { - LeaveCriticalSection(&synth->cs); - return FLUID_FAILED; - } - voice->fluid_voice = fluid_voice; - list_add_tail(&synth->voices, &voice->entry); - } + set_default_voice_connections(fluid_voice); + if (region->wave_sample.cSampleLoops) + { + WLOOP *loop = region->wave_loops; - voice->wave = wave; - wave_addref(voice->wave); + if (loop->ulType == WLOOP_TYPE_FORWARD) + fluid_voice_gen_set(fluid_voice, GEN_SAMPLEMODE, FLUID_LOOP_DURING_RELEASE); + else if (loop->ulType == WLOOP_TYPE_RELEASE) + fluid_voice_gen_set(fluid_voice, GEN_SAMPLEMODE, FLUID_LOOP_UNTIL_RELEASE); + else + FIXME("Unsupported loop type %lu\n", loop->ulType); - set_default_voice_connections(fluid_voice); - if (region->wave_sample.cSampleLoops) - { - WLOOP *loop = region->wave_loops; - - if (loop->ulType == WLOOP_TYPE_FORWARD) - fluid_voice_gen_set(fluid_voice, GEN_SAMPLEMODE, FLUID_LOOP_DURING_RELEASE); - else if (loop->ulType == WLOOP_TYPE_RELEASE) - fluid_voice_gen_set(fluid_voice, GEN_SAMPLEMODE, FLUID_LOOP_UNTIL_RELEASE); - else - FIXME("Unsupported loop type %lu\n", loop->ulType); - - /* When copy_data is TRUE, fluid_sample_set_sound_data() adds - * 8-frame padding around the sample data. Offset the loop points - * to compensate for this. */ - fluid_voice_gen_set(fluid_voice, GEN_STARTLOOPADDROFS, 8 + loop->ulStart); - fluid_voice_gen_set(fluid_voice, GEN_ENDLOOPADDROFS, 8 + loop->ulStart + loop->ulLength); - } - fluid_voice_gen_set(fluid_voice, GEN_OVERRIDEROOTKEY, region->wave_sample.usUnityNote); - fluid_voice_gen_set(fluid_voice, GEN_FINETUNE, region->wave_sample.sFineTune); - LIST_FOR_EACH_ENTRY(articulation, &instrument->articulations, struct articulation, entry) - add_voice_connections(fluid_voice, &articulation->list, articulation->connections); - LIST_FOR_EACH_ENTRY(articulation, ®ion->articulations, struct articulation, entry) - add_voice_connections(fluid_voice, &articulation->list, articulation->connections); - fluid_synth_start_voice(synth->fluid_synth, fluid_voice); - LeaveCriticalSection(&synth->cs); - return FLUID_OK; + /* When copy_data is TRUE, fluid_sample_set_sound_data() adds + * 8-frame padding around the sample data. Offset the loop points + * to compensate for this. */ + fluid_voice_gen_set(fluid_voice, GEN_STARTLOOPADDROFS, 8 + loop->ulStart); + fluid_voice_gen_set(fluid_voice, GEN_ENDLOOPADDROFS, 8 + loop->ulStart + loop->ulLength); } + fluid_voice_gen_set(fluid_voice, GEN_OVERRIDEROOTKEY, region->wave_sample.usUnityNote); + fluid_voice_gen_set(fluid_voice, GEN_FINETUNE, region->wave_sample.sFineTune); + LIST_FOR_EACH_ENTRY(articulation, &instrument->articulations, struct articulation, entry) + add_voice_connections(fluid_voice, &articulation->list, articulation->connections); + LIST_FOR_EACH_ENTRY(articulation, ®ion->articulations, struct articulation, entry) + add_voice_connections(fluid_voice, &articulation->list, articulation->connections); + fluid_synth_start_voice(synth->fluid_synth, fluid_voice); LeaveCriticalSection(&synth->cs); - WARN("Failed to find instrument matching note / velocity\n"); - return FLUID_FAILED; + return FLUID_OK; } static void synth_preset_free(fluid_preset_t *fluid_preset)
1
0
0
0
Anton Baskanov : dmsynth: Get rid of instrument reference counting.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: 3fd64a726a383b9e12b0cae8897f44ce15b6c69b URL:
https://gitlab.winehq.org/wine/wine/-/commit/3fd64a726a383b9e12b0cae8897f44…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Mon Nov 6 17:39:07 2023 +0700 dmsynth: Get rid of instrument reference counting. --- dlls/dmsynth/synth.c | 43 ++++++++++++++++++------------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index d11ca0f2f5d..05f5b0e354e 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -277,7 +277,6 @@ static void region_destroy(struct region *region) struct instrument { struct list entry; - LONG ref; UINT id; UINT patch; @@ -288,30 +287,25 @@ struct instrument struct synth *synth; }; -static void instrument_release(struct instrument *instrument) +static void instrument_destroy(struct instrument *instrument) { - ULONG ref = InterlockedDecrement(&instrument->ref); + struct articulation *articulation; + struct region *region; + void *next; - if (!ref) + LIST_FOR_EACH_ENTRY_SAFE(region, next, &instrument->regions, struct region, entry) { - struct articulation *articulation; - struct region *region; - void *next; - - LIST_FOR_EACH_ENTRY_SAFE(region, next, &instrument->regions, struct region, entry) - { - list_remove(®ion->entry); - region_destroy(region); - } - - LIST_FOR_EACH_ENTRY_SAFE(articulation, next, &instrument->articulations, struct articulation, entry) - { - list_remove(&articulation->entry); - free(articulation); - } + list_remove(®ion->entry); + region_destroy(region); + } - free(instrument); + LIST_FOR_EACH_ENTRY_SAFE(articulation, next, &instrument->articulations, struct articulation, entry) + { + list_remove(&articulation->entry); + free(articulation); } + + free(instrument); } struct preset @@ -424,7 +418,7 @@ static ULONG WINAPI synth_Release(IDirectMusicSynth8 *iface) LIST_FOR_EACH_ENTRY_SAFE(instrument, next, &This->instruments, struct instrument, entry) { list_remove(&instrument->entry); - instrument_release(instrument); + instrument_destroy(instrument); } LIST_FOR_EACH_ENTRY_SAFE(wave, next, &This->waves, struct wave, entry) @@ -736,7 +730,6 @@ static HRESULT synth_download_instrument(struct synth *This, DMUS_DOWNLOADINFO * if (instrument_info->ulFirstExtCkIdx) FIXME("Instrument extensions not implemented\n"); if (!(instrument = calloc(1, sizeof(*instrument)))) return E_OUTOFMEMORY; - instrument->ref = 1; instrument->id = info->dwDLId; instrument->patch = instrument_info->ulPatch; instrument->flags = instrument_info->ulFlags; @@ -763,7 +756,7 @@ static HRESULT synth_download_instrument(struct synth *This, DMUS_DOWNLOADINFO * if (!(region->wave = synth_find_wave_from_id(This, region->wave_link.ulTableIndex))) { free(region); - instrument_release(instrument); + instrument_destroy(instrument); return DMUS_E_BADWAVELINK; } @@ -786,7 +779,7 @@ static HRESULT synth_download_instrument(struct synth *This, DMUS_DOWNLOADINFO * return S_OK; error: - instrument_release(instrument); + instrument_destroy(instrument); return E_OUTOFMEMORY; } @@ -930,7 +923,7 @@ static HRESULT WINAPI synth_Unload(IDirectMusicSynth8 *iface, HANDLE handle, list_remove(&instrument->entry); LeaveCriticalSection(&This->cs); - instrument_release(instrument); + instrument_destroy(instrument); return S_OK; } }
1
0
0
0
Anton Baskanov : dmsynth: Move instrument search to synth_preset_noteon().
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: 24c00250c4a5e95a1b7b30e6ce396ee05a1bccbb URL:
https://gitlab.winehq.org/wine/wine/-/commit/24c00250c4a5e95a1b7b30e6ce396e…
Author: Anton Baskanov <baskanov(a)gmail.com> Date: Thu Nov 2 14:16:50 2023 +0700 dmsynth: Move instrument search to synth_preset_noteon(). This allows loaded instruments to take effect without a subsequent program change. In particular, when there is no program change at all, this allows the default Acoustic Grand Piano or Standard drum set to play. As a side effect, this disables FluidSynth fallback logic for missing presets. --- dlls/dmsynth/synth.c | 53 ++++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 51271e48b2a..d11ca0f2f5d 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -288,11 +288,6 @@ struct instrument struct synth *synth; }; -static void instrument_addref(struct instrument *instrument) -{ - InterlockedIncrement(&instrument->ref); -} - static void instrument_release(struct instrument *instrument) { ULONG ref = InterlockedDecrement(&instrument->ref); @@ -327,7 +322,7 @@ struct preset fluid_preset_t *fluid_preset; - struct instrument *instrument; + struct synth *synth; }; struct event @@ -637,7 +632,6 @@ static HRESULT WINAPI synth_Close(IDirectMusicSynth8 *iface) LIST_FOR_EACH_ENTRY_SAFE(preset, next, &This->presets, struct preset, entry) { list_remove(&preset->entry); - instrument_release(preset->instrument); delete_fluid_preset(preset->fluid_preset); free(preset); } @@ -1785,13 +1779,28 @@ static void set_default_voice_connections(fluid_voice_t *fluid_voice) static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *fluid_synth, int chan, int key, int vel) { struct preset *preset = fluid_preset_get_data(fluid_preset); - struct instrument *instrument = preset->instrument; - struct synth *synth = instrument->synth; + struct synth *synth = preset->synth; + struct instrument *instrument; fluid_voice_t *fluid_voice; struct region *region; TRACE("(%p, %p, %u, %u, %u)\n", fluid_preset, fluid_synth, chan, key, vel); + EnterCriticalSection(&synth->cs); + + LIST_FOR_EACH_ENTRY(instrument, &synth->instruments, struct instrument, entry) + { + if (preset->bank == 128 && instrument->patch == (0x80000000 | preset->patch)) break; + else if (instrument->patch == ((preset->bank << 8) | preset->patch)) break; + } + + if (&instrument->entry == &synth->instruments) + { + WARN("Could not find instrument with patch %#x\n", preset->patch); + LeaveCriticalSection(&synth->cs); + return FLUID_FAILED; + } + LIST_FOR_EACH_ENTRY(region, &instrument->regions, struct region, entry) { struct articulation *articulation; @@ -1804,6 +1813,7 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui if (!(fluid_voice = fluid_synth_alloc_voice(synth->fluid_synth, wave->fluid_sample, chan, key, vel))) { WARN("Failed to allocate FluidSynth voice\n"); + LeaveCriticalSection(&synth->cs); return FLUID_FAILED; } @@ -1819,7 +1829,10 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui if (&voice->entry == &synth->voices) { if (!(voice = calloc(1, sizeof(struct voice)))) + { + LeaveCriticalSection(&synth->cs); return FLUID_FAILED; + } voice->fluid_voice = fluid_voice; list_add_tail(&synth->voices, &voice->entry); } @@ -1852,9 +1865,12 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui LIST_FOR_EACH_ENTRY(articulation, ®ion->articulations, struct articulation, entry) add_voice_connections(fluid_voice, &articulation->list, articulation->connections); fluid_synth_start_voice(synth->fluid_synth, fluid_voice); + LeaveCriticalSection(&synth->cs); return FLUID_OK; } + LeaveCriticalSection(&synth->cs); + WARN("Failed to find instrument matching note / velocity\n"); return FLUID_FAILED; } @@ -1871,7 +1887,6 @@ static const char *synth_sfont_get_name(fluid_sfont_t *fluid_sfont) static fluid_preset_t *synth_sfont_get_preset(fluid_sfont_t *fluid_sfont, int bank, int patch) { struct synth *synth = fluid_sfont_get_data(fluid_sfont); - struct instrument *instrument; fluid_preset_t *fluid_preset; struct preset *preset; @@ -1888,19 +1903,6 @@ static fluid_preset_t *synth_sfont_get_preset(fluid_sfont_t *fluid_sfont, int ba } } - LIST_FOR_EACH_ENTRY(instrument, &synth->instruments, struct instrument, entry) - { - if (bank == 128 && instrument->patch == (0x80000000 | patch)) break; - else if (instrument->patch == ((bank << 8) | patch)) break; - } - - if (&instrument->entry == &synth->instruments) - { - WARN("Could not find instrument with patch %#x\n", patch); - LeaveCriticalSection(&synth->cs); - return NULL; - } - if (!(fluid_preset = new_fluid_preset(fluid_sfont, synth_preset_get_name, synth_preset_get_bank, synth_preset_get_num, synth_preset_noteon, synth_preset_free))) { @@ -1918,12 +1920,11 @@ static fluid_preset_t *synth_sfont_get_preset(fluid_sfont_t *fluid_sfont, int ba preset->bank = bank; preset->patch = patch; preset->fluid_preset = fluid_preset; - preset->instrument = instrument; + preset->synth = synth; fluid_preset_set_data(fluid_preset, preset); - instrument_addref(instrument); list_add_tail(&synth->presets, &preset->entry); - TRACE("Created fluid_preset %p for instrument %p\n", fluid_preset, instrument); + TRACE("Created fluid_preset %p\n", fluid_preset); LeaveCriticalSection(&synth->cs);
1
0
0
0
Jacek Caban : include: Don't use dllexport attribute for Wine PE modules.
by Alexandre Julliard
15 Nov '23
15 Nov '23
Module: wine Branch: master Commit: dc4bad6d85409f5116fec5d44b2788b685b1befd URL:
https://gitlab.winehq.org/wine/wine/-/commit/dc4bad6d85409f5116fec5d44b2788…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Wed Nov 15 16:26:39 2023 +0100 include: Don't use dllexport attribute for Wine PE modules. --- include/winnt.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/winnt.h b/include/winnt.h index d1c82084f9f..0af765652b7 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -180,7 +180,10 @@ extern "C" { /* a couple of useful Wine extensions */ -#ifdef _MSC_VER +#if defined(__WINESRC__) && !defined(WINE_UNIX_LIB) +/* Wine uses .spec file for PE exports */ +# define DECLSPEC_EXPORT +#elif defined(_MSC_VER) # define DECLSPEC_EXPORT __declspec(dllexport) #elif defined(__MINGW32__) # define DECLSPEC_EXPORT __attribute__((dllexport))
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
...
99
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Results per page:
10
25
50
100
200