Fixed the behavior for SHGetFileInfo when the SHGFI_USEFILEATTRIBUTES
[wine] / dlls / quartz / seekpass.c
1 /*
2  *      Implementation of CLSID_SeekingPassThru
3  *
4  *      FIXME - not tested yet.
5  *
6  * hidenori@a2.ctktv.ne.jp
7  */
8
9 #include "config.h"
10
11 #include "windef.h"
12 #include "winbase.h"
13 #include "wingdi.h"
14 #include "winuser.h"
15 #include "winerror.h"
16 #include "strmif.h"
17 #include "control.h"
18 #include "uuids.h"
19
20 #include "debugtools.h"
21 DEFAULT_DEBUG_CHANNEL(quartz);
22
23 #include "quartz_private.h"
24 #include "seekpass.h"
25
26
27 /***************************************************************************
28  *
29  *      CSeekingPassThru::ISeekingPassThru
30  *
31  */
32
33 static HRESULT WINAPI
34 ISeekingPassThru_fnQueryInterface(ISeekingPassThru* iface,REFIID riid,void** ppobj)
35 {
36         CSeekingPassThru_THIS(iface,seekpass);
37
38         TRACE("(%p)->()\n",This);
39
40         return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
41 }
42
43 static ULONG WINAPI
44 ISeekingPassThru_fnAddRef(ISeekingPassThru* iface)
45 {
46         CSeekingPassThru_THIS(iface,seekpass);
47
48         TRACE("(%p)->()\n",This);
49
50         return IUnknown_AddRef(This->unk.punkControl);
51 }
52
53 static ULONG WINAPI
54 ISeekingPassThru_fnRelease(ISeekingPassThru* iface)
55 {
56         CSeekingPassThru_THIS(iface,seekpass);
57
58         TRACE("(%p)->()\n",This);
59
60         return IUnknown_Release(This->unk.punkControl);
61 }
62
63 static HRESULT WINAPI
64 ISeekingPassThru_fnInit(ISeekingPassThru* iface,BOOL bRendering,IPin* pPin)
65 {
66         CSeekingPassThru_THIS(iface,seekpass);
67
68         FIXME("(%p)->(%d,%p) not tested!\n",This,bRendering,pPin);
69
70         if ( pPin == NULL )
71                 return E_POINTER;
72
73         /* Why is 'bRendering' given as an argument?? */
74         EnterCriticalSection( &This->cs );
75
76         if ( This->passthru.pPin != NULL )
77                 IPin_Release( This->passthru.pPin );
78         This->passthru.pPin = pPin; IPin_AddRef( pPin );
79
80         LeaveCriticalSection( &This->cs );
81
82         return NOERROR;
83 }
84
85
86 static ICOM_VTABLE(ISeekingPassThru) iseekingpassthru =
87 {
88         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
89         /* IUnknown fields */
90         ISeekingPassThru_fnQueryInterface,
91         ISeekingPassThru_fnAddRef,
92         ISeekingPassThru_fnRelease,
93         /* ISeekingPassThru fields */
94         ISeekingPassThru_fnInit,
95 };
96
97 static
98 HRESULT CSeekingPassThru_InitISeekingPassThru(CSeekingPassThru* This)
99 {
100         TRACE("(%p)\n",This);
101         ICOM_VTBL(&This->seekpass) = &iseekingpassthru;
102         This->passthru.punk = This->unk.punkControl;
103         This->passthru.pPin = NULL;
104         InitializeCriticalSection( &This->cs );
105
106         return NOERROR;
107 }
108
109 static
110 void CSeekingPassThru_UninitISeekingPassThru(CSeekingPassThru* This)
111 {
112         TRACE("(%p)\n",This);
113         if ( This->passthru.pPin != NULL )
114         {
115                 IPin_Release( This->passthru.pPin );
116                 This->passthru.pPin = NULL;
117         }
118         DeleteCriticalSection( &This->cs );
119 }
120
121 /***************************************************************************
122  *
123  *      new/delete for CLSID_SeekingPassThru.
124  *
125  */
126
127 /* can I use offsetof safely? - FIXME? */
128 static QUARTZ_IFEntry IFEntries[] =
129 {
130   { &IID_ISeekingPassThru, offsetof(CSeekingPassThru,seekpass)-offsetof(CSeekingPassThru,unk) },
131   { &IID_IMediaPosition, offsetof(CSeekingPassThru,passthru.mpos)-offsetof(CSeekingPassThru,unk) },
132   { &IID_IMediaSeeking, offsetof(CSeekingPassThru,passthru.mseek)-offsetof(CSeekingPassThru,unk) },
133 };
134
135
136 static void QUARTZ_DestroySeekingPassThru(IUnknown* punk)
137 {
138         CSeekingPassThru_THIS(punk,unk);
139
140         TRACE("(%p)\n",This);
141
142         CPassThruImpl_UninitIMediaSeeking( &This->passthru );
143         CPassThruImpl_UninitIMediaPosition( &This->passthru );
144         CSeekingPassThru_UninitISeekingPassThru(This);
145 }
146
147 HRESULT QUARTZ_CreateSeekingPassThru(IUnknown* punkOuter,void** ppobj)
148 {
149         HRESULT hr;
150         CSeekingPassThru*       This;
151
152         TRACE("(%p,%p)\n",punkOuter,ppobj);
153
154         hr = QUARTZ_CreateSeekingPassThruInternal(punkOuter,&This,FALSE,NULL);
155         if ( hr != S_OK )
156                 return hr;
157
158         ppobj = (void*)(&This->unk);
159
160         return NOERROR;
161 }
162
163 HRESULT QUARTZ_CreateSeekingPassThruInternal(IUnknown* punkOuter,CSeekingPassThru** ppobj,BOOL bRendering,IPin* pPin)
164 {
165         CSeekingPassThru*       This;
166         HRESULT hr;
167
168         TRACE("(%p,%p,%d,%p)\n",punkOuter,ppobj,(int)bRendering,pPin);
169
170         This = (CSeekingPassThru*)QUARTZ_AllocObj( sizeof(CSeekingPassThru) );
171         if ( This == NULL )
172                 return E_OUTOFMEMORY;
173
174         QUARTZ_IUnkInit( &This->unk, punkOuter );
175         hr = CSeekingPassThru_InitISeekingPassThru(This);
176         if ( SUCCEEDED(hr) )
177         {
178                 hr = CPassThruImpl_InitIMediaPosition( &This->passthru );
179                 if ( SUCCEEDED(hr) )
180                 {
181                         hr = CPassThruImpl_InitIMediaSeeking( &This->passthru );
182                         if ( FAILED(hr) )
183                         {
184                                 CPassThruImpl_UninitIMediaPosition( &This->passthru );
185                         }
186                 }
187                 else
188                 {
189                         CSeekingPassThru_UninitISeekingPassThru(This);
190                 }
191         }
192
193         if ( FAILED(hr) )
194         {
195                 QUARTZ_FreeObj( This );
196                 return hr;
197         }
198
199         This->unk.pEntries = IFEntries;
200         This->unk.dwEntries = sizeof(IFEntries)/sizeof(IFEntries[0]);
201         This->unk.pOnFinalRelease = QUARTZ_DestroySeekingPassThru;
202
203         *ppobj = This;
204
205         if ( pPin != NULL )
206         {
207                 hr = ISeekingPassThru_Init((ISeekingPassThru*)(&This->seekpass),bRendering,pPin);
208                 if ( FAILED(hr) )
209                 {
210                         IUnknown_Release(This->unk.punkControl);
211                         return hr;
212                 }
213         }
214
215         return S_OK;
216 }
217
218
219
220
221 /***************************************************************************
222  *
223  *      CPassThruImpl Helper methods.
224  *
225  */
226
227 static
228 HRESULT CPassThruImpl_GetConnected( CPassThruImpl* pImpl, IPin** ppPin )
229 {
230         return IPin_ConnectedTo( pImpl->pPin, ppPin );
231 }
232
233 HRESULT CPassThruImpl_QueryPosPass(
234         CPassThruImpl* pImpl, IMediaPosition** ppPosition )
235 {
236         IPin*   pPin;
237         HRESULT hr;
238
239         hr = CPassThruImpl_GetConnected( pImpl, &pPin );
240         if ( FAILED(hr) )
241                 return hr;
242         hr = IPin_QueryInterface(pPin,&IID_IMediaPosition,(void**)ppPosition);
243         IPin_Release(pPin);
244
245         return hr;
246 }
247
248 HRESULT CPassThruImpl_QuerySeekPass(
249         CPassThruImpl* pImpl, IMediaSeeking** ppSeeking )
250 {
251         IPin*   pPin;
252         HRESULT hr;
253
254         hr = CPassThruImpl_GetConnected( pImpl, &pPin );
255         if ( FAILED(hr) )
256                 return hr;
257         hr = IPin_QueryInterface(pPin,&IID_IMediaSeeking,(void**)ppSeeking);
258         IPin_Release(pPin);
259
260         return hr;
261 }
262
263 /***************************************************************************
264  *
265  *      An implementation for CPassThruImpl::IMediaPosition.
266  *
267  */
268
269
270 #define QUERYPOSPASS \
271         IMediaPosition* pPos = NULL; \
272         HRESULT hr; \
273         hr = CPassThruImpl_QueryPosPass( This, &pPos ); \
274         if ( FAILED(hr) ) return hr;
275
276 static HRESULT WINAPI
277 IMediaPosition_fnQueryInterface(IMediaPosition* iface,REFIID riid,void** ppobj)
278 {
279         CPassThruImpl_THIS(iface,mpos);
280
281         TRACE("(%p)->()\n",This);
282
283         return IUnknown_QueryInterface(This->punk,riid,ppobj);
284 }
285
286 static ULONG WINAPI
287 IMediaPosition_fnAddRef(IMediaPosition* iface)
288 {
289         CPassThruImpl_THIS(iface,mpos);
290
291         TRACE("(%p)->()\n",This);
292
293         return IUnknown_AddRef(This->punk);
294 }
295
296 static ULONG WINAPI
297 IMediaPosition_fnRelease(IMediaPosition* iface)
298 {
299         CPassThruImpl_THIS(iface,mpos);
300
301         TRACE("(%p)->()\n",This);
302
303         return IUnknown_Release(This->punk);
304 }
305
306 static HRESULT WINAPI
307 IMediaPosition_fnGetTypeInfoCount(IMediaPosition* iface,UINT* pcTypeInfo)
308 {
309         CPassThruImpl_THIS(iface,mpos);
310
311         FIXME("(%p)->() stub!\n",This);
312
313         return E_NOTIMPL;
314 }
315
316 static HRESULT WINAPI
317 IMediaPosition_fnGetTypeInfo(IMediaPosition* iface,UINT iTypeInfo, LCID lcid, ITypeInfo** ppobj)
318 {
319         CPassThruImpl_THIS(iface,mpos);
320
321         FIXME("(%p)->() stub!\n",This);
322
323         return E_NOTIMPL;
324 }
325
326 static HRESULT WINAPI
327 IMediaPosition_fnGetIDsOfNames(IMediaPosition* iface,REFIID riid, LPOLESTR* ppwszName, UINT cNames, LCID lcid, DISPID* pDispId)
328 {
329         CPassThruImpl_THIS(iface,mpos);
330
331         FIXME("(%p)->() stub!\n",This);
332
333         return E_NOTIMPL;
334 }
335
336 static HRESULT WINAPI
337 IMediaPosition_fnInvoke(IMediaPosition* iface,DISPID DispId, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarRes, EXCEPINFO* pExcepInfo, UINT* puArgErr)
338 {
339         CPassThruImpl_THIS(iface,mpos);
340
341         FIXME("(%p)->() stub!\n",This);
342
343         return E_NOTIMPL;
344 }
345
346
347 static HRESULT WINAPI
348 IMediaPosition_fnget_Duration(IMediaPosition* iface,REFTIME* prefTime)
349 {
350         CPassThruImpl_THIS(iface,mpos);
351         QUERYPOSPASS
352
353         TRACE("(%p)->()\n",This);
354
355         return IMediaPosition_get_Duration(pPos,prefTime);
356 }
357
358 static HRESULT WINAPI
359 IMediaPosition_fnput_CurrentPosition(IMediaPosition* iface,REFTIME refTime)
360 {
361         CPassThruImpl_THIS(iface,mpos);
362         QUERYPOSPASS
363
364         TRACE("(%p)->()\n",This);
365
366         return IMediaPosition_put_CurrentPosition(pPos,refTime);
367 }
368
369 static HRESULT WINAPI
370 IMediaPosition_fnget_CurrentPosition(IMediaPosition* iface,REFTIME* prefTime)
371 {
372         CPassThruImpl_THIS(iface,mpos);
373         QUERYPOSPASS
374
375         TRACE("(%p)->()\n",This);
376
377         return IMediaPosition_get_CurrentPosition(pPos,prefTime);
378 }
379
380 static HRESULT WINAPI
381 IMediaPosition_fnget_StopTime(IMediaPosition* iface,REFTIME* prefTime)
382 {
383         CPassThruImpl_THIS(iface,mpos);
384         QUERYPOSPASS
385
386         TRACE("(%p)->()\n",This);
387
388         return IMediaPosition_get_StopTime(pPos,prefTime);
389 }
390
391 static HRESULT WINAPI
392 IMediaPosition_fnput_StopTime(IMediaPosition* iface,REFTIME refTime)
393 {
394         CPassThruImpl_THIS(iface,mpos);
395         QUERYPOSPASS
396
397         TRACE("(%p)->()\n",This);
398
399         return IMediaPosition_put_StopTime(pPos,refTime);
400 }
401
402 static HRESULT WINAPI
403 IMediaPosition_fnget_PrerollTime(IMediaPosition* iface,REFTIME* prefTime)
404 {
405         CPassThruImpl_THIS(iface,mpos);
406         QUERYPOSPASS
407
408         TRACE("(%p)->()\n",This);
409
410         return IMediaPosition_get_PrerollTime(pPos,prefTime);
411 }
412
413 static HRESULT WINAPI
414 IMediaPosition_fnput_PrerollTime(IMediaPosition* iface,REFTIME refTime)
415 {
416         CPassThruImpl_THIS(iface,mpos);
417         QUERYPOSPASS
418
419         TRACE("(%p)->()\n",This);
420
421         return IMediaPosition_put_PrerollTime(pPos,refTime);
422 }
423
424 static HRESULT WINAPI
425 IMediaPosition_fnput_Rate(IMediaPosition* iface,double dblRate)
426 {
427         CPassThruImpl_THIS(iface,mpos);
428         QUERYPOSPASS
429
430         TRACE("(%p)->()\n",This);
431
432         return IMediaPosition_put_Rate(pPos,dblRate);
433 }
434
435 static HRESULT WINAPI
436 IMediaPosition_fnget_Rate(IMediaPosition* iface,double* pdblRate)
437 {
438         CPassThruImpl_THIS(iface,mpos);
439         QUERYPOSPASS
440
441         TRACE("(%p)->()\n",This);
442
443         return IMediaPosition_get_Rate(pPos,pdblRate);
444 }
445
446 static HRESULT WINAPI
447 IMediaPosition_fnCanSeekForward(IMediaPosition* iface,LONG* pCanSeek)
448 {
449         CPassThruImpl_THIS(iface,mpos);
450         QUERYPOSPASS
451
452         TRACE("(%p)->()\n",This);
453
454         return IMediaPosition_CanSeekForward(pPos,pCanSeek);
455 }
456
457 static HRESULT WINAPI
458 IMediaPosition_fnCanSeekBackward(IMediaPosition* iface,LONG* pCanSeek)
459 {
460         CPassThruImpl_THIS(iface,mpos);
461         QUERYPOSPASS
462
463         TRACE("(%p)->()\n",This);
464
465         return IMediaPosition_CanSeekBackward(pPos,pCanSeek);
466 }
467
468
469 static ICOM_VTABLE(IMediaPosition) impos =
470 {
471         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
472         /* IUnknown fields */
473         IMediaPosition_fnQueryInterface,
474         IMediaPosition_fnAddRef,
475         IMediaPosition_fnRelease,
476         /* IDispatch fields */
477         IMediaPosition_fnGetTypeInfoCount,
478         IMediaPosition_fnGetTypeInfo,
479         IMediaPosition_fnGetIDsOfNames,
480         IMediaPosition_fnInvoke,
481         /* IMediaPosition fields */
482         IMediaPosition_fnget_Duration,
483         IMediaPosition_fnput_CurrentPosition,
484         IMediaPosition_fnget_CurrentPosition,
485         IMediaPosition_fnget_StopTime,
486         IMediaPosition_fnput_StopTime,
487         IMediaPosition_fnget_PrerollTime,
488         IMediaPosition_fnput_PrerollTime,
489         IMediaPosition_fnput_Rate,
490         IMediaPosition_fnget_Rate,
491         IMediaPosition_fnCanSeekForward,
492         IMediaPosition_fnCanSeekBackward,
493 };
494
495
496 HRESULT CPassThruImpl_InitIMediaPosition( CPassThruImpl* pImpl )
497 {
498         TRACE("(%p)\n",pImpl);
499         ICOM_VTBL(&pImpl->mpos) = &impos;
500
501         return NOERROR;
502 }
503
504 void CPassThruImpl_UninitIMediaPosition( CPassThruImpl* pImpl )
505 {
506         TRACE("(%p)\n",pImpl);
507 }
508
509 #undef QUERYPOSPASS
510
511
512 /***************************************************************************
513  *
514  *      An implementation for CPassThruImpl::IMediaSeeking.
515  *
516  */
517
518 #define QUERYSEEKPASS \
519         IMediaSeeking* pSeek = NULL; \
520         HRESULT hr; \
521         hr = CPassThruImpl_QuerySeekPass( This, &pSeek ); \
522         if ( FAILED(hr) ) return hr;
523
524
525 static HRESULT WINAPI
526 IMediaSeeking_fnQueryInterface(IMediaSeeking* iface,REFIID riid,void** ppobj)
527 {
528         CPassThruImpl_THIS(iface,mseek);
529
530         TRACE("(%p)->()\n",This);
531
532         return IUnknown_QueryInterface(This->punk,riid,ppobj);
533 }
534
535 static ULONG WINAPI
536 IMediaSeeking_fnAddRef(IMediaSeeking* iface)
537 {
538         CPassThruImpl_THIS(iface,mseek);
539
540         TRACE("(%p)->()\n",This);
541
542         return IUnknown_AddRef(This->punk);
543 }
544
545 static ULONG WINAPI
546 IMediaSeeking_fnRelease(IMediaSeeking* iface)
547 {
548         CPassThruImpl_THIS(iface,mseek);
549
550         TRACE("(%p)->()\n",This);
551
552         return IUnknown_Release(This->punk);
553 }
554
555
556 static HRESULT WINAPI
557 IMediaSeeking_fnGetCapabilities(IMediaSeeking* iface,DWORD* pdwCaps)
558 {
559         CPassThruImpl_THIS(iface,mseek);
560         QUERYSEEKPASS
561
562         TRACE("(%p)->()\n",This);
563
564         return IMediaSeeking_GetCapabilities(pSeek,pdwCaps);
565 }
566
567 static HRESULT WINAPI
568 IMediaSeeking_fnCheckCapabilities(IMediaSeeking* iface,DWORD* pdwCaps)
569 {
570         CPassThruImpl_THIS(iface,mseek);
571         QUERYSEEKPASS
572
573         TRACE("(%p)->()\n",This);
574
575         return IMediaSeeking_CheckCapabilities(pSeek,pdwCaps);
576 }
577
578 static HRESULT WINAPI
579 IMediaSeeking_fnIsFormatSupported(IMediaSeeking* iface,const GUID* pidFormat)
580 {
581         CPassThruImpl_THIS(iface,mseek);
582         QUERYSEEKPASS
583
584         TRACE("(%p)->()\n",This);
585
586         return IMediaSeeking_IsFormatSupported(pSeek,pidFormat);
587 }
588
589 static HRESULT WINAPI
590 IMediaSeeking_fnQueryPreferredFormat(IMediaSeeking* iface,GUID* pidFormat)
591 {
592         CPassThruImpl_THIS(iface,mseek);
593         QUERYSEEKPASS
594
595         TRACE("(%p)->()\n",This);
596
597         return IMediaSeeking_QueryPreferredFormat(pSeek,pidFormat);
598 }
599
600 static HRESULT WINAPI
601 IMediaSeeking_fnGetTimeFormat(IMediaSeeking* iface,GUID* pidFormat)
602 {
603         CPassThruImpl_THIS(iface,mseek);
604         QUERYSEEKPASS
605
606         TRACE("(%p)->()\n",This);
607
608         return IMediaSeeking_GetTimeFormat(pSeek,pidFormat);
609 }
610
611 static HRESULT WINAPI
612 IMediaSeeking_fnIsUsingTimeFormat(IMediaSeeking* iface,const GUID* pidFormat)
613 {
614         CPassThruImpl_THIS(iface,mseek);
615         QUERYSEEKPASS
616
617         TRACE("(%p)->()\n",This);
618
619         return IMediaSeeking_IsUsingTimeFormat(pSeek,pidFormat);
620 }
621
622 static HRESULT WINAPI
623 IMediaSeeking_fnSetTimeFormat(IMediaSeeking* iface,const GUID* pidFormat)
624 {
625         CPassThruImpl_THIS(iface,mseek);
626         QUERYSEEKPASS
627
628         TRACE("(%p)->()\n",This);
629
630         return IMediaSeeking_SetTimeFormat(pSeek,pidFormat);
631 }
632
633 static HRESULT WINAPI
634 IMediaSeeking_fnGetDuration(IMediaSeeking* iface,LONGLONG* pllDuration)
635 {
636         CPassThruImpl_THIS(iface,mseek);
637         QUERYSEEKPASS
638
639         TRACE("(%p)->()\n",This);
640
641         return IMediaSeeking_GetDuration(pSeek,pllDuration);
642 }
643
644 static HRESULT WINAPI
645 IMediaSeeking_fnGetStopPosition(IMediaSeeking* iface,LONGLONG* pllPos)
646 {
647         CPassThruImpl_THIS(iface,mseek);
648         QUERYSEEKPASS
649
650         TRACE("(%p)->()\n",This);
651
652         return IMediaSeeking_GetStopPosition(pSeek,pllPos);
653 }
654
655 static HRESULT WINAPI
656 IMediaSeeking_fnGetCurrentPosition(IMediaSeeking* iface,LONGLONG* pllPos)
657 {
658         CPassThruImpl_THIS(iface,mseek);
659         QUERYSEEKPASS
660
661         TRACE("(%p)->()\n",This);
662
663         return IMediaSeeking_GetCurrentPosition(pSeek,pllPos);
664 }
665
666 static HRESULT WINAPI
667 IMediaSeeking_fnConvertTimeFormat(IMediaSeeking* iface,LONGLONG* pllOut,const GUID* pidFmtOut,LONGLONG llIn,const GUID* pidFmtIn)
668 {
669         CPassThruImpl_THIS(iface,mseek);
670         QUERYSEEKPASS
671
672         TRACE("(%p)->()\n",This);
673
674         return IMediaSeeking_ConvertTimeFormat(pSeek,pllOut,pidFmtOut,llIn,pidFmtIn);
675 }
676
677 static HRESULT WINAPI
678 IMediaSeeking_fnSetPositions(IMediaSeeking* iface,LONGLONG* pllCur,DWORD dwCurFlags,LONGLONG* pllStop,DWORD dwStopFlags)
679 {
680         CPassThruImpl_THIS(iface,mseek);
681         QUERYSEEKPASS
682
683         TRACE("(%p)->()\n",This);
684
685         return IMediaSeeking_SetPositions(pSeek,pllCur,dwCurFlags,pllStop,dwStopFlags);
686 }
687
688 static HRESULT WINAPI
689 IMediaSeeking_fnGetPositions(IMediaSeeking* iface,LONGLONG* pllCur,LONGLONG* pllStop)
690 {
691         CPassThruImpl_THIS(iface,mseek);
692         QUERYSEEKPASS
693
694         TRACE("(%p)->()\n",This);
695
696         return IMediaSeeking_GetPositions(pSeek,pllCur,pllStop);
697 }
698
699 static HRESULT WINAPI
700 IMediaSeeking_fnGetAvailable(IMediaSeeking* iface,LONGLONG* pllFirst,LONGLONG* pllLast)
701 {
702         CPassThruImpl_THIS(iface,mseek);
703         QUERYSEEKPASS
704
705         TRACE("(%p)->()\n",This);
706
707         return IMediaSeeking_GetAvailable(pSeek,pllFirst,pllLast);
708 }
709
710 static HRESULT WINAPI
711 IMediaSeeking_fnSetRate(IMediaSeeking* iface,double dblRate)
712 {
713         CPassThruImpl_THIS(iface,mseek);
714         QUERYSEEKPASS
715
716         TRACE("(%p)->()\n",This);
717
718         return IMediaSeeking_SetRate(pSeek,dblRate);
719 }
720
721 static HRESULT WINAPI
722 IMediaSeeking_fnGetRate(IMediaSeeking* iface,double* pdblRate)
723 {
724         CPassThruImpl_THIS(iface,mseek);
725         QUERYSEEKPASS
726
727         TRACE("(%p)->()\n",This);
728
729         return IMediaSeeking_GetRate(pSeek,pdblRate);
730 }
731
732 static HRESULT WINAPI
733 IMediaSeeking_fnGetPreroll(IMediaSeeking* iface,LONGLONG* pllPreroll)
734 {
735         CPassThruImpl_THIS(iface,mseek);
736         QUERYSEEKPASS
737
738         TRACE("(%p)->()\n",This);
739
740         return IMediaSeeking_GetPreroll(pSeek,pllPreroll);
741 }
742
743
744
745
746 static ICOM_VTABLE(IMediaSeeking) imseek =
747 {
748         ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
749         /* IUnknown fields */
750         IMediaSeeking_fnQueryInterface,
751         IMediaSeeking_fnAddRef,
752         IMediaSeeking_fnRelease,
753         /* IMediaSeeking fields */
754         IMediaSeeking_fnGetCapabilities,
755         IMediaSeeking_fnCheckCapabilities,
756         IMediaSeeking_fnIsFormatSupported,
757         IMediaSeeking_fnQueryPreferredFormat,
758         IMediaSeeking_fnGetTimeFormat,
759         IMediaSeeking_fnIsUsingTimeFormat,
760         IMediaSeeking_fnSetTimeFormat,
761         IMediaSeeking_fnGetDuration,
762         IMediaSeeking_fnGetStopPosition,
763         IMediaSeeking_fnGetCurrentPosition,
764         IMediaSeeking_fnConvertTimeFormat,
765         IMediaSeeking_fnSetPositions,
766         IMediaSeeking_fnGetPositions,
767         IMediaSeeking_fnGetAvailable,
768         IMediaSeeking_fnSetRate,
769         IMediaSeeking_fnGetRate,
770         IMediaSeeking_fnGetPreroll,
771 };
772
773
774
775 HRESULT CPassThruImpl_InitIMediaSeeking( CPassThruImpl* pImpl )
776 {
777         TRACE("(%p)\n",pImpl);
778         ICOM_VTBL(&pImpl->mseek) = &imseek;
779
780         return NOERROR;
781 }
782
783 void CPassThruImpl_UninitIMediaSeeking( CPassThruImpl* pImpl )
784 {
785         TRACE("(%p)\n",pImpl);
786 }
787
788 #undef QUERYSEEKPASS