Skip to content

Conversation

@LinusU
Copy link
Contributor

@LinusU LinusU commented Nov 18, 2025

Unfortunately, this did not fix my problem (#126 (comment)), but I still believe that this implementation should be correct...

Copy link
Owner

@evmar evmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, I am impressed you figured this out!

pt_x: 0,
pt_y: 0,
};
dispatch_message(sys, &msg).await;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This executes the message handler in the current x86 thread, which (from the name of the function you're in) you can see is the multimedia thread. That is, all the winmm functionality is supposed to happen on this winmm thread and the different callbacks it makes (with the exception of the function callback, I think?) are supposed to go onto the caller's thread.

Concretely, I think that means this should put this message in the target's message queue, rather than dispatching it. Take a look at PostMessage's impl

get_state(sys).messages.push(MSG {

I think maybe the way I'd do it is to change that PostMessage into a wrapper around a post_message() function that accepts a MSG and then call it from here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants