ReactOS  0.4.14-dev-52-g6116262
mciqtz.c
Go to the documentation of this file.
1 /*
2  * DirectShow MCI Driver
3  *
4  * Copyright 2009 Christian Costa
5  *
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.
10  *
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.
15  *
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
19  */
20 
21 #include <stdarg.h>
22 #include <math.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "winuser.h"
26 #include "mmddk.h"
27 #include "wine/debug.h"
28 #include "mciqtz_private.h"
29 #include "digitalv.h"
30 #include "wownt32.h"
31 
33 
36 
37 /*======================================================================*
38  * MCI QTZ implementation *
39  *======================================================================*/
40 
42 
43 /***********************************************************************
44  * DllMain (MCIQTZ.0)
45  */
47 {
48  switch (fdwReason) {
49  case DLL_PROCESS_ATTACH:
50  DisableThreadLibraryCalls(hInstDLL);
51  MCIQTZ_hInstance = hInstDLL;
52  break;
53  }
54  return TRUE;
55 }
56 
57 /**************************************************************************
58  * MCIQTZ_mciGetOpenDev [internal]
59  */
61 {
62  WINE_MCIQTZ* wma = (WINE_MCIQTZ*)mciGetDriverData(wDevID);
63 
64  if (!wma) {
65  WARN("Invalid wDevID=%u\n", wDevID);
66  return NULL;
67  }
68  return wma;
69 }
70 
71 /**************************************************************************
72  * MCIQTZ_drvOpen [internal]
73  */
75 {
76  WINE_MCIQTZ* wma;
77  static const WCHAR mciAviWStr[] = {'M','C','I','A','V','I',0};
78 
79  TRACE("(%s, %p)\n", debugstr_w(str), modp);
80 
81  /* session instance */
82  if (!modp)
83  return 0xFFFFFFFF;
84 
86  if (!wma)
87  return 0;
88 
91  wma->wDevID = modp->wDeviceID;
93  mciSetDriverData(wma->wDevID, (DWORD_PTR)wma);
94 
95  return modp->wDeviceID;
96 }
97 
98 /**************************************************************************
99  * MCIQTZ_drvClose [internal]
100  */
101 static DWORD MCIQTZ_drvClose(DWORD dwDevID)
102 {
103  WINE_MCIQTZ* wma;
104 
105  TRACE("(%04x)\n", dwDevID);
106 
107  wma = MCIQTZ_mciGetOpenDev(dwDevID);
108 
109  if (wma) {
110  /* finish all outstanding things */
111  MCIQTZ_mciClose(dwDevID, MCI_WAIT, NULL);
112 
114  mciSetDriverData(dwDevID, 0);
115  CloseHandle(wma->stop_event);
116  HeapFree(GetProcessHeap(), 0, wma);
117  return 1;
118  }
119 
120  return (dwDevID == 0xFFFFFFFF) ? 1 : 0;
121 }
122 
123 /**************************************************************************
124  * MCIQTZ_drvConfigure [internal]
125  */
127 {
128  WINE_MCIQTZ* wma;
129 
130  TRACE("(%04x)\n", dwDevID);
131 
132  wma = MCIQTZ_mciGetOpenDev(dwDevID);
133  if (!wma)
134  return 0;
135 
136  MCIQTZ_mciStop(dwDevID, MCI_WAIT, NULL);
137 
138  MessageBoxA(0, "Sample QTZ Wine Driver !", "MM-Wine Driver", MB_OK);
139 
140  return 1;
141 }
142 
143 /**************************************************************************
144  * MCIQTZ_mciNotify [internal]
145  *
146  * Notifications in MCI work like a 1-element queue.
147  * Each new notification request supersedes the previous one.
148  */
149 static void MCIQTZ_mciNotify(DWORD_PTR hWndCallBack, WINE_MCIQTZ* wma, UINT wStatus)
150 {
151  MCIDEVICEID wDevID = wma->notify_devid;
153  if (old) mciDriverNotify(old, wDevID, MCI_NOTIFY_SUPERSEDED);
154  mciDriverNotify(HWND_32(LOWORD(hWndCallBack)), wDevID, wStatus);
155 }
156 
157 /***************************************************************************
158  * MCIQTZ_mciOpen [internal]
159  */
161  LPMCI_DGV_OPEN_PARMSW lpOpenParms)
162 {
163  WINE_MCIQTZ* wma;
164  HRESULT hr;
165  DWORD style = 0;
166  RECT rc = { 0, 0, 0, 0 };
167 
168  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpOpenParms);
169 
170  if(!lpOpenParms)
172 
173  wma = MCIQTZ_mciGetOpenDev(wDevID);
174  if (!wma)
176 
177  MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
178 
180  wma->uninit = SUCCEEDED(hr);
181 
182  hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IGraphBuilder, (LPVOID*)&wma->pgraph);
183  if (FAILED(hr)) {
184  TRACE("Cannot create filtergraph (hr = %x)\n", hr);
185  goto err;
186  }
187 
188  hr = IGraphBuilder_QueryInterface(wma->pgraph, &IID_IMediaControl, (LPVOID*)&wma->pmctrl);
189  if (FAILED(hr)) {
190  TRACE("Cannot get IMediaControl interface (hr = %x)\n", hr);
191  goto err;
192  }
193 
194  hr = IGraphBuilder_QueryInterface(wma->pgraph, &IID_IMediaSeeking, (void**)&wma->seek);
195  if (FAILED(hr)) {
196  TRACE("Cannot get IMediaSeeking interface (hr = %x)\n", hr);
197  goto err;
198  }
199 
200  hr = IGraphBuilder_QueryInterface(wma->pgraph, &IID_IMediaEvent, (void**)&wma->mevent);
201  if (FAILED(hr)) {
202  TRACE("Cannot get IMediaEvent interface (hr = %x)\n", hr);
203  goto err;
204  }
205 
206  hr = IGraphBuilder_QueryInterface(wma->pgraph, &IID_IVideoWindow, (void**)&wma->vidwin);
207  if (FAILED(hr)) {
208  TRACE("Cannot get IVideoWindow interface (hr = %x)\n", hr);
209  goto err;
210  }
211 
212  hr = IGraphBuilder_QueryInterface(wma->pgraph, &IID_IBasicVideo, (void**)&wma->vidbasic);
213  if (FAILED(hr)) {
214  TRACE("Cannot get IBasicVideo interface (hr = %x)\n", hr);
215  goto err;
216  }
217 
218  hr = IGraphBuilder_QueryInterface(wma->pgraph, &IID_IBasicAudio, (void**)&wma->audio);
219  if (FAILED(hr)) {
220  TRACE("Cannot get IBasicAudio interface (hr = %x)\n", hr);
221  goto err;
222  }
223 
225  TRACE("Wrong dwFlags %x\n", dwFlags);
226  goto err;
227  }
228 
229  if (!lpOpenParms->lpstrElementName || !lpOpenParms->lpstrElementName[0]) {
230  TRACE("Invalid filename specified\n");
231  goto err;
232  }
233 
234  TRACE("Open file %s\n", debugstr_w(lpOpenParms->lpstrElementName));
235 
236  hr = IGraphBuilder_RenderFile(wma->pgraph, lpOpenParms->lpstrElementName, NULL);
237  if (FAILED(hr)) {
238  TRACE("Cannot render file (hr = %x)\n", hr);
239  goto err;
240  }
241 
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;
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;
254  }
255  else if (style)
256  IVideoWindow_put_WindowStyle(wma->vidwin, style);
257  IBasicVideo_GetVideoSize(wma->vidbasic, &rc.right, &rc.bottom);
258  wma->opened = TRUE;
259 
260  if (dwFlags & MCI_NOTIFY)
262 
263  return 0;
264 
265 err:
266  if (wma->audio)
267  IBasicAudio_Release(wma->audio);
268  wma->audio = NULL;
269  if (wma->vidbasic)
270  IBasicVideo_Release(wma->vidbasic);
271  wma->vidbasic = NULL;
272  if (wma->seek)
273  IMediaSeeking_Release(wma->seek);
274  wma->seek = NULL;
275  if (wma->vidwin)
276  IVideoWindow_Release(wma->vidwin);
277  wma->vidwin = NULL;
278  if (wma->pgraph)
279  IGraphBuilder_Release(wma->pgraph);
280  wma->pgraph = NULL;
281  if (wma->mevent)
282  IMediaEvent_Release(wma->mevent);
283  wma->mevent = NULL;
284  if (wma->pmctrl)
285  IMediaControl_Release(wma->pmctrl);
286  wma->pmctrl = NULL;
287 
288  if (wma->uninit)
289  CoUninitialize();
290  wma->uninit = FALSE;
291 
292  return MCIERR_INTERNAL;
293 }
294 
295 /***************************************************************************
296  * MCIQTZ_mciClose [internal]
297  */
299 {
300  WINE_MCIQTZ* wma;
301 
302  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
303 
304  wma = MCIQTZ_mciGetOpenDev(wDevID);
305  if (!wma)
307 
308  MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
309 
310  if (wma->opened) {
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);
318  if (wma->uninit)
319  CoUninitialize();
320  wma->opened = FALSE;
321  }
322 
323  return 0;
324 }
325 
326 /***************************************************************************
327  * MCIQTZ_notifyThread [internal]
328  */
330 {
331  WINE_MCIQTZ* wma = (WINE_MCIQTZ *)parm;
332  HRESULT hr;
333  HANDLE handle[2];
334  DWORD n = 0, ret = 0;
335 
336  handle[n++] = wma->stop_event;
337  IMediaEvent_GetEventHandle(wma->mevent, (OAEVENT *)&handle[n++]);
338 
339  for (;;) {
340  DWORD r;
341  HANDLE old;
342 
344  if (r == WAIT_OBJECT_0) {
345  TRACE("got stop event\n");
347  if (old)
349  break;
350  }
351  else if (r == WAIT_OBJECT_0+1) {
352  LONG event_code;
353  LONG_PTR p1, p2;
354  do {
355  hr = IMediaEvent_GetEvent(wma->mevent, &event_code, &p1, &p2, 0);
356  if (SUCCEEDED(hr)) {
357  TRACE("got event_code = 0x%02x\n", event_code);
358  IMediaEvent_FreeEventParams(wma->mevent, event_code, p1, p2);
359  }
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,
367  &wma->seek_start,
369  &wma->seek_stop,
371  IMediaControl_Run(wma->pmctrl);
372  continue;
373  }
375  if (old)
377  break;
378  }
379  }
380  else {
381  TRACE("Unknown error (%d)\n", (int)r);
382  break;
383  }
384  }
385 
386  hr = IMediaControl_Stop(wma->pmctrl);
387  if (FAILED(hr)) {
388  TRACE("Cannot stop filtergraph (hr = %x)\n", hr);
390  }
391 
392  return ret;
393 }
394 
395 /***************************************************************************
396  * MCIQTZ_mciPlay [internal]
397  */
399 {
400  WINE_MCIQTZ* wma;
401  HRESULT hr;
402  GUID format;
403  DWORD start_flags;
404 
405  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
406 
407  if(!lpParms)
409 
410  wma = MCIQTZ_mciGetOpenDev(wDevID);
411  if (!wma)
413 
414  ResetEvent(wma->stop_event);
415  if (dwFlags & MCI_NOTIFY) {
416  HANDLE old;
418  if (old)
420  }
421 
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;
427  else
428  wma->seek_start = lpParms->dwFrom;
429  start_flags = AM_SEEKING_AbsolutePositioning;
430  } else {
431  wma->seek_start = 0;
432  start_flags = AM_SEEKING_NoPositioning;
433  }
434  if (dwFlags & MCI_TO) {
435  if (IsEqualGUID(&format, &TIME_FORMAT_MEDIA_TIME))
436  wma->seek_stop = lpParms->dwTo * 10000;
437  else
438  wma->seek_stop = lpParms->dwTo;
439  } else {
440  wma->seek_stop = 0;
441  IMediaSeeking_GetDuration(wma->seek, &wma->seek_stop);
442  }
443  IMediaSeeking_SetPositions(wma->seek, &wma->seek_start, start_flags,
445 
446  hr = IMediaControl_Run(wma->pmctrl);
447  if (FAILED(hr)) {
448  TRACE("Cannot run filtergraph (hr = %x)\n", hr);
449  return MCIERR_INTERNAL;
450  }
451 
452  IVideoWindow_put_Visible(wma->vidwin, OATRUE);
453 
454  wma->thread = CreateThread(NULL, 0, MCIQTZ_notifyThread, wma, 0, NULL);
455  if (!wma->thread) {
456  TRACE("Can't create thread\n");
457  return MCIERR_INTERNAL;
458  }
459  return 0;
460 }
461 
462 /***************************************************************************
463  * MCIQTZ_mciSeek [internal]
464  */
466 {
467  WINE_MCIQTZ* wma;
468  HRESULT hr;
469  LONGLONG newpos;
470 
471  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
472 
473  if(!lpParms)
475 
476  wma = MCIQTZ_mciGetOpenDev(wDevID);
477  if (!wma)
479 
480  MCIQTZ_mciStop(wDevID, MCI_WAIT, NULL);
481 
482  if (dwFlags & MCI_SEEK_TO_START) {
483  newpos = 0;
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;
490  } else {
491  WARN("dwFlag doesn't tell where to seek to...\n");
493  }
494 
495  hr = IMediaSeeking_SetPositions(wma->seek, &newpos, AM_SEEKING_AbsolutePositioning, NULL, AM_SEEKING_NoPositioning);
496  if (FAILED(hr)) {
497  FIXME("Cannot set position (hr = %x)\n", hr);
498  return MCIERR_INTERNAL;
499  }
500 
501  if (dwFlags & MCI_NOTIFY)
503 
504  return 0;
505 }
506 
507 /***************************************************************************
508  * MCIQTZ_mciStop [internal]
509  */
511 {
512  WINE_MCIQTZ* wma;
513 
514  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
515 
516  wma = MCIQTZ_mciGetOpenDev(wDevID);
517  if (!wma)
519 
520  if (!wma->opened)
521  return 0;
522 
523  if (wma->thread) {
524  SetEvent(wma->stop_event);
526  CloseHandle(wma->thread);
527  wma->thread = NULL;
528  }
529 
530  if (!wma->parent)
531  IVideoWindow_put_Visible(wma->vidwin, OAFALSE);
532 
533  return 0;
534 }
535 
536 /***************************************************************************
537  * MCIQTZ_mciPause [internal]
538  */
540 {
541  WINE_MCIQTZ* wma;
542  HRESULT hr;
543 
544  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
545 
546  wma = MCIQTZ_mciGetOpenDev(wDevID);
547  if (!wma)
549 
550  hr = IMediaControl_Pause(wma->pmctrl);
551  if (FAILED(hr)) {
552  TRACE("Cannot pause filtergraph (hr = %x)\n", hr);
553  return MCIERR_INTERNAL;
554  }
555 
556  return 0;
557 }
558 
559 /***************************************************************************
560  * MCIQTZ_mciResume [internal]
561  */
563 {
564  WINE_MCIQTZ* wma;
565  HRESULT hr;
566 
567  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
568 
569  wma = MCIQTZ_mciGetOpenDev(wDevID);
570  if (!wma)
572 
573  hr = IMediaControl_Run(wma->pmctrl);
574  if (FAILED(hr)) {
575  TRACE("Cannot run filtergraph (hr = %x)\n", hr);
576  return MCIERR_INTERNAL;
577  }
578 
579  return 0;
580 }
581 
582 /***************************************************************************
583  * MCIQTZ_mciGetDevCaps [internal]
584  */
586 {
587  WINE_MCIQTZ* wma;
588 
589  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
590 
591  if(!lpParms)
593 
594  wma = MCIQTZ_mciGetOpenDev(wDevID);
595  if (!wma)
597 
598  if (!(dwFlags & MCI_GETDEVCAPS_ITEM))
600 
601  switch (lpParms->dwItem) {
604  TRACE("MCI_GETDEVCAPS_CAN_RECORD = %08x\n", lpParms->dwReturn);
605  break;
607  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
608  TRACE("MCI_GETDEVCAPS_HAS_AUDIO = %08x\n", lpParms->dwReturn);
609  break;
611  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
612  TRACE("MCI_GETDEVCAPS_HAS_VIDEO = %08x\n", lpParms->dwReturn);
613  break;
616  TRACE("MCI_GETDEVCAPS_DEVICE_TYPE = %08x\n", lpParms->dwReturn);
617  break;
619  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
620  TRACE("MCI_GETDEVCAPS_USES_FILES = %08x\n", lpParms->dwReturn);
621  break;
623  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
624  TRACE("MCI_GETDEVCAPS_COMPOUND_DEVICE = %08x\n", lpParms->dwReturn);
625  break;
628  TRACE("MCI_GETDEVCAPS_EJECT = %08x\n", lpParms->dwReturn);
629  break;
631  lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
632  TRACE("MCI_GETDEVCAPS_CAN_PLAY = %08x\n", lpParms->dwReturn);
633  break;
636  TRACE("MCI_GETDEVCAPS_CAN_SAVE = %08x\n", lpParms->dwReturn);
637  break;
640  TRACE("MCI_DGV_GETDEVCAPS_CAN_REVERSE = %08x\n", lpParms->dwReturn);
641  break;
643  lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE); /* FIXME */
644  TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH = %08x\n", lpParms->dwReturn);
645  break;
648  TRACE("MCI_DGV_GETDEVCAPS_CAN_LOCK = %08x\n", lpParms->dwReturn);
649  break;
652  TRACE("MCI_DGV_GETDEVCAPS_CAN_FREEZE = %08x\n", lpParms->dwReturn);
653  break;
656  TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH_INPUT = %08x\n", lpParms->dwReturn);
657  break;
660  TRACE("MCI_DGV_GETDEVCAPS_HAS_STILL = %08x\n", lpParms->dwReturn);
661  break;
663  lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE); /* FIXME */
664  TRACE("MCI_DGV_GETDEVCAPS_CAN_TEST = %08x\n", lpParms->dwReturn);
665  break;
667  lpParms->dwReturn = 1;
668  TRACE("MCI_DGV_GETDEVCAPS_MAX_WINDOWS = %u\n", lpParms->dwReturn);
669  return 0;
670  default:
671  WARN("Unknown capability %08x\n", lpParms->dwItem);
672  /* Fall through */
673  case MCI_DGV_GETDEVCAPS_MAXIMUM_RATE: /* unknown to w2k */
674  case MCI_DGV_GETDEVCAPS_MINIMUM_RATE: /* unknown to w2k */
676  }
677 
678  return MCI_RESOURCE_RETURNED;
679 }
680 
681 /***************************************************************************
682  * MCIQTZ_mciSet [internal]
683  */
685 {
686  WINE_MCIQTZ* wma;
687 
688  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
689 
690  if(!lpParms)
692 
693  wma = MCIQTZ_mciGetOpenDev(wDevID);
694  if (!wma)
696 
698  switch (lpParms->dwTimeFormat) {
700  TRACE("MCI_SET_TIME_FORMAT = MCI_FORMAT_MILLISECONDS\n");
702  break;
703  case MCI_FORMAT_FRAMES:
704  TRACE("MCI_SET_TIME_FORMAT = MCI_FORMAT_FRAMES\n");
706  break;
707  default:
708  WARN("Bad time format %u\n", lpParms->dwTimeFormat);
709  return MCIERR_BAD_TIME_FORMAT;
710  }
711  }
712 
714  FIXME("MCI_SET_DOOR_OPEN not implemented yet\n");
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");
726  FIXME("MCI_SET_AUDIO_LEFT not implemented yet\n");
728  FIXME("MCI_SET_AUDIO_RIGHT not implemented yet\n");
729 
730  if (dwFlags & ~0x7f03 /* All MCI_SET flags mask */)
731  ERR("Unknown flags %08x\n", dwFlags & ~0x7f03);
732 
733  return 0;
734 }
735 
736 /***************************************************************************
737  * MCIQTZ_mciStatus [internal]
738  */
740 {
741  WINE_MCIQTZ* wma;
742  HRESULT hr;
744 
745  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
746 
747  if(!lpParms)
749 
750  wma = MCIQTZ_mciGetOpenDev(wDevID);
751  if (!wma)
753 
754  if (!(dwFlags & MCI_STATUS_ITEM)) {
755  WARN("No status item specified\n");
757  }
758 
759  switch (lpParms->dwItem) {
760  case MCI_STATUS_LENGTH: {
761  LONGLONG duration = -1;
762  GUID format;
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;
767  }
768  hr = IMediaSeeking_SetTimeFormat(wma->seek, &format);
769  if (FAILED(hr)) {
770  FIXME("Cannot set time format (hr = %x)\n", hr);
771  lpParms->dwReturn = 0;
772  break;
773  }
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;
780  else
781  lpParms->dwReturn = duration / 10000;
782  break;
783  }
784  case MCI_STATUS_POSITION: {
785  REFERENCE_TIME curpos;
786 
787  hr = IMediaSeeking_GetCurrentPosition(wma->seek, &curpos);
788  if (FAILED(hr)) {
789  FIXME("Cannot get position (hr = %x)\n", hr);
790  return MCIERR_INTERNAL;
791  }
792  lpParms->dwReturn = curpos / 10000;
793  break;
794  }
796  FIXME("MCI_STATUS_NUMBER_OF_TRACKS not implemented yet\n");
798  case MCI_STATUS_MODE: {
799  LONG state = State_Stopped;
800  IMediaControl_GetState(wma->pmctrl, -1, &state);
801  if (state == State_Stopped)
803  else if (state == State_Running) {
805  if (!wma->thread || WaitForSingleObject(wma->thread, 0) == WAIT_OBJECT_0)
807  } else if (state == State_Paused)
810  break;
811  }
813  FIXME("MCI_STATUS_MEDIA_PRESENT not implemented yet\n");
816  lpParms->dwReturn = MAKEMCIRESOURCE(wma->time_format,
819  break;
820  case MCI_STATUS_READY:
821  FIXME("MCI_STATUS_READY not implemented yet\n");
824  FIXME("MCI_STATUS_CURRENT_TRACK not implemented yet\n");
826  default:
827  FIXME("Unknown command %08X\n", lpParms->dwItem);
829  }
830 
831  if (dwFlags & MCI_NOTIFY)
833 
834  return ret;
835 }
836 
837 /***************************************************************************
838  * MCIQTZ_mciWhere [internal]
839  */
841 {
842  WINE_MCIQTZ* wma;
843  HRESULT hr;
844  HWND hWnd;
845  RECT rc;
847 
848  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
849 
850  if(!lpParms)
852 
853  wma = MCIQTZ_mciGetOpenDev(wDevID);
854  if (!wma)
856 
857  hr = IVideoWindow_get_Owner(wma->vidwin, (OAHWND*)&hWnd);
858  if (FAILED(hr)) {
859  TRACE("No video stream, returning no window error\n");
860  return MCIERR_NO_WINDOW;
861  }
862 
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));
868  }
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));
874  }
877  FIXME("MCI_DGV_WHERE_FRAME_MAX not supported yet\n");
878  else
879  FIXME("MCI_DGV_WHERE_FRAME not supported yet\n");
880  goto out;
881  }
884  FIXME("MCI_DGV_WHERE_VIDEO_MAX not supported yet\n");
885  else
886  FIXME("MCI_DGV_WHERE_VIDEO not supported yet\n");
887  goto out;
888  }
890  if (dwFlags & MCI_DGV_WHERE_MAX) {
892  rc.right -= rc.left;
893  rc.bottom -= rc.top;
894  TRACE("MCI_DGV_WHERE_WINDOW_MAX %s\n", wine_dbgstr_rect(&rc));
895  } else {
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));
898  }
899  }
900  ret = 0;
901 out:
902  lpParms->rc = rc;
903  return ret;
904 }
905 
906 /***************************************************************************
907  * MCIQTZ_mciWindow [internal]
908  */
910 {
911  WINE_MCIQTZ *wma = MCIQTZ_mciGetOpenDev(wDevID);
912 
913  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
914 
915  if(!lpParms)
917 
918  if (!wma)
920  if (dwFlags & MCI_TEST)
921  return 0;
922 
923  if (dwFlags & MCI_DGV_WINDOW_HWND && (IsWindow(lpParms->hWnd) || !lpParms->hWnd)) {
924  LONG visible = OATRUE;
925  LONG style = 0;
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);
930  style &= ~WS_CHILD;
931  if (lpParms->hWnd)
932  IVideoWindow_put_WindowStyle(wma->vidwin, style|WS_CHILD);
933  else
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;
939  }
941  TRACE("Setting nCmdShow to %d\n", lpParms->nCmdShow);
942  IVideoWindow_put_WindowState(wma->vidwin, lpParms->nCmdShow);
943  }
945  TRACE("Setting caption to %s\n", debugstr_w(lpParms->lpstrText));
946  IVideoWindow_put_Caption(wma->vidwin, lpParms->lpstrText);
947  }
948  return 0;
949 }
950 
951 /***************************************************************************
952  * MCIQTZ_mciPut [internal]
953  */
955 {
956  WINE_MCIQTZ *wma = MCIQTZ_mciGetOpenDev(wDevID);
957  MCI_DGV_RECT_PARMS *rectparms;
958  HRESULT hr;
959 
960  TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
961 
962  if(!lpParms)
964 
965  if (!wma)
967 
968  if (!(dwFlags & MCI_DGV_RECT)) {
969  FIXME("No support for non-RECT MCI_PUT\n");
970  return 1;
971  }
972 
973  if (dwFlags & MCI_TEST)
974  return 0;
975 
976  dwFlags &= ~MCI_DGV_RECT;
977  rectparms = (MCI_DGV_RECT_PARMS*)lpParms;
978 
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);
984  if(FAILED(hr))
985  WARN("IVideoWindow_SetWindowPosition failed: 0x%x\n", hr);
986 
988  }
989 
990  if (dwFlags & MCI_NOTIFY) {
992  dwFlags &= ~MCI_NOTIFY;
993  }
994 
995  if (dwFlags)
996  FIXME("No support for some flags: 0x%x\n", dwFlags);
997 
998  return 0;
999 }
1000 
1001 /******************************************************************************
1002  * MCIAVI_mciUpdate [internal]
1003  */
1005 {
1006  WINE_MCIQTZ *wma;
1007  DWORD res = 0;
1008 
1009  TRACE("%04x, %08x, %p\n", wDevID, dwFlags, lpParms);
1010 
1011  if(!lpParms)
1013 
1014  wma = MCIQTZ_mciGetOpenDev(wDevID);
1015  if (!wma)
1016  return MCIERR_INVALID_DEVICE_ID;
1017 
1018  if (dwFlags & MCI_DGV_UPDATE_HDC) {
1019  LONG state, size;
1020  BYTE *data;
1021  BITMAPINFO *info;
1022  HRESULT hr;
1023  RECT src, dest;
1024  LONG visible = OATRUE;
1025 
1026  res = MCIERR_INTERNAL;
1027  IMediaControl_GetState(wma->pmctrl, -1, &state);
1028  if (state == State_Running)
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);
1034  if (wma->parent)
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);
1041  goto out;
1042  }
1043  data = HeapAlloc(GetProcessHeap(), 0, size);
1044  info = (BITMAPINFO*)data;
1045  IBasicVideo_GetCurrentImage(wma->vidbasic, &size, (LONG*)data);
1046  data += info->bmiHeader.biSize;
1047 
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,
1054  HeapFree(GetProcessHeap(), 0, data);
1055  res = 0;
1056 out:
1057  if (wma->parent)
1058  IVideoWindow_put_Visible(wma->vidwin, visible);
1059  }
1060  else if (dwFlags)
1061  FIXME("Unhandled flags %x\n", dwFlags);
1062  return res;
1063 }
1064 
1065 /***************************************************************************
1066  * MCIQTZ_mciSetAudio [internal]
1067  */
1069 {
1070  WINE_MCIQTZ *wma;
1071  DWORD ret = 0;
1072 
1073  TRACE("(%04x, %08x, %p)\n", wDevID, dwFlags, lpParms);
1074 
1075  if(!lpParms)
1077 
1078  wma = MCIQTZ_mciGetOpenDev(wDevID);
1079  if (!wma)
1080  return MCIERR_INVALID_DEVICE_ID;
1081 
1082  if (!(dwFlags & MCI_DGV_SETAUDIO_ITEM)) {
1083  FIXME("Unknown flags (%08x)\n", dwFlags);
1084  return 0;
1085  }
1086 
1088  switch (lpParms->dwItem) {
1091  long vol;
1092  HRESULT hr;
1093  if (lpParms->dwValue > 1000) {
1095  break;
1096  }
1097  if (dwFlags & MCI_TEST)
1098  break;
1099  if (lpParms->dwValue != 0)
1100  vol = (long)(2000.0 * (log10(lpParms->dwValue) - 3.0));
1101  else
1102  vol = -10000;
1103  TRACE("Setting volume to %ld\n", vol);
1104  hr = IBasicAudio_put_Volume(wma->audio, vol);
1105  if (FAILED(hr)) {
1106  WARN("Cannot set volume (hr = %x)\n", hr);
1107  ret = MCIERR_INTERNAL;
1108  }
1109  }
1110  break;
1111  default:
1112  FIXME("Unknown item %08x\n", lpParms->dwItem);
1113  break;
1114  }
1115  }
1116 
1117  return ret;
1118 }
1119 
1120 /*======================================================================*
1121  * MCI QTZ entry points *
1122  *======================================================================*/
1123 
1124 /**************************************************************************
1125  * DriverProc (MCIQTZ.@)
1126  */
1127 LRESULT CALLBACK MCIQTZ_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg,
1128  LPARAM dwParam1, LPARAM dwParam2)
1129 {
1130  TRACE("(%08lX, %p, %08X, %08lX, %08lX)\n",
1131  dwDevID, hDriv, wMsg, dwParam1, dwParam2);
1132 
1133  switch (wMsg) {
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;
1144  }
1145 
1146  /* session instance */
1147  if (dwDevID == 0xFFFFFFFF)
1148  return 1;
1149 
1150  switch (wMsg) {
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);
1164  case MCI_UPDATE:
1165  return MCIQTZ_mciUpdate(dwDevID, dwParam1, (LPMCI_DGV_UPDATE_PARMS)dwParam2);
1166  case MCI_WINDOW:
1167  return MCIQTZ_mciWindow(dwDevID, dwParam1, (LPMCI_DGV_WINDOW_PARMSW)dwParam2);
1168  case MCI_PUT:
1169  return MCIQTZ_mciPut(dwDevID, dwParam1, (MCI_GENERIC_PARMS*)dwParam2);
1170  case MCI_RECORD:
1171  case MCI_INFO:
1172  case MCI_LOAD:
1173  case MCI_SAVE:
1174  case MCI_FREEZE:
1175  case MCI_REALIZE:
1176  case MCI_UNFREEZE:
1177  case MCI_STEP:
1178  case MCI_COPY:
1179  case MCI_CUT:
1180  case MCI_DELETE:
1181  case MCI_PASTE:
1182  case MCI_CUE:
1183  /* Digital Video specific */
1184  case MCI_CAPTURE:
1185  case MCI_MONITOR:
1186  case MCI_RESERVE:
1187  case MCI_SIGNAL:
1188  case MCI_SETVIDEO:
1189  case MCI_QUALITY:
1190  case MCI_LIST:
1191  case MCI_UNDO:
1192  case MCI_CONFIGURE:
1193  case MCI_RESTORE:
1194  FIXME("Unimplemented command [%08X]\n", wMsg);
1195  break;
1196  case MCI_SPIN:
1197  case MCI_ESCAPE:
1198  WARN("Unsupported command [%08X]\n", wMsg);
1199  break;
1200  case MCI_OPEN:
1201  case MCI_CLOSE:
1202  FIXME("Shouldn't receive a MCI_OPEN or CLOSE message\n");
1203  break;
1204  default:
1205  TRACE("Sending msg [%08X] to default driver proc\n", wMsg);
1206  return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
1207  }
1208 
1210 }
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID fImpLoad)
Definition: mciqtz.c:46
#define DRV_DISABLE
Definition: mmsystem.h:123
BOOL WINAPI mciSetDriverData(UINT uDeviceID, DWORD dwData)
#define MCI_UNFREEZE
Definition: mmsystem.h:669
#define MCI_SETAUDIO
Definition: digitalv.h:39
#define MCI_DGV_PUT_DESTINATION
Definition: digitalv.h:234
DWORD_PTR dwCallback
Definition: digitalv.h:808
int WINAPI StretchDIBits(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ const VOID *, _In_ const BITMAPINFO *, _In_ UINT, _In_ DWORD)
#define MCI_ESCAPE
Definition: mmsystem.h:648
HANDLE callback
#define MCI_MODE_STOP
Definition: mmsystem.h:695
DWORD WINAPI mciGetDriverData(UINT uDeviceID)
Definition: mci.c:2066
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
#define MCI_COPY
Definition: mmsystem.h:672
#define MCI_RESTORE
Definition: digitalv.h:46
#define MCI_STATUS_ITEM
Definition: mmsystem.h:742
HRESULT hr
Definition: shlfolder.c:183
#define MCI_WAIT
Definition: mmsystem.h:730
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define MCI_DGV_WHERE_VIDEO
Definition: digitalv.h:447
IGraphBuilder * pgraph
#define MCI_DGV_WHERE_DESTINATION
Definition: digitalv.h:445
#define MCI_DGV_WHERE_MAX
Definition: digitalv.h:449
#define SW_HIDE
Definition: winuser.h:762
#define MCI_STATUS_NUMBER_OF_TRACKS
Definition: mmsystem.h:746
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static DWORD MCIQTZ_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMSW lpParms)
Definition: mciqtz.c:909
#define MCI_GETDEVCAPS_CAN_SAVE
Definition: mmsystem.h:767
#define MCI_CAPTURE
Definition: digitalv.h:36
DWORD dwTimeFormat
Definition: digitalv.h:733
#define MCIERR_UNSUPPORTED_FUNCTION
Definition: mmsystem.h:584
#define WARN(fmt,...)
Definition: debug.h:111
MCIDEVICEID notify_devid
static HINSTANCE MCIQTZ_hInstance
Definition: mciqtz.c:41
#define MCI_STEP
Definition: mmsystem.h:657
#define CALLBACK
Definition: compat.h:27
DWORD_PTR dwCallback
Definition: mmsystem.h:1537
HWND hWnd
Definition: settings.c:17
#define MCI_DEVTYPE_DIGITAL_VIDEO
Definition: mmsystem.h:687
GLdouble n
Definition: glext.h:7729
LONG top
Definition: windef.h:292
HANDLE HWND
Definition: compat.h:13
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define MCI_DGV_SETAUDIO_ITEM
Definition: digitalv.h:296
#define MCI_PASTE
Definition: mmsystem.h:673
#define MCI_RESERVE
Definition: digitalv.h:38
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
UINT WINAPI mciLoadCommandResource(HINSTANCE hInstance, LPCWSTR lpResName, UINT uType)
Definition: mci.c:1460
#define MCI_GETDEVCAPS_COMPOUND_DEVICE
Definition: mmsystem.h:764
static DWORD MCIQTZ_drvClose(DWORD dwDevID)
Definition: mciqtz.c:101
#define MCI_SET_OFF
Definition: mmsystem.h:778
#define MCI_PLAY
Definition: mmsystem.h:649
#define DRV_CLOSE
Definition: mmsystem.h:122
IMediaSeeking * seek
#define MCI_RESUME
Definition: mmsystem.h:675
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
#define MCI_DGV_UPDATE_HDC
Definition: digitalv.h:439
#define MCI_SET_AUDIO
Definition: mmsystem.h:775
#define MCI_RESOURCE_RETURNED
Definition: mmddk.h:369
#define WS_CHILD
Definition: pedump.c:617
LONG left
Definition: windef.h:291
REFERENCE_TIME seek_stop
#define MCI_FREEZE
Definition: mmsystem.h:668
#define MCI_GETDEVCAPS_CAN_RECORD
Definition: mmsystem.h:759
#define MAKEMCIRESOURCE(wRet, wRes)
Definition: mmddk.h:388
#define MCI_SET_DOOR_CLOSED
Definition: mmsystem.h:773
LONG right
Definition: windef.h:293
#define MCI_DGV_GETDEVCAPS_CAN_LOCK
Definition: digitalv.h:116
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
Definition: synch.c:151
#define MCI_STATUS_POSITION
Definition: mmsystem.h:745
#define MCI_CUE
Definition: mmsystem.h:663
#define MCI_SAVE
Definition: mmsystem.h:661
#define MCI_NOTIFY_ABORTED
Definition: mmsystem.h:727
#define MCI_QUALITY
Definition: digitalv.h:42
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static DWORD MCIQTZ_mciPut(UINT wDevID, DWORD dwFlags, MCI_GENERIC_PARMS *lpParms)
Definition: mciqtz.c:954
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
#define OAFALSE
Definition: dshow.h:53
static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSW lpOpenParms)
Definition: mciqtz.c:160
#define DRV_QUERYCONFIGURE
Definition: mmsystem.h:126
#define DRV_OPEN
Definition: mmsystem.h:121
struct _test_info info[]
Definition: SetCursorPos.c:19
static DWORD MCIQTZ_mciResume(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
Definition: mciqtz.c:562
#define MCI_STOP
Definition: mmsystem.h:651
#define MCI_WINDOW
Definition: mmsystem.h:665
int WINAPI MessageBoxA(_In_opt_ HWND, _In_opt_ LPCSTR, _In_opt_ LPCSTR, _In_ UINT)
IBasicVideo * vidbasic
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
BOOL WINAPI mciDriverNotify(HWND hwndCallback, UINT uDeviceID, UINT uStatus)
Definition: mci.c:2056
#define MCI_GETDEVCAPS_USES_FILES
Definition: mmsystem.h:763
#define MCI_SET
Definition: mmsystem.h:656
static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
Definition: mciqtz.c:398
#define MCI_DGV_SETAUDIO_VOLUME
Definition: digitalv.h:305
DWORD_PTR dwCallback
Definition: digitalv.h:604
#define MCI_FORMAT_FRAMES
Definition: mmsystem.h:704
static DWORD MCIQTZ_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS lpParms)
Definition: mciqtz.c:1004
#define MCI_OPEN_ELEMENT_ID
Definition: mmsystem.h:737
static DWORD MCIQTZ_mciSeek(UINT wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
Definition: mciqtz.c:465
#define MCI_FORMAT_MILLISECONDS
Definition: mmsystem.h:701
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
#define MCI_RECORD
Definition: mmsystem.h:658
UINT wCustomCommandTable
Definition: mmddk.h:438
static DWORD MCIQTZ_mciStop(UINT, DWORD, LPMCI_GENERIC_PARMS)
Definition: mciqtz.c:510
IMediaEvent * mevent
#define MCI_SIGNAL
Definition: digitalv.h:40
#define debugstr_w
Definition: kernel32.h:32
#define MCI_MODE_PLAY
Definition: mmsystem.h:696
#define FIXME(fmt,...)
Definition: debug.h:110
IBasicAudio * audio
#define MCI_WHERE
Definition: mmsystem.h:667
#define MCI_GETDEVCAPS_DEVICE_TYPE
Definition: mmsystem.h:762
#define MCI_DGV_GETDEVCAPS_MAXIMUM_RATE
Definition: digitalv.h:125
#define MCI_DGV_WHERE_SOURCE
Definition: digitalv.h:444
LONG_PTR OAHWND
Definition: control.idl:31
const WCHAR * str
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:652
LONG_PTR LPARAM
Definition: windef.h:208
#define DRV_LOAD(x)
#define MCI_OPEN
Definition: mmsystem.h:646
#define EC_COMPLETE
Definition: evcode.h:17
DWORD time_format
#define MCIERR_MISSING_PARAMETER
Definition: mmsystem.h:583
#define DRVCNF_RESTART
Definition: mmsystem.h:135
#define DRV_REMOVE
Definition: mmsystem.h:128
#define MCI_INFO
Definition: mmsystem.h:653
static DWORD MCIQTZ_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms)
Definition: mciqtz.c:840
#define MCI_DGV_WINDOW_TEXT
Definition: digitalv.h:455
#define MCI_DGV_OPEN_PARENT
Definition: digitalv.h:212
#define MCI_GETDEVCAPS_HAS_VIDEO
Definition: mmsystem.h:761
#define MCI_DGV_WINDOW_HWND
Definition: digitalv.h:453
#define MCI_CONFIGURE
Definition: digitalv.h:45
#define MCI_DGV_PLAY_REPEAT
Definition: digitalv.h:227
#define MCI_OPEN_DRIVER
Definition: mmddk.h:334
static void MCIQTZ_mciNotify(DWORD_PTR hWndCallBack, WINE_MCIQTZ *wma, UINT wStatus)
Definition: mciqtz.c:149
#define MCI_STATUS
Definition: mmsystem.h:662
int64_t LONGLONG
Definition: typedefs.h:66
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
#define MCI_SET_ON
Definition: mmsystem.h:777
#define WAIT_OBJECT_0
Definition: winbase.h:387
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define MCI_DGV_GETDEVCAPS_MAX_WINDOWS
Definition: digitalv.h:119
#define MCI_STATUS_LENGTH
Definition: mmsystem.h:744
LPWSTR lpstrElementName
Definition: digitalv.h:607
#define DRV_CONFIGURE
Definition: mmsystem.h:125
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MCI_DGV_GETDEVCAPS_CAN_TEST
Definition: digitalv.h:124
#define MCI_SET_TIME_FORMAT
Definition: mmsystem.h:774
LONG HRESULT
Definition: typedefs.h:77
#define MCI_TEST
Definition: digitalv.h:32
#define MCI_SET_AUDIO_LEFT
Definition: mmsystem.h:780
static DWORD MCIQTZ_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms)
Definition: mciqtz.c:684
#define MCIERR_BAD_TIME_FORMAT
Definition: mmsystem.h:601
IVideoWindow * vidwin
#define MCI_DGV_GETDEVCAPS_MINIMUM_RATE
Definition: digitalv.h:126
UINT command_table
#define WINAPI
Definition: msvc.h:8
#define MCI_REALIZE
Definition: mmsystem.h:664
const char * wine_dbgstr_rect(const RECT *rect)
_STLP_DECLSPEC complex< float > _STLP_CALL log10(const complex< float > &)
Definition: complex.cpp:230
static FILE * out
Definition: regtests2xml.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD MCIQTZ_drvOpen(LPCWSTR str, LPMCI_OPEN_DRIVER_PARMSW modp)
Definition: mciqtz.c:74
#define DRV_FREE
Definition: mmsystem.h:124
#define MCI_STATUS_MODE
Definition: mmsystem.h:747
BOOL WINAPI mciFreeCommandResource(UINT uTable)
Definition: mci.c:1500
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static DWORD CALLBACK MCIQTZ_notifyThread(LPVOID parm)
Definition: mciqtz.c:329
#define MCI_SETVIDEO
Definition: digitalv.h:41
DWORD_PTR dwCallback
Definition: mmsystem.h:1543
#define MCI_NOTIFY_SUCCESSFUL
Definition: mmsystem.h:725
int ret
#define MCI_SET_AUDIO_RIGHT
Definition: mmsystem.h:781
static DWORD MCIQTZ_mciClose(UINT, DWORD, LPMCI_GENERIC_PARMS)
Definition: mciqtz.c:298
#define MCI_DGV_WHERE_FRAME
Definition: digitalv.h:446
REFERENCE_TIME seek_start
#define MCI_LOAD
Definition: mmsystem.h:670
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define MCI_DGV_GETDEVCAPS_HAS_STILL
Definition: digitalv.h:121
static int state
Definition: maze.c:121
#define MCI_GETDEVCAPS_HAS_AUDIO
Definition: mmsystem.h:760
#define MCIERR_INTERNAL
Definition: mmsystem.h:587
#define MCI_STATUS_CURRENT_TRACK
Definition: mmsystem.h:751
unsigned char BYTE
Definition: mem.h:68
#define MCI_CUT
Definition: mmsystem.h:671
DWORD_PTR dwReturn
Definition: digitalv.h:809
#define MCI_SEEK_TO_END
Definition: mmsystem.h:741
#define MCIERR_OUTOFRANGE
Definition: mmsystem.h:592
#define MCI_GETDEVCAPS_ITEM
Definition: mmsystem.h:758
#define MCI_FALSE
Definition: mmddk.h:340
GLenum src
Definition: glext.h:6340
#define err(...)
HANDLE stop_event
static DWORD MCIQTZ_mciSetAudio(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SETAUDIO_PARMSW lpParms)
Definition: mciqtz.c:1068
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define MCI_CLOSE_DRIVER
Definition: mmddk.h:335
#define MCI_SEEK_TO_START
Definition: mmsystem.h:740
#define DRV_ENABLE
Definition: mmsystem.h:120
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define ERR(fmt,...)
Definition: debug.h:109
LRESULT CALLBACK MCIQTZ_DriverProc(DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
Definition: mciqtz.c:1127
#define MCI_DGV_GETDEVCAPS_CAN_REVERSE
Definition: digitalv.h:120
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define HWND_32(h16)
Definition: wownt32.h:29
#define S_OK
Definition: intsafe.h:59
DWORD LPVOID fImpLoad
Definition: misc.cpp:155
#define MCI_SET_VIDEO
Definition: mmsystem.h:776
#define MCI_NOTIFY_SUPERSEDED
Definition: mmsystem.h:726
#define MCI_DGV_WINDOW_STATE
Definition: digitalv.h:454
#define MCI_DGV_GETDEVCAPS_CAN_STRETCH
Definition: digitalv.h:117
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
#define MCI_PUT
Definition: mmsystem.h:666
DWORD_PTR dwCallback
Definition: mmsystem.h:1517
static WINE_MCIQTZ * MCIQTZ_mciGetOpenDev(UINT wDevID)
Definition: mciqtz.c:60
#define long
Definition: qsort.c:33
#define MCI_DGV_SETAUDIO_VALUE
Definition: digitalv.h:297
#define MCI_OPEN_ELEMENT
Definition: mmsystem.h:735
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:1935
unsigned int UINT
Definition: ndis.h:50
static DWORD MCIQTZ_drvConfigure(DWORD dwDevID)
Definition: mciqtz.c:126
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define MB_OK
Definition: winuser.h:784
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define MCI_CLOSE
Definition: mmsystem.h:647
#define MCI_INTEGER_RETURNED
Definition: mmddk.h:372
#define MCI_GETDEVCAPS
Definition: mmsystem.h:654
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
#define MCI_TRUE
Definition: mmddk.h:341
static DWORD MCIQTZ_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSW lpParms)
Definition: mciqtz.c:739
UINT MCIDEVICEID
Definition: mmsystem.h:959
static DWORD MCIQTZ_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms)
Definition: mciqtz.c:585
#define MCIERR_UNRECOGNIZED_COMMAND
Definition: mmsystem.h:571
#define MCI_DGV_GETDEVCAPS_CAN_STR_IN
Definition: digitalv.h:123
GLuint res
Definition: glext.h:9613
#define MCI_GETDEVCAPS_CAN_EJECT
Definition: mmsystem.h:765
#define MCI_MODE_PAUSE
Definition: mmsystem.h:699
#define MCI_PAUSE
Definition: mmsystem.h:652
#define MCI_FROM
Definition: mmsystem.h:731
#define MCI_DGV_GETDEVCAPS_CAN_FREEZE
Definition: digitalv.h:118
#define DRV_INSTALL
Definition: mmsystem.h:127
LONG bottom
Definition: windef.h:294
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
Definition: driver.c:554
#define MCI_DGV_RECT
Definition: digitalv.h:232
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
static char * dest
Definition: rtl.c:135
#define MCI_DGV_OPEN_WS
Definition: digitalv.h:211
#define MCI_UNDO
Definition: digitalv.h:44
#define MCIERR_INVALID_DEVICE_ID
Definition: mmsystem.h:569
#define MCI_STATUS_TIME_FORMAT
Definition: mmsystem.h:749
LONG_PTR LRESULT
Definition: windef.h:209
#define MCI_NOTIFY
Definition: mmsystem.h:729
#define DIB_RGB_COLORS
Definition: wingdi.h:366
LONG_PTR OAEVENT
Definition: control.idl:32
#define INFINITE
Definition: serial.h:102
#define MCIERR_NO_WINDOW
Definition: mmsystem.h:639
Arabic default style
Definition: afstyles.h:93
IMediaControl * pmctrl
#define MCI_STATUS_MEDIA_PRESENT
Definition: mmsystem.h:748
#define MCI_MONITOR
Definition: digitalv.h:37
#define MCIERR_NULL_PARAMETER_BLOCK
Definition: mmsystem.h:605
#define MCI_SPIN
Definition: mmsystem.h:655
#define LOWORD(l)
Definition: pedump.c:82
WINE_DEFAULT_DEBUG_CHANNEL(mciqtz)
#define HeapFree(x, y, z)
Definition: compat.h:394
#define MCI_UPDATE
Definition: mmsystem.h:674
#define SRCCOPY
Definition: wingdi.h:332
#define MCI_SEEK
Definition: mmsystem.h:650
#define MCI_DELETE
Definition: mmsystem.h:676
#define MCI_TO
Definition: mmsystem.h:732
#define MCI_DGV_WHERE_WINDOW
Definition: digitalv.h:448
#define OATRUE
Definition: dshow.h:49
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define MCI_SET_DOOR_OPEN
Definition: mmsystem.h:772
#define MCI_FORMAT_RETURN_BASE
Definition: mmddk.h:343
#define MCI_LIST
Definition: digitalv.h:43
static DWORD MCIQTZ_mciPause(UINT wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
Definition: mciqtz.c:539
#define MCI_STATUS_READY
Definition: mmsystem.h:750
#define MCI_GETDEVCAPS_CAN_PLAY
Definition: mmsystem.h:766
MCIDEVICEID wDevID