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
)
78 TRACE("(%s, %p)\n", debugstr_w(str
), modp
);
80 /* session instance */
84 wma
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(WINE_MCIQTZ
));
88 wma
->stop_event
= CreateEventW(NULL
, FALSE
, FALSE
, NULL
);
89 modp
->wType
= MCI_DEVTYPE_DIGITAL_VIDEO
;
90 wma
->wDevID
= modp
->wDeviceID
;
91 modp
->wCustomCommandTable
= wma
->command_table
= mciLoadCommandResource(MCIQTZ_hInstance
, L
"MCIAVI", 0);
92 mciSetDriverData(wma
->wDevID
, (DWORD_PTR
)wma
);
94 return modp
->wDeviceID
;
97 /**************************************************************************
98 * MCIQTZ_drvClose [internal]
100 static DWORD
MCIQTZ_drvClose(DWORD dwDevID
)
104 TRACE("(%04x)\n", dwDevID
);
106 wma
= MCIQTZ_mciGetOpenDev(dwDevID
);
109 /* finish all outstanding things */
110 MCIQTZ_mciClose(dwDevID
, MCI_WAIT
, NULL
);
112 mciFreeCommandResource(wma
->command_table
);
113 mciSetDriverData(dwDevID
, 0);
114 CloseHandle(wma
->stop_event
);
115 HeapFree(GetProcessHeap(), 0, wma
);
119 return (dwDevID
== 0xFFFFFFFF) ? 1 : 0;
122 /**************************************************************************
123 * MCIQTZ_drvConfigure [internal]
125 static DWORD
MCIQTZ_drvConfigure(DWORD dwDevID
)
129 TRACE("(%04x)\n", dwDevID
);
131 wma
= MCIQTZ_mciGetOpenDev(dwDevID
);
135 MCIQTZ_mciStop(dwDevID
, MCI_WAIT
, NULL
);
137 MessageBoxA(0, "Sample QTZ Wine Driver !", "MM-Wine Driver", MB_OK
);
142 /**************************************************************************
143 * MCIQTZ_mciNotify [internal]
145 * Notifications in MCI work like a 1-element queue.
146 * Each new notification request supersedes the previous one.
148 static void MCIQTZ_mciNotify(DWORD_PTR hWndCallBack
, WINE_MCIQTZ
* wma
, UINT wStatus
)
150 MCIDEVICEID wDevID
= wma
->notify_devid
;
151 HANDLE old
= InterlockedExchangePointer(&wma
->callback
, NULL
);
152 if (old
) mciDriverNotify(old
, wDevID
, MCI_NOTIFY_SUPERSEDED
);
153 mciDriverNotify(HWND_32(LOWORD(hWndCallBack
)), wDevID
, wStatus
);
156 /***************************************************************************
157 * MCIQTZ_mciOpen [internal]
159 static DWORD
MCIQTZ_mciOpen(UINT wDevID
, DWORD dwFlags
,
160 LPMCI_DGV_OPEN_PARMSW lpOpenParms
)
165 RECT rc
= { 0, 0, 0, 0 };
167 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpOpenParms
);
170 return MCIERR_NULL_PARAMETER_BLOCK
;
172 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
174 return MCIERR_INVALID_DEVICE_ID
;
176 MCIQTZ_mciStop(wDevID
, MCI_WAIT
, NULL
);
178 hr
= CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
179 wma
->uninit
= SUCCEEDED(hr
);
181 hr
= CoCreateInstance(&CLSID_FilterGraph
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IGraphBuilder
, (LPVOID
*)&wma
->pgraph
);
183 TRACE("Cannot create filtergraph (hr = %x)\n", hr
);
187 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IMediaControl
, (LPVOID
*)&wma
->pmctrl
);
189 TRACE("Cannot get IMediaControl interface (hr = %x)\n", hr
);
193 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IMediaSeeking
, (void**)&wma
->seek
);
195 TRACE("Cannot get IMediaSeeking interface (hr = %x)\n", hr
);
199 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IMediaEvent
, (void**)&wma
->mevent
);
201 TRACE("Cannot get IMediaEvent interface (hr = %x)\n", hr
);
205 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IVideoWindow
, (void**)&wma
->vidwin
);
207 TRACE("Cannot get IVideoWindow interface (hr = %x)\n", hr
);
211 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IBasicVideo
, (void**)&wma
->vidbasic
);
213 TRACE("Cannot get IBasicVideo interface (hr = %x)\n", hr
);
217 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IBasicAudio
, (void**)&wma
->audio
);
219 TRACE("Cannot get IBasicAudio interface (hr = %x)\n", hr
);
223 if (!(dwFlags
& MCI_OPEN_ELEMENT
) || (dwFlags
& MCI_OPEN_ELEMENT_ID
)) {
224 TRACE("Wrong dwFlags %x\n", dwFlags
);
228 if (!lpOpenParms
->lpstrElementName
|| !lpOpenParms
->lpstrElementName
[0]) {
229 TRACE("Invalid filename specified\n");
233 TRACE("Open file %s\n", debugstr_w(lpOpenParms
->lpstrElementName
));
235 hr
= IGraphBuilder_RenderFile(wma
->pgraph
, lpOpenParms
->lpstrElementName
, NULL
);
237 TRACE("Cannot render file (hr = %x)\n", hr
);
241 IVideoWindow_put_AutoShow(wma
->vidwin
, OAFALSE
);
242 IVideoWindow_put_Visible(wma
->vidwin
, OAFALSE
);
243 if (dwFlags
& MCI_DGV_OPEN_WS
)
244 style
= lpOpenParms
->dwStyle
;
245 if (dwFlags
& MCI_DGV_OPEN_PARENT
) {
246 IVideoWindow_put_MessageDrain(wma
->vidwin
, (OAHWND
)lpOpenParms
->hWndParent
);
247 IVideoWindow_put_WindowState(wma
->vidwin
, SW_HIDE
);
248 IVideoWindow_put_WindowStyle(wma
->vidwin
, style
|WS_CHILD
);
249 IVideoWindow_put_Owner(wma
->vidwin
, (OAHWND
)lpOpenParms
->hWndParent
);
250 GetClientRect(lpOpenParms
->hWndParent
, &rc
);
251 IVideoWindow_SetWindowPosition(wma
->vidwin
, rc
.left
, rc
.top
, rc
.right
- rc
.top
, rc
.bottom
- rc
.top
);
252 wma
->parent
= (HWND
)lpOpenParms
->hWndParent
;
255 IVideoWindow_put_WindowStyle(wma
->vidwin
, style
);
256 IBasicVideo_GetVideoSize(wma
->vidbasic
, &rc
.right
, &rc
.bottom
);
259 if (dwFlags
& MCI_NOTIFY
)
260 mciDriverNotify(HWND_32(LOWORD(lpOpenParms
->dwCallback
)), wDevID
, MCI_NOTIFY_SUCCESSFUL
);
266 IBasicAudio_Release(wma
->audio
);
269 IBasicVideo_Release(wma
->vidbasic
);
270 wma
->vidbasic
= NULL
;
272 IMediaSeeking_Release(wma
->seek
);
275 IVideoWindow_Release(wma
->vidwin
);
278 IGraphBuilder_Release(wma
->pgraph
);
281 IMediaEvent_Release(wma
->mevent
);
284 IMediaControl_Release(wma
->pmctrl
);
291 return MCIERR_INTERNAL
;
294 /***************************************************************************
295 * MCIQTZ_mciClose [internal]
297 static DWORD
MCIQTZ_mciClose(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
301 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
303 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
305 return MCIERR_INVALID_DEVICE_ID
;
307 MCIQTZ_mciStop(wDevID
, MCI_WAIT
, NULL
);
310 IVideoWindow_Release(wma
->vidwin
);
311 IBasicVideo_Release(wma
->vidbasic
);
312 IBasicAudio_Release(wma
->audio
);
313 IMediaSeeking_Release(wma
->seek
);
314 IMediaEvent_Release(wma
->mevent
);
315 IGraphBuilder_Release(wma
->pgraph
);
316 IMediaControl_Release(wma
->pmctrl
);
325 /***************************************************************************
326 * MCIQTZ_notifyThread [internal]
328 static DWORD CALLBACK
MCIQTZ_notifyThread(LPVOID parm
)
330 WINE_MCIQTZ
* wma
= (WINE_MCIQTZ
*)parm
;
333 DWORD n
= 0, ret
= 0;
335 handle
[n
++] = wma
->stop_event
;
336 IMediaEvent_GetEventHandle(wma
->mevent
, (OAEVENT
*)&handle
[n
++]);
342 r
= WaitForMultipleObjects(n
, handle
, FALSE
, INFINITE
);
343 if (r
== WAIT_OBJECT_0
) {
344 TRACE("got stop event\n");
345 old
= InterlockedExchangePointer(&wma
->callback
, NULL
);
347 mciDriverNotify(old
, wma
->notify_devid
, MCI_NOTIFY_ABORTED
);
350 else if (r
== WAIT_OBJECT_0
+1) {
354 hr
= IMediaEvent_GetEvent(wma
->mevent
, &event_code
, &p1
, &p2
, 0);
356 TRACE("got event_code = 0x%02x\n", event_code
);
357 IMediaEvent_FreeEventParams(wma
->mevent
, event_code
, p1
, p2
);
359 } while (hr
== S_OK
&& event_code
!= EC_COMPLETE
);
360 if (hr
== S_OK
&& event_code
== EC_COMPLETE
) {
361 /* Repeat the music by seeking and running again */
362 if (wma
->mci_flags
& MCI_DGV_PLAY_REPEAT
) {
363 TRACE("repeat media as requested\n");
364 IMediaControl_Stop(wma
->pmctrl
);
365 IMediaSeeking_SetPositions(wma
->seek
,
367 AM_SEEKING_AbsolutePositioning
,
369 AM_SEEKING_AbsolutePositioning
);
370 IMediaControl_Run(wma
->pmctrl
);
373 old
= InterlockedExchangePointer(&wma
->callback
, NULL
);
375 mciDriverNotify(old
, wma
->notify_devid
, MCI_NOTIFY_SUCCESSFUL
);
380 TRACE("Unknown error (%d)\n", (int)r
);
385 hr
= IMediaControl_Stop(wma
->pmctrl
);
387 TRACE("Cannot stop filtergraph (hr = %x)\n", hr
);
388 ret
= MCIERR_INTERNAL
;
394 /***************************************************************************
395 * MCIQTZ_mciPlay [internal]
397 static DWORD
MCIQTZ_mciPlay(UINT wDevID
, DWORD dwFlags
, LPMCI_PLAY_PARMS lpParms
)
404 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
407 return MCIERR_NULL_PARAMETER_BLOCK
;
409 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
411 return MCIERR_INVALID_DEVICE_ID
;
413 ResetEvent(wma
->stop_event
);
414 if (dwFlags
& MCI_NOTIFY
) {
416 old
= InterlockedExchangePointer(&wma
->callback
, HWND_32(LOWORD(lpParms
->dwCallback
)));
418 mciDriverNotify(old
, wma
->notify_devid
, MCI_NOTIFY_ABORTED
);
421 wma
->mci_flags
= dwFlags
;
422 IMediaSeeking_GetTimeFormat(wma
->seek
, &format
);
423 if (dwFlags
& MCI_FROM
) {
424 wma
->seek_start
= lpParms
->dwFrom
;
425 if (IsEqualGUID(&format
, &TIME_FORMAT_MEDIA_TIME
))
426 wma
->seek_start
*= 10000;
428 start_flags
= AM_SEEKING_AbsolutePositioning
;
431 start_flags
= AM_SEEKING_NoPositioning
;
433 if (dwFlags
& MCI_TO
) {
434 wma
->seek_stop
= lpParms
->dwTo
;
435 if (IsEqualGUID(&format
, &TIME_FORMAT_MEDIA_TIME
))
436 wma
->seek_stop
*= 10000;
439 IMediaSeeking_GetDuration(wma
->seek
, &wma
->seek_stop
);
441 IMediaSeeking_SetPositions(wma
->seek
, &wma
->seek_start
, start_flags
,
442 &wma
->seek_stop
, AM_SEEKING_AbsolutePositioning
);
444 hr
= IMediaControl_Run(wma
->pmctrl
);
446 TRACE("Cannot run filtergraph (hr = %x)\n", hr
);
447 return MCIERR_INTERNAL
;
450 IVideoWindow_put_Visible(wma
->vidwin
, OATRUE
);
452 wma
->thread
= CreateThread(NULL
, 0, MCIQTZ_notifyThread
, wma
, 0, NULL
);
454 TRACE("Can't create thread\n");
455 return MCIERR_INTERNAL
;
460 /***************************************************************************
461 * MCIQTZ_mciSeek [internal]
463 static DWORD
MCIQTZ_mciSeek(UINT wDevID
, DWORD dwFlags
, LPMCI_SEEK_PARMS lpParms
)
469 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
472 return MCIERR_NULL_PARAMETER_BLOCK
;
474 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
476 return MCIERR_INVALID_DEVICE_ID
;
478 MCIQTZ_mciStop(wDevID
, MCI_WAIT
, NULL
);
480 if (dwFlags
& MCI_SEEK_TO_START
) {
482 } else if (dwFlags
& MCI_SEEK_TO_END
) {
483 FIXME("MCI_SEEK_TO_END not implemented yet\n");
484 return MCIERR_INTERNAL
;
485 } else if (dwFlags
& MCI_TO
) {
486 FIXME("MCI_TO not implemented yet\n");
487 return MCIERR_INTERNAL
;
489 WARN("dwFlag doesn't tell where to seek to...\n");
490 return MCIERR_MISSING_PARAMETER
;
493 hr
= IMediaSeeking_SetPositions(wma
->seek
, &newpos
, AM_SEEKING_AbsolutePositioning
, NULL
, AM_SEEKING_NoPositioning
);
495 FIXME("Cannot set position (hr = %x)\n", hr
);
496 return MCIERR_INTERNAL
;
499 if (dwFlags
& MCI_NOTIFY
)
500 MCIQTZ_mciNotify(lpParms
->dwCallback
, wma
, MCI_NOTIFY_SUCCESSFUL
);
505 /***************************************************************************
506 * MCIQTZ_mciStop [internal]
508 static DWORD
MCIQTZ_mciStop(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
512 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
514 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
516 return MCIERR_INVALID_DEVICE_ID
;
522 SetEvent(wma
->stop_event
);
523 WaitForSingleObject(wma
->thread
, INFINITE
);
524 CloseHandle(wma
->thread
);
529 IVideoWindow_put_Visible(wma
->vidwin
, OAFALSE
);
534 /***************************************************************************
535 * MCIQTZ_mciPause [internal]
537 static DWORD
MCIQTZ_mciPause(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
542 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
544 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
546 return MCIERR_INVALID_DEVICE_ID
;
548 hr
= IMediaControl_Pause(wma
->pmctrl
);
550 TRACE("Cannot pause filtergraph (hr = %x)\n", hr
);
551 return MCIERR_INTERNAL
;
557 /***************************************************************************
558 * MCIQTZ_mciResume [internal]
560 static DWORD
MCIQTZ_mciResume(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
565 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
567 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
569 return MCIERR_INVALID_DEVICE_ID
;
571 hr
= IMediaControl_Run(wma
->pmctrl
);
573 TRACE("Cannot run filtergraph (hr = %x)\n", hr
);
574 return MCIERR_INTERNAL
;
580 /***************************************************************************
581 * MCIQTZ_mciGetDevCaps [internal]
583 static DWORD
MCIQTZ_mciGetDevCaps(UINT wDevID
, DWORD dwFlags
, LPMCI_GETDEVCAPS_PARMS lpParms
)
587 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
590 return MCIERR_NULL_PARAMETER_BLOCK
;
592 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
594 return MCIERR_INVALID_DEVICE_ID
;
596 if (!(dwFlags
& MCI_GETDEVCAPS_ITEM
))
597 return MCIERR_MISSING_PARAMETER
;
599 switch (lpParms
->dwItem
) {
600 case MCI_GETDEVCAPS_CAN_RECORD
:
601 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
602 TRACE("MCI_GETDEVCAPS_CAN_RECORD = %08x\n", lpParms
->dwReturn
);
604 case MCI_GETDEVCAPS_HAS_AUDIO
:
605 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
606 TRACE("MCI_GETDEVCAPS_HAS_AUDIO = %08x\n", lpParms
->dwReturn
);
608 case MCI_GETDEVCAPS_HAS_VIDEO
:
609 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
610 TRACE("MCI_GETDEVCAPS_HAS_VIDEO = %08x\n", lpParms
->dwReturn
);
612 case MCI_GETDEVCAPS_DEVICE_TYPE
:
613 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_DEVTYPE_DIGITAL_VIDEO
, MCI_DEVTYPE_DIGITAL_VIDEO
);
614 TRACE("MCI_GETDEVCAPS_DEVICE_TYPE = %08x\n", lpParms
->dwReturn
);
616 case MCI_GETDEVCAPS_USES_FILES
:
617 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
618 TRACE("MCI_GETDEVCAPS_USES_FILES = %08x\n", lpParms
->dwReturn
);
620 case MCI_GETDEVCAPS_COMPOUND_DEVICE
:
621 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
622 TRACE("MCI_GETDEVCAPS_COMPOUND_DEVICE = %08x\n", lpParms
->dwReturn
);
624 case MCI_GETDEVCAPS_CAN_EJECT
:
625 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
626 TRACE("MCI_GETDEVCAPS_EJECT = %08x\n", lpParms
->dwReturn
);
628 case MCI_GETDEVCAPS_CAN_PLAY
:
629 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
630 TRACE("MCI_GETDEVCAPS_CAN_PLAY = %08x\n", lpParms
->dwReturn
);
632 case MCI_GETDEVCAPS_CAN_SAVE
:
633 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
634 TRACE("MCI_GETDEVCAPS_CAN_SAVE = %08x\n", lpParms
->dwReturn
);
636 case MCI_DGV_GETDEVCAPS_CAN_REVERSE
:
637 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
638 TRACE("MCI_DGV_GETDEVCAPS_CAN_REVERSE = %08x\n", lpParms
->dwReturn
);
640 case MCI_DGV_GETDEVCAPS_CAN_STRETCH
:
641 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
); /* FIXME */
642 TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH = %08x\n", lpParms
->dwReturn
);
644 case MCI_DGV_GETDEVCAPS_CAN_LOCK
:
645 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
646 TRACE("MCI_DGV_GETDEVCAPS_CAN_LOCK = %08x\n", lpParms
->dwReturn
);
648 case MCI_DGV_GETDEVCAPS_CAN_FREEZE
:
649 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
650 TRACE("MCI_DGV_GETDEVCAPS_CAN_FREEZE = %08x\n", lpParms
->dwReturn
);
652 case MCI_DGV_GETDEVCAPS_CAN_STR_IN
:
653 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
654 TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH_INPUT = %08x\n", lpParms
->dwReturn
);
656 case MCI_DGV_GETDEVCAPS_HAS_STILL
:
657 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
658 TRACE("MCI_DGV_GETDEVCAPS_HAS_STILL = %08x\n", lpParms
->dwReturn
);
660 case MCI_DGV_GETDEVCAPS_CAN_TEST
:
661 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
); /* FIXME */
662 TRACE("MCI_DGV_GETDEVCAPS_CAN_TEST = %08x\n", lpParms
->dwReturn
);
664 case MCI_DGV_GETDEVCAPS_MAX_WINDOWS
:
665 lpParms
->dwReturn
= 1;
666 TRACE("MCI_DGV_GETDEVCAPS_MAX_WINDOWS = %u\n", lpParms
->dwReturn
);
669 WARN("Unknown capability %08x\n", lpParms
->dwItem
);
671 case MCI_DGV_GETDEVCAPS_MAXIMUM_RATE
: /* unknown to w2k */
672 case MCI_DGV_GETDEVCAPS_MINIMUM_RATE
: /* unknown to w2k */
673 return MCIERR_UNSUPPORTED_FUNCTION
;
676 return MCI_RESOURCE_RETURNED
;
679 /***************************************************************************
680 * MCIQTZ_mciSet [internal]
682 static DWORD
MCIQTZ_mciSet(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_SET_PARMS lpParms
)
686 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
689 return MCIERR_NULL_PARAMETER_BLOCK
;
691 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
693 return MCIERR_INVALID_DEVICE_ID
;
695 if (dwFlags
& MCI_SET_TIME_FORMAT
) {
696 switch (lpParms
->dwTimeFormat
) {
697 case MCI_FORMAT_MILLISECONDS
:
698 TRACE("MCI_SET_TIME_FORMAT = MCI_FORMAT_MILLISECONDS\n");
699 wma
->time_format
= MCI_FORMAT_MILLISECONDS
;
701 case MCI_FORMAT_FRAMES
:
702 TRACE("MCI_SET_TIME_FORMAT = MCI_FORMAT_FRAMES\n");
703 wma
->time_format
= MCI_FORMAT_FRAMES
;
706 WARN("Bad time format %u\n", lpParms
->dwTimeFormat
);
707 return MCIERR_BAD_TIME_FORMAT
;
711 if (dwFlags
& MCI_SET_DOOR_OPEN
)
712 FIXME("MCI_SET_DOOR_OPEN not implemented yet\n");
713 if (dwFlags
& MCI_SET_DOOR_CLOSED
)
714 FIXME("MCI_SET_DOOR_CLOSED not implemented yet\n");
715 if (dwFlags
& MCI_SET_AUDIO
)
716 FIXME("MCI_SET_AUDIO not implemented yet\n");
717 if (dwFlags
& MCI_SET_VIDEO
)
718 FIXME("MCI_SET_VIDEO not implemented yet\n");
719 if (dwFlags
& MCI_SET_ON
)
720 FIXME("MCI_SET_ON not implemented yet\n");
721 if (dwFlags
& MCI_SET_OFF
)
722 FIXME("MCI_SET_OFF not implemented yet\n");
723 if (dwFlags
& MCI_SET_AUDIO_LEFT
)
724 FIXME("MCI_SET_AUDIO_LEFT not implemented yet\n");
725 if (dwFlags
& MCI_SET_AUDIO_RIGHT
)
726 FIXME("MCI_SET_AUDIO_RIGHT not implemented yet\n");
728 if (dwFlags
& ~0x7f03 /* All MCI_SET flags mask */)
729 ERR("Unknown flags %08x\n", dwFlags
& ~0x7f03);
734 /***************************************************************************
735 * MCIQTZ_mciStatus [internal]
737 static DWORD
MCIQTZ_mciStatus(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_STATUS_PARMSW lpParms
)
741 DWORD ret
= MCI_INTEGER_RETURNED
;
743 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
746 return MCIERR_NULL_PARAMETER_BLOCK
;
748 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
750 return MCIERR_INVALID_DEVICE_ID
;
752 if (!(dwFlags
& MCI_STATUS_ITEM
)) {
753 WARN("No status item specified\n");
754 return MCIERR_UNRECOGNIZED_COMMAND
;
757 switch (lpParms
->dwItem
) {
758 case MCI_STATUS_LENGTH
: {
759 LONGLONG duration
= -1;
761 switch (wma
->time_format
) {
762 case MCI_FORMAT_MILLISECONDS
: format
= TIME_FORMAT_MEDIA_TIME
; break;
763 case MCI_FORMAT_FRAMES
: format
= TIME_FORMAT_FRAME
; break;
764 default: ERR("Unhandled format %x\n", wma
->time_format
); break;
766 hr
= IMediaSeeking_SetTimeFormat(wma
->seek
, &format
);
768 FIXME("Cannot set time format (hr = %x)\n", hr
);
769 lpParms
->dwReturn
= 0;
772 hr
= IMediaSeeking_GetDuration(wma
->seek
, &duration
);
773 if (FAILED(hr
) || duration
< 0) {
774 FIXME("Cannot read duration (hr = %x)\n", hr
);
775 lpParms
->dwReturn
= 0;
776 } else if (wma
->time_format
!= MCI_FORMAT_MILLISECONDS
)
777 lpParms
->dwReturn
= duration
;
779 lpParms
->dwReturn
= duration
/ 10000;
782 case MCI_STATUS_POSITION
: {
783 REFERENCE_TIME curpos
;
785 hr
= IMediaSeeking_GetCurrentPosition(wma
->seek
, &curpos
);
787 FIXME("Cannot get position (hr = %x)\n", hr
);
788 return MCIERR_INTERNAL
;
790 lpParms
->dwReturn
= curpos
/ 10000;
793 case MCI_STATUS_NUMBER_OF_TRACKS
:
794 FIXME("MCI_STATUS_NUMBER_OF_TRACKS not implemented yet\n");
795 return MCIERR_UNRECOGNIZED_COMMAND
;
796 case MCI_STATUS_MODE
: {
797 LONG state
= State_Stopped
;
798 IMediaControl_GetState(wma
->pmctrl
, -1, &state
);
799 if (state
== State_Stopped
)
800 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_STOP
, MCI_MODE_STOP
);
801 else if (state
== State_Running
) {
802 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_PLAY
, MCI_MODE_PLAY
);
803 if (!wma
->thread
|| WaitForSingleObject(wma
->thread
, 0) == WAIT_OBJECT_0
)
804 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_STOP
, MCI_MODE_STOP
);
805 } else if (state
== State_Paused
)
806 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_PAUSE
, MCI_MODE_PAUSE
);
807 ret
= MCI_RESOURCE_RETURNED
;
810 case MCI_STATUS_MEDIA_PRESENT
:
811 FIXME("MCI_STATUS_MEDIA_PRESENT not implemented yet\n");
812 return MCIERR_UNRECOGNIZED_COMMAND
;
813 case MCI_STATUS_TIME_FORMAT
:
814 lpParms
->dwReturn
= MAKEMCIRESOURCE(wma
->time_format
,
815 MCI_FORMAT_RETURN_BASE
+ wma
->time_format
);
816 ret
= MCI_RESOURCE_RETURNED
;
818 case MCI_STATUS_READY
:
819 FIXME("MCI_STATUS_READY not implemented yet\n");
820 return MCIERR_UNRECOGNIZED_COMMAND
;
821 case MCI_STATUS_CURRENT_TRACK
:
822 FIXME("MCI_STATUS_CURRENT_TRACK not implemented yet\n");
823 return MCIERR_UNRECOGNIZED_COMMAND
;
825 FIXME("Unknown command %08X\n", lpParms
->dwItem
);
826 return MCIERR_UNRECOGNIZED_COMMAND
;
829 if (dwFlags
& MCI_NOTIFY
)
830 MCIQTZ_mciNotify(lpParms
->dwCallback
, wma
, MCI_NOTIFY_SUCCESSFUL
);
835 /***************************************************************************
836 * MCIQTZ_mciWhere [internal]
838 static DWORD
MCIQTZ_mciWhere(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_RECT_PARMS lpParms
)
844 DWORD ret
= MCIERR_UNRECOGNIZED_COMMAND
;
846 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
849 return MCIERR_NULL_PARAMETER_BLOCK
;
851 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
853 return MCIERR_INVALID_DEVICE_ID
;
855 hr
= IVideoWindow_get_Owner(wma
->vidwin
, (OAHWND
*)&hWnd
);
857 TRACE("No video stream, returning no window error\n");
858 return MCIERR_NO_WINDOW
;
861 if (dwFlags
& MCI_DGV_WHERE_SOURCE
) {
862 if (dwFlags
& MCI_DGV_WHERE_MAX
)
863 FIXME("MCI_DGV_WHERE_SOURCE_MAX stub\n");
864 IBasicVideo_GetSourcePosition(wma
->vidbasic
, &rc
.left
, &rc
.top
, &rc
.right
, &rc
.bottom
);
865 TRACE("MCI_DGV_WHERE_SOURCE %s\n", wine_dbgstr_rect(&rc
));
867 if (dwFlags
& MCI_DGV_WHERE_DESTINATION
) {
868 if (dwFlags
& MCI_DGV_WHERE_MAX
)
869 FIXME("MCI_DGV_WHERE_DESTINATION_MAX stub\n");
870 IBasicVideo_GetDestinationPosition(wma
->vidbasic
, &rc
.left
, &rc
.top
, &rc
.right
, &rc
.bottom
);
871 TRACE("MCI_DGV_WHERE_DESTINATION %s\n", wine_dbgstr_rect(&rc
));
873 if (dwFlags
& MCI_DGV_WHERE_FRAME
) {
874 if (dwFlags
& MCI_DGV_WHERE_MAX
)
875 FIXME("MCI_DGV_WHERE_FRAME_MAX not supported yet\n");
877 FIXME("MCI_DGV_WHERE_FRAME not supported yet\n");
880 if (dwFlags
& MCI_DGV_WHERE_VIDEO
) {
881 if (dwFlags
& MCI_DGV_WHERE_MAX
)
882 FIXME("MCI_DGV_WHERE_VIDEO_MAX not supported yet\n");
884 FIXME("MCI_DGV_WHERE_VIDEO not supported yet\n");
887 if (dwFlags
& MCI_DGV_WHERE_WINDOW
) {
888 if (dwFlags
& MCI_DGV_WHERE_MAX
) {
889 GetWindowRect(GetDesktopWindow(), &rc
);
892 TRACE("MCI_DGV_WHERE_WINDOW_MAX %s\n", wine_dbgstr_rect(&rc
));
894 IVideoWindow_GetWindowPosition(wma
->vidwin
, &rc
.left
, &rc
.top
, &rc
.right
, &rc
.bottom
);
895 TRACE("MCI_DGV_WHERE_WINDOW %s\n", wine_dbgstr_rect(&rc
));
904 /***************************************************************************
905 * MCIQTZ_mciWindow [internal]
907 static DWORD
MCIQTZ_mciWindow(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_WINDOW_PARMSW lpParms
)
909 WINE_MCIQTZ
*wma
= MCIQTZ_mciGetOpenDev(wDevID
);
911 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
914 return MCIERR_NULL_PARAMETER_BLOCK
;
917 return MCIERR_INVALID_DEVICE_ID
;
918 if (dwFlags
& MCI_TEST
)
921 if (dwFlags
& MCI_DGV_WINDOW_HWND
&& (IsWindow(lpParms
->hWnd
) || !lpParms
->hWnd
)) {
922 LONG visible
= OATRUE
;
924 TRACE("Setting hWnd to %p\n", lpParms
->hWnd
);
925 IVideoWindow_get_Visible(wma
->vidwin
, &visible
);
926 IVideoWindow_put_Visible(wma
->vidwin
, OAFALSE
);
927 IVideoWindow_get_WindowStyle(wma
->vidwin
, &style
);
930 IVideoWindow_put_WindowStyle(wma
->vidwin
, style
|WS_CHILD
);
932 IVideoWindow_put_WindowStyle(wma
->vidwin
, style
);
933 IVideoWindow_put_Owner(wma
->vidwin
, (OAHWND
)lpParms
->hWnd
);
934 IVideoWindow_put_MessageDrain(wma
->vidwin
, (OAHWND
)lpParms
->hWnd
);
935 IVideoWindow_put_Visible(wma
->vidwin
, visible
);
936 wma
->parent
= lpParms
->hWnd
;
938 if (dwFlags
& MCI_DGV_WINDOW_STATE
) {
939 TRACE("Setting nCmdShow to %d\n", lpParms
->nCmdShow
);
940 IVideoWindow_put_WindowState(wma
->vidwin
, lpParms
->nCmdShow
);
942 if (dwFlags
& MCI_DGV_WINDOW_TEXT
) {
943 TRACE("Setting caption to %s\n", debugstr_w(lpParms
->lpstrText
));
944 IVideoWindow_put_Caption(wma
->vidwin
, lpParms
->lpstrText
);
949 /***************************************************************************
950 * MCIQTZ_mciPut [internal]
952 static DWORD
MCIQTZ_mciPut(UINT wDevID
, DWORD dwFlags
, MCI_GENERIC_PARMS
*lpParms
)
954 WINE_MCIQTZ
*wma
= MCIQTZ_mciGetOpenDev(wDevID
);
955 MCI_DGV_RECT_PARMS
*rectparms
;
958 TRACE("(%04x, %08X, %p)\n", wDevID
, dwFlags
, lpParms
);
961 return MCIERR_NULL_PARAMETER_BLOCK
;
964 return MCIERR_INVALID_DEVICE_ID
;
966 if (!(dwFlags
& MCI_DGV_RECT
)) {
967 FIXME("No support for non-RECT MCI_PUT\n");
971 if (dwFlags
& MCI_TEST
)
974 dwFlags
&= ~MCI_DGV_RECT
;
975 rectparms
= (MCI_DGV_RECT_PARMS
*)lpParms
;
977 if (dwFlags
& MCI_DGV_PUT_DESTINATION
) {
978 hr
= IVideoWindow_SetWindowPosition(wma
->vidwin
,
979 rectparms
->rc
.left
, rectparms
->rc
.top
,
980 rectparms
->rc
.right
- rectparms
->rc
.left
,
981 rectparms
->rc
.bottom
- rectparms
->rc
.top
);
983 WARN("IVideoWindow_SetWindowPosition failed: 0x%x\n", hr
);
985 dwFlags
&= ~MCI_DGV_PUT_DESTINATION
;
988 if (dwFlags
& MCI_NOTIFY
) {
989 MCIQTZ_mciNotify(lpParms
->dwCallback
, wma
, MCI_NOTIFY_SUCCESSFUL
);
990 dwFlags
&= ~MCI_NOTIFY
;
994 FIXME("No support for some flags: 0x%x\n", dwFlags
);
999 /******************************************************************************
1000 * MCIAVI_mciUpdate [internal]
1002 static DWORD
MCIQTZ_mciUpdate(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_UPDATE_PARMS lpParms
)
1007 TRACE("%04x, %08x, %p\n", wDevID
, dwFlags
, lpParms
);
1010 return MCIERR_NULL_PARAMETER_BLOCK
;
1012 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
1014 return MCIERR_INVALID_DEVICE_ID
;
1016 if (dwFlags
& MCI_DGV_UPDATE_HDC
) {
1022 LONG visible
= OATRUE
;
1024 res
= MCIERR_INTERNAL
;
1025 IMediaControl_GetState(wma
->pmctrl
, -1, &state
);
1026 if (state
== State_Running
)
1027 return MCIERR_UNSUPPORTED_FUNCTION
;
1028 /* If in stopped state, nothing has been drawn to screen
1029 * moving to pause, which is needed for the old dib renderer, will result
1030 * in a single frame drawn, so hide the window here */
1031 IVideoWindow_get_Visible(wma
->vidwin
, &visible
);
1033 IVideoWindow_put_Visible(wma
->vidwin
, OAFALSE
);
1034 /* FIXME: Should we check the original state and restore it? */
1035 IMediaControl_Pause(wma
->pmctrl
);
1036 IMediaControl_GetState(wma
->pmctrl
, -1, &state
);
1037 if (FAILED(hr
= IBasicVideo_GetCurrentImage(wma
->vidbasic
, &size
, NULL
))) {
1038 WARN("Could not get image size (hr = %x)\n", hr
);
1041 data
= HeapAlloc(GetProcessHeap(), 0, size
);
1042 info
= (BITMAPINFO
*)data
;
1043 IBasicVideo_GetCurrentImage(wma
->vidbasic
, &size
, (LONG
*)data
);
1044 data
+= info
->bmiHeader
.biSize
;
1046 IBasicVideo_GetSourcePosition(wma
->vidbasic
, &src
.left
, &src
.top
, &src
.right
, &src
.bottom
);
1047 IBasicVideo_GetDestinationPosition(wma
->vidbasic
, &dest
.left
, &dest
.top
, &dest
.right
, &dest
.bottom
);
1048 StretchDIBits(lpParms
->hDC
,
1049 dest
.left
, dest
.top
, dest
.right
+ dest
.left
, dest
.bottom
+ dest
.top
,
1050 src
.left
, src
.top
, src
.right
+ src
.left
, src
.bottom
+ src
.top
,
1051 data
, info
, DIB_RGB_COLORS
, SRCCOPY
);
1052 HeapFree(GetProcessHeap(), 0, data
);
1056 IVideoWindow_put_Visible(wma
->vidwin
, visible
);
1059 FIXME("Unhandled flags %x\n", dwFlags
);
1063 /***************************************************************************
1064 * MCIQTZ_mciSetAudio [internal]
1066 static DWORD
MCIQTZ_mciSetAudio(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_SETAUDIO_PARMSW lpParms
)
1071 TRACE("(%04x, %08x, %p)\n", wDevID
, dwFlags
, lpParms
);
1074 return MCIERR_NULL_PARAMETER_BLOCK
;
1076 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
1078 return MCIERR_INVALID_DEVICE_ID
;
1080 if (!(dwFlags
& MCI_DGV_SETAUDIO_ITEM
)) {
1081 FIXME("Unknown flags (%08x)\n", dwFlags
);
1085 if (dwFlags
& MCI_DGV_SETAUDIO_ITEM
) {
1086 switch (lpParms
->dwItem
) {
1087 case MCI_DGV_SETAUDIO_VOLUME
:
1088 if (dwFlags
& MCI_DGV_SETAUDIO_VALUE
) {
1091 if (lpParms
->dwValue
> 1000) {
1092 ret
= MCIERR_OUTOFRANGE
;
1095 if (dwFlags
& MCI_TEST
)
1097 if (lpParms
->dwValue
!= 0)
1098 vol
= (long)(2000.0 * (log10(lpParms
->dwValue
) - 3.0));
1101 TRACE("Setting volume to %ld\n", vol
);
1102 hr
= IBasicAudio_put_Volume(wma
->audio
, vol
);
1104 WARN("Cannot set volume (hr = %x)\n", hr
);
1105 ret
= MCIERR_INTERNAL
;
1110 FIXME("Unknown item %08x\n", lpParms
->dwItem
);
1118 /*======================================================================*
1119 * MCI QTZ entry points *
1120 *======================================================================*/
1122 /**************************************************************************
1123 * DriverProc (MCIQTZ.@)
1125 LRESULT CALLBACK
MCIQTZ_DriverProc(DWORD_PTR dwDevID
, HDRVR hDriv
, UINT wMsg
,
1126 LPARAM dwParam1
, LPARAM dwParam2
)
1128 TRACE("(%08lX, %p, %08X, %08lX, %08lX)\n",
1129 dwDevID
, hDriv
, wMsg
, dwParam1
, dwParam2
);
1132 case DRV_LOAD
: return 1;
1133 case DRV_FREE
: return 1;
1134 case DRV_OPEN
: return MCIQTZ_drvOpen((LPCWSTR
)dwParam1
, (LPMCI_OPEN_DRIVER_PARMSW
)dwParam2
);
1135 case DRV_CLOSE
: return MCIQTZ_drvClose(dwDevID
);
1136 case DRV_ENABLE
: return 1;
1137 case DRV_DISABLE
: return 1;
1138 case DRV_QUERYCONFIGURE
: return 1;
1139 case DRV_CONFIGURE
: return MCIQTZ_drvConfigure(dwDevID
);
1140 case DRV_INSTALL
: return DRVCNF_RESTART
;
1141 case DRV_REMOVE
: return DRVCNF_RESTART
;
1144 /* session instance */
1145 if (dwDevID
== 0xFFFFFFFF)
1149 case MCI_OPEN_DRIVER
: return MCIQTZ_mciOpen (dwDevID
, dwParam1
, (LPMCI_DGV_OPEN_PARMSW
) dwParam2
);
1150 case MCI_CLOSE_DRIVER
: return MCIQTZ_mciClose (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1151 case MCI_PLAY
: return MCIQTZ_mciPlay (dwDevID
, dwParam1
, (LPMCI_PLAY_PARMS
) dwParam2
);
1152 case MCI_SEEK
: return MCIQTZ_mciSeek (dwDevID
, dwParam1
, (LPMCI_SEEK_PARMS
) dwParam2
);
1153 case MCI_STOP
: return MCIQTZ_mciStop (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1154 case MCI_PAUSE
: return MCIQTZ_mciPause (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1155 case MCI_RESUME
: return MCIQTZ_mciResume (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1156 case MCI_GETDEVCAPS
: return MCIQTZ_mciGetDevCaps(dwDevID
, dwParam1
, (LPMCI_GETDEVCAPS_PARMS
) dwParam2
);
1157 case MCI_SET
: return MCIQTZ_mciSet (dwDevID
, dwParam1
, (LPMCI_DGV_SET_PARMS
) dwParam2
);
1158 case MCI_STATUS
: return MCIQTZ_mciStatus (dwDevID
, dwParam1
, (LPMCI_DGV_STATUS_PARMSW
) dwParam2
);
1159 case MCI_WHERE
: return MCIQTZ_mciWhere (dwDevID
, dwParam1
, (LPMCI_DGV_RECT_PARMS
) dwParam2
);
1160 /* Digital Video specific */
1161 case MCI_SETAUDIO
: return MCIQTZ_mciSetAudio (dwDevID
, dwParam1
, (LPMCI_DGV_SETAUDIO_PARMSW
) dwParam2
);
1163 return MCIQTZ_mciUpdate(dwDevID
, dwParam1
, (LPMCI_DGV_UPDATE_PARMS
)dwParam2
);
1165 return MCIQTZ_mciWindow(dwDevID
, dwParam1
, (LPMCI_DGV_WINDOW_PARMSW
)dwParam2
);
1167 return MCIQTZ_mciPut(dwDevID
, dwParam1
, (MCI_GENERIC_PARMS
*)dwParam2
);
1181 /* Digital Video specific */
1192 FIXME("Unimplemented command [%08X]\n", wMsg
);
1196 WARN("Unsupported command [%08X]\n", wMsg
);
1200 FIXME("Shouldn't receive a MCI_OPEN or CLOSE message\n");
1203 TRACE("Sending msg [%08X] to default driver proc\n", wMsg
);
1204 return DefDriverProc(dwDevID
, hDriv
, wMsg
, dwParam1
, dwParam2
);
1207 return MCIERR_UNRECOGNIZED_COMMAND
;