Commit 6ce8a31b authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

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
parent 67153fa0
......@@ -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));
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment