Commit b075088e authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

dmime: IDirectMusicPerformance8 GetGraph return DMUS_E_NOT_FOUND if graph not set.

Just ensure the pointer and return value are correct from GetGraph. I plan to extend these tests at a later date. The tests also show that IDirectMusicPerformance8 has a internal IDirectMusicGraph implementation, returned via QueryInterface. Signed-off-by: 's avatarAlistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: 's avatarMichael Stefaniuc <mstefani@winehq.org> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 4badb89c
......@@ -549,18 +549,21 @@ static HRESULT WINAPI IDirectMusicPerformance8Impl_FreePMsg(IDirectMusicPerforma
}
static HRESULT WINAPI IDirectMusicPerformance8Impl_GetGraph(IDirectMusicPerformance8 *iface,
IDirectMusicGraph **ppGraph)
IDirectMusicGraph **graph)
{
IDirectMusicPerformance8Impl *This = impl_from_IDirectMusicPerformance8(iface);
IDirectMusicPerformance8Impl *This = impl_from_IDirectMusicPerformance8(iface);
FIXME("(%p, %p): to check\n", This, ppGraph);
if (NULL != This->pToolGraph) {
*ppGraph = This->pToolGraph;
IDirectMusicGraph_AddRef(*ppGraph);
} else {
return E_FAIL;
}
return S_OK;
TRACE("(%p, %p)\n", This, graph);
if (!graph)
return E_POINTER;
*graph = This->pToolGraph;
if (This->pToolGraph) {
IDirectMusicGraph_AddRef(*graph);
}
return *graph ? S_OK : DMUS_E_NOT_FOUND;
}
static HRESULT WINAPI IDirectMusicPerformance8Impl_SetGraph(IDirectMusicPerformance8 *iface,
......
......@@ -345,7 +345,7 @@ static void test_pchannel(void)
unsigned int i;
HRESULT hr;
create_performance(&perf, NULL, NULL, FALSE);
create_performance(&perf, NULL, NULL, TRUE);
hr = IDirectMusicPerformance8_Init(perf, NULL, NULL, NULL);
ok(hr == S_OK, "Init failed: %08x\n", hr);
hr = IDirectMusicPerformance8_PChannelInfo(perf, 0, &port, NULL, NULL);
......@@ -610,6 +610,31 @@ static void test_notification_type(void)
IDirectMusicPerformance8_Release(perf);
}
static void test_performance_graph(void)
{
HRESULT hr;
IDirectMusicPerformance8 *perf;
IDirectMusicGraph *graph = NULL, *graph2;
create_performance(&perf, NULL, NULL, FALSE);
hr = IDirectMusicPerformance8_Init(perf, NULL, NULL, NULL);
ok(hr == S_OK, "Init failed: %08x\n", hr);
hr = IDirectMusicPerformance8_GetGraph(perf, NULL);
ok(hr == E_POINTER, "Failed: %08x\n", hr);
hr = IDirectMusicPerformance8_GetGraph(perf, &graph2);
ok(hr == DMUS_E_NOT_FOUND, "Failed: %08x\n", hr);
ok(graph2 == NULL, "unexpected pointer.\n");
hr = IDirectMusicPerformance8_QueryInterface(perf, &IID_IDirectMusicGraph, (void**)&graph);
todo_wine ok(hr == S_OK, "Failed: %08x\n", hr);
if (graph)
IDirectMusicGraph_Release(graph);
destroy_performance(perf, NULL, NULL);
}
START_TEST( performance )
{
HRESULT hr;
......@@ -630,6 +655,7 @@ START_TEST( performance )
test_createport();
test_pchannel();
test_notification_type();
test_performance_graph();
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