diff options
author | Jean-Francois Mauguit <jfmauguit@mac.com> | 2024-09-24 09:03:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-24 09:03:25 -0400 |
commit | bab614c421ed7ae329d26bf028c4a3b1d2450f5a (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/ie_plugin/WinampFactory.cpp | |
parent | 4bde6044fddf053f31795b9eaccdd2a5a527d21f (diff) | |
parent | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (diff) | |
download | winamp-bab614c421ed7ae329d26bf028c4a3b1d2450f5a.tar.gz |
Merge pull request #5 from WinampDesktop/community
Merge to main
Diffstat (limited to 'Src/ie_plugin/WinampFactory.cpp')
-rw-r--r-- | Src/ie_plugin/WinampFactory.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Src/ie_plugin/WinampFactory.cpp b/Src/ie_plugin/WinampFactory.cpp new file mode 100644 index 00000000..3d7cb68b --- /dev/null +++ b/Src/ie_plugin/WinampFactory.cpp @@ -0,0 +1,65 @@ +#include "WinampFactory.h" +#include "Winamp.h" + +//FileTypeRegistrar registrar; + +WinampFactory::WinampFactory() +{ +} + +WinampFactory::~WinampFactory() +{ +} + +ULONG WinampFactory::AddRef() +{ + return 10; +} + +ULONG WinampFactory::Release() +{ + return 10; +} + +HRESULT WinampFactory::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 WinampFactory::LockServer(BOOL fLock) +{ + return S_OK; +} + +HRESULT WinampFactory::CreateInstance(LPUNKNOWN pUnkOuter, REFIID riid, void **ppAny) +{ + if(pUnkOuter != NULL) + { + return CLASS_E_NOAGGREGATION; + } + + Winamp *winamp = new Winamp; + HRESULT hr = winamp->QueryInterface(riid, ppAny); + if (FAILED(hr)) + delete winamp; + return hr; + + +}
\ No newline at end of file |