Commit 4a0db156 authored by Anton Baskanov's avatar Anton Baskanov Committed by Alexandre Julliard

amstream: Fix AMAudioData::QueryInterface.

parent 16d300ca
......@@ -43,7 +43,6 @@ static HRESULT WINAPI IAudioDataImpl_QueryInterface(IAudioData *iface, REFIID ri
TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ret_iface);
if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IMemoryData) ||
IsEqualGUID(riid, &IID_IAudioData))
{
IAudioData_AddRef(iface);
......
......@@ -593,6 +593,39 @@ error:
IAMMultiMediaStream_Release(pams);
}
static IUnknown *create_audio_data(void)
{
IUnknown *audio_data = NULL;
HRESULT result = CoCreateInstance(&CLSID_AMAudioData, NULL, CLSCTX_INPROC_SERVER,
&IID_IUnknown, (void **)&audio_data);
ok(S_OK == result, "got 0x%08x\n", result);
return audio_data;
}
static void test_audiodata_query_interface(void)
{
IUnknown *unknown = create_audio_data();
IMemoryData *memory_data = NULL;
IAudioData *audio_data = NULL;
HRESULT result;
result = IUnknown_QueryInterface(unknown, &IID_IMemoryData, (void **)&memory_data);
ok(E_NOINTERFACE == result, "got 0x%08x\n", result);
result = IUnknown_QueryInterface(unknown, &IID_IAudioData, (void **)&audio_data);
ok(S_OK == result, "got 0x%08x\n", result);
if (S_OK == result)
{
result = IAudioData_QueryInterface(audio_data, &IID_IMemoryData, (void **)&memory_data);
ok(E_NOINTERFACE == result, "got 0x%08x\n", result);
IAudioData_Release(audio_data);
}
IUnknown_Release(unknown);
}
START_TEST(amstream)
{
HANDLE file;
......@@ -611,5 +644,7 @@ START_TEST(amstream)
test_renderfile();
}
test_audiodata_query_interface();
CoUninitialize();
}
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