reg/tests: Test import with non-standard registry file headers.
[wine.git] / dlls / mciavi32 / info.c
blobf6797787e8a5108ffcdc188c04f59d8611ce85e1
1 /*
2 * Digital video MCI Wine Driver
4 * Copyright 1999, 2000 Eric POUECH
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
21 #include <string.h>
22 #include "private_mciavi.h"
23 #include "wine/debug.h"
24 #include "wine/unicode.h"
26 WINE_DEFAULT_DEBUG_CHANNEL(mciavi);
28 /**************************************************************************
29 * MCIAVI_ConvertFrameToTimeFormat [internal]
31 static DWORD MCIAVI_ConvertFrameToTimeFormat(WINE_MCIAVI* wma, DWORD val, LPDWORD lpRet)
33 DWORD ret = 0;
35 switch (wma->dwMciTimeFormat) {
36 case MCI_FORMAT_MILLISECONDS:
37 ret = (val * wma->mah.dwMicroSecPerFrame) / 1000;
38 break;
39 case MCI_FORMAT_FRAMES:
40 ret = val;
41 break;
42 default:
43 WARN("Bad time format %u!\n", wma->dwMciTimeFormat);
45 TRACE("val=%u=0x%08x [tf=%u] => ret=%u\n", val, val, wma->dwMciTimeFormat, ret);
46 *lpRet = 0;
47 return ret;
50 /**************************************************************************
51 * MCIAVI_ConvertTimeFormatToFrame [internal]
53 DWORD MCIAVI_ConvertTimeFormatToFrame(WINE_MCIAVI* wma, DWORD val)
55 DWORD ret = 0;
57 switch (wma->dwMciTimeFormat) {
58 case MCI_FORMAT_MILLISECONDS:
59 ret = (val * 1000) / wma->mah.dwMicroSecPerFrame;
60 break;
61 case MCI_FORMAT_FRAMES:
62 ret = val;
63 break;
64 default:
65 WARN("Bad time format %u!\n", wma->dwMciTimeFormat);
67 TRACE("val=%u=0x%08x [tf=%u] => ret=%u\n", val, val, wma->dwMciTimeFormat, ret);
68 return ret;
71 /***************************************************************************
72 * MCIAVI_mciGetDevCaps [internal]
74 DWORD MCIAVI_mciGetDevCaps(UINT wDevID, DWORD dwFlags, LPMCI_GETDEVCAPS_PARMS lpParms)
76 WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
77 DWORD ret = MCIERR_UNSUPPORTED_FUNCTION;
79 TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
81 if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
82 if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
83 if (!(dwFlags & MCI_GETDEVCAPS_ITEM)) return MCIERR_MISSING_PARAMETER;
84 if (dwFlags & MCI_TEST) return 0;
86 EnterCriticalSection(&wma->cs);
88 if (dwFlags & MCI_GETDEVCAPS_ITEM) {
89 switch (lpParms->dwItem) {
90 case MCI_GETDEVCAPS_DEVICE_TYPE:
91 TRACE("MCI_GETDEVCAPS_DEVICE_TYPE !\n");
92 lpParms->dwReturn = MAKEMCIRESOURCE(MCI_DEVTYPE_DIGITAL_VIDEO, MCI_DEVTYPE_DIGITAL_VIDEO);
93 ret = MCI_RESOURCE_RETURNED;
94 break;
95 case MCI_GETDEVCAPS_HAS_AUDIO:
96 TRACE("MCI_GETDEVCAPS_HAS_AUDIO !\n");
97 lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
98 ret = MCI_RESOURCE_RETURNED;
99 break;
100 case MCI_GETDEVCAPS_HAS_VIDEO:
101 TRACE("MCI_GETDEVCAPS_HAS_VIDEO !\n");
102 lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
103 ret = MCI_RESOURCE_RETURNED;
104 break;
105 case MCI_GETDEVCAPS_USES_FILES:
106 TRACE("MCI_GETDEVCAPS_USES_FILES !\n");
107 lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
108 ret = MCI_RESOURCE_RETURNED;
109 break;
110 case MCI_GETDEVCAPS_COMPOUND_DEVICE:
111 TRACE("MCI_GETDEVCAPS_COMPOUND_DEVICE !\n");
112 lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
113 ret = MCI_RESOURCE_RETURNED;
114 break;
115 case MCI_GETDEVCAPS_CAN_EJECT:
116 TRACE("MCI_GETDEVCAPS_CAN_EJECT !\n");
117 lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
118 ret = MCI_RESOURCE_RETURNED;
119 break;
120 case MCI_GETDEVCAPS_CAN_PLAY:
121 TRACE("MCI_GETDEVCAPS_CAN_PLAY !\n");
122 lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
123 ret = MCI_RESOURCE_RETURNED;
124 break;
125 case MCI_GETDEVCAPS_CAN_RECORD:
126 TRACE("MCI_GETDEVCAPS_CAN_RECORD !\n");
127 lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
128 ret = MCI_RESOURCE_RETURNED;
129 break;
130 case MCI_GETDEVCAPS_CAN_SAVE:
131 TRACE("MCI_GETDEVCAPS_CAN_SAVE !\n");
132 lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
133 ret = MCI_RESOURCE_RETURNED;
134 break;
135 case MCI_DGV_GETDEVCAPS_CAN_REVERSE:
136 TRACE("MCI_DGV_GETDEVCAPS_CAN_REVERSE !\n");
137 lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE); /* FIXME */
138 ret = MCI_RESOURCE_RETURNED;
139 break;
140 case MCI_DGV_GETDEVCAPS_CAN_STRETCH:
141 TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH !\n");
142 lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE); /* FIXME */
143 ret = MCI_RESOURCE_RETURNED;
144 break;
145 case MCI_DGV_GETDEVCAPS_CAN_LOCK:
146 TRACE("MCI_DGV_GETDEVCAPS_CAN_LOCK !\n");
147 lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
148 ret = MCI_RESOURCE_RETURNED;
149 break;
150 case MCI_DGV_GETDEVCAPS_CAN_FREEZE:
151 TRACE("MCI_DGV_GETDEVCAPS_CAN_FREEZE !\n");
152 lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
153 ret = MCI_RESOURCE_RETURNED;
154 break;
155 case MCI_DGV_GETDEVCAPS_CAN_STR_IN:
156 TRACE("MCI_DGV_GETDEVCAPS_CAN_STRETCH_INPUT !\n");
157 lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
158 ret = MCI_RESOURCE_RETURNED;
159 break;
160 case MCI_DGV_GETDEVCAPS_HAS_STILL:
161 TRACE("MCI_DGV_GETDEVCAPS_HAS_STILL !\n");
162 lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE);
163 ret = MCI_RESOURCE_RETURNED;
164 break;
165 case MCI_DGV_GETDEVCAPS_CAN_TEST:
166 TRACE("MCI_DGV_GETDEVCAPS_CAN_TEST !\n");
167 lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
168 ret = MCI_RESOURCE_RETURNED;
169 break;
170 case MCI_DGV_GETDEVCAPS_PALETTES:
171 TRACE("MCI_DGV_GETDEVCAPS_PALETTES !\n");
172 lpParms->dwReturn = MAKEMCIRESOURCE(FALSE, MCI_FALSE); /* FIXME */
173 ret = MCI_RESOURCE_RETURNED;
174 break;
175 /* w2k does not know MAX_WINDOWS or MAX/MINIMUM_RATE */
176 default:
177 FIXME("Unknown capability (%08x) !\n", lpParms->dwItem);
178 break;
182 LeaveCriticalSection(&wma->cs);
183 return ret;
186 /***************************************************************************
187 * MCIAVI_mciInfo [internal]
189 DWORD MCIAVI_mciInfo(UINT wDevID, DWORD dwFlags, LPMCI_DGV_INFO_PARMSW lpParms)
191 LPCWSTR str = 0;
192 WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
193 DWORD ret = 0;
194 static const WCHAR wszAviPlayer[] = {'W','i','n','e','\'','s',' ','A','V','I',' ','p','l','a','y','e','r',0};
196 if (lpParms == NULL || lpParms->lpstrReturn == NULL)
197 return MCIERR_NULL_PARAMETER_BLOCK;
198 if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
199 if (dwFlags & MCI_TEST) return 0;
201 TRACE("buf=%p, len=%u\n", lpParms->lpstrReturn, lpParms->dwRetSize);
203 EnterCriticalSection(&wma->cs);
205 if (dwFlags & MCI_INFO_PRODUCT)
206 str = wszAviPlayer;
207 else if (dwFlags & MCI_INFO_FILE)
208 str = wma->lpFileName;
209 else {
210 WARN("Don't know this info command (%u)\n", dwFlags);
211 ret = MCIERR_UNRECOGNIZED_COMMAND;
213 if (!ret) {
214 WCHAR zero = 0;
215 /* Only mciwave, mciseq and mcicda set dwRetSize (since NT). */
216 lstrcpynW(lpParms->lpstrReturn, str ? str : &zero, lpParms->dwRetSize);
218 LeaveCriticalSection(&wma->cs);
219 return ret;
222 /***************************************************************************
223 * MCIAVI_mciSet [internal]
225 DWORD MCIAVI_mciSet(UINT wDevID, DWORD dwFlags, LPMCI_DGV_SET_PARMS lpParms)
227 WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
229 if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
230 if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
231 if (dwFlags & MCI_TEST) return 0;
233 EnterCriticalSection(&wma->cs);
235 if (dwFlags & MCI_SET_TIME_FORMAT) {
236 switch (lpParms->dwTimeFormat) {
237 case MCI_FORMAT_MILLISECONDS:
238 TRACE("MCI_FORMAT_MILLISECONDS !\n");
239 wma->dwMciTimeFormat = MCI_FORMAT_MILLISECONDS;
240 break;
241 case MCI_FORMAT_FRAMES:
242 TRACE("MCI_FORMAT_FRAMES !\n");
243 wma->dwMciTimeFormat = MCI_FORMAT_FRAMES;
244 break;
245 default:
246 WARN("Bad time format %u!\n", lpParms->dwTimeFormat);
247 LeaveCriticalSection(&wma->cs);
248 return MCIERR_BAD_TIME_FORMAT;
252 if (dwFlags & MCI_SET_DOOR_OPEN) {
253 TRACE("No support for door open !\n");
254 LeaveCriticalSection(&wma->cs);
255 return MCIERR_UNSUPPORTED_FUNCTION;
257 if (dwFlags & MCI_SET_DOOR_CLOSED) {
258 TRACE("No support for door close !\n");
259 LeaveCriticalSection(&wma->cs);
260 return MCIERR_UNSUPPORTED_FUNCTION;
263 if (dwFlags & MCI_SET_ON) {
264 const char *szVideo="";
265 const char *szAudio="";
266 const char *szSeek="";
268 if (dwFlags & MCI_SET_VIDEO) {
269 szVideo = " video";
270 wma->dwSet |= 4;
272 if (dwFlags & MCI_SET_AUDIO) {
273 switch (lpParms->dwAudio) {
274 case MCI_SET_AUDIO_ALL:
275 szAudio = " audio all";
276 wma->dwSet |= 3;
277 break;
278 case MCI_SET_AUDIO_LEFT:
279 szAudio = " audio left";
280 wma->dwSet |= 1;
281 break;
282 case MCI_SET_AUDIO_RIGHT:
283 szAudio = " audio right";
284 wma->dwSet |= 2;
285 break;
286 default:
287 szAudio = " audio unknown";
288 WARN("Unknown audio channel %u\n", lpParms->dwAudio);
289 break;
292 if (dwFlags & MCI_DGV_SET_SEEK_EXACTLY) {
293 szSeek = " seek_exactly";
295 FIXME("MCI_SET_ON:%s%s%s\n", szVideo, szAudio, szSeek);
298 if (dwFlags & MCI_SET_OFF) {
299 const char *szVideo="";
300 const char *szAudio="";
301 const char *szSeek="";
303 if (dwFlags & MCI_SET_VIDEO) {
304 szVideo = " video";
305 wma->dwSet &= ~4;
307 if (dwFlags & MCI_SET_AUDIO) {
308 switch (lpParms->dwAudio) {
309 case MCI_SET_AUDIO_ALL:
310 szAudio = " audio all";
311 wma->dwSet &= ~3;
312 break;
313 case MCI_SET_AUDIO_LEFT:
314 szAudio = " audio left";
315 wma->dwSet &= ~2;
316 break;
317 case MCI_SET_AUDIO_RIGHT:
318 szAudio = " audio right";
319 wma->dwSet &= ~2;
320 break;
321 default:
322 szAudio = " audio unknown";
323 WARN("Unknown audio channel %u\n", lpParms->dwAudio);
324 break;
327 if (dwFlags & MCI_DGV_SET_SEEK_EXACTLY) {
328 szSeek = " seek_exactly";
330 FIXME("MCI_SET_OFF:%s%s%s\n", szVideo, szAudio, szSeek);
332 if (dwFlags & MCI_DGV_SET_FILEFORMAT) {
333 LPCSTR str = "save";
334 if (dwFlags & MCI_DGV_SET_STILL)
335 str = "capture";
337 switch (lpParms->dwFileFormat) {
338 case MCI_DGV_FF_AVI: FIXME("Setting file format (%s) to 'AVI'\n", str); break;
339 case MCI_DGV_FF_AVSS: FIXME("Setting file format (%s) to 'AVSS'\n", str); break;
340 case MCI_DGV_FF_DIB: FIXME("Setting file format (%s) to 'DIB'\n", str); break;
341 case MCI_DGV_FF_JFIF: FIXME("Setting file format (%s) to 'JFIF'\n", str); break;
342 case MCI_DGV_FF_JPEG: FIXME("Setting file format (%s) to 'JPEG'\n", str); break;
343 case MCI_DGV_FF_MPEG: FIXME("Setting file format (%s) to 'MPEG'\n", str); break;
344 case MCI_DGV_FF_RDIB: FIXME("Setting file format (%s) to 'RLE DIB'\n", str); break;
345 case MCI_DGV_FF_RJPEG: FIXME("Setting file format (%s) to 'RJPEG'\n", str); break;
346 default: FIXME("Setting unknown file format (%s): %d\n", str, lpParms->dwFileFormat);
350 if (dwFlags & MCI_DGV_SET_SPEED) {
351 FIXME("Setting speed to %d\n", lpParms->dwSpeed);
354 LeaveCriticalSection(&wma->cs);
355 return 0;
358 /***************************************************************************
359 * MCIAVI_mciStatus [internal]
361 DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSW lpParms)
363 WINE_MCIAVI* wma = MCIAVI_mciGetOpenDev(wDevID);
364 DWORD ret = 0;
366 if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
367 if (wma == NULL) return MCIERR_INVALID_DEVICE_ID;
368 if (!(dwFlags & MCI_STATUS_ITEM)) return MCIERR_MISSING_PARAMETER;
369 if (dwFlags & MCI_TEST) return 0;
371 EnterCriticalSection(&wma->cs);
373 if (dwFlags & MCI_STATUS_ITEM) {
374 switch (lpParms->dwItem) {
375 case MCI_STATUS_CURRENT_TRACK:
376 lpParms->dwReturn = 1;
377 TRACE("MCI_STATUS_CURRENT_TRACK => %lu\n", lpParms->dwReturn);
378 break;
379 case MCI_STATUS_LENGTH:
380 if (!wma->hFile) {
381 lpParms->dwReturn = 0;
382 LeaveCriticalSection(&wma->cs);
383 return MCIERR_UNSUPPORTED_FUNCTION;
385 /* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
386 lpParms->dwReturn = MCIAVI_ConvertFrameToTimeFormat(wma, wma->mah.dwTotalFrames, &ret);
387 TRACE("MCI_STATUS_LENGTH => %lu\n", lpParms->dwReturn);
388 break;
389 case MCI_STATUS_MODE:
390 lpParms->dwReturn = MAKEMCIRESOURCE(wma->dwStatus, wma->dwStatus);
391 ret = MCI_RESOURCE_RETURNED;
392 TRACE("MCI_STATUS_MODE => 0x%04x\n", LOWORD(lpParms->dwReturn));
393 break;
394 case MCI_STATUS_MEDIA_PRESENT:
395 TRACE("MCI_STATUS_MEDIA_PRESENT => TRUE\n");
396 lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
397 ret = MCI_RESOURCE_RETURNED;
398 break;
399 case MCI_STATUS_NUMBER_OF_TRACKS:
400 lpParms->dwReturn = 1;
401 TRACE("MCI_STATUS_NUMBER_OF_TRACKS => %lu\n", lpParms->dwReturn);
402 break;
403 case MCI_STATUS_POSITION:
404 if (!wma->hFile) {
405 lpParms->dwReturn = 0;
406 LeaveCriticalSection(&wma->cs);
407 return MCIERR_UNSUPPORTED_FUNCTION;
409 /* only one track in file is currently handled, so don't take care of MCI_TRACK flag */
410 lpParms->dwReturn = MCIAVI_ConvertFrameToTimeFormat(wma,
411 (dwFlags & MCI_STATUS_START) ? 0 : wma->dwCurrVideoFrame,
412 &ret);
413 TRACE("MCI_STATUS_POSITION %s => %lu\n",
414 (dwFlags & MCI_STATUS_START) ? "start" : "current", lpParms->dwReturn);
415 break;
416 case MCI_STATUS_READY:
417 lpParms->dwReturn = (wma->dwStatus == MCI_MODE_NOT_READY) ?
418 MAKEMCIRESOURCE(FALSE, MCI_FALSE) : MAKEMCIRESOURCE(TRUE, MCI_TRUE);
419 ret = MCI_RESOURCE_RETURNED;
420 TRACE("MCI_STATUS_READY = %u\n", LOWORD(lpParms->dwReturn));
421 break;
422 case MCI_STATUS_TIME_FORMAT:
423 lpParms->dwReturn = MAKEMCIRESOURCE(wma->dwMciTimeFormat,
424 wma->dwMciTimeFormat + MCI_FORMAT_RETURN_BASE);
425 TRACE("MCI_STATUS_TIME_FORMAT => %u\n", LOWORD(lpParms->dwReturn));
426 ret = MCI_RESOURCE_RETURNED;
427 break;
428 case MCI_DGV_STATUS_AUDIO:
429 lpParms->dwReturn = (wma->dwSet & 3) ?
430 MAKEMCIRESOURCE(MCI_ON, MCI_ON_S) : MAKEMCIRESOURCE(MCI_OFF, MCI_OFF_S);
431 ret = MCI_RESOURCE_RETURNED|MCI_RESOURCE_DRIVER;
432 TRACE("MCI_STATUS_AUDIO = %u\n", LOWORD(lpParms->dwReturn));
433 break;
434 case MCI_DGV_STATUS_VIDEO:
435 lpParms->dwReturn = (wma->dwSet & 4) ?
436 MAKEMCIRESOURCE(MCI_ON, MCI_ON_S) : MAKEMCIRESOURCE(MCI_OFF, MCI_OFF_S);
437 ret = MCI_RESOURCE_RETURNED|MCI_RESOURCE_DRIVER;
438 TRACE("MCI_STATUS_VIDEO = %u\n", LOWORD(lpParms->dwReturn));
439 break;
441 #if 0
442 case MCI_AVI_STATUS_AUDIO_BREAKS:
443 case MCI_AVI_STATUS_FRAMES_SKIPPED:
444 case MCI_AVI_STATUS_LAST_PLAY_SPEED:
445 case MCI_DGV_STATUS_AUDIO_INPUT:
446 case MCI_DGV_STATUS_AUDIO_RECORD:
447 case MCI_DGV_STATUS_AUDIO_SOURCE:
448 case MCI_DGV_STATUS_AVGBYTESPERSEC:
449 case MCI_DGV_STATUS_BASS:
450 case MCI_DGV_STATUS_BITSPERSAMPLE:
451 case MCI_DGV_STATUS_BLOCKALIGN:
452 case MCI_DGV_STATUS_BRIGHTNESS:
453 case MCI_DGV_STATUS_COLOR:
454 case MCI_DGV_STATUS_CONTRAST:
455 case MCI_DGV_STATUS_FILEFORMAT:
456 case MCI_DGV_STATUS_FILE_MODE:
457 case MCI_DGV_STATUS_FILE_COMPLETION:
458 case MCI_DGV_STATUS_GAMMA:
459 #endif
460 case MCI_DGV_STATUS_BITSPERPEL:
461 lpParms->dwReturn = wma->inbih->biBitCount;
462 TRACE("MCI_DGV_STATUS_BITSPERPEL => %lu\n", lpParms->dwReturn);
463 break;
464 case MCI_DGV_STATUS_HPAL:
465 lpParms->dwReturn = 0;
466 TRACE("MCI_DGV_STATUS_HPAL => %lx\n", lpParms->dwReturn);
467 break;
468 case MCI_DGV_STATUS_HWND:
469 lpParms->dwReturn = (DWORD_PTR)wma->hWndPaint;
470 TRACE("MCI_DGV_STATUS_HWND => %p\n", wma->hWndPaint);
471 break;
472 case MCI_DGV_STATUS_WINDOW_VISIBLE:
473 lpParms->dwReturn = IsWindowVisible(wma->hWndPaint) ?
474 MAKEMCIRESOURCE(TRUE, MCI_TRUE) : MAKEMCIRESOURCE(FALSE, MCI_FALSE);
475 ret = MCI_RESOURCE_RETURNED;
476 TRACE("MCI_STATUS_WINDOW_VISIBLE = %u\n", LOWORD(lpParms->dwReturn));
477 break;
478 case MCI_DGV_STATUS_WINDOW_MINIMIZED:
479 lpParms->dwReturn = IsIconic(wma->hWndPaint) ?
480 MAKEMCIRESOURCE(TRUE, MCI_TRUE) : MAKEMCIRESOURCE(FALSE, MCI_FALSE);
481 ret = MCI_RESOURCE_RETURNED;
482 TRACE("MCI_STATUS_WINDOW_MINIMIZED = %u\n", LOWORD(lpParms->dwReturn));
483 break;
484 case MCI_DGV_STATUS_WINDOW_MAXIMIZED:
485 lpParms->dwReturn = IsZoomed(wma->hWndPaint) ?
486 MAKEMCIRESOURCE(TRUE, MCI_TRUE) : MAKEMCIRESOURCE(FALSE, MCI_FALSE);
487 ret = MCI_RESOURCE_RETURNED;
488 TRACE("MCI_STATUS_WINDOW_MMAXIMIZED = %u\n", LOWORD(lpParms->dwReturn));
489 break;
490 case MCI_DGV_STATUS_SPEED:
491 lpParms->dwReturn = 1000;
492 TRACE("MCI_DGV_STATUS_SPEED = %lu\n", lpParms->dwReturn);
493 break;
494 case MCI_DGV_STATUS_FRAME_RATE:
495 /* FIXME: 1000 is a settable speed multiplier */
496 lpParms->dwReturn = MulDiv(1000000,1000,wma->mah.dwMicroSecPerFrame);
497 TRACE("MCI_DGV_STATUS_FRAME_RATE = %lu\n", lpParms->dwReturn);
498 break;
499 case MCI_DGV_STATUS_FORWARD:
500 lpParms->dwReturn = MAKEMCIRESOURCE(TRUE, MCI_TRUE);
501 ret = MCI_RESOURCE_RETURNED;
502 TRACE("MCI_DGV_STATUS_FORWARD = %u\n", LOWORD(lpParms->dwReturn));
503 break;
504 case MCI_DGV_STATUS_PAUSE_MODE:
505 if (wma->dwStatus != MCI_MODE_PAUSE) {
506 LeaveCriticalSection(&wma->cs);
507 return MCIERR_NONAPPLICABLE_FUNCTION;
509 lpParms->dwReturn = MAKEMCIRESOURCE(MCI_MODE_PLAY, MCI_MODE_PLAY);
510 ret = MCI_RESOURCE_RETURNED;
511 TRACE("MCI_STATUS_MODE => 0x%04x\n", LOWORD(lpParms->dwReturn));
512 break;
513 case MCI_DGV_STATUS_AUDIO_STREAM:
514 lpParms->dwReturn = wma->audio_stream_n;
515 TRACE("MCI_DGV_STATUS_AUDIO_STREAM => %lu\n", lpParms->dwReturn);
516 break;
517 #if 0
518 case MCI_DGV_STATUS_KEY_COLOR:
519 case MCI_DGV_STATUS_KEY_INDEX:
520 case MCI_DGV_STATUS_MONITOR:
521 case MCI_DGV_MONITOR_FILE:
522 case MCI_DGV_MONITOR_INPUT:
523 case MCI_DGV_STATUS_MONITOR_METHOD:
524 case MCI_DGV_STATUS_SAMPLESPERSECOND:
525 case MCI_DGV_STATUS_SEEK_EXACTLY:
526 case MCI_DGV_STATUS_SHARPNESS:
527 case MCI_DGV_STATUS_SIZE:
528 case MCI_DGV_STATUS_SMPTE:
529 case MCI_DGV_STATUS_STILL_FILEFORMAT:
530 case MCI_DGV_STATUS_TINT:
531 case MCI_DGV_STATUS_TREBLE:
532 case MCI_DGV_STATUS_UNSAVED:
533 case MCI_DGV_STATUS_VIDEO_RECORD:
534 case MCI_DGV_STATUS_VIDEO_SOURCE:
535 case MCI_DGV_STATUS_VIDEO_SRC_NUM:
536 case MCI_DGV_STATUS_VIDEO_STREAM:
537 case MCI_DGV_STATUS_VOLUME:
538 #endif
539 default:
540 FIXME("Unknown command %08X !\n", lpParms->dwItem);
541 TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms);
542 LeaveCriticalSection(&wma->cs);
543 return MCIERR_UNSUPPORTED_FUNCTION;
547 if (dwFlags & MCI_NOTIFY) {
548 TRACE("MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
549 mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)),
550 wDevID, MCI_NOTIFY_SUCCESSFUL);
552 LeaveCriticalSection(&wma->cs);
553 return ret;