ReactOS 0.4.15-dev-7934-g1dc8d80
classfactory.c File Reference
#include "precomp.h"
Include dependency graph for classfactory.c:

Go to the source code of this file.

Classes

struct  IClassFactoryImpl
 

Functions

static HRESULT WINAPI IClassFactory_fnQueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI IClassFactory_fnAddRef (LPCLASSFACTORY iface)
 
static ULONG WINAPI IClassFactory_fnRelease (LPCLASSFACTORY iface)
 
static HRESULT WINAPI IClassFactory_fnCreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
 
static HRESULT WINAPI IClassFactory_fnLockServer (LPCLASSFACTORY iface, BOOL fLock)
 
IClassFactoryIClassFactory_fnConstructor (LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, REFIID riidInst)
 

Variables

static const IClassFactoryVtbl dclfvt
 

Function Documentation

◆ IClassFactory_fnAddRef()

static ULONG WINAPI IClassFactory_fnAddRef ( LPCLASSFACTORY  iface)
static

Definition at line 36 of file classfactory.c.

38{
40 ULONG refCount = InterlockedIncrement(&This->ref);
41
42 return refCount;
43}
#define InterlockedIncrement
Definition: armddk.h:53
uint32_t ULONG
Definition: typedefs.h:59

◆ IClassFactory_fnConstructor()

IClassFactory * IClassFactory_fnConstructor ( LPFNCREATEINSTANCE  lpfnCI,
PLONG  pcRefDll,
REFIID  riidInst 
)

Definition at line 105 of file classfactory.c.

109{
110 IClassFactoryImpl* lpclf;
111
112 lpclf = CoTaskMemAlloc(sizeof(IClassFactoryImpl));
113 lpclf->ref = 1;
114 lpclf->lpVtbl = &dclfvt;
115 lpclf->lpfnCI = lpfnCI;
116
117 if (pcRefDll)
118 InterlockedIncrement(pcRefDll);
119 lpclf->riidInst = riidInst;
120
121 return (LPCLASSFACTORY)lpclf;
122}
static const IClassFactoryVtbl dclfvt
Definition: classfactory.c:114
LPFNCREATEINSTANCE lpfnCI
Definition: shellole.c:61
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
LPFNCREATEINSTANCE lpfnCI
Definition: classfactory.c:18
const IID * riidInst
Definition: classfactory.c:19
const IClassFactoryVtbl * lpVtbl
Definition: classfactory.c:15

◆ IClassFactory_fnCreateInstance()

static HRESULT WINAPI IClassFactory_fnCreateInstance ( LPCLASSFACTORY  iface,
LPUNKNOWN  pUnkOuter,
REFIID  riid,
LPVOID ppvObject 
)
static

Definition at line 65 of file classfactory.c.

70{
72
73 *ppvObject = NULL;
74
75 if ( This->riidInst==NULL || IsEqualCLSID(riid, This->riidInst) || IsEqualCLSID(riid, &IID_IUnknown) )
76 {
77 return This->lpfnCI(pUnkOuter, riid, ppvObject);
78 }
79
80 return E_NOINTERFACE;
81}
const GUID IID_IUnknown
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39
#define IsEqualCLSID(rclsid1, rclsid2)
Definition: guiddef.h:96
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ IClassFactory_fnLockServer()

static HRESULT WINAPI IClassFactory_fnLockServer ( LPCLASSFACTORY  iface,
BOOL  fLock 
)
static

Definition at line 85 of file classfactory.c.

88{
89 //IClassFactoryImpl *This = (IClassFactoryImpl *)iface;
90 return E_NOTIMPL;
91}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IClassFactory_fnQueryInterface()

static HRESULT WINAPI IClassFactory_fnQueryInterface ( LPCLASSFACTORY  iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 16 of file classfactory.c.

20{
22
23 *ppvObj = NULL;
25 {
26 *ppvObj = This;
28 return S_OK;
29 }
30 return E_NOINTERFACE;
31}
const GUID IID_IClassFactory
#define S_OK
Definition: intsafe.h:52
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ IClassFactory_fnRelease()

static ULONG WINAPI IClassFactory_fnRelease ( LPCLASSFACTORY  iface)
static

Definition at line 48 of file classfactory.c.

50{
52 ULONG refCount = InterlockedDecrement(&This->ref);
53
54 if (!refCount)
55 {
57 return 0;
58 }
59 return refCount;
60}
#define InterlockedDecrement
Definition: armddk.h:52
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442

Variable Documentation

◆ dclfvt

const IClassFactoryVtbl dclfvt
static
Initial value:
=
{
}
static ULONG WINAPI IClassFactory_fnRelease(LPCLASSFACTORY iface)
Definition: classfactory.c:62
static HRESULT WINAPI IClassFactory_fnQueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
Definition: classfactory.c:26
static HRESULT WINAPI IClassFactory_fnLockServer(LPCLASSFACTORY iface, BOOL fLock)
Definition: classfactory.c:105
static ULONG WINAPI IClassFactory_fnAddRef(LPCLASSFACTORY iface)
Definition: classfactory.c:48
static HRESULT WINAPI IClassFactory_fnCreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
Definition: classfactory.c:81

Definition at line 94 of file classfactory.c.