On Mon, May 21, 2018 at 09:36:13PM +0900, Akihiro Sagawa wrote:
+static MMRESULT midistream_post_message_and_wait(WINE_MIDIStream* lpMidiStrm, UINT msg, WPARAM wParam, LPARAM lParam) +{
- ResetEvent(lpMidiStrm->hEvent);
- if (!PostThreadMessageA(lpMidiStrm->dwThreadID, msg, wParam, lParam)) {
WARN("bad PostThreadMessageA\n");
return MMSYSERR_ERROR;
- } else if (GetCurrentThreadId() != lpMidiStrm->dwThreadID) {
if (WaitForSingleObject(lpMidiStrm->hEvent, INFINITE) != WAIT_OBJECT_0) {
Sorry for the delay in reviewing these.
This seems thread-unsafe to me. Since these are private Wine messages, could we define wParam to be a unique event to signal instead of storing it in the stream object?
The rest of the patch sequence looks OK to me.
Thanks for working on this, Andrew