ReactOS  0.4.15-dev-2961-gecb0c09
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 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by OBJSEL_IClassFactory_AddRef(), and OBJSEL_IClassFactory_Release().

◆ 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 
75  ref = InterlockedIncrement(&This->ref);
76 
77  if (ref == 1)
78  {
80  }
81 
82  return ref;
83 }
DECLSPEC_HIDDEN LONG dll_refs
Definition: devenum_main.c:28
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
static ClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: factory.c:29
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
#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: precomp.h:44
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI OBJSEL_IDsObjectPicker_Create(LPVOID *ppvObj)
Definition: objsel.c:220
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define E_POINTER
Definition: winerror.h:2365

◆ 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 TRACE(s)
Definition: solgame.cpp:4
#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 
46  if (IsEqualGUID(riid, &IID_IUnknown) ||
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 E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define E_POINTER
Definition: winerror.h:2365
const GUID IID_IClassFactory

◆ 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 
98  ref = InterlockedDecrement(&This->ref);
99 
100  if (ref == 0)
101  {
103  }
104 
105  return ref;
106 }
DECLSPEC_HIDDEN LONG dll_refs
Definition: devenum_main.c:28
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
static ClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: factory.c:29
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
#define E_POINTER
Definition: winerror.h:2365

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( objsel  )

Variable Documentation

◆ IClassFactory_Vtbl

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

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().