ReactOS 0.4.16-dev-297-gc569aee
precomp.h File Reference
#include <dshow.h>
#include <ks.h>
#include <ksproxy.h>
#include <ksmedia.h>
#include <stdio.h>
#include <wchar.h>
#include <tchar.h>
#include <uuids.h>
#include <bdatypes.h>
#include <bdaiface.h>
#include <bdamedia.h>
#include <assert.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 BDAPLGIN_TRACE
 
#define BUILDING_KS
 
#define _KSDDK_
 
#define __STREAMS__
 

Typedefs

typedef HRESULT(CALLBACKLPFNCREATEINSTANCE) (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)
 

Functions

IClassFactoryCClassFactory_fnConstructor (LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, IID *riidInst)
 
HRESULT WINAPI CBDADeviceControl_fnConstructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CBDAPinControl_fnConstructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CControlNode_fnConstructor (IBaseFilter *pFilter, ULONG NodeType, ULONG PinId, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CBDAFrequencyFilter_fnConstructor (IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CBDASignalStatistics_fnConstructor (IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CBDALNBInfo_fnConstructor (IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI CBDADigitalDemodulator_fnConstructor (IKsPropertySet *pProperty, ULONG NodeId, REFIID riid, LPVOID *ppv)
 

Variables

const GUID IID_IKsObject
 

Macro Definition Documentation

◆ __STREAMS__

#define __STREAMS__

Definition at line 10 of file precomp.h.

◆ _KSDDK_

#define _KSDDK_

Definition at line 6 of file precomp.h.

◆ BDAPLGIN_TRACE

#define BDAPLGIN_TRACE

Definition at line 4 of file precomp.h.

◆ BUILDING_KS

#define BUILDING_KS

Definition at line 5 of file precomp.h.

Typedef Documentation

◆ LPFNCREATEINSTANCE

typedef HRESULT(CALLBACK * LPFNCREATEINSTANCE) (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppvObject)

Definition at line 22 of file precomp.h.

Function Documentation

◆ CBDADeviceControl_fnConstructor()

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

Definition at line 495 of file devicecontrol.cpp.

499{
500 HRESULT hr;
501 IKsObject *pObject = NULL;
502 IBaseFilter *pFilter = NULL;
504
505#ifdef BDAPLGIN_TRACE
506 OutputDebugStringW(L"CBDADeviceControl_fnConstructor\n");
507#endif
508
509 //DebugBreak();
510
511 // sanity check
512 assert(pUnkOuter);
513
514 // query for IKsObject
515 hr = pUnkOuter->QueryInterface(IID_IKsObject, (void**)&pObject);
516
517 if (FAILED(hr))
518 return E_NOINTERFACE;
519
520 // sanity check
521 assert(hr == NOERROR);
522
523 // query for IBaseFilter interface support
524 hr = pUnkOuter->QueryInterface(IID_IBaseFilter, (void**)&pFilter);
525
526 if (FAILED(hr))
527 {
528 // release
529 pObject->Release();
530 return E_NOINTERFACE;
531 }
532
533 // another sanity check
534 assert(pObject != NULL);
535
536 // get file handle
537 hFile = pObject->KsGetObjectHandle();
538
539 // one more sanity check
541
542 // release IKsObject interface
543 pObject->Release();
544
545 // release filter
546 pFilter->Release();
547
548 // construct device control
549 CBDADeviceControl * handler = new CBDADeviceControl(pUnkOuter, pFilter, hFile);
550
551 if (!handler)
552 return E_OUTOFMEMORY;
553
554 if (FAILED(handler->QueryInterface(riid, ppv)))
555 {
556 /* not supported */
557 delete handler;
558 return E_NOINTERFACE;
559 }
560
561 return NOERROR;
562}
virtual ULONG Release(__in_opt PVOID Tag=NULL, __in LONG Line=0, __in_opt PSTR File=NULL)
Definition: fxobject.hpp:853
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const GUID IID_IKsObject
const GUID IID_IBaseFilter
#define NULL
Definition: types.h:112
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
#define assert(x)
Definition: debug.h:53
FxObject * pObject
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
nsrefcnt Release()
#define FAILED(hr)
Definition: intsafe.h:51
_In_ HANDLE hFile
Definition: mswsock.h:90
#define L(x)
Definition: ntvdm.h:50
HRESULT hr
Definition: shlfolder.c:183
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354

◆ CBDADigitalDemodulator_fnConstructor()

HRESULT WINAPI CBDADigitalDemodulator_fnConstructor ( IKsPropertySet pProperty,
ULONG  NodeId,
REFIID  riid,
LPVOID ppv 
)

Definition at line 312 of file digitaldemo.cpp.

317{
318 // construct device control
320
321#ifdef BDAPLGIN_TRACE
322 OutputDebugStringW(L"CBDADigitalDemodulator_fnConstructor\n");
323#endif
324
325 if (!handler)
326 return E_OUTOFMEMORY;
327
328 if (FAILED(handler->QueryInterface(riid, ppv)))
329 {
330 /* not supported */
331 delete handler;
332 return E_NOINTERFACE;
333 }
334
335 return NOERROR;
336}
_Must_inspect_result_ _In_ KSP_BDA_NODE_PIN * pProperty
Definition: bdasup.h:156

Referenced by CControlNode::QueryInterface().

◆ CBDAFrequencyFilter_fnConstructor()

HRESULT WINAPI CBDAFrequencyFilter_fnConstructor ( IKsPropertySet pProperty,
ULONG  NodeId,
REFIID  riid,
LPVOID ppv 
)

Definition at line 260 of file frequencyfilter.cpp.

265{
266 // construct device control
268
269#ifdef BDAPLGIN_TRACE
270 OutputDebugStringW(L"CBDAFrequencyFilter_fnConstructor\n");
271#endif
272
273 if (!handler)
274 return E_OUTOFMEMORY;
275
276 if (FAILED(handler->QueryInterface(riid, ppv)))
277 {
278 /* not supported */
279 delete handler;
280 return E_NOINTERFACE;
281 }
282
283 return NOERROR;
284}

Referenced by CControlNode::QueryInterface().

◆ CBDALNBInfo_fnConstructor()

HRESULT WINAPI CBDALNBInfo_fnConstructor ( IKsPropertySet pProperty,
ULONG  NodeId,
REFIID  riid,
LPVOID ppv 
)

Definition at line 181 of file lnbinfo.cpp.

186{
187 // construct device control
188 CBDALNBInfo * handler = new CBDALNBInfo(pProperty, NodeId);
189
190#ifdef BDAPLGIN_TRACE
191 OutputDebugStringW(L"CBDALNBInfo_fnConstructor\n");
192#endif
193
194 if (!handler)
195 return E_OUTOFMEMORY;
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}

Referenced by CControlNode::QueryInterface().

◆ CBDAPinControl_fnConstructor()

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

Definition at line 236 of file pincontrol.cpp.

240{
241 IPin * pConnectedPin = NULL;
242 IBDA_NetworkProvider * pNetworkProvider = NULL;
244 HRESULT hr;
245 IKsObject * pObject = NULL;
246 IPin * pPin = NULL;
248 PIN_INFO PinInfo;
249 FILTER_INFO FilterInfo;
250 ULONG RegistrationCtx = 0;
251
252 if (!pUnkOuter)
253 return E_POINTER;
254
255 OutputDebugStringW(L"CBDAPinControl_fnConstructor\n");
256 //DebugBreak();
257
258 // query for IKsObject interface
259 hr = pUnkOuter->QueryInterface(IID_IKsObject, (void**)&pObject);
260
261 if (FAILED(hr))
262 return hr;
263
264 // query for IPin interface
265 hr = pObject->QueryInterface(IID_IPin, (void**)&pPin);
266
267 if (FAILED(hr))
268 {
269 //clean up
270 pObject->Release();
271 return hr;
272 }
273
274 // get pin info
275 hr = pPin->QueryPinInfo(&PinInfo);
276
277 if (FAILED(hr))
278 {
279 //clean up
280 pObject->Release();
281 pPin->Release();
282 return hr;
283 }
284
285 if (!PinInfo.pFilter)
286 {
287 //clean up
288 pObject->Release();
289 pPin->Release();
290 return hr;
291 }
292
293 // sanity checks
294 assert(PinInfo.pFilter != NULL);
295
296 // query filter info
297 hr = PinInfo.pFilter->QueryFilterInfo(&FilterInfo);
298
299 // sanity check
300 assert(FilterInfo.pGraph != NULL);
301
302 // get network provider interface
303 hr = GetNetworkProviderFromGraph(FilterInfo.pGraph, &pNetworkProvider);
304
305 if (SUCCEEDED(hr))
306 {
307 if (PinInfo.dir == PINDIR_OUTPUT)
308 {
309 // get connected pin handle
310 hr = pPin->ConnectedTo(&pConnectedPin);
311 if (SUCCEEDED(hr))
312 {
313 // get file handle
314 hFile = pObject->KsGetObjectHandle();
315 if (hFile)
316 {
317 hr = CBDAPinControl_RealConstructor(hFile, pNetworkProvider, pConnectedPin, 0, pUnkOuter, riid, ppv);
318 if (SUCCEEDED(hr))
319 {
320 // set to null to prevent releasing
321 pNetworkProvider = NULL;
322 pConnectedPin = NULL;
323 }
324 }
325 else
326 {
327 // expected file handle
329 }
330 }
331 }
332 else
333 {
334 // get IUnknown from base filter
335 hr = PinInfo.pFilter->QueryInterface(IID_IUnknown, (void**)&pUnknown);
336 if (SUCCEEDED(hr))
337 {
338 // register device filter
339 OutputDebugStringW(L"CBDAPinControl_fnConstructor registering device filter with network provider\n");
340 hr = pNetworkProvider->RegisterDeviceFilter(pUnknown, &RegistrationCtx);
341 if (SUCCEEDED(hr))
342 {
343 // get file handle
344 hFile = pObject->KsGetObjectHandle();
345 if (hFile)
346 {
347 hr = CBDAPinControl_RealConstructor(hFile, pNetworkProvider, NULL, RegistrationCtx, pUnkOuter, riid, ppv);
348 if (SUCCEEDED(hr))
349 {
350 // set to null to prevent releasing
351 pNetworkProvider = NULL;
352 }
353 }
354 else
355 {
356 // expected file handle
358 }
359 }
360 else
361 {
362 WCHAR Buffer[100];
363 swprintf(Buffer, L"CBDAPinControl_fnConstructor failed to register filter with %lx\n", hr);
365 }
366 }
367 }
368 }
369
370 // release IFilterGraph interface
371 FilterInfo.pGraph->Release();
372
373 // release IBaseFilter interface
374 PinInfo.pFilter->Release();
375
376 // release IPin
377 pPin->Release();
378
379 // release IKsObject
380 pObject->Release();
381
382
383 if (pNetworkProvider)
384 {
385 // release network provider
386 pNetworkProvider->Release();
387 }
388
389 if (pConnectedPin)
390 {
391 // release connected pin
392 pConnectedPin->Release();
393 }
394
395 if (pUnknown)
396 {
397 // release filter
398 pUnknown->Release();
399 }
400
401 return hr;
402}
@ PINDIR_OUTPUT
Definition: axcore.idl:42
const GUID IID_IUnknown
Definition: bufpool.h:45
virtual _Must_inspect_result_ NTSTATUS QueryInterface(__in FxQueryInterfaceParams *Params)
Definition: fxobject.cpp:255
#define swprintf
Definition: precomp.h:40
_In_ PUNKNOWN pUnknown
Definition: drmk.h:76
HRESULT RegisterDeviceFilter([in] IUnknown *pUnkFilterControl, [in, out] ULONG *ppvRegisitrationContext)
Definition: axcore.idl:92
ULONG Release()
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT GetNetworkProviderFromGraph(IFilterGraph *pGraph, IBDA_NetworkProvider **pOutNetworkProvider)
Definition: pincontrol.cpp:162
HRESULT CBDAPinControl_RealConstructor(HANDLE hPin, IBDA_NetworkProvider *pNetworkProvider, IPin *pConnectedPin, ULONG RegistrationCtx, IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
Definition: pincontrol.cpp:206
const GUID IID_IPin
Definition: pincontrol.cpp:15
uint32_t ULONG
Definition: typedefs.h:59
#define E_UNEXPECTED
Definition: winerror.h:2456
#define E_POINTER
Definition: winerror.h:2365
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ CBDASignalStatistics_fnConstructor()

HRESULT WINAPI CBDASignalStatistics_fnConstructor ( IKsPropertySet pProperty,
ULONG  NodeId,
REFIID  riid,
LPVOID ppv 
)

Definition at line 265 of file signalstatistics.cpp.

270{
271 // construct device control
273
274#ifdef BDAPLGIN_TRACE
275 OutputDebugStringW(L"CBDASignalStatistics_fnConstructor\n");
276#endif
277
278 if (!handler)
279 return E_OUTOFMEMORY;
280
281 if (FAILED(handler->QueryInterface(riid, ppv)))
282 {
283 /* not supported */
284 delete handler;
285 return E_NOINTERFACE;
286 }
287
288 return NOERROR;
289}

Referenced by CControlNode::QueryInterface().

◆ 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}
#define InterlockedIncrement
Definition: armddk.h:53
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
Definition: main.c:439

◆ CControlNode_fnConstructor()

HRESULT WINAPI CControlNode_fnConstructor ( IBaseFilter pFilter,
ULONG  NodeType,
ULONG  PinId,
REFIID  riid,
LPVOID ppv 
)

Definition at line 92 of file controlnode.cpp.

98{
99 WCHAR Buffer[100];
100 HRESULT hr;
101 IPin * pPin = NULL;
103
104 // store pin id
105 swprintf(Buffer, L"%u", PinId);
106
107 // try find target pin
108 hr = pFilter->FindPin(Buffer, &pPin);
109
110 if (FAILED(hr))
111 {
112#ifdef BDAPLGIN_TRACE
113 swprintf(Buffer, L"CControlNode_fnConstructor failed find pin %lu with %lx\n", PinId, hr);
115#endif
116 return hr;
117 }
118
119 // query for IKsPropertySet interface
121 if (FAILED(hr))
122 return hr;
123
124#ifdef BDAPLGIN_TRACE
125 swprintf(Buffer, L"CControlNode_fnConstructor get IID_IKsObject status %lx\n", hr);
127#endif
128
129 // release IPin interface
130 pPin->Release();
131
132 // construct device control
134
135#ifdef BDAPLGIN_TRACE
136 OutputDebugStringW(L"CControlNode_fnConstructor\n");
137#endif
138
139 if (!handler)
140 return E_OUTOFMEMORY;
141
142 if (FAILED(handler->QueryInterface(riid, ppv)))
143 {
144 /* not supported */
145 delete handler;
146 return E_NOINTERFACE;
147 }
148
149 return NOERROR;
150}
NodeType
Definition: Node.h:6
const GUID IID_IKsPropertySet
Definition: controlnode.cpp:13
HRESULT FindPin([in, string] LPCWSTR Id, [out] IPin **ppPin)

Referenced by CBDADeviceControl::GetControlNode().

Variable Documentation

◆ IID_IKsObject

const GUID IID_IKsObject
extern

Definition at line 12 of file devicecontrol.cpp.