ReactOS  0.4.14-dev-358-gbef841c
CKsProxy Class Reference
Inheritance diagram for CKsProxy:
Collaboration diagram for CKsProxy:

Public Types

typedef std::vector< IUnknown * > ProxyPluginVector
 
typedef std::vector< IPin * > PinVector
 
- Public Types inherited from IBaseFilter
typedef struct IBaseFilter::_FilterInfo FILTER_INFO
 
- Public Types inherited from IMediaFilter
enum  _FilterState { State_Stopped, State_Paused, State_Running }
 
typedef enum IMediaFilter::_FilterState FILTER_STATE
 
- Public Types inherited from IPersist
typedef IPersistLPPERSIST
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IPersistPropertyBag
typedef IPersistPropertyBagLPPERSISTPROPERTYBAG
 
- Public Types inherited from IPersistStream
typedef IPersistStreamLPPERSISTSTREAM
 
- Public Types inherited from ISpecifyPropertyPages
typedef ISpecifyPropertyPagesLPSPECIFYPROPERTYPAGES
 
typedef struct ISpecifyPropertyPages::tagCAUUID CAUUID
 
typedef struct ISpecifyPropertyPages::tagCAUUIDLPCAUUID
 

Public Member Functions

STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
HRESULT STDMETHODCALLTYPE GetClassID (CLSID *pClassID)
 
HRESULT STDMETHODCALLTYPE Stop (void)
 
HRESULT STDMETHODCALLTYPE Pause (void)
 
HRESULT STDMETHODCALLTYPE Run (REFERENCE_TIME tStart)
 
HRESULT STDMETHODCALLTYPE GetState (DWORD dwMilliSecsTimeout, FILTER_STATE *State)
 
HRESULT STDMETHODCALLTYPE SetSyncSource (IReferenceClock *pClock)
 
HRESULT STDMETHODCALLTYPE GetSyncSource (IReferenceClock **pClock)
 
HRESULT STDMETHODCALLTYPE EnumPins (IEnumPins **ppEnum)
 
HRESULT STDMETHODCALLTYPE FindPin (LPCWSTR Id, IPin **ppPin)
 
HRESULT STDMETHODCALLTYPE QueryFilterInfo (FILTER_INFO *pInfo)
 
HRESULT STDMETHODCALLTYPE JoinFilterGraph (IFilterGraph *pGraph, LPCWSTR pName)
 
HRESULT STDMETHODCALLTYPE QueryVendorInfo (LPWSTR *pVendorInfo)
 
HRESULT STDMETHODCALLTYPE GetTime (REFERENCE_TIME *pTime)
 
HRESULT STDMETHODCALLTYPE AdviseTime (REFERENCE_TIME baseTime, REFERENCE_TIME streamTime, HEVENT hEvent, DWORD_PTR *pdwAdviseCookie)
 
HRESULT STDMETHODCALLTYPE AdvisePeriodic (REFERENCE_TIME startTime, REFERENCE_TIME periodTime, HSEMAPHORE hSemaphore, DWORD_PTR *pdwAdviseCookie)
 
HRESULT STDMETHODCALLTYPE Unadvise (DWORD_PTR dwAdviseCookie)
 
HRESULT STDMETHODCALLTYPE GetCapabilities (DWORD *pCapabilities)
 
HRESULT STDMETHODCALLTYPE CheckCapabilities (DWORD *pCapabilities)
 
HRESULT STDMETHODCALLTYPE IsFormatSupported (const GUID *pFormat)
 
HRESULT STDMETHODCALLTYPE QueryPreferredFormat (GUID *pFormat)
 
HRESULT STDMETHODCALLTYPE GetTimeFormat (GUID *pFormat)
 
HRESULT STDMETHODCALLTYPE IsUsingTimeFormat (const GUID *pFormat)
 
HRESULT STDMETHODCALLTYPE SetTimeFormat (const GUID *pFormat)
 
HRESULT STDMETHODCALLTYPE GetDuration (LONGLONG *pDuration)
 
HRESULT STDMETHODCALLTYPE GetStopPosition (LONGLONG *pStop)
 
HRESULT STDMETHODCALLTYPE GetCurrentPosition (LONGLONG *pCurrent)
 
HRESULT STDMETHODCALLTYPE ConvertTimeFormat (LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat)
 
HRESULT STDMETHODCALLTYPE SetPositions (LONGLONG *pCurrent, DWORD dwCurrentFlags, LONGLONG *pStop, DWORD dwStopFlags)
 
HRESULT STDMETHODCALLTYPE GetPositions (LONGLONG *pCurrent, LONGLONG *pStop)
 
HRESULT STDMETHODCALLTYPE GetAvailable (LONGLONG *pEarliest, LONGLONG *pLatest)
 
HRESULT STDMETHODCALLTYPE SetRate (double dRate)
 
HRESULT STDMETHODCALLTYPE GetRate (double *pdRate)
 
HRESULT STDMETHODCALLTYPE GetPreroll (LONGLONG *pllPreroll)
 
HRESULT STDMETHODCALLTYPE Set (REFGUID guidPropSet, DWORD dwPropID, LPVOID pInstanceData, DWORD cbInstanceData, LPVOID pPropData, DWORD cbPropData)
 
HRESULT STDMETHODCALLTYPE Get (REFGUID guidPropSet, DWORD dwPropID, LPVOID pInstanceData, DWORD cbInstanceData, LPVOID pPropData, DWORD cbPropData, DWORD *pcbReturned)
 
HRESULT STDMETHODCALLTYPE QuerySupported (REFGUID guidPropSet, DWORD dwPropID, DWORD *pTypeSupport)
 
ULONG STDMETHODCALLTYPE GetMiscFlags (void)
 
HRESULT STDMETHODCALLTYPE KsProperty (PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, ULONG DataLength, ULONG *BytesReturned)
 
HRESULT STDMETHODCALLTYPE KsMethod (PKSMETHOD Method, ULONG MethodLength, LPVOID MethodData, ULONG DataLength, ULONG *BytesReturned)
 
HRESULT STDMETHODCALLTYPE KsEvent (PKSEVENT Event, ULONG EventLength, LPVOID EventData, ULONG DataLength, ULONG *BytesReturned)
 
HRESULT STDMETHODCALLTYPE CreateNodeInstance (ULONG NodeId, ULONG Flags, ACCESS_MASK DesiredAccess, IUnknown *UnkOuter, REFGUID InterfaceId, LPVOID *Interface)
 
HRESULT STDMETHODCALLTYPE KsAddAggregate (IN REFGUID AggregateClass)
 
HRESULT STDMETHODCALLTYPE KsRemoveAggregate (REFGUID AggregateClass)
 
HRESULT STDMETHODCALLTYPE KsGetTime (LONGLONG *Time)
 
HRESULT STDMETHODCALLTYPE KsSetTime (LONGLONG Time)
 
HRESULT STDMETHODCALLTYPE KsGetPhysicalTime (LONGLONG *Time)
 
HRESULT STDMETHODCALLTYPE KsSetPhysicalTime (LONGLONG Time)
 
HRESULT STDMETHODCALLTYPE KsGetCorrelatedTime (KSCORRELATED_TIME *CorrelatedTime)
 
HRESULT STDMETHODCALLTYPE KsSetCorrelatedTime (KSCORRELATED_TIME *CorrelatedTime)
 
HRESULT STDMETHODCALLTYPE KsGetCorrelatedPhysicalTime (KSCORRELATED_TIME *CorrelatedTime)
 
HRESULT STDMETHODCALLTYPE KsSetCorrelatedPhysicalTime (KSCORRELATED_TIME *CorrelatedTime)
 
HRESULT STDMETHODCALLTYPE KsGetResolution (KSRESOLUTION *Resolution)
 
HRESULT STDMETHODCALLTYPE KsGetState (KSSTATE *State)
 
HRESULT STDMETHODCALLTYPE Register (void)
 
HRESULT STDMETHODCALLTYPE Unregister (void)
 
HRESULT STDMETHODCALLTYPE InitNew (void)
 
HRESULT STDMETHODCALLTYPE Load (IPropertyBag *pPropBag, IErrorLog *pErrorLog)
 
HRESULT STDMETHODCALLTYPE Save (IPropertyBag *pPropBag, BOOL fClearDirty, BOOL fSaveAllProperties)
 
HANDLE STDMETHODCALLTYPE KsGetObjectHandle ()
 
HANDLE STDMETHODCALLTYPE KsGetClockHandle ()
 
HRESULT STDMETHODCALLTYPE DeviceInfo (CLSID *pclsidInterfaceClass, LPWSTR *pwszSymbolicLink)
 
HRESULT STDMETHODCALLTYPE Reassociate (void)
 
HRESULT STDMETHODCALLTYPE Disassociate (void)
 
HRESULT STDMETHODCALLTYPE IsDirty (void)
 
HRESULT STDMETHODCALLTYPE Load (IStream *pStm)
 
HRESULT STDMETHODCALLTYPE Save (IStream *pStm, BOOL fClearDirty)
 
HRESULT STDMETHODCALLTYPE GetSizeMax (ULARGE_INTEGER *pcbSize)
 
HRESULT STDMETHODCALLTYPE GetPages (CAUUID *pPages)
 
 CKsProxy ()
 
 ~CKsProxy ()
 
HRESULT STDMETHODCALLTYPE GetSupportedSets (LPGUID *pOutGuid, PULONG NumGuids)
 
HRESULT STDMETHODCALLTYPE LoadProxyPlugins (LPGUID pGuids, ULONG NumGuids)
 
HRESULT STDMETHODCALLTYPE GetNumberOfPins (PULONG NumPins)
 
HRESULT STDMETHODCALLTYPE GetPinInstanceCount (ULONG PinId, PKSPIN_CINSTANCES Instances)
 
HRESULT STDMETHODCALLTYPE GetPinDataflow (ULONG PinId, KSPIN_DATAFLOW *DataFlow)
 
HRESULT STDMETHODCALLTYPE GetPinName (ULONG PinId, KSPIN_DATAFLOW DataFlow, ULONG PinCount, LPWSTR *OutPinName)
 
HRESULT STDMETHODCALLTYPE GetPinCommunication (ULONG PinId, KSPIN_COMMUNICATION *Communication)
 
HRESULT STDMETHODCALLTYPE CreatePins ()
 
HRESULT STDMETHODCALLTYPE GetMediaSeekingFormats (PKSMULTIPLE_ITEM *FormatList)
 
HRESULT STDMETHODCALLTYPE CreateClockInstance ()
 
HRESULT STDMETHODCALLTYPE PerformClockProperty (ULONG PropertyId, ULONG PropertyFlags, PVOID OutputBuffer, ULONG OutputBufferSize)
 
HRESULT STDMETHODCALLTYPE SetPinState (KSSTATE State)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- Public Member Functions inherited from IKsControl
HRESULT KsProperty ([in] PKSPROPERTY Property, [in] ULONG PropertyLength, [in, out] void *PropertyData, [in] ULONG DataLength, [out] ULONG *BytesReturned)
 
HRESULT KsMethod ([in] PKSMETHOD Method, [in] ULONG MethodLength, [in, out] void *MethodData, [in] ULONG DataLength, [out] ULONG *BytesReturned)
 
HRESULT KsEvent ([in] PKSEVENT Event, [in] ULONG EventLength, [in, out] void *EventData, [in] ULONG DataLength, [out] ULONG *BytesReturned)
 

Protected Attributes

LONG m_Ref
 
IFilterGraphm_pGraph
 
IReferenceClockm_ReferenceClock
 
FILTER_STATE m_FilterState
 
HANDLE m_hDevice
 
ProxyPluginVector m_Plugins
 
PinVector m_Pins
 
LPWSTR m_DevicePath
 
CLSID m_DeviceInterfaceGUID
 
HANDLE m_hClock
 
CRITICAL_SECTION m_Lock
 

Detailed Description

Definition at line 24 of file proxy.cpp.

Member Typedef Documentation

◆ PinVector

typedef std::vector<IPin *> CKsProxy::PinVector

Definition at line 44 of file proxy.cpp.

◆ ProxyPluginVector

typedef std::vector<IUnknown *> CKsProxy::ProxyPluginVector

Definition at line 43 of file proxy.cpp.

Constructor & Destructor Documentation

◆ CKsProxy()

CKsProxy::CKsProxy ( )

Definition at line 201 of file proxy.cpp.

201  : m_Ref(0),
202  m_pGraph(0),
204  m_hDevice(0),
205  m_Plugins(),
206  m_Pins(),
207  m_DevicePath(0),
208  m_hClock(0)
209 {
210  m_ReferenceClock = this;
212 }
PinVector m_Pins
Definition: proxy.cpp:194
CRITICAL_SECTION m_Lock
Definition: proxy.cpp:198
HANDLE m_hClock
Definition: proxy.cpp:197
LPWSTR m_DevicePath
Definition: proxy.cpp:195
LONG m_Ref
Definition: proxy.cpp:188
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
HANDLE m_hDevice
Definition: proxy.cpp:192
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
IReferenceClock * m_ReferenceClock
Definition: proxy.cpp:190
IFilterGraph * m_pGraph
Definition: proxy.cpp:189
FILTER_STATE m_FilterState
Definition: proxy.cpp:191

◆ ~CKsProxy()

CKsProxy::~CKsProxy ( )
inline

Definition at line 167 of file proxy.cpp.

168  {
169  if (m_hDevice)
171  };
#define CloseHandle
Definition: compat.h:406
HANDLE m_hDevice
Definition: proxy.cpp:192

Member Function Documentation

◆ AdvisePeriodic()

HRESULT STDMETHODCALLTYPE CKsProxy::AdvisePeriodic ( REFERENCE_TIME  startTime,
REFERENCE_TIME  periodTime,
HSEMAPHORE  hSemaphore,
DWORD_PTR pdwAdviseCookie 
)

Implements IReferenceClock.

Definition at line 719 of file proxy.cpp.

724 {
725  HRESULT hr;
729 
730 #ifdef KSPROXY_TRACE
731  OutputDebugStringW(L"CKsProxy::AdvisePeriodic\n");
732 #endif
733 
734  //
735  //FIXME locks
736  //
737 
738  if (!pdwAdviseCookie)
739  return E_POINTER;
740 
741  if (!m_hClock)
742  {
743  // create clock
745  if (FAILED(hr))
746  return hr;
747  }
748 
749  // allocate event entry
751  if (Event)
752  {
753  // setup request
757 
758  Event->EventData.NotificationType = KSEVENTF_SEMAPHORE_HANDLE;
759  Event->EventData.SemaphoreHandle.Semaphore = (HANDLE)hSemaphore;
760  Event->EventData.SemaphoreHandle.Reserved = 0;
761  Event->EventData.SemaphoreHandle.Adjustment = 1;
762  Event->TimeBase = startTime;
763  Event->Interval = periodTime;
764 
765  // perform request
767  if (SUCCEEDED(hr))
768  {
769  // store event handle
770  *pdwAdviseCookie = (DWORD_PTR)Event;
771  }
772  else
773  {
774  // failed to enable event
776  }
777  }
778  else
779  {
780  hr = E_OUTOFMEMORY;
781  }
782 
783  return hr;
784 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define DWORD_PTR
Definition: treelist.c:76
HRESULT hr
Definition: shlfolder.c:183
static ULONGLONG startTime
Definition: main.c:115
HANDLE m_hClock
Definition: proxy.cpp:197
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
HRESULT STDMETHODCALLTYPE CreateClockInstance()
Definition: proxy.cpp:393
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
_In_ PVOID _In_ ULONG Event
Definition: iotypes.h:435
#define KSEVENTF_SEMAPHORE_HANDLE
Definition: ks.h:1779
#define KSEVENT_TYPE_ENABLE
Definition: ks.h:1789
struct KSEVENT_TIME_INTERVAL * PKSEVENT_TIME_INTERVAL
LONG HRESULT
Definition: typedefs.h:77
PVOID HANDLE
Definition: typedefs.h:71
static const WCHAR L[]
Definition: oid.c:1250
#define IOCTL_KS_ENABLE_EVENT
Definition: ks.h:130
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define KSEVENTSETID_Clock
Definition: ks.h:332
unsigned int ULONG
Definition: retypes.h:1
#define E_POINTER
Definition: winerror.h:2365
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ AdviseTime()

HRESULT STDMETHODCALLTYPE CKsProxy::AdviseTime ( REFERENCE_TIME  baseTime,
REFERENCE_TIME  streamTime,
HEVENT  hEvent,
DWORD_PTR pdwAdviseCookie 
)

Implements IReferenceClock.

Definition at line 651 of file proxy.cpp.

656 {
657  HRESULT hr;
661 
662 #ifdef KSPROXY_TRACE
663  OutputDebugStringW(L"CKsProxy::AdviseTime\n");
664 #endif
665 
666  //
667  //FIXME locks
668  //
669 
670  if (!pdwAdviseCookie)
671  return E_POINTER;
672 
673  if (!m_hClock)
674  {
675  // create clock
677  if (FAILED(hr))
678  return hr;
679  }
680 
681  // allocate event entry
683  if (Event)
684  {
685  // setup request
689 
690  Event->EventData.NotificationType = KSEVENTF_EVENT_HANDLE;
691  Event->EventData.EventHandle.Event = (HANDLE)hEvent;
692  Event->EventData.Alignment.Alignment[0] = 0;
693  Event->EventData.Alignment.Alignment[1] = 0;
694  Event->MarkTime = baseTime + streamTime;
695 
696  // perform request
698  if (SUCCEEDED(hr))
699  {
700  // store event handle
701  *pdwAdviseCookie = (DWORD_PTR)Event;
702  }
703  else
704  {
705  // failed to enable event
707  }
708  }
709  else
710  {
711  hr = E_OUTOFMEMORY;
712  }
713 
714  return hr;
715 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define DWORD_PTR
Definition: treelist.c:76
HRESULT hr
Definition: shlfolder.c:183
HANDLE m_hClock
Definition: proxy.cpp:197
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
static HANDLE hEvent
Definition: comm.c:54
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
HRESULT STDMETHODCALLTYPE CreateClockInstance()
Definition: proxy.cpp:393
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
_In_ PVOID _In_ ULONG Event
Definition: iotypes.h:435
struct KSEVENT_TIME_MARK * PKSEVENT_TIME_MARK
#define KSEVENT_TYPE_ENABLE
Definition: ks.h:1789
LONG HRESULT
Definition: typedefs.h:77
PVOID HANDLE
Definition: typedefs.h:71
static const WCHAR L[]
Definition: oid.c:1250
#define IOCTL_KS_ENABLE_EVENT
Definition: ks.h:130
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define KSEVENTF_EVENT_HANDLE
Definition: ks.h:1778
#define KSEVENTSETID_Clock
Definition: ks.h:332
unsigned int ULONG
Definition: retypes.h:1
#define E_POINTER
Definition: winerror.h:2365
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ CheckCapabilities()

HRESULT STDMETHODCALLTYPE CKsProxy::CheckCapabilities ( DWORD pCapabilities)

Implements IMediaSeeking.

Definition at line 881 of file proxy.cpp.

883 {
885  HRESULT hr;
886 
887 #ifdef KSPROXY_TRACE
888  OutputDebugStringW(L"CKsProxy::CheckCapabilities\n");
889 #endif
890 
891  if (!pCapabilities)
892  return E_POINTER;
893 
894  if (!*pCapabilities)
895  return E_FAIL;
896 
898  if (SUCCEEDED(hr))
899  {
900  if ((Capabilities | *pCapabilities) == Capabilities)
901  {
902  // all present
903  return S_OK;
904  }
905 
906  Capabilities = (Capabilities & *pCapabilities);
907  if (Capabilities)
908  {
909  // not all present
910  *pCapabilities = Capabilities;
911  return S_FALSE;
912  }
913  // no capabilities are present
914  return E_FAIL;
915  }
916 
917  return hr;
918 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT STDMETHODCALLTYPE GetCapabilities(DWORD *pCapabilities)
Definition: proxy.cpp:822
#define E_FAIL
Definition: ddrawi.h:102
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
Definition: hidclass.h:103
#define S_FALSE
Definition: winerror.h:2357
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ ConvertTimeFormat()

HRESULT STDMETHODCALLTYPE CKsProxy::ConvertTimeFormat ( LONGLONG pTarget,
const GUID pTargetFormat,
LONGLONG  Source,
const GUID pSourceFormat 
)

Implements IMediaSeeking.

Definition at line 1358 of file proxy.cpp.

1363 {
1366  GUID SourceFormat, TargetFormat;
1367  HRESULT hr;
1368 
1372 
1373 #ifdef KSPROXY_TRACE
1374  OutputDebugStringW(L"CKsProxy::ConvertTimeFormat\n");
1375 #endif
1376 
1377  if (!pTargetFormat)
1378  {
1379  // get current format
1380  hr = GetTimeFormat(&TargetFormat);
1381  if (FAILED(hr))
1382  return hr;
1383 
1384  pTargetFormat = &TargetFormat;
1385  }
1386 
1387  if (!pSourceFormat)
1388  {
1389  // get current format
1390  hr = GetTimeFormat(&SourceFormat);
1391  if (FAILED(hr))
1392  return hr;
1393 
1394  pSourceFormat = &SourceFormat;
1395  }
1396 
1397  Property.SourceFormat = *pSourceFormat;
1398  Property.TargetFormat = *pTargetFormat;
1399  Property.Time = Source;
1400 
1401 
1404  {
1405  //default error
1406  hr = E_NOTIMPL;
1407 
1408  // check if plugins support it
1409  for(Index = 0; Index < m_Plugins.size(); Index++)
1410  {
1411  // get plugin
1412  IUnknown * Plugin = m_Plugins[Index];
1413 
1414  if (!Plugin)
1415  continue;
1416 
1417  // query for IMediaSeeking interface
1418  IMediaSeeking *pSeek = NULL;
1419  hr = Plugin->QueryInterface(IID_IMediaSeeking, (void**)&pSeek);
1420  if (SUCCEEDED(hr))
1421  {
1422  // convert time format
1423  hr = pSeek->ConvertTimeFormat(pTarget, pTargetFormat, Source, pSourceFormat);
1424  // release IMediaSeeking interface
1425  pSeek->Release();
1426 
1427  if (hr != S_FALSE) // plugin implements it
1428  break;
1429  }
1430  }
1431  }
1432 
1433  return hr;
1434 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
HRESULT hr
Definition: shlfolder.c:183
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
int64_t LONGLONG
Definition: typedefs.h:66
HANDLE m_hDevice
Definition: proxy.cpp:192
LONG HRESULT
Definition: typedefs.h:77
static const UCHAR Index[8]
Definition: usbohci.c:18
nsrefcnt Release()
#define SEVERITY_ERROR
Definition: winerror.h:65
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
HRESULT STDMETHODCALLTYPE GetTimeFormat(GUID *pFormat)
Definition: proxy.cpp:1096
_In_ DWORD Property
Definition: setupapi.h:1545
#define FACILITY_WIN32
Definition: winerror.h:27
#define KSPROPSETID_MediaSeeking
Definition: ks.h:473
#define E_NOTIMPL
Definition: ddrawi.h:99
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define ERROR_NOT_FOUND
Definition: winerror.h:690
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define ERROR_SET_NOT_FOUND
Definition: winerror.h:692
unsigned int ULONG
Definition: retypes.h:1
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167
Property(long _type, long _tag, INREAL _value)
Definition: reader.h:125
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ CreateClockInstance()

HRESULT STDMETHODCALLTYPE CKsProxy::CreateClockInstance ( )

Definition at line 393 of file proxy.cpp.

394 {
395  HRESULT hr;
397  ULONG Index;
398  PIN_DIRECTION PinDir;
399  IKsObject *pObject;
401 
402  // find output pin and handle
403  for(Index = 0; Index < m_Pins.size(); Index++)
404  {
405  //get pin
406  IPin * pin = m_Pins[Index];
407  if (!pin)
408  continue;
409 
410  // get direction
411  hr = pin->QueryDirection(&PinDir);
412  if (FAILED(hr))
413  continue;
414 
415  // query IKsObject interface
416  hr = pin->QueryInterface(IID_IKsObject, (void**)&pObject);
417  if (FAILED(hr))
418  continue;
419 
420 
421  // get pin handle
422  hPin = pObject->KsGetObjectHandle();
423 
424  //release IKsObject
425  pObject->Release();
426 
427  if (hPin != INVALID_HANDLE_VALUE)
428  break;
429  }
430 
431  if (hPin == INVALID_HANDLE_VALUE)
432  {
433  // clock can only be instantiated on a pin handle
434  return E_NOTIMPL;
435  }
436 
437  if (m_hClock)
438  {
439  // release clock handle
441  }
442 
443  //setup clock create request
445 
446  // setup clock create request
447  hr = KsCreateClock(hPin, &ClockCreate, &m_hClock); // FIXME KsCreateClock returns NTSTATUS
448  if (SUCCEEDED(hr))
449  {
450  // failed to create clock
452  }
453 
454  return S_OK;
455 }
PinVector m_Pins
Definition: proxy.cpp:194
#define CloseHandle
Definition: compat.h:406
HRESULT hr
Definition: shlfolder.c:183
const GUID IID_IKsObject
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
HANDLE m_hClock
Definition: proxy.cpp:197
KSDDKAPI DWORD NTAPI KsCreateClock(HANDLE ConnectionHandle, PKSCLOCK_CREATE ClockCreate, PHANDLE ClockHandle)
Definition: ksuser.c:145
Definition: regsvr.c:103
ULONG CreateFlags
Definition: ks.h:1857
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
LONG HRESULT
Definition: typedefs.h:77
static const UCHAR Index[8]
Definition: usbohci.c:18
nsrefcnt Release()
#define SEVERITY_ERROR
Definition: winerror.h:65
#define FACILITY_WIN32
Definition: winerror.h:27
#define S_OK
Definition: intsafe.h:59
Definition: axcore.idl:91
#define E_NOTIMPL
Definition: ddrawi.h:99
enum _PinDirection PIN_DIRECTION
_In_ PKSCLOCK_CREATE ClockCreate
Definition: ks.h:4527
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by AdvisePeriodic(), AdviseTime(), GetTime(), PerformClockProperty(), and QueryInterface().

◆ CreateNodeInstance()

HRESULT STDMETHODCALLTYPE CKsProxy::CreateNodeInstance ( ULONG  NodeId,
ULONG  Flags,
ACCESS_MASK  DesiredAccess,
IUnknown UnkOuter,
REFGUID  InterfaceId,
LPVOID Interface 
)

Definition at line 1883 of file proxy.cpp.

1890 {
1891  HRESULT hr;
1892 
1893 #ifdef KSPROXY_TRACE
1894  OutputDebugStringW(L"CKsProxy::CreateNodeInstance\n");
1895 #endif
1896 
1897  *Interface = NULL;
1898 
1899  if (IsEqualIID(IID_IUnknown, InterfaceId) || !UnkOuter)
1900  {
1901  hr = CKsNode_Constructor(UnkOuter, m_hDevice, NodeId, DesiredAccess, InterfaceId, Interface);
1902  }
1903  else
1904  {
1905  // interface not supported
1906  hr = E_NOINTERFACE;
1907  }
1908 
1909  return hr;
1910 }
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI CKsNode_Constructor(IUnknown *pUnkOuter, HANDLE ParentHandle, ULONG NodeId, ACCESS_MASK DesiredAccess, REFIID riid, LPVOID *ppv)
Definition: node.cpp:115
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
HANDLE m_hDevice
Definition: proxy.cpp:192
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
static const WCHAR L[]
Definition: oid.c:1250
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ CreatePins()

HRESULT STDMETHODCALLTYPE CKsProxy::CreatePins ( )

Definition at line 2450 of file proxy.cpp.

2451 {
2452  ULONG NumPins, Index;
2453  KSPIN_CINSTANCES Instances;
2455  KSPIN_COMMUNICATION Communication;
2456  HRESULT hr;
2457  LPWSTR PinName;
2458  IPin * pPin;
2459  ULONG InputPin = 0;
2460  ULONG OutputPin = 0;
2461 
2462  // get number of pins
2463  hr = GetNumberOfPins(&NumPins);
2464  if (FAILED(hr))
2465  return hr;
2466 
2467  for(Index = 0; Index < NumPins; Index++)
2468  {
2469  // query current instance count
2470  hr = GetPinInstanceCount(Index, &Instances);
2471  if (FAILED(hr))
2472  {
2473 #ifdef KSPROXY_TRACE
2474  WCHAR Buffer[100];
2475  swprintf(Buffer, L"CKsProxy::CreatePins GetPinInstanceCount failed with %lx\n", hr);
2477 #endif
2478  continue;
2479  }
2480 
2481 
2482  // query pin communication;
2483  hr = GetPinCommunication(Index, &Communication);
2484  if (FAILED(hr))
2485  {
2486 #ifdef KSPROXY_TRACE
2487  WCHAR Buffer[100];
2488  swprintf(Buffer, L"CKsProxy::CreatePins GetPinCommunication failed with %lx\n", hr);
2490 #endif
2491  continue;
2492  }
2493 
2494  if (Instances.CurrentCount == Instances.PossibleCount)
2495  {
2496  // already maximum reached for this pin
2497 #ifdef KSPROXY_TRACE
2498  WCHAR Buffer[100];
2499  swprintf(Buffer, L"CKsProxy::CreatePins Instances.CurrentCount == Instances.PossibleCount\n");
2501 #endif
2502  continue;
2503  }
2504 
2505  // get direction of pin
2507  if (FAILED(hr))
2508  {
2509 #ifdef KSPROXY_TRACE
2510  WCHAR Buffer[100];
2511  swprintf(Buffer, L"CKsProxy::CreatePins GetPinDataflow failed with %lx\n", hr);
2513 #endif
2514  continue;
2515  }
2516 
2517  if (DataFlow == KSPIN_DATAFLOW_IN)
2518  hr = GetPinName(Index, DataFlow, InputPin, &PinName);
2519  else
2520  hr = GetPinName(Index, DataFlow, OutputPin, &PinName);
2521 
2522  if (FAILED(hr))
2523  {
2524 #ifdef KSPROXY_TRACE
2525  WCHAR Buffer[100];
2526  swprintf(Buffer, L"CKsProxy::CreatePins GetPinName failed with %lx\n", hr);
2528 #endif
2529  continue;
2530  }
2531 
2532  // construct the pins
2533  if (DataFlow == KSPIN_DATAFLOW_IN)
2534  {
2535  hr = CInputPin_Constructor((IBaseFilter*)this, PinName, m_hDevice, Index, Communication, IID_IPin, (void**)&pPin);
2536  if (FAILED(hr))
2537  {
2538 #ifdef KSPROXY_TRACE
2539  WCHAR Buffer[100];
2540  swprintf(Buffer, L"CKsProxy::CreatePins CInputPin_Constructor failed with %lx\n", hr);
2542 #endif
2543  CoTaskMemFree(PinName);
2544  continue;
2545  }
2546  InputPin++;
2547  }
2548  else
2549  {
2550  hr = COutputPin_Constructor((IBaseFilter*)this, PinName, Index, Communication, IID_IPin, (void**)&pPin);
2551  if (FAILED(hr))
2552  {
2553 #ifdef KSPROXY_TRACE
2554  WCHAR Buffer[100];
2555  swprintf(Buffer, L"CKsProxy::CreatePins COutputPin_Constructor failed with %lx\n", hr);
2557 #endif
2558  CoTaskMemFree(PinName);
2559  continue;
2560  }
2561  OutputPin++;
2562  }
2563 
2564  // store pins
2565  m_Pins.push_back(pPin);
2566 
2567 #ifdef KSPROXY_TRACE
2568  WCHAR Buffer[100];
2569  swprintf(Buffer, L"Index %lu DataFlow %lu Name %s\n", Index, DataFlow, PinName);
2571 #endif
2572 
2573  }
2574 
2575  return S_OK;
2576 }
PinVector m_Pins
Definition: proxy.cpp:194
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
HRESULT STDMETHODCALLTYPE GetPinName(ULONG PinId, KSPIN_DATAFLOW DataFlow, ULONG PinCount, LPWSTR *OutPinName)
Definition: proxy.cpp:2380
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
HRESULT WINAPI CInputPin_Constructor(IBaseFilter *ParentFilter, LPCWSTR PinName, HANDLE hFilter, ULONG PinId, KSPIN_COMMUNICATION Communication, REFIID riid, LPVOID *ppv)
Definition: input_pin.cpp:1766
HRESULT WINAPI COutputPin_Constructor(IBaseFilter *ParentFilter, LPCWSTR PinName, ULONG PinId, KSPIN_COMMUNICATION Communication, REFIID riid, LPVOID *ppv)
HRESULT STDMETHODCALLTYPE GetPinCommunication(ULONG PinId, KSPIN_COMMUNICATION *Communication)
Definition: proxy.cpp:2342
Definition: bufpool.h:45
KSPIN_DATAFLOW
Definition: ks.h:1248
HRESULT STDMETHODCALLTYPE GetPinInstanceCount(ULONG PinId, PKSPIN_CINSTANCES Instances)
Definition: proxy.cpp:2323
HANDLE m_hDevice
Definition: proxy.cpp:192
__wchar_t WCHAR
Definition: xmlstorage.h:180
ULONG PossibleCount
Definition: ks.h:651
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
static const UCHAR Index[8]
Definition: usbohci.c:18
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
KSPIN_COMMUNICATION
Definition: ks.h:1253
Definition: axcore.idl:91
ULONG CurrentCount
Definition: ks.h:652
unsigned int ULONG
Definition: retypes.h:1
HRESULT STDMETHODCALLTYPE GetPinDataflow(ULONG PinId, KSPIN_DATAFLOW *DataFlow)
Definition: proxy.cpp:2361
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DataFlow
HRESULT STDMETHODCALLTYPE GetNumberOfPins(PULONG NumPins)
Definition: proxy.cpp:2307
const GUID IID_IPin
Definition: pincontrol.cpp:15

Referenced by Load().

◆ DeviceInfo()

HRESULT STDMETHODCALLTYPE CKsProxy::DeviceInfo ( CLSID pclsidInterfaceClass,
LPWSTR pwszSymbolicLink 
)

Definition at line 2063 of file proxy.cpp.

2064 {
2065 #ifdef KSPROXY_TRACE
2066  OutputDebugStringW(L"CKsProxy::DeviceInfo\n");
2067 #endif
2068 
2069  if (!m_DevicePath)
2070  {
2071  // object not initialized
2073  }
2074 
2075  // copy device interface guid
2076  CopyMemory(pclsidInterfaceClass, &m_DeviceInterfaceGUID, sizeof(GUID));
2077 
2078  if (pwszSymbolicLink)
2079  {
2080  *pwszSymbolicLink = (LPWSTR)CoTaskMemAlloc((wcslen(m_DevicePath)+1) * sizeof(WCHAR));
2081  if (!*pwszSymbolicLink)
2082  return E_OUTOFMEMORY;
2083 
2084  wcscpy(*pwszSymbolicLink, m_DevicePath);
2085  }
2086  return S_OK;
2087 }
CLSID m_DeviceInterfaceGUID
Definition: proxy.cpp:196
LPWSTR m_DevicePath
Definition: proxy.cpp:195
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CopyMemory
Definition: winbase.h:1640
#define SEVERITY_ERROR
Definition: winerror.h:65
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define FACILITY_WIN32
Definition: winerror.h:27
#define S_OK
Definition: intsafe.h:59
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

◆ Disassociate()

HRESULT STDMETHODCALLTYPE CKsProxy::Disassociate ( void  )

Definition at line 2115 of file proxy.cpp.

2116 {
2117 #ifdef KSPROXY_TRACE
2118  OutputDebugStringW(L"CKsProxy::Disassociate\n");
2119 #endif
2120 
2121  if (!m_hDevice)
2122  return E_HANDLE;
2123 
2125  m_hDevice = NULL;
2126  return NOERROR;
2127 }
#define CloseHandle
Definition: compat.h:406
#define E_HANDLE
Definition: winerror.h:2850
#define NOERROR
Definition: winerror.h:2354
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
smooth NULL
Definition: ftsmooth.c:416
HANDLE m_hDevice
Definition: proxy.cpp:192
static const WCHAR L[]
Definition: oid.c:1250

◆ EnumPins()

HRESULT STDMETHODCALLTYPE CKsProxy::EnumPins ( IEnumPins **  ppEnum)

Implements IBaseFilter.

Definition at line 3030 of file proxy.cpp.

3032 {
3033  return CEnumPins_fnConstructor(m_Pins, IID_IEnumPins, (void**)ppEnum);
3034 }
PinVector m_Pins
Definition: proxy.cpp:194
HRESULT WINAPI CEnumPins_fnConstructor(std::vector< IPin * > Pins, REFIID riid, LPVOID *ppv)
Definition: enumpins.cpp:151

◆ FindPin()

HRESULT STDMETHODCALLTYPE CKsProxy::FindPin ( LPCWSTR  Id,
IPin **  ppPin 
)

Implements IBaseFilter.

Definition at line 3038 of file proxy.cpp.

3040 {
3041  ULONG PinId;
3042 
3043 #ifdef KSPROXY_TRACE
3044  OutputDebugStringW(L"CKsProxy::FindPin\n");
3045 #endif
3046 
3047  if (!ppPin)
3048  return E_POINTER;
3049 
3050  // convert to pin
3051  int ret = swscanf(Id, L"%u", &PinId);
3052 
3053  if (!ret || ret == EOF)
3054  {
3055  // invalid id
3056  return VFW_E_NOT_FOUND;
3057  }
3058 
3059  if (PinId >= m_Pins.size() || m_Pins[PinId] == NULL)
3060  {
3061  // invalid id
3062  return VFW_E_NOT_FOUND;
3063  }
3064 
3065  // found pin
3066  *ppPin = m_Pins[PinId];
3067  m_Pins[PinId]->AddRef();
3068 
3069  return S_OK;
3070 }
PinVector m_Pins
Definition: proxy.cpp:194
DWORD Id
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
smooth NULL
Definition: ftsmooth.c:416
#define VFW_E_NOT_FOUND
Definition: vfwmsgs.h:61
int ret
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
#define EOF
Definition: stdio.h:24
unsigned int ULONG
Definition: retypes.h:1
#define E_POINTER
Definition: winerror.h:2365
_Check_return_ _CRTIMP int __cdecl swscanf(_In_z_ const wchar_t *_Src, _In_z_ _Scanf_format_string_ const wchar_t *_Format,...)

◆ Get()

HRESULT STDMETHODCALLTYPE CKsProxy::Get ( REFGUID  guidPropSet,
DWORD  dwPropID,
LPVOID  pInstanceData,
DWORD  cbInstanceData,
LPVOID  pPropData,
DWORD  cbPropData,
DWORD pcbReturned 
)

Implements IKsPropertySet.

Definition at line 1812 of file proxy.cpp.

1820 {
1822 
1823 #ifdef KSPROXY_TRACE
1824  OutputDebugStringW(L"CKsProxy::Get\n");
1825 #endif
1826 
1827  if (cbInstanceData)
1828  {
1829  PKSPROPERTY Property = (PKSPROPERTY)CoTaskMemAlloc(sizeof(KSPROPERTY) + cbInstanceData);
1830  if (!Property)
1831  return E_OUTOFMEMORY;
1832 
1833  Property->Set = guidPropSet;
1834  Property->Id = dwPropID;
1835  Property->Flags = KSPROPERTY_TYPE_GET;
1836 
1837  CopyMemory((Property+1), pInstanceData, cbInstanceData);
1838 
1839  HRESULT hr = KsProperty(Property, sizeof(KSPROPERTY) + cbInstanceData, pPropData, cbPropData, &BytesReturned);
1841  return hr;
1842  }
1843  else
1844  {
1846 
1847  Property.Set = guidPropSet;
1848  Property.Id = dwPropID;
1849  Property.Flags = KSPROPERTY_TYPE_GET;
1850 
1851  HRESULT hr = KsProperty(&Property, sizeof(KSPROPERTY), pPropData, cbPropData, &BytesReturned);
1852  return hr;
1853  }
1854 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LONG HRESULT
Definition: typedefs.h:77
#define CopyMemory
Definition: winbase.h:1640
static const WCHAR L[]
Definition: oid.c:1250
HRESULT STDMETHODCALLTYPE KsProperty(PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, ULONG DataLength, ULONG *BytesReturned)
Definition: proxy.cpp:1709
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1
struct KSIDENTIFIER * PKSPROPERTY
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404

◆ GetAvailable()

HRESULT STDMETHODCALLTYPE CKsProxy::GetAvailable ( LONGLONG pEarliest,
LONGLONG pLatest 
)

Implements IMediaSeeking.

Definition at line 1534 of file proxy.cpp.

1537 {
1541  HRESULT hr;
1542 
1545  Property.Flags = KSPROPERTY_TYPE_GET;
1546 
1547 #ifdef KSPROXY_TRACE
1548  OutputDebugStringW(L"CKsProxy::GetAvailable\n");
1549 #endif
1550 
1553  {
1554  // check if plugins support it
1555  for(Index = 0; Index < m_Plugins.size(); Index++)
1556  {
1557  hr = E_NOTIMPL;
1558  // get plugin
1559  IUnknown * Plugin = m_Plugins[Index];
1560 
1561  if (!Plugin)
1562  continue;
1563 
1564  // query for IMediaSeeking interface
1565  IMediaSeeking *pSeek = NULL;
1566  hr = Plugin->QueryInterface(IID_IMediaSeeking, (void**)&pSeek);
1567  if (SUCCEEDED(hr))
1568  {
1569  // delegate call
1570  hr = pSeek->GetAvailable(pEarliest, pLatest);
1571  // release IMediaSeeking interface
1572  pSeek->Release();
1573 
1574  if (hr != S_FALSE) // plugin implements it
1575  break;
1576  }
1577  }
1578  }
1579  else if (SUCCEEDED(hr))
1580  {
1581  *pEarliest = Media.Earliest;
1582  *pLatest = Media.Latest;
1583  }
1584 
1585  return hr;
1586 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
HRESULT hr
Definition: shlfolder.c:183
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
HANDLE m_hDevice
Definition: proxy.cpp:192
LONG HRESULT
Definition: typedefs.h:77
static const UCHAR Index[8]
Definition: usbohci.c:18
nsrefcnt Release()
#define SEVERITY_ERROR
Definition: winerror.h:65
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
_In_ DWORD Property
Definition: setupapi.h:1545
#define FACILITY_WIN32
Definition: winerror.h:27
#define KSPROPSETID_MediaSeeking
Definition: ks.h:473
#define E_NOTIMPL
Definition: ddrawi.h:99
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define ERROR_NOT_FOUND
Definition: winerror.h:690
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define ERROR_SET_NOT_FOUND
Definition: winerror.h:692
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ GetCapabilities()

HRESULT STDMETHODCALLTYPE CKsProxy::GetCapabilities ( DWORD pCapabilities)

Implements IMediaSeeking.

Definition at line 822 of file proxy.cpp.

824 {
827  HRESULT hr = S_OK;
828  DWORD TempCaps;
829 
833 
834 #ifdef KSPROXY_TRACE
835  OutputDebugStringW(L"CKsProxy::GetCapabilities\n");
836 #endif
837 
838 
839  if (!pCapabilities)
840  return E_POINTER;
841 
842 
845 
847  // check if plugins support it
848  for(Index = 0; Index < m_Plugins.size(); Index++)
849  {
850  // get plugin
851  IUnknown * Plugin = m_Plugins[Index];
852 
853  if (!Plugin)
854  continue;
855 
856  // query for IMediaSeeking interface
857  IMediaSeeking *pSeek = NULL;
858  hr = Plugin->QueryInterface(IID_IMediaSeeking, (void**)&pSeek);
859  if (FAILED(hr))
860  {
861  *pCapabilities = 0;
862  return hr;
863  }
864 
865  TempCaps = 0;
866  // set time format
867  hr = pSeek->GetCapabilities(&TempCaps);
868  if (SUCCEEDED(hr))
869  {
870  // and with supported flags
871  *pCapabilities = (*pCapabilities & TempCaps);
872  }
873  // release IMediaSeeking interface
874  pSeek->Release();
875  }
876  return hr;
877 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
HRESULT hr
Definition: shlfolder.c:183
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
smooth NULL
Definition: ftsmooth.c:416
HANDLE m_hDevice
Definition: proxy.cpp:192
LONG HRESULT
Definition: typedefs.h:77
static const UCHAR Index[8]
Definition: usbohci.c:18
nsrefcnt Release()
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
_In_ DWORD Property
Definition: setupapi.h:1545
#define S_OK
Definition: intsafe.h:59
#define KSPROPSETID_MediaSeeking
Definition: ks.h:473
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
unsigned int ULONG
Definition: retypes.h:1
KS_SEEKING_CAPABILITIES
Definition: ks.h:498
#define E_POINTER
Definition: winerror.h:2365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CheckCapabilities().

◆ GetClassID()

HRESULT STDMETHODCALLTYPE CKsProxy::GetClassID ( CLSID pClassID)

Implements IPersist.

Definition at line 2704 of file proxy.cpp.

2706 {
2707 #ifdef KSPROXY_TRACE
2708  OutputDebugStringW(L"CKsProxy::GetClassID\n");
2709 #endif
2710  CopyMemory(pClassID, &CLSID_Proxy, sizeof(GUID));
2711 
2712  return S_OK;
2713 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define CopyMemory
Definition: winbase.h:1640
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59

◆ GetCurrentPosition()

HRESULT STDMETHODCALLTYPE CKsProxy::GetCurrentPosition ( LONGLONG pCurrent)

Implements IMediaSeeking.

Definition at line 1310 of file proxy.cpp.

1312 {
1315  HRESULT hr;
1316 
1319  Property.Flags = KSPROPERTY_TYPE_GET;
1320 
1321 #ifdef KSPROXY_TRACE
1322  OutputDebugStringW(L"CKsProxy::GetCurrentPosition\n");
1323 #endif
1324 
1327  {
1328  // check if plugins support it
1329  for(Index = 0; Index < m_Plugins.size(); Index++)
1330  {
1331  hr = E_NOTIMPL;
1332  // get plugin
1333  IUnknown * Plugin = m_Plugins[Index];
1334 
1335  if (!Plugin)
1336  continue;
1337 
1338  // query for IMediaSeeking interface
1339  IMediaSeeking *pSeek = NULL;
1340  hr = Plugin->QueryInterface(IID_IMediaSeeking, (void**)&pSeek);
1341  if (SUCCEEDED(hr))
1342  {
1343  // get current position
1344  hr = pSeek->GetCurrentPosition(pCurrent);
1345  // release IMediaSeeking interface
1346  pSeek->Release();
1347 
1348  if (hr != S_FALSE) // plugin implements it
1349  break;
1350  }
1351  }
1352  }
1353  return hr;
1354 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
HRESULT hr
Definition: shlfolder.c:183
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
int64_t LONGLONG
Definition: typedefs.h:66
HANDLE m_hDevice
Definition: proxy.cpp:192
LONG HRESULT
Definition: typedefs.h:77
static const UCHAR Index[8]
Definition: usbohci.c:18
nsrefcnt Release()
#define SEVERITY_ERROR
Definition: winerror.h:65
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
_In_ DWORD Property
Definition: setupapi.h:1545
#define FACILITY_WIN32
Definition: winerror.h:27
#define KSPROPSETID_MediaSeeking
Definition: ks.h:473
#define E_NOTIMPL
Definition: ddrawi.h:99
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define ERROR_NOT_FOUND
Definition: winerror.h:690
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define ERROR_SET_NOT_FOUND
Definition: winerror.h:692
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by GetPositions(), and SetPositions().

◆ GetDuration()

HRESULT STDMETHODCALLTYPE CKsProxy::GetDuration ( LONGLONG pDuration)

Implements IMediaSeeking.

Definition at line 1214 of file proxy.cpp.

1216 {
1219  HRESULT hr;
1220 
1223  Property.Flags = KSPROPERTY_TYPE_GET;
1224 
1225 #ifdef KSPROXY_TRACE
1226  OutputDebugStringW(L"CKsProxy::GetDuration\n");
1227 #endif
1228 
1231  {
1232  // check if plugins support it
1233  for(Index = 0; Index < m_Plugins.size(); Index++)
1234  {
1235  hr = E_NOTIMPL;
1236  // get plugin
1237  IUnknown * Plugin = m_Plugins[Index];
1238 
1239  if (!Plugin)
1240  continue;
1241 
1242  // query for IMediaSeeking interface
1243  IMediaSeeking *pSeek = NULL;
1244  hr = Plugin->QueryInterface(IID_IMediaSeeking, (void**)&pSeek);
1245  if (SUCCEEDED(hr))
1246  {
1247  // get duration
1248  hr = pSeek->GetStopPosition(pDuration);
1249  // release IMediaSeeking interface
1250  pSeek->Release();
1251 
1252  if (hr != S_FALSE) // plugin implements it
1253  break;
1254  }
1255  }
1256  }
1257  return hr;
1258 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
HRESULT hr
Definition: shlfolder.c:183
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
int64_t LONGLONG
Definition: typedefs.h:66
HANDLE m_hDevice
Definition: proxy.cpp:192
LONG HRESULT
Definition: typedefs.h:77
static const UCHAR Index[8]
Definition: usbohci.c:18
nsrefcnt Release()
#define SEVERITY_ERROR
Definition: winerror.h:65
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
_In_ DWORD Property
Definition: setupapi.h:1545
#define FACILITY_WIN32
Definition: winerror.h:27
#define KSPROPSETID_MediaSeeking
Definition: ks.h:473
#define E_NOTIMPL
Definition: ddrawi.h:99
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define ERROR_NOT_FOUND
Definition: winerror.h:690
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define ERROR_SET_NOT_FOUND
Definition: winerror.h:692
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ GetMediaSeekingFormats()

HRESULT STDMETHODCALLTYPE CKsProxy::GetMediaSeekingFormats ( PKSMULTIPLE_ITEM FormatList)

Definition at line 922 of file proxy.cpp.

924 {
926  HRESULT hr;
928 
932 
933  // query for format size list
935 
937  {
938  // allocate format list
940  if (!*FormatList)
941  {
942  // not enough memory
943  return E_OUTOFMEMORY;
944  }
945 
946  // get format list
948  if (FAILED(hr))
949  {
950  // failed to query format list
951  CoTaskMemFree(FormatList);
952  }
953  }
954  return hr;
955 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
HANDLE m_hDevice
Definition: proxy.cpp:192
LONG HRESULT
Definition: typedefs.h:77
#define SEVERITY_ERROR
Definition: winerror.h:65
struct KSMULTIPLE_ITEM * PKSMULTIPLE_ITEM
#define ERROR_MORE_DATA
Definition: dderror.h:13
_In_ DWORD Property
Definition: setupapi.h:1545
#define FACILITY_WIN32
Definition: winerror.h:27
#define KSPROPSETID_MediaSeeking
Definition: ks.h:473
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404

Referenced by IsFormatSupported(), and QueryPreferredFormat().

◆ GetMiscFlags()

ULONG STDMETHODCALLTYPE CKsProxy::GetMiscFlags ( void  )

Implements IAMFilterMiscFlags.

Definition at line 1664 of file proxy.cpp.

1665 {
1666  ULONG Index;
1667  ULONG Flags = 0;
1668  HRESULT hr;
1669  PIN_DIRECTION PinDirection;
1670  KSPIN_COMMUNICATION Communication;
1671 
1672 
1673  for(Index = 0; Index < m_Pins.size(); Index++)
1674  {
1675  // get current pin
1676  IPin * pin = m_Pins[Index];
1677  // query direction
1678  hr = pin->QueryDirection(&PinDirection);
1679  if (SUCCEEDED(hr))
1680  {
1681  if (PinDirection == PINDIR_INPUT)
1682  {
1683  if (SUCCEEDED(GetPinCommunication(Index, //FIXME verify PinId
1684  &Communication)))
1685  {
1686  if (Communication != KSPIN_COMMUNICATION_NONE && Communication != KSPIN_COMMUNICATION_BRIDGE)
1687  {
1689  }
1690  }
1691  }
1692  }
1693  }
1694 
1695 #ifdef KSPROXY_TRACE
1696  WCHAR Buffer[100];
1697  swprintf(Buffer, L"CKsProxy::GetMiscFlags stub Flags %x\n", Flags);
1699 #endif
1700 
1701  return Flags;
1702 }
PinVector m_Pins
Definition: proxy.cpp:194
HRESULT hr
Definition: shlfolder.c:183
Definition: regsvr.c:103
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
HRESULT STDMETHODCALLTYPE GetPinCommunication(ULONG PinId, KSPIN_COMMUNICATION *Communication)
Definition: proxy.cpp:2342
Definition: bufpool.h:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
static const UCHAR Index[8]
Definition: usbohci.c:18
static const WCHAR L[]
Definition: oid.c:1250
KSPIN_COMMUNICATION
Definition: ks.h:1253
Definition: axcore.idl:91
enum _PinDirection PIN_DIRECTION
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ GetNumberOfPins()

HRESULT STDMETHODCALLTYPE CKsProxy::GetNumberOfPins ( PULONG  NumPins)

Definition at line 2307 of file proxy.cpp.

2309 {
2312 
2313  // setup request
2314  Property.Set = KSPROPSETID_Pin;
2316  Property.Flags = KSPROPERTY_TYPE_GET;
2317 
2319 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
HANDLE m_hDevice
Definition: proxy.cpp:192
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define KSPROPSETID_Pin
Definition: ks.h:617
unsigned int ULONG
Definition: retypes.h:1

Referenced by CreatePins().

◆ GetPages()

HRESULT STDMETHODCALLTYPE CKsProxy::GetPages ( CAUUID pPages)

Implements ISpecifyPropertyPages.

Definition at line 372 of file proxy.cpp.

373 {
374 #ifdef KSPROXY_TRACE
375  OutputDebugStringW(L"CKsProxy::GetPages NotImplemented\n");
376 #endif
377 
378  if (!pPages)
379  return E_POINTER;
380 
381  pPages->cElems = 0;
382  pPages->pElems = NULL;
383 
384  return S_OK;
385 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ GetPinCommunication()

HRESULT STDMETHODCALLTYPE CKsProxy::GetPinCommunication ( ULONG  PinId,
KSPIN_COMMUNICATION Communication 
)

Definition at line 2342 of file proxy.cpp.

2345 {
2346  KSP_PIN Property;
2348 
2349  // setup request
2353  Property.PinId = PinId;
2354  Property.Reserved = 0;
2355 
2357 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
Definition: ks.h:642
HANDLE m_hDevice
Definition: proxy.cpp:192
_In_ DWORD Property
Definition: setupapi.h:1545
KSPIN_COMMUNICATION
Definition: ks.h:1253
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define KSPROPSETID_Pin
Definition: ks.h:617
unsigned int ULONG
Definition: retypes.h:1
Property(long _type, long _tag, INREAL _value)
Definition: reader.h:125

Referenced by CreatePins(), and GetMiscFlags().

◆ GetPinDataflow()

HRESULT STDMETHODCALLTYPE CKsProxy::GetPinDataflow ( ULONG  PinId,
KSPIN_DATAFLOW DataFlow 
)

Definition at line 2361 of file proxy.cpp.

2364 {
2365  KSP_PIN Property;
2367 
2368  // setup request
2372  Property.PinId = PinId;
2373  Property.Reserved = 0;
2374 
2376 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
KSPIN_DATAFLOW
Definition: ks.h:1248
Definition: ks.h:642
HANDLE m_hDevice
Definition: proxy.cpp:192
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define KSPROPSETID_Pin
Definition: ks.h:617
unsigned int ULONG
Definition: retypes.h:1
DataFlow
Property(long _type, long _tag, INREAL _value)
Definition: reader.h:125

Referenced by CreatePins().

◆ GetPinInstanceCount()

HRESULT STDMETHODCALLTYPE CKsProxy::GetPinInstanceCount ( ULONG  PinId,
PKSPIN_CINSTANCES  Instances 
)

Definition at line 2323 of file proxy.cpp.

2326 {
2327  KSP_PIN Property;
2329 
2330  // setup request
2334  Property.PinId = PinId;
2335  Property.Reserved = 0;
2336 
2338 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
Definition: ks.h:642
HANDLE m_hDevice
Definition: proxy.cpp:192
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define KSPROPSETID_Pin
Definition: ks.h:617
unsigned int ULONG
Definition: retypes.h:1
Property(long _type, long _tag, INREAL _value)
Definition: reader.h:125

Referenced by CreatePins().

◆ GetPinName()

HRESULT STDMETHODCALLTYPE CKsProxy::GetPinName ( ULONG  PinId,
KSPIN_DATAFLOW  DataFlow,
ULONG  PinCount,
LPWSTR OutPinName 
)

Definition at line 2380 of file proxy.cpp.

2385 {
2386  KSP_PIN Property;
2387  LPWSTR PinName;
2389  HRESULT hr;
2390  WCHAR Buffer[100];
2391 
2392  // setup request
2396  Property.PinId = PinId;
2397  Property.Reserved = 0;
2398 
2399  // #1 try get it from pin directly
2401 
2403  {
2404  // allocate pin name
2405  PinName = (LPWSTR)CoTaskMemAlloc(BytesReturned);
2406  if (!PinName)
2407  return E_OUTOFMEMORY;
2408 
2409  // retry with allocated buffer
2411  if (SUCCEEDED(hr))
2412  {
2413  *OutPinName = PinName;
2414  return hr;
2415  }
2416 
2417  //free buffer
2418  CoTaskMemFree(PinName);
2419  }
2420 
2421  //
2422  // TODO: retrieve pin name from topology node
2423  //
2424 
2425  if (DataFlow == KSPIN_DATAFLOW_IN)
2426  {
2427  swprintf(Buffer, L"Input%lu", PinCount);
2428  }
2429  else
2430  {
2431  swprintf(Buffer, L"Output%lu", PinCount);
2432  }
2433 
2434  // allocate pin name
2435  PinName = (LPWSTR)CoTaskMemAlloc((wcslen(Buffer)+1) * sizeof(WCHAR));
2436  if (!PinName)
2437  return E_OUTOFMEMORY;
2438 
2439  // copy pin name
2440  wcscpy(PinName, Buffer);
2441 
2442  // store result
2443  *OutPinName = PinName;
2444  // done
2445  return S_OK;
2446 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
_In_ const GUID _In_ ULONG PinCount
Definition: strmini.h:504
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
Definition: ks.h:642
HANDLE m_hDevice
Definition: proxy.cpp:192
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define SEVERITY_ERROR
Definition: winerror.h:65
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define ERROR_MORE_DATA
Definition: dderror.h:13
_In_ DWORD Property
Definition: setupapi.h:1545
#define FACILITY_WIN32
Definition: winerror.h:27
#define S_OK
Definition: intsafe.h:59
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define KSPROPSETID_Pin
Definition: ks.h:617
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
DataFlow
Property(long _type, long _tag, INREAL _value)
Definition: reader.h:125
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by CreatePins().

◆ GetPositions()

HRESULT STDMETHODCALLTYPE CKsProxy::GetPositions ( LONGLONG pCurrent,
LONGLONG pStop 
)

Implements IMediaSeeking.

Definition at line 1515 of file proxy.cpp.

1518 {
1519  HRESULT hr;
1520 
1521 #ifdef KSPROXY_TRACE
1522  OutputDebugStringW(L"CKsProxy::GetPositions\n");
1523 #endif
1524 
1525  hr = GetCurrentPosition(pCurrent);
1526  if (SUCCEEDED(hr))
1527  hr = GetStopPosition(pStop);
1528 
1529  return hr;
1530 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT STDMETHODCALLTYPE GetCurrentPosition(LONGLONG *pCurrent)
Definition: proxy.cpp:1310
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
HRESULT STDMETHODCALLTYPE GetStopPosition(LONGLONG *pStop)
Definition: proxy.cpp:1262
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR L[]
Definition: oid.c:1250
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ GetPreroll()

HRESULT STDMETHODCALLTYPE CKsProxy::GetPreroll ( LONGLONG pllPreroll)

Implements IMediaSeeking.

Definition at line 1612 of file proxy.cpp.

1614 {
1617  HRESULT hr;
1618 
1621  Property.Flags = KSPROPERTY_TYPE_GET;
1622 
1623 #ifdef KSPROXY_TRACE
1624  OutputDebugStringW(L"CKsProxy::GetPreroll\n");
1625 #endif
1626 
1629  {
1630  // check if all plugins support it
1631  for(Index = 0; Index < m_Plugins.size(); Index++)
1632  {
1633  // get plugin
1634  IUnknown * Plugin = m_Plugins[Index];
1635 
1636  if (!Plugin)
1637  continue;
1638 
1639  // query for IMediaSeeking interface
1640  IMediaSeeking *pSeek = NULL;
1641  hr = Plugin->QueryInterface(IID_IMediaSeeking, (void**)&pSeek);
1642  if (SUCCEEDED(hr))
1643  {
1644  // get preroll
1645  hr = pSeek->GetPreroll(pllPreroll);
1646  // release IMediaSeeking interface
1647  pSeek->Release();
1648 
1649  if (hr != S_FALSE) // plugin implements it
1650  break;
1651  }
1652  }
1653  hr = E_NOTIMPL;
1654  }
1655  return hr;
1656 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
HRESULT hr
Definition: shlfolder.c:183
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
int64_t LONGLONG
Definition: typedefs.h:66
HANDLE m_hDevice
Definition: proxy.cpp:192
LONG HRESULT
Definition: typedefs.h:77
static const UCHAR Index[8]
Definition: usbohci.c:18
nsrefcnt Release()
#define SEVERITY_ERROR
Definition: winerror.h:65
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
_In_ DWORD Property
Definition: setupapi.h:1545
#define FACILITY_WIN32
Definition: winerror.h:27
#define KSPROPSETID_MediaSeeking
Definition: ks.h:473
#define E_NOTIMPL
Definition: ddrawi.h:99
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define ERROR_NOT_FOUND
Definition: winerror.h:690
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define ERROR_SET_NOT_FOUND
Definition: winerror.h:692
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ GetRate()

HRESULT STDMETHODCALLTYPE CKsProxy::GetRate ( double pdRate)

Implements IMediaSeeking.

Definition at line 1601 of file proxy.cpp.

1603 {
1604 #ifdef KSPROXY_TRACE
1605  OutputDebugStringW(L"CKsProxy::GetRate\n");
1606 #endif
1607  return E_NOTIMPL;
1608 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetSizeMax()

HRESULT STDMETHODCALLTYPE CKsProxy::GetSizeMax ( ULARGE_INTEGER pcbSize)

Implements IPersistStream.

Definition at line 2047 of file proxy.cpp.

2049 {
2050 #ifdef KSPROXY_TRACE
2051  OutputDebugStringW(L"CKsProxy::GetSizeMax Notimplemented\n");
2052 #endif
2053 
2054  return E_NOTIMPL;
2055 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetState()

HRESULT STDMETHODCALLTYPE CKsProxy::GetState ( DWORD  dwMilliSecsTimeout,
FILTER_STATE State 
)

Implements IMediaFilter.

Definition at line 2881 of file proxy.cpp.

2884 {
2885  if (!State)
2886  return E_POINTER;
2887 
2888  *State = m_FilterState;
2889  return S_OK;
2890 }
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365
FILTER_STATE m_FilterState
Definition: proxy.cpp:191

◆ GetStopPosition()

HRESULT STDMETHODCALLTYPE CKsProxy::GetStopPosition ( LONGLONG pStop)

Implements IMediaSeeking.

Definition at line 1262 of file proxy.cpp.

1264 {
1267  HRESULT hr;
1268 
1271  Property.Flags = KSPROPERTY_TYPE_GET;
1272 
1273 #ifdef KSPROXY_TRACE
1274  OutputDebugStringW(L"CKsProxy::GetStopPosition\n");
1275 #endif
1276 
1279  {
1280  // check if plugins support it
1281  for(Index = 0; Index < m_Plugins.size(); Index++)
1282  {
1283  hr = E_NOTIMPL;
1284  // get plugin
1285  IUnknown * Plugin = m_Plugins[Index];
1286 
1287  if (!Plugin)
1288  continue;
1289 
1290  // query for IMediaSeeking interface
1291  IMediaSeeking *pSeek = NULL;
1292  hr = Plugin->QueryInterface(IID_IMediaSeeking, (void**)&pSeek);
1293  if (SUCCEEDED(hr))
1294  {
1295  // get stop position
1296  hr = pSeek->GetStopPosition(pStop);
1297  // release IMediaSeeking interface
1298  pSeek->Release();
1299 
1300  if (hr != S_FALSE) // plugin implements it
1301  break;
1302  }
1303  }
1304  }
1305  return hr;
1306 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
HRESULT hr
Definition: shlfolder.c:183
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
int64_t LONGLONG
Definition: typedefs.h:66
HANDLE m_hDevice
Definition: proxy.cpp:192
LONG HRESULT
Definition: typedefs.h:77
static const UCHAR Index[8]
Definition: usbohci.c:18
nsrefcnt Release()
#define SEVERITY_ERROR
Definition: winerror.h:65
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
_In_ DWORD Property
Definition: setupapi.h:1545
#define FACILITY_WIN32
Definition: winerror.h:27
#define KSPROPSETID_MediaSeeking
Definition: ks.h:473
#define E_NOTIMPL
Definition: ddrawi.h:99
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define ERROR_NOT_FOUND
Definition: winerror.h:690
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define ERROR_SET_NOT_FOUND
Definition: winerror.h:692
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by GetPositions(), and SetPositions().

◆ GetSupportedSets()

HRESULT STDMETHODCALLTYPE CKsProxy::GetSupportedSets ( LPGUID pOutGuid,
PULONG  NumGuids 
)

Definition at line 2176 of file proxy.cpp.

2179 {
2181  LPGUID pGuid;
2182  ULONG NumProperty = 0;
2183  ULONG NumMethods = 0;
2184  ULONG NumEvents = 0;
2185  ULONG Length;
2187  HRESULT hr;
2188 
2189  Property.Set = GUID_NULL;
2190  Property.Id = 0;
2192 
2196 
2197  Length = NumProperty + NumMethods + NumEvents;
2198 
2199  // allocate guid buffer
2200  pGuid = (LPGUID)CoTaskMemAlloc(Length);
2201  if (!pGuid)
2202  {
2203  // failed
2204  return E_OUTOFMEMORY;
2205  }
2206 
2207  NumProperty /= sizeof(GUID);
2208  NumMethods /= sizeof(GUID);
2209  NumEvents /= sizeof(GUID);
2210 
2211  // get all properties
2213  if (FAILED(hr))
2214  {
2215  CoTaskMemFree(pGuid);
2216  return E_FAIL;
2217  }
2218  Length -= BytesReturned;
2219 
2220  // get all methods
2221  if (Length)
2222  {
2224  if (FAILED(hr))
2225  {
2226  CoTaskMemFree(pGuid);
2227  return E_FAIL;
2228  }
2229  Length -= BytesReturned;
2230  }
2231 
2232  // get all events
2233  if (Length)
2234  {
2236  if (FAILED(hr))
2237  {
2238  CoTaskMemFree(pGuid);
2239  return E_FAIL;
2240  }
2241  Length -= BytesReturned;
2242  }
2243 
2244 #ifdef KSPROXY_TRACE
2245  WCHAR Buffer[200];
2246  swprintf(Buffer, L"NumProperty %lu NumMethods %lu NumEvents %lu\n", NumProperty, NumMethods, NumEvents);
2248 #endif
2249 
2250  *pOutGuid = pGuid;
2251  *NumGuids = NumProperty+NumEvents+NumMethods;
2252  return S_OK;
2253 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
#define KSPROPERTY_TYPE_SETSUPPORT
Definition: dmksctrl.h:44
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define E_FAIL
Definition: ddrawi.h:102
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define IOCTL_KS_METHOD
Definition: ks.h:136
HANDLE m_hDevice
Definition: proxy.cpp:192
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static const WCHAR L[]
Definition: oid.c:1250
#define IOCTL_KS_ENABLE_EVENT
Definition: ks.h:130
#define GUID_NULL
Definition: ks.h:106
_In_ DWORD Property
Definition: setupapi.h:1545
struct _GUID GUID
#define S_OK
Definition: intsafe.h:59
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
GUID * LPGUID
Definition: guiddef.h:81

Referenced by Load().

◆ GetSyncSource()

HRESULT STDMETHODCALLTYPE CKsProxy::GetSyncSource ( IReferenceClock **  pClock)

Implements IMediaFilter.

Definition at line 3011 of file proxy.cpp.

3013 {
3014 #ifdef KSPROXY_TRACE
3015  OutputDebugStringW(L"CKsProxy::GetSyncSource\n");
3016 #endif
3017 
3018  if (!pClock)
3019  return E_POINTER;
3020 
3021  if (m_ReferenceClock)
3023 
3024  *pClock = m_ReferenceClock;
3025  return S_OK;
3026 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
ULONG AddRef()
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
IReferenceClock * m_ReferenceClock
Definition: proxy.cpp:190
#define E_POINTER
Definition: winerror.h:2365

◆ GetTime()

HRESULT STDMETHODCALLTYPE CKsProxy::GetTime ( REFERENCE_TIME pTime)

Implements IReferenceClock.

Definition at line 608 of file proxy.cpp.

610 {
611  HRESULT hr;
614 
615 #ifdef KSPROXY_TRACE
616  OutputDebugStringW(L"CKsProxy::GetTime\n");
617 #endif
618 
619  if (!pTime)
620  return E_POINTER;
621 
622  //
623  //FIXME locks
624  //
625 
626  if (!m_hClock)
627  {
628  // create clock
630  if (FAILED(hr))
631  return hr;
632  }
633 
634  // setup request
638 
639  // perform request
641 
642  // TODO
643  // increment value
644  //
645 
646  return hr;
647 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
HRESULT hr
Definition: shlfolder.c:183
HANDLE m_hClock
Definition: proxy.cpp:197
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
HRESULT STDMETHODCALLTYPE CreateClockInstance()
Definition: proxy.cpp:393
const GUID KSPROPSETID_Clock
Definition: pin.c:115
_In_ PCCERT_CONTEXT _In_opt_ LPFILETIME pTime
Definition: wincrypt.h:4840
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR L[]
Definition: oid.c:1250
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1
#define E_POINTER
Definition: winerror.h:2365

◆ GetTimeFormat()

HRESULT STDMETHODCALLTYPE CKsProxy::GetTimeFormat ( GUID pFormat)

Implements IMediaSeeking.

Definition at line 1096 of file proxy.cpp.

1098 {
1101  HRESULT hr;
1102 
1105  Property.Flags = KSPROPERTY_TYPE_GET;
1106 
1107 #ifdef KSPROXY_TRACE
1108  OutputDebugStringW(L"CKsProxy::GetTimeFormat\n");
1109 #endif
1110 
1113  {
1114  // check if plugins support it
1115  for(Index = 0; Index < m_Plugins.size(); Index++)
1116  {
1117  hr = E_NOTIMPL;
1118  // get plugin
1119  IUnknown * Plugin = m_Plugins[Index];
1120 
1121  if (!Plugin)
1122  continue;
1123 
1124  // query for IMediaSeeking interface
1125  IMediaSeeking *pSeek = NULL;
1126  hr = Plugin->QueryInterface(IID_IMediaSeeking, (void**)&pSeek);
1127  if (SUCCEEDED(hr))
1128  {
1129  // set time format
1130  hr = pSeek->GetTimeFormat(pFormat);
1131  // release IMediaSeeking interface
1132  pSeek->Release();
1133 
1134  if (hr != S_FALSE)
1135  break;
1136  }
1137  }
1138  }
1139  return hr;
1140 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
HRESULT hr
Definition: shlfolder.c:183
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
HANDLE m_hDevice
Definition: proxy.cpp:192
LONG HRESULT
Definition: typedefs.h:77
static const UCHAR Index[8]
Definition: usbohci.c:18
nsrefcnt Release()
#define SEVERITY_ERROR
Definition: winerror.h:65
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
_In_ DWORD Property
Definition: setupapi.h:1545
#define FACILITY_WIN32
Definition: winerror.h:27
#define KSPROPSETID_MediaSeeking
Definition: ks.h:473
#define E_NOTIMPL
Definition: ddrawi.h:99
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define ERROR_NOT_FOUND
Definition: winerror.h:690
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define ERROR_SET_NOT_FOUND
Definition: winerror.h:692
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by ConvertTimeFormat().

◆ InitNew()

HRESULT STDMETHODCALLTYPE CKsProxy::InitNew ( void  )

Implements IPersistPropertyBag.

Definition at line 2165 of file proxy.cpp.

2166 {
2167 #ifdef KSPROXY_TRACE
2168  OutputDebugStringW(L"CKsProxy::InitNew\n");
2169 #endif
2170 
2171  return S_OK;
2172 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59

◆ IsDirty()

HRESULT STDMETHODCALLTYPE CKsProxy::IsDirty ( void  )

Implements IPersistStream.

Definition at line 1945 of file proxy.cpp.

1946 {
1947 #ifdef KSPROXY_TRACE
1948  OutputDebugStringW(L"CKsProxy::IsDirty Notimplemented\n");
1949 #endif
1950  return E_NOTIMPL;
1951 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IsFormatSupported()

HRESULT STDMETHODCALLTYPE CKsProxy::IsFormatSupported ( const GUID pFormat)

Implements IMediaSeeking.

Definition at line 959 of file proxy.cpp.

961 {
962  PKSMULTIPLE_ITEM FormatList;
963  LPGUID pGuid;
964  ULONG Index;
965  HRESULT hr = S_FALSE;
966 
967 #ifdef KSPROXY_TRACE
968  WCHAR Buffer[100];
969  LPOLESTR pstr;
970  StringFromCLSID(*pFormat, &pstr);
971  swprintf(Buffer, L"CKsProxy::IsFormatSupported %s\n",pstr);
973 #endif
974 
975  if (!pFormat)
976  return E_POINTER;
977 
978  // get media formats
979  hr = GetMediaSeekingFormats(&FormatList);
980  if (SUCCEEDED(hr))
981  {
982 #ifdef KSPROXY_TRACE
983  swprintf(Buffer, L"CKsProxy::IsFormatSupported NumFormat %lu\n",FormatList->Count);
985 #endif
986 
987  //iterate through format list
988  pGuid = (LPGUID)(FormatList + 1);
989  for(Index = 0; Index < FormatList->Count; Index++)
990  {
991  if (IsEqualGUID(*pGuid, *pFormat))
992  {
993  CoTaskMemFree(FormatList);
994  return S_OK;
995  }
996  pGuid++;
997  }
998  // free format list
999  CoTaskMemFree(FormatList);
1000  }
1001 
1002  // check if all plugins support it
1003  for(Index = 0; Index < m_Plugins.size(); Index++)
1004  {
1005  // get plugin
1006  IUnknown * Plugin = m_Plugins[Index];
1007 
1008  if (!Plugin)
1009  continue;
1010 
1011  // query for IMediaSeeking interface
1012  IMediaSeeking *pSeek = NULL;
1013  hr = Plugin->QueryInterface(IID_IMediaSeeking, (void**)&pSeek);
1014  if (FAILED(hr))
1015  {
1016  // plugin does not support interface
1017  hr = S_FALSE;
1018 #ifdef KSPROXY_TRACE
1019  OutputDebugStringW(L"CKsProxy::IsFormatSupported plugin does not support IMediaSeeking interface\n");
1020 #endif
1021  break;
1022  }
1023 
1024  // query if it is supported
1025  hr = pSeek->IsFormatSupported(pFormat);
1026  // release interface
1027  pSeek->Release();
1028 
1029  if (FAILED(hr) || hr == S_FALSE)
1030  break;
1031  }
1032 
1033  return hr;
1034 }
ULONG Count
Definition: ks.h:1980
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
static LPOLESTR
Definition: stg_prop.c:27
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
static const UCHAR Index[8]
Definition: usbohci.c:18
nsrefcnt Release()
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
HRESULT STDMETHODCALLTYPE GetMediaSeekingFormats(PKSMULTIPLE_ITEM *FormatList)
Definition: proxy.cpp:922
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
unsigned int ULONG
Definition: retypes.h:1
#define E_POINTER
Definition: winerror.h:2365
#define SUCCEEDED(hr)
Definition: intsafe.h:57
GUID * LPGUID
Definition: guiddef.h:81
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412

◆ IsUsingTimeFormat()

HRESULT STDMETHODCALLTYPE CKsProxy::IsUsingTimeFormat ( const GUID pFormat)

Implements IMediaSeeking.

Definition at line 1144 of file proxy.cpp.

1146 {
1147  GUID Format;
1148 
1149 #ifdef KSPROXY_TRACE
1150  OutputDebugStringW(L"CKsProxy::IsUsingTimeFormat\n");
1151 #endif
1152 
1154  return S_FALSE;
1155 
1156  if (IsEqualGUID(Format, *pFormat))
1157  return S_OK;
1158  else
1159  return S_FALSE;
1160 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
HRESULT STDMETHODCALLTYPE QueryPreferredFormat(GUID *pFormat)
Definition: proxy.cpp:1038
#define S_FALSE
Definition: winerror.h:2357
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char * Format
Definition: acpixf.h:1212

◆ JoinFilterGraph()

HRESULT STDMETHODCALLTYPE CKsProxy::JoinFilterGraph ( IFilterGraph pGraph,
LPCWSTR  pName 
)

Implements IBaseFilter.

Definition at line 3096 of file proxy.cpp.

3099 {
3100 #ifdef KSPROXY_TRACE
3101  WCHAR Buffer[100];
3102  swprintf(Buffer, L"CKsProxy::JoinFilterGraph pName %s pGraph %p m_Ref %u\n", pName, pGraph, m_Ref);
3104 #endif
3105 
3106  if (pGraph)
3107  {
3108  // joining filter graph
3109  m_pGraph = pGraph;
3110  }
3111  else
3112  {
3113  // leaving graph
3114  m_pGraph = 0;
3115  }
3116 
3117  return S_OK;
3118 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
LONG m_Ref
Definition: proxy.cpp:188
Definition: bufpool.h:45
static LPSTR pName
Definition: security.c:75
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define swprintf(buf, format,...)
Definition: sprintf.c:56
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
IFilterGraph * m_pGraph
Definition: proxy.cpp:189

◆ KsAddAggregate()

HRESULT STDMETHODCALLTYPE CKsProxy::KsAddAggregate ( IN REFGUID  AggregateClass)

Definition at line 1917 of file proxy.cpp.

1919 {
1920 #ifdef KSPROXY_TRACE
1921  OutputDebugStringW(L"CKsProxy::KsAddAggregate NotImplemented\n");
1922 #endif
1923  return E_NOTIMPL;
1924 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ KsEvent()

HRESULT STDMETHODCALLTYPE CKsProxy::KsEvent ( PKSEVENT  Event,
ULONG  EventLength,
LPVOID  EventData,
ULONG  DataLength,
ULONG BytesReturned 
)

Definition at line 1743 of file proxy.cpp.

1749 {
1750 #ifdef KSPROXY_TRACE
1751  OutputDebugStringW(L"CKsProxy::KsEvent\n");
1752 #endif
1753 
1754  assert(m_hDevice != 0);
1755  if (EventLength)
1757  else
1759 }
#define IOCTL_KS_DISABLE_EVENT
Definition: ks.h:133
#define assert(x)
Definition: debug.h:53
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
smooth NULL
Definition: ftsmooth.c:416
HANDLE m_hDevice
Definition: proxy.cpp:192
static const WCHAR L[]
Definition: oid.c:1250
#define IOCTL_KS_ENABLE_EVENT
Definition: ks.h:130
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG DataLength
Definition: hidpi.h:333

◆ KsGetClockHandle()

HANDLE STDMETHODCALLTYPE CKsProxy::KsGetClockHandle ( )

Definition at line 2135 of file proxy.cpp.

2136 {
2137 #ifdef KSPROXY_TRACE
2138  OutputDebugStringW(L"CKsProxy::KsGetClockHandle\n");
2139 #endif
2140 
2141  return m_hClock;
2142 }
HANDLE m_hClock
Definition: proxy.cpp:197
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250

◆ KsGetCorrelatedPhysicalTime()

HRESULT STDMETHODCALLTYPE CKsProxy::KsGetCorrelatedPhysicalTime ( KSCORRELATED_TIME CorrelatedTime)

Definition at line 560 of file proxy.cpp.

562 {
563 #ifdef KSPROXY_TRACE
564  OutputDebugStringW(L"CKsProxy::KsGetCorrelatedPhysicalTime\n");
565 #endif
567 }
HRESULT STDMETHODCALLTYPE PerformClockProperty(ULONG PropertyId, ULONG PropertyFlags, PVOID OutputBuffer, ULONG OutputBufferSize)
Definition: proxy.cpp:459
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250

◆ KsGetCorrelatedTime()

HRESULT STDMETHODCALLTYPE CKsProxy::KsGetCorrelatedTime ( KSCORRELATED_TIME CorrelatedTime)

Definition at line 537 of file proxy.cpp.

539 {
540 #ifdef KSPROXY_TRACE
541  OutputDebugStringW(L"CKsProxy::KsGetCorrelatedTime\n");
542 #endif
543 
545 }
HRESULT STDMETHODCALLTYPE PerformClockProperty(ULONG PropertyId, ULONG PropertyFlags, PVOID OutputBuffer, ULONG OutputBufferSize)
Definition: proxy.cpp:459
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250

◆ KsGetObjectHandle()

HANDLE STDMETHODCALLTYPE CKsProxy::KsGetObjectHandle ( )

Definition at line 2151 of file proxy.cpp.

2152 {
2153 #ifdef KSPROXY_TRACE
2154  OutputDebugStringW(L"CKsProxy::KsGetObjectHandle\n");
2155 #endif
2156 
2157  return m_hDevice;
2158 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
HANDLE m_hDevice
Definition: proxy.cpp:192
static const WCHAR L[]
Definition: oid.c:1250

◆ KsGetPhysicalTime()

HRESULT STDMETHODCALLTYPE CKsProxy::KsGetPhysicalTime ( LONGLONG Time)

Definition at line 513 of file proxy.cpp.

515 {
516 #ifdef KSPROXY_TRACE
517  OutputDebugStringW(L"CKsProxy::KsGetPhysicalTime\n");
518 #endif
519 
521 }
HRESULT STDMETHODCALLTYPE PerformClockProperty(ULONG PropertyId, ULONG PropertyFlags, PVOID OutputBuffer, ULONG OutputBufferSize)
Definition: proxy.cpp:459
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
int64_t LONGLONG
Definition: typedefs.h:66
static const WCHAR L[]
Definition: oid.c:1250
static PLARGE_INTEGER Time
Definition: time.c:105

◆ KsGetResolution()

HRESULT STDMETHODCALLTYPE CKsProxy::KsGetResolution ( KSRESOLUTION Resolution)

Definition at line 583 of file proxy.cpp.

585 {
586 #ifdef KSPROXY_TRACE
587  OutputDebugStringW(L"CKsProxy::KsGetResolution\n");
588 #endif
590 }
HRESULT STDMETHODCALLTYPE PerformClockProperty(ULONG PropertyId, ULONG PropertyFlags, PVOID OutputBuffer, ULONG OutputBufferSize)
Definition: proxy.cpp:459
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250
static BYTE Resolution
Definition: mouse.c:35

◆ KsGetState()

HRESULT STDMETHODCALLTYPE CKsProxy::KsGetState ( KSSTATE State)

Definition at line 594 of file proxy.cpp.

596 {
597 #ifdef KSPROXY_TRACE
598  OutputDebugStringW(L"CKsProxy::KsGetState\n");
599 #endif
601 }
HRESULT STDMETHODCALLTYPE PerformClockProperty(ULONG PropertyId, ULONG PropertyFlags, PVOID OutputBuffer, ULONG OutputBufferSize)
Definition: proxy.cpp:459
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250
KSSTATE
Definition: ks.h:1214

◆ KsGetTime()

HRESULT STDMETHODCALLTYPE CKsProxy::KsGetTime ( LONGLONG Time)

Definition at line 489 of file proxy.cpp.

491 {
492 #ifdef KSPROXY_TRACE
493  OutputDebugStringW(L"CKsProxy::KsGetTime\n");
494 #endif
495 
497 }
HRESULT STDMETHODCALLTYPE PerformClockProperty(ULONG PropertyId, ULONG PropertyFlags, PVOID OutputBuffer, ULONG OutputBufferSize)
Definition: proxy.cpp:459
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
int64_t LONGLONG
Definition: typedefs.h:66
static const WCHAR L[]
Definition: oid.c:1250
static PLARGE_INTEGER Time
Definition: time.c:105

◆ KsMethod()

HRESULT STDMETHODCALLTYPE CKsProxy::KsMethod ( PKSMETHOD  Method,
ULONG  MethodLength,
LPVOID  MethodData,
ULONG  DataLength,
ULONG BytesReturned 
)

Definition at line 1726 of file proxy.cpp.

1732 {
1733 #ifdef KSPROXY_TRACE
1734  OutputDebugStringW(L"CKsProxy::KsMethod\n");
1735 #endif
1736 
1737  assert(m_hDevice != 0);
1738  return KsSynchronousDeviceControl(m_hDevice, IOCTL_KS_METHOD, (PVOID)Method, MethodLength, (PVOID)MethodData, DataLength, BytesReturned);
1739 }
#define assert(x)
Definition: debug.h:53
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define IOCTL_KS_METHOD
Definition: ks.h:136
HANDLE m_hDevice
Definition: proxy.cpp:192
static const WCHAR L[]
Definition: oid.c:1250
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG DataLength
Definition: hidpi.h:333

◆ KsProperty()

HRESULT STDMETHODCALLTYPE CKsProxy::KsProperty ( PKSPROPERTY  Property,
ULONG  PropertyLength,
LPVOID  PropertyData,
ULONG  DataLength,
ULONG BytesReturned 
)

Definition at line 1709 of file proxy.cpp.

1715 {
1716 #ifdef KSPROXY_TRACE
1717  OutputDebugStringW(L"CKsProxy::KsProperty\n");
1718 #endif
1719 
1720  assert(m_hDevice != 0);
1722 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define assert(x)
Definition: debug.h:53
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
HANDLE m_hDevice
Definition: proxy.cpp:192
static const WCHAR L[]
Definition: oid.c:1250
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
_Must_inspect_result_ _Out_writes_to_ DataLength PHIDP_DATA _Inout_ PULONG DataLength
Definition: hidpi.h:333

Referenced by Get(), QuerySupported(), and Set().

◆ KsRemoveAggregate()

HRESULT STDMETHODCALLTYPE CKsProxy::KsRemoveAggregate ( REFGUID  AggregateClass)

Definition at line 1928 of file proxy.cpp.

1930 {
1931 #ifdef KSPROXY_TRACE
1932  OutputDebugStringW(L"CKsProxy::KsRemoveAggregate NotImplemented\n");
1933 #endif
1934 
1935  return E_NOTIMPL;
1936 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ KsSetCorrelatedPhysicalTime()

HRESULT STDMETHODCALLTYPE CKsProxy::KsSetCorrelatedPhysicalTime ( KSCORRELATED_TIME CorrelatedTime)

Definition at line 571 of file proxy.cpp.

573 {
574 #ifdef KSPROXY_TRACE
575  OutputDebugStringW(L"CKsProxy::KsSetCorrelatedPhysicalTime\n");
576 #endif
577 
579 }
HRESULT STDMETHODCALLTYPE PerformClockProperty(ULONG PropertyId, ULONG PropertyFlags, PVOID OutputBuffer, ULONG OutputBufferSize)
Definition: proxy.cpp:459
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43

◆ KsSetCorrelatedTime()

HRESULT STDMETHODCALLTYPE CKsProxy::KsSetCorrelatedTime ( KSCORRELATED_TIME CorrelatedTime)

Definition at line 549 of file proxy.cpp.

551 {
552 #ifdef KSPROXY_TRACE
553  OutputDebugStringW(L"CKsProxy::KsSetCorrelatedTime\n");
554 #endif
556 }
HRESULT STDMETHODCALLTYPE PerformClockProperty(ULONG PropertyId, ULONG PropertyFlags, PVOID OutputBuffer, ULONG OutputBufferSize)
Definition: proxy.cpp:459
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43

◆ KsSetPhysicalTime()

HRESULT STDMETHODCALLTYPE CKsProxy::KsSetPhysicalTime ( LONGLONG  Time)

Definition at line 525 of file proxy.cpp.

527 {
528 #ifdef KSPROXY_TRACE
529  OutputDebugStringW(L"CKsProxy::KsSetPhysicalTime\n");
530 #endif
531 
533 }
HRESULT STDMETHODCALLTYPE PerformClockProperty(ULONG PropertyId, ULONG PropertyFlags, PVOID OutputBuffer, ULONG OutputBufferSize)
Definition: proxy.cpp:459
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
int64_t LONGLONG
Definition: typedefs.h:66
static const WCHAR L[]
Definition: oid.c:1250
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
static PLARGE_INTEGER Time
Definition: time.c:105

◆ KsSetTime()

HRESULT STDMETHODCALLTYPE CKsProxy::KsSetTime ( LONGLONG  Time)

Definition at line 501 of file proxy.cpp.

503 {
504 #ifdef KSPROXY_TRACE
505  OutputDebugStringW(L"CKsProxy::KsSetTime\n");
506 #endif
507 
509 }
HRESULT STDMETHODCALLTYPE PerformClockProperty(ULONG PropertyId, ULONG PropertyFlags, PVOID OutputBuffer, ULONG OutputBufferSize)
Definition: proxy.cpp:459
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
int64_t LONGLONG
Definition: typedefs.h:66
static const WCHAR L[]
Definition: oid.c:1250
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
static PLARGE_INTEGER Time
Definition: time.c:105

◆ Load() [1/2]

HRESULT STDMETHODCALLTYPE CKsProxy::Load ( IPropertyBag pPropBag,
IErrorLog pErrorLog 
)

Implements IPersistPropertyBag.

Definition at line 2580 of file proxy.cpp.

2581 {
2582  HRESULT hr;
2583  VARIANT varName;
2584  LPGUID pGuid;
2585  ULONG NumGuids = 0;
2586  HDEVINFO hList;
2587  SP_DEVICE_INTERFACE_DATA DeviceInterfaceData;
2588 
2589 #ifdef KSPROXY_TRACE
2590  WCHAR Buffer[100];
2591  OutputDebugStringW(L"CKsProxy::Load\n");
2592 #endif
2593 
2594  // read device path
2595  varName.vt = VT_BSTR;
2596  hr = pPropBag->Read(L"DevicePath", &varName, pErrorLog);
2597 
2598  if (FAILED(hr))
2599  {
2600 #ifdef KSPROXY_TRACE
2601  swprintf(Buffer, L"CKsProxy::Load Read %lx\n", hr);
2603 #endif
2605  }
2606 
2607 #ifdef KSPROXY_TRACE
2608  OutputDebugStringW(L"DevicePath: ");
2609  OutputDebugStringW(varName.bstrVal);
2610  OutputDebugStringW(L"\n");
2611 #endif
2612 
2613  // create device list
2615  if (hList == INVALID_HANDLE_VALUE)
2616  {
2617  // failed to create device list
2619  }
2620 
2621  DeviceInterfaceData.cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
2622  if (!SetupDiOpenDeviceInterfaceW(hList, (PCWSTR)varName.bstrVal, 0, &DeviceInterfaceData))
2623  {
2624  // failed to open device interface
2626  }
2627 
2628  // FIXME handle device interface links(aliases)
2629  CopyMemory(&m_DeviceInterfaceGUID, &DeviceInterfaceData.InterfaceClassGuid, sizeof(GUID));
2630 
2631  // close device info list
2633 
2634  // open device
2636 
2638  {
2639  // failed to open device
2640 #ifdef KSPROXY_TRACE
2641  swprintf(Buffer, L"CKsProxy:: failed to open device with %lx\n", GetLastError());
2643 #endif
2645  }
2646 
2647  // store device path
2648  m_DevicePath = varName.bstrVal;
2649 
2650  // get all supported sets
2651  hr = GetSupportedSets(&pGuid, &NumGuids);
2652  if (FAILED(hr))
2653  {
2655  m_hDevice = NULL;
2656  return hr;
2657  }
2658 
2659  // load all proxy plugins
2660  hr = LoadProxyPlugins(pGuid, NumGuids);
2661  if (FAILED(hr))
2662  {
2663 #if 0 //HACK
2665  m_hDevice = NULL;
2666  return hr;
2667 #endif
2668  OutputDebugStringW(L"CKsProxy::LoadProxyPlugins failed!\n");
2669  }
2670 
2671  // free sets
2672  CoTaskMemFree(pGuid);
2673 
2674  // now create the input / output pins
2675  hr = CreatePins();
2676 
2677 #ifdef KSPROXY_TRACE
2678  swprintf(Buffer, L"CKsProxy::Load CreatePins %lx\n", hr);
2680 #endif
2681 
2682  //HACK
2683  hr = S_OK;
2684 
2685  return hr;
2686 }
const uint16_t * PCWSTR
Definition: typedefs.h:55
#define CloseHandle
Definition: compat.h:406
HRESULT STDMETHODCALLTYPE GetSupportedSets(LPGUID *pOutGuid, PULONG NumGuids)
Definition: proxy.cpp:2176
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
HDEVINFO WINAPI SetupDiCreateDeviceInfoListExW(const GUID *ClassGuid, HWND hwndParent, PCWSTR MachineName, PVOID Reserved)
Definition: devinst.c:1268
HRESULT STDMETHODCALLTYPE CreatePins()
Definition: proxy.cpp:2450
CLSID m_DeviceInterfaceGUID
Definition: proxy.cpp:196
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
HRESULT STDMETHODCALLTYPE LoadProxyPlugins(LPGUID pGuids, ULONG NumGuids)
Definition: proxy.cpp:2257
LPWSTR m_DevicePath
Definition: proxy.cpp:195
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
#define OPEN_EXISTING
Definition: compat.h:434
HRESULT Read([in] LPCOLESTR pszPropName, [in, out] VARIANT *pVar, [in] IErrorLog *pErrorLog)
HANDLE m_hDevice
Definition: proxy.cpp:192
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
Definition: devinst.c:2898
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define CopyMemory
Definition: winbase.h:1640
#define SEVERITY_ERROR
Definition: winerror.h:65
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const WCHAR L[]
Definition: oid.c:1250
#define GENERIC_READ
Definition: compat.h:124
#define FACILITY_WIN32
Definition: winerror.h:27
HWND hList
Definition: livecd.c:10
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI SetupDiOpenDeviceInterfaceW(HDEVINFO DeviceInfoSet, PCWSTR DevicePath, DWORD OpenFlags, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
Definition: devinst.c:3766
VARTYPE vt
Definition: compat.h:2030
#define CreateFileW
Definition: compat.h:408
struct _SP_DEVICE_INTERFACE_DATA SP_DEVICE_INTERFACE_DATA
unsigned int ULONG
Definition: retypes.h:1
BSTR bstrVal
Definition: compat.h:2048
#define FILE_FLAG_OVERLAPPED
Definition: disk.h:46

◆ Load() [2/2]

HRESULT STDMETHODCALLTYPE CKsProxy::Load ( IStream pStm)

Implements IPersistStream.

Definition at line 1955 of file proxy.cpp.

1957 {
1958  HRESULT hr;
1959  WCHAR Buffer[1000];
1960  AM_MEDIA_TYPE MediaType;
1962  LONG Length;
1963 
1964  ULONG PinId;
1965  LPOLESTR pMajor, pSub, pFormat;
1966 
1967 #ifdef KSPROXY_TRACE
1968  OutputDebugStringW(L"CKsProxy::Load\n");
1969 #endif
1970 
1971 #if 0
1972  ULONG Version = ReadInt(pStm, hr);
1973  if (Version != 1)
1974  return E_FAIL;
1975 #endif
1976 
1977  hr = pStm->Read(&Length, sizeof(ULONG), &BytesReturned);
1978  swprintf(Buffer, L"Length hr %x hr length %lu\n", hr, Length);
1980 
1981  do
1982  {
1983  hr = pStm->Read(&PinId, sizeof(ULONG), &BytesReturned);
1984  swprintf(Buffer, L"Read: hr %08x PinId %lx BytesReturned %lu\n", hr, PinId, BytesReturned);
1986 
1987  if (FAILED(hr) || !BytesReturned)
1988  break;
1989 
1990  Length -= BytesReturned;
1991 
1992  hr = pStm->Read(&MediaType, sizeof(AM_MEDIA_TYPE), &BytesReturned);
1993  if (FAILED(hr) || BytesReturned != sizeof(AM_MEDIA_TYPE))
1994  {
1995  swprintf(Buffer, L"Read failed with %lx\n", hr);
1997  break;
1998  }
1999 
2000 
2001  StringFromIID(MediaType.majortype, &pMajor);
2002  StringFromIID(MediaType.subtype , &pSub);
2003  StringFromIID(MediaType.formattype, &pFormat);
2004 
2005  swprintf(Buffer, L"BytesReturned %lu majortype %s subtype %s bFixedSizeSamples %u bTemporalCompression %u lSampleSize %u formattype %s, pUnk %p cbFormat %u pbFormat %p\n", BytesReturned, pMajor, pSub, MediaType.bFixedSizeSamples, MediaType.bTemporalCompression, MediaType.lSampleSize, pFormat, MediaType.pUnk, MediaType.cbFormat, MediaType.pbFormat);
2007 
2008  Length -= BytesReturned;
2009 
2010 
2011  if (MediaType.cbFormat)
2012  {
2013  MediaType.pbFormat = (BYTE*)CoTaskMemAlloc(MediaType.cbFormat);
2014  if (!MediaType.pbFormat)
2015  return E_OUTOFMEMORY;
2016 
2017  hr = pStm->Read(&MediaType.pbFormat, sizeof(MediaType.cbFormat), &BytesReturned);
2018  if (FAILED(hr))
2019  {
2020  swprintf(Buffer, L"ReadFormat failed with %lx\n", hr);
2022  break;
2023  }
2024  Length -= BytesReturned;
2025  }
2026 
2027  }while(Length > 0);
2028 
2029  return S_OK;
2030 }
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:359
HRESULT hr
Definition: shlfolder.c:183
static LPOLESTR
Definition: stg_prop.c:27
#define E_FAIL
Definition: ddrawi.h:102
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
long LONG
Definition: pedump.c:60
Definition: bufpool.h:45
_Check_return_ HRESULT WINAPI StringFromIID(_In_ REFIID rclsid, _Outptr_ LPOLESTR *lplpsz)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
static const WCHAR L[]
Definition: oid.c:1250
unsigned char BYTE
Definition: mem.h:68
#define S_OK
Definition: intsafe.h:59
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1
HRESULT Read([out, size_is(cb), length_is(*pcbRead)] void *pv, [in] ULONG cb, [out] ULONG *pcbRead)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404

◆ LoadProxyPlugins()

HRESULT STDMETHODCALLTYPE CKsProxy::LoadProxyPlugins ( LPGUID  pGuids,
ULONG  NumGuids 
)

Definition at line 2257 of file proxy.cpp.

2260 {
2261  ULONG Index;
2262  LPOLESTR pStr;
2263  HKEY hKey, hSubKey;
2264  HRESULT hr;
2265  IUnknown * pUnknown;
2266 
2267  if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SYSTEM\\CurrentControlSet\\Control\\MediaInterfaces", 0, KEY_READ, &hKey) != ERROR_SUCCESS)
2268  {
2269  OutputDebugStringW(L"CKsProxy::LoadProxyPlugins failed to open MediaInterfaces key\n");
2270  return E_FAIL;
2271  }
2272 
2273  // enumerate all sets
2274  for(Index = 0; Index < NumGuids; Index++)
2275  {
2276  // convert to string
2277  hr = StringFromCLSID(pGuids[Index], &pStr);
2278  if (FAILED(hr))
2279  return E_FAIL;
2280 
2281  // now try open class key
2282  if (RegOpenKeyExW(hKey, pStr, 0, KEY_READ, &hSubKey) != ERROR_SUCCESS)
2283  {
2284  // no plugin for that set exists
2285  CoTaskMemFree(pStr);
2286  continue;
2287  }
2288 
2289  // try load plugin
2290  hr = CoCreateInstance(pGuids[Index], (IBaseFilter*)this, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&pUnknown);
2291  if (SUCCEEDED(hr))
2292  {
2293  // store plugin
2294  m_Plugins.push_back(pUnknown);
2295  }
2296  // close key
2297  RegCloseKey(hSubKey);
2298  }
2299 
2300  // close media interfaces key
2301  RegCloseKey(hKey);
2302  return S_OK;
2303 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
#define KEY_READ
Definition: nt_native.h:1023
static LPOLESTR
Definition: stg_prop.c:27
#define E_FAIL
Definition: ddrawi.h:102
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
static const UCHAR Index[8]
Definition: usbohci.c:18
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:59
unsigned int ULONG
Definition: retypes.h:1
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412

Referenced by Load().

◆ Pause()

HRESULT STDMETHODCALLTYPE CKsProxy::Pause ( void  )

Implements IMediaFilter.

Definition at line 2738 of file proxy.cpp.

2739 {
2740  HRESULT hr = S_OK;
2741 
2742 #ifdef KSPROXY_TRACE
2743  OutputDebugStringW(L"CKsProxy::Pause\n");
2744 #endif
2745 
2747 
2749  {
2751  }
2752  if (SUCCEEDED(hr))
2753  {
2755  {
2757  }
2758  }
2759 
2760  if (SUCCEEDED(hr))
2762 
2764  return hr;
2765 
2766 }
HRESULT hr
Definition: shlfolder.c:183
HRESULT STDMETHODCALLTYPE SetPinState(KSSTATE State)
Definition: proxy.cpp:2806
CRITICAL_SECTION m_Lock
Definition: proxy.cpp:198
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
FILTER_STATE m_FilterState
Definition: proxy.cpp:191
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by Run().

◆ PerformClockProperty()

HRESULT STDMETHODCALLTYPE CKsProxy::PerformClockProperty ( ULONG  PropertyId,
ULONG  PropertyFlags,
PVOID  OutputBuffer,
ULONG  OutputBufferSize 
)

Definition at line 459 of file proxy.cpp.

464 {
466  HRESULT hr;
468 
469  if (!m_hClock)
470  {
471  // create clock
473  if (FAILED(hr))
474  return hr;
475  }
476 
477  // setup request
479  Property.Id = PropertyId;
480  Property.Flags = PropertyFlags;
481 
483 
484  return hr;
485 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
HRESULT hr
Definition: shlfolder.c:183
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: classpnp.h:966
HANDLE m_hClock
Definition: proxy.cpp:197
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
HRESULT STDMETHODCALLTYPE CreateClockInstance()
Definition: proxy.cpp:393
const GUID KSPROPSETID_Clock
Definition: pin.c:115
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
LONG HRESULT
Definition: typedefs.h:77
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1

Referenced by KsGetCorrelatedPhysicalTime(), KsGetCorrelatedTime(), KsGetPhysicalTime(), KsGetResolution(), KsGetState(), KsGetTime(), KsSetCorrelatedPhysicalTime(), KsSetCorrelatedTime(), KsSetPhysicalTime(), and KsSetTime().

◆ QueryFilterInfo()

HRESULT STDMETHODCALLTYPE CKsProxy::QueryFilterInfo ( FILTER_INFO pInfo)

Implements IBaseFilter.

Definition at line 3075 of file proxy.cpp.

3077 {
3078  if (!pInfo)
3079  return E_POINTER;
3080 
3081 #ifdef KSPROXY_TRACE
3082  OutputDebugStringW(L"CKsProxy::QueryFilterInfo\n");
3083 #endif
3084 
3085  pInfo->achName[0] = L'\0';
3086  pInfo->pGraph = m_pGraph;
3087 
3088  if (m_pGraph)
3089  m_pGraph->AddRef();
3090 
3091  return S_OK;
3092 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
ULONG AddRef()
static const WCHAR L[]
Definition: oid.c:1250
#define S_OK
Definition: intsafe.h:59
IFilterGraph * m_pGraph
Definition: proxy.cpp:189
#define E_POINTER
Definition: winerror.h:2365

◆ QueryInterface()

HRESULT STDMETHODCALLTYPE CKsProxy::QueryInterface ( REFIID  InterfaceId,
PVOID Interface 
)

Definition at line 217 of file proxy.cpp.

220 {
221  *Output = NULL;
222 
223  if (IsEqualGUID(refiid, IID_IUnknown) ||
224  IsEqualGUID(refiid, IID_IBaseFilter))
225  {
226  *Output = PVOID(this);
227  reinterpret_cast<IUnknown*>(*Output)->AddRef();
228  return NOERROR;
229  }
230  else if (IsEqualGUID(refiid, IID_IPersistPropertyBag))
231  {
232  *Output = (IPersistPropertyBag*)(this);
233  reinterpret_cast<IPersistPropertyBag*>(*Output)->AddRef();
234  return NOERROR;
235  }
236  else if (IsEqualGUID(refiid, IID_IAMDeviceRemoval))
237  {
238  *Output = (IAMDeviceRemoval*)(this);
239  reinterpret_cast<IAMDeviceRemoval*>(*Output)->AddRef();
240  return NOERROR;
241  }
242  else if (IsEqualGUID(refiid, IID_IPersistStream))
243  {
244  *Output = (IPersistStream*)(this);
245  reinterpret_cast<IPersistStream*>(*Output)->AddRef();
246  return NOERROR;
247  }
248  else if (IsEqualGUID(refiid, IID_IPersist))
249  {
250  *Output = (IPersistStream*)(this);
251  reinterpret_cast<IPersist*>(*Output)->AddRef();
252  return NOERROR;
253  }
254  else if (IsEqualGUID(refiid, IID_IKsObject))
255  {
256  *Output = (IKsObject*)(this);
257  reinterpret_cast<IKsObject*>(*Output)->AddRef();
258  return NOERROR;
259  }
260  else if (IsEqualGUID(refiid, IID_IKsClock))
261  {
262  *Output = (IKsClock*)(this);
263  reinterpret_cast<IKsClock*>(*Output)->AddRef();
264  return NOERROR;
265  }
266  else if (IsEqualGUID(refiid, IID_IReferenceClock))
267  {
268  if (!m_hClock)
269  {
271  if (FAILED(hr))
272  return hr;
273  }
274 
275  *Output = (IReferenceClock*)(this);
276  reinterpret_cast<IReferenceClock*>(*Output)->AddRef();
277  return NOERROR;
278  }
279  else if (IsEqualGUID(refiid, IID_IMediaSeeking))
280  {
281  *Output = (IMediaSeeking*)(this);
282  reinterpret_cast<IMediaSeeking*>(*Output)->AddRef();
283  return NOERROR;
284  }
285  else if (IsEqualGUID(refiid, IID_IAMFilterMiscFlags))
286  {
287  *Output = (IAMFilterMiscFlags*)(this);
288  reinterpret_cast<IAMFilterMiscFlags*>(*Output)->AddRef();
289  return NOERROR;
290  }
291  else if (IsEqualGUID(refiid, IID_IKsControl))
292  {
293  *Output = (IKsControl*)(this);
294  reinterpret_cast<IKsControl*>(*Output)->AddRef();
295  return NOERROR;
296  }
297  else if (IsEqualGUID(refiid, IID_IKsPropertySet))
298  {
299  *Output = (IKsPropertySet*)(this);
300  reinterpret_cast<IKsPropertySet*>(*Output)->AddRef();
301  return NOERROR;
302  }
303  else if (IsEqualGUID(refiid, IID_IKsTopology))
304  {
305  *Output = (IKsTopology*)(this);
306  reinterpret_cast<IKsTopology*>(*Output)->AddRef();
307  return NOERROR;
308  }
309  else if (IsEqualGUID(refiid, IID_IKsAggregateControl))
310  {
311  *Output = (IKsAggregateControl*)(this);
312  reinterpret_cast<IKsAggregateControl*>(*Output)->AddRef();
313  return NOERROR;
314  }
315  else if (IsEqualGUID(refiid, IID_IKsClockPropertySet))
316  {
317  if (!m_hClock)
318  {
320  if (FAILED(hr))
321  return hr;
322  }
323 
324  *Output = (IKsClockPropertySet*)(this);
325  reinterpret_cast<IKsClockPropertySet*>(*Output)->AddRef();
326  return NOERROR;
327  }
328  else if (IsEqualGUID(refiid, IID_ISpecifyPropertyPages))
329  {
330  *Output = (ISpecifyPropertyPages*)(this);
331  reinterpret_cast<ISpecifyPropertyPages*>(*Output)->AddRef();
332  return NOERROR;
333  }
334 
335  for(ULONG Index = 0; Index < m_Plugins.size(); Index++)
336  {
337  if (m_Pins[Index])
338  {
339  HRESULT hr = m_Plugins[Index]->QueryInterface(refiid, Output);
340  if (SUCCEEDED(hr))
341  {
342 #ifdef KSPROXY_TRACE
343  WCHAR Buffer[100];
344  LPOLESTR lpstr;
345  StringFromCLSID(refiid, &lpstr);
346  swprintf(Buffer, L"CKsProxy::QueryInterface plugin %lu supports interface %s\n", Index, lpstr);
349 #endif
350  return hr;
351  }
352  }
353  }
354 #ifdef KSPROXY_TRACE
356  LPOLESTR lpstr;
357  StringFromCLSID(refiid, &lpstr);
358  swprintf(Buffer, L"CKsProxy::QueryInterface: NoInterface for %s !!!\n", lpstr);
361 #endif
362 
363  return E_NOINTERFACE;
364 }
PinVector m_Pins
Definition: proxy.cpp:194
const GUID IID_IBaseFilter
#define E_NOINTERFACE
Definition: winerror.h:2364
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
const GUID IID_IKsControl
Definition: filter.c:44
#define NOERROR
Definition: winerror.h:2354
const GUID IID_IKsObject
const GUID IID_IPersist
Definition: proxy.cpp:14
HANDLE m_hClock
Definition: proxy.cpp:197
const GUID IID_ISpecifyPropertyPages
Definition: proxy.cpp:12
static LPOLESTR
Definition: stg_prop.c:27
const GUID IID_IKsClock
Definition: proxy.cpp:19
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
HRESULT STDMETHODCALLTYPE CreateClockInstance()
Definition: proxy.cpp:393
const GUID IID_IPersistPropertyBag
Definition: proxy.cpp:11
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
const GUID IID_IKsClockPropertySet
Definition: proxy.cpp:17
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
static const UCHAR Index[8]
Definition: usbohci.c:18
const GUID IID_IKsAggregateControl
Definition: proxy.cpp:16
const GUID IID_IPersistStream
Definition: proxy.cpp:13
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
Definition: arc.h:85
const GUID IID_IKsPropertySet
Definition: controlnode.cpp:13
const GUID IID_IKsTopology
Definition: proxy.cpp:18
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
unsigned int ULONG
Definition: retypes.h:1
static LPCSTR lpstr
Definition: font.c:51
#define SUCCEEDED(hr)
Definition: intsafe.h:57
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412

◆ QueryPreferredFormat()

HRESULT STDMETHODCALLTYPE CKsProxy::QueryPreferredFormat ( GUID pFormat)

Implements IMediaSeeking.

Definition at line 1038 of file proxy.cpp.

1040 {
1041  PKSMULTIPLE_ITEM FormatList;
1042  HRESULT hr;
1043  ULONG Index;
1044 
1045 #ifdef KSPROXY_TRACE
1046  OutputDebugStringW(L"CKsProxy::QueryPreferredFormat\n");
1047 #endif
1048 
1049  if (!pFormat)
1050  return E_POINTER;
1051 
1052  hr = GetMediaSeekingFormats(&FormatList);
1053  if (SUCCEEDED(hr))
1054  {
1055  if (FormatList->Count)
1056  {
1057  CopyMemory(pFormat, (FormatList + 1), sizeof(GUID));
1058  CoTaskMemFree(FormatList);
1059  return S_OK;
1060  }
1061  CoTaskMemFree(FormatList);
1062  }
1064  {
1065  // check if plugins support it
1066  for(Index = 0; Index < m_Plugins.size(); Index++)
1067  {
1068  // get plugin
1069  IUnknown * Plugin = m_Plugins[Index];
1070 
1071  if (!Plugin)
1072  continue;
1073 
1074  // query for IMediaSeeking interface
1075  IMediaSeeking *pSeek = NULL;
1076  hr = Plugin->QueryInterface(IID_IMediaSeeking, (void**)&pSeek);
1077  if (SUCCEEDED(hr))
1078  {
1079  // get preferred time format
1080  hr = pSeek->QueryPreferredFormat(pFormat);
1081  // release IMediaSeeking interface
1082  pSeek->Release();
1083 
1084  if (hr != S_FALSE)
1085  return hr;
1086  }
1087  }
1088  hr = S_FALSE;
1089  }
1090 
1091  return hr;
1092 }
ULONG Count
Definition: ks.h:1980
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
LONG HRESULT
Definition: typedefs.h:77
#define CopyMemory
Definition: winbase.h:1640
static const UCHAR Index[8]
Definition: usbohci.c:18
nsrefcnt Release()
#define SEVERITY_ERROR
Definition: winerror.h:65
static const WCHAR L[]
Definition: oid.c:1250
ProxyPluginVector m_Plugins
Definition: proxy.cpp:193
HRESULT STDMETHODCALLTYPE GetMediaSeekingFormats(PKSMULTIPLE_ITEM *FormatList)
Definition: proxy.cpp:922
#define FACILITY_WIN32
Definition: winerror.h:27
#define S_OK
Definition: intsafe.h:59
#define ERROR_NOT_FOUND
Definition: winerror.h:690
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define ERROR_SET_NOT_FOUND
Definition: winerror.h:692
unsigned int ULONG
Definition: retypes.h:1
#define E_POINTER
Definition: winerror.h:2365
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by IsUsingTimeFormat().

◆ QuerySupported()

HRESULT STDMETHODCALLTYPE CKsProxy::QuerySupported ( REFGUID  guidPropSet,
DWORD  dwPropID,
DWORD pTypeSupport 
)

Implements IKsPropertySet.

Definition at line 1858 of file proxy.cpp.

1862 {
1865 
1866 #ifdef KSPROXY_TRACE
1867  OutputDebugStringW(L"CKsProxy::QuerySupported\n");
1868 #endif
1869 
1870  Property.Set = guidPropSet;
1871  Property.Id = dwPropID;
1873 
1874  return KsProperty(&Property, sizeof(KSPROPERTY), pTypeSupport, sizeof(DWORD), &BytesReturned);
1875 }
#define KSPROPERTY_TYPE_SETSUPPORT
Definition: dmksctrl.h:44
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
HRESULT STDMETHODCALLTYPE KsProperty(PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, ULONG DataLength, ULONG *BytesReturned)
Definition: proxy.cpp:1709
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1

◆ QueryVendorInfo()

HRESULT STDMETHODCALLTYPE CKsProxy::QueryVendorInfo ( LPWSTR pVendorInfo)

Implements IBaseFilter.

Definition at line 3123 of file proxy.cpp.

3125 {
3126 #ifdef KSPROXY_TRACE
3127  OutputDebugStringW(L"CKsProxy::QueryVendorInfo\n");
3128 #endif
3129  return StringFromCLSID(CLSID_Proxy, pVendorInfo);
3130 }
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
static const WCHAR L[]
Definition: oid.c:1250
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412

◆ Reassociate()

HRESULT STDMETHODCALLTYPE CKsProxy::Reassociate ( void  )

Definition at line 2090 of file proxy.cpp.

2091 {
2092 #ifdef KSPROXY_TRACE
2093  OutputDebugStringW(L"CKsProxy::Reassociate\n");
2094 #endif
2095 
2096  if (!m_DevicePath || m_hDevice)
2097  {
2098  // file path not available
2100  }
2101 
2103  if (!m_hDevice)
2104  {
2105  // failed to open device
2107  }
2108 
2109  // success
2110  return NOERROR;
2111 }
#define NOERROR
Definition: winerror.h:2354
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
LPWSTR m_DevicePath
Definition: proxy.cpp:195
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define OPEN_EXISTING
Definition: compat.h:434
HANDLE m_hDevice
Definition: proxy.cpp:192
#define SEVERITY_ERROR
Definition: winerror.h:65
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const WCHAR L[]
Definition: oid.c:1250
#define GENERIC_READ
Definition: compat.h:124
#define FACILITY_WIN32
Definition: winerror.h:27
#define CreateFileW
Definition: compat.h:408
#define FILE_FLAG_OVERLAPPED
Definition: disk.h:46

◆ Register()

HRESULT STDMETHODCALLTYPE CKsProxy::Register ( void  )

Implements IAMovieSetup.

Definition at line 3138 of file proxy.cpp.

3139 {
3140 #ifdef KSPROXY_TRACE
3141  OutputDebugStringW(L"CKsProxy::Register : NotImplemented\n");
3142 #endif
3143 
3144  return E_NOTIMP