filter.c 14.5 KB
Newer Older
1 2
/* -*- tab-width: 8; c-basic-offset: 4 -*- */

3 4 5 6
/*
 *      MSACM32 library
 *
 *      Copyright 1998  Patrik Stridvall
7 8 9 10 11 12 13 14 15 16 17 18 19
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 22
 */

23
#include <stdarg.h>
24
#include <string.h>
25
#include "windef.h"
26
#include "winbase.h"
27
#include "winnls.h"
28 29
#include "winerror.h"
#include "mmsystem.h"
30
#define NOBITMAP
31
#include "mmreg.h"
32 33
#include "msacm.h"
#include "msacmdrv.h"
34
#include "wineacm.h"
35
#include "wine/debug.h"
36

37
WINE_DEFAULT_DEBUG_CHANNEL(msacm);
38

39
/***********************************************************************
40
 *           acmFilterChooseA (MSACM32.@)
41
 */
42
MMRESULT WINAPI acmFilterChooseA(PACMFILTERCHOOSEA pafltrc)
43
{
44 45 46
    FIXME("(%p): stub\n", pafltrc);
    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    return MMSYSERR_ERROR;
47 48 49
}

/***********************************************************************
50
 *           acmFilterChooseW (MSACM32.@)
51
 */
52
MMRESULT WINAPI acmFilterChooseW(PACMFILTERCHOOSEW pafltrc)
53
{
54 55 56
    FIXME("(%p): stub\n", pafltrc);
    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    return MMSYSERR_ERROR;
57 58 59
}

/***********************************************************************
60
 *           acmFilterDetailsA (MSACM32.@)
61
 */
62
MMRESULT WINAPI acmFilterDetailsA(HACMDRIVER had, PACMFILTERDETAILSA pafd,
63
				  DWORD fdwDetails)
64
{
65 66 67 68 69 70
    ACMFILTERDETAILSW	afdw;
    MMRESULT		mmr;

    memset(&afdw, 0, sizeof(afdw));
    afdw.cbStruct = sizeof(afdw);
    afdw.dwFilterIndex = pafd->dwFilterIndex;
71
    afdw.dwFilterTag = pafd->dwFilterTag;
72 73 74 75 76
    afdw.pwfltr = pafd->pwfltr;
    afdw.cbwfltr = pafd->cbwfltr;

    mmr = acmFilterDetailsW(had, &afdw, fdwDetails);
    if (mmr == MMSYSERR_NOERROR) {
77 78
	pafd->dwFilterTag = afdw.dwFilterTag;
	pafd->fdwSupport = afdw.fdwSupport;
79 80
        WideCharToMultiByte( CP_ACP, 0, afdw.szFilter, -1, pafd->szFilter,
                             sizeof(pafd->szFilter), NULL, NULL );
81 82
    }
    return mmr;
83 84 85
}

/***********************************************************************
86
 *           acmFilterDetailsW (MSACM32.@)
87
 */
88
MMRESULT WINAPI acmFilterDetailsW(HACMDRIVER had, PACMFILTERDETAILSW pafd,
89
				  DWORD fdwDetails)
90
{
Eric Pouech's avatar
Eric Pouech committed
91 92 93
    MMRESULT			mmr;
    ACMFILTERTAGDETAILSA	aftd;

94
    TRACE("(%p, %p, %d)\n", had, pafd, fdwDetails);
95

Eric Pouech's avatar
Eric Pouech committed
96 97 98 99
    memset(&aftd, 0, sizeof(aftd));
    aftd.cbStruct = sizeof(aftd);

    if (pafd->cbStruct < sizeof(*pafd)) return MMSYSERR_INVALPARAM;
100

Eric Pouech's avatar
Eric Pouech committed
101 102 103 104 105 106
    switch (fdwDetails) {
    case ACM_FILTERDETAILSF_FILTER:
	if (pafd->dwFilterTag != pafd->pwfltr->dwFilterTag) {
	    mmr = MMSYSERR_INVALPARAM;
	    break;
	}
107
	if (had == NULL) {
Eric Pouech's avatar
Eric Pouech committed
108 109 110 111 112
	    PWINE_ACMDRIVERID		padid;

	    mmr = ACMERR_NOTPOSSIBLE;
	    for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
		/* should check for codec only */
113
		if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
Eric Pouech's avatar
Eric Pouech committed
114 115 116 117 118 119
		    acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
		    mmr = MSACM_Message(had, ACMDM_FILTER_DETAILS,
					(LPARAM)pafd, (LPARAM)fdwDetails);
		    acmDriverClose(had, 0);
		    if (mmr == MMSYSERR_NOERROR) break;
		}
120
	    }
Eric Pouech's avatar
Eric Pouech committed
121
	} else {
122
	    mmr = MSACM_Message(had, ACMDM_FILTER_DETAILS, (LPARAM)pafd, fdwDetails);
Eric Pouech's avatar
Eric Pouech committed
123 124 125 126
	}
	break;
    case ACM_FILTERDETAILSF_INDEX:
	/* should check pafd->dwFilterIndex < aftd->cStandardFilters */
127
	mmr = MSACM_Message(had, ACMDM_FILTER_DETAILS, (LPARAM)pafd, fdwDetails);
Eric Pouech's avatar
Eric Pouech committed
128 129
	break;
    default:
130
	WARN("Unknown fdwDetails %08x\n", fdwDetails);
Eric Pouech's avatar
Eric Pouech committed
131 132 133 134 135 136 137 138 139
	mmr = MMSYSERR_INVALFLAG;
	break;
    }

    TRACE("=> %d\n", mmr);
    return mmr;
}

struct MSACM_FilterEnumWtoA_Instance {
140 141 142
    PACMFILTERDETAILSA pafda;
    DWORD_PTR          dwInstance;
    ACMFILTERENUMCBA   fnCallback;
Eric Pouech's avatar
Eric Pouech committed
143 144 145
};

static BOOL CALLBACK MSACM_FilterEnumCallbackWtoA(HACMDRIVERID hadid,
146
						  PACMFILTERDETAILSW pafdw,
147
                                                  DWORD_PTR dwInstance,
Eric Pouech's avatar
Eric Pouech committed
148 149 150 151 152 153
						  DWORD fdwSupport)
{
    struct MSACM_FilterEnumWtoA_Instance* pafei;

    pafei = (struct MSACM_FilterEnumWtoA_Instance*)dwInstance;

154 155 156
    pafei->pafda->dwFilterIndex = pafdw->dwFilterIndex;
    pafei->pafda->dwFilterTag = pafdw->dwFilterTag;
    pafei->pafda->fdwSupport = pafdw->fdwSupport;
157 158
    WideCharToMultiByte( CP_ACP, 0, pafdw->szFilter, -1, pafei->pafda->szFilter,
                         sizeof(pafei->pafda->szFilter), NULL, NULL );
Eric Pouech's avatar
Eric Pouech committed
159

160
    return (pafei->fnCallback)(hadid, pafei->pafda,
Eric Pouech's avatar
Eric Pouech committed
161
			       pafei->dwInstance, fdwSupport);
162 163 164
}

/***********************************************************************
165
 *           acmFilterEnumA (MSACM32.@)
166
 */
167
MMRESULT WINAPI acmFilterEnumA(HACMDRIVER had, PACMFILTERDETAILSA pafda,
168 169
                               ACMFILTERENUMCBA fnCallback,
                               DWORD_PTR dwInstance, DWORD fdwEnum)
170
{
Eric Pouech's avatar
Eric Pouech committed
171 172 173 174 175 176 177 178 179 180 181 182 183 184
    ACMFILTERDETAILSW		afdw;
    struct MSACM_FilterEnumWtoA_Instance afei;

    memset(&afdw, 0, sizeof(afdw));
    afdw.cbStruct = sizeof(afdw);
    afdw.dwFilterIndex = pafda->dwFilterIndex;
    afdw.dwFilterTag = pafda->dwFilterTag;
    afdw.pwfltr = pafda->pwfltr;
    afdw.cbwfltr = pafda->cbwfltr;

    afei.pafda = pafda;
    afei.dwInstance = dwInstance;
    afei.fnCallback = fnCallback;

185
    return acmFilterEnumW(had, &afdw, MSACM_FilterEnumCallbackWtoA,
186
                          (DWORD_PTR)&afei, fdwEnum);
Eric Pouech's avatar
Eric Pouech committed
187 188
}

189 190
static BOOL MSACM_FilterEnumHelper(PWINE_ACMDRIVERID padid, HACMDRIVER had,
				   PACMFILTERDETAILSW pafd,
191 192
                                   ACMFILTERENUMCBW fnCallback,
                                   DWORD_PTR dwInstance, DWORD fdwEnum)
Eric Pouech's avatar
Eric Pouech committed
193 194
{
    ACMFILTERTAGDETAILSW	aftd;
195
    unsigned int i, j;
Eric Pouech's avatar
Eric Pouech committed
196

197
    for (i = 0; i < padid->cFilterTags; i++) {
Eric Pouech's avatar
Eric Pouech committed
198 199 200 201 202
	memset(&aftd, 0, sizeof(aftd));
	aftd.cbStruct = sizeof(aftd);
	aftd.dwFilterTagIndex = i;
	if (acmFilterTagDetailsW(had, &aftd, ACM_FILTERTAGDETAILSF_INDEX) != MMSYSERR_NOERROR)
	    continue;
203 204

	if ((fdwEnum & ACM_FILTERENUMF_DWFILTERTAG) &&
Eric Pouech's avatar
Eric Pouech committed
205 206
	    aftd.dwFilterTag != pafd->pwfltr->dwFilterTag)
	    continue;
207

Eric Pouech's avatar
Eric Pouech committed
208 209 210
	for (j = 0; j < aftd.cStandardFilters; j++) {
	    pafd->dwFilterIndex = j;
	    pafd->dwFilterTag = aftd.dwFilterTag;
211
	    if (acmFilterDetailsW(had, pafd, ACM_FILTERDETAILSF_INDEX) != MMSYSERR_NOERROR)
Eric Pouech's avatar
Eric Pouech committed
212
		continue;
213

214
	    if (!(fnCallback)((HACMDRIVERID)padid, pafd, dwInstance, padid->fdwSupport))
215
		return FALSE;
Eric Pouech's avatar
Eric Pouech committed
216 217 218
	}
    }
    return TRUE;
219 220 221
}

/***********************************************************************
222
 *           acmFilterEnumW (MSACM32.@)
223
 */
224
MMRESULT WINAPI acmFilterEnumW(HACMDRIVER had, PACMFILTERDETAILSW pafd,
225 226
                               ACMFILTERENUMCBW fnCallback,
                               DWORD_PTR dwInstance, DWORD fdwEnum)
227
{
Eric Pouech's avatar
Eric Pouech committed
228 229 230
    PWINE_ACMDRIVERID		padid;
    BOOL			ret;

231
    TRACE("(%p, %p, %p, %ld, %d)\n",
232
	  had, pafd, fnCallback, dwInstance, fdwEnum);
Eric Pouech's avatar
Eric Pouech committed
233 234 235 236 237 238 239 240 241

    if (pafd->cbStruct < sizeof(*pafd)) return MMSYSERR_INVALPARAM;

    if (fdwEnum & ~(ACM_FILTERENUMF_DWFILTERTAG))
	FIXME("Unsupported fdwEnum values\n");

    if (had) {
	HACMDRIVERID	hadid;

242
	if (acmDriverID((HACMOBJ)had, &hadid, 0) != MMSYSERR_NOERROR)
Eric Pouech's avatar
Eric Pouech committed
243
	    return MMSYSERR_INVALHANDLE;
244 245 246
	MSACM_FilterEnumHelper(MSACM_GetDriverID(hadid), had, pafd,
			       fnCallback, dwInstance, fdwEnum);
	return MMSYSERR_NOERROR;
Eric Pouech's avatar
Eric Pouech committed
247 248 249
    }
    for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
	    /* should check for codec only */
250
	    if ((padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) ||
251
		acmDriverOpen(&had, (HACMDRIVERID)padid, 0) != MMSYSERR_NOERROR)
Eric Pouech's avatar
Eric Pouech committed
252
		continue;
253
	    ret = MSACM_FilterEnumHelper(padid, had, pafd,
Eric Pouech's avatar
Eric Pouech committed
254 255 256 257 258
					 fnCallback, dwInstance, fdwEnum);
	    acmDriverClose(had, 0);
	    if (!ret) break;
    }
    return MMSYSERR_NOERROR;
259 260 261
}

/***********************************************************************
262
 *           acmFilterTagDetailsA (MSACM32.@)
263
 */
264
MMRESULT WINAPI acmFilterTagDetailsA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda,
265
				     DWORD fdwDetails)
266
{
267 268 269 270 271 272 273 274 275 276
    ACMFILTERTAGDETAILSW	aftdw;
    MMRESULT			mmr;

    memset(&aftdw, 0, sizeof(aftdw));
    aftdw.cbStruct = sizeof(aftdw);
    aftdw.dwFilterTagIndex = paftda->dwFilterTagIndex;
    aftdw.dwFilterTag = paftda->dwFilterTag;

    mmr = acmFilterTagDetailsW(had, &aftdw, fdwDetails);
    if (mmr == MMSYSERR_NOERROR) {
277
	paftda->dwFilterTag = aftdw.dwFilterTag;
278
	paftda->dwFilterTagIndex = aftdw.dwFilterTagIndex;
279 280 281
	paftda->cbFilterSize = aftdw.cbFilterSize;
	paftda->fdwSupport = aftdw.fdwSupport;
	paftda->cStandardFilters = aftdw.cStandardFilters;
282 283
        WideCharToMultiByte( CP_ACP, 0, aftdw.szFilterTag, -1, paftda->szFilterTag,
                             sizeof(paftda->szFilterTag), NULL, NULL );
284 285
    }
    return mmr;
286 287 288
}

/***********************************************************************
289
 *           acmFilterTagDetailsW (MSACM32.@)
290
 */
291
MMRESULT WINAPI acmFilterTagDetailsW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
292
				     DWORD fdwDetails)
293
{
Eric Pouech's avatar
Eric Pouech committed
294 295 296
    PWINE_ACMDRIVERID	padid;
    MMRESULT		mmr;

297
    TRACE("(%p, %p, %d)\n", had, paftd, fdwDetails);
298

Eric Pouech's avatar
Eric Pouech committed
299 300
    if (fdwDetails & ~(ACM_FILTERTAGDETAILSF_FILTERTAG|ACM_FILTERTAGDETAILSF_INDEX|
		       ACM_FILTERTAGDETAILSF_LARGESTSIZE))
301
	return MMSYSERR_INVALFLAG;
Eric Pouech's avatar
Eric Pouech committed
302 303 304

    switch (fdwDetails) {
    case ACM_FILTERTAGDETAILSF_FILTERTAG:
305
	if (had == NULL) {
Eric Pouech's avatar
Eric Pouech committed
306 307 308
	    mmr = ACMERR_NOTPOSSIBLE;
	    for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
		/* should check for codec only */
309 310
		if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
		      acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {
311
		    mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
Eric Pouech's avatar
Eric Pouech committed
312 313 314 315 316
		    acmDriverClose(had, 0);
		    if (mmr == MMSYSERR_NOERROR) break;
		}
	    }
	} else {
317
	    mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
Eric Pouech's avatar
Eric Pouech committed
318 319 320 321 322
	}
	break;

    case ACM_FILTERTAGDETAILSF_INDEX:
	/* FIXME should check paftd->dwFilterTagIndex < add.cFilterTags */
323
	mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
Eric Pouech's avatar
Eric Pouech committed
324 325 326
	break;

    case ACM_FILTERTAGDETAILSF_LARGESTSIZE:
327
	if (had == NULL) {
Eric Pouech's avatar
Eric Pouech committed
328 329 330 331 332 333
	    ACMFILTERTAGDETAILSW	tmp;
	    DWORD			ft = paftd->dwFilterTag;

	    mmr = ACMERR_NOTPOSSIBLE;
	    for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
		/* should check for codec only */
334
		if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
Eric Pouech's avatar
Eric Pouech committed
335 336 337 338 339 340
		    acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == 0) {

		    memset(&tmp, 0, sizeof(tmp));
		    tmp.cbStruct = sizeof(tmp);
		    tmp.dwFilterTag = ft;

341
		    if (MSACM_Message(had, ACMDM_FILTERTAG_DETAILS,
342
				      (LPARAM)&tmp, fdwDetails) == MMSYSERR_NOERROR) {
Eric Pouech's avatar
Eric Pouech committed
343 344 345 346
			if (mmr == ACMERR_NOTPOSSIBLE ||
			    paftd->cbFilterSize < tmp.cbFilterSize) {
			    *paftd = tmp;
			    mmr = MMSYSERR_NOERROR;
347
			}
Eric Pouech's avatar
Eric Pouech committed
348 349 350 351 352
		    }
		    acmDriverClose(had, 0);
		}
	    }
	} else {
353
	    mmr = MSACM_Message(had, ACMDM_FILTERTAG_DETAILS, (LPARAM)paftd, fdwDetails);
Eric Pouech's avatar
Eric Pouech committed
354 355 356 357
	}
	break;

    default:
358
	WARN("Unsupported fdwDetails=%08x\n", fdwDetails);
Eric Pouech's avatar
Eric Pouech committed
359 360 361
	mmr = MMSYSERR_ERROR;
    }

362
    if (mmr == MMSYSERR_NOERROR &&
Eric Pouech's avatar
Eric Pouech committed
363
	paftd->dwFilterTag == WAVE_FORMAT_PCM && paftd->szFilterTag[0] == 0)
364 365
        MultiByteToWideChar( CP_ACP, 0, "PCM", -1, paftd->szFilterTag,
                             sizeof(paftd->szFilterTag)/sizeof(WCHAR) );
Eric Pouech's avatar
Eric Pouech committed
366 367 368 369 370

    return mmr;
}

struct MSACM_FilterTagEnumWtoA_Instance {
371 372 373
    PACMFILTERTAGDETAILSA paftda;
    DWORD_PTR             dwInstance;
    ACMFILTERTAGENUMCBA   fnCallback;
Eric Pouech's avatar
Eric Pouech committed
374 375 376
};

static BOOL CALLBACK MSACM_FilterTagEnumCallbackWtoA(HACMDRIVERID hadid,
377
						     PACMFILTERTAGDETAILSW paftdw,
378
                                                     DWORD_PTR dwInstance,
Eric Pouech's avatar
Eric Pouech committed
379 380 381 382 383 384
						     DWORD fdwSupport)
{
    struct MSACM_FilterTagEnumWtoA_Instance* paftei;

    paftei = (struct MSACM_FilterTagEnumWtoA_Instance*)dwInstance;

385 386 387 388 389
    paftei->paftda->dwFilterTagIndex = paftdw->dwFilterTagIndex;
    paftei->paftda->dwFilterTag = paftdw->dwFilterTag;
    paftei->paftda->cbFilterSize = paftdw->cbFilterSize;
    paftei->paftda->fdwSupport = paftdw->fdwSupport;
    paftei->paftda->cStandardFilters = paftdw->cStandardFilters;
390 391
    WideCharToMultiByte( CP_ACP, 0, paftdw->szFilterTag, -1, paftei->paftda->szFilterTag,
                         sizeof(paftei->paftda->szFilterTag), NULL, NULL );
Eric Pouech's avatar
Eric Pouech committed
392

393
    return (paftei->fnCallback)(hadid, paftei->paftda,
Eric Pouech's avatar
Eric Pouech committed
394
				paftei->dwInstance, fdwSupport);
395 396 397
}

/***********************************************************************
398
 *           acmFilterTagEnumA (MSACM32.@)
399
 */
Eric Pouech's avatar
Eric Pouech committed
400
MMRESULT WINAPI acmFilterTagEnumA(HACMDRIVER had, PACMFILTERTAGDETAILSA paftda,
401 402
                                  ACMFILTERTAGENUMCBA fnCallback,
                                  DWORD_PTR dwInstance, DWORD fdwEnum)
403
{
Eric Pouech's avatar
Eric Pouech committed
404 405 406 407 408 409 410 411 412 413 414 415
    ACMFILTERTAGDETAILSW	aftdw;
    struct MSACM_FilterTagEnumWtoA_Instance aftei;

    memset(&aftdw, 0, sizeof(aftdw));
    aftdw.cbStruct = sizeof(aftdw);
    aftdw.dwFilterTagIndex = paftda->dwFilterTagIndex;
    aftdw.dwFilterTag = paftda->dwFilterTag;

    aftei.paftda = paftda;
    aftei.dwInstance = dwInstance;
    aftei.fnCallback = fnCallback;

416
    return acmFilterTagEnumW(had, &aftdw, MSACM_FilterTagEnumCallbackWtoA,
417
                             (DWORD_PTR)&aftei, fdwEnum);
418 419 420
}

/***********************************************************************
421
 *           acmFilterTagEnumW (MSACM32.@)
422
 */
423
MMRESULT WINAPI acmFilterTagEnumW(HACMDRIVER had, PACMFILTERTAGDETAILSW paftd,
424 425
                                  ACMFILTERTAGENUMCBW fnCallback,
                                  DWORD_PTR dwInstance, DWORD fdwEnum)
426
{
Eric Pouech's avatar
Eric Pouech committed
427
    PWINE_ACMDRIVERID		padid;
428
    unsigned int			i;
Eric Pouech's avatar
Eric Pouech committed
429

430
    TRACE("(%p, %p, %p, %ld, %d)\n",
431
	  had, paftd, fnCallback, dwInstance, fdwEnum);
Eric Pouech's avatar
Eric Pouech committed
432 433 434 435

    if (paftd->cbStruct < sizeof(*paftd)) return MMSYSERR_INVALPARAM;

    if (had) FIXME("had != NULL, not supported\n");
436

Eric Pouech's avatar
Eric Pouech committed
437 438
    for (padid = MSACM_pFirstACMDriverID; padid; padid = padid->pNextACMDriverID) {
	/* should check for codec only */
439 440
	if (!(padid->fdwSupport & ACMDRIVERDETAILS_SUPPORTF_DISABLED) &&
	    acmDriverOpen(&had, (HACMDRIVERID)padid, 0) == MMSYSERR_NOERROR) {
441 442 443 444 445 446 447

	    for (i = 0; i < padid->cFilterTags; i++) {
		paftd->dwFilterTagIndex = i;
		if (acmFilterTagDetailsW(had, paftd, ACM_FILTERTAGDETAILSF_INDEX) == MMSYSERR_NOERROR) {
		    if (!(fnCallback)((HACMDRIVERID)padid, paftd, dwInstance, padid->fdwSupport)) {
			padid = NULL;
			break;
Eric Pouech's avatar
Eric Pouech committed
448 449 450
		    }
		}
	    }
451
	    acmDriverClose(had, 0);
Eric Pouech's avatar
Eric Pouech committed
452 453 454
	}
    }
    return MMSYSERR_NOERROR;
455
}