Fixed opening of some drivers.

This commit is contained in:
Eric Pouech 2001-04-13 22:28:19 +00:00 committed by Alexandre Julliard
parent 1b9e33df0c
commit 3c03f75c02
1 changed files with 23 additions and 6 deletions

View File

@ -235,6 +235,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
{
PWINE_ACMDRIVERID padid;
PWINE_ACMDRIVER pad;
MMRESULT ret = MMSYSERR_ERROR;
TRACE("(%p, %x, %08lu)\n", phad, hadid, fdwOpen);
@ -254,11 +255,23 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
pad->obj.dwType = WINE_ACMOBJ_DRIVER;
pad->obj.pACMDriverID = padid;
if (!(pad->hDrvr = padid->hInstModule) && padid->pszDriverAlias)
pad->hDrvr = OpenDriverA(padid->pszDriverAlias, NULL, 0);
if (!pad->hDrvr) {
HeapFree(MSACM_hHeap, 0, pad);
return MMSYSERR_ERROR;
if (!(pad->hDrvr = padid->hInstModule) && padid->pszDriverAlias) {
ACMDRVOPENDESCW adod;
adod.cbStruct = sizeof(adod);
adod.fccType = ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC;
adod.fccComp = ACMDRIVERDETAILS_FCCCOMP_UNDEFINED;
adod.dwVersion = acmGetVersion();
adod.dwFlags = fdwOpen;
adod.dwError = 0;
adod.pszSectionName = (LPCWSTR)"\0"; /* FIXME */
adod.pszAliasName = (LPCWSTR)"\0"; /* FIXME */
adod.dnDevNode = 0;
if (!(pad->hDrvr = OpenDriverA(padid->pszDriverAlias, NULL, (DWORD)&adod))) {
ret = adod.dwError;
goto gotError;
}
}
/* insert new pad at beg of list */
@ -269,6 +282,10 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpe
*phad = (HACMDRIVER)pad;
TRACE("'%s' => %08lx\n", padid->pszDriverAlias, (DWORD)pad);
return MMSYSERR_NOERROR;
gotError:
if (!pad->hDrvr)
HeapFree(MSACM_hHeap, 0, pad);
return ret;
}
/***********************************************************************