mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-17 12:25:46 -04:00
Initial community commit
This commit is contained in:
67
Src/Elevator/ElevatorFactory.cpp
Normal file
67
Src/Elevator/ElevatorFactory.cpp
Normal file
@ -0,0 +1,67 @@
|
||||
#include "ElevatorFactory.h"
|
||||
#include "FileTypeRegistrar.h"
|
||||
|
||||
FileTypeRegistrar registrar;
|
||||
|
||||
void Lock();
|
||||
void UnLock();
|
||||
|
||||
ElevatorFactory::ElevatorFactory()
|
||||
{
|
||||
}
|
||||
|
||||
ElevatorFactory::~ElevatorFactory()
|
||||
{
|
||||
}
|
||||
|
||||
ULONG ElevatorFactory::AddRef()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
ULONG ElevatorFactory::Release()
|
||||
{
|
||||
return 10;
|
||||
}
|
||||
|
||||
HRESULT ElevatorFactory::QueryInterface(REFIID riid, void ** ppAny)
|
||||
{
|
||||
// IID_IUnknown is the REFIID of standard interface IUnknown
|
||||
if(riid == IID_IUnknown)
|
||||
{
|
||||
*ppAny = (IUnknown *)this;
|
||||
}
|
||||
else if(riid == IID_IClassFactory)
|
||||
{
|
||||
*ppAny = (IClassFactory *)this;
|
||||
}
|
||||
else
|
||||
{
|
||||
*ppAny = NULL;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
((IUnknown *)(*ppAny))->AddRef();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT ElevatorFactory::LockServer(BOOL fLock)
|
||||
{
|
||||
if (fLock)
|
||||
Lock();
|
||||
else
|
||||
UnLock();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT ElevatorFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void **ppAny)
|
||||
{
|
||||
if(pUnkOuter != NULL)
|
||||
{
|
||||
return CLASS_E_NOAGGREGATION;
|
||||
}
|
||||
|
||||
FileTypeRegistrar *pRegistrar = ®istrar;
|
||||
return pRegistrar->QueryInterface(riid, ppAny);
|
||||
}
|
Reference in New Issue
Block a user