mirror of
https://github.com/reactos/reactos.git
synced 2025-05-23 11:04:52 +00:00
[DXSDK]
- Add BDA Change Sync Method Set [BDAPLGIN] - Add "BDA Device Control Plug-in for MPEG2 based networks" stub svn path=/trunk/; revision=45677
This commit is contained in:
parent
07e5b173eb
commit
f4ef4493d0
10 changed files with 727 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
|||
<property name="BASEADDRESS_MSGSM32ACM" value="0x56db0000" />
|
||||
<property name="BASEADDRESS_MSG711ACM" value="0x584f0000" />
|
||||
<property name="BASEADDRESS_IMAADP32ACM" value="0x585e0000" />
|
||||
<property name="BASEADDRESS_BDAPLGIN" value="0x58600000" />
|
||||
<property name="BASEADDRESS_TELEPHON" value="0x58750000" />
|
||||
<property name="BASEADDRESS_PWRCFG" value="0x587e0000" />
|
||||
<property name="BASEADDRESS_MMSYS" value="0x588a0000" />
|
||||
|
|
106
reactos/dll/directx/bdaplgin/bdaplgin.cpp
Normal file
106
reactos/dll/directx/bdaplgin/bdaplgin.cpp
Normal file
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS BDA Proxy
|
||||
* FILE: dll/directx/bdaplgin/classfactory.cpp
|
||||
* PURPOSE: ClassFactory interface
|
||||
*
|
||||
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
const GUID CBDADeviceControl_GUID = {STATIC_KSMETHODSETID_BdaChangeSync};
|
||||
const GUID CBDAPinControl_GUID = {0x0DED49D5, 0xA8B7, 0x4d5d, {0x97, 0xA1, 0x12, 0xB0, 0xC1, 0x95, 0x87, 0x4D}};
|
||||
|
||||
|
||||
static INTERFACE_TABLE InterfaceTable[] =
|
||||
{
|
||||
{&CBDADeviceControl_GUID, CBDADeviceControl_fnConstructor},
|
||||
{&CBDAPinControl_GUID, CBDAPinControl_fnConstructor},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
extern "C"
|
||||
BOOL
|
||||
WINAPI
|
||||
DllMain(
|
||||
HINSTANCE hInstDLL,
|
||||
DWORD fdwReason,
|
||||
LPVOID lpvReserved)
|
||||
{
|
||||
switch (fdwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
OutputDebugStringW(L"BDAPLGIN::DllMain()\n");
|
||||
DisableThreadLibraryCalls(hInstDLL);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
extern "C"
|
||||
KSDDKAPI
|
||||
HRESULT
|
||||
WINAPI
|
||||
DllUnregisterServer(void)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
KSDDKAPI
|
||||
HRESULT
|
||||
WINAPI
|
||||
DllRegisterServer(void)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
KSDDKAPI
|
||||
HRESULT
|
||||
WINAPI
|
||||
DllGetClassObject(
|
||||
REFCLSID rclsid,
|
||||
REFIID riid,
|
||||
LPVOID *ppv)
|
||||
{
|
||||
UINT i;
|
||||
HRESULT hres = E_OUTOFMEMORY;
|
||||
IClassFactory * pcf = NULL;
|
||||
|
||||
if (!ppv)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
for (i = 0; InterfaceTable[i].riid; i++)
|
||||
{
|
||||
if (IsEqualIID(*InterfaceTable[i].riid, rclsid))
|
||||
{
|
||||
pcf = CClassFactory_fnConstructor(InterfaceTable[i].lpfnCI, NULL, NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pcf)
|
||||
{
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
}
|
||||
|
||||
hres = pcf->QueryInterface(riid, ppv);
|
||||
pcf->Release();
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
||||
KSDDKAPI
|
||||
HRESULT
|
||||
WINAPI
|
||||
DllCanUnloadNow(void)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
27
reactos/dll/directx/bdaplgin/bdaplgin.rbuild
Normal file
27
reactos/dll/directx/bdaplgin/bdaplgin.rbuild
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
|
||||
<group>
|
||||
<module name="bdaplgin" type="win32dll" baseaddress="${BASEADDRESS_BDAPLGIN}" installbase="system32" installname="bdaplgin.ax">
|
||||
<importlibrary definition="bdaplgin.spec" />
|
||||
<include base="bdaplgin">.</include>
|
||||
<library>ntdll</library>
|
||||
<library>kernel32</library>
|
||||
<library>advapi32</library>
|
||||
<library>ole32</library>
|
||||
<library>advapi32</library>
|
||||
<library>msvcrt</library>
|
||||
<group compilerset="gcc">
|
||||
<compilerflag compiler="cxx">-fno-exceptions</compilerflag>
|
||||
<compilerflag compiler="cxx">-fno-rtti</compilerflag>
|
||||
</group>
|
||||
<group compilerset="msc">
|
||||
<compilerflag compiler="cxx">/GR-</compilerflag>
|
||||
</group>
|
||||
|
||||
<file>bdaplgin.cpp</file>
|
||||
<file>bdaplgin.rc</file>
|
||||
<file>classfactory.cpp</file>
|
||||
<file>devicecontrol.cpp</file>
|
||||
<file>pincontrol.cpp</file>
|
||||
</module>
|
||||
</group>
|
4
reactos/dll/directx/bdaplgin/bdaplgin.spec
Normal file
4
reactos/dll/directx/bdaplgin/bdaplgin.spec
Normal file
|
@ -0,0 +1,4 @@
|
|||
@ stdcall DllCanUnloadNow()
|
||||
@ stdcall DllGetClassObject(ptr ptr ptr)
|
||||
@ stdcall DllRegisterServer()
|
||||
@ stdcall DllUnregisterServer()
|
106
reactos/dll/directx/bdaplgin/classfactory.cpp
Normal file
106
reactos/dll/directx/bdaplgin/classfactory.cpp
Normal file
|
@ -0,0 +1,106 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS BDA Proxy
|
||||
* FILE: dll/directx/bdaplgin/classfactory.cpp
|
||||
* PURPOSE: ClassFactory interface
|
||||
*
|
||||
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
|
||||
*/
|
||||
#include "precomp.h"
|
||||
|
||||
const GUID IID_IUnknown = {0x00000000, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}};
|
||||
const GUID IID_IClassFactory = {0x00000001, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}};
|
||||
|
||||
class CClassFactory : public IClassFactory
|
||||
{
|
||||
public:
|
||||
STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
|
||||
|
||||
STDMETHODIMP_(ULONG) AddRef()
|
||||
{
|
||||
InterlockedIncrement(&m_Ref);
|
||||
return m_Ref;
|
||||
}
|
||||
STDMETHODIMP_(ULONG) Release()
|
||||
{
|
||||
InterlockedDecrement(&m_Ref);
|
||||
|
||||
if (!m_Ref)
|
||||
{
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return m_Ref;
|
||||
}
|
||||
|
||||
HRESULT WINAPI CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject);
|
||||
HRESULT WINAPI LockServer(BOOL fLock);
|
||||
|
||||
CClassFactory(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, IID *riidInst) : m_Ref(1), m_lpfnCI(lpfnCI), m_IID(riidInst)
|
||||
{};
|
||||
|
||||
virtual ~CClassFactory(){};
|
||||
|
||||
protected:
|
||||
LONG m_Ref;
|
||||
LPFNCREATEINSTANCE m_lpfnCI;
|
||||
IID * m_IID;
|
||||
};
|
||||
|
||||
HRESULT
|
||||
WINAPI
|
||||
CClassFactory::QueryInterface(
|
||||
REFIID riid,
|
||||
LPVOID *ppvObj)
|
||||
{
|
||||
*ppvObj = NULL;
|
||||
if(IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IClassFactory))
|
||||
{
|
||||
*ppvObj = PVOID(this);
|
||||
InterlockedIncrement(&m_Ref);
|
||||
return S_OK;
|
||||
}
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
WINAPI
|
||||
CClassFactory::CreateInstance(
|
||||
LPUNKNOWN pUnkOuter,
|
||||
REFIID riid,
|
||||
LPVOID *ppvObject)
|
||||
{
|
||||
*ppvObject = NULL;
|
||||
|
||||
if ( m_IID == NULL || IsEqualCLSID(riid, *m_IID) || IsEqualCLSID(riid, IID_IUnknown))
|
||||
{
|
||||
return m_lpfnCI(pUnkOuter, riid, ppvObject);
|
||||
}
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
WINAPI
|
||||
CClassFactory::LockServer(
|
||||
BOOL fLock)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
IClassFactory *
|
||||
CClassFactory_fnConstructor(
|
||||
LPFNCREATEINSTANCE lpfnCI,
|
||||
PLONG pcRefDll,
|
||||
IID * riidInst)
|
||||
{
|
||||
CClassFactory* factory = new CClassFactory(lpfnCI, pcRefDll, riidInst);
|
||||
|
||||
if (!factory)
|
||||
return NULL;
|
||||
|
||||
if (pcRefDll)
|
||||
InterlockedIncrement(pcRefDll);
|
||||
|
||||
return (LPCLASSFACTORY)factory;
|
||||
}
|
255
reactos/dll/directx/bdaplgin/devicecontrol.cpp
Normal file
255
reactos/dll/directx/bdaplgin/devicecontrol.cpp
Normal file
|
@ -0,0 +1,255 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS BDA Proxy
|
||||
* FILE: dll/directx/bdaplgin/classfactory.cpp
|
||||
* PURPOSE: ClassFactory interface
|
||||
*
|
||||
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
const GUID IID_IBDA_DeviceControl = {0xFD0A5AF3, 0xB41D, 0x11d2, {0x9C, 0x95, 0x00, 0xC0, 0x4F, 0x79, 0x71, 0xE0}};
|
||||
const GUID IID_IBDA_Topology = {0x79B56888, 0x7FEA, 0x4690, {0xB4, 0x5D, 0x38, 0xFD, 0x3C, 0x78, 0x49, 0xBE}};
|
||||
|
||||
class CBDADeviceControl : public IBDA_DeviceControl,
|
||||
public IBDA_Topology
|
||||
{
|
||||
public:
|
||||
STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
|
||||
|
||||
STDMETHODIMP_(ULONG) AddRef()
|
||||
{
|
||||
InterlockedIncrement(&m_Ref);
|
||||
return m_Ref;
|
||||
}
|
||||
STDMETHODIMP_(ULONG) Release()
|
||||
{
|
||||
InterlockedDecrement(&m_Ref);
|
||||
|
||||
if (!m_Ref)
|
||||
{
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return m_Ref;
|
||||
}
|
||||
|
||||
// IBDA_DeviceControl methods
|
||||
HRESULT STDMETHODCALLTYPE StartChanges( void);
|
||||
HRESULT STDMETHODCALLTYPE CheckChanges( void);
|
||||
HRESULT STDMETHODCALLTYPE CommitChanges( void);
|
||||
HRESULT STDMETHODCALLTYPE GetChangeState(ULONG *pState);
|
||||
|
||||
// IBDA_Topology methods
|
||||
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(HANDLE hFile) : m_Ref(0), m_Handle(hFile){};
|
||||
virtual ~CBDADeviceControl(){};
|
||||
|
||||
protected:
|
||||
LONG m_Ref;
|
||||
HANDLE m_Handle;
|
||||
};
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::QueryInterface(
|
||||
IN REFIID refiid,
|
||||
OUT PVOID* Output)
|
||||
{
|
||||
WCHAR Buffer[MAX_PATH];
|
||||
LPOLESTR lpstr;
|
||||
|
||||
*Output = NULL;
|
||||
|
||||
if (IsEqualGUID(refiid, IID_IUnknown))
|
||||
{
|
||||
*Output = PVOID(this);
|
||||
reinterpret_cast<IUnknown*>(*Output)->AddRef();
|
||||
return NOERROR;
|
||||
}
|
||||
if (IsEqualGUID(refiid, IID_IBDA_DeviceControl))
|
||||
{
|
||||
*Output = (IBDA_DeviceControl*)(this);
|
||||
reinterpret_cast<IBDA_DeviceControl*>(*Output)->AddRef();
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
if (IsEqualGUID(refiid, IID_IBDA_Topology))
|
||||
{
|
||||
*Output = (IBDA_Topology*)(this);
|
||||
reinterpret_cast<IBDA_Topology*>(*Output)->AddRef();
|
||||
return NOERROR;
|
||||
}
|
||||
|
||||
StringFromCLSID(refiid, &lpstr);
|
||||
swprintf(Buffer, L"CBDADeviceControl::QueryInterface: NoInterface for %s", lpstr);
|
||||
OutputDebugStringW(Buffer);
|
||||
CoTaskMemFree(lpstr);
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// IBDA_DeviceControl methods
|
||||
//
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::StartChanges( void)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::StartChanges: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::CheckChanges( void)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::CheckChanges: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::CommitChanges( void)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::CommitChanges: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::GetChangeState(ULONG *pState)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::GetChangeState: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// IBDA_Topology methods
|
||||
//
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::GetNodeTypes(ULONG *pulcNodeTypes, ULONG ulcNodeTypesMax, ULONG * rgulNodeTypes)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::GetNodeTypes: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::GetNodeDescriptors(ULONG *ulcNodeDescriptors, ULONG ulcNodeDescriptorsMax, BDANODE_DESCRIPTOR * rgNodeDescriptors)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::GetNodeDescriptors: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::GetNodeInterfaces(ULONG ulNodeType, ULONG *pulcInterfaces, ULONG ulcInterfacesMax, GUID * rgguidInterfaces)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::GetNodeInterfaces: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::GetPinTypes(ULONG *pulcPinTypes, ULONG ulcPinTypesMax, ULONG *rgulPinTypes)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::GetPinTypes: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::GetTemplateConnections(ULONG *pulcConnections, ULONG ulcConnectionsMax, BDA_TEMPLATE_CONNECTION * rgConnections)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::GetTemplateConnections: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::CreatePin(ULONG ulPinType, ULONG *pulPinId)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::CreatePin: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::DeletePin(ULONG ulPinId)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::DeletePin: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::SetMediaType(ULONG ulPinId, AM_MEDIA_TYPE *pMediaType)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::SetMediaType: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::SetMedium(ULONG ulPinId, REGPINMEDIUM *pMedium)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::SetMedium: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::CreateTopology(ULONG ulInputPinId, ULONG ulOutputPinId){
|
||||
OutputDebugStringW(L"CBDADeviceControl::CreateTopology: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDADeviceControl::GetControlNode(ULONG ulInputPinId, ULONG ulOutputPinId, ULONG ulNodeType, IUnknown **ppControlNode)
|
||||
{
|
||||
OutputDebugStringW(L"CBDADeviceControl::GetControlNode: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
WINAPI
|
||||
CBDADeviceControl_fnConstructor(
|
||||
IUnknown * pUnkOuter,
|
||||
REFIID riid,
|
||||
LPVOID * ppv)
|
||||
{
|
||||
CBDADeviceControl * handler = new CBDADeviceControl(NULL);
|
||||
|
||||
OutputDebugStringW(L"CBDADeviceControl_fnConstructor\n");
|
||||
|
||||
if (!handler)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
if (FAILED(handler->QueryInterface(riid, ppv)))
|
||||
{
|
||||
/* not supported */
|
||||
delete handler;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
return NOERROR;
|
||||
}
|
120
reactos/dll/directx/bdaplgin/pincontrol.cpp
Normal file
120
reactos/dll/directx/bdaplgin/pincontrol.cpp
Normal file
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS BDA Proxy
|
||||
* FILE: dll/directx/bdaplgin/classfactory.cpp
|
||||
* PURPOSE: ClassFactory interface
|
||||
*
|
||||
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
|
||||
*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
const GUID IID_IBDA_PinControl = {0x0DED49D5, 0xA8B7, 0x4d5d, {0x97, 0xA1, 0x12, 0xB0, 0xC1, 0x95, 0x87, 0x4D}};
|
||||
|
||||
class CBDAPinControl : public IBDA_PinControl
|
||||
{
|
||||
public:
|
||||
STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
|
||||
|
||||
STDMETHODIMP_(ULONG) AddRef()
|
||||
{
|
||||
InterlockedIncrement(&m_Ref);
|
||||
return m_Ref;
|
||||
}
|
||||
STDMETHODIMP_(ULONG) Release()
|
||||
{
|
||||
InterlockedDecrement(&m_Ref);
|
||||
|
||||
if (!m_Ref)
|
||||
{
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return m_Ref;
|
||||
}
|
||||
// IBDA_PinControl methods
|
||||
HRESULT STDMETHODCALLTYPE GetPinID(ULONG *pulPinID);
|
||||
HRESULT STDMETHODCALLTYPE GetPinType(ULONG *pulPinType);
|
||||
HRESULT STDMETHODCALLTYPE RegistrationContext(ULONG *pulRegistrationCtx);
|
||||
|
||||
|
||||
CBDAPinControl(HANDLE hFile) : m_Ref(0), m_Handle(hFile){};
|
||||
virtual ~CBDAPinControl(){};
|
||||
|
||||
protected:
|
||||
LONG m_Ref;
|
||||
HANDLE m_Handle;
|
||||
|
||||
};
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDAPinControl::QueryInterface(
|
||||
IN REFIID refiid,
|
||||
OUT PVOID* Output)
|
||||
{
|
||||
if (IsEqualGUID(refiid, IID_IUnknown))
|
||||
{
|
||||
*Output = PVOID(this);
|
||||
reinterpret_cast<IUnknown*>(*Output)->AddRef();
|
||||
return NOERROR;
|
||||
}
|
||||
if (IsEqualGUID(refiid, IID_IBDA_PinControl))
|
||||
{
|
||||
*Output = (IBDA_PinControl*)(this);
|
||||
reinterpret_cast<IBDA_PinControl*>(*Output)->AddRef();
|
||||
return NOERROR;
|
||||
}
|
||||
OutputDebugStringW(L"CBDAPinControl::QueryInterface: NoInterface!!!\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
// IBDA_PinControl methods
|
||||
//
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDAPinControl::GetPinID(ULONG *pulPinID)
|
||||
{
|
||||
OutputDebugStringW(L"CBDAPinControl::GetPinID: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDAPinControl::GetPinType(ULONG *pulPinType)
|
||||
{
|
||||
OutputDebugStringW(L"CBDAPinControl::GetPinType: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
STDMETHODCALLTYPE
|
||||
CBDAPinControl::RegistrationContext(ULONG *pulRegistrationCtx)
|
||||
{
|
||||
OutputDebugStringW(L"CBDAPinControl::RegistrationContext: NotImplemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
HRESULT
|
||||
WINAPI
|
||||
CBDAPinControl_fnConstructor(
|
||||
IUnknown * pUnkOuter,
|
||||
REFIID riid,
|
||||
LPVOID * ppv)
|
||||
{
|
||||
CBDAPinControl * handler = new CBDAPinControl(NULL);
|
||||
|
||||
OutputDebugStringW(L"CBDAPinControl_fnConstructor");
|
||||
|
||||
if (!handler)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
if (FAILED(handler->QueryInterface(riid, ppv)))
|
||||
{
|
||||
/* not supported */
|
||||
delete handler;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
return NOERROR;
|
||||
}
|
51
reactos/dll/directx/bdaplgin/precomp.h
Normal file
51
reactos/dll/directx/bdaplgin/precomp.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
#ifndef PRECOMP_H__
|
||||
#define PRECOMP_H__
|
||||
|
||||
#define BUILDING_KS
|
||||
#define _KSDDK_
|
||||
#include <dshow.h>
|
||||
//#include <streams.h>
|
||||
#include <ks.h>
|
||||
#define __STREAMS__
|
||||
#include <ksproxy.h>
|
||||
#include <stdio.h>
|
||||
#include <wchar.h>
|
||||
#include <tchar.h>
|
||||
#include <uuids.h>
|
||||
#include <bdaiface.h>
|
||||
#include <bdamedia.h>
|
||||
|
||||
typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const GUID* riid;
|
||||
LPFNCREATEINSTANCE lpfnCI;
|
||||
} INTERFACE_TABLE;
|
||||
|
||||
/* classfactory.cpp */
|
||||
IClassFactory *
|
||||
CClassFactory_fnConstructor(
|
||||
LPFNCREATEINSTANCE lpfnCI,
|
||||
PLONG pcRefDll,
|
||||
IID * riidInst);
|
||||
|
||||
/* devicecontrol.cpp */
|
||||
HRESULT
|
||||
WINAPI
|
||||
CBDADeviceControl_fnConstructor(
|
||||
IUnknown * pUnkOuter,
|
||||
REFIID riid,
|
||||
LPVOID * ppv);
|
||||
|
||||
|
||||
/* pincontrol.cpp */
|
||||
HRESULT
|
||||
WINAPI
|
||||
CBDAPinControl_fnConstructor(
|
||||
IUnknown * pUnkOuter,
|
||||
REFIID riid,
|
||||
LPVOID * ppv);
|
||||
|
||||
|
||||
#endif
|
|
@ -4,6 +4,9 @@
|
|||
<directory name="amstream">
|
||||
<xi:include href="amstream/amstream.rbuild" />
|
||||
</directory>
|
||||
<directory name="bdaplgin">
|
||||
<xi:include href="bdaplgin/bdaplgin.rbuild" />
|
||||
</directory>
|
||||
<directory name="d3d8thk">
|
||||
<xi:include href="d3d8thk/d3d8thk.rbuild" />
|
||||
</directory>
|
||||
|
|
|
@ -201,4 +201,58 @@ typedef enum {
|
|||
NULL, 0, NULL, NULL, 0)
|
||||
|
||||
|
||||
/* ------------------------------------------------------------
|
||||
BDA Change Sync Method Set {FD0A5AF3-B41D-11d2-9C95-00C04F7971E0}
|
||||
*/
|
||||
|
||||
#define STATIC_KSMETHODSETID_BdaChangeSync \
|
||||
0xfd0a5af3, 0xb41d, 0x11d2, {0x9c, 0x95, 0x0, 0xc0, 0x4f, 0x79, 0x71, 0xe0}
|
||||
DEFINE_GUIDSTRUCT("FD0A5AF3-B41D-11d2-9C95-00C04F7971E0", KSMETHODSETID_BdaChangeSync);
|
||||
#define KSMETHODSETID_BdaChangeSync DEFINE_GUIDNAMED(KSMETHODSETID_BdaChangeSync)
|
||||
|
||||
typedef enum {
|
||||
KSMETHOD_BDA_START_CHANGES = 0,
|
||||
KSMETHOD_BDA_CHECK_CHANGES,
|
||||
KSMETHOD_BDA_COMMIT_CHANGES,
|
||||
KSMETHOD_BDA_GET_CHANGE_STATE
|
||||
} KSMETHOD_BDA_CHANGE_SYNC;
|
||||
|
||||
#define DEFINE_KSMETHOD_ITEM_BDA_START_CHANGES(MethodHandler, SupportHandler)\
|
||||
DEFINE_KSMETHOD_ITEM(\
|
||||
KSMETHOD_BDA_START_CHANGES,\
|
||||
KSMETHOD_TYPE_NONE,\
|
||||
(MethodHandler),\
|
||||
sizeof(KSMETHOD),\
|
||||
0,\
|
||||
SupportHandler)
|
||||
|
||||
#define DEFINE_KSMETHOD_ITEM_BDA_CHECK_CHANGES(MethodHandler, SupportHandler)\
|
||||
DEFINE_KSMETHOD_ITEM(\
|
||||
KSMETHOD_BDA_CHECK_CHANGES,\
|
||||
KSMETHOD_TYPE_NONE,\
|
||||
(MethodHandler),\
|
||||
sizeof(KSMETHOD),\
|
||||
0,\
|
||||
SupportHandler)
|
||||
|
||||
#define DEFINE_KSMETHOD_ITEM_BDA_COMMIT_CHANGES(MethodHandler, SupportHandler)\
|
||||
DEFINE_KSMETHOD_ITEM(\
|
||||
KSMETHOD_BDA_COMMIT_CHANGES,\
|
||||
KSMETHOD_TYPE_NONE,\
|
||||
(MethodHandler),\
|
||||
sizeof(KSMETHOD),\
|
||||
0,\
|
||||
SupportHandler)
|
||||
|
||||
#define DEFINE_KSMETHOD_ITEM_BDA_GET_CHANGE_STATE(MethodHandler, SupportHandler)\
|
||||
DEFINE_KSMETHOD_ITEM(\
|
||||
KSMETHOD_BDA_GET_CHANGE_STATE,\
|
||||
KSMETHOD_TYPE_READ,\
|
||||
(MethodHandler),\
|
||||
sizeof(KSMETHOD),\
|
||||
0,\
|
||||
SupportHandler)
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue