amstream: Fix AMAudioData::QueryInterface.
Signed-off-by: Anton Baskanov <baskanov@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
16d300cacd
commit
4a0db15622
|
@ -43,7 +43,6 @@ static HRESULT WINAPI IAudioDataImpl_QueryInterface(IAudioData *iface, REFIID ri
|
||||||
TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ret_iface);
|
TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid(riid), ret_iface);
|
||||||
|
|
||||||
if (IsEqualGUID(riid, &IID_IUnknown) ||
|
if (IsEqualGUID(riid, &IID_IUnknown) ||
|
||||||
IsEqualGUID(riid, &IID_IMemoryData) ||
|
|
||||||
IsEqualGUID(riid, &IID_IAudioData))
|
IsEqualGUID(riid, &IID_IAudioData))
|
||||||
{
|
{
|
||||||
IAudioData_AddRef(iface);
|
IAudioData_AddRef(iface);
|
||||||
|
|
|
@ -593,6 +593,39 @@ error:
|
||||||
IAMMultiMediaStream_Release(pams);
|
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)
|
START_TEST(amstream)
|
||||||
{
|
{
|
||||||
HANDLE file;
|
HANDLE file;
|
||||||
|
@ -611,5 +644,7 @@ START_TEST(amstream)
|
||||||
test_renderfile();
|
test_renderfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
test_audiodata_query_interface();
|
||||||
|
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue