Re: [PATCH 1/6] amstream: Fix AMAudioData::QueryInterface.
On 27.07.2016 15:51, Anton Baskanov wrote:
Signed-off-by: Anton Baskanov <baskanov(a)gmail.com> --- dlls/amstream/audiodata.c | 1 - dlls/amstream/tests/Makefile.in | 3 +- dlls/amstream/tests/audiodata.c | 67 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 2 deletions(-) create mode 100755 dlls/amstream/tests/audiodata.c
Hi, Anton. Please keep tests in existing amstream.c file. +
+static void test_query_interface(void) +{ + IUnknown *unknown = create_audio_data(); + IMemoryData *memory_data = NULL; + IAudioData *audio_data = NULL; + + HRESULT result = S_OK;
result initialization is not needed;
+ + result = IUnknown_QueryInterface(unknown, &IID_IMemoryData, (void **)&memory_data); + ok(E_NOINTERFACE == result, "got 0x%08x\n", result); + if (S_OK == result) + { + IMemoryData_Release(memory_data); + }
If it always fails, there's no reason add conditional Release.
+ + result = IUnknown_QueryInterface(unknown, &IID_IAudioData, (void **)&audio_data); + ok(S_OK == result, "got 0x%08x\n", result); + if (S_OK == result) + { + IAudioData_Release(audio_data); + } + + IUnknown_Release(unknown); +}
Could you check if you can query IMemoryData from IAudioData? It seems really weird if parent interface is not supported at all.
participants (1)
-
Nikolay Sivov