1
0
mirror of https://github.com/wine-mirror/wine synced 2024-06-29 06:14:34 +00:00

dsound: Initialize MTA in IDirectSound::Initialize().

RE:D Cherish! (Trial ver) depends on this behavior.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53613
This commit is contained in:
Akihiro Sagawa 2024-03-06 23:29:31 +09:00 committed by Alexandre Julliard
parent 67153fa0c3
commit 6ce8a31b0b
4 changed files with 4 additions and 8 deletions

View File

@ -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));

View File

@ -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;

View File

@ -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);

View File

@ -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);