Module: wine Branch: master Commit: 1f84523800671046076aac142babea56c9a1b79d URL: https://gitlab.winehq.org/wine/wine/-/commit/1f84523800671046076aac142babea5...
Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Sep 12 10:11:38 2023 +0200
dmime: Set the tool delivery type on the messages flags.
---
dlls/dmime/graph.c | 11 +++++++++++ dlls/dmime/performance.c | 4 ++++ dlls/dmime/tests/dmime.c | 6 +++--- 3 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/dlls/dmime/graph.c b/dlls/dmime/graph.c index 44996b0303e..d8f6bb88701 100644 --- a/dlls/dmime/graph.c +++ b/dlls/dmime/graph.c @@ -26,6 +26,7 @@ struct tool_entry { struct list entry; IDirectMusicTool *tool; + DWORD delivery; };
struct graph @@ -111,6 +112,7 @@ static ULONG WINAPI graph_Release(IDirectMusicGraph *iface)
static HRESULT WINAPI graph_StampPMsg(IDirectMusicGraph *iface, DMUS_PMSG *msg) { + const DWORD delivery_flags = DMUS_PMSGF_TOOL_IMMEDIATE | DMUS_PMSGF_TOOL_QUEUE | DMUS_PMSGF_TOOL_ATTIME; struct graph *This = impl_from_IDirectMusicGraph(iface); struct tool_entry *entry, *next, *first;
@@ -140,6 +142,9 @@ static HRESULT WINAPI graph_StampPMsg(IDirectMusicGraph *iface, DMUS_PMSG *msg) msg->pTool = next->tool; IDirectMusicTool_AddRef(msg->pTool);
+ msg->dwFlags &= ~delivery_flags; + msg->dwFlags |= next->delivery; + return S_OK; }
@@ -148,6 +153,7 @@ static HRESULT WINAPI graph_InsertTool(IDirectMusicGraph *iface, IDirectMusicToo { struct graph *This = impl_from_IDirectMusicGraph(iface); struct tool_entry *entry, *next; + HRESULT hr;
TRACE("(%p, %p, %p, %ld, %li)\n", This, tool, channels, channel_count, index);
@@ -163,6 +169,11 @@ static HRESULT WINAPI graph_InsertTool(IDirectMusicGraph *iface, IDirectMusicToo entry->tool = tool; IDirectMusicTool_AddRef(tool); IDirectMusicTool_Init(tool, iface); + if (FAILED(hr = IDirectMusicTool_GetMsgDeliveryType(tool, &entry->delivery))) + { + WARN("Failed to get delivery type from tool %p, hr %#lx\n", tool, hr); + entry->delivery = DMUS_PMSGF_TOOL_IMMEDIATE; + } list_add_before(&next->entry, &entry->entry);
return S_OK; diff --git a/dlls/dmime/performance.c b/dlls/dmime/performance.c index 904008954a2..d277c5de043 100644 --- a/dlls/dmime/performance.c +++ b/dlls/dmime/performance.c @@ -1311,6 +1311,10 @@ static HRESULT WINAPI performance_graph_StampPMsg(IDirectMusicGraph *iface, DMUS
if (hr == DMUS_S_LAST_TOOL) { + const DWORD delivery_flags = DMUS_PMSGF_TOOL_IMMEDIATE | DMUS_PMSGF_TOOL_QUEUE | DMUS_PMSGF_TOOL_ATTIME; + msg->dwFlags &= ~delivery_flags; + msg->dwFlags |= DMUS_PMSGF_TOOL_QUEUE; + if (msg->pTool) IDirectMusicTool_Release(msg->pTool); msg->pTool = &This->IDirectMusicTool_iface; IDirectMusicTool_AddRef(msg->pTool); diff --git a/dlls/dmime/tests/dmime.c b/dlls/dmime/tests/dmime.c index 17f11daf5ac..e178960b18f 100644 --- a/dlls/dmime/tests/dmime.c +++ b/dlls/dmime/tests/dmime.c @@ -756,7 +756,7 @@ static void test_graph(void) ok(!msg.dwSize, "got %ld\n", msg.dwSize); ok(!msg.rtTime, "got %I64d\n", msg.rtTime); ok(!msg.mtTime, "got %ld\n", msg.mtTime); - todo_wine ok(msg.dwFlags == DMUS_PMSGF_TOOL_IMMEDIATE, "got %#lx\n", msg.dwFlags); + ok(msg.dwFlags == DMUS_PMSGF_TOOL_IMMEDIATE, "got %#lx\n", msg.dwFlags); ok(!msg.dwPChannel, "got %ld\n", msg.dwPChannel); ok(!msg.dwVirtualTrackID, "got %ld\n", msg.dwVirtualTrackID); ok(!msg.dwType, "got %#lx\n", msg.dwType); @@ -1555,7 +1555,7 @@ static void test_performance_graph(void) ok(!msg.dwSize, "got %ld\n", msg.dwSize); ok(!msg.rtTime, "got %I64d\n", msg.rtTime); ok(!msg.mtTime, "got %ld\n", msg.mtTime); - todo_wine ok(msg.dwFlags == DMUS_PMSGF_TOOL_QUEUE, "got %#lx\n", msg.dwFlags); + ok(msg.dwFlags == DMUS_PMSGF_TOOL_QUEUE, "got %#lx\n", msg.dwFlags); ok(!msg.dwPChannel, "got %ld\n", msg.dwPChannel); ok(!msg.dwVirtualTrackID, "got %ld\n", msg.dwVirtualTrackID); ok(!msg.dwType, "got %#lx\n", msg.dwType); @@ -1611,7 +1611,7 @@ static void test_performance_graph(void) ok(!msg.dwSize, "got %ld\n", msg.dwSize); ok(!msg.rtTime, "got %I64d\n", msg.rtTime); ok(!msg.mtTime, "got %ld\n", msg.mtTime); - todo_wine ok(msg.dwFlags == DMUS_PMSGF_TOOL_IMMEDIATE, "got %#lx\n", msg.dwFlags); + ok(msg.dwFlags == DMUS_PMSGF_TOOL_IMMEDIATE, "got %#lx\n", msg.dwFlags); ok(!msg.dwPChannel, "got %ld\n", msg.dwPChannel); ok(!msg.dwVirtualTrackID, "got %ld\n", msg.dwVirtualTrackID); ok(!msg.dwType, "got %#lx\n", msg.dwType);