Re: [PATCH 03/10] winmm: Implement waveOut* on top of MMDevAPI
Andrew Eikum <aeikum(a)codeweavers.com> writes:
+static MMRESULT WINMM_SendDeviceThreadMessage(UINT msg, WPARAM wp) +{ + DWORD wait; + MMRESULT res; + + EnterCriticalSection(&g_devthread_lock); + + if(!PostThreadMessageW(g_devthread_id, msg, wp, (DWORD_PTR)&res)){ + ERR("PostThreadMessage failed: %d\n", GetLastError()); + LeaveCriticalSection(&g_devthread_lock); + return MMSYSERR_ERROR; + } + + wait = WaitForSingleObject(g_devthread_evt, INFINITE); + + LeaveCriticalSection(&g_devthread_lock);
If you are going to wait for a reply it would be better to create a HWND_MESSAGE window and do a SendMessage to it, then you get all the synchronization for free. -- Alexandre Julliard julliard(a)winehq.org
participants (1)
-
Alexandre Julliard