ReactOS 0.4.16-dev-125-g798ea90
factory.c File Reference
#include "objsel_private.h"
#include "wine/debug.h"
Include dependency graph for factory.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (objsel)
 
static ClassFactoryImplimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI OBJSEL_IClassFactory_QueryInterface (LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI OBJSEL_IClassFactory_AddRef (LPCLASSFACTORY iface)
 
static ULONG WINAPI OBJSEL_IClassFactory_Release (LPCLASSFACTORY iface)
 
static HRESULT WINAPI OBJSEL_IClassFactory_CreateInstance (LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
 
static HRESULT WINAPI OBJSEL_IClassFactory_LockServer (LPCLASSFACTORY iface, BOOL fLock)
 

Variables

static IClassFactoryVtbl IClassFactory_Vtbl
 
ClassFactoryImpl OBJSEL_ClassFactory = { { &IClassFactory_Vtbl }, 0 }
 

Function Documentation

◆ impl_from_IClassFactory()

static ClassFactoryImpl * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 29 of file factory.c.

30{
31 return CONTAINING_RECORD(iface, ClassFactoryImpl, IClassFactory_iface);
32}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ OBJSEL_IClassFactory_AddRef()

static ULONG WINAPI OBJSEL_IClassFactory_AddRef ( LPCLASSFACTORY  iface)
static

Definition at line 66 of file factory.c.

67{
69 ULONG ref;
70
71 TRACE("\n");
72
73 if (This == NULL) return E_POINTER;
74
76
77 if (ref == 1)
78 {
80 }
81
82 return ref;
83}
#define InterlockedIncrement
Definition: armddk.h:53
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: factory.c:51
DECLSPEC_HIDDEN LONG dll_refs
Definition: devenum_main.c:28
#define NULL
Definition: types.h:112
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ OBJSEL_IClassFactory_CreateInstance()

static HRESULT WINAPI OBJSEL_IClassFactory_CreateInstance ( LPCLASSFACTORY  iface,
LPUNKNOWN  pUnkOuter,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 112 of file factory.c.

117{
118 TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
119
120 if (ppvObj == NULL) return E_POINTER;
121
122 /* Don't support aggregation (Windows doesn't) */
123 if (pUnkOuter != NULL) return CLASS_E_NOAGGREGATION;
124
125 if (IsEqualGUID(&IID_IDsObjectPicker, riid))
126 {
127 return OBJSEL_IDsObjectPicker_Create(ppvObj);
128 }
129
131}
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
HRESULT WINAPI OBJSEL_IDsObjectPicker_Create(LPVOID *ppvObj)
Definition: objsel.c:220
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ OBJSEL_IClassFactory_LockServer()

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

Definition at line 137 of file factory.c.

140{
141 TRACE("\n");
142
143 if (fLock)
144 IClassFactory_AddRef(iface);
145 else
146 IClassFactory_Release(iface);
147 return S_OK;
148}
#define S_OK
Definition: intsafe.h:52

◆ OBJSEL_IClassFactory_QueryInterface()

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

Definition at line 37 of file factory.c.

41{
42 TRACE("\n\tIID:\t%s\n",debugstr_guid(riid));
43
44 if (ppvObj == NULL) return E_POINTER;
45
48 {
49 *ppvObj = iface;
50 IClassFactory_AddRef(iface);
51 return S_OK;
52 }
53 else if (IsEqualGUID(riid, &IID_IDsObjectPicker))
54 {
55 return IClassFactory_CreateInstance(iface, NULL, riid, ppvObj);
56 }
57
58 FIXME("- no interface IID: %s\n", debugstr_guid(riid));
59 return E_NOINTERFACE;
60}
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ OBJSEL_IClassFactory_Release()

static ULONG WINAPI OBJSEL_IClassFactory_Release ( LPCLASSFACTORY  iface)
static

Definition at line 89 of file factory.c.

90{
92 ULONG ref;
93
94 TRACE("\n");
95
96 if (This == NULL) return E_POINTER;
97
99
100 if (ref == 0)
101 {
103 }
104
105 return ref;
106}
#define InterlockedDecrement
Definition: armddk.h:52

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( objsel  )

Variable Documentation

◆ IClassFactory_Vtbl

IClassFactoryVtbl IClassFactory_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI OBJSEL_IClassFactory_QueryInterface(LPCLASSFACTORY iface, REFIID riid, LPVOID *ppvObj)
Definition: factory.c:37
static ULONG WINAPI OBJSEL_IClassFactory_AddRef(LPCLASSFACTORY iface)
Definition: factory.c:66
static HRESULT WINAPI OBJSEL_IClassFactory_LockServer(LPCLASSFACTORY iface, BOOL fLock)
Definition: factory.c:137
static ULONG WINAPI OBJSEL_IClassFactory_Release(LPCLASSFACTORY iface)
Definition: factory.c:89
static HRESULT WINAPI OBJSEL_IClassFactory_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
Definition: factory.c:112

Definition at line 154 of file factory.c.

◆ OBJSEL_ClassFactory

ClassFactoryImpl OBJSEL_ClassFactory = { { &IClassFactory_Vtbl }, 0 }

Definition at line 168 of file factory.c.

Referenced by DllGetClassObject().