Commit 4b787aa9 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

dmime: Implement IDirectMusicPerformance8_ClonePMsg.

parent 0c4e1e43
......@@ -1071,13 +1071,22 @@ static HRESULT WINAPI performance_StopEx(IDirectMusicPerformance8 *iface, IUnkno
return S_OK;
}
static HRESULT WINAPI performance_ClonePMsg(IDirectMusicPerformance8 *iface, DMUS_PMSG *pSourcePMSG,
DMUS_PMSG **ppCopyPMSG)
static HRESULT WINAPI performance_ClonePMsg(IDirectMusicPerformance8 *iface, DMUS_PMSG *msg, DMUS_PMSG **clone)
{
struct performance *This = impl_from_IDirectMusicPerformance8(iface);
struct performance *This = impl_from_IDirectMusicPerformance8(iface);
HRESULT hr;
FIXME("(%p, %p, %p): stub\n", This, pSourcePMSG, ppCopyPMSG);
return S_OK;
TRACE("(%p, %p, %p)\n", This, msg, clone);
if (!msg || !clone) return E_POINTER;
if (FAILED(hr = IDirectMusicPerformance8_AllocPMsg(iface, msg->dwSize, clone))) return hr;
memcpy(*clone, msg, msg->dwSize);
if (msg->pTool) IDirectMusicTool_AddRef(msg->pTool);
if (msg->pGraph) IDirectMusicGraph_AddRef(msg->pGraph);
if (msg->punkUser) IUnknown_AddRef(msg->punkUser);
return S_OK;
}
static HRESULT WINAPI performance_CreateAudioPath(IDirectMusicPerformance8 *iface,
......
......@@ -1805,13 +1805,13 @@ static void test_performance_pmsg(void)
ok(hr == E_INVALIDARG, "got %#lx\n", hr);
hr = IDirectMusicPerformance8_ClonePMsg((IDirectMusicPerformance8 *)performance, msg, NULL);
todo_wine ok(hr == E_POINTER, "got %#lx\n", hr);
ok(hr == E_POINTER, "got %#lx\n", hr);
hr = IDirectMusicPerformance8_ClonePMsg((IDirectMusicPerformance8 *)performance, NULL, &clone);
todo_wine ok(hr == E_POINTER, "got %#lx\n", hr);
ok(hr == E_POINTER, "got %#lx\n", hr);
clone = NULL;
hr = IDirectMusicPerformance8_ClonePMsg((IDirectMusicPerformance8 *)performance, msg, &clone);
ok(hr == S_OK, "got %#lx\n", hr);
todo_wine ok(clone != NULL, "got %p\n", clone);
ok(clone != NULL, "got %p\n", clone);
msg->mtTime = 500;
msg->dwFlags = DMUS_PMSGF_MUSICTIME;
......@@ -1822,8 +1822,7 @@ static void test_performance_pmsg(void)
hr = IDirectMusicPerformance_FreePMsg(performance, msg);
ok(hr == DMUS_E_CANNOT_FREE, "got %#lx\n", hr);
if (!clone) hr = S_OK;
else hr = IDirectMusicPerformance_FreePMsg(performance, clone);
hr = IDirectMusicPerformance_FreePMsg(performance, clone);
ok(hr == S_OK, "got %#lx\n", hr);
......
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