[BDAPLGIN]

- Implement IBDA_PinControl::GetPinID, IBDA_PinControl::GetPinType
- Comment out enumeration of IBDA_NetworkProvider
[MSDVBNP]
- Start implementing Network Provider for MPEG-2 based Networks
[MSVIDCTL]
- Start implementing ActiveX Control for Streaming Video

svn path=/trunk/; revision=45746
This commit is contained in:
Johannes Anderwald 2010-03-01 15:28:28 +00:00
parent 3970017d64
commit 04fdf4b562
21 changed files with 2435 additions and 10 deletions

View file

@ -469,7 +469,7 @@ CBDADeviceControl::GetControlNode(ULONG ulInputPinId, ULONG ulOutputPinId, ULONG
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx, BytesReturned %lu PinId %lu Dummy %lu\n", hr, BytesReturned, PinId, Dummy);
swprintf(Buffer, L"CBDADeviceControl::GetControlNode: hr %lx, BytesReturned %lu PinId %lu\n", hr, BytesReturned, PinId);
OutputDebugStringW(Buffer);
#endif

View file

@ -9,7 +9,8 @@
#include "precomp.h"
const GUID IID_IBDA_PinControl = {0x0DED49D5, 0xA8B7, 0x4d5d, {0x97, 0xA1, 0x12, 0xB0, 0xC1, 0x95, 0x87, 0x4D}};
const GUID IID_IBDA_PinControl = {0x0DED49D5, 0xA8B7, 0x4d5d, {0x97, 0xA1, 0x12, 0xB0, 0xC1, 0x95, 0x87, 0x4D}};
const GUID KSPROPSETID_BdaPinControl = {0x0ded49d5, 0xa8b7, 0x4d5d, {0x97, 0xa1, 0x12, 0xb0, 0xc1, 0x95, 0x87, 0x4d}};
const GUID IID_IPin = {0x56a86891, 0x0ad4, 0x11ce, {0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
class CBDAPinControl : public IBDA_PinControl
@ -39,7 +40,11 @@ public:
CBDAPinControl(HANDLE hFile, IBDA_NetworkProvider * pProvider, IPin * pConnectedPin) : m_Ref(0), m_Handle(hFile), m_pProvider(pProvider), m_pConnectedPin(pConnectedPin){};
virtual ~CBDAPinControl(){};
virtual ~CBDAPinControl()
{
//m_pConnectedPin->Release();
//m_pProvider->Release();
};
protected:
LONG m_Ref;
@ -67,6 +72,16 @@ CBDAPinControl::QueryInterface(
return NOERROR;
}
#ifdef BDAPLGIN_TRACE
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CBDAPinControl::QueryInterface: NoInterface for %s", lpstr);
DebugBreak();
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
#endif
return E_NOINTERFACE;
}
//-------------------------------------------------------------------
@ -76,22 +91,50 @@ HRESULT
STDMETHODCALLTYPE
CBDAPinControl::GetPinID(ULONG *pulPinID)
{
KSPROPERTY Property;
ULONG BytesReturned;
HRESULT hr;
// setup request
Property.Set = KSPROPSETID_BdaPinControl;
Property.Id = KSPROPERTY_BDA_PIN_ID;
Property.Flags = KSPROPERTY_TYPE_GET;
// perform request
hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSPROPERTY), pulPinID, sizeof(ULONG), &BytesReturned);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDAPinControl::GetPinID: NotImplemented\n");
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAPinControl::GetPinID: hr %lx pulPinID %lu BytesReturned %lx\n", hr, *pulPinID, BytesReturned);
OutputDebugStringW(Buffer);
#endif
return E_NOTIMPL;
return hr;
}
HRESULT
STDMETHODCALLTYPE
CBDAPinControl::GetPinType(ULONG *pulPinType)
{
KSPROPERTY Property;
ULONG BytesReturned;
HRESULT hr;
// setup request
Property.Set = KSPROPSETID_BdaPinControl;
Property.Id = KSPROPERTY_BDA_PIN_TYPE;
Property.Flags = KSPROPERTY_TYPE_GET;
// perform request
hr = KsSynchronousDeviceControl(m_Handle, IOCTL_KS_PROPERTY, (PVOID)&Property, sizeof(KSPROPERTY), pulPinType, sizeof(ULONG), &BytesReturned);
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDAPinControl::GetPinType: NotImplemented\n");
WCHAR Buffer[100];
swprintf(Buffer, L"CBDAPinControl::GetPinType: hr %lx pulPinType %lu BytesReturned %lx\n", hr, *pulPinType, BytesReturned);
OutputDebugStringW(Buffer);
#endif
return E_NOTIMPL;
return hr;
}
HRESULT
@ -112,15 +155,29 @@ CBDAPinControl_fnConstructor(
REFIID riid,
LPVOID * ppv)
{
IPin * pConnectedPin = NULL;
IBDA_NetworkProvider * pNetworkProvider = NULL;
HANDLE hFile = INVALID_HANDLE_VALUE;
#if 0
if (!IsEqualGUID(riid, IID_IUnknown))
{
#ifdef BDAPLGIN_TRACE
OutputDebugStringW(L"CBDAPinControl_fnConstructor: Expected IUnknown\n");
#endif
return REGDB_E_CLASSNOTREG;
}
HRESULT hr;
IKsObject * pObject = NULL;
IPin * pPin = NULL, * pConnectedPin = NULL;
IPin * pPin = NULL;
IEnumFilters *pEnumFilters = NULL;
IBDA_NetworkProvider * pNetworkProvider = NULL;
IBaseFilter * ppFilter[1];
PIN_INFO PinInfo;
FILTER_INFO FilterInfo;
HANDLE hFile = INVALID_HANDLE_VALUE;
if (!pUnkOuter)
return E_POINTER;
@ -225,6 +282,7 @@ CBDAPinControl_fnConstructor(
// no network provider interface in graph
return E_NOINTERFACE;
}
#endif
CBDAPinControl * handler = new CBDAPinControl(hFile, pNetworkProvider, pConnectedPin);

View file

@ -1,6 +1,7 @@
#ifndef PRECOMP_H__
#define PRECOMP_H__
#define BDAPLGIN_TRACE
#define BUILDING_KS
#define _KSDDK_
#include <dshow.h>

View file

@ -0,0 +1,105 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS BDA Proxy
* FILE: dll/directx/msdvbnp/classfactory.cpp
* PURPOSE: IClassFactory 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;
}

View file

@ -0,0 +1,108 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Network Provider for MPEG2 based networks
* FILE: dll/directx/msdvbnp/msdvbnp.cpp
* PURPOSE: COM Initialization
*
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
*/
#include "precomp.h"
const GUID CLSID_DVBTNetworkProvider = {0x216c62df, 0x6d7f, 0x4e9a, {0x85, 0x71, 0x5, 0xf1, 0x4e, 0xdb, 0x76, 0x6a}};
static INTERFACE_TABLE InterfaceTable[] =
{
{&CLSID_DVBTNetworkProvider, CNetworkProvider_fnConstructor},
{NULL, NULL}
};
extern "C"
BOOL
WINAPI
DllMain(
HINSTANCE hInstDLL,
DWORD fdwReason,
LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
CoInitialize(NULL);
#ifdef MSDVBNP_TRACE
OutputDebugStringW(L"MSDVBNP::DllMain()\n");
#endif
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;
}

View file

@ -0,0 +1,28 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<group>
<module name="msdvbnp" type="win32dll" baseaddress="${BASEADDRESS_MSDVBNP}" installbase="system32" installname="msdvbnp.ax">
<importlibrary definition="msdvbnp.spec" />
<include base="msdvbnp">.</include>
<library>ntdll</library>
<library>kernel32</library>
<library>advapi32</library>
<library>ole32</library>
<library>advapi32</library>
<library>msvcrt</library>
<library>strmiids</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>classfactory.cpp</file>
<file>msdvbnp.cpp</file>
<file>msdvbnp.rc</file>
<file>networkprovider.cpp</file>
<file>scanningtuner.cpp</file>
</module>
</group>

View file

@ -0,0 +1,12 @@
#include <windows.h>
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Network Provider for MPEG2 based networks\0"
#define REACTOS_STR_INTERNAL_NAME "MSDvBNP.ax\0"
#define REACTOS_STR_ORIGINAL_FILENAME "MSDvBNP.ax\0"
#define REACTOS_STR_PRODUCT_VERSION "6.5.2600.3264\0"
#define REACTOS_STR_FILE_VERSION "6.5.2600.3264\0"
#include <reactos/version.rc>

View file

@ -0,0 +1,4 @@
@ stdcall DllCanUnloadNow()
@ stdcall DllGetClassObject(ptr ptr ptr)
@ stdcall DllRegisterServer()
@ stdcall DllUnregisterServer()

View file

@ -0,0 +1,350 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Network Provider for MPEG2 based networks
* FILE: dll/directx/msdvbnp/networkprovider.cpp
* PURPOSE: IBDA_NetworkProvider interface
*
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
*/
#include "precomp.h"
class CNetworkProvider : public IBaseFilter,
public IAMovieSetup,
public IBDA_NetworkProvider
{
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;
}
// IBaseFilter methods
HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
HRESULT STDMETHODCALLTYPE Stop( void);
HRESULT STDMETHODCALLTYPE Pause( void);
HRESULT STDMETHODCALLTYPE Run(REFERENCE_TIME tStart);
HRESULT STDMETHODCALLTYPE GetState(DWORD dwMilliSecsTimeout, FILTER_STATE *State);
HRESULT STDMETHODCALLTYPE SetSyncSource(IReferenceClock *pClock);
HRESULT STDMETHODCALLTYPE GetSyncSource(IReferenceClock **pClock);
HRESULT STDMETHODCALLTYPE EnumPins(IEnumPins **ppEnum);
HRESULT STDMETHODCALLTYPE FindPin(LPCWSTR Id, IPin **ppPin);
HRESULT STDMETHODCALLTYPE QueryFilterInfo(FILTER_INFO *pInfo);
HRESULT STDMETHODCALLTYPE JoinFilterGraph(IFilterGraph *pGraph, LPCWSTR pName);
HRESULT STDMETHODCALLTYPE QueryVendorInfo(LPWSTR *pVendorInfo);
//IAMovieSetup methods
HRESULT STDMETHODCALLTYPE Register( void);
HRESULT STDMETHODCALLTYPE Unregister( void);
//IBDA_NetworkProvider methods
HRESULT STDMETHODCALLTYPE PutSignalSource(ULONG ulSignalSource);
HRESULT STDMETHODCALLTYPE GetSignalSource(ULONG *pulSignalSource);
HRESULT STDMETHODCALLTYPE GetNetworkType(GUID *pguidNetworkType);
HRESULT STDMETHODCALLTYPE PutTuningSpace(REFGUID guidTuningSpace);
HRESULT STDMETHODCALLTYPE GetTuningSpace(GUID *pguidTuingSpace);
HRESULT STDMETHODCALLTYPE RegisterDeviceFilter(IUnknown *pUnkFilterControl, ULONG *ppvRegisitrationContext);
HRESULT STDMETHODCALLTYPE UnRegisterDeviceFilter(ULONG pvRegistrationContext);
CNetworkProvider() : m_Ref(0), m_pGraph(0){};
virtual ~CNetworkProvider(){};
protected:
LONG m_Ref;
IFilterGraph *m_pGraph;
};
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::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_IBaseFilter))
{
*Output = (IBaseFilter*)(this);
reinterpret_cast<IBaseFilter*>(*Output)->AddRef();
return NOERROR;
}
if (IsEqualGUID(refiid, IID_ITuner) ||
IsEqualGUID(refiid, IID_IScanningTuner))
{
// construct scanning tuner
return CScanningTunner_fnConstructor(NULL, refiid, Output);
}
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CNetworkProvider::QueryInterface: NoInterface for %s", lpstr);
DebugBreak();
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
return E_NOINTERFACE;
}
//-------------------------------------------------------------------
// IBaseFilter interface
//
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::GetClassID(
CLSID *pClassID)
{
OutputDebugStringW(L"CNetworkProvider::GetClassID : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::Stop()
{
OutputDebugStringW(L"CNetworkProvider::Stop : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::Pause()
{
OutputDebugStringW(L"CNetworkProvider::Pause : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::Run(
REFERENCE_TIME tStart)
{
OutputDebugStringW(L"CNetworkProvider::Run : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::GetState(
DWORD dwMilliSecsTimeout,
FILTER_STATE *State)
{
OutputDebugStringW(L"CNetworkProvider::GetState : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::SetSyncSource(
IReferenceClock *pClock)
{
OutputDebugStringW(L"CNetworkProvider::SetSyncSource : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::GetSyncSource(
IReferenceClock **pClock)
{
OutputDebugStringW(L"CNetworkProvider::GetSyncSource : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::EnumPins(
IEnumPins **ppEnum)
{
OutputDebugStringW(L"CNetworkProvider::EnumPins : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::FindPin(
LPCWSTR Id, IPin **ppPin)
{
OutputDebugStringW(L"CNetworkProvider::FindPin : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::QueryFilterInfo(
FILTER_INFO *pInfo)
{
OutputDebugStringW(L"CNetworkProvider::QueryFilterInfo : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::JoinFilterGraph(
IFilterGraph *pGraph,
LPCWSTR pName)
{
if (pGraph)
{
// joining filter graph
m_pGraph = pGraph;
}
else
{
// leaving graph
m_pGraph = 0;
}
OutputDebugStringW(L"CNetworkProvider::JoinFilterGraph\n");
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::QueryVendorInfo(
LPWSTR *pVendorInfo)
{
OutputDebugStringW(L"CNetworkProvider::QueryVendorInfo : NotImplemented\n");
return E_NOTIMPL;
}
//-------------------------------------------------------------------
// IAMovieSetup interface
//
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::Register()
{
OutputDebugStringW(L"CNetworkProvider::Register : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::Unregister()
{
OutputDebugStringW(L"CNetworkProvider::Unregister : NotImplemented\n");
return E_NOTIMPL;
}
//-------------------------------------------------------------------
// IBDA_NetworkProvider interface
//
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::PutSignalSource(
ULONG ulSignalSource)
{
OutputDebugStringW(L"CNetworkProvider::PutSignalSource : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::GetSignalSource(
ULONG *pulSignalSource)
{
OutputDebugStringW(L"CNetworkProvider::GetSignalSource : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::GetNetworkType(
GUID *pguidNetworkType)
{
OutputDebugStringW(L"CNetworkProvider::GetNetworkType : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::PutTuningSpace(
REFGUID guidTuningSpace)
{
OutputDebugStringW(L"CNetworkProvider::PutTuningSpace : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::GetTuningSpace(
GUID *pguidTuingSpace)
{
OutputDebugStringW(L"CNetworkProvider::GetTuningSpace : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::RegisterDeviceFilter(
IUnknown *pUnkFilterControl,
ULONG *ppvRegisitrationContext)
{
OutputDebugStringW(L"CNetworkProvider::RegisterDeviceFilter : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CNetworkProvider::UnRegisterDeviceFilter(ULONG pvRegistrationContext)
{
OutputDebugStringW(L"CNetworkProvider::UnRegisterDeviceFilter : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
WINAPI
CNetworkProvider_fnConstructor(
IUnknown *pUnknown,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CNetworkProvider * handler = new CNetworkProvider();
#ifdef MSDVBNP_TRACE
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(riid, &lpstr);
swprintf(Buffer, L"CNetworkProvider_fnConstructor riid %s pUnknown %p", lpstr, pUnknown);
OutputDebugStringW(Buffer);
#endif
if (!handler)
return E_OUTOFMEMORY;
if (FAILED(handler->QueryInterface(riid, ppv)))
{
/* not supported */
delete handler;
return E_NOINTERFACE;
}
OutputDebugStringW(L"CNetworkProvider_fnConstructor Success");
return NOERROR;
}

View file

@ -0,0 +1,54 @@
#ifndef PRECOMP_H__
#define PRECOMP_H__
#define MSDVBNP_TRACE
#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 <bdatypes.h>
#include <bdaiface.h>
#include <bdamedia.h>
#include <tuner.h>
#include <assert.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);
/* networkprovider.cpp */
HRESULT
WINAPI
CNetworkProvider_fnConstructor(
IUnknown *pUnknown,
REFIID riid,
LPVOID * ppv);
/* scanningtunner.cpp */
HRESULT
WINAPI
CScanningTunner_fnConstructor(
IUnknown *pUnknown,
REFIID riid,
LPVOID * ppv);
#endif

View file

@ -0,0 +1,265 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS Network Provider for MPEG2 based networks
* FILE: dll/directx/msdvbnp/networkprovider.cpp
* PURPOSE: IScanningTunner interface
*
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
*/
#include "precomp.h"
class CScanningTunner : public IScanningTuner
{
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;
}
//ITuner methods
HRESULT STDMETHODCALLTYPE get_TuningSpace(ITuningSpace **TuningSpace);
HRESULT STDMETHODCALLTYPE put_TuningSpace(ITuningSpace *TuningSpace);
HRESULT STDMETHODCALLTYPE EnumTuningSpaces(IEnumTuningSpaces **ppEnum);
HRESULT STDMETHODCALLTYPE get_TuneRequest(ITuneRequest **TuneRequest);
HRESULT STDMETHODCALLTYPE put_TuneRequest(ITuneRequest *TuneRequest);
HRESULT STDMETHODCALLTYPE Validate(ITuneRequest *TuneRequest);
HRESULT STDMETHODCALLTYPE get_PreferredComponentTypes(IComponentTypes **ComponentTypes);
HRESULT STDMETHODCALLTYPE put_PreferredComponentTypes(IComponentTypes *ComponentTypes);
HRESULT STDMETHODCALLTYPE get_SignalStrength(long *Strength);
HRESULT STDMETHODCALLTYPE TriggerSignalEvents(long Interval);
//IScanningTuner methods
HRESULT STDMETHODCALLTYPE SeekUp();
HRESULT STDMETHODCALLTYPE SeekDown();
HRESULT STDMETHODCALLTYPE ScanUp(long MillisecondsPause);
HRESULT STDMETHODCALLTYPE ScanDown(long MillisecondsPause);
HRESULT STDMETHODCALLTYPE AutoProgram();
CScanningTunner() : m_Ref(0), m_TuningSpace(0){};
virtual ~CScanningTunner(){};
protected:
LONG m_Ref;
ITuningSpace * m_TuningSpace;
};
HRESULT
STDMETHODCALLTYPE
CScanningTunner::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_ITuner))
{
*Output = (ITuner*)(this);
reinterpret_cast<ITuner*>(*Output)->AddRef();
return NOERROR;
}
if (IsEqualGUID(refiid, IID_IScanningTuner))
{
*Output = (IScanningTuner*)(this);
reinterpret_cast<IScanningTuner*>(*Output)->AddRef();
return NOERROR;
}
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CScanningTunner::QueryInterface: NoInterface for %s\n", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
return E_NOINTERFACE;
}
//-------------------------------------------------------------------
//ITuner
//
HRESULT
STDMETHODCALLTYPE
CScanningTunner::get_TuningSpace(
ITuningSpace **TuningSpace)
{
OutputDebugStringW(L"CScanningTunner::get_TuningSpace\n");
*TuningSpace = m_TuningSpace;
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::put_TuningSpace(
ITuningSpace *TuningSpace)
{
OutputDebugStringW(L"CScanningTunner::put_TuningSpace\n");
m_TuningSpace = TuningSpace;
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::EnumTuningSpaces(
IEnumTuningSpaces **ppEnum)
{
OutputDebugStringW(L"CScanningTunner::EnumTuningSpaces : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::get_TuneRequest(
ITuneRequest **TuneRequest)
{
OutputDebugStringW(L"CScanningTunner::get_TuneRequest : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::put_TuneRequest(
ITuneRequest *TuneRequest)
{
OutputDebugStringW(L"CScanningTunner::put_TuneRequest : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::Validate(
ITuneRequest *TuneRequest)
{
OutputDebugStringW(L"CScanningTunner::Validate : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::get_PreferredComponentTypes(
IComponentTypes **ComponentTypes)
{
OutputDebugStringW(L"CScanningTunner::get_PreferredComponentTypes : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::put_PreferredComponentTypes(
IComponentTypes *ComponentTypes)
{
OutputDebugStringW(L"CScanningTunner::put_PreferredComponentTypes : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::get_SignalStrength(
long *Strength)
{
OutputDebugStringW(L"CScanningTunner::get_SignalStrength : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::TriggerSignalEvents(
long Interval)
{
OutputDebugStringW(L"CScanningTunner::TriggerSignalEvents : NotImplemented\n");
return E_NOTIMPL;
}
//-------------------------------------------------------------------
//IScanningTuner
HRESULT
STDMETHODCALLTYPE
CScanningTunner::SeekUp()
{
OutputDebugStringW(L"CScanningTunner::SeekUp : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::SeekDown()
{
OutputDebugStringW(L"CScanningTunner::SeekDown : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::ScanUp(
long MillisecondsPause)
{
OutputDebugStringW(L"CScanningTunner::ScanUp : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::ScanDown(
long MillisecondsPause)
{
OutputDebugStringW(L"CScanningTunner::ScanDown : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CScanningTunner::AutoProgram()
{
OutputDebugStringW(L"CScanningTunner::AutoProgram : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
WINAPI
CScanningTunner_fnConstructor(
IUnknown *pUnknown,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CScanningTunner * handler = new CScanningTunner();
#ifdef MSDVBNP_TRACE
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(riid, &lpstr);
swprintf(Buffer, L"CScanningTunner_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown);
OutputDebugStringW(Buffer);
#endif
if (!handler)
return E_OUTOFMEMORY;
if (FAILED(handler->QueryInterface(riid, ppv)))
{
/* not supported */
delete handler;
return E_NOINTERFACE;
}
return NOERROR;
}

View file

@ -0,0 +1,106 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS BDA Proxy
* FILE: dll/directx/msvidctl/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;
}

View file

@ -0,0 +1,142 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS BDA Proxy
* FILE: dll/directx/msvidctl/tuningspace.cpp
* PURPOSE: ITuningSpace interface
*
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
*/
#include "precomp.h"
class CEnumTuningSpaces : public IEnumTuningSpaces
{
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;
}
// IEnumTuningSpaces methods
HRESULT STDMETHODCALLTYPE Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched);
HRESULT STDMETHODCALLTYPE Skip(ULONG celt);
HRESULT STDMETHODCALLTYPE Reset();
HRESULT STDMETHODCALLTYPE Clone(IEnumTuningSpaces **ppEnum);
CEnumTuningSpaces() : m_Ref(0){};
virtual ~CEnumTuningSpaces(){};
protected:
LONG m_Ref;
};
HRESULT
STDMETHODCALLTYPE
CEnumTuningSpaces::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_IEnumTuningSpaces))
{
*Output = (IEnumTuningSpaces*)this;
reinterpret_cast<IEnumTuningSpaces*>(*Output)->AddRef();
return NOERROR;
}
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CEnumTuningSpaces::QueryInterface: NoInterface for %s\n", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
return E_NOINTERFACE;
}
//-------------------------------------------------------------------
// IEnumTuningSpaces
//
HRESULT
STDMETHODCALLTYPE
CEnumTuningSpaces::Next(ULONG celt, ITuningSpace **rgelt, ULONG *pceltFetched)
{
OutputDebugStringW(L"CEnumTuningSpaces::Next : stub\n");
return CTuningSpace_fnConstructor(NULL, IID_ITuningSpace, (void**)rgelt);
}
HRESULT
STDMETHODCALLTYPE
CEnumTuningSpaces::Skip(ULONG celt)
{
OutputDebugStringW(L"CEnumTuningSpaces::Skip : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CEnumTuningSpaces::Reset()
{
OutputDebugStringW(L"CEnumTuningSpaces::Reset : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CEnumTuningSpaces::Clone(IEnumTuningSpaces **ppEnum)
{
OutputDebugStringW(L"CEnumTuningSpaces::Clone : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
WINAPI
CEnumTuningSpaces_fnConstructor(
IUnknown *pUnknown,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CEnumTuningSpaces * tuningspaces = new CEnumTuningSpaces();
#ifdef MSVIDCTL_TRACE
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(riid, &lpstr);
swprintf(Buffer, L"CEnumTuningSpaces_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown);
OutputDebugStringW(Buffer);
#endif
if (!tuningspaces)
return E_OUTOFMEMORY;
if (FAILED(tuningspaces->QueryInterface(riid, ppv)))
{
/* not supported */
delete tuningspaces;
return E_NOINTERFACE;
}
return NOERROR;
}

View file

@ -0,0 +1,106 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS DVB
* FILE: dll/directx/msvidctl/msvidctl.cpp
* PURPOSE: ReactOS DVB Initialization
*
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
*/
#include "precomp.h"
static INTERFACE_TABLE InterfaceTable[] =
{
{&CLSID_SystemTuningSpaces, CTuningSpaceContainer_fnConstructor},
{NULL, NULL}
};
extern "C"
BOOL
WINAPI
DllMain(
HINSTANCE hInstDLL,
DWORD fdwReason,
LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
CoInitialize(NULL);
#ifdef MSDVBNP_TRACE
OutputDebugStringW(L"MSVIDCTL::DllMain()\n");
#endif
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;
}

View file

@ -0,0 +1,30 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<group>
<module name="msvidctl" type="win32dll" baseaddress="${BASEADDRESS_MSVIDCTL}" installbase="system32" installname="msvidctl.dll">
<importlibrary definition="msvidctl.spec" />
<include base="msvidctl">.</include>
<library>ntdll</library>
<library>kernel32</library>
<library>advapi32</library>
<library>ole32</library>
<library>advapi32</library>
<library>msvcrt</library>
<library>strmiids</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>classfactory.cpp</file>
<file>enumtuningspaces.cpp</file>
<file>msvidctl.cpp</file>
<file>msvidctl.rc</file>
<file>tunerequest.cpp</file>
<file>tuningspace.cpp</file>
<file>tuningspace_container.cpp</file>
</module>
</group>

View file

@ -0,0 +1,12 @@
#include <windows.h>
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
#define REACTOS_VERSION_DLL
#define REACTOS_STR_FILE_DESCRIPTION "ReactOS ActiveX Control for Streaming Video\0"
#define REACTOS_STR_INTERNAL_NAME "MSVidCtl\0"
#define REACTOS_STR_ORIGINAL_FILENAME "MSVidCtl\0"
#define REACTOS_STR_PRODUCT_VERSION "6.05.2600.3264\0"
#define REACTOS_STR_FILE_VERSION "6.05.2600.3264\0"
#include <reactos/version.rc>

View file

@ -0,0 +1,4 @@
@ stdcall DllCanUnloadNow()
@ stdcall DllGetClassObject(ptr ptr ptr)
@ stdcall DllRegisterServer()
@ stdcall DllUnregisterServer()

View file

@ -0,0 +1,72 @@
#ifndef PRECOMP_H__
#define PRECOMP_H__
#define MSVIDCTL_TRACE
#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 <bdatypes.h>
#include <bdaiface.h>
#include <bdamedia.h>
#include <tuner.h>
#include <assert.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);
/* tuningspace_container.cpp */
HRESULT
WINAPI
CTuningSpaceContainer_fnConstructor(
IUnknown *pUnknown,
REFIID riid,
LPVOID * ppv);
/* tuningspace.cpp */
HRESULT
WINAPI
CTuningSpace_fnConstructor(
IUnknown *pUnknown,
REFIID riid,
LPVOID * ppv);
/* tunerequest.cpp */
HRESULT
WINAPI
CTuneRequest_fnConstructor(
IUnknown *pUnknown,
ITuningSpace * TuningSpace,
REFIID riid,
LPVOID * ppv);
/* enumtuningspaces.cpp */
HRESULT
WINAPI
CEnumTuningSpaces_fnConstructor(
IUnknown *pUnknown,
REFIID riid,
LPVOID * ppv);
#endif

View file

@ -0,0 +1,331 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS BDA Proxy
* FILE: dll/directx/msvidctl/tuningspace.cpp
* PURPOSE: ITuningRequest interface
*
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
*/
#include "precomp.h"
class CTuneRequest : public IDVBTuneRequest
{
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)
{
OutputDebugStringW(L"CTuneRequest::Release : delete\n");
WCHAR Buffer[100];
swprintf(Buffer, L"CTuneRequest::Release : m_TuningSpace %p delete\n", m_TuningSpace);
OutputDebugStringW(Buffer);
m_TuningSpace->Release();
//delete this;
return 0;
}
return m_Ref;
}
//IDispatch methods
HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
//ITuneRequest methods
HRESULT STDMETHODCALLTYPE get_TuningSpace(ITuningSpace **TuningSpace);
HRESULT STDMETHODCALLTYPE get_Components(IComponents **Components);
HRESULT STDMETHODCALLTYPE Clone(ITuneRequest **NewTuneRequest);
HRESULT STDMETHODCALLTYPE get_Locator(ILocator **Locator);
HRESULT STDMETHODCALLTYPE put_Locator(ILocator *Locator);
//IDVBTuneRequest methods
HRESULT STDMETHODCALLTYPE get_ONID(long *ONID);
HRESULT STDMETHODCALLTYPE put_ONID(long ONID);
HRESULT STDMETHODCALLTYPE get_TSID(long *TSID);
HRESULT STDMETHODCALLTYPE put_TSID(long TSID);
HRESULT STDMETHODCALLTYPE get_SID(long *SID);
HRESULT STDMETHODCALLTYPE put_SID(long SID);
CTuneRequest(ITuningSpace * TuningSpace) : m_Ref(0), m_ONID(-1), m_TSID(-1), m_SID(-1), m_Locator(0), m_TuningSpace(TuningSpace)
{
m_TuningSpace->AddRef();
};
CTuneRequest(ITuningSpace * TuningSpace, LONG ONID, LONG TSID, LONG SID, ILocator * Locator) : m_Ref(1), m_ONID(ONID), m_TSID(TSID), m_SID(SID), m_Locator(Locator), m_TuningSpace(TuningSpace)
{
if (m_Locator)
m_Locator->AddRef();
m_TuningSpace->AddRef();
};
virtual ~CTuneRequest(){};
protected:
LONG m_Ref;
LONG m_ONID;
LONG m_TSID;
LONG m_SID;
ILocator * m_Locator;
ITuningSpace * m_TuningSpace;
};
HRESULT
STDMETHODCALLTYPE
CTuneRequest::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_ITuneRequest))
{
*Output = (ITuneRequest*)this;
reinterpret_cast<ITuneRequest*>(*Output)->AddRef();
return NOERROR;
}
if (IsEqualGUID(refiid, IID_IDVBTuneRequest))
{
*Output = (IDVBTuneRequest*)this;
reinterpret_cast<IDVBTuneRequest*>(*Output)->AddRef();
return NOERROR;
}
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CTuneRequest::QueryInterface: NoInterface for %s", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
return E_NOINTERFACE;
}
//-------------------------------------------------------------------
// IDispatch methods
//
HRESULT
STDMETHODCALLTYPE
CTuneRequest::GetTypeInfoCount(UINT *pctinfo)
{
OutputDebugStringW(L"CTuneRequest::GetTypeInfoCount : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
{
OutputDebugStringW(L"CTuneRequest::GetTypeInfo : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
OutputDebugStringW(L"CTuneRequest::GetIDsOfNames : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
OutputDebugStringW(L"CTuneRequest::Invoke : NotImplemented\n");
return E_NOTIMPL;
}
//-------------------------------------------------------------------
// ITuneRequest interface
//
HRESULT
STDMETHODCALLTYPE
CTuneRequest::get_TuningSpace(ITuningSpace **TuningSpace)
{
#ifdef MSVIDCTL_TRACE
OutputDebugStringW(L"CTuneRequest::get_TuningSpace\n");
#endif
*TuningSpace = m_TuningSpace;
m_TuningSpace->AddRef();
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::get_Components(IComponents **Components)
{
OutputDebugStringW(L"CTuneRequest::get_Components : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::Clone(ITuneRequest **NewTuneRequest)
{
#ifdef MSVIDCTL_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CTuneRequest::Clone %p\n", NewTuneRequest);
OutputDebugStringW(Buffer);
#endif
*NewTuneRequest = new CTuneRequest(m_TuningSpace, m_ONID, m_TSID, m_SID, m_Locator);
if (!*NewTuneRequest)
return E_OUTOFMEMORY;
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::get_Locator(ILocator **Locator)
{
OutputDebugStringW(L"CTuneRequest::get_Locator : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::put_Locator(ILocator *Locator)
{
OutputDebugStringW(L"CTuneRequest::put_Locator : stub\n");
m_Locator = Locator;
return S_OK;
}
//-------------------------------------------------------------------
// IDVBTuneRequest interface
//
HRESULT
STDMETHODCALLTYPE
CTuneRequest::get_ONID(long *ONID)
{
#ifdef MSVIDCTL_TRACE
OutputDebugStringW(L"CTuneRequest::get_ONID\n");
#endif
*ONID = m_ONID;
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::put_ONID(long ONID)
{
#ifdef MSVIDCTL_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CTuneRequest::put_ONID : %lu\n", ONID);
OutputDebugStringW(Buffer);
#endif
m_ONID = ONID;
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::get_TSID(long *TSID)
{
#ifdef MSVIDCTL_TRACE
OutputDebugStringW(L"CTuneRequest::get_TSID\n");
#endif
*TSID = m_TSID;
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::put_TSID(long TSID)
{
#ifdef MSVIDCTL_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CTuneRequest::put_TSID : %lu\n", TSID);
OutputDebugStringW(Buffer);
#endif
m_TSID = TSID;
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::get_SID(long *SID)
{
#ifdef MSVIDCTL_TRACE
OutputDebugStringW(L"CTuneRequest::get_SID\n");
#endif
*SID = m_SID;
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CTuneRequest::put_SID(long SID)
{
#ifdef MSVIDCTL_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CTuneRequest::put_SID : %lu\n", SID);
OutputDebugStringW(Buffer);
#endif
m_SID = SID;
return S_OK;
}
HRESULT
WINAPI
CTuneRequest_fnConstructor(
IUnknown *pUnknown,
ITuningSpace * TuningSpace,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CTuneRequest * request = new CTuneRequest(TuningSpace);
#ifdef MSVIDCTL_TRACE
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(riid, &lpstr);
swprintf(Buffer, L"CTuneRequest_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown);
OutputDebugStringW(Buffer);
#endif
if (!request)
return E_OUTOFMEMORY;
if (FAILED(request->QueryInterface(riid, ppv)))
{
/* not supported */
delete request;
return E_NOINTERFACE;
}
return NOERROR;
}

View file

@ -0,0 +1,365 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS BDA Proxy
* FILE: dll/directx/msvidctl/tuningspace.cpp
* PURPOSE: ITuningSpace interface
*
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
*/
#include "precomp.h"
const GUID CLSID_DVBTNetworkProvider = {0x216c62df, 0x6d7f, 0x4e9a, {0x85, 0x71, 0x5, 0xf1, 0x4e, 0xdb, 0x76, 0x6a}};
class CTuningSpace : public IDVBTuningSpace
{
public:
STDMETHODIMP QueryInterface( REFIID InterfaceId, PVOID* Interface);
STDMETHODIMP_(ULONG) AddRef()
{
InterlockedIncrement(&m_Ref);
return m_Ref;
}
STDMETHODIMP_(ULONG) Release()
{
InterlockedDecrement(&m_Ref);
WCHAR Buffer[100];
swprintf(Buffer, L"CTuningSpace::Release : %p Ref %lu\n", this, m_Ref);
OutputDebugStringW(Buffer);
if (!m_Ref)
{
//delete this;
return 0;
}
return m_Ref;
}
// IDispatch methods
HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
//ITuningSpace methods
HRESULT STDMETHODCALLTYPE get_UniqueName(BSTR *Name);
HRESULT STDMETHODCALLTYPE put_UniqueName(BSTR Name);
HRESULT STDMETHODCALLTYPE get_FriendlyName(BSTR *Name);
HRESULT STDMETHODCALLTYPE put_FriendlyName(BSTR Name);
HRESULT STDMETHODCALLTYPE get_CLSID(BSTR *SpaceCLSID);
HRESULT STDMETHODCALLTYPE get_NetworkType(BSTR *NetworkTypeGuid);
HRESULT STDMETHODCALLTYPE put_NetworkType(BSTR NetworkTypeGuid);
HRESULT STDMETHODCALLTYPE get__NetworkType(GUID *NetworkTypeGuid);
HRESULT STDMETHODCALLTYPE put__NetworkType(REFCLSID NetworkTypeGuid);
HRESULT STDMETHODCALLTYPE CreateTuneRequest(ITuneRequest **TuneRequest);
HRESULT STDMETHODCALLTYPE EnumCategoryGUIDs(IEnumGUID **ppEnum);
HRESULT STDMETHODCALLTYPE EnumDeviceMonikers(IEnumMoniker **ppEnum);
HRESULT STDMETHODCALLTYPE get_DefaultPreferredComponentTypes(IComponentTypes **ComponentTypes);
HRESULT STDMETHODCALLTYPE put_DefaultPreferredComponentTypes(IComponentTypes *NewComponentTypes);
HRESULT STDMETHODCALLTYPE get_FrequencyMapping(BSTR *pMapping);
HRESULT STDMETHODCALLTYPE put_FrequencyMapping(BSTR Mapping);
HRESULT STDMETHODCALLTYPE get_DefaultLocator(ILocator **LocatorVal);
HRESULT STDMETHODCALLTYPE put_DefaultLocator(ILocator *LocatorVal);
HRESULT STDMETHODCALLTYPE Clone(ITuningSpace **NewTS);
// IDVBTuningSpace
HRESULT STDMETHODCALLTYPE get_SystemType(DVBSystemType *SysType);
HRESULT STDMETHODCALLTYPE put_SystemType(DVBSystemType SysType);
CTuningSpace() : m_Ref(0){};
virtual ~CTuningSpace(){};
protected:
LONG m_Ref;
};
HRESULT
STDMETHODCALLTYPE
CTuningSpace::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_ITuningSpace))
{
*Output = (ITuningSpace*)this;
reinterpret_cast<ITuningSpace*>(*Output)->AddRef();
return NOERROR;
}
if (IsEqualGUID(refiid, IID_IDVBTuningSpace))
{
*Output = (IDVBTuningSpace*)this;
reinterpret_cast<IDVBTuningSpace*>(*Output)->AddRef();
return NOERROR;
}
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CTuningSpace::QueryInterface: NoInterface for %s", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
return E_NOINTERFACE;
}
//-------------------------------------------------------------------
// IDispatch methods
//
HRESULT
STDMETHODCALLTYPE
CTuningSpace::GetTypeInfoCount(UINT *pctinfo)
{
OutputDebugStringW(L"CTuningSpace::GetTypeInfoCount : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
{
OutputDebugStringW(L"CTuningSpace::GetTypeInfo : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
OutputDebugStringW(L"CTuningSpace::GetIDsOfNames : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
OutputDebugStringW(L"CTuningSpace::Invoke : NotImplemented\n");
return E_NOTIMPL;
}
//-------------------------------------------------------------------
// ITuningSpace interface
//
HRESULT
STDMETHODCALLTYPE
CTuningSpace::get_UniqueName(BSTR *Name)
{
OutputDebugStringW(L"CTuningSpace::get_UniqueName : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::put_UniqueName(BSTR Name)
{
OutputDebugStringW(L"CTuningSpace::put_UniqueName : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::get_FriendlyName(BSTR *Name)
{
OutputDebugStringW(L"CTuningSpace::get_FriendlyName : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::put_FriendlyName(BSTR Name)
{
OutputDebugStringW(L"CTuningSpace::put_FriendlyName : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::get_CLSID(BSTR *SpaceCLSID)
{
OutputDebugStringW(L"CTuningSpace::get_CLSID : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::get_NetworkType(BSTR *NetworkTypeGuid)
{
OutputDebugStringW(L"CTuningSpace::get_NetworkType : stub\n");
return StringFromCLSID(CLSID_DVBTNetworkProvider, (LPOLESTR*)NetworkTypeGuid);
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::put_NetworkType(BSTR NetworkTypeGuid)
{
OutputDebugStringW(L"CTuningSpace::put_NetworkType : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::get__NetworkType(GUID *NetworkTypeGuid)
{
#ifdef MSVIDCTL_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CTuningSpace::get__NetworkType : %p stub\n", NetworkTypeGuid);
OutputDebugStringW(Buffer);
#endif
CopyMemory(NetworkTypeGuid, &CLSID_DVBTNetworkProvider, sizeof(GUID));
OutputDebugStringW(L"CTuningSpace::get__NetworkType : done\n");
return S_OK;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::put__NetworkType(REFCLSID NetworkTypeGuid)
{
OutputDebugStringW(L"CTuningSpace::put__NetworkType : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::CreateTuneRequest(ITuneRequest **TuneRequest)
{
OutputDebugStringW(L"CTuningSpace::CreateTuneRequest : stub\n");
return CTuneRequest_fnConstructor(NULL, (ITuningSpace*)this, IID_ITuneRequest, (void**)TuneRequest);
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::EnumCategoryGUIDs(IEnumGUID **ppEnum)
{
OutputDebugStringW(L"CTuningSpace::EnumCategoryGUIDs : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::EnumDeviceMonikers(IEnumMoniker **ppEnum)
{
OutputDebugStringW(L"CTuningSpace::EnumDeviceMonikers : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::get_DefaultPreferredComponentTypes(IComponentTypes **ComponentTypes)
{
OutputDebugStringW(L"CTuningSpace::get_DefaultPreferredComponentTypes : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::put_DefaultPreferredComponentTypes(IComponentTypes *NewComponentTypes)
{
OutputDebugStringW(L"CTuningSpace::put_DefaultPreferredComponentTypes : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::get_FrequencyMapping(BSTR *pMapping)
{
OutputDebugStringW(L"CTuningSpace::get_FrequencyMapping : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::put_FrequencyMapping(BSTR Mapping)
{
OutputDebugStringW(L"CTuningSpace::put_FrequencyMapping : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::get_DefaultLocator(ILocator **LocatorVal)
{
OutputDebugStringW(L"CTuningSpace::get_DefaultLocator : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::put_DefaultLocator(ILocator *LocatorVal)
{
OutputDebugStringW(L"CTuningSpace::put_DefaultLocator : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::Clone(ITuningSpace **NewTS)
{
OutputDebugStringW(L"CTuningSpace::Clone : NotImplemented\n");
return E_NOTIMPL;
}
//-------------------------------------------------------------------
// IDVBTuningSpace
//
HRESULT
STDMETHODCALLTYPE
CTuningSpace::get_SystemType(DVBSystemType *SysType)
{
OutputDebugStringW(L"CTuningSpace::get_SystemType : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpace::put_SystemType(DVBSystemType SysType)
{
OutputDebugStringW(L"CTuningSpace::put_SystemType : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
WINAPI
CTuningSpace_fnConstructor(
IUnknown *pUnknown,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CTuningSpace * space = new CTuningSpace();
#ifdef MSVIDCTL_TRACE
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(riid, &lpstr);
swprintf(Buffer, L"CTuningSpace_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown);
OutputDebugStringW(Buffer);
#endif
if (!space)
return E_OUTOFMEMORY;
if (FAILED(space->QueryInterface(riid, ppv)))
{
/* not supported */
delete space;
return E_NOINTERFACE;
}
return NOERROR;
}

View file

@ -0,0 +1,272 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS BDA Proxy
* FILE: dll/directx/msvidctl/tuningspace_container.cpp
* PURPOSE: ITuningSpaceContainer interface
*
* PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
*/
#define _FORCENAMELESSUNION
#include "precomp.h"
class CTuningSpaceContainer : public ITuningSpaceContainer
{
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)
{
OutputDebugStringW(L"CTuningSpaceContainer::Release : delete\n");
//delete this;
return 0;
}
return m_Ref;
}
// IDispatch methods
HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo);
HRESULT STDMETHODCALLTYPE GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId);
HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
//ITuningSpaceContainer methods
HRESULT STDMETHODCALLTYPE get_Count(long *Count);
HRESULT STDMETHODCALLTYPE get__NewEnum(IEnumVARIANT **NewEnum);
HRESULT STDMETHODCALLTYPE get_Item(VARIANT varIndex, ITuningSpace **TuningSpace);
HRESULT STDMETHODCALLTYPE put_Item(VARIANT varIndex, ITuningSpace *TuningSpace);
HRESULT STDMETHODCALLTYPE TuningSpacesForCLSID(BSTR SpaceCLSID, ITuningSpaces **NewColl);
HRESULT STDMETHODCALLTYPE _TuningSpacesForCLSID(REFCLSID SpaceCLSID, ITuningSpaces **NewColl);
HRESULT STDMETHODCALLTYPE TuningSpacesForName(BSTR Name, ITuningSpaces **NewColl);
HRESULT STDMETHODCALLTYPE FindID(ITuningSpace *TuningSpace, long *ID);
HRESULT STDMETHODCALLTYPE Add(ITuningSpace *TuningSpace, VARIANT *NewIndex);
HRESULT STDMETHODCALLTYPE get_EnumTuningSpaces(IEnumTuningSpaces **ppEnum);
HRESULT STDMETHODCALLTYPE Remove(VARIANT Index);
HRESULT STDMETHODCALLTYPE get_MaxCount(long *MaxCount);
HRESULT STDMETHODCALLTYPE put_MaxCount(long MaxCount);
CTuningSpaceContainer() : m_Ref(0){};
virtual ~CTuningSpaceContainer(){};
protected:
LONG m_Ref;
};
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::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_ITuningSpaceContainer))
{
*Output = (ITuningSpaceContainer*)this;
reinterpret_cast<ITuningSpaceContainer*>(*Output)->AddRef();
return NOERROR;
}
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(refiid, &lpstr);
swprintf(Buffer, L"CTuningSpaceContainer::QueryInterface: NoInterface for %s", lpstr);
OutputDebugStringW(Buffer);
CoTaskMemFree(lpstr);
return E_NOINTERFACE;
}
//-------------------------------------------------------------------
// IDispatch methods
//
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::GetTypeInfoCount(UINT *pctinfo)
{
OutputDebugStringW(L"CTuningSpaceContainer::GetTypeInfoCount : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
{
OutputDebugStringW(L"CTuningSpaceContainer::GetTypeInfo : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
OutputDebugStringW(L"CTuningSpaceContainer::GetIDsOfNames : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
OutputDebugStringW(L"CTuningSpaceContainer::Invoke : NotImplemented\n");
return E_NOTIMPL;
}
//-------------------------------------------------------------------
// ITuningSpaceContainer methods
//
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::get_Count(long *Count)
{
OutputDebugStringW(L"CTuningSpaceContainer::get_Count : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::get__NewEnum(IEnumVARIANT **NewEnum)
{
OutputDebugStringW(L"CTuningSpaceContainer::get__NewEnum : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::get_Item(VARIANT varIndex, ITuningSpace **TuningSpace)
{
#ifdef MSVIDCTL_TRACE
WCHAR Buffer[100];
swprintf(Buffer, L"CTuningSpaceContainer::get_Item : type %x value %s stub\n", varIndex.vt, varIndex.bstrVal);
OutputDebugStringW(Buffer);
#endif
return CTuningSpace_fnConstructor(NULL, IID_ITuningSpace, (void**)TuningSpace);
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::put_Item(VARIANT varIndex, ITuningSpace *TuningSpace)
{
OutputDebugStringW(L"CTuningSpaceContainer::put_Item : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::TuningSpacesForCLSID(BSTR SpaceCLSID, ITuningSpaces **NewColl)
{
OutputDebugStringW(L"CTuningSpaceContainer::TuningSpacesForCLSID : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::_TuningSpacesForCLSID(REFCLSID SpaceCLSID, ITuningSpaces **NewColl)
{
OutputDebugStringW(L"CTuningSpaceContainer::_TuningSpacesForCLSID : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::TuningSpacesForName(BSTR Name, ITuningSpaces **NewColl)
{
OutputDebugStringW(L"CTuningSpaceContainer::TuningSpacesForName : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::FindID(ITuningSpace *TuningSpace, long *ID)
{
OutputDebugStringW(L"CTuningSpaceContainer::FindID : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::Add(ITuningSpace *TuningSpace, VARIANT *NewIndex)
{
OutputDebugStringW(L"CTuningSpaceContainer::Add : stub\n");
TuningSpace->AddRef();
NewIndex->vt = VT_BSTR;
InterlockedIncrement(&m_Ref);
return TuningSpace->get_FriendlyName(&NewIndex->bstrVal);;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::get_EnumTuningSpaces(IEnumTuningSpaces **ppEnum)
{
OutputDebugStringW(L"CTuningSpaceContainer::get_EnumTuningSpaces : stub\n");
return CEnumTuningSpaces_fnConstructor(NULL, IID_IEnumTuningSpaces, (void**)ppEnum);
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::Remove(VARIANT Index)
{
OutputDebugStringW(L"CTuningSpaceContainer::Remove: NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::get_MaxCount(long *MaxCount)
{
OutputDebugStringW(L"CTuningSpaceContainer::get_MaxCount : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
STDMETHODCALLTYPE
CTuningSpaceContainer::put_MaxCount(long MaxCount)
{
OutputDebugStringW(L"CTuningSpaceContainer::put_MaxCount : NotImplemented\n");
return E_NOTIMPL;
}
HRESULT
WINAPI
CTuningSpaceContainer_fnConstructor(
IUnknown *pUnknown,
REFIID riid,
LPVOID * ppv)
{
// construct device control
CTuningSpaceContainer * provider = new CTuningSpaceContainer();
#ifdef MSVIDCTL_TRACE
WCHAR Buffer[MAX_PATH];
LPOLESTR lpstr;
StringFromCLSID(riid, &lpstr);
swprintf(Buffer, L"CTuningSpaceContainer_fnConstructor riid %s pUnknown %p\n", lpstr, pUnknown);
OutputDebugStringW(Buffer);
#endif
if (!provider)
return E_OUTOFMEMORY;
if (FAILED(provider->QueryInterface(riid, ppv)))
{
/* not supported */
delete provider;
return E_NOINTERFACE;
}
return NOERROR;
}