diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Elevator/ElevatorFactory.cpp | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/Elevator/ElevatorFactory.cpp')
-rw-r--r-- | Src/Elevator/ElevatorFactory.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/Src/Elevator/ElevatorFactory.cpp b/Src/Elevator/ElevatorFactory.cpp new file mode 100644 index 00000000..8fca8d6b --- /dev/null +++ b/Src/Elevator/ElevatorFactory.cpp @@ -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); +}
\ No newline at end of file |