ReactOS  0.4.13-dev-698-g77671f0
CBDADeviceControl Class Reference
Inheritance diagram for CBDADeviceControl:
Collaboration diagram for CBDADeviceControl:

Public Member Functions

STDMETHODIMP QueryInterface (REFIID InterfaceId, PVOID *Interface)
 
 STDMETHODIMP_ (ULONG) AddRef()
 
 STDMETHODIMP_ (ULONG) Release()
 
HRESULT STDMETHODCALLTYPE StartChanges (void)
 
HRESULT STDMETHODCALLTYPE CheckChanges (void)
 
HRESULT STDMETHODCALLTYPE CommitChanges (void)
 
HRESULT STDMETHODCALLTYPE GetChangeState (ULONG *pState)
 
HRESULT STDMETHODCALLTYPE GetNodeTypes (ULONG *pulcNodeTypes, ULONG ulcNodeTypesMax, ULONG *rgulNodeTypes)
 
HRESULT STDMETHODCALLTYPE GetNodeDescriptors (ULONG *ulcNodeDescriptors, ULONG ulcNodeDescriptorsMax, BDANODE_DESCRIPTOR *rgNodeDescriptors)
 
HRESULT STDMETHODCALLTYPE GetNodeInterfaces (ULONG ulNodeType, ULONG *pulcInterfaces, ULONG ulcInterfacesMax, GUID *rgguidInterfaces)
 
HRESULT STDMETHODCALLTYPE GetPinTypes (ULONG *pulcPinTypes, ULONG ulcPinTypesMax, ULONG *rgulPinTypes)
 
HRESULT STDMETHODCALLTYPE GetTemplateConnections (ULONG *pulcConnections, ULONG ulcConnectionsMax, BDA_TEMPLATE_CONNECTION *rgConnections)
 
HRESULT STDMETHODCALLTYPE CreatePin (ULONG ulPinType, ULONG *pulPinId)
 
HRESULT STDMETHODCALLTYPE DeletePin (ULONG ulPinId)
 
HRESULT STDMETHODCALLTYPE SetMediaType (ULONG ulPinId, AM_MEDIA_TYPE *pMediaType)
 
HRESULT STDMETHODCALLTYPE SetMedium (ULONG ulPinId, REGPINMEDIUM *pMedium)
 
HRESULT STDMETHODCALLTYPE CreateTopology (ULONG ulInputPinId, ULONG ulOutputPinId)
 
HRESULT STDMETHODCALLTYPE GetControlNode (ULONG ulInputPinId, ULONG ulOutputPinId, ULONG ulNodeType, IUnknown **ppControlNode)
 
 CBDADeviceControl (IUnknown *pUnkOuter, IBaseFilter *pFilter, HANDLE hFile)
 
virtual ~CBDADeviceControl ()
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Protected Attributes

LONG m_Ref
 
IUnknownm_pUnkOuter
 
HANDLE m_Handle
 
IBaseFilterm_pFilter
 

Additional Inherited Members

- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 

Detailed Description

Definition at line 31 of file devicecontrol.cpp.

Constructor & Destructor Documentation

◆ CBDADeviceControl()

CBDADeviceControl::CBDADeviceControl ( IUnknown pUnkOuter,
IBaseFilter pFilter,
HANDLE  hFile 
)
inline

Definition at line 72 of file devicecontrol.cpp.

72 : m_Ref(0), m_pUnkOuter(pUnkOuter), m_Handle(hFile), m_pFilter(pFilter){};
IBaseFilter * m_pFilter
IUnknown * m_pUnkOuter
_In_ HANDLE hFile
Definition: mswsock.h:90

◆ ~CBDADeviceControl()

virtual CBDADeviceControl::~CBDADeviceControl ( )
inlinevirtual

Definition at line 73 of file devicecontrol.cpp.

73 {};

Member Function Documentation

◆ CheckChanges()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::CheckChanges ( void  )

Implements IBDA_DeviceControl.

Definition at line 145 of file devicecontrol.cpp.

146 {
147  KSMETHOD Method;
148  HRESULT hr;
150 
151  /* setup request */
154  Method.Flags = KSMETHOD_TYPE_NONE;
155 
156  /* execute request */
158 
159 #ifdef BDAPLGIN_TRACE
160  WCHAR Buffer[100];
161  swprintf(Buffer, L"CBDADeviceControl::CheckChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
163 #endif
164 
165  return hr;
166 }
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
GUID Set
Definition: dmksctrl.h:76
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define KSMETHOD_TYPE_NONE
Definition: dmksctrl.h:34
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define IOCTL_KS_METHOD
Definition: ks.h:142
const GUID KSMETHODSETID_BdaChangeSync
ULONG Id
Definition: dmksctrl.h:77
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
ULONG Flags
Definition: dmksctrl.h:78
static const WCHAR L[]
Definition: oid.c:1250
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1

◆ CommitChanges()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::CommitChanges ( void  )

Implements IBDA_DeviceControl.

Definition at line 171 of file devicecontrol.cpp.

172 {
173  KSMETHOD Method;
174  HRESULT hr;
176 
177  /* setup request */
180  Method.Flags = KSMETHOD_TYPE_NONE;
181 
182  /* execute request */
184 
185 #ifdef BDAPLGIN_TRACE
186  WCHAR Buffer[100];
187  swprintf(Buffer, L"CBDADeviceControl::CommitChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
189 #endif
190 
191  return hr;
192 }
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
GUID Set
Definition: dmksctrl.h:76
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define KSMETHOD_TYPE_NONE
Definition: dmksctrl.h:34
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define IOCTL_KS_METHOD
Definition: ks.h:142
const GUID KSMETHODSETID_BdaChangeSync
ULONG Id
Definition: dmksctrl.h:77
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
ULONG Flags
Definition: dmksctrl.h:78
static const WCHAR L[]
Definition: oid.c:1250
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1

◆ CreatePin()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::CreatePin ( ULONG  ulPinType,
ULONG pulPinId 
)

Implements IBDA_Topology.

Definition at line 384 of file devicecontrol.cpp.

385 {
386 #ifdef BDAPLGIN_TRACE
387  OutputDebugStringW(L"CBDADeviceControl::CreatePin: NotImplemented\n");
388 #endif
389 
390  return E_NOTIMPL;
391 }
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

◆ CreateTopology()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::CreateTopology ( ULONG  ulInputPinId,
ULONG  ulOutputPinId 
)

Implements IBDA_Topology.

Definition at line 428 of file devicecontrol.cpp.

429 {
430  KSM_BDA_PIN_PAIR Method;
431  HRESULT hr;
432  ULONG BytesReturned = 0;
433 
437  Method.InputPinId = ulInputPinId;
438  Method.OutputPinId = ulOutputPinId;
439 
441 
442 #ifdef BDAPLGIN_TRACE
443  WCHAR Buffer[100];
444  swprintf(Buffer, L"CBDADeviceControl::CreateTopology: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
446 #endif
447 
448  return hr;
449 }
HRESULT hr
Definition: shlfolder.c:183
ULONG OutputPinId
Definition: bdamedia.h:47
KSDDKAPI HRESULT WINAPI KsSynchronousDeviceControl(HANDLE Handle, ULONG IoControl, PVOID InBuffer, ULONG InLength, PVOID OutBuffer, ULONG OutLength, PULONG BytesReturned)
Definition: ksproxy.cpp:34
const GUID KSMETHODSETID_BdaDeviceConfiguration
GUID Set
Definition: dmksctrl.h:76
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define KSMETHOD_TYPE_NONE
Definition: dmksctrl.h:34
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define IOCTL_KS_METHOD
Definition: ks.h:142
ULONG Id
Definition: dmksctrl.h:77
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
ULONG Flags
Definition: dmksctrl.h:78
static const WCHAR L[]
Definition: oid.c:1250
ULONG InputPinId
Definition: bdamedia.h:43
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1
KSMETHOD Method
Definition: bdamedia.h:41

◆ DeletePin()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::DeletePin ( ULONG  ulPinId)

Implements IBDA_Topology.

Definition at line 395 of file devicecontrol.cpp.

396 {
397 #ifdef BDAPLGIN_TRACE
398  OutputDebugStringW(L"CBDADeviceControl::DeletePin: NotImplemented\n");
399 #endif
400 
401  return E_NOTIMPL;
402 }
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

◆ GetChangeState()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::GetChangeState ( ULONG pState)

Implements IBDA_DeviceControl.

Definition at line 196 of file devicecontrol.cpp.

197 {
198  if (pState)
199  {
200  *pState = BDA_CHANGES_COMPLETE;
201  return S_OK;
202  }
203  else
204  {
205  return E_POINTER;
206  }
207 }
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ GetControlNode()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::GetControlNode ( ULONG  ulInputPinId,
ULONG  ulOutputPinId,
ULONG  ulNodeType,
IUnknown **  ppControlNode 
)

Implements IBDA_Topology.

Definition at line 453 of file devicecontrol.cpp.

454 {
455  HRESULT hr;
456  ULONG PinId = 0;
459 
460  //setup request
464  Property.ulInputPinId = ulInputPinId;
465  Property.ulOutputPinId = ulOutputPinId;
466  Property.ulNodeType = ulNodeType;
467 
468  // perform request
469  // WinXP SP3 expects minimum sizeof(KSP_BDA_NODE_PIN) + sizeof(ULONG)
470  // seems a driver to be a driver bug
471 
473 
474 #ifdef BDAPLGIN_TRACE
475  WCHAR Buffer[200];
476  swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx, BytesReturned %lu PinId %lu ulInputPinId %lu ulOutputPinId %lu ulNodeType %lu\n", hr, BytesReturned, PinId, ulInputPinId, ulOutputPinId, ulNodeType);
478 #endif
479 
480  if (FAILED(hr))
481  return hr;
482 
483  hr = CControlNode_fnConstructor(m_pFilter, ulNodeType, PinId, IID_IUnknown, (LPVOID*)ppControlNode);
484 
485 #ifdef BDAPLGIN_TRACE
486  swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx\n", hr);
488 #endif
489 
490  return hr;
491 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
HRESULT hr
Definition: shlfolder.c:183
IBaseFilter * m_pFilter
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
Definition: bufpool.h:45
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define swprintf(buf, format,...)
Definition: sprintf.c:56
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
const GUID KSPROPSETID_BdaTopology
unsigned int ULONG
Definition: retypes.h:1
Property(long _type, long _tag, INREAL _value)
Definition: reader.h:125
HRESULT WINAPI CControlNode_fnConstructor(IBaseFilter *pFilter, ULONG NodeType, ULONG PinId, REFIID riid, LPVOID *ppv)
Definition: controlnode.cpp:92

◆ GetNodeDescriptors()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::GetNodeDescriptors ( ULONG ulcNodeDescriptors,
ULONG  ulcNodeDescriptorsMax,
BDANODE_DESCRIPTOR rgNodeDescriptors 
)

Implements IBDA_Topology.

Definition at line 250 of file devicecontrol.cpp.

251 {
253  HRESULT hr;
255 
256 
257  // setup request
261 
262  // perform request
263  hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSPROPERTY), rgNodeDescriptors, sizeof(BDANODE_DESCRIPTOR) * ulcNodeDescriptorsMax, &BytesReturned);
264 
265  *ulcNodeDescriptors = (BytesReturned / sizeof(BDANODE_DESCRIPTOR));
266 
267 #ifdef BDAPLGIN_TRACE
268  WCHAR Buffer[1000];
269  swprintf(Buffer, L"CBDADeviceControl::GetNodeDescriptors: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
271 
272 
273  if (SUCCEEDED(hr))
274  {
275  for(ULONG Index = 0; Index < min(*ulcNodeDescriptors, ulcNodeDescriptorsMax); Index++)
276  {
277  LPOLESTR pGUIDFunction, pGUIDName;
278 
279  StringFromCLSID(rgNodeDescriptors[Index].guidFunction, &pGUIDFunction);
280  StringFromCLSID(rgNodeDescriptors[Index].guidName, &pGUIDName);
281 
282  swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\nFunction %s\n Name %s\n-----\n", Index, rgNodeDescriptors[Index].ulBdaNodeType, pGUIDFunction, pGUIDName);
284  }
285  }
286 #endif
287 
288 
289  return hr;
290 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
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
static LPOLESTR
Definition: stg_prop.c:27
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
struct _BDANODE_DESCRIPTOR BDANODE_DESCRIPTOR
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
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
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define min(a, b)
Definition: monoChain.cc:55
const GUID KSPROPSETID_BdaTopology
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2321

◆ GetNodeInterfaces()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::GetNodeInterfaces ( ULONG  ulNodeType,
ULONG pulcInterfaces,
ULONG  ulcInterfacesMax,
GUID rgguidInterfaces 
)

Implements IBDA_Topology.

Definition at line 294 of file devicecontrol.cpp.

295 {
297  HRESULT hr;
299 
300 
301  // setup request
305  Property.NodeId = ulNodeType;
306  Property.Reserved = 0;
307 
308  // perform request
309  hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSP_NODE), rgguidInterfaces, sizeof(GUID) * ulcInterfacesMax, &BytesReturned);
310 
311  *pulcInterfaces = (BytesReturned / sizeof(GUID));
312 
313 #ifdef BDAPLGIN_TRACE
314  WCHAR Buffer[100];
315  swprintf(Buffer, L"CBDADeviceControl::GetNodeInterfaces: hr %lx, BytesReturned %lu ulNodeType %lu\n", hr, BytesReturned, ulNodeType);
317 
318  if (SUCCEEDED(hr))
319  {
320  for(ULONG Index = 0; Index < min(*pulcInterfaces, ulcInterfacesMax); Index++)
321  {
322  LPOLESTR pstr;
323 
324  StringFromCLSID(rgguidInterfaces[Index], &pstr);
325 
326  swprintf(Buffer, L"CBDADeviceControl::GetNodeInterfaces: Index %lu Name %s\n", Index, pstr);
328  }
329  }
330 #endif
331 
332  return hr;
333 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
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
static LPOLESTR
Definition: stg_prop.c:27
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
Definition: ks.h:2104
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
_In_ DWORD Property
Definition: setupapi.h:1545
struct _GUID GUID
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
#define min(a, b)
Definition: monoChain.cc:55
const GUID KSPROPSETID_BdaTopology
unsigned int ULONG
Definition: retypes.h:1
Property(long _type, long _tag, INREAL _value)
Definition: reader.h:125
#define SUCCEEDED(hr)
Definition: intsafe.h:57
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2321

◆ GetNodeTypes()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::GetNodeTypes ( ULONG pulcNodeTypes,
ULONG  ulcNodeTypesMax,
ULONG rgulNodeTypes 
)

Implements IBDA_Topology.

Definition at line 214 of file devicecontrol.cpp.

215 {
217  HRESULT hr;
219 
220  // setup request
224 
225  // perform request
226  hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSPROPERTY), rgulNodeTypes, sizeof(ULONG) * ulcNodeTypesMax, &BytesReturned);
227 
228  *pulcNodeTypes = (BytesReturned / sizeof(ULONG));
229 
230 #ifdef BDAPLGIN_TRACE
231  WCHAR Buffer[100];
232  swprintf(Buffer, L"CBDADeviceControl::GetNodeTypes: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
234 
235  if (SUCCEEDED(hr))
236  {
237  for(ULONG Index = 0; Index < *pulcNodeTypes; Index++)
238  {
239  swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\n", Index, rgulNodeTypes[Index]);
241  }
242  }
243 #endif
244 
245  return hr;
246 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
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
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
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
const GUID KSPROPSETID_BdaTopology
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ GetPinTypes()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::GetPinTypes ( ULONG pulcPinTypes,
ULONG  ulcPinTypesMax,
ULONG rgulPinTypes 
)

Implements IBDA_Topology.

Definition at line 337 of file devicecontrol.cpp.

338 {
340  HRESULT hr;
342 
343  // setup request
347 
348  // perform request
349  hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSPROPERTY), rgulPinTypes, sizeof(ULONG) * ulcPinTypesMax, &BytesReturned);
350 
351  *pulcPinTypes = (BytesReturned / sizeof(ULONG));
352 
353 #ifdef BDAPLGIN_TRACE
354  WCHAR Buffer[100];
355  swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
357 
358  if (SUCCEEDED(hr))
359  {
360  for(ULONG Index = 0; Index < *pulcPinTypes; Index++)
361  {
362  swprintf(Buffer, L"CBDADeviceControl::GetPinTypes: Index %lu Value %lx\n", Index, rgulPinTypes[Index]);
364  }
365  }
366 #endif
367 
368  return hr;
369 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:150
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
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
_In_ DWORD Property
Definition: setupapi.h:1545
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
const GUID KSPROPSETID_BdaTopology
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ GetTemplateConnections()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::GetTemplateConnections ( ULONG pulcConnections,
ULONG  ulcConnectionsMax,
BDA_TEMPLATE_CONNECTION rgConnections 
)

Implements IBDA_Topology.

Definition at line 373 of file devicecontrol.cpp.

374 {
375 #ifdef BDAPLGIN_TRACE
376  OutputDebugStringW(L"CBDADeviceControl::GetTemplateConnections: NotImplemented\n");
377 #endif
378 
379  return E_NOTIMPL;
380 }
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

◆ QueryInterface()

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

Definition at line 84 of file devicecontrol.cpp.

87 {
88  *Output = NULL;
89 
90  if (IsEqualGUID(refiid, IID_IUnknown))
91  {
92  *Output = PVOID(this);
93  reinterpret_cast<IUnknown*>(*Output)->AddRef();
94  return NOERROR;
95  }
97  {
98  *Output = (IBDA_DeviceControl*)(this);
99  reinterpret_cast<IBDA_DeviceControl*>(*Output)->AddRef();
100  return NOERROR;
101  }
102 
103  if (IsEqualGUID(refiid, IID_IBDA_Topology))
104  {
105  *Output = (IBDA_Topology*)(this);
106  reinterpret_cast<IBDA_Topology*>(*Output)->AddRef();
107  return NOERROR;
108  }
109 
110  return E_NOINTERFACE;
111 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354
smooth NULL
Definition: ftsmooth.c:416
void * PVOID
Definition: retypes.h:9
const GUID IID_IUnknown
Definition: arc.h:85
const GUID IID_IBDA_DeviceControl
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
const GUID IID_IBDA_Topology

◆ SetMediaType()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::SetMediaType ( ULONG  ulPinId,
AM_MEDIA_TYPE pMediaType 
)

Implements IBDA_Topology.

Definition at line 406 of file devicecontrol.cpp.

407 {
408 #ifdef BDAPLGIN_TRACE
409  OutputDebugStringW(L"CBDADeviceControl::SetMediaType: NotImplemented\n");
410 #endif
411 
412  return E_NOTIMPL;
413 }
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

◆ SetMedium()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::SetMedium ( ULONG  ulPinId,
REGPINMEDIUM pMedium 
)

Implements IBDA_Topology.

Definition at line 417 of file devicecontrol.cpp.

418 {
419 #ifdef BDAPLGIN_TRACE
420  OutputDebugStringW(L"CBDADeviceControl::SetMedium: NotImplemented\n");
421 #endif
422 
423  return E_NOTIMPL;
424 }
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

◆ StartChanges()

HRESULT STDMETHODCALLTYPE CBDADeviceControl::StartChanges ( void  )

Implements IBDA_DeviceControl.

Definition at line 119 of file devicecontrol.cpp.

120 {
121  KSMETHOD Method;
122  HRESULT hr;
124 
125  /* setup request */
128  Method.Flags = KSMETHOD_TYPE_NONE;
129 
130  /* execute request */
132 
133 #ifdef BDAPLGIN_TRACE
134  WCHAR Buffer[100];
135  swprintf(Buffer, L"CBDADeviceControl::StartChanges: hr %lx, BytesReturned %lu\n", hr, BytesReturned);
137 #endif
138 
139  return hr;
140 }
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
GUID Set
Definition: dmksctrl.h:76
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define KSMETHOD_TYPE_NONE
Definition: dmksctrl.h:34
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
#define IOCTL_KS_METHOD
Definition: ks.h:142
const GUID KSMETHODSETID_BdaChangeSync
ULONG Id
Definition: dmksctrl.h:77
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define swprintf(buf, format,...)
Definition: sprintf.c:56
ULONG Flags
Definition: dmksctrl.h:78
static const WCHAR L[]
Definition: oid.c:1250
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1

◆ STDMETHODIMP_() [1/2]

CBDADeviceControl::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 37 of file devicecontrol.cpp.

38  {
40  return m_Ref;
41  }
#define InterlockedIncrement
Definition: armddk.h:53

◆ STDMETHODIMP_() [2/2]

CBDADeviceControl::STDMETHODIMP_ ( ULONG  )
inline

Definition at line 42 of file devicecontrol.cpp.

43  {
45  if (!m_Ref)
46  {
47  delete this;
48  return 0;
49  }
50  return m_Ref;
51  }
#define InterlockedDecrement
Definition: armddk.h:52

Member Data Documentation

◆ m_Handle

◆ m_pFilter

IBaseFilter* CBDADeviceControl::m_pFilter
protected

Definition at line 79 of file devicecontrol.cpp.

Referenced by GetControlNode().

◆ m_pUnkOuter

IUnknown* CBDADeviceControl::m_pUnkOuter
protected

Definition at line 77 of file devicecontrol.cpp.

◆ m_Ref

LONG CBDADeviceControl::m_Ref
protected

Definition at line 73 of file devicecontrol.cpp.

Referenced by STDMETHODIMP_().


The documentation for this class was generated from the following file: