diff options
author | Chris Robinson <[email protected]> | 2017-06-26 08:57:29 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-06-26 08:57:29 -0700 |
commit | 2f2d941edb61767689a1a80940ea539681648807 (patch) | |
tree | 6cc4827b301f148976c4a46176aa4e4acc507a92 /Alc | |
parent | 740e7d979c10d798a01d446c9262fce1d83041a6 (diff) |
Trace the message name in the message handler loop
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/backends/mmdevapi.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c index f341c1b0..668d2fe5 100644 --- a/Alc/backends/mmdevapi.c +++ b/Alc/backends/mmdevapi.c @@ -111,6 +111,15 @@ typedef struct { #define WM_USER_Enumerate (WM_USER+5) #define WM_USER_Last (WM_USER+5) +static const char MessageStr[WM_USER_Last+1-WM_USER][20] = { + "Open Device", + "Reset Device", + "Start Device", + "Stop Device", + "Close Device", + "Enumerate Devices", +}; + static inline void ReturnMsgResponse(ThreadRequest *req, HRESULT res) { req->result = res; @@ -405,7 +414,11 @@ static DWORD CALLBACK ALCmmdevProxy_messageHandler(void *ptr) TRACE("Starting message loop\n"); while(GetMessage(&msg, NULL, WM_USER_First, WM_USER_Last)) { - TRACE("Got message %u (lparam=%p, wparam=%p)\n", msg.message, (void*)msg.lParam, (void*)msg.wParam); + TRACE("Got message \"%s\" (0x%04x, lparam=%p, wparam=%p)\n", + (msg.message >= WM_USER && msg.message <= WM_USER_Last) ? + MessageStr[msg.message-WM_USER] : "Unknown", + msg.message, (void*)msg.lParam, (void*)msg.wParam + ); switch(msg.message) { case WM_USER_OpenDevice: |