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
28 #include "wine/debug.h"
29 #include "mciqtz_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(mciqtz
);
35 static const WCHAR mciqtz_class
[] = L
"MCIQTZ_Window";
37 static DWORD
MCIQTZ_mciClose(UINT
, DWORD
, LPMCI_GENERIC_PARMS
);
38 static DWORD
MCIQTZ_mciStop(UINT
, DWORD
, LPMCI_GENERIC_PARMS
);
40 /*======================================================================*
41 * MCI QTZ implementation *
42 *======================================================================*/
44 static HINSTANCE MCIQTZ_hInstance
= 0;
46 /***********************************************************************
49 BOOL WINAPI
DllMain(HINSTANCE hInstDLL
, DWORD fdwReason
, LPVOID fImpLoad
)
52 case DLL_PROCESS_ATTACH
:
53 DisableThreadLibraryCalls(hInstDLL
);
54 MCIQTZ_hInstance
= hInstDLL
;
60 /**************************************************************************
61 * MCIQTZ_mciGetOpenDev [internal]
63 static WINE_MCIQTZ
* MCIQTZ_mciGetOpenDev(UINT wDevID
)
65 WINE_MCIQTZ
* wma
= (WINE_MCIQTZ
*)mciGetDriverData(wDevID
);
68 WARN("Invalid wDevID=%u\n", wDevID
);
74 static void unregister_class(void)
76 UnregisterClassW(mciqtz_class
, MCIQTZ_hInstance
);
79 static bool register_class(void)
81 WNDCLASSW
class = {0};
83 class.lpfnWndProc
= DefWindowProcW
;
84 class.cbWndExtra
= sizeof(MCIDEVICEID
);
85 class.hInstance
= MCIQTZ_hInstance
;
86 class.hCursor
= LoadCursorW(0, (const WCHAR
*)IDC_ARROW
);
87 class.lpszClassName
= mciqtz_class
;
89 return RegisterClassW(&class) || GetLastError() == ERROR_CLASS_ALREADY_EXISTS
;
92 /**************************************************************************
93 * MCIQTZ_drvOpen [internal]
95 static DWORD
MCIQTZ_drvOpen(LPCWSTR str
, LPMCI_OPEN_DRIVER_PARMSW modp
)
99 TRACE("(%s, %p)\n", debugstr_w(str
), modp
);
101 /* session instance */
105 if (!register_class())
108 wma
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(WINE_MCIQTZ
));
112 wma
->stop_event
= CreateEventW(NULL
, FALSE
, FALSE
, NULL
);
113 modp
->wType
= MCI_DEVTYPE_DIGITAL_VIDEO
;
114 wma
->wDevID
= modp
->wDeviceID
;
115 modp
->wCustomCommandTable
= wma
->command_table
= mciLoadCommandResource(MCIQTZ_hInstance
, L
"MCIAVI", 0);
116 mciSetDriverData(wma
->wDevID
, (DWORD_PTR
)wma
);
118 return modp
->wDeviceID
;
121 /**************************************************************************
122 * MCIQTZ_drvClose [internal]
124 static DWORD
MCIQTZ_drvClose(DWORD dwDevID
)
128 TRACE("(%04lx)\n", dwDevID
);
130 wma
= MCIQTZ_mciGetOpenDev(dwDevID
);
133 /* finish all outstanding things */
134 MCIQTZ_mciClose(dwDevID
, MCI_WAIT
, NULL
);
137 mciFreeCommandResource(wma
->command_table
);
138 mciSetDriverData(dwDevID
, 0);
139 CloseHandle(wma
->stop_event
);
140 HeapFree(GetProcessHeap(), 0, wma
);
144 return (dwDevID
== 0xFFFFFFFF) ? 1 : 0;
147 /**************************************************************************
148 * MCIQTZ_drvConfigure [internal]
150 static DWORD
MCIQTZ_drvConfigure(DWORD dwDevID
)
154 TRACE("(%04lx)\n", dwDevID
);
156 wma
= MCIQTZ_mciGetOpenDev(dwDevID
);
160 MCIQTZ_mciStop(dwDevID
, MCI_WAIT
, NULL
);
162 MessageBoxA(0, "Sample QTZ Wine Driver !", "MM-Wine Driver", MB_OK
);
167 static bool create_window(WINE_MCIQTZ
*wma
, DWORD flags
, const MCI_DGV_OPEN_PARMSW
*params
)
169 DWORD style
= (WS_OVERLAPPEDWINDOW
| WS_CLIPCHILDREN
) & ~WS_MAXIMIZEBOX
;
170 LONG width
, height
, min_width
;
175 if (flags
& MCI_DGV_OPEN_PARENT
)
176 parent
= params
->hWndParent
;
177 if (flags
& MCI_DGV_OPEN_WS
)
178 style
= params
->dwStyle
;
180 hr
= IBasicVideo_GetVideoSize(wma
->vidbasic
, &width
, &height
);
181 if (hr
== E_NOINTERFACE
)
182 return true; /* audio file */
185 ERR("Failed to get video size, hr %#lx.\n", hr
);
189 /* Native always assumes an overlapped window
190 * when calculating default video window size. */
191 SetRect(&rc
, 0, 0, width
, height
);
192 AdjustWindowRect(&rc
, WS_OVERLAPPEDWINDOW
, FALSE
);
193 min_width
= GetSystemMetrics(SM_CXMIN
);
194 width
= max(rc
.right
- rc
.left
, min_width
);
195 height
= rc
.bottom
- rc
.top
;
197 wma
->window
= CreateWindowW(mciqtz_class
, params
->lpstrElementName
, style
,
198 CW_USEDEFAULT
, CW_USEDEFAULT
, width
, height
, parent
, NULL
, MCIQTZ_hInstance
, NULL
);
200 TRACE("device %#x, flags %#lx, style %#lx, parent %p, dimensions %ldx%ld, created window %p.\n",
201 wma
->wDevID
, flags
, style
, parent
, width
, height
, wma
->window
);
205 ERR("Failed to create window, error %lu.\n", GetLastError());
209 IVideoWindow_put_AutoShow(wma
->vidwin
, OAFALSE
);
210 IVideoWindow_put_MessageDrain(wma
->vidwin
, (OAHWND
)wma
->window
);
211 IVideoWindow_put_Owner(wma
->vidwin
, (OAHWND
)wma
->window
);
212 IVideoWindow_put_WindowStyle(wma
->vidwin
, WS_CHILD
); /* reset window style */
214 if (style
& (WS_POPUP
| WS_CHILD
))
215 IBasicVideo_GetVideoSize(wma
->vidbasic
, &width
, &height
);
218 GetClientRect(wma
->window
, &rc
);
223 IVideoWindow_SetWindowPosition(wma
->vidwin
, 0, 0, width
, height
);
224 IVideoWindow_put_Visible(wma
->vidwin
, OATRUE
);
225 wma
->parent
= wma
->window
;
230 /**************************************************************************
231 * MCIQTZ_mciNotify [internal]
233 * Notifications in MCI work like a 1-element queue.
234 * Each new notification request supersedes the previous one.
236 static void MCIQTZ_mciNotify(DWORD_PTR hWndCallBack
, WINE_MCIQTZ
* wma
, UINT wStatus
)
238 MCIDEVICEID wDevID
= wma
->notify_devid
;
239 HANDLE old
= InterlockedExchangePointer(&wma
->callback
, NULL
);
240 if (old
) mciDriverNotify(old
, wDevID
, MCI_NOTIFY_SUPERSEDED
);
241 mciDriverNotify(HWND_32(LOWORD(hWndCallBack
)), wDevID
, wStatus
);
244 /***************************************************************************
245 * MCIQTZ_mciOpen [internal]
247 static DWORD
MCIQTZ_mciOpen(UINT wDevID
, DWORD dwFlags
,
248 LPMCI_DGV_OPEN_PARMSW lpOpenParms
)
253 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpOpenParms
);
256 return MCIERR_NULL_PARAMETER_BLOCK
;
258 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
260 return MCIERR_INVALID_DEVICE_ID
;
262 MCIQTZ_mciStop(wDevID
, MCI_WAIT
, NULL
);
264 hr
= CoInitializeEx(NULL
, COINIT_MULTITHREADED
);
265 wma
->uninit
= SUCCEEDED(hr
);
267 hr
= CoCreateInstance(&CLSID_FilterGraph
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IGraphBuilder
, (LPVOID
*)&wma
->pgraph
);
269 TRACE("Cannot create filtergraph (hr = %lx)\n", hr
);
273 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IMediaControl
, (LPVOID
*)&wma
->pmctrl
);
275 TRACE("Cannot get IMediaControl interface (hr = %lx)\n", hr
);
279 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IMediaSeeking
, (void**)&wma
->seek
);
281 TRACE("Cannot get IMediaSeeking interface (hr = %lx)\n", hr
);
285 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IMediaEvent
, (void**)&wma
->mevent
);
287 TRACE("Cannot get IMediaEvent interface (hr = %lx)\n", hr
);
291 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IVideoWindow
, (void**)&wma
->vidwin
);
293 TRACE("Cannot get IVideoWindow interface (hr = %lx)\n", hr
);
297 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IBasicVideo
, (void**)&wma
->vidbasic
);
299 TRACE("Cannot get IBasicVideo interface (hr = %lx)\n", hr
);
303 hr
= IGraphBuilder_QueryInterface(wma
->pgraph
, &IID_IBasicAudio
, (void**)&wma
->audio
);
305 TRACE("Cannot get IBasicAudio interface (hr = %lx)\n", hr
);
309 if (!(dwFlags
& MCI_OPEN_ELEMENT
) || (dwFlags
& MCI_OPEN_ELEMENT_ID
)) {
310 TRACE("Wrong dwFlags %lx\n", dwFlags
);
314 if (!lpOpenParms
->lpstrElementName
|| !lpOpenParms
->lpstrElementName
[0]) {
315 TRACE("Invalid filename specified\n");
319 TRACE("Open file %s\n", debugstr_w(lpOpenParms
->lpstrElementName
));
321 hr
= IGraphBuilder_RenderFile(wma
->pgraph
, lpOpenParms
->lpstrElementName
, NULL
);
323 TRACE("Cannot render file (hr = %lx)\n", hr
);
327 if (!create_window(wma
, dwFlags
, lpOpenParms
))
331 if (dwFlags
& MCI_NOTIFY
)
332 mciDriverNotify(HWND_32(LOWORD(lpOpenParms
->dwCallback
)), wDevID
, MCI_NOTIFY_SUCCESSFUL
);
338 IBasicAudio_Release(wma
->audio
);
341 IBasicVideo_Release(wma
->vidbasic
);
342 wma
->vidbasic
= NULL
;
344 IMediaSeeking_Release(wma
->seek
);
347 IVideoWindow_Release(wma
->vidwin
);
350 IGraphBuilder_Release(wma
->pgraph
);
353 IMediaEvent_Release(wma
->mevent
);
356 IMediaControl_Release(wma
->pmctrl
);
363 return MCIERR_INTERNAL
;
366 /***************************************************************************
367 * MCIQTZ_mciClose [internal]
369 static DWORD
MCIQTZ_mciClose(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
373 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
375 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
377 return MCIERR_INVALID_DEVICE_ID
;
379 MCIQTZ_mciStop(wDevID
, MCI_WAIT
, NULL
);
384 IVideoWindow_put_MessageDrain(wma
->vidwin
, (OAHWND
)NULL
);
385 IVideoWindow_put_Owner(wma
->vidwin
, (OAHWND
)NULL
);
386 DestroyWindow(wma
->window
);
389 IVideoWindow_Release(wma
->vidwin
);
390 IBasicVideo_Release(wma
->vidbasic
);
391 IBasicAudio_Release(wma
->audio
);
392 IMediaSeeking_Release(wma
->seek
);
393 IMediaEvent_Release(wma
->mevent
);
394 IGraphBuilder_Release(wma
->pgraph
);
395 IMediaControl_Release(wma
->pmctrl
);
404 /***************************************************************************
405 * MCIQTZ_notifyThread [internal]
407 static DWORD CALLBACK
MCIQTZ_notifyThread(LPVOID parm
)
409 WINE_MCIQTZ
* wma
= (WINE_MCIQTZ
*)parm
;
412 DWORD n
= 0, ret
= 0;
414 handle
[n
++] = wma
->stop_event
;
415 IMediaEvent_GetEventHandle(wma
->mevent
, (OAEVENT
*)&handle
[n
++]);
421 r
= WaitForMultipleObjects(n
, handle
, FALSE
, INFINITE
);
422 if (r
== WAIT_OBJECT_0
) {
423 TRACE("got stop event\n");
424 old
= InterlockedExchangePointer(&wma
->callback
, NULL
);
426 mciDriverNotify(old
, wma
->notify_devid
, MCI_NOTIFY_ABORTED
);
429 else if (r
== WAIT_OBJECT_0
+1) {
433 hr
= IMediaEvent_GetEvent(wma
->mevent
, &event_code
, &p1
, &p2
, 0);
435 TRACE("got event_code = 0x%02lx\n", event_code
);
436 IMediaEvent_FreeEventParams(wma
->mevent
, event_code
, p1
, p2
);
438 } while (hr
== S_OK
&& event_code
!= EC_COMPLETE
);
439 if (hr
== S_OK
&& event_code
== EC_COMPLETE
) {
440 /* Repeat the music by seeking and running again */
441 if (wma
->mci_flags
& MCI_DGV_PLAY_REPEAT
) {
442 TRACE("repeat media as requested\n");
443 IMediaControl_Stop(wma
->pmctrl
);
444 IMediaSeeking_SetPositions(wma
->seek
,
446 AM_SEEKING_AbsolutePositioning
,
448 AM_SEEKING_AbsolutePositioning
);
449 IMediaControl_Run(wma
->pmctrl
);
452 old
= InterlockedExchangePointer(&wma
->callback
, NULL
);
454 mciDriverNotify(old
, wma
->notify_devid
, MCI_NOTIFY_SUCCESSFUL
);
459 TRACE("Unknown error (%d)\n", (int)r
);
464 hr
= IMediaControl_Stop(wma
->pmctrl
);
466 TRACE("Cannot stop filtergraph (hr = %lx)\n", hr
);
467 ret
= MCIERR_INTERNAL
;
473 /***************************************************************************
474 * MCIQTZ_mciPlay [internal]
476 static DWORD
MCIQTZ_mciPlay(UINT wDevID
, DWORD dwFlags
, LPMCI_PLAY_PARMS lpParms
)
483 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
486 return MCIERR_NULL_PARAMETER_BLOCK
;
488 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
490 return MCIERR_INVALID_DEVICE_ID
;
492 ResetEvent(wma
->stop_event
);
493 if (dwFlags
& MCI_NOTIFY
) {
495 old
= InterlockedExchangePointer(&wma
->callback
, HWND_32(LOWORD(lpParms
->dwCallback
)));
497 mciDriverNotify(old
, wma
->notify_devid
, MCI_NOTIFY_ABORTED
);
500 wma
->mci_flags
= dwFlags
;
501 IMediaSeeking_GetTimeFormat(wma
->seek
, &format
);
502 if (dwFlags
& MCI_FROM
) {
503 wma
->seek_start
= lpParms
->dwFrom
;
504 if (IsEqualGUID(&format
, &TIME_FORMAT_MEDIA_TIME
))
505 wma
->seek_start
*= 10000;
507 start_flags
= AM_SEEKING_AbsolutePositioning
;
510 start_flags
= AM_SEEKING_NoPositioning
;
512 if (dwFlags
& MCI_TO
) {
513 wma
->seek_stop
= lpParms
->dwTo
;
514 if (IsEqualGUID(&format
, &TIME_FORMAT_MEDIA_TIME
))
515 wma
->seek_stop
*= 10000;
518 IMediaSeeking_GetDuration(wma
->seek
, &wma
->seek_stop
);
520 IMediaSeeking_SetPositions(wma
->seek
, &wma
->seek_start
, start_flags
,
521 &wma
->seek_stop
, AM_SEEKING_AbsolutePositioning
);
523 hr
= IMediaControl_Run(wma
->pmctrl
);
525 TRACE("Cannot run filtergraph (hr = %lx)\n", hr
);
526 return MCIERR_INTERNAL
;
530 ShowWindow(wma
->parent
, SW_SHOW
);
534 wma
->thread
= CreateThread(NULL
, 0, MCIQTZ_notifyThread
, wma
, 0, NULL
);
536 TRACE("Can't create thread\n");
537 return MCIERR_INTERNAL
;
543 /***************************************************************************
544 * MCIQTZ_mciSeek [internal]
546 static DWORD
MCIQTZ_mciSeek(UINT wDevID
, DWORD dwFlags
, LPMCI_SEEK_PARMS lpParms
)
552 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
555 return MCIERR_NULL_PARAMETER_BLOCK
;
557 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
559 return MCIERR_INVALID_DEVICE_ID
;
561 MCIQTZ_mciStop(wDevID
, MCI_WAIT
, NULL
);
563 if (dwFlags
& MCI_SEEK_TO_START
) {
565 } else if (dwFlags
& MCI_SEEK_TO_END
) {
566 FIXME("MCI_SEEK_TO_END not implemented yet\n");
567 return MCIERR_INTERNAL
;
568 } else if (dwFlags
& MCI_TO
) {
569 FIXME("MCI_TO not implemented yet\n");
570 return MCIERR_INTERNAL
;
572 WARN("dwFlag doesn't tell where to seek to...\n");
573 return MCIERR_MISSING_PARAMETER
;
576 hr
= IMediaSeeking_SetPositions(wma
->seek
, &newpos
, AM_SEEKING_AbsolutePositioning
, NULL
, AM_SEEKING_NoPositioning
);
578 FIXME("Cannot set position (hr = %lx)\n", hr
);
579 return MCIERR_INTERNAL
;
582 if (dwFlags
& MCI_NOTIFY
)
583 MCIQTZ_mciNotify(lpParms
->dwCallback
, wma
, MCI_NOTIFY_SUCCESSFUL
);
588 /***************************************************************************
589 * MCIQTZ_mciStop [internal]
591 static DWORD
MCIQTZ_mciStop(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
595 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
597 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
599 return MCIERR_INVALID_DEVICE_ID
;
605 SetEvent(wma
->stop_event
);
606 WaitForSingleObject(wma
->thread
, INFINITE
);
607 CloseHandle(wma
->thread
);
614 /***************************************************************************
615 * MCIQTZ_mciPause [internal]
617 static DWORD
MCIQTZ_mciPause(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
622 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
624 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
626 return MCIERR_INVALID_DEVICE_ID
;
628 hr
= IMediaControl_Pause(wma
->pmctrl
);
630 TRACE("Cannot pause filtergraph (hr = %lx)\n", hr
);
631 return MCIERR_INTERNAL
;
637 /***************************************************************************
638 * MCIQTZ_mciResume [internal]
640 static DWORD
MCIQTZ_mciResume(UINT wDevID
, DWORD dwFlags
, LPMCI_GENERIC_PARMS lpParms
)
645 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
647 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
649 return MCIERR_INVALID_DEVICE_ID
;
651 hr
= IMediaControl_Run(wma
->pmctrl
);
653 TRACE("Cannot run filtergraph (hr = %lx)\n", hr
);
654 return MCIERR_INTERNAL
;
660 /***************************************************************************
661 * MCIQTZ_mciGetDevCaps [internal]
663 static DWORD
MCIQTZ_mciGetDevCaps(UINT wDevID
, DWORD dwFlags
, LPMCI_GETDEVCAPS_PARMS lpParms
)
667 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
670 return MCIERR_NULL_PARAMETER_BLOCK
;
672 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
674 return MCIERR_INVALID_DEVICE_ID
;
676 if (!(dwFlags
& MCI_GETDEVCAPS_ITEM
))
677 return MCIERR_MISSING_PARAMETER
;
679 switch (lpParms
->dwItem
) {
680 case MCI_GETDEVCAPS_CAN_RECORD
:
681 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
682 TRACE("MCI_GETDEVCAPS_CAN_RECORD = %08lx\n", lpParms
->dwReturn
);
684 case MCI_GETDEVCAPS_HAS_AUDIO
:
685 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
686 TRACE("MCI_GETDEVCAPS_HAS_AUDIO = %08lx\n", lpParms
->dwReturn
);
688 case MCI_GETDEVCAPS_HAS_VIDEO
:
689 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
690 TRACE("MCI_GETDEVCAPS_HAS_VIDEO = %08lx\n", lpParms
->dwReturn
);
692 case MCI_GETDEVCAPS_DEVICE_TYPE
:
693 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_DEVTYPE_DIGITAL_VIDEO
, MCI_DEVTYPE_DIGITAL_VIDEO
);
694 TRACE("MCI_GETDEVCAPS_DEVICE_TYPE = %08lx\n", lpParms
->dwReturn
);
696 case MCI_GETDEVCAPS_USES_FILES
:
697 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
698 TRACE("MCI_GETDEVCAPS_USES_FILES = %08lx\n", lpParms
->dwReturn
);
700 case MCI_GETDEVCAPS_COMPOUND_DEVICE
:
701 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
702 TRACE("MCI_GETDEVCAPS_COMPOUND_DEVICE = %08lx\n", lpParms
->dwReturn
);
704 case MCI_GETDEVCAPS_CAN_EJECT
:
705 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
706 TRACE("MCI_GETDEVCAPS_EJECT = %08lx\n", lpParms
->dwReturn
);
708 case MCI_GETDEVCAPS_CAN_PLAY
:
709 lpParms
->dwReturn
= MAKEMCIRESOURCE(TRUE
, MCI_TRUE
);
710 TRACE("MCI_GETDEVCAPS_CAN_PLAY = %08lx\n", lpParms
->dwReturn
);
712 case MCI_GETDEVCAPS_CAN_SAVE
:
713 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
714 TRACE("MCI_GETDEVCAPS_CAN_SAVE = %08lx\n", lpParms
->dwReturn
);
716 case MCI_DGV_GETDEVCAPS_CAN_REVERSE
:
717 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
718 TRACE("MCI_DGV_GETDEVCAPS_CAN_REVERSE = %08lx\n", lpParms
->dwReturn
);
720 case MCI_DGV_GETDEVCAPS_CAN_STRETCH
:
721 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
); /* FIXME */
722 TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH = %08lx\n", lpParms
->dwReturn
);
724 case MCI_DGV_GETDEVCAPS_CAN_LOCK
:
725 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
726 TRACE("MCI_DGV_GETDEVCAPS_CAN_LOCK = %08lx\n", lpParms
->dwReturn
);
728 case MCI_DGV_GETDEVCAPS_CAN_FREEZE
:
729 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
730 TRACE("MCI_DGV_GETDEVCAPS_CAN_FREEZE = %08lx\n", lpParms
->dwReturn
);
732 case MCI_DGV_GETDEVCAPS_CAN_STR_IN
:
733 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
734 TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH_INPUT = %08lx\n", lpParms
->dwReturn
);
736 case MCI_DGV_GETDEVCAPS_HAS_STILL
:
737 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
);
738 TRACE("MCI_DGV_GETDEVCAPS_HAS_STILL = %08lx\n", lpParms
->dwReturn
);
740 case MCI_DGV_GETDEVCAPS_CAN_TEST
:
741 lpParms
->dwReturn
= MAKEMCIRESOURCE(FALSE
, MCI_FALSE
); /* FIXME */
742 TRACE("MCI_DGV_GETDEVCAPS_CAN_TEST = %08lx\n", lpParms
->dwReturn
);
744 case MCI_DGV_GETDEVCAPS_MAX_WINDOWS
:
745 lpParms
->dwReturn
= 1;
746 TRACE("MCI_DGV_GETDEVCAPS_MAX_WINDOWS = %lu\n", lpParms
->dwReturn
);
749 WARN("Unknown capability %08lx\n", lpParms
->dwItem
);
751 case MCI_DGV_GETDEVCAPS_MAXIMUM_RATE
: /* unknown to w2k */
752 case MCI_DGV_GETDEVCAPS_MINIMUM_RATE
: /* unknown to w2k */
753 return MCIERR_UNSUPPORTED_FUNCTION
;
756 return MCI_RESOURCE_RETURNED
;
759 /***************************************************************************
760 * MCIQTZ_mciSet [internal]
762 static DWORD
MCIQTZ_mciSet(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_SET_PARMS lpParms
)
766 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
769 return MCIERR_NULL_PARAMETER_BLOCK
;
771 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
773 return MCIERR_INVALID_DEVICE_ID
;
775 if (dwFlags
& MCI_SET_TIME_FORMAT
) {
776 switch (lpParms
->dwTimeFormat
) {
777 case MCI_FORMAT_MILLISECONDS
:
778 TRACE("MCI_SET_TIME_FORMAT = MCI_FORMAT_MILLISECONDS\n");
779 wma
->time_format
= MCI_FORMAT_MILLISECONDS
;
781 case MCI_FORMAT_FRAMES
:
782 TRACE("MCI_SET_TIME_FORMAT = MCI_FORMAT_FRAMES\n");
783 wma
->time_format
= MCI_FORMAT_FRAMES
;
786 WARN("Bad time format %lu\n", lpParms
->dwTimeFormat
);
787 return MCIERR_BAD_TIME_FORMAT
;
791 if (dwFlags
& MCI_SET_DOOR_OPEN
)
792 FIXME("MCI_SET_DOOR_OPEN not implemented yet\n");
793 if (dwFlags
& MCI_SET_DOOR_CLOSED
)
794 FIXME("MCI_SET_DOOR_CLOSED not implemented yet\n");
795 if (dwFlags
& MCI_SET_AUDIO
)
796 FIXME("MCI_SET_AUDIO not implemented yet\n");
797 if (dwFlags
& MCI_SET_VIDEO
)
798 FIXME("MCI_SET_VIDEO not implemented yet\n");
799 if (dwFlags
& MCI_SET_ON
)
800 FIXME("MCI_SET_ON not implemented yet\n");
801 if (dwFlags
& MCI_SET_OFF
)
802 FIXME("MCI_SET_OFF not implemented yet\n");
803 if (dwFlags
& MCI_SET_AUDIO_LEFT
)
804 FIXME("MCI_SET_AUDIO_LEFT not implemented yet\n");
805 if (dwFlags
& MCI_SET_AUDIO_RIGHT
)
806 FIXME("MCI_SET_AUDIO_RIGHT not implemented yet\n");
808 if (dwFlags
& ~0x7f03 /* All MCI_SET flags mask */)
809 ERR("Unknown flags %08lx\n", dwFlags
& ~0x7f03);
814 /***************************************************************************
815 * MCIQTZ_mciStatus [internal]
817 static DWORD
MCIQTZ_mciStatus(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_STATUS_PARMSW lpParms
)
821 DWORD ret
= MCI_INTEGER_RETURNED
;
823 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
826 return MCIERR_NULL_PARAMETER_BLOCK
;
828 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
830 return MCIERR_INVALID_DEVICE_ID
;
832 if (!(dwFlags
& MCI_STATUS_ITEM
)) {
833 WARN("No status item specified\n");
834 return MCIERR_UNRECOGNIZED_COMMAND
;
837 switch (lpParms
->dwItem
) {
838 case MCI_STATUS_LENGTH
: {
839 LONGLONG duration
= -1;
841 switch (wma
->time_format
) {
842 case MCI_FORMAT_MILLISECONDS
: format
= TIME_FORMAT_MEDIA_TIME
; break;
843 case MCI_FORMAT_FRAMES
: format
= TIME_FORMAT_FRAME
; break;
844 default: ERR("Unhandled format %lx\n", wma
->time_format
); break;
846 hr
= IMediaSeeking_SetTimeFormat(wma
->seek
, &format
);
848 FIXME("Cannot set time format (hr = %lx)\n", hr
);
849 lpParms
->dwReturn
= 0;
852 hr
= IMediaSeeking_GetDuration(wma
->seek
, &duration
);
853 if (FAILED(hr
) || duration
< 0) {
854 FIXME("Cannot read duration (hr = %lx)\n", hr
);
855 lpParms
->dwReturn
= 0;
856 } else if (wma
->time_format
!= MCI_FORMAT_MILLISECONDS
)
857 lpParms
->dwReturn
= duration
;
859 lpParms
->dwReturn
= duration
/ 10000;
862 case MCI_STATUS_POSITION
: {
863 REFERENCE_TIME curpos
;
865 hr
= IMediaSeeking_GetCurrentPosition(wma
->seek
, &curpos
);
867 FIXME("Cannot get position (hr = %lx)\n", hr
);
868 return MCIERR_INTERNAL
;
870 lpParms
->dwReturn
= curpos
/ 10000;
873 case MCI_STATUS_NUMBER_OF_TRACKS
:
874 FIXME("MCI_STATUS_NUMBER_OF_TRACKS not implemented yet\n");
875 return MCIERR_UNRECOGNIZED_COMMAND
;
876 case MCI_STATUS_MODE
: {
877 LONG state
= State_Stopped
;
878 IMediaControl_GetState(wma
->pmctrl
, -1, &state
);
879 if (state
== State_Stopped
)
880 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_STOP
, MCI_MODE_STOP
);
881 else if (state
== State_Running
) {
882 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_PLAY
, MCI_MODE_PLAY
);
883 if (!wma
->thread
|| WaitForSingleObject(wma
->thread
, 0) == WAIT_OBJECT_0
)
884 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_STOP
, MCI_MODE_STOP
);
885 } else if (state
== State_Paused
)
886 lpParms
->dwReturn
= MAKEMCIRESOURCE(MCI_MODE_PAUSE
, MCI_MODE_PAUSE
);
887 ret
= MCI_RESOURCE_RETURNED
;
890 case MCI_STATUS_MEDIA_PRESENT
:
891 FIXME("MCI_STATUS_MEDIA_PRESENT not implemented yet\n");
892 return MCIERR_UNRECOGNIZED_COMMAND
;
893 case MCI_STATUS_TIME_FORMAT
:
894 lpParms
->dwReturn
= MAKEMCIRESOURCE(wma
->time_format
,
895 MCI_FORMAT_RETURN_BASE
+ wma
->time_format
);
896 ret
= MCI_RESOURCE_RETURNED
;
898 case MCI_STATUS_READY
:
899 FIXME("MCI_STATUS_READY not implemented yet\n");
900 return MCIERR_UNRECOGNIZED_COMMAND
;
901 case MCI_STATUS_CURRENT_TRACK
:
902 FIXME("MCI_STATUS_CURRENT_TRACK not implemented yet\n");
903 return MCIERR_UNRECOGNIZED_COMMAND
;
905 FIXME("Unknown command %08lX\n", lpParms
->dwItem
);
906 return MCIERR_UNRECOGNIZED_COMMAND
;
909 if (dwFlags
& MCI_NOTIFY
)
910 MCIQTZ_mciNotify(lpParms
->dwCallback
, wma
, MCI_NOTIFY_SUCCESSFUL
);
915 /***************************************************************************
916 * MCIQTZ_mciWhere [internal]
918 static DWORD
MCIQTZ_mciWhere(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_RECT_PARMS lpParms
)
924 DWORD ret
= MCIERR_UNRECOGNIZED_COMMAND
;
926 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
929 return MCIERR_NULL_PARAMETER_BLOCK
;
931 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
933 return MCIERR_INVALID_DEVICE_ID
;
935 hr
= IVideoWindow_get_Owner(wma
->vidwin
, (OAHWND
*)&hWnd
);
937 TRACE("No video stream, returning no window error\n");
938 return MCIERR_NO_WINDOW
;
941 if (dwFlags
& MCI_DGV_WHERE_SOURCE
) {
942 if (dwFlags
& MCI_DGV_WHERE_MAX
)
943 FIXME("MCI_DGV_WHERE_SOURCE_MAX stub\n");
944 IBasicVideo_GetSourcePosition(wma
->vidbasic
, &rc
.left
, &rc
.top
, &rc
.right
, &rc
.bottom
);
945 TRACE("MCI_DGV_WHERE_SOURCE %s\n", wine_dbgstr_rect(&rc
));
947 if (dwFlags
& MCI_DGV_WHERE_DESTINATION
) {
948 if (dwFlags
& MCI_DGV_WHERE_MAX
)
949 FIXME("MCI_DGV_WHERE_DESTINATION_MAX stub\n");
950 IBasicVideo_GetDestinationPosition(wma
->vidbasic
, &rc
.left
, &rc
.top
, &rc
.right
, &rc
.bottom
);
951 TRACE("MCI_DGV_WHERE_DESTINATION %s\n", wine_dbgstr_rect(&rc
));
953 if (dwFlags
& MCI_DGV_WHERE_FRAME
) {
954 if (dwFlags
& MCI_DGV_WHERE_MAX
)
955 FIXME("MCI_DGV_WHERE_FRAME_MAX not supported yet\n");
957 FIXME("MCI_DGV_WHERE_FRAME not supported yet\n");
960 if (dwFlags
& MCI_DGV_WHERE_VIDEO
) {
961 if (dwFlags
& MCI_DGV_WHERE_MAX
)
962 FIXME("MCI_DGV_WHERE_VIDEO_MAX not supported yet\n");
964 FIXME("MCI_DGV_WHERE_VIDEO not supported yet\n");
967 if (dwFlags
& MCI_DGV_WHERE_WINDOW
) {
968 if (dwFlags
& MCI_DGV_WHERE_MAX
) {
969 GetWindowRect(GetDesktopWindow(), &rc
);
972 TRACE("MCI_DGV_WHERE_WINDOW_MAX %s\n", wine_dbgstr_rect(&rc
));
974 GetWindowRect(wma
->parent
, &rc
);
977 TRACE("MCI_DGV_WHERE_WINDOW %s\n", wine_dbgstr_rect(&rc
));
986 /***************************************************************************
987 * MCIQTZ_mciWindow [internal]
989 static DWORD
MCIQTZ_mciWindow(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_WINDOW_PARMSW lpParms
)
991 WINE_MCIQTZ
*wma
= MCIQTZ_mciGetOpenDev(wDevID
);
993 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
996 return MCIERR_NULL_PARAMETER_BLOCK
;
999 return MCIERR_INVALID_DEVICE_ID
;
1000 if (dwFlags
& MCI_TEST
)
1003 if (dwFlags
& MCI_DGV_WINDOW_HWND
) {
1005 if (lpParms
->hWnd
&& !IsWindow(lpParms
->hWnd
))
1006 return MCIERR_NO_WINDOW
;
1008 return MCIERR_INTERNAL
;
1009 hwnd
= lpParms
->hWnd
? lpParms
->hWnd
: wma
->window
;
1010 TRACE("Setting parent window to %p.\n", hwnd
);
1011 if (wma
->parent
!= hwnd
)
1015 IVideoWindow_put_MessageDrain(wma
->vidwin
, (OAHWND
)hwnd
);
1016 IVideoWindow_put_Owner(wma
->vidwin
, (OAHWND
)hwnd
);
1018 IBasicVideo_GetVideoSize(wma
->vidbasic
, &width
, &height
);
1019 IVideoWindow_SetWindowPosition(wma
->vidwin
, 0, 0, width
, height
);
1021 if (wma
->parent
== wma
->window
)
1022 ShowWindow(wma
->window
, SW_HIDE
);
1023 else if (hwnd
== wma
->window
)
1024 ShowWindow(wma
->window
, SW_SHOW
);
1029 if (dwFlags
& MCI_DGV_WINDOW_STATE
) {
1031 return MCIERR_NO_WINDOW
;
1032 TRACE("Setting nCmdShow to %d\n", lpParms
->nCmdShow
);
1033 ShowWindow(wma
->parent
, lpParms
->nCmdShow
);
1035 if (dwFlags
& MCI_DGV_WINDOW_TEXT
) {
1037 return MCIERR_NO_WINDOW
;
1038 TRACE("Setting caption to %s\n", debugstr_w(lpParms
->lpstrText
));
1039 SetWindowTextW(wma
->parent
, lpParms
->lpstrText
);
1044 /***************************************************************************
1045 * MCIQTZ_mciPut [internal]
1047 static DWORD
MCIQTZ_mciPut(UINT wDevID
, DWORD dwFlags
, MCI_GENERIC_PARMS
*lpParms
)
1049 WINE_MCIQTZ
*wma
= MCIQTZ_mciGetOpenDev(wDevID
);
1050 MCI_DGV_RECT_PARMS
*rectparms
;
1053 TRACE("(%04x, %08lX, %p)\n", wDevID
, dwFlags
, lpParms
);
1056 return MCIERR_NULL_PARAMETER_BLOCK
;
1059 return MCIERR_INVALID_DEVICE_ID
;
1061 if (!(dwFlags
& MCI_DGV_RECT
)) {
1062 FIXME("No support for non-RECT MCI_PUT\n");
1066 if (dwFlags
& MCI_TEST
)
1069 dwFlags
&= ~MCI_DGV_RECT
;
1070 rectparms
= (MCI_DGV_RECT_PARMS
*)lpParms
;
1072 if (dwFlags
& MCI_DGV_PUT_DESTINATION
) {
1073 hr
= IVideoWindow_SetWindowPosition(wma
->vidwin
,
1074 rectparms
->rc
.left
, rectparms
->rc
.top
,
1075 rectparms
->rc
.right
- rectparms
->rc
.left
,
1076 rectparms
->rc
.bottom
- rectparms
->rc
.top
);
1078 WARN("IVideoWindow_SetWindowPosition failed: 0x%lx\n", hr
);
1080 dwFlags
&= ~MCI_DGV_PUT_DESTINATION
;
1083 if (dwFlags
& MCI_NOTIFY
) {
1084 MCIQTZ_mciNotify(lpParms
->dwCallback
, wma
, MCI_NOTIFY_SUCCESSFUL
);
1085 dwFlags
&= ~MCI_NOTIFY
;
1089 FIXME("No support for some flags: 0x%lx\n", dwFlags
);
1094 /******************************************************************************
1095 * MCIAVI_mciUpdate [internal]
1097 static DWORD
MCIQTZ_mciUpdate(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_UPDATE_PARMS lpParms
)
1102 TRACE("%04x, %08lx, %p\n", wDevID
, dwFlags
, lpParms
);
1105 return MCIERR_NULL_PARAMETER_BLOCK
;
1107 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
1109 return MCIERR_INVALID_DEVICE_ID
;
1111 if (dwFlags
& MCI_DGV_UPDATE_HDC
) {
1117 LONG visible
= OATRUE
;
1119 res
= MCIERR_INTERNAL
;
1120 IMediaControl_GetState(wma
->pmctrl
, -1, &state
);
1121 if (state
== State_Running
)
1122 return MCIERR_UNSUPPORTED_FUNCTION
;
1123 /* If in stopped state, nothing has been drawn to screen
1124 * moving to pause, which is needed for the old dib renderer, will result
1125 * in a single frame drawn, so hide the window here */
1126 IVideoWindow_get_Visible(wma
->vidwin
, &visible
);
1128 IVideoWindow_put_Visible(wma
->vidwin
, OAFALSE
);
1129 /* FIXME: Should we check the original state and restore it? */
1130 IMediaControl_Pause(wma
->pmctrl
);
1131 IMediaControl_GetState(wma
->pmctrl
, -1, &state
);
1132 if (FAILED(hr
= IBasicVideo_GetCurrentImage(wma
->vidbasic
, &size
, NULL
))) {
1133 WARN("Could not get image size (hr = %lx)\n", hr
);
1136 data
= HeapAlloc(GetProcessHeap(), 0, size
);
1137 info
= (BITMAPINFO
*)data
;
1138 IBasicVideo_GetCurrentImage(wma
->vidbasic
, &size
, (LONG
*)data
);
1139 data
+= info
->bmiHeader
.biSize
;
1141 IBasicVideo_GetSourcePosition(wma
->vidbasic
, &src
.left
, &src
.top
, &src
.right
, &src
.bottom
);
1142 IBasicVideo_GetDestinationPosition(wma
->vidbasic
, &dest
.left
, &dest
.top
, &dest
.right
, &dest
.bottom
);
1143 StretchDIBits(lpParms
->hDC
,
1144 dest
.left
, dest
.top
, dest
.right
+ dest
.left
, dest
.bottom
+ dest
.top
,
1145 src
.left
, src
.top
, src
.right
+ src
.left
, src
.bottom
+ src
.top
,
1146 data
, info
, DIB_RGB_COLORS
, SRCCOPY
);
1147 HeapFree(GetProcessHeap(), 0, data
);
1151 IVideoWindow_put_Visible(wma
->vidwin
, visible
);
1154 FIXME("Unhandled flags %lx\n", dwFlags
);
1158 /***************************************************************************
1159 * MCIQTZ_mciSetAudio [internal]
1161 static DWORD
MCIQTZ_mciSetAudio(UINT wDevID
, DWORD dwFlags
, LPMCI_DGV_SETAUDIO_PARMSW lpParms
)
1166 TRACE("(%04x, %08lx, %p)\n", wDevID
, dwFlags
, lpParms
);
1169 return MCIERR_NULL_PARAMETER_BLOCK
;
1171 wma
= MCIQTZ_mciGetOpenDev(wDevID
);
1173 return MCIERR_INVALID_DEVICE_ID
;
1175 if (!(dwFlags
& MCI_DGV_SETAUDIO_ITEM
)) {
1176 FIXME("Unknown flags (%08lx)\n", dwFlags
);
1180 if (dwFlags
& MCI_DGV_SETAUDIO_ITEM
) {
1181 switch (lpParms
->dwItem
) {
1182 case MCI_DGV_SETAUDIO_VOLUME
:
1183 if (dwFlags
& MCI_DGV_SETAUDIO_VALUE
) {
1186 if (lpParms
->dwValue
> 1000) {
1187 ret
= MCIERR_OUTOFRANGE
;
1190 if (dwFlags
& MCI_TEST
)
1192 if (lpParms
->dwValue
!= 0)
1193 vol
= (long)(2000.0 * (log10(lpParms
->dwValue
) - 3.0));
1196 TRACE("Setting volume to %ld\n", vol
);
1197 hr
= IBasicAudio_put_Volume(wma
->audio
, vol
);
1199 WARN("Cannot set volume (hr = %lx)\n", hr
);
1200 ret
= MCIERR_INTERNAL
;
1205 FIXME("Unknown item %08lx\n", lpParms
->dwItem
);
1213 /*======================================================================*
1214 * MCI QTZ entry points *
1215 *======================================================================*/
1217 /**************************************************************************
1218 * DriverProc (MCIQTZ.@)
1220 LRESULT CALLBACK
MCIQTZ_DriverProc(DWORD_PTR dwDevID
, HDRVR hDriv
, UINT wMsg
,
1221 LPARAM dwParam1
, LPARAM dwParam2
)
1223 TRACE("(%08IX, %p, %08X, %08IX, %08IX)\n",
1224 dwDevID
, hDriv
, wMsg
, dwParam1
, dwParam2
);
1227 case DRV_LOAD
: return 1;
1228 case DRV_FREE
: return 1;
1229 case DRV_OPEN
: return MCIQTZ_drvOpen((LPCWSTR
)dwParam1
, (LPMCI_OPEN_DRIVER_PARMSW
)dwParam2
);
1230 case DRV_CLOSE
: return MCIQTZ_drvClose(dwDevID
);
1231 case DRV_ENABLE
: return 1;
1232 case DRV_DISABLE
: return 1;
1233 case DRV_QUERYCONFIGURE
: return 1;
1234 case DRV_CONFIGURE
: return MCIQTZ_drvConfigure(dwDevID
);
1235 case DRV_INSTALL
: return DRVCNF_RESTART
;
1236 case DRV_REMOVE
: return DRVCNF_RESTART
;
1239 /* session instance */
1240 if (dwDevID
== 0xFFFFFFFF)
1244 case MCI_OPEN_DRIVER
: return MCIQTZ_mciOpen (dwDevID
, dwParam1
, (LPMCI_DGV_OPEN_PARMSW
) dwParam2
);
1245 case MCI_CLOSE_DRIVER
: return MCIQTZ_mciClose (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1246 case MCI_PLAY
: return MCIQTZ_mciPlay (dwDevID
, dwParam1
, (LPMCI_PLAY_PARMS
) dwParam2
);
1247 case MCI_SEEK
: return MCIQTZ_mciSeek (dwDevID
, dwParam1
, (LPMCI_SEEK_PARMS
) dwParam2
);
1248 case MCI_STOP
: return MCIQTZ_mciStop (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1249 case MCI_PAUSE
: return MCIQTZ_mciPause (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1250 case MCI_RESUME
: return MCIQTZ_mciResume (dwDevID
, dwParam1
, (LPMCI_GENERIC_PARMS
) dwParam2
);
1251 case MCI_GETDEVCAPS
: return MCIQTZ_mciGetDevCaps(dwDevID
, dwParam1
, (LPMCI_GETDEVCAPS_PARMS
) dwParam2
);
1252 case MCI_SET
: return MCIQTZ_mciSet (dwDevID
, dwParam1
, (LPMCI_DGV_SET_PARMS
) dwParam2
);
1253 case MCI_STATUS
: return MCIQTZ_mciStatus (dwDevID
, dwParam1
, (LPMCI_DGV_STATUS_PARMSW
) dwParam2
);
1254 case MCI_WHERE
: return MCIQTZ_mciWhere (dwDevID
, dwParam1
, (LPMCI_DGV_RECT_PARMS
) dwParam2
);
1255 /* Digital Video specific */
1256 case MCI_SETAUDIO
: return MCIQTZ_mciSetAudio (dwDevID
, dwParam1
, (LPMCI_DGV_SETAUDIO_PARMSW
) dwParam2
);
1258 return MCIQTZ_mciUpdate(dwDevID
, dwParam1
, (LPMCI_DGV_UPDATE_PARMS
)dwParam2
);
1260 return MCIQTZ_mciWindow(dwDevID
, dwParam1
, (LPMCI_DGV_WINDOW_PARMSW
)dwParam2
);
1262 return MCIQTZ_mciPut(dwDevID
, dwParam1
, (MCI_GENERIC_PARMS
*)dwParam2
);
1276 /* Digital Video specific */
1287 FIXME("Unimplemented command [%08X]\n", wMsg
);
1291 WARN("Unsupported command [%08X]\n", wMsg
);
1295 FIXME("Shouldn't receive a MCI_OPEN or CLOSE message\n");
1298 TRACE("Sending msg [%08X] to default driver proc\n", wMsg
);
1299 return DefDriverProc(dwDevID
, hDriv
, wMsg
, dwParam1
, dwParam2
);
1302 return MCIERR_UNRECOGNIZED_COMMAND
;