From: Bernhard Kölbl besentv@gmail.com
This one actually retrieves a handler.
Signed-off-by: Bernhard Kölbl besentv@gmail.com --- dlls/windows.media.speech/tests/speech.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/windows.media.speech/tests/speech.c b/dlls/windows.media.speech/tests/speech.c index 9ef49b160cd..c7d80385b7a 100644 --- a/dlls/windows.media.speech/tests/speech.c +++ b/dlls/windows.media.speech/tests/speech.c @@ -860,7 +860,7 @@ static void test_SpeechRecognizer(void) HANDLE blocked_thread; HRESULT hr, error_code; UINT32 id; - LONG ref; + LONG ref, old_ref;
hr = RoInitialize(RO_INIT_MULTITHREADED); ok(hr == S_OK, "RoInitialize failed, hr %#lx.\n", hr); @@ -1133,14 +1133,22 @@ static void test_SpeechRecognizer(void) block_param.handler = &compilation_handler.IAsyncHandler_Compilation_iface; block_param.operation = operation; blocked_thread = CreateThread(NULL, 0, async_operation_block_thread, &block_param, 0, NULL); - ok(!WaitForSingleObject(compilation_handler.event_finished, 5000), "Wait for event_finished failed.\n"); - ok(WaitForSingleObject(blocked_thread, 100) == WAIT_TIMEOUT, "Wait for block_thread didn't time out.\n");
todo_wine ok(compilation_handler.ref == 3, "Got unexpected ref %lu.\n", compilation_handler.ref); todo_wine check_refcount(operation, 3);
+ handler = (void*)0xdeadbeef; + old_ref = compilation_handler.ref; + hr = IAsyncOperation_SpeechRecognitionCompilationResult_get_Completed(operation, &handler); + ok(hr == S_OK, "IAsyncOperation_SpeechRecognitionCompilationResult_get_Completed failed, hr %#lx.\n", hr); + todo_wine ok(handler == &compilation_handler.IAsyncHandler_Compilation_iface, "Handler was %p.\n", handler); + + ref = compilation_handler.ref - old_ref; + todo_wine ok(ref == 1, "The ref was increased by %lu.\n", ref); + if (handler) IAsyncOperationCompletedHandler_SpeechRecognitionCompilationResult_Release(handler); + hr = IAsyncOperation_SpeechRecognitionCompilationResult_QueryInterface(operation, &IID_IAsyncInfo, (void **)&info); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);