From: Akihiro Sagawa sagawa.aki@gmail.com
RE:D Cherish! (Trial ver) depends on this behavior.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53613 --- dlls/dsound/dsound.c | 3 +++ dlls/dsound/dsound_private.h | 1 + dlls/dsound/tests/dsound.c | 4 ---- dlls/dsound/tests/dsound8.c | 4 ---- 4 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c index 57fd6c1a651..7629810db50 100644 --- a/dlls/dsound/dsound.c +++ b/dlls/dsound/dsound.c @@ -207,6 +207,8 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device) WaitForSingleObject(device->thread, INFINITE); CloseHandle(device->thread); } + if (device->mta_cookie) + CoDecrementMTAUsage(device->mta_cookie);
EnterCriticalSection(&DSOUND_renderers_lock); list_remove(&device->entry); @@ -332,6 +334,7 @@ static HRESULT DirectSoundDevice_Initialize(DirectSoundDevice ** ppDevice, LPCGU WARN("DSOUND_ReopenDevice failed: %08lx\n", hr); return hr; } + CoIncrementMTAUsage(&device->mta_cookie);
ZeroMemory(&device->drvcaps, sizeof(device->drvcaps));
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h index 34498125317..28bba6cd64e 100644 --- a/dlls/dsound/dsound_private.h +++ b/dlls/dsound/dsound_private.h @@ -90,6 +90,7 @@ struct DirectSoundDevice int lfe_channel; float *tmp_buffer, *cp_buffer; DWORD tmp_buffer_len, cp_buffer_len; + CO_MTA_USAGE_COOKIE mta_cookie;
DSVOLUMEPAN volpan;
diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index da430bb1411..7a815e0ce0b 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -1879,9 +1879,7 @@ static void test_implicit_mta(void) "IDirectSound_Initialize() failed: %08lx\n", hr); if (hr == DS_OK) { check_apttype(&test_apt_data); - todo_wine ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); - todo_wine ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, "got apt type qualifier %d.\n", test_apt_data.qualifier); } @@ -1896,9 +1894,7 @@ static void test_implicit_mta(void) "DirectSoundCreate() failed: %08lx\n", hr); if (hr == DS_OK) { check_apttype(&test_apt_data); - todo_wine ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); - todo_wine ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, "got apt type qualifier %d.\n", test_apt_data.qualifier); IDirectSound_Release(dso); diff --git a/dlls/dsound/tests/dsound8.c b/dlls/dsound/tests/dsound8.c index 2bdeb49fe97..e95800af83e 100644 --- a/dlls/dsound/tests/dsound8.c +++ b/dlls/dsound/tests/dsound8.c @@ -1903,9 +1903,7 @@ static void test_implicit_mta(void) "IDirectSound8_Initialize() failed: %08lx\n", hr); if (hr == DS_OK) { check_apttype(&test_apt_data); - todo_wine ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); - todo_wine ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, "got apt type qualifier %d.\n", test_apt_data.qualifier); } @@ -1920,9 +1918,7 @@ static void test_implicit_mta(void) "DirectSoundCreate8() failed: %08lx\n", hr); if (hr == DS_OK) { check_apttype(&test_apt_data); - todo_wine ok(test_apt_data.type == APTTYPE_MTA, "got apt type %d.\n", test_apt_data.type); - todo_wine ok(test_apt_data.qualifier == APTTYPEQUALIFIER_IMPLICIT_MTA, "got apt type qualifier %d.\n", test_apt_data.qualifier); IDirectSound8_Release(dso);