ReactOS  0.4.13-dev-257-gfabbd7c
precomp.h File Reference
#include <dshow.h>
#include <ks.h>
#include <ksproxy.h>
#include <devioctl.h>
#include <stdio.h>
#include <dvp.h>
#include <vptype.h>
#include <vpconfig.h>
#include <setupapi.h>
#include <vector>
#include <stack>
#include <list>
#include <assert.h>
#include <ksmedia.h>
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  INTERFACE_TABLE
 

Macros

#define WIN32_NO_STATUS
 
#define WIN32_LEAN_AND_MEAN
 
#define _FORCENAMELESSUNION
 
#define BUILDING_KS
 
#define _KSDDK_
 
#define KSPROXY_TRACE
 
#define __STREAMS__
 
#define INTERFACE   IKsClock
 

Typedefs

typedef REFIID riid
 
typedef REFIID LPVOIDppvObject
 

Functions

interface DECLSPEC_UUID ("877E4351-6FEA-11D0-B863-00AA00A216A1") IKsClock
 
 DECLARE_INTERFACE_ (IKsClock, IUnknown)
 
typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown *pUnkOuter
 
IClassFactoryCClassFactory_fnConstructor (LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, IID *riidInst)
 
HRESULT WINAPI CKsDataTypeHandler_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CKsInterfaceHandler_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CKsClockForwarder_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CKsQualityForwarder_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CVPConfig_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CVPVBIConfig_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CKsBasicAudio_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CKsProxy_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CInputPin_Constructor (IBaseFilter *ParentFilter, LPCWSTR PinName, HANDLE hFilter, ULONG PinId, KSPIN_COMMUNICATION Communication, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI COutputPin_Constructor (IBaseFilter *ParentFilter, LPCWSTR PinName, ULONG PinId, KSPIN_COMMUNICATION Communication, REFIID riid, LPVOID *ppv)
 
HRESULT STDMETHODCALLTYPE COutputPin_SetState (IPin *Pin, KSSTATE State)
 
HRESULT WINAPI CEnumPins_fnConstructor (std::vector< IPin * > Pins, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CEnumMediaTypes_fnConstructor (ULONG MediaTypeCount, AM_MEDIA_TYPE *MediaTypes, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CKsNode_Constructor (IUnknown *pUnkOuter, HANDLE ParentHandle, ULONG NodeId, ACCESS_MASK DesiredAccess, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CKsAllocator_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CMediaSample_Constructor (IMemAllocator *Allocator, BYTE *pBuffer, ULONG BufferSize, REFIID riid, LPVOID *ppv)
 

Variables

const GUID IID_IKsObject
 
const GUID IID_IKsPinEx
 
const GUID IID_IKsAggregateControl
 
const GUID IID_IKsPinPipe
 
const GUID IID_IKsPinFactory
 
const GUID IID_IKsAllocatorEx
 
KSPIN_INTERFACE StandardPinInterface
 
KSPIN_MEDIUM StandardPinMedium
 

Macro Definition Documentation

◆ __STREAMS__

#define __STREAMS__

Definition at line 13 of file precomp.h.

◆ _FORCENAMELESSUNION

#define _FORCENAMELESSUNION

Definition at line 6 of file precomp.h.

◆ _KSDDK_

#define _KSDDK_

Definition at line 8 of file precomp.h.

◆ BUILDING_KS

#define BUILDING_KS

Definition at line 7 of file precomp.h.

◆ INTERFACE

#define INTERFACE   IKsClock

Definition at line 34 of file precomp.h.

◆ KSPROXY_TRACE

#define KSPROXY_TRACE

Definition at line 9 of file precomp.h.

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Definition at line 4 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 3 of file precomp.h.

Typedef Documentation

◆ ppvObject

◆ riid

typedef REFIID riid

Definition at line 44 of file precomp.h.

Function Documentation

◆ CClassFactory_fnConstructor()

IClassFactory* CClassFactory_fnConstructor ( LPFNCREATEINSTANCE  lpfnCI,
PLONG  pcRefDll,
IID riidInst 
)

Definition at line 91 of file classfactory.cpp.

95 {
96  CClassFactory* factory = new CClassFactory(lpfnCI, pcRefDll, riidInst);
97 
98  if (!factory)
99  return NULL;
100 
101  if (pcRefDll)
102  InterlockedIncrement(pcRefDll);
103 
104  return (LPCLASSFACTORY)factory;
105 }
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
Definition: main.c:440
smooth NULL
Definition: ftsmooth.c:416
#define InterlockedIncrement
Definition: armddk.h:53
static ClassFactoryImpl factory
Definition: ole_server.c:234

◆ CEnumMediaTypes_fnConstructor()

HRESULT WINAPI CEnumMediaTypes_fnConstructor ( ULONG  MediaTypeCount,
AM_MEDIA_TYPE MediaTypes,
REFIID  riid,
LPVOID ppv 
)

Definition at line 175 of file enum_mediatypes.cpp.

180 {
181  CEnumMediaTypes * handler = new CEnumMediaTypes(MediaTypeCount, MediaTypes);
182 
183 #ifdef KSPROXY_TRACE
185  LPOLESTR lpstr;
187  swprintf(Buffer, L"CEnumMediaTypes_fnConstructor riid %s\n", lpstr);
189 #endif
190 
191  if (!handler)
192  {
193  CoTaskMemFree(MediaTypes);
194  return E_OUTOFMEMORY;
195  }
196 
197  if (FAILED(handler->QueryInterface(riid, ppv)))
198  {
199  /* not supported */
200  delete handler;
201  return E_NOINTERFACE;
202  }
203 
204  return NOERROR;
205 }
#define E_NOINTERFACE
Definition: winerror.h:2364
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static LPOLESTR
Definition: stg_prop.c:27
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: bufpool.h:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
static const WCHAR L[]
Definition: oid.c:1250
static LPCSTR lpstr
Definition: font.c:51
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2321

Referenced by CPin::EnumMediaTypes(), CInputPin::EnumMediaTypes(), and COutputPin::EnumMediaTypes().

◆ CEnumPins_fnConstructor()

HRESULT WINAPI CEnumPins_fnConstructor ( std::vector< IPin * >  Pins,
REFIID  riid,
LPVOID ppv 
)

Definition at line 151 of file enumpins.cpp.

155 {
156  CEnumPins * handler = new CEnumPins(Pins);
157 
158  if (!handler)
159  return E_OUTOFMEMORY;
160 
161  if (FAILED(handler->QueryInterface(riid, ppv)))
162  {
163  /* not supported */
164  delete handler;
165  return E_NOINTERFACE;
166  }
167 
168  return NOERROR;
169 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

Referenced by CNetworkProvider::EnumPins(), and CKsProxy::EnumPins().

◆ CInputPin_Constructor()

HRESULT WINAPI CInputPin_Constructor ( IBaseFilter ParentFilter,
LPCWSTR  PinName,
HANDLE  hFilter,
ULONG  PinId,
KSPIN_COMMUNICATION  Communication,
REFIID  riid,
LPVOID ppv 
)

Definition at line 1766 of file input_pin.cpp.

1774 {
1775  CInputPin * handler = new CInputPin(ParentFilter, PinName, PinId, Communication);
1776 
1777  if (!handler)
1778  return E_OUTOFMEMORY;
1779 
1780  if (FAILED(handler->QueryInterface(riid, ppv)))
1781  {
1782  /* not supported */
1783  delete handler;
1784  return E_NOINTERFACE;
1785  }
1786 
1787  return S_OK;
1788 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define S_OK
Definition: intsafe.h:59
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

Referenced by CKsProxy::CreatePins().

◆ CKsAllocator_Constructor()

HRESULT WINAPI CKsAllocator_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv 
)

Definition at line 603 of file allocator.cpp.

607 {
608 #ifdef KSPROXY_TRACE
609  OutputDebugStringW(L"CKsAllocator_Constructor\n");
610 #endif
611 
613 
614  if (!handler)
615  return E_OUTOFMEMORY;
616 
617  if (FAILED(handler->QueryInterface(riid, ppv)))
618  {
619  /* not supported */
620  delete handler;
621  return E_NOINTERFACE;
622  }
623 
624  return NOERROR;
625 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const WCHAR L[]
Definition: oid.c:1250
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

Referenced by COutputPin::Connect().

◆ CKsBasicAudio_Constructor()

HRESULT WINAPI CKsBasicAudio_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv 
)

Definition at line 272 of file basicaudio.cpp.

276 {
277 #ifdef KSPROXY_TRACE
278  OutputDebugStringW(L"CKsBasicAudio_Constructor\n");
279 #endif
280 
282 
283  if (!handler)
284  return E_OUTOFMEMORY;
285 
286  if (FAILED(handler->QueryInterface(riid, ppv)))
287  {
288  /* not supported */
289  delete handler;
290  return E_NOINTERFACE;
291  }
292 
293  return NOERROR;
294 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const WCHAR L[]
Definition: oid.c:1250
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

◆ CKsClockForwarder_Constructor()

HRESULT WINAPI CKsClockForwarder_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv 
)

Definition at line 334 of file clockforward.cpp.

338 {
339  HRESULT hr;
340  HANDLE handle;
341 
342 #ifdef KSPROXY_TRACE
343  OutputDebugStringW(L"CKsClockForwarder_Constructor\n");
344 #endif
345 
346  // open default clock
348 
349  if (hr != NOERROR)
350  {
351 #ifdef KSPROXY_TRACE
352  OutputDebugString("CKsClockForwarder_Constructor failed to open device\n");
353 #endif
354  return hr;
355  }
356 
358 
359  if (!clock)
360  {
361  // free clock handle
363  return E_OUTOFMEMORY;
364  }
365 
366  if (FAILED(clock->QueryInterface(riid, ppv)))
367  {
368  /* not supported */
369  delete clock;
370  return E_NOINTERFACE;
371  }
372 
373  return NOERROR;
374 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define CloseHandle
Definition: compat.h:398
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define OutputDebugString
Definition: winbase.h:3704
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define GENERIC_WRITE
Definition: nt_native.h:90
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR L[]
Definition: oid.c:1250
#define GENERIC_READ
Definition: compat.h:124
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
Definition: clock.c:23
#define KSCATEGORY_CLOCK
Definition: ks.h:245
KSDDKAPI HRESULT WINAPI KsOpenDefaultDevice(REFGUID Category, ACCESS_MASK Access, PHANDLE DeviceHandle)
Definition: ksproxy.cpp:101

◆ CKsDataTypeHandler_Constructor()

HRESULT WINAPI CKsDataTypeHandler_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv 
)

Definition at line 228 of file datatype.cpp.

232 {
233 #ifdef KSPROXY_TRACE
234  OutputDebugStringW(L"CKsDataTypeHandler_Constructor\n");
235 #endif
236 
238 
239  if (!handler)
240  return E_OUTOFMEMORY;
241 
242  if (FAILED(handler->QueryInterface(riid, ppv)))
243  {
244  /* not supported */
245  delete handler;
246  return E_NOINTERFACE;
247  }
248 
249  return NOERROR;
250 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const WCHAR L[]
Definition: oid.c:1250
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

◆ CKsInterfaceHandler_Constructor()

HRESULT WINAPI CKsInterfaceHandler_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv 
)

Definition at line 478 of file interface.cpp.

482 {
483 #ifdef KSPROXY_TRACE
484  OutputDebugStringW(L"CKsInterfaceHandler_Constructor\n");
485 #endif
486 
488 
489  if (!handler)
490  return E_OUTOFMEMORY;
491 
492  if (FAILED(handler->QueryInterface(riid, ppv)))
493  {
494  /* not supported */
495  delete handler;
496  return E_NOINTERFACE;
497  }
498 
499  return NOERROR;
500 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const WCHAR L[]
Definition: oid.c:1250
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

◆ CKsNode_Constructor()

HRESULT WINAPI CKsNode_Constructor ( IUnknown pUnkOuter,
HANDLE  ParentHandle,
ULONG  NodeId,
ACCESS_MASK  DesiredAccess,
REFIID  riid,
LPVOID ppv 
)

Definition at line 115 of file node.cpp.

122 {
123  HRESULT hr;
124  HANDLE handle;
126 
127 #ifdef KSPROXY_TRACE
128  OutputDebugStringW(L"CKsNode_Constructor\n");
129 #endif
130 
131  //setup request
133  NodeCreate.Node = NodeId;
134 
136  if (hr != NOERROR)
137  {
138  OutputDebugString("CKsNode_Constructor failed to open device\n");
140  }
141 
142  CKsNode * quality = new CKsNode(pUnkOuter, handle);
143 
144  if (!quality)
145  {
146  // free clock handle
148  return E_OUTOFMEMORY;
149  }
150 
151  if (FAILED(quality->QueryInterface(riid, ppv)))
152  {
153  /* not supported */
154  delete quality;
155  return E_NOINTERFACE;
156  }
157 
158  return NOERROR;
159 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define CloseHandle
Definition: compat.h:398
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
#define NOERROR
Definition: winerror.h:2354
_In_ PKSNODE_CREATE NodeCreate
Definition: ks.h:4575
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
Definition: node.cpp:11
#define OutputDebugString
Definition: winbase.h:3704
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
KSDDKAPI DWORD NTAPI KsCreateTopologyNode(HANDLE ParentHandle, PKSNODE_CREATE NodeCreate, IN ACCESS_MASK DesiredAccess, OUT PHANDLE NodeHandle)
Definition: ksuser.c:240
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
ULONG Node
Definition: ks.h:2124
LONG HRESULT
Definition: typedefs.h:77
int quality
Definition: jpeglib.h:991
#define SEVERITY_ERROR
Definition: winerror.h:65
static const WCHAR L[]
Definition: oid.c:1250
#define FACILITY_WIN32
Definition: winerror.h:27
_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
ULONG CreateFlags
Definition: ks.h:2123

Referenced by CKsProxy::CreateNodeInstance().

◆ CKsProxy_Constructor()

HRESULT WINAPI CKsProxy_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv 
)

Definition at line 3159 of file proxy.cpp.

3163 {
3164 #ifdef KSPROXY_TRACE
3165  WCHAR Buffer[100];
3166  LPOLESTR pstr;
3167  StringFromCLSID(riid, &pstr);
3168  swprintf(Buffer, L"CKsProxy_Constructor pUnkOuter %p riid %s\n", pUnkOuter, pstr);
3170 #endif
3171 
3172  CKsProxy * handler = new CKsProxy();
3173 
3174  if (!handler)
3175  return E_OUTOFMEMORY;
3176 
3177  if (FAILED(handler->QueryInterface(riid, ppv)))
3178  {
3179  /* not supported */
3180  delete handler;
3181  return E_NOINTERFACE;
3182  }
3183 
3184  return S_OK;
3185 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static LPOLESTR
Definition: stg_prop.c:27
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: bufpool.h:45
__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
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2321

◆ CKsQualityForwarder_Constructor()

HRESULT WINAPI CKsQualityForwarder_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv 
)

Definition at line 94 of file qualityforward.cpp.

98 {
99  HRESULT hr;
100  HANDLE handle;
101 
102 #ifdef KSPROXY_TRACE
103  OutputDebugStringW(L"CKsQualityForwarder_Constructor\n");
104 #endif
105 
106  // open default clock
108 
109  if (hr != NOERROR)
110  {
111 #ifdef KSPROXY_TRACE
112  OutputDebugString("CKsClockForwarder_Constructor failed to open device\n");
113 #endif
114  return hr;
115  }
116 
118 
119  if (!quality)
120  {
121  // free clock handle
123  return E_OUTOFMEMORY;
124  }
125 
126  if (FAILED(quality->QueryInterface(riid, ppv)))
127  {
128  /* not supported */
129  delete quality;
130  return E_NOINTERFACE;
131  }
132 
133  return NOERROR;
134 }
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define CloseHandle
Definition: compat.h:398
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define OutputDebugString
Definition: winbase.h:3704
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define GENERIC_WRITE
Definition: nt_native.h:90
LONG HRESULT
Definition: typedefs.h:77
int quality
Definition: jpeglib.h:991
static const WCHAR L[]
Definition: oid.c:1250
#define GENERIC_READ
Definition: compat.h:124
#define KSCATEGORY_QUALITY
Definition: ks.h:255
KSDDKAPI HRESULT WINAPI KsOpenDefaultDevice(REFGUID Category, ACCESS_MASK Access, PHANDLE DeviceHandle)
Definition: ksproxy.cpp:101

◆ CMediaSample_Constructor()

HRESULT WINAPI CMediaSample_Constructor ( IMemAllocator Allocator,
BYTE pBuffer,
ULONG  BufferSize,
REFIID  riid,
LPVOID ppv 
)

Definition at line 342 of file mediasample.cpp.

348 {
349 #ifdef KSPROXY_TRACE
350  OutputDebugStringW(L"CMediaSample_Constructor\n");
351 #endif
352 
353  CMediaSample * handler = new CMediaSample(Allocator, pBuffer, BufferSize);
354 
355  if (!handler)
356  return E_OUTOFMEMORY;
357 
358  if (FAILED(handler->QueryInterface(riid, ppv)))
359  {
360  /* not supported */
361  delete handler;
362  return E_NOINTERFACE;
363  }
364 
365  return NOERROR;
366 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
PVOID pBuffer
#define BufferSize
Definition: classpnp.h:419
static const WCHAR L[]
Definition: oid.c:1250
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

Referenced by CKsAllocator::Commit().

◆ COutputPin_Constructor()

HRESULT WINAPI COutputPin_Constructor ( IBaseFilter ParentFilter,
LPCWSTR  PinName,
ULONG  PinId,
KSPIN_COMMUNICATION  Communication,
REFIID  riid,
LPVOID ppv 
)

Definition at line 2801 of file output_pin.cpp.

2808 {
2809  COutputPin * handler = new COutputPin(ParentFilter, PinName, PinId, Communication);
2810 
2811  if (!handler)
2812  return E_OUTOFMEMORY;
2813 
2814  if (FAILED(handler->QueryInterface(riid, ppv)))
2815  {
2816  /* not supported */
2817  delete handler;
2818  return E_NOINTERFACE;
2819  }
2820 
2821  return S_OK;
2822 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define S_OK
Definition: intsafe.h:59
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

Referenced by CKsProxy::CreatePins().

◆ COutputPin_SetState()

HRESULT STDMETHODCALLTYPE COutputPin_SetState ( IPin Pin,
KSSTATE  State 
)

Definition at line 2607 of file output_pin.cpp.

2610 {
2611  HRESULT hr = S_OK;
2613  KSSTATE CurState;
2615  COutputPin * pPin = (COutputPin*)Pin;
2616 
2617 #ifdef KSPROXY_TRACE
2618  WCHAR Buffer[200];
2619 #endif
2620 
2623  Property.Flags = KSPROPERTY_TYPE_SET;
2624 
2625  EnterCriticalSection(&pPin->m_Lock);
2626 
2627  if (pPin->m_State <= State)
2628  {
2629  if (pPin->m_State == KSSTATE_STOP)
2630  {
2631  hr = pPin->InitializeIOThread();
2632  if (FAILED(hr))
2633  {
2634  // failed to initialize I/O thread
2635 #ifdef KSPROXY_TRACE
2636  OutputDebugStringW(L"Failed to initialize I/O Thread\n");
2637 #endif
2638  LeaveCriticalSection(&pPin->m_Lock);
2639  return hr;
2640  }
2641  CurState = KSSTATE_ACQUIRE;
2642  hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned);
2643 
2644 #ifdef KSPROXY_TRACE
2645  swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_STOP KSSTATE_ACQUIRE PinName %s hr %lx\n", pPin->m_PinName, hr);
2647 #endif
2648 
2649  if (FAILED(hr))
2650  {
2651  LeaveCriticalSection(&pPin->m_Lock);
2652  return hr;
2653  }
2654 
2655  pPin->m_State = CurState;
2656 
2657  if (pPin->m_State == State)
2658  {
2659  LeaveCriticalSection(&pPin->m_Lock);
2660  return hr;
2661  }
2662  }
2663  if (pPin->m_State == KSSTATE_ACQUIRE)
2664  {
2665  CurState = KSSTATE_PAUSE;
2666  hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned);
2667 
2668 #ifdef KSPROXY_TRACE
2669  swprintf(Buffer, L"COutputPin_SetState Setting State CurState KSSTATE_ACQUIRE KSSTATE_PAUSE PinName %s hr %lx\n", pPin->m_PinName, hr);
2671 #endif
2672 
2673  if (FAILED(hr))
2674  {
2675  LeaveCriticalSection(&pPin->m_Lock);
2676  return hr;
2677  }
2678 
2679  pPin->m_State = CurState;
2680 
2681  if (pPin->m_State == State)
2682  {
2683  LeaveCriticalSection(&pPin->m_Lock);
2684  return hr;
2685  }
2686  }
2687  if (State == KSSTATE_RUN && pPin->m_State == KSSTATE_PAUSE)
2688  {
2689  CurState = KSSTATE_RUN;
2690  hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned);
2691 
2692 #ifdef KSPROXY_TRACE
2693  swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_PAUSE KSSTATE_RUN PinName %s hr %lx\n", pPin->m_PinName, hr);
2695 #endif
2696 
2697  if (SUCCEEDED(hr))
2698  {
2699  pPin->m_State = CurState;
2700  // signal start event
2701  SetEvent(pPin->m_hStartEvent);
2702  }
2703  }
2704 
2705  LeaveCriticalSection(&pPin->m_Lock);
2706  return hr;
2707  }
2708  else
2709  {
2710  if (pPin->m_State == KSSTATE_RUN)
2711  {
2712  // setting pending stop flag
2713  pPin->m_StopInProgress = true;
2714 
2715  // release any waiting threads
2717 
2718  // wait until i/o thread is done
2720 
2721  CurState = KSSTATE_PAUSE;
2722  hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned);
2723 
2724 #ifdef KSPROXY_TRACE
2725  swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_RUN KSSTATE_PAUSE PinName %s hr %lx\n", pPin->m_PinName, hr);
2727 #endif
2728 
2729  if (FAILED(hr))
2730  {
2731  LeaveCriticalSection(&pPin->m_Lock);
2732  return hr;
2733  }
2734 
2735  pPin->m_State = CurState;
2736 
2737  if (FAILED(hr))
2738  {
2739  LeaveCriticalSection(&pPin->m_Lock);
2740  return hr;
2741  }
2742  }
2743  if (pPin->m_State == KSSTATE_PAUSE)
2744  {
2745  CurState = KSSTATE_ACQUIRE;
2746  hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned);
2747 
2748 #ifdef KSPROXY_TRACE
2749  swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_PAUSE KSSTATE_ACQUIRE PinName %s hr %lx\n", pPin->m_PinName, hr);
2751 #endif
2752 
2753  if (FAILED(hr))
2754  {
2755  LeaveCriticalSection(&pPin->m_Lock);
2756  return hr;
2757  }
2758 
2759  pPin->m_State = CurState;
2760 
2761  if (pPin->m_State == State)
2762  {
2763  LeaveCriticalSection(&pPin->m_Lock);
2764  return hr;
2765  }
2766  }
2767 
2768  CloseHandle(pPin->m_hStopEvent);
2769  CloseHandle(pPin->m_hStartEvent);
2771 
2772  /* close event handles */
2773  pPin->m_hStopEvent = NULL;
2774  pPin->m_hStartEvent = NULL;
2775  pPin->m_hBufferAvailable = NULL;
2776 
2777  CurState = KSSTATE_STOP;
2778  hr = pPin->KsProperty(&Property, sizeof(KSPROPERTY), &CurState, sizeof(KSSTATE), &BytesReturned);
2779 
2780 #ifdef KSPROXY_TRACE
2781  swprintf(Buffer, L"COutputPin_SetState Setting State CurState: KSSTATE_ACQUIRE KSSTATE_STOP PinName %s hr %lx\n", pPin->m_PinName, hr);
2783 #endif
2784 
2785  if (SUCCEEDED(hr))
2786  {
2787  // store state
2788  pPin->m_State = CurState;
2789  }
2790 
2791  // unset pending stop flag
2792  pPin->m_StopInProgress = false;
2793 
2794  LeaveCriticalSection(&pPin->m_Lock);
2795  return hr;
2796  }
2797 }
BOOL m_StopInProgress
Definition: output_pin.cpp:201
HANDLE m_hBufferAvailable
Definition: output_pin.cpp:199
#define CloseHandle
Definition: compat.h:398
HRESULT hr
Definition: shlfolder.c:183
LPCWSTR m_PinName
Definition: output_pin.cpp:176
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:679
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define KSPROPSETID_Connection
Definition: ks.h:376
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
HRESULT WINAPI InitializeIOThread()
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
HANDLE m_hStartEvent
Definition: output_pin.cpp:198
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
static const WCHAR L[]
Definition: oid.c:1250
_In_ DWORD Property
Definition: setupapi.h:1545
#define S_OK
Definition: intsafe.h:59
KSSTATE m_State
Definition: output_pin.cpp:204
KSSTATE
Definition: ks.h:1244
HANDLE m_hStopEvent
Definition: output_pin.cpp:200
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define INFINITE
Definition: serial.h:102
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
HRESULT STDMETHODCALLTYPE KsProperty(PKSPROPERTY Property, ULONG PropertyLength, LPVOID PropertyData, ULONG DataLength, ULONG *BytesReturned)
#define SUCCEEDED(hr)
Definition: intsafe.h:57
CRITICAL_SECTION m_Lock
Definition: output_pin.cpp:205

Referenced by CKsProxy::SetPinState().

◆ CVPConfig_Constructor()

HRESULT WINAPI CVPConfig_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv 
)

Definition at line 336 of file cvpconfig.cpp.

340 {
341 #ifdef KSPROXY_TRACE
342  OutputDebugStringW(L"CVPConfig_Constructor\n");
343 #endif
344 
345  CVPConfig * handler = new CVPConfig();
346 
347  if (!handler)
348  return E_OUTOFMEMORY;
349 
350  if (FAILED(handler->QueryInterface(riid, ppv)))
351  {
352  /* not supported */
353  delete handler;
354  return E_NOINTERFACE;
355  }
356 
357  return NOERROR;
358 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const WCHAR L[]
Definition: oid.c:1250
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

◆ CVPVBIConfig_Constructor()

HRESULT WINAPI CVPVBIConfig_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv 
)

Definition at line 306 of file cvpvbiconfig.cpp.

310 {
311 #ifdef KSPROXY_TRACE
312  OutputDebugStringW(L"CVPVBIConfig_Constructor\n");
313 #endif
314 
316 
317  if (!handler)
318  return E_OUTOFMEMORY;
319 
320  if (FAILED(handler->QueryInterface(riid, ppv)))
321  {
322  /* not supported */
323  delete handler;
324  return E_NOINTERFACE;
325  }
326 
327  return NOERROR;
328 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const WCHAR L[]
Definition: oid.c:1250
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786

◆ DECLARE_INTERFACE_()

DECLARE_INTERFACE_ ( IKsClock  ,
IUnknown   
)

Definition at line 36 of file precomp.h.

37 {
38  STDMETHOD_(HANDLE, KsGetClockHandle)(
39  THIS
40  ) PURE;
41 };
#define THIS
Definition: basetyps.h:66
#define PURE
Definition: basetyps.h:64
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DECLSPEC_UUID()

interface DECLSPEC_UUID ( "877E4351-6FEA-11D0-B863-00AA00A216A1"  )

◆ HRESULT()

typedef HRESULT ( CALLBACK LPFNCREATEINSTANCE)

Variable Documentation

◆ IID_IKsAggregateControl

const GUID IID_IKsAggregateControl

◆ IID_IKsAllocatorEx

const GUID IID_IKsAllocatorEx

Definition at line 11 of file allocator.cpp.

Referenced by CKsAllocator::QueryInterface().

◆ IID_IKsObject

◆ IID_IKsPinEx

◆ IID_IKsPinFactory

const GUID IID_IKsPinFactory

◆ IID_IKsPinPipe

const GUID IID_IKsPinPipe

Definition at line 11 of file input_pin.cpp.

Referenced by COutputPin::QueryInterface(), and CInputPin::QueryInterface().

◆ StandardPinInterface

◆ StandardPinMedium