Fixed improper acm streams closing.
diff --git a/dlls/msacm32/stream.c b/dlls/msacm32/stream.c
index 0d3f595..c8f3436 100644
--- a/dlls/msacm32/stream.c
+++ b/dlls/msacm32/stream.c
@@ -45,7 +45,8 @@
}
ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CLOSE, (DWORD)&was->drvInst, 0);
if (ret == MMSYSERR_NOERROR) {
- /* FIXME: shall the was->pDrv->hDrvr be also closed ? */
+ if (was->hAcmDriver)
+ acmDriverClose(was->hAcmDriver, 0L);
HeapFree(MSACM_hHeap, 0, was);
}
TRACE("=> (%d)\n", ret);
@@ -166,7 +167,8 @@
was->obj.pACMDriverID = wad->obj.pACMDriverID;
was->pDrv = wad;
-
+ was->hAcmDriver = 0; /* not to close it in acmStreamClose */
+
ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L);
if (ret != MMSYSERR_NOERROR)
goto errCleanUp;
@@ -180,6 +182,7 @@
if ((wad = MSACM_GetDriver(had)) != 0) {
was->obj.pACMDriverID = wad->obj.pACMDriverID;
was->pDrv = wad;
+ was->hAcmDriver = had;
ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L);
/* FIXME: when shall the acmDriver be Close():d ? */
diff --git a/dlls/msacm32/wineacm.h b/dlls/msacm32/wineacm.h
index 117d745..dfe1730 100644
--- a/dlls/msacm32/wineacm.h
+++ b/dlls/msacm32/wineacm.h
@@ -22,6 +22,7 @@
WINE_ACMOBJ obj;
PWINE_ACMDRIVER pDrv;
ACMDRVSTREAMINSTANCE drvInst;
+ HACMDRIVER hAcmDriver;
} WINE_ACMSTREAM, *PWINE_ACMSTREAM;
typedef struct _WINE_ACMDRIVERID