From: Shaun Ren sren@codeweavers.com
--- dlls/sapi/mmaudio.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/sapi/mmaudio.c b/dlls/sapi/mmaudio.c index d99bcb13672..7452d9a7257 100644 --- a/dlls/sapi/mmaudio.c +++ b/dlls/sapi/mmaudio.c @@ -293,6 +293,7 @@ static HRESULT WINAPI objwithtoken_SetObjectToken(ISpObjectWithToken *iface, ISp if (This->token) return SPERR_ALREADY_INITIALIZED;
+ ISpObjectToken_AddRef(token); This->token = token; return S_OK; }
From: Shaun Ren sren@codeweavers.com
--- dlls/sapi/tts.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/sapi/tts.c b/dlls/sapi/tts.c index 147734cc9a9..b0b3bbd2eff 100644 --- a/dlls/sapi/tts.c +++ b/dlls/sapi/tts.c @@ -641,7 +641,6 @@ static HRESULT WINAPI spvoice_SetVoice(ISpVoice *iface, ISpObjectToken *token) ISpTTSEngine *engine; HRESULT hr;
- TRACE("(%p, %p).\n", iface, token);
if (!token) @@ -649,6 +648,8 @@ static HRESULT WINAPI spvoice_SetVoice(ISpVoice *iface, ISpObjectToken *token) if (FAILED(hr = create_default_token(SPCAT_VOICES, &token))) return hr; } + else + ISpObjectToken_AddRef(token);
hr = ISpObjectToken_CreateInstance(token, NULL, CLSCTX_ALL, &IID_ISpTTSEngine, (void **)&engine); ISpObjectToken_Release(token);
From: Shaun Ren sren@codeweavers.com
--- dlls/sapi/tests/mmaudio.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/sapi/tests/mmaudio.c b/dlls/sapi/tests/mmaudio.c index 7c72fb112bf..a990430d784 100644 --- a/dlls/sapi/tests/mmaudio.c +++ b/dlls/sapi/tests/mmaudio.c @@ -167,7 +167,7 @@ static void test_audio_out(void) UINT devid; char *buf = NULL; ULONG written; - DWORD start, end; + DWORD start, duration; HANDLE event = NULL; HRESULT hr;
@@ -256,6 +256,7 @@ static void test_audio_out(void) ok(hr == S_OK, "got %#lx.\n", hr);
written = 0xdeadbeef; + start = GetTickCount(); hr = ISpMMSysAudio_Write(mmaudio, buf, wfx->nAvgBytesPerSec * 200 / 1000, &written); ok(hr == S_OK, "got %#lx.\n", hr); ok(written == wfx->nAvgBytesPerSec * 200 / 1000, "got %lu.\n", written); @@ -263,7 +264,8 @@ static void test_audio_out(void) hr = ISpMMSysAudio_Write(mmaudio, buf, wfx->nAvgBytesPerSec * 200 / 1000, NULL); ok(hr == S_OK, "got %#lx.\n", hr);
- start = GetTickCount(); + hr = ISpMMSysAudio_Commit(mmaudio, STGC_DEFAULT); + todo_wine ok(hr == S_OK, "got %#lx.\n", hr);
event = ISpMMSysAudio_EventHandle(mmaudio); ok(event != NULL, "event == NULL.\n"); @@ -271,8 +273,8 @@ static void test_audio_out(void) hr = WaitForSingleObject(event, 1000); ok(hr == WAIT_OBJECT_0, "got %#lx.\n", hr);
- end = GetTickCount(); - ok(end - start <= 500, "waited for %lu ms.\n", end - start); + duration = GetTickCount() - start; + ok(duration > 200 && duration < 800, "took %lu ms.\n", duration);
hr = ISpMMSysAudio_SetState(mmaudio, SPAS_CLOSED, 0); ok(hr == S_OK, "got %#lx.\n", hr);
From: Shaun Ren sren@codeweavers.com
--- dlls/sapi/tests/token.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/sapi/tests/token.c b/dlls/sapi/tests/token.c index 5a3bc0e340e..8befd98c2a5 100644 --- a/dlls/sapi/tests/token.c +++ b/dlls/sapi/tests/token.c @@ -601,7 +601,7 @@ static IClassFactory test_class_cf = { &ClassFactoryVtbl };
static void test_object_token(void) { - static const WCHAR test_token_id[] = L"HKEY_CURRENT_USER\Software\Winetest\sapi\TestToken"; + static const WCHAR test_token_id[] = L"HKEY_LOCAL_MACHINE\Software\Wine\Winetest\sapi\TestToken";
ISpObjectToken *token; ISpDataKey *sub_key; @@ -742,7 +742,12 @@ static void test_object_token(void) ok( hr == S_OK, "got %08lx\n", hr );
hr = ISpObjectToken_SetId( token, NULL, test_token_id, TRUE ); - ok( hr == S_OK, "got %08lx\n", hr ); + ok( hr == S_OK || broken(hr == E_ACCESSDENIED) /* win1064_adm */, "got %08lx\n", hr ); + if (hr == E_ACCESSDENIED) { + win_skip( "token SetId access denied\n" ); + ISpObjectToken_Release( token ); + return; + }
hr = ISpObjectToken_CreateKey( token, L"Attributes", &sub_key ); ok( hr == S_OK, "got %08lx\n", hr ); @@ -763,10 +768,6 @@ static void test_object_token(void)
test_class_token = NULL; hr = ISpObjectToken_CreateInstance( token, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&obj ); - if ( hr == E_ACCESSDENIED ) { - win_skip( "ISpObjectToken_CreateInstance returned E_ACCESSDENIED\n" ); - return; - } ok( hr == S_OK, "got %08lx\n", hr ); ok( test_class_token != NULL, "test_class_token not set\n" );
This merge request was approved by Huw Davies.