mirror of
https://github.com/reactos/reactos.git
synced 2024-11-09 16:20:37 +00:00
a00acb2a1b
svn path=/branches/header-work/; revision=46021
110 lines
1.9 KiB
C++
110 lines
1.9 KiB
C++
/*
|
|
* 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:
|
|
CoInitialize(NULL);
|
|
|
|
#ifdef BDAPLGIN_TRACE
|
|
OutputDebugStringW(L"BDAPLGIN::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;
|
|
}
|