aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/mmdevapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/backends/mmdevapi.c')
-rw-r--r--Alc/backends/mmdevapi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c
index 32c4d7ef..b93ff667 100644
--- a/Alc/backends/mmdevapi.c
+++ b/Alc/backends/mmdevapi.c
@@ -600,6 +600,12 @@ static DWORD CALLBACK MMDevApiMsgProc(void *ptr)
CoUninitialize();
+ /* HACK: Force Windows to create a message queue for this thread before
+ * returning success, otherwise PostThreadMessage may fail if it gets
+ * called before GetMessage.
+ */
+ PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
+
TRACE("Message thread initialization complete\n");
req->result = S_OK;
SetEvent(req->FinishedEvt);