Correctly implement ACM_STREAMOPENF_QUERY flag in acmOpenStream.

This commit is contained in:
Eric Pouech 1999-12-05 23:08:42 +00:00 committed by Alexandre Julliard
parent 92e492e296
commit 94d6bc927f
1 changed files with 12 additions and 6 deletions

View File

@ -185,9 +185,12 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw
was->hAcmDriver = had;
ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L);
/* FIXME: when shall the acmDriver be Close():d ? */
if (ret == MMSYSERR_NOERROR)
if (ret == MMSYSERR_NOERROR) {
if (fdwOpen & ACM_STREAMOPENF_QUERY) {
acmDriverClose(had, 0L);
}
break;
}
}
/* no match, close this acm driver and try next one */
acmDriverClose(had, 0L);
@ -198,13 +201,16 @@ MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pw
goto errCleanUp;
}
}
if (phas)
*phas = (HACMSTREAM)was;
TRACE("=> (%d)\n", ret);
ret = MMSYSERR_NOERROR;
if (!(fdwOpen & ACM_STREAMOPENF_QUERY))
if (!(fdwOpen & ACM_STREAMOPENF_QUERY)) {
if (phas)
*phas = (HACMSTREAM)was;
TRACE("=> (%d)\n", ret);
return ret;
}
errCleanUp:
if (phas)
*phas = (HACMSTREAM)0;
HeapFree(MSACM_hHeap, 0, was);
TRACE("=> (%d)\n", ret);
return ret;