2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS BDA Proxy
4 * FILE: dll/directx/bdaplgin/classfactory.cpp
5 * PURPOSE: ClassFactory interface
7 * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
12 const GUID IID_IBDA_DeviceControl
= {0xFD0A5AF3, 0xB41D, 0x11d2, {0x9C, 0x95, 0x00, 0xC0, 0x4F, 0x79, 0x71, 0xE0}};
13 const GUID IID_IBDA_Topology
= {0x79B56888, 0x7FEA, 0x4690, {0xB4, 0x5D, 0x38, 0xFD, 0x3C, 0x78, 0x49, 0xBE}};
15 class CBDADeviceControl
: public IBDA_DeviceControl
,
19 STDMETHODIMP
QueryInterface( REFIID InterfaceId
, PVOID
* Interface
);
21 STDMETHODIMP_(ULONG
) AddRef()
23 InterlockedIncrement(&m_Ref
);
26 STDMETHODIMP_(ULONG
) Release()
28 InterlockedDecrement(&m_Ref
);
38 // IBDA_DeviceControl methods
39 HRESULT STDMETHODCALLTYPE
StartChanges( void);
40 HRESULT STDMETHODCALLTYPE
CheckChanges( void);
41 HRESULT STDMETHODCALLTYPE
CommitChanges( void);
42 HRESULT STDMETHODCALLTYPE
GetChangeState(ULONG
*pState
);
44 // IBDA_Topology methods
45 HRESULT STDMETHODCALLTYPE
GetNodeTypes(ULONG
*pulcNodeTypes
, ULONG ulcNodeTypesMax
, ULONG
* rgulNodeTypes
);
46 HRESULT STDMETHODCALLTYPE
GetNodeDescriptors(ULONG
*ulcNodeDescriptors
, ULONG ulcNodeDescriptorsMax
, BDANODE_DESCRIPTOR
* rgNodeDescriptors
);
47 HRESULT STDMETHODCALLTYPE
GetNodeInterfaces(ULONG ulNodeType
, ULONG
*pulcInterfaces
, ULONG ulcInterfacesMax
, GUID
* rgguidInterfaces
);
48 HRESULT STDMETHODCALLTYPE
GetPinTypes(ULONG
*pulcPinTypes
, ULONG ulcPinTypesMax
, ULONG
*rgulPinTypes
);
49 HRESULT STDMETHODCALLTYPE
GetTemplateConnections(ULONG
*pulcConnections
, ULONG ulcConnectionsMax
, BDA_TEMPLATE_CONNECTION
* rgConnections
);
50 HRESULT STDMETHODCALLTYPE
CreatePin(ULONG ulPinType
, ULONG
*pulPinId
);
51 HRESULT STDMETHODCALLTYPE
DeletePin(ULONG ulPinId
);
52 HRESULT STDMETHODCALLTYPE
SetMediaType(ULONG ulPinId
, AM_MEDIA_TYPE
*pMediaType
);
53 HRESULT STDMETHODCALLTYPE
SetMedium(ULONG ulPinId
, REGPINMEDIUM
*pMedium
);
54 HRESULT STDMETHODCALLTYPE
CreateTopology(ULONG ulInputPinId
, ULONG ulOutputPinId
);
55 HRESULT STDMETHODCALLTYPE
GetControlNode(ULONG ulInputPinId
, ULONG ulOutputPinId
, ULONG ulNodeType
, IUnknown
**ppControlNode
);
57 CBDADeviceControl(HANDLE hFile
) : m_Ref(0), m_Handle(hFile
){};
58 virtual ~CBDADeviceControl(){};
67 CBDADeviceControl::QueryInterface(
71 WCHAR Buffer
[MAX_PATH
];
76 if (IsEqualGUID(refiid
, IID_IUnknown
))
78 *Output
= PVOID(this);
79 reinterpret_cast<IUnknown
*>(*Output
)->AddRef();
82 if (IsEqualGUID(refiid
, IID_IBDA_DeviceControl
))
84 *Output
= (IBDA_DeviceControl
*)(this);
85 reinterpret_cast<IBDA_DeviceControl
*>(*Output
)->AddRef();
89 if (IsEqualGUID(refiid
, IID_IBDA_Topology
))
91 *Output
= (IBDA_Topology
*)(this);
92 reinterpret_cast<IBDA_Topology
*>(*Output
)->AddRef();
96 StringFromCLSID(refiid
, &lpstr
);
97 swprintf(Buffer
, L
"CBDADeviceControl::QueryInterface: NoInterface for %s", lpstr
);
98 OutputDebugStringW(Buffer
);
101 return E_NOINTERFACE
;
105 //-------------------------------------------------------------------
106 // IBDA_DeviceControl methods
110 CBDADeviceControl::StartChanges( void)
112 OutputDebugStringW(L
"CBDADeviceControl::StartChanges: NotImplemented\n");
119 CBDADeviceControl::CheckChanges( void)
121 OutputDebugStringW(L
"CBDADeviceControl::CheckChanges: NotImplemented\n");
128 CBDADeviceControl::CommitChanges( void)
130 OutputDebugStringW(L
"CBDADeviceControl::CommitChanges: NotImplemented\n");
136 CBDADeviceControl::GetChangeState(ULONG
*pState
)
138 OutputDebugStringW(L
"CBDADeviceControl::GetChangeState: NotImplemented\n");
142 //-------------------------------------------------------------------
143 // IBDA_Topology methods
147 CBDADeviceControl::GetNodeTypes(ULONG
*pulcNodeTypes
, ULONG ulcNodeTypesMax
, ULONG
* rgulNodeTypes
)
149 OutputDebugStringW(L
"CBDADeviceControl::GetNodeTypes: NotImplemented\n");
155 CBDADeviceControl::GetNodeDescriptors(ULONG
*ulcNodeDescriptors
, ULONG ulcNodeDescriptorsMax
, BDANODE_DESCRIPTOR
* rgNodeDescriptors
)
157 OutputDebugStringW(L
"CBDADeviceControl::GetNodeDescriptors: NotImplemented\n");
163 CBDADeviceControl::GetNodeInterfaces(ULONG ulNodeType
, ULONG
*pulcInterfaces
, ULONG ulcInterfacesMax
, GUID
* rgguidInterfaces
)
165 OutputDebugStringW(L
"CBDADeviceControl::GetNodeInterfaces: NotImplemented\n");
171 CBDADeviceControl::GetPinTypes(ULONG
*pulcPinTypes
, ULONG ulcPinTypesMax
, ULONG
*rgulPinTypes
)
173 OutputDebugStringW(L
"CBDADeviceControl::GetPinTypes: NotImplemented\n");
179 CBDADeviceControl::GetTemplateConnections(ULONG
*pulcConnections
, ULONG ulcConnectionsMax
, BDA_TEMPLATE_CONNECTION
* rgConnections
)
181 OutputDebugStringW(L
"CBDADeviceControl::GetTemplateConnections: NotImplemented\n");
187 CBDADeviceControl::CreatePin(ULONG ulPinType
, ULONG
*pulPinId
)
189 OutputDebugStringW(L
"CBDADeviceControl::CreatePin: NotImplemented\n");
195 CBDADeviceControl::DeletePin(ULONG ulPinId
)
197 OutputDebugStringW(L
"CBDADeviceControl::DeletePin: NotImplemented\n");
203 CBDADeviceControl::SetMediaType(ULONG ulPinId
, AM_MEDIA_TYPE
*pMediaType
)
205 OutputDebugStringW(L
"CBDADeviceControl::SetMediaType: NotImplemented\n");
211 CBDADeviceControl::SetMedium(ULONG ulPinId
, REGPINMEDIUM
*pMedium
)
213 OutputDebugStringW(L
"CBDADeviceControl::SetMedium: NotImplemented\n");
219 CBDADeviceControl::CreateTopology(ULONG ulInputPinId
, ULONG ulOutputPinId
){
220 OutputDebugStringW(L
"CBDADeviceControl::CreateTopology: NotImplemented\n");
227 CBDADeviceControl::GetControlNode(ULONG ulInputPinId
, ULONG ulOutputPinId
, ULONG ulNodeType
, IUnknown
**ppControlNode
)
229 OutputDebugStringW(L
"CBDADeviceControl::GetControlNode: NotImplemented\n");
235 CBDADeviceControl_fnConstructor(
236 IUnknown
* pUnkOuter
,
240 CBDADeviceControl
* handler
= new CBDADeviceControl(NULL
);
242 OutputDebugStringW(L
"CBDADeviceControl_fnConstructor\n");
245 return E_OUTOFMEMORY
;
247 if (FAILED(handler
->QueryInterface(riid
, ppv
)))
251 return E_NOINTERFACE
;