ReactOS  0.4.14-dev-98-gb0d4763
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 RemoteLockServer ([in] BOOL fLock)
 

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  }
LONG objs_loaded
Definition: main.cpp:48
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
LONG refcount
Definition: factory.h:67
#define InterlockedIncrement
Definition: armddk.h:53

◆ ~Factory()

virtual Factory::~Factory ( )
inlinevirtual

Definition at line 38 of file factory.h.

38  {
40  }
LONG objs_loaded
Definition: main.cpp:48
#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  }
LONG refcount
Definition: factory.h:67
#define InterlockedIncrement
Definition: armddk.h:53

◆ 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)
45  return CLASS_E_NOAGGREGATION;
46 
47  switch (type) {
48  case FactoryIconHandler:
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 
58  case FactoryContextMenu:
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 
68  case FactoryPropSheet:
69  if (iid == IID_IUnknown || iid == IID_IShellPropSheetExt || iid == IID_IShellExtInit) {
70  BtrfsPropSheet* bps = new BtrfsPropSheet;
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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT __stdcall QueryInterface(REFIID riid, void **ppObj)
Definition: propsheet.cpp:66
REFIID LPVOID * ppv
Definition: atlbase.h:39
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const GUID IID_IUnknown
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
HRESULT __stdcall QueryInterface(REFIID riid, void **ppObj)
HRESULT __stdcall QueryInterface(REFIID riid, void **ppObj)
Definition: contextmenu.cpp:70
HRESULT __stdcall QueryInterface(REFIID riid, void **ppObj)
Definition: iconoverlay.cpp:35

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
const GUID IID_IClassFactory

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
#define InterlockedDecrement
Definition: armddk.h:52
LONG refcount
Definition: factory.h:67

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: