<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=GBK">
  </head>
  <body>
    On 4/28/20 10:14 AM, dead ash wrote:<br>
    <blockquote type="cite"
cite="mid:PU1PR03MB3126ABA7276A2F175B3718D69FAC0@PU1PR03MB3126.apcprd03.prod.outlook.com"></blockquote>
    <blockquote type="cite">
      <pre style="color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; overflow-wrap: break-word; white-space: pre-wrap;">diff --git a/dlls/winmm/waveform.c b/dlls/winmm/waveform.c
index 42b888e1ac..dffc002c24 100644
--- a/dlls/winmm/waveform.c
+++ b/dlls/winmm/waveform.c
@@ -1243,10 +1243,17 @@ static LRESULT WOD_Open(WINMM_OpenInfo *info)
             lock = &g_devthread_lock;
             internal_index = MAPPER_INDEX;
         }else{
-            if(info->req_device >= g_outmmdevices_count)
-                return MMSYSERR_BADDEVICEID;
+            if(info->req_device >= g_outmmdevices_count) {
+                WINMM_Device *device = WINMM_GetDeviceFromHWAVE((HWAVE)info->req_device);
+
+                if(device == NULL) return MMSYSERR_BADDEVICEID;
+
+                mmdevice = device->parent;
+            }
+            else {
+                mmdevice = read_map(g_out_map, info->req_device);
+            }
 
-            mmdevice = read_map(g_out_map, info->req_device);
 
             if(!mmdevice->out_caps.szPname[0])</pre>
    </blockquote>
    Please add a test for this. Also note req_device is shorter than
    HWAVE, on 64-bit.<br>
  </body>
</html>