ReactOS 0.4.15-dev-7654-g6bc40d3
Factory Class Reference

#include <factory.h>

Inheritance diagram for Factory:
Collaboration diagram for Factory:

Public Member Functions

 Factory ()
 
virtual ~Factory ()
 
HRESULT __stdcall QueryInterface (REFIID riid, void **ppObj)
 
ULONG __stdcall AddRef ()
 
ULONG __stdcall Release ()
 
virtual HRESULT __stdcall CreateInstance (IUnknown *pUnknownOuter, const IID &iid, void **ppv)
 
virtual HRESULT __stdcall LockServer (BOOL bLock)
 
- Public Member Functions inherited from IClassFactory
HRESULT CreateInstance ([in, unique] IUnknown *pUnkOuter, [in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
HRESULT RemoteCreateInstance ([in] REFIID riid, [out, iid_is(riid)] IUnknown **ppvObject)
 
HRESULT LockServer ([in] BOOL fLock)
 
HRESULT RemoteLockServer ([in] BOOL fLock)
 
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Public Attributes

factory_type type
 

Private Attributes

LONG refcount
 

Additional Inherited Members

- Public Types inherited from IClassFactory
typedef IClassFactoryLPCLASSFACTORY
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 

Detailed Description

Definition at line 30 of file factory.h.

Constructor & Destructor Documentation

◆ Factory()

Factory::Factory ( )
inline

Definition at line 32 of file factory.h.

32 {
33 refcount = 0;
36 }
#define InterlockedIncrement
Definition: armddk.h:53
LONG refcount
Definition: factory.h:67
LONG objs_loaded
Definition: main.cpp:48
@ FactoryUnknown
Definition: factory.h:23
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ ~Factory()

virtual Factory::~Factory ( )
inlinevirtual

Definition at line 38 of file factory.h.

38 {
40 }
#define InterlockedDecrement
Definition: armddk.h:52

Member Function Documentation

◆ AddRef()

ULONG __stdcall Factory::AddRef ( void  )
inline

Implements IUnknown.

Definition at line 46 of file factory.h.

46 {
48 }

◆ CreateInstance()

HRESULT __stdcall Factory::CreateInstance ( IUnknown pUnknownOuter,
const IID iid,
void **  ppv 
)
virtual

Definition at line 43 of file factory.cpp.

43 {
44 if (pUnknownOuter)
46
47 switch (type) {
49 if (iid == IID_IUnknown || iid == IID_IShellIconOverlayIdentifier) {
51 if (!bio)
52 return E_OUTOFMEMORY;
53
54 return bio->QueryInterface(iid, ppv);
55 }
56 break;
57
59 if (iid == IID_IUnknown || iid == IID_IContextMenu || iid == IID_IShellExtInit) {
61 if (!bcm)
62 return E_OUTOFMEMORY;
63
64 return bcm->QueryInterface(iid, ppv);
65 }
66 break;
67
69 if (iid == IID_IUnknown || iid == IID_IShellPropSheetExt || iid == IID_IShellExtInit) {
71 if (!bps)
72 return E_OUTOFMEMORY;
73
74 return bps->QueryInterface(iid, ppv);
75 }
76 break;
77
79 if (iid == IID_IUnknown || iid == IID_IShellPropSheetExt || iid == IID_IShellExtInit) {
81 if (!bps)
82 return E_OUTOFMEMORY;
83
84 return bps->QueryInterface(iid, ppv);
85 }
86 break;
87
88 default:
89 break;
90 }
91
92 *ppv = nullptr;
93 return E_NOINTERFACE;
94}
const GUID IID_IUnknown
HRESULT __stdcall QueryInterface(REFIID riid, void **ppObj)
Definition: contextmenu.cpp:70
HRESULT __stdcall QueryInterface(REFIID riid, void **ppObj)
Definition: propsheet.cpp:73
HRESULT __stdcall QueryInterface(REFIID riid, void **ppObj)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
@ FactoryContextMenu
Definition: factory.h:25
@ FactoryIconHandler
Definition: factory.h:24
@ FactoryVolPropSheet
Definition: factory.h:27
@ FactoryPropSheet
Definition: factory.h:26
REFIID LPVOID * ppv
Definition: atlbase.h:39
static EFI_BLOCK_IO * bio
Definition: uefidisk.c:61
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ LockServer()

HRESULT __stdcall Factory::LockServer ( BOOL  bLock)
virtual

Implements IClassFactory.

Definition at line 39 of file factory.cpp.

39 {
40 return E_NOTIMPL;
41}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ QueryInterface()

HRESULT __stdcall Factory::QueryInterface ( REFIID  riid,
void **  ppObj 
)

Implements IUnknown.

Definition at line 26 of file factory.cpp.

26 {
27 if (iid == IID_IUnknown || iid == IID_IClassFactory) {
28 *ppv = static_cast<IClassFactory*>(this);
29 } else {
30 *ppv = nullptr;
31 return E_NOINTERFACE;
32 }
33
34 reinterpret_cast<IUnknown*>(*ppv)->AddRef();
35
36 return S_OK;
37}
const GUID IID_IClassFactory
ULONG AddRef()
#define S_OK
Definition: intsafe.h:52

Referenced by DllGetClassObject().

◆ Release()

ULONG __stdcall Factory::Release ( void  )
inline

Implements IUnknown.

Definition at line 50 of file factory.h.

50 {
52
53 if (rc == 0)
54 delete this;
55
56 return rc;
57 }
long LONG
Definition: pedump.c:60

Member Data Documentation

◆ refcount

LONG Factory::refcount
private

Definition at line 67 of file factory.h.

Referenced by AddRef(), Factory(), and Release().

◆ type

factory_type Factory::type

Definition at line 64 of file factory.h.

Referenced by DllGetClassObject().


The documentation for this class was generated from the following files: