2022-09-09 20:44:40 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "pch.h"
|
|
|
|
|
|
|
|
class ClassFactory : public IClassFactory
|
|
|
|
{
|
|
|
|
public:
|
2022-09-12 19:55:47 +08:00
|
|
|
ClassFactory(_In_ REFCLSID clsid);
|
|
|
|
~ClassFactory();
|
|
|
|
|
2022-09-09 20:44:40 +08:00
|
|
|
// IUnknown
|
|
|
|
IFACEMETHODIMP QueryInterface(REFIID riid, void** ppv) override;
|
|
|
|
IFACEMETHODIMP_(ULONG) AddRef() override;
|
|
|
|
IFACEMETHODIMP_(ULONG) Release() override;
|
|
|
|
|
|
|
|
// IClassFactory
|
|
|
|
IFACEMETHODIMP CreateInstance(IUnknown* pUnkOuter, REFIID riid, void** ppvObject) override;
|
|
|
|
IFACEMETHODIMP LockServer(BOOL fLock) override;
|
|
|
|
private:
|
|
|
|
std::atomic<ULONG> m_ref_count;
|
|
|
|
IID m_clsid;
|
|
|
|
};
|