Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
0b98e472
Commit
0b98e472
authored
Oct 24, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmime: Fix performance message requeue-ing from the message thread.
parent
540219df
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
performance.c
dlls/dmime/performance.c
+21
-9
No files found.
dlls/dmime/performance.c
View file @
0b98e472
...
...
@@ -88,6 +88,19 @@ static inline struct message *message_from_DMUS_PMSG(DMUS_PMSG *msg)
return
msg
?
CONTAINING_RECORD
(
msg
,
struct
message
,
msg
)
:
NULL
;
}
static
void
performance_queue_message
(
struct
performance
*
This
,
struct
message
*
message
,
struct
list
*
hint
)
{
struct
message
*
prev
;
LIST_FOR_EACH_ENTRY_REV
(
prev
,
hint
?
hint
:
&
This
->
messages
,
struct
message
,
entry
)
{
if
(
&
prev
->
entry
==
&
This
->
messages
)
break
;
if
(
prev
->
msg
.
rtTime
<=
message
->
msg
.
rtTime
)
break
;
}
list_add_after
(
&
prev
->
entry
,
&
message
->
entry
);
}
static
HRESULT
performance_process_message
(
struct
performance
*
This
,
DMUS_PMSG
*
msg
,
DWORD
*
timeout
)
{
static
const
DWORD
delivery_flags
=
DMUS_PMSGF_TOOL_IMMEDIATE
|
DMUS_PMSGF_TOOL_QUEUE
|
DMUS_PMSGF_TOOL_ATTIME
;
...
...
@@ -133,8 +146,8 @@ static HRESULT performance_process_message(struct performance *This, DMUS_PMSG *
static
DWORD
WINAPI
message_thread_proc
(
void
*
args
)
{
struct
performance
*
This
=
args
;
struct
message
*
message
,
*
next
;
HRESULT
h
r
;
HRESULT
hr
=
DMUS_S_REQUEUE
;
struct
list
*
pt
r
;
TRACE
(
"performance %p message thread
\n
"
,
This
);
SetThreadDescription
(
GetCurrentThread
(),
L"wine_dmime_message"
);
...
...
@@ -145,13 +158,15 @@ static DWORD WINAPI message_thread_proc(void *args)
{
DWORD
timeout
=
INFINITE
;
LIST_FOR_EACH_ENTRY_SAFE
(
message
,
next
,
&
This
->
messages
,
struct
message
,
entry
)
while
((
ptr
=
list_head
(
&
This
->
messages
))
)
{
struct
message
*
message
=
LIST_ENTRY
(
ptr
,
struct
message
,
entry
);
struct
list
*
next
=
ptr
->
next
;
list_remove
(
&
message
->
entry
);
list_init
(
&
message
->
entry
);
hr
=
performance_process_message
(
This
,
&
message
->
msg
,
&
timeout
);
if
(
hr
==
DMUS_S_REQUEUE
)
list_add_before
(
&
next
->
entry
,
&
message
->
entry
);
if
(
hr
==
DMUS_S_REQUEUE
)
performance_queue_message
(
This
,
message
,
next
);
if
(
hr
!=
S_OK
)
break
;
}
...
...
@@ -486,7 +501,7 @@ static HRESULT WINAPI performance_SendPMsg(IDirectMusicPerformance8 *iface, DMUS
{
const
DWORD
delivery_flags
=
DMUS_PMSGF_TOOL_IMMEDIATE
|
DMUS_PMSGF_TOOL_QUEUE
|
DMUS_PMSGF_TOOL_ATTIME
;
struct
performance
*
This
=
impl_from_IDirectMusicPerformance8
(
iface
);
struct
message
*
message
,
*
next
;
struct
message
*
message
;
HRESULT
hr
;
TRACE
(
"(%p, %p)
\n
"
,
This
,
msg
);
...
...
@@ -523,10 +538,7 @@ static HRESULT WINAPI performance_SendPMsg(IDirectMusicPerformance8 *iface, DMUS
if
(
hr
!=
DMUS_S_REQUEUE
)
goto
done
;
}
LIST_FOR_EACH_ENTRY
(
next
,
&
This
->
messages
,
struct
message
,
entry
)
if
(
next
->
msg
.
rtTime
>
message
->
msg
.
rtTime
)
break
;
list_add_before
(
&
next
->
entry
,
&
message
->
entry
);
performance_queue_message
(
This
,
message
,
NULL
);
hr
=
S_OK
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment