4 * Copyright 1993 Martin Ayotte
5 * 1998-2003,2009 Eric Pouech
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #define NONAMELESSUNION
27 #define NONAMELESSSTRUCT
35 #include "wine/winuser16.h"
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(mmsys);
43 /**************************************************************************
44 * MCI_MessageToString [internal]
46 static const char* MCI_MessageToString(UINT wMsg)
48 static char buffer[100];
50 #define CASE(s) case (s): return #s
60 CASE(DRV_QUERYCONFIGURE);
63 CASE(DRV_EXITSESSION);
64 CASE(DRV_EXITAPPLICATION);
68 CASE(MCI_CLOSE_DRIVER);
81 CASE(MCI_OPEN_DRIVER);
100 /* constants for digital video */
114 sprintf(buffer, "MCI_<<%04X>>", wMsg);
119 static LPWSTR MCI_strdupAtoW( LPCSTR str )
124 if (!str) return NULL;
125 len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
126 ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
127 if (ret) MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
131 /**************************************************************************
132 * MCI_MapMsg16To32W [internal]
134 static MMSYSTEM_MapType MCI_MapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR* lParam)
137 return MMSYSTEM_MAP_OK;
138 /* FIXME: to add also (with seg/linear modifications to do):
139 * MCI_LIST, MCI_LOAD, MCI_QUALITY, MCI_RESERVE, MCI_RESTORE, MCI_SAVE
140 * MCI_SETAUDIO, MCI_SETTUNER, MCI_SETVIDEO
143 /* case MCI_CAPTURE */
145 case MCI_CLOSE_DRIVER:
152 /* case MCI_INDEX: */
154 /* case MCI_MONITOR: */
163 /* case MCI_SETTIMECODE:*/
164 /* case MCI_SIGNAL:*/
166 case MCI_STATUS: /* FIXME: is wrong for digital video */
171 *lParam = (DWORD)MapSL(*lParam);
172 return MMSYSTEM_MAP_OK;
178 LPMCI_DGV_RECT_PARMS mdrp32 = HeapAlloc(GetProcessHeap(), 0,
179 sizeof(LPMCI_DGV_RECT_PARMS16) + sizeof(MCI_DGV_RECT_PARMS));
180 LPMCI_DGV_RECT_PARMS16 mdrp16 = MapSL(*lParam);
182 *(LPMCI_DGV_RECT_PARMS16*)(mdrp32) = mdrp16;
183 mdrp32 = (LPMCI_DGV_RECT_PARMS)((char*)mdrp32 + sizeof(LPMCI_DGV_RECT_PARMS16));
184 mdrp32->dwCallback = mdrp16->dwCallback;
185 mdrp32->rc.left = mdrp16->rc.left;
186 mdrp32->rc.top = mdrp16->rc.top;
187 mdrp32->rc.right = mdrp16->rc.right;
188 mdrp32->rc.bottom = mdrp16->rc.bottom;
190 return MMSYSTEM_MAP_NOMEM;
192 *lParam = (DWORD)mdrp32;
194 return MMSYSTEM_MAP_OKMEM;
196 /* in fact, I would also need the dwFlags... to see
197 * which members of lParam are effectively used
199 *lParam = (DWORD)MapSL(*lParam);
200 FIXME("Current mapping may be wrong\n");
204 LPMCI_BREAK_PARMS mbp32 = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_BREAK_PARMS));
205 LPMCI_BREAK_PARMS16 mbp16 = MapSL(*lParam);
208 mbp32->dwCallback = mbp16->dwCallback;
209 mbp32->nVirtKey = mbp16->nVirtKey;
210 mbp32->hwndBreak = HWND_32(mbp16->hwndBreak);
212 return MMSYSTEM_MAP_NOMEM;
214 *lParam = (DWORD)mbp32;
216 return MMSYSTEM_MAP_OKMEM;
219 LPMCI_VD_ESCAPE_PARMSW mvep32w = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_VD_ESCAPE_PARMSW));
220 LPMCI_VD_ESCAPE_PARMS16 mvep16 = MapSL(*lParam);
223 mvep32w->dwCallback = mvep16->dwCallback;
224 mvep32w->lpstrCommand = MCI_strdupAtoW(MapSL(mvep16->lpstrCommand));
226 return MMSYSTEM_MAP_NOMEM;
228 *lParam = (DWORD)mvep32w;
230 return MMSYSTEM_MAP_OKMEM;
233 LPMCI_INFO_PARMSW mip32w = HeapAlloc(GetProcessHeap(), 0, sizeof(LPMCI_OPEN_PARMS16) + sizeof(MCI_INFO_PARMSW));
234 LPMCI_INFO_PARMS16 mip16 = MapSL(*lParam);
236 /* FIXME this is wrong if device is of type
237 * MCI_DEVTYPE_DIGITAL_VIDEO, some members are not mapped
240 *(LPMCI_INFO_PARMS16*)(mip32w) = mip16;
241 mip32w = (LPMCI_INFO_PARMSW)((char*)mip32w + sizeof(LPMCI_INFO_PARMS16));
242 mip32w->dwCallback = mip16->dwCallback;
243 mip32w->lpstrReturn = HeapAlloc(GetProcessHeap(), 0, mip16->dwRetSize * sizeof(WCHAR));
244 mip32w->dwRetSize = mip16->dwRetSize * sizeof(WCHAR);
246 return MMSYSTEM_MAP_NOMEM;
248 *lParam = (DWORD)mip32w;
250 return MMSYSTEM_MAP_OKMEM;
252 case MCI_OPEN_DRIVER:
254 LPMCI_OPEN_PARMSW mop32w = HeapAlloc(GetProcessHeap(), 0, sizeof(LPMCI_OPEN_PARMS16) + sizeof(MCI_OPEN_PARMSW) + 2 * sizeof(DWORD));
255 LPMCI_OPEN_PARMS16 mop16 = MapSL(*lParam);
258 *(LPMCI_OPEN_PARMS16*)(mop32w) = mop16;
259 mop32w = (LPMCI_OPEN_PARMSW)((char*)mop32w + sizeof(LPMCI_OPEN_PARMS16));
260 mop32w->dwCallback = mop16->dwCallback;
261 mop32w->wDeviceID = mop16->wDeviceID;
262 if( ( dwFlags & ( MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID)) == MCI_OPEN_TYPE)
263 mop32w->lpstrDeviceType = MCI_strdupAtoW(MapSL(mop16->lpstrDeviceType));
265 mop32w->lpstrDeviceType = (LPWSTR) mop16->lpstrDeviceType;
266 if( ( dwFlags & ( MCI_OPEN_ELEMENT | MCI_OPEN_ELEMENT_ID)) == MCI_OPEN_ELEMENT)
267 mop32w->lpstrElementName = MCI_strdupAtoW(MapSL(mop16->lpstrElementName));
269 mop32w->lpstrElementName = (LPWSTR) mop16->lpstrElementName;
270 if( ( dwFlags & MCI_OPEN_ALIAS))
271 mop32w->lpstrAlias = MCI_strdupAtoW(MapSL(mop16->lpstrAlias));
273 mop32w->lpstrAlias = (LPWSTR) mop16->lpstrAlias;
274 /* copy extended information if any...
275 * FIXME: this may seg fault if initial structure does not contain them and
276 * the reads after msip16 fail under LDT limits...
277 * NOTE: this should be split in two. First pass, while calling MCI_OPEN, and
278 * should not take care of extended parameters, and should be used by MCI_Open
279 * to fetch uDevType. When, this is known, the mapping for sending the
280 * MCI_OPEN_DRIVER shall be done depending on uDevType.
282 memcpy(mop32w + 1, mop16 + 1, 2 * sizeof(DWORD));
284 return MMSYSTEM_MAP_NOMEM;
286 *lParam = (DWORD)mop32w;
288 return MMSYSTEM_MAP_OKMEM;
291 MCI_SYSINFO_PARMSW *msip32w = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_OPEN_PARMS16 *) + sizeof(MCI_SYSINFO_PARMSW));
292 MCI_SYSINFO_PARMS16 *msip16 = MapSL(*lParam);
295 return MMSYSTEM_MAP_NOMEM;
297 *(MCI_SYSINFO_PARMS16 **)msip32w = msip16;
298 msip32w = (MCI_SYSINFO_PARMSW *)((char *)msip32w + sizeof(MCI_OPEN_PARMS16 *));
299 msip32w->dwCallback = msip16->dwCallback;
300 msip32w->lpstrReturn = HeapAlloc(GetProcessHeap(), 0, (dwFlags & MCI_SYSINFO_QUANTITY) ?
302 msip16->dwRetSize * sizeof(WCHAR));
303 if (!msip32w->lpstrReturn)
305 HeapFree(GetProcessHeap(), 0, msip32w);
306 return MMSYSTEM_MAP_NOMEM;
308 msip32w->dwRetSize = (dwFlags & MCI_SYSINFO_QUANTITY) ? sizeof(DWORD) : msip16->dwRetSize;
309 msip32w->dwNumber = msip16->dwNumber;
310 msip32w->wDeviceType = msip16->wDeviceType;
312 *lParam = (DWORD)msip32w;
314 return MMSYSTEM_MAP_OKMEM;
317 LPMCI_SOUND_PARMSW mbp32 = HeapAlloc(GetProcessHeap(), 0, sizeof(MCI_SOUND_PARMSW));
318 LPMCI_SOUND_PARMS16 mbp16 = MapSL(*lParam);
321 mbp32->dwCallback = mbp16->dwCallback;
322 mbp32->lpstrSoundName = MCI_strdupAtoW(MapSL(mbp16->lpstrSoundName));
324 return MMSYSTEM_MAP_NOMEM;
326 *lParam = (DWORD)mbp32;
328 return MMSYSTEM_MAP_OKMEM;
336 case DRV_QUERYCONFIGURE:
339 case DRV_EXITSESSION:
340 case DRV_EXITAPPLICATION:
342 FIXME("This is a hack\n");
343 return MMSYSTEM_MAP_OK;
345 FIXME("Don't know how to map msg=%s\n", MCI_MessageToString(wMsg));
347 return MMSYSTEM_MAP_MSGERROR;
350 /**************************************************************************
351 * MCI_UnMapMsg16To32W [internal]
353 static MMSYSTEM_MapType MCI_UnMapMsg16To32W(WORD wMsg, DWORD dwFlags, DWORD_PTR lParam)
356 /* case MCI_CAPTURE */
358 case MCI_CLOSE_DRIVER:
365 /* case MCI_INDEX: */
367 /* case MCI_MONITOR: */
376 /* case MCI_SETTIMECODE:*/
377 /* case MCI_SIGNAL:*/
384 return MMSYSTEM_MAP_OK;
391 LPMCI_DGV_RECT_PARMS16 mdrp16 = (LPMCI_DGV_RECT_PARMS16)lParam;
392 LPMCI_DGV_RECT_PARMS mdrp32 = (LPMCI_DGV_RECT_PARMS)((char*)lParam + sizeof(LPMCI_DGV_RECT_PARMS16));
393 mdrp16->dwCallback = mdrp32->dwCallback;
394 mdrp16->rc.left = mdrp32->rc.left;
395 mdrp16->rc.top = mdrp32->rc.top;
396 mdrp16->rc.right = mdrp32->rc.right;
397 mdrp16->rc.bottom = mdrp32->rc.bottom;
398 HeapFree(GetProcessHeap(), 0, (LPVOID)lParam);
400 return MMSYSTEM_MAP_OK;
402 /* FIXME ?? see Map function */
403 return MMSYSTEM_MAP_OK;
406 HeapFree(GetProcessHeap(), 0, (LPVOID)lParam);
407 return MMSYSTEM_MAP_OK;
410 LPMCI_VD_ESCAPE_PARMSW mvep32W = (LPMCI_VD_ESCAPE_PARMSW)lParam;
411 HeapFree(GetProcessHeap(), 0, (LPVOID)mvep32W->lpstrCommand);
412 HeapFree(GetProcessHeap(), 0, (LPVOID)lParam);
414 return MMSYSTEM_MAP_OK;
417 LPMCI_INFO_PARMSW mip32w = (LPMCI_INFO_PARMSW)lParam;
418 LPMCI_INFO_PARMS16 mip16 = *(LPMCI_INFO_PARMS16*)((char*)mip32w - sizeof(LPMCI_INFO_PARMS16));
420 WideCharToMultiByte(CP_ACP, 0,
421 mip32w->lpstrReturn, mip32w->dwRetSize / sizeof(WCHAR),
422 MapSL(mip16->lpstrReturn), mip16->dwRetSize,
424 HeapFree(GetProcessHeap(), 0, mip32w->lpstrReturn);
425 HeapFree(GetProcessHeap(), 0, (LPVOID)lParam);
427 return MMSYSTEM_MAP_OK;
430 MCI_SYSINFO_PARMSW *msip32w = (MCI_SYSINFO_PARMSW *)lParam;
431 MCI_SYSINFO_PARMS16 *msip16 = *(MCI_SYSINFO_PARMS16 **)((char *)msip32w - sizeof(MCI_SYSINFO_PARMS16 *));
433 if (dwFlags & MCI_SYSINFO_QUANTITY) {
434 DWORD *quantity = MapSL(msip16->lpstrReturn);
436 *quantity = *(DWORD *)msip32w->lpstrReturn;
439 WideCharToMultiByte(CP_ACP, 0,
440 msip32w->lpstrReturn, msip32w->dwRetSize,
441 MapSL(msip16->lpstrReturn), msip16->dwRetSize,
445 HeapFree(GetProcessHeap(), 0, msip32w->lpstrReturn);
446 HeapFree(GetProcessHeap(), 0, (LPVOID)lParam);
448 return MMSYSTEM_MAP_OK;
451 LPMCI_SOUND_PARMSW msp32W = (LPMCI_SOUND_PARMSW)lParam;
452 HeapFree(GetProcessHeap(), 0, (LPVOID)msp32W->lpstrSoundName);
453 HeapFree(GetProcessHeap(), 0, (LPVOID)lParam);
455 return MMSYSTEM_MAP_OK;
457 case MCI_OPEN_DRIVER:
459 LPMCI_OPEN_PARMSW mop32w = (LPMCI_OPEN_PARMSW)lParam;
460 LPMCI_OPEN_PARMS16 mop16 = *(LPMCI_OPEN_PARMS16*)((char*)mop32w - sizeof(LPMCI_OPEN_PARMS16));
462 mop16->wDeviceID = mop32w->wDeviceID;
463 if( ( dwFlags & ( MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID)) == MCI_OPEN_TYPE)
464 HeapFree(GetProcessHeap(), 0, (LPWSTR)mop32w->lpstrDeviceType);
465 if( ( dwFlags & ( MCI_OPEN_ELEMENT | MCI_OPEN_ELEMENT_ID)) == MCI_OPEN_ELEMENT)
466 HeapFree(GetProcessHeap(), 0, (LPWSTR)mop32w->lpstrElementName);
467 if( ( dwFlags & MCI_OPEN_ALIAS))
468 HeapFree(GetProcessHeap(), 0, (LPWSTR)mop32w->lpstrAlias);
469 if (!HeapFree(GetProcessHeap(), 0, (LPVOID)(lParam - sizeof(LPMCI_OPEN_PARMS16))))
470 FIXME("bad free line=%d\n", __LINE__);
472 return MMSYSTEM_MAP_OK;
480 case DRV_QUERYCONFIGURE:
483 case DRV_EXITSESSION:
484 case DRV_EXITAPPLICATION:
486 FIXME("This is a hack\n");
487 return MMSYSTEM_MAP_OK;
489 FIXME("Map/Unmap internal error on msg=%s\n", MCI_MessageToString(wMsg));
491 return MMSYSTEM_MAP_MSGERROR;
494 /* ###################################################
496 * ###################################################
499 #include <pshpack1.h>
500 #define MCI_MAX_THUNKS 32
502 static struct mci_thunk
504 BYTE popl_eax; /* popl %eax (return address) */
505 BYTE pushl_func; /* pushl $pfn16 (16bit callback function) */
507 BYTE pushl_eax; /* pushl %eax */
508 BYTE jmp; /* ljmp MCI_Yield1632 */
515 static CRITICAL_SECTION mci_cs;
516 static CRITICAL_SECTION_DEBUG mci_critsect_debug =
519 { &mci_critsect_debug.ProcessLocksList, &mci_critsect_debug.ProcessLocksList },
520 0, 0, { (DWORD_PTR)(__FILE__ ": mmsystem_mci_cs") }
522 static CRITICAL_SECTION mci_cs = { &mci_critsect_debug, -1, 0, 0, 0, 0 };
524 static UINT MCI_Yield1632(DWORD pfn16, MCIDEVICEID id, DWORD yield_data)
531 PeekMessageW( &msg, 0, 0, 0, PM_REMOVE | PM_QS_SENDMESSAGE );
535 /* 16 bit func, call it */
536 TRACE("Function (16 bit) !\n");
538 args[2] = (MCIDEVICEID16)id;
539 args[1] = HIWORD(yield_data);
540 args[0] = LOWORD(yield_data);
541 return WOWCallback16Ex(pfn16, WCB16_PASCAL, sizeof(args), args, NULL);
544 /******************************************************************
548 static struct mci_thunk* MCI_AddThunk(MCIDEVICEID id, YIELDPROC16 pfn16)
550 struct mci_thunk* thunk;
554 MCI_Thunks = VirtualAlloc(NULL, MCI_MAX_THUNKS * sizeof(*MCI_Thunks), MEM_COMMIT,
555 PAGE_EXECUTE_READWRITE);
556 if (!MCI_Thunks) return NULL;
557 for (thunk = MCI_Thunks; thunk < &MCI_Thunks[MCI_MAX_THUNKS]; thunk++)
559 thunk->popl_eax = 0x58; /* popl %eax */
560 thunk->pushl_func = 0x68; /* pushl $pfn16 */
562 thunk->pushl_eax = 0x50; /* pushl %eax */
563 thunk->jmp = 0xe9; /* jmp MCI_Yield1632 */
564 thunk->callback = (char *)MCI_Yield1632 - (char *)(&thunk->callback + 1);
568 for (thunk = MCI_Thunks; thunk < &MCI_Thunks[MCI_MAX_THUNKS]; thunk++)
570 if (thunk->yield16 == 0)
572 thunk->yield16 = pfn16;
577 FIXME("Out of mci-thunks. Bump MCI_MAX_THUNKS\n");
581 /******************************************************************
585 static struct mci_thunk* MCI_HasThunk(YIELDPROC pfn)
587 struct mci_thunk* thunk;
589 if (!MCI_Thunks) return NULL;
590 for (thunk = MCI_Thunks; thunk < &MCI_Thunks[MCI_MAX_THUNKS]; thunk++)
592 if ((YIELDPROC)thunk == pfn) return thunk;
597 /**************************************************************************
598 * mciSetYieldProc [MMSYSTEM.714]
600 BOOL16 WINAPI mciSetYieldProc16(UINT16 uDeviceID, YIELDPROC16 fpYieldProc, DWORD dwYieldData)
602 struct mci_thunk* thunk;
605 TRACE("(%u, %p, %08x)\n", uDeviceID, fpYieldProc, dwYieldData);
607 if (!(thunk = MCI_AddThunk(uDeviceID, fpYieldProc)))
609 ret = mciSetYieldProc(uDeviceID, (YIELDPROC)thunk, dwYieldData);
610 if (!ret) thunk->yield16 = NULL;
614 /**************************************************************************
615 * mciGetYieldProc [MMSYSTEM.716]
617 YIELDPROC16 WINAPI mciGetYieldProc16(UINT16 uDeviceID, DWORD* lpdwYieldData)
621 struct mci_thunk* thunk;
623 TRACE("(%u, %p)\n", uDeviceID, lpdwYieldData);
625 yield = mciGetYieldProc(uDeviceID, &data);
626 if (!yield || !(thunk = MCI_HasThunk(yield))) return NULL;
628 if (lpdwYieldData) *lpdwYieldData = data;
629 return thunk->yield16;
632 /**************************************************************************
633 * mciGetErrorString [MMSYSTEM.706]
635 BOOL16 WINAPI mciGetErrorString16(DWORD wError, LPSTR lpstrBuffer, UINT16 uLength)
637 return mciGetErrorStringA(wError, lpstrBuffer, uLength);
640 /**************************************************************************
641 * mciDriverNotify [MMSYSTEM.711]
643 BOOL16 WINAPI mciDriverNotify16(HWND16 hWndCallBack, UINT16 wDevID, UINT16 wStatus)
645 TRACE("(%04X, %04x, %04X)\n", hWndCallBack, wDevID, wStatus);
647 return PostMessageA(HWND_32(hWndCallBack), MM_MCINOTIFY, wStatus, wDevID);
650 /**************************************************************************
651 * mciGetDriverData [MMSYSTEM.708]
653 DWORD WINAPI mciGetDriverData16(UINT16 uDeviceID)
655 return mciGetDriverData(uDeviceID);
658 /**************************************************************************
659 * mciSetDriverData [MMSYSTEM.707]
661 BOOL16 WINAPI mciSetDriverData16(UINT16 uDeviceID, DWORD data)
663 return mciSetDriverData(uDeviceID, data);
666 /**************************************************************************
667 * mciSendCommand [MMSYSTEM.701]
669 DWORD WINAPI mciSendCommand16(UINT16 wDevID, UINT16 wMsg, DWORD dwParam1, DWORD p2)
673 DWORD_PTR dwParam2 = p2;
675 TRACE("(%04X, %s, %08X, %08lX)\n", wDevID, MCI_MessageToString(wMsg), dwParam1, dwParam2);
686 /* FIXME: this is suboptimal. If MCI driver is a 16bit one, we'll be
687 * doing 16=>32W, then 32W=>16 conversions.
688 * We could directly call the 16bit driver if we had the information.
693 MMSYSTEM_MapType res;
695 dwRet = MCIERR_INVALID_DEVICE_ID;
697 switch (res = MCI_MapMsg16To32W(wMsg, dwParam1, &dwParam2)) {
698 case MMSYSTEM_MAP_MSGERROR:
699 TRACE("%s not handled yet\n", MCI_MessageToString(wMsg));
700 dwRet = MCIERR_DRIVER_INTERNAL;
702 case MMSYSTEM_MAP_NOMEM:
703 TRACE("Problem mapping %s from 16 to 32a\n", MCI_MessageToString(wMsg));
704 dwRet = MCIERR_OUT_OF_MEMORY;
706 case MMSYSTEM_MAP_OK:
707 case MMSYSTEM_MAP_OKMEM:
708 dwRet = mciSendCommandW(wDevID, wMsg, dwParam1, dwParam2);
709 if (res == MMSYSTEM_MAP_OKMEM)
710 MCI_UnMapMsg16To32W(wMsg, dwParam1, dwParam2);
717 if (wDevID == MCI_ALL_DEVICE_ID) {
718 FIXME("unhandled MCI_ALL_DEVICE_ID\n");
719 dwRet = MCIERR_CANNOT_USE_ALL;
721 dwRet = SendDriverMessage(hdrv, wMsg, dwParam1, dwParam2);
725 if (wMsg == MCI_CLOSE && dwRet == 0 && MCI_Thunks)
727 /* free yield thunks, if any */
729 for (i = 0; i < MCI_MAX_THUNKS; i++)
731 if (MCI_Thunks[i].id == wDevID)
732 MCI_Thunks[i].yield16 = NULL;
738 /**************************************************************************
739 * mciGetDeviceID [MMSYSTEM.703]
741 UINT16 WINAPI mciGetDeviceID16(LPCSTR lpstrName)
743 TRACE("(\"%s\")\n", lpstrName);
745 return mciGetDeviceIDA(lpstrName);
748 /**************************************************************************
749 * mciGetDeviceIDFromElementID [MMSYSTEM.715]
751 UINT16 WINAPI mciGetDeviceIDFromElementID16(DWORD dwElementID, LPCSTR lpstrType)
753 return mciGetDeviceIDFromElementIDA(dwElementID, lpstrType);
756 /**************************************************************************
757 * mciGetCreatorTask [MMSYSTEM.717]
759 HTASK16 WINAPI mciGetCreatorTask16(UINT16 uDeviceID)
761 return HTASK_16(mciGetCreatorTask(uDeviceID));
764 /**************************************************************************
765 * mciDriverYield [MMSYSTEM.710]
767 UINT16 WINAPI mciDriverYield16(UINT16 uDeviceID)
769 return mciDriverYield(uDeviceID);
772 /**************************************************************************
773 * mciSendString [MMSYSTEM.702]
775 DWORD WINAPI mciSendString16(LPCSTR lpstrCommand, LPSTR lpstrRet,
776 UINT16 uRetLen, HWND16 hwndCallback)
778 return mciSendStringA(lpstrCommand, lpstrRet, uRetLen, HWND_32(hwndCallback));
781 /**************************************************************************
782 * mciLoadCommandResource [MMSYSTEM.705]
784 UINT16 WINAPI mciLoadCommandResource16(HINSTANCE16 hInst, LPCSTR resname, UINT16 type)
786 TRACE("(%04x, %s, %x)!\n", hInst, resname, type);
787 return MCI_NO_COMMAND_TABLE;
790 /**************************************************************************
791 * mciFreeCommandResource [MMSYSTEM.713]
793 BOOL16 WINAPI mciFreeCommandResource16(UINT16 uTable)
795 TRACE("(%04x)!\n", uTable);
800 /**************************************************************************
801 * mciExecute [MMSYSTEM.712]
803 BOOL16 WINAPI mciExecute16(LPCSTR lpstrCommand)
805 return mciExecute(lpstrCommand);