2 * DirectShow MCI Driver
4 * Copyright 2009 Christian Costa
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/debug.h"
28 #include "mciqtz_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(mciqtz
);
34 static DWORD
MCIQTZ_mciClose(UINT
, DWORD
, LPMCI_GENERIC_PARMS
);
35 static DWORD
MCIQTZ_mciStop(UINT
, DWORD
, LPMCI_GENERIC_PARMS
);
37 /*======================================================================*
38 * MCI QTZ implementation *
39 *======================================================================*/
41 static HINSTANCE MCIQTZ_hInstance
= 0;
43 /***********************************************************************
46 BOOL WINAPI
DllMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID fImpLoad
)
49 case DLL_PROCESS_ATTACH
:
50 DisableThreadLibraryCalls(hInstDLL
);
51 MCIQTZ_hInstance
= hInstDLL
;
57 /**************************************************************************
58 * MCIQTZ_mciGetOpenDev [internal]
60 static WINE_MCIQTZ
* MCIQTZ_mciGetOpenDev(UINT wDevID
)
62 WINE_MCIQTZ
* wma
= (WINE_MCIQTZ
*)mciGetDriverData(wDevID
);
65 WARN("Invalid wDevID=%u\n", wDevID
);
71 /**************************************************************************
72 * MCIQTZ_drvOpen [internal]
74 static DWORD
MCIQTZ_drvOpen(LPCWSTR str
, LPMCI_OPEN_DRIVER_PARMSW modp
)
77 static const WCHAR mciAviWStr
[] = {'M','C','I','A','V','I',0};
79 TRACE("(%s, %p)\n", debugstr_w(str
), modp
);
81 /* session instance */
85 wma
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(WINE_MCIQTZ
));
89 wma
->stop_event
= CreateEventW(NULL
, FALSE
, FALSE
, NULL
);
90 modp
->wType
= MCI_DEVTYPE_DIGITAL_VIDEO
;
91 wma
->wDevID
= modp
->wDeviceID
;
92 modp
->wCustomCommandTable
= wma
->command_table
= mciLoadCommandResource(MCIQTZ_hInstance
, mciAviWStr
, 0);
93 mciSetDriverData(wma
->wDevID
, (DWORD_PTR
)wma
);
95 return modp
->wDeviceID
;
98 /**************************************************************************
99 * MCIQTZ_drvClose [internal]
101 static DWORD
MCIQTZ_drvClose(DWORD dwDevID
)
105 TRACE("(%04x)\n", dwDevID
);
107 wma
= MCIQTZ_mciGetOpenDev(dwDevID
);
110 /* finish all outstanding things */
111 MCIQTZ_mciClose(dwDevID
, MCI_WAIT
, NULL
);
113 mciFreeCommandResource(wma
->command_table
);
114 mciSetDriverData(dwDevID
, 0);
115 CloseHandle(wma
->stop_event
);
116 HeapFree(GetProcessHeap(), 0, wma
);
120 return (dwDevID
== 0xFFFFFFFF) ? 1 : 0;
123 /**************************************************************************
124 * MCIQTZ_drvConfigure [internal]
126 static DWORD
MCIQTZ_drvConfigure(DWORD dwDevID
)
130 TRACE("(%04x)\n", dwDevID
);
132 wma
= MCIQTZ_mciGetOpenDev(dwDevID
);
136 MCIQTZ_mciStop(dwDevID
, MCI_WAIT
, NULL
);
138 MessageBoxA(0, "Sample QTZ Wine Driver !", "MM-Wine Driver", MB_OK
);
143 /**************************************************************************
144 * MCIQTZ_mciNotify [internal]
146 * Notifications in MCI work like a 1-element queue.
147 * Each new notification request supersedes the previous one.
149 static void MCIQTZ_mciNotify(DWORD_PTR hWndCallBack
, WINE_MCIQTZ
* wma
, UINT wStatus
)
151 MCIDEVICEID wDevID
= wma
->notify_devid
;
152 HANDLE old
= InterlockedExchangePointer(&wma
->callback
, NULL
);
153 if (old
) mciDriverNotify(old
, wDevID
, MCI_NOTIFY_SUPERSEDED
);
154 mciDriverNotify(HWND_32(LOWORD(hWndCallBack
)), wDevID
, wStatus
);
157 /***************************************************************************
158 * MCIQTZ_mciOpen [internal]
160 static DWORD
MCIQTZ_mciOpen(UINT wDevID
, DWORD dwFlags
,
161 LPMCI_DGV_OPEN_PARMSW lpOpenParms
)
166 RECT rc
= { 0, 0, 0, 0 };
168 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpOpenParms
);
171 return MCIERR_NULL_PARAMETER_BLOCK
;
173 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
175 return MCIERR_INVALID_DEVICE_ID
;
177 MCIQTZ_mciStop(wDevID
, MCI_WAIT
, NULL
);
179 hr
= CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
180 wma
->uninit
= SUCCEEDED(hr
);
182 hr
= CoCreateInstance(&CLSID_FilterGraph
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IGraphBuilder
, (LPVOID
*)&wma
->pgraph
);
184 TRACE("Cannot create filtergraph (hr = %x)\n", hr
);
188 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IMediaControl
, (LPVOID
*)&wma
->pmctrl
);
190 TRACE("Cannot get IMediaControl interface (hr = %x)\n", hr
);
194 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IMediaSeeking
, (void**)&wma
->seek
);
196 TRACE("Cannot get IMediaSeeking interface (hr = %x)\n", hr
);
200 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IMediaEvent
, (void**)&wma
->mevent
);
202 TRACE("Cannot get IMediaEvent interface (hr = %x)\n", hr
);
206 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IVideoWindow
, (void**)&wma
->vidwin
);
208 TRACE("Cannot get IVideoWindow interface (hr = %x)\n", hr
);
212 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IBasicVideo
, (void**)&wma
->vidbasic
);
214 TRACE("Cannot get IBasicVideo interface (hr = %x)\n", hr
);
218 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IBasicAudio
, (void**)&wma
->audio
);
220 TRACE("Cannot get IBasicAudio interface (hr = %x)\n", hr
);
224 if (!(dwFlags
& MCI_OPEN_ELEMENT
) || (dwFlags
& MCI_OPEN_ELEMENT_ID
)) {
225 TRACE("Wrong dwFlags %x\n", dwFlags
);
229 if (!lpOpenParms
->lpstrElementName
|| !lpOpenParms
->lpstrElementName
[0]) {
230 TRACE("Invalid filename specified\n");
234 TRACE("Open file %s\n", debugstr_w(lpOpenParms
->lpstrElementName
));
236 hr
= IGraphBuilder_RenderFile(wma
->pgraph
, lpOpenParms
->lpstrElementName
, NULL
);
238 TRACE("Cannot render file (hr = %x)\n", hr
);
242 IVideoWindow_put_AutoShow(wma
->vidwin
, OAFALSE
);
243 IVideoWindow_put_Visible(wma
->vidwin
, OAFALSE
);
244 if (dwFlags
& MCI_DGV_OPEN_WS
)
245 style
= lpOpenParms
->dwStyle
;
246 if (dwFlags
& MCI_DGV_OPEN_PARENT
) {
247 IVideoWindow_put_MessageDrain(wma
->vidwin
, (OAHWND
)lpOpenParms
->hWndParent
);
248 IVideoWindow_put_WindowState(wma
->vidwin
, SW_HIDE
);
249 IVideoWindow_put_WindowStyle(wma
->vidwin
, style
|WS_CHILD
);
250 IVideoWindow_put_Owner(wma
->vidwin
, (OAHWND
)lpOpenParms
->hWndParent
);
251 GetClientRect(lpOpenParms
->hWndParent
, &rc
);
252 IVideoWindow_SetWindowPosition(wma
->vidwin
, rc
.left
, rc
.top
, rc
.right
- rc
.top
, rc
.bottom
- rc
.top
);
253 wma
->parent
= (HWND
)lpOpenParms
->hWndParent
;
256 IVideoWindow_put_WindowStyle(wma
->vidwin
, style
);
257 IBasicVideo_GetVideoSize(wma
->vidbasic
, &rc
.right
, &rc
.bottom
);
260 if (dwFlags
& MCI_NOTIFY
)
261 mciDriverNotify(HWND_32(LOWORD(lpOpenParms
->dwCallback
)), wDevID
, MCI_NOTIFY_SUCCESSFUL
);
267 IBasicAudio_Release(wma
->audio
);
270 IBasicVideo_Release(wma
->vidbasic
);
271 wma
->vidbasic
= NULL
;
273 IMediaSeeking_Release(wma
->seek
);
276 IVideoWindow_Release(wma
->vidwin
);
279 IGraphBuilder_Release(wma
->pgraph
);
282 IMediaEvent_Release(wma
->mevent
);
285 IMediaControl_Release(wma
->pmctrl
);
292 return MCIERR_INTERNAL
;
295 /***************************************************************************
296 * MCIQTZ_mciClose [internal]
298 static DWORD
MCIQTZ_mciClose(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
302 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
304 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
306 return MCIERR_INVALID_DEVICE_ID
;
308 MCIQTZ_mciStop(wDevID
, MCI_WAIT
, NULL
);
311 IVideoWindow_Release(wma
->vidwin
);
312 IBasicVideo_Release(wma
->vidbasic
);
313 IBasicAudio_Release(wma
->audio
);
314 IMediaSeeking_Release(wma
->seek
);
315 IMediaEvent_Release(wma
->mevent
);
316 IGraphBuilder_Release(wma
->pgraph
);
317 IMediaControl_Release(wma
->pmctrl
);
326 /***************************************************************************
327 * MCIQTZ_notifyThread [internal]
329 static DWORD CALLBACK
MCIQTZ_notifyThread(LPVOID parm
)
331 WINE_MCIQTZ
* wma
= (WINE_MCIQTZ
*)parm
;
334 DWORD n
= 0, ret
= 0;
336 handle
[n
++] = wma
->stop_event
;
337 IMediaEvent_GetEventHandle(wma
->mevent
, (OAEVENT
*)&handle
[n
++]);
343 r
= WaitForMultipleObjects(n
, handle
, FALSE
, INFINITE
);
344 if (r
== WAIT_OBJECT_0
) {
345 TRACE("got stop event\n");
346 old
= InterlockedExchangePointer(&wma
->callback
, NULL
);
348 mciDriverNotify(old
, wma
->notify_devid
, MCI_NOTIFY_ABORTED
);
351 else if (r
== WAIT_OBJECT_0
+1) {
355 hr
= IMediaEvent_GetEvent(wma
->mevent
, &event_code
, &p1
, &p2
, 0);
357 TRACE("got event_code = 0x%02x\n", event_code
);
358 IMediaEvent_FreeEventParams(wma
->mevent
, event_code
, p1
, p2
);
360 } while (hr
== S_OK
&& event_code
!= EC_COMPLETE
);
361 if (hr
== S_OK
&& event_code
== EC_COMPLETE
) {
362 /* Repeat the music by seeking and running again */
363 if (wma
->mci_flags
& MCI_DGV_PLAY_REPEAT
) {
364 TRACE("repeat media as requested\n");
365 IMediaControl_Stop(wma
->pmctrl
);
366 IMediaSeeking_SetPositions(wma
->seek
,
368 AM_SEEKING_AbsolutePositioning
,
370 AM_SEEKING_AbsolutePositioning
);
371 IMediaControl_Run(wma
->pmctrl
);
374 old
= InterlockedExchangePointer(&wma
->callback
, NULL
);
376 mciDriverNotify(old
, wma
->notify_devid
, MCI_NOTIFY_SUCCESSFUL
);
381 TRACE("Unknown error (%d)\n", (int)r
);
386 hr
= IMediaControl_Stop(wma
->pmctrl
);
388 TRACE("Cannot stop filtergraph (hr = %x)\n", hr
);
389 ret
= MCIERR_INTERNAL
;
395 /***************************************************************************
396 * MCIQTZ_mciPlay [internal]
398 static DWORD
MCIQTZ_mciPlay(UINT wDevID
, DWORD dwFlags
, LPMCI_PLAY_PARMS lpParms
)
405 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
408 return MCIERR_NULL_PARAMETER_BLOCK
;
410 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
412 return MCIERR_INVALID_DEVICE_ID
;
414 ResetEvent(wma
->stop_event
);
415 if (dwFlags
& MCI_NOTIFY
) {
417 old
= InterlockedExchangePointer(&wma
->callback
, HWND_32(LOWORD(lpParms
->dwCallback
)));
419 mciDriverNotify(old
, wma
->notify_devid
, MCI_NOTIFY_ABORTED
);
422 wma
->mci_flags
= dwFlags
;
423 IMediaSeeking_GetTimeFormat(wma
->seek
, &format
);
424 if (dwFlags
& MCI_FROM
) {
425 if (IsEqualGUID(&format
, &TIME_FORMAT_MEDIA_TIME
))
426 wma
->seek_start
= lpParms
->dwFrom
* 10000;
428 wma
->seek_start
= lpParms
->dwFrom
;
429 start_flags
= AM_SEEKING_AbsolutePositioning
;
432 start_flags
= AM_SEEKING_NoPositioning
;
434 if (dwFlags
& MCI_TO
) {
435 if (IsEqualGUID(&format
, &TIME_FORMAT_MEDIA_TIME
))
436 wma
->seek_stop
= lpParms
->dwTo
* 10000;
438 wma
->seek_stop
= lpParms
->dwTo
;
441 IMediaSeeking_GetDuration(wma
->seek
, &wma
->seek_stop
);
443 IMediaSeeking_SetPositions(wma
->seek
, &wma
->seek_start
, start_flags
,
444 &wma
->seek_stop
, AM_SEEKING_AbsolutePositioning
);
446 hr
= IMediaControl_Run(wma
->pmctrl
);
448 TRACE("Cannot run filtergraph (hr = %x)\n", hr
);
449 return MCIERR_INTERNAL
;
452 IVideoWindow_put_Visible(wma
->vidwin
, OATRUE
);
454 wma
->thread
= CreateThread(NULL
, 0, MCIQTZ_notifyThread
, wma
, 0, NULL
);
456 TRACE("Can't create thread\n");
457 return MCIERR_INTERNAL
;
462 /***************************************************************************
463 * MCIQTZ_mciSeek [internal]
465 static DWORD
MCIQTZ_mciSeek(UINT wDevID
, DWORD dwFlags
, LPMCI_SEEK_PARMS lpParms
)
471 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
474 return MCIERR_NULL_PARAMETER_BLOCK
;
476 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
478 return MCIERR_INVALID_DEVICE_ID
;
480 MCIQTZ_mciStop(wDevID
, MCI_WAIT
, NULL
);
482 if (dwFlags
& MCI_SEEK_TO_START
) {
484 } else if (dwFlags
& MCI_SEEK_TO_END
) {
485 FIXME("MCI_SEEK_TO_END not implemented yet\n");
486 return MCIERR_INTERNAL
;
487 } else if (dwFlags
& MCI_TO
) {
488 FIXME("MCI_TO not implemented yet\n");
489 return MCIERR_INTERNAL
;
491 WARN("dwFlag doesn't tell where to seek to...\n");
492 return MCIERR_MISSING_PARAMETER
;
495 hr
= IMediaSeeking_SetPositions(wma
->seek
, &newpos
, AM_SEEKING_AbsolutePositioning
, NULL
, AM_SEEKING_NoPositioning
);
497 FIXME("Cannot set position (hr = %x)\n", hr
);
498 return MCIERR_INTERNAL
;
501 if (dwFlags
& MCI_NOTIFY
)
502 MCIQTZ_mciNotify(lpParms
->dwCallback
, wma
, MCI_NOTIFY_SUCCESSFUL
);
507 /***************************************************************************
508 * MCIQTZ_mciStop [internal]
510 static DWORD
MCIQTZ_mciStop(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
514 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
516 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
518 return MCIERR_INVALID_DEVICE_ID
;
524 SetEvent(wma
->stop_event
);
525 WaitForSingleObject(wma
->thread
, INFINITE
);
526 CloseHandle(wma
->thread
);
531 IVideoWindow_put_Visible(wma
->vidwin
, OAFALSE
);
536 /***************************************************************************
537 * MCIQTZ_mciPause [internal]
539 static DWORD
MCIQTZ_mciPause(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
544 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
546 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
548 return MCIERR_INVALID_DEVICE_ID
;
550 hr
= IMediaControl_Pause(wma
->pmctrl
);
552 TRACE("Cannot pause filtergraph (hr = %x)\n", hr
);
553 return MCIERR_INTERNAL
;
559 /***************************************************************************
560 * MCIQTZ_mciResume [internal]
562 static DWORD
MCIQTZ_mciResume(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
567 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
569 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
571 return MCIERR_INVALID_DEVICE_ID
;
573 hr
= IMediaControl_Run(wma
->pmctrl
);
575 TRACE("Cannot run filtergraph (hr = %x)\n", hr
);
576 return MCIERR_INTERNAL
;
582 /***************************************************************************
583 * MCIQTZ_mciGetDevCaps [internal]
585 static DWORD
MCIQTZ_mciGetDevCaps(UINT wDevID
, DWORD dwFlags
, LPMCI_GETDEVCAPS_PARMS lpParms
)
589 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
592 return MCIERR_NULL_PARAMETER_BLOCK
;
594 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
596 return MCIERR_INVALID_DEVICE_ID
;
598 if (!(dwFlags
& MCI_GETDEVCAPS_ITEM
))
599 return MCIERR_MISSING_PARAMETER
;
601 switch (lpParms
->dwItem
) {
602 case MCI_GETDEVCAPS_CAN_RECORD
:
603 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
604 TRACE("MCI_GETDEVCAPS_CAN_RECORD = %08x\n", lpParms
->dwReturn
);
606 case MCI_GETDEVCAPS_HAS_AUDIO
:
607 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
608 TRACE("MCI_GETDEVCAPS_HAS_AUDIO = %08x\n", lpParms
->dwReturn
);
610 case MCI_GETDEVCAPS_HAS_VIDEO
:
611 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
612 TRACE("MCI_GETDEVCAPS_HAS_VIDEO = %08x\n", lpParms
->dwReturn
);
614 case MCI_GETDEVCAPS_DEVICE_TYPE
:
615 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_DEVTYPE_DIGITAL_VIDEO
, MCI_DEVTYPE_DIGITAL_VIDEO
);
616 TRACE("MCI_GETDEVCAPS_DEVICE_TYPE = %08x\n", lpParms
->dwReturn
);
618 case MCI_GETDEVCAPS_USES_FILES
:
619 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
620 TRACE("MCI_GETDEVCAPS_USES_FILES = %08x\n", lpParms
->dwReturn
);
622 case MCI_GETDEVCAPS_COMPOUND_DEVICE
:
623 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
624 TRACE("MCI_GETDEVCAPS_COMPOUND_DEVICE = %08x\n", lpParms
->dwReturn
);
626 case MCI_GETDEVCAPS_CAN_EJECT
:
627 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
628 TRACE("MCI_GETDEVCAPS_EJECT = %08x\n", lpParms
->dwReturn
);
630 case MCI_GETDEVCAPS_CAN_PLAY
:
631 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
632 TRACE("MCI_GETDEVCAPS_CAN_PLAY = %08x\n", lpParms
->dwReturn
);
634 case MCI_GETDEVCAPS_CAN_SAVE
:
635 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
636 TRACE("MCI_GETDEVCAPS_CAN_SAVE = %08x\n", lpParms
->dwReturn
);
638 case MCI_DGV_GETDEVCAPS_CAN_REVERSE
:
639 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
640 TRACE("MCI_DGV_GETDEVCAPS_CAN_REVERSE = %08x\n", lpParms
->dwReturn
);
642 case MCI_DGV_GETDEVCAPS_CAN_STRETCH
:
643 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
); /* FIXME */
644 TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH = %08x\n", lpParms
->dwReturn
);
646 case MCI_DGV_GETDEVCAPS_CAN_LOCK
:
647 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
648 TRACE("MCI_DGV_GETDEVCAPS_CAN_LOCK = %08x\n", lpParms
->dwReturn
);
650 case MCI_DGV_GETDEVCAPS_CAN_FREEZE
:
651 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
652 TRACE("MCI_DGV_GETDEVCAPS_CAN_FREEZE = %08x\n", lpParms
->dwReturn
);
654 case MCI_DGV_GETDEVCAPS_CAN_STR_IN
:
655 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
656 TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH_INPUT = %08x\n", lpParms
->dwReturn
);
658 case MCI_DGV_GETDEVCAPS_HAS_STILL
:
659 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
660 TRACE("MCI_DGV_GETDEVCAPS_HAS_STILL = %08x\n", lpParms
->dwReturn
);
662 case MCI_DGV_GETDEVCAPS_CAN_TEST
:
663 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
); /* FIXME */
664 TRACE("MCI_DGV_GETDEVCAPS_CAN_TEST = %08x\n", lpParms
->dwReturn
);
666 case MCI_DGV_GETDEVCAPS_MAX_WINDOWS
:
667 lpParms
->dwReturn
= 1;
668 TRACE("MCI_DGV_GETDEVCAPS_MAX_WINDOWS = %u\n", lpParms
->dwReturn
);
671 WARN("Unknown capability %08x\n", lpParms
->dwItem
);
673 case MCI_DGV_GETDEVCAPS_MAXIMUM_RATE
: /* unknown to w2k */
674 case MCI_DGV_GETDEVCAPS_MINIMUM_RATE
: /* unknown to w2k */
675 return MCIERR_UNSUPPORTED_FUNCTION
;
678 return MCI_RESOURCE_RETURNED
;
681 /***************************************************************************
682 * MCIQTZ_mciSet [internal]
684 static DWORD
MCIQTZ_mciSet(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_SET_PARMS lpParms
)
688 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
691 return MCIERR_NULL_PARAMETER_BLOCK
;
693 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
695 return MCIERR_INVALID_DEVICE_ID
;
697 if (dwFlags
& MCI_SET_TIME_FORMAT
) {
698 switch (lpParms
->dwTimeFormat
) {
699 case MCI_FORMAT_MILLISECONDS
:
700 TRACE("MCI_SET_TIME_FORMAT = MCI_FORMAT_MILLISECONDS\n");
701 wma
->time_format
= MCI_FORMAT_MILLISECONDS
;
703 case MCI_FORMAT_FRAMES
:
704 TRACE("MCI_SET_TIME_FORMAT = MCI_FORMAT_FRAMES\n");
705 wma
->time_format
= MCI_FORMAT_FRAMES
;
708 WARN("Bad time format %u\n", lpParms
->dwTimeFormat
);
709 return MCIERR_BAD_TIME_FORMAT
;
713 if (dwFlags
& MCI_SET_DOOR_OPEN
)
714 FIXME("MCI_SET_DOOR_OPEN not implemented yet\n");
715 if (dwFlags
& MCI_SET_DOOR_CLOSED
)
716 FIXME("MCI_SET_DOOR_CLOSED not implemented yet\n");
717 if (dwFlags
& MCI_SET_AUDIO
)
718 FIXME("MCI_SET_AUDIO not implemented yet\n");
719 if (dwFlags
& MCI_SET_VIDEO
)
720 FIXME("MCI_SET_VIDEO not implemented yet\n");
721 if (dwFlags
& MCI_SET_ON
)
722 FIXME("MCI_SET_ON not implemented yet\n");
723 if (dwFlags
& MCI_SET_OFF
)
724 FIXME("MCI_SET_OFF not implemented yet\n");
725 if (dwFlags
& MCI_SET_AUDIO_LEFT
)
726 FIXME("MCI_SET_AUDIO_LEFT not implemented yet\n");
727 if (dwFlags
& MCI_SET_AUDIO_RIGHT
)
728 FIXME("MCI_SET_AUDIO_RIGHT not implemented yet\n");
730 if (dwFlags
& ~0x7f03 /* All MCI_SET flags mask */)
731 ERR("Unknown flags %08x\n", dwFlags
& ~0x7f03);
736 /***************************************************************************
737 * MCIQTZ_mciStatus [internal]
739 static DWORD
MCIQTZ_mciStatus(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_STATUS_PARMSW lpParms
)
743 DWORD ret
= MCI_INTEGER_RETURNED
;
745 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
748 return MCIERR_NULL_PARAMETER_BLOCK
;
750 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
752 return MCIERR_INVALID_DEVICE_ID
;
754 if (!(dwFlags
& MCI_STATUS_ITEM
)) {
755 WARN("No status item specified\n");
756 return MCIERR_UNRECOGNIZED_COMMAND
;
759 switch (lpParms
->dwItem
) {
760 case MCI_STATUS_LENGTH
: {
761 LONGLONG duration
= -1;
763 switch (wma
->time_format
) {
764 case MCI_FORMAT_MILLISECONDS
: format
= TIME_FORMAT_MEDIA_TIME
; break;
765 case MCI_FORMAT_FRAMES
: format
= TIME_FORMAT_FRAME
; break;
766 default: ERR("Unhandled format %x\n", wma
->time_format
); break;
768 hr
= IMediaSeeking_SetTimeFormat(wma
->seek
, &format
);
770 FIXME("Cannot set time format (hr = %x)\n", hr
);
771 lpParms
->dwReturn
= 0;
774 hr
= IMediaSeeking_GetDuration(wma
->seek
, &duration
);
775 if (FAILED(hr
) || duration
< 0) {
776 FIXME("Cannot read duration (hr = %x)\n", hr
);
777 lpParms
->dwReturn
= 0;
778 } else if (wma
->time_format
!= MCI_FORMAT_MILLISECONDS
)
779 lpParms
->dwReturn
= duration
;
781 lpParms
->dwReturn
= duration
/ 10000;
784 case MCI_STATUS_POSITION
: {
785 REFERENCE_TIME curpos
;
787 hr
= IMediaSeeking_GetCurrentPosition(wma
->seek
, &curpos
);
789 FIXME("Cannot get position (hr = %x)\n", hr
);
790 return MCIERR_INTERNAL
;
792 lpParms
->dwReturn
= curpos
/ 10000;
795 case MCI_STATUS_NUMBER_OF_TRACKS
:
796 FIXME("MCI_STATUS_NUMBER_OF_TRACKS not implemented yet\n");
797 return MCIERR_UNRECOGNIZED_COMMAND
;
798 case MCI_STATUS_MODE
: {
799 LONG state
= State_Stopped
;
800 IMediaControl_GetState(wma
->pmctrl
, -1, &state
);
801 if (state
== State_Stopped
)
802 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_STOP
, MCI_MODE_STOP
);
803 else if (state
== State_Running
) {
804 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_PLAY
, MCI_MODE_PLAY
);
805 if (!wma
->thread
|| WaitForSingleObject(wma
->thread
, 0) == WAIT_OBJECT_0
)
806 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_STOP
, MCI_MODE_STOP
);
807 } else if (state
== State_Paused
)
808 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_PAUSE
, MCI_MODE_PAUSE
);
809 ret
= MCI_RESOURCE_RETURNED
;
812 case MCI_STATUS_MEDIA_PRESENT
:
813 FIXME("MCI_STATUS_MEDIA_PRESENT not implemented yet\n");
814 return MCIERR_UNRECOGNIZED_COMMAND
;
815 case MCI_STATUS_TIME_FORMAT
:
816 lpParms
->dwReturn
= MAKEMCIRESOURCE(wma
->time_format
,
817 MCI_FORMAT_RETURN_BASE
+ wma
->time_format
);
818 ret
= MCI_RESOURCE_RETURNED
;
820 case MCI_STATUS_READY
:
821 FIXME("MCI_STATUS_READY not implemented yet\n");
822 return MCIERR_UNRECOGNIZED_COMMAND
;
823 case MCI_STATUS_CURRENT_TRACK
:
824 FIXME("MCI_STATUS_CURRENT_TRACK not implemented yet\n");
825 return MCIERR_UNRECOGNIZED_COMMAND
;
827 FIXME("Unknown command %08X\n", lpParms
->dwItem
);
828 return MCIERR_UNRECOGNIZED_COMMAND
;
831 if (dwFlags
& MCI_NOTIFY
)
832 MCIQTZ_mciNotify(lpParms
->dwCallback
, wma
, MCI_NOTIFY_SUCCESSFUL
);
837 /***************************************************************************
838 * MCIQTZ_mciWhere [internal]
840 static DWORD
MCIQTZ_mciWhere(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_RECT_PARMS lpParms
)
846 DWORD ret
= MCIERR_UNRECOGNIZED_COMMAND
;
848 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
851 return MCIERR_NULL_PARAMETER_BLOCK
;
853 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
855 return MCIERR_INVALID_DEVICE_ID
;
857 hr
= IVideoWindow_get_Owner(wma
->vidwin
, (OAHWND
*)&hWnd
);
859 TRACE("No video stream, returning no window error\n");
860 return MCIERR_NO_WINDOW
;
863 if (dwFlags
& MCI_DGV_WHERE_SOURCE
) {
864 if (dwFlags
& MCI_DGV_WHERE_MAX
)
865 FIXME("MCI_DGV_WHERE_SOURCE_MAX stub\n");
866 IBasicVideo_GetSourcePosition(wma
->vidbasic
, &rc
.left
, &rc
.top
, &rc
.right
, &rc
.bottom
);
867 TRACE("MCI_DGV_WHERE_SOURCE %s\n", wine_dbgstr_rect(&rc
));
869 if (dwFlags
& MCI_DGV_WHERE_DESTINATION
) {
870 if (dwFlags
& MCI_DGV_WHERE_MAX
)
871 FIXME("MCI_DGV_WHERE_DESTINATION_MAX stub\n");
872 IBasicVideo_GetDestinationPosition(wma
->vidbasic
, &rc
.left
, &rc
.top
, &rc
.right
, &rc
.bottom
);
873 TRACE("MCI_DGV_WHERE_DESTINATION %s\n", wine_dbgstr_rect(&rc
));
875 if (dwFlags
& MCI_DGV_WHERE_FRAME
) {
876 if (dwFlags
& MCI_DGV_WHERE_MAX
)
877 FIXME("MCI_DGV_WHERE_FRAME_MAX not supported yet\n");
879 FIXME("MCI_DGV_WHERE_FRAME not supported yet\n");
882 if (dwFlags
& MCI_DGV_WHERE_VIDEO
) {
883 if (dwFlags
& MCI_DGV_WHERE_MAX
)
884 FIXME("MCI_DGV_WHERE_VIDEO_MAX not supported yet\n");
886 FIXME("MCI_DGV_WHERE_VIDEO not supported yet\n");
889 if (dwFlags
& MCI_DGV_WHERE_WINDOW
) {
890 if (dwFlags
& MCI_DGV_WHERE_MAX
) {
891 GetWindowRect(GetDesktopWindow(), &rc
);
894 TRACE("MCI_DGV_WHERE_WINDOW_MAX %s\n", wine_dbgstr_rect(&rc
));
896 IVideoWindow_GetWindowPosition(wma
->vidwin
, &rc
.left
, &rc
.top
, &rc
.right
, &rc
.bottom
);
897 TRACE("MCI_DGV_WHERE_WINDOW %s\n", wine_dbgstr_rect(&rc
));
906 /***************************************************************************
907 * MCIQTZ_mciWindow [internal]
909 static DWORD
MCIQTZ_mciWindow(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_WINDOW_PARMSW lpParms
)
911 WINE_MCIQTZ
*wma
= MCIQTZ_mciGetOpenDev(wDevID
);
913 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
916 return MCIERR_NULL_PARAMETER_BLOCK
;
919 return MCIERR_INVALID_DEVICE_ID
;
920 if (dwFlags
& MCI_TEST
)
923 if (dwFlags
& MCI_DGV_WINDOW_HWND
&& (IsWindow(lpParms
->hWnd
) || !lpParms
->hWnd
)) {
924 LONG visible
= OATRUE
;
926 TRACE("Setting hWnd to %p\n", lpParms
->hWnd
);
927 IVideoWindow_get_Visible(wma
->vidwin
, &visible
);
928 IVideoWindow_put_Visible(wma
->vidwin
, OAFALSE
);
929 IVideoWindow_get_WindowStyle(wma
->vidwin
, &style
);
932 IVideoWindow_put_WindowStyle(wma
->vidwin
, style
|WS_CHILD
);
934 IVideoWindow_put_WindowStyle(wma
->vidwin
, style
);
935 IVideoWindow_put_Owner(wma
->vidwin
, (OAHWND
)lpParms
->hWnd
);
936 IVideoWindow_put_MessageDrain(wma
->vidwin
, (OAHWND
)lpParms
->hWnd
);
937 IVideoWindow_put_Visible(wma
->vidwin
, visible
);
938 wma
->parent
= lpParms
->hWnd
;
940 if (dwFlags
& MCI_DGV_WINDOW_STATE
) {
941 TRACE("Setting nCmdShow to %d\n", lpParms
->nCmdShow
);
942 IVideoWindow_put_WindowState(wma
->vidwin
, lpParms
->nCmdShow
);
944 if (dwFlags
& MCI_DGV_WINDOW_TEXT
) {
945 TRACE("Setting caption to %s\n", debugstr_w(lpParms
->lpstrText
));
946 IVideoWindow_put_Caption(wma
->vidwin
, lpParms
->lpstrText
);
951 /***************************************************************************
952 * MCIQTZ_mciPut [internal]
954 static DWORD
MCIQTZ_mciPut(UINT wDevID
, DWORD dwFlags
, MCI_GENERIC_PARMS
*lpParms
)
956 WINE_MCIQTZ
*wma
= MCIQTZ_mciGetOpenDev(wDevID
);
957 MCI_DGV_RECT_PARMS
*rectparms
;
960 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
963 return MCIERR_NULL_PARAMETER_BLOCK
;
966 return MCIERR_INVALID_DEVICE_ID
;
968 if (!(dwFlags
& MCI_DGV_RECT
)) {
969 FIXME("No support for non-RECT MCI_PUT\n");
973 if (dwFlags
& MCI_TEST
)
976 dwFlags
&= ~MCI_DGV_RECT
;
977 rectparms
= (MCI_DGV_RECT_PARMS
*)lpParms
;
979 if (dwFlags
& MCI_DGV_PUT_DESTINATION
) {
980 hr
= IVideoWindow_SetWindowPosition(wma
->vidwin
,
981 rectparms
->rc
.left
, rectparms
->rc
.top
,
982 rectparms
->rc
.right
- rectparms
->rc
.left
,
983 rectparms
->rc
.bottom
- rectparms
->rc
.top
);
985 WARN("IVideoWindow_SetWindowPosition failed: 0x%x\n", hr
);
987 dwFlags
&= ~MCI_DGV_PUT_DESTINATION
;
990 if (dwFlags
& MCI_NOTIFY
) {
991 MCIQTZ_mciNotify(lpParms
->dwCallback
, wma
, MCI_NOTIFY_SUCCESSFUL
);
992 dwFlags
&= ~MCI_NOTIFY
;
996 FIXME("No support for some flags: 0x%x\n", dwFlags
);
1001 /******************************************************************************
1002 * MCIAVI_mciUpdate [internal]
1004 static DWORD
MCIQTZ_mciUpdate(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_UPDATE_PARMS lpParms
)
1009 TRACE("%04x, %08x, %p\n", wDevID
, dwFlags
, lpParms
);
1012 return MCIERR_NULL_PARAMETER_BLOCK
;
1014 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
1016 return MCIERR_INVALID_DEVICE_ID
;
1018 if (dwFlags
& MCI_DGV_UPDATE_HDC
) {
1024 LONG visible
= OATRUE
;
1026 res
= MCIERR_INTERNAL
;
1027 IMediaControl_GetState(wma
->pmctrl
, -1, &state
);
1028 if (state
== State_Running
)
1029 return MCIERR_UNSUPPORTED_FUNCTION
;
1030 /* If in stopped state, nothing has been drawn to screen
1031 * moving to pause, which is needed for the old dib renderer, will result
1032 * in a single frame drawn, so hide the window here */
1033 IVideoWindow_get_Visible(wma
->vidwin
, &visible
);
1035 IVideoWindow_put_Visible(wma
->vidwin
, OAFALSE
);
1036 /* FIXME: Should we check the original state and restore it? */
1037 IMediaControl_Pause(wma
->pmctrl
);
1038 IMediaControl_GetState(wma
->pmctrl
, -1, &state
);
1039 if (FAILED(hr
= IBasicVideo_GetCurrentImage(wma
->vidbasic
, &size
, NULL
))) {
1040 WARN("Could not get image size (hr = %x)\n", hr
);
1043 data
= HeapAlloc(GetProcessHeap(), 0, size
);
1044 info
= (BITMAPINFO
*)data
;
1045 IBasicVideo_GetCurrentImage(wma
->vidbasic
, &size
, (LONG
*)data
);
1046 data
+= info
->bmiHeader
.biSize
;
1048 IBasicVideo_GetSourcePosition(wma
->vidbasic
, &src
.left
, &src
.top
, &src
.right
, &src
.bottom
);
1049 IBasicVideo_GetDestinationPosition(wma
->vidbasic
, &dest
.left
, &dest
.top
, &dest
.right
, &dest
.bottom
);
1050 StretchDIBits(lpParms
->hDC
,
1051 dest
.left
, dest
.top
, dest
.right
+ dest
.left
, dest
.bottom
+ dest
.top
,
1052 src
.left
, src
.top
, src
.right
+ src
.left
, src
.bottom
+ src
.top
,
1053 data
, info
, DIB_RGB_COLORS
, SRCCOPY
);
1054 HeapFree(GetProcessHeap(), 0, data
);
1058 IVideoWindow_put_Visible(wma
->vidwin
, visible
);
1061 FIXME("Unhandled flags %x\n", dwFlags
);
1065 /***************************************************************************
1066 * MCIQTZ_mciSetAudio [internal]
1068 static DWORD
MCIQTZ_mciSetAudio(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_SETAUDIO_PARMSW lpParms
)
1073 TRACE("(%04x, %08x, %p)\n", wDevID
, dwFlags
, lpParms
);
1076 return MCIERR_NULL_PARAMETER_BLOCK
;
1078 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
1080 return MCIERR_INVALID_DEVICE_ID
;
1082 if (!(dwFlags
& MCI_DGV_SETAUDIO_ITEM
)) {
1083 FIXME("Unknown flags (%08x)\n", dwFlags
);
1087 if (dwFlags
& MCI_DGV_SETAUDIO_ITEM
) {
1088 switch (lpParms
->dwItem
) {
1089 case MCI_DGV_SETAUDIO_VOLUME
:
1090 if (dwFlags
& MCI_DGV_SETAUDIO_VALUE
) {
1093 if (lpParms
->dwValue
> 1000) {
1094 ret
= MCIERR_OUTOFRANGE
;
1097 if (dwFlags
& MCI_TEST
)
1099 if (lpParms
->dwValue
!= 0)
1100 vol
= (long)(2000.0 * (log10(lpParms
->dwValue
) - 3.0));
1103 TRACE("Setting volume to %ld\n", vol
);
1104 hr
= IBasicAudio_put_Volume(wma
->audio
, vol
);
1106 WARN("Cannot set volume (hr = %x)\n", hr
);
1107 ret
= MCIERR_INTERNAL
;
1112 FIXME("Unknown item %08x\n", lpParms
->dwItem
);
1120 /*======================================================================*
1121 * MCI QTZ entry points *
1122 *======================================================================*/
1124 /**************************************************************************
1125 * DriverProc (MCIQTZ.@)
1127 LRESULT CALLBACK
MCIQTZ_DriverProc(DWORD_PTR dwDevID
, HDRVR hDriv
, UINT wMsg
,
1128 LPARAM dwParam1
, LPARAM dwParam2
)
1130 TRACE("(%08lX, %p, %08X, %08lX, %08lX)\n",
1131 dwDevID
, hDriv
, wMsg
, dwParam1
, dwParam2
);
1134 case DRV_LOAD
: return 1;
1135 case DRV_FREE
: return 1;
1136 case DRV_OPEN
: return MCIQTZ_drvOpen((LPCWSTR
)dwParam1
, (LPMCI_OPEN_DRIVER_PARMSW
)dwParam2
);
1137 case DRV_CLOSE
: return MCIQTZ_drvClose(dwDevID
);
1138 case DRV_ENABLE
: return 1;
1139 case DRV_DISABLE
: return 1;
1140 case DRV_QUERYCONFIGURE
: return 1;
1141 case DRV_CONFIGURE
: return MCIQTZ_drvConfigure(dwDevID
);
1142 case DRV_INSTALL
: return DRVCNF_RESTART
;
1143 case DRV_REMOVE
: return DRVCNF_RESTART
;
1146 /* session instance */
1147 if (dwDevID
== 0xFFFFFFFF)
1151 case MCI_OPEN_DRIVER
: return MCIQTZ_mciOpen (dwDevID
, dwParam1
, (LPMCI_DGV_OPEN_PARMSW
) dwParam2
);
1152 case MCI_CLOSE_DRIVER
: return MCIQTZ_mciClose (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1153 case MCI_PLAY
: return MCIQTZ_mciPlay (dwDevID
, dwParam1
, (LPMCI_PLAY_PARMS
) dwParam2
);
1154 case MCI_SEEK
: return MCIQTZ_mciSeek (dwDevID
, dwParam1
, (LPMCI_SEEK_PARMS
) dwParam2
);
1155 case MCI_STOP
: return MCIQTZ_mciStop (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1156 case MCI_PAUSE
: return MCIQTZ_mciPause (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1157 case MCI_RESUME
: return MCIQTZ_mciResume (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1158 case MCI_GETDEVCAPS
: return MCIQTZ_mciGetDevCaps(dwDevID
, dwParam1
, (LPMCI_GETDEVCAPS_PARMS
) dwParam2
);
1159 case MCI_SET
: return MCIQTZ_mciSet (dwDevID
, dwParam1
, (LPMCI_DGV_SET_PARMS
) dwParam2
);
1160 case MCI_STATUS
: return MCIQTZ_mciStatus (dwDevID
, dwParam1
, (LPMCI_DGV_STATUS_PARMSW
) dwParam2
);
1161 case MCI_WHERE
: return MCIQTZ_mciWhere (dwDevID
, dwParam1
, (LPMCI_DGV_RECT_PARMS
) dwParam2
);
1162 /* Digital Video specific */
1163 case MCI_SETAUDIO
: return MCIQTZ_mciSetAudio (dwDevID
, dwParam1
, (LPMCI_DGV_SETAUDIO_PARMSW
) dwParam2
);
1165 return MCIQTZ_mciUpdate(dwDevID
, dwParam1
, (LPMCI_DGV_UPDATE_PARMS
)dwParam2
);
1167 return MCIQTZ_mciWindow(dwDevID
, dwParam1
, (LPMCI_DGV_WINDOW_PARMSW
)dwParam2
);
1169 return MCIQTZ_mciPut(dwDevID
, dwParam1
, (MCI_GENERIC_PARMS
*)dwParam2
);
1183 /* Digital Video specific */
1194 FIXME("Unimplemented command [%08X]\n", wMsg
);
1198 WARN("Unsupported command [%08X]\n", wMsg
);
1202 FIXME("Shouldn't receive a MCI_OPEN or CLOSE message\n");
1205 TRACE("Sending msg [%08X] to default driver proc\n", wMsg
);
1206 return DefDriverProc(dwDevID
, hDriv
, wMsg
, dwParam1
, dwParam2
);
1209 return MCIERR_UNRECOGNIZED_COMMAND
;