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 ...@@ -1071,13 +1071,22 @@ static HRESULT WINAPI performance_StopEx(IDirectMusicPerformance8 *iface, IUnkno
return S_OK; return S_OK;
} }
static HRESULT WINAPI performance_ClonePMsg(IDirectMusicPerformance8 *iface, DMUS_PMSG *pSourcePMSG, static HRESULT WINAPI performance_ClonePMsg(IDirectMusicPerformance8 *iface, DMUS_PMSG *msg, DMUS_PMSG **clone)
DMUS_PMSG **ppCopyPMSG)
{ {
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); TRACE("(%p, %p, %p)\n", This, msg, clone);
return S_OK;
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, static HRESULT WINAPI performance_CreateAudioPath(IDirectMusicPerformance8 *iface,
......
...@@ -1805,13 +1805,13 @@ static void test_performance_pmsg(void) ...@@ -1805,13 +1805,13 @@ static void test_performance_pmsg(void)
ok(hr == E_INVALIDARG, "got %#lx\n", hr); ok(hr == E_INVALIDARG, "got %#lx\n", hr);
hr = IDirectMusicPerformance8_ClonePMsg((IDirectMusicPerformance8 *)performance, msg, NULL); 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); 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; clone = NULL;
hr = IDirectMusicPerformance8_ClonePMsg((IDirectMusicPerformance8 *)performance, msg, &clone); hr = IDirectMusicPerformance8_ClonePMsg((IDirectMusicPerformance8 *)performance, msg, &clone);
ok(hr == S_OK, "got %#lx\n", hr); 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->mtTime = 500;
msg->dwFlags = DMUS_PMSGF_MUSICTIME; msg->dwFlags = DMUS_PMSGF_MUSICTIME;
...@@ -1822,8 +1822,7 @@ static void test_performance_pmsg(void) ...@@ -1822,8 +1822,7 @@ static void test_performance_pmsg(void)
hr = IDirectMusicPerformance_FreePMsg(performance, msg); hr = IDirectMusicPerformance_FreePMsg(performance, msg);
ok(hr == DMUS_E_CANNOT_FREE, "got %#lx\n", hr); ok(hr == DMUS_E_CANNOT_FREE, "got %#lx\n", hr);
if (!clone) hr = S_OK; hr = IDirectMusicPerformance_FreePMsg(performance, clone);
else hr = IDirectMusicPerformance_FreePMsg(performance, clone);
ok(hr == S_OK, "got %#lx\n", hr); 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