ReactOS  0.4.14-dev-1332-g6db3d88
main.c File Reference
#include "qedit_private.h"
#include "rpcproxy.h"
#include "wine/debug.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  IClassFactoryImpl
 
struct  object_creation_info
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (qedit)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
 
static IClassFactoryImplimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI DSCF_QueryInterface (IClassFactory *iface, REFIID riid, void **ppobj)
 
static ULONG WINAPI DSCF_AddRef (IClassFactory *iface)
 
static ULONG WINAPI DSCF_Release (IClassFactory *iface)
 
static HRESULT WINAPI DSCF_CreateInstance (IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppobj)
 
static HRESULT WINAPI DSCF_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

static HINSTANCE instance
 
static const struct object_creation_info object_creation []
 
static const IClassFactoryVtbl DSCF_Vtbl
 

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 139 of file main.c.

140 {
141  return S_FALSE;
142 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 159 of file main.c.

160 {
161  unsigned int i;
163 
164  TRACE("(%s,%s,%p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
165 
167  && ! IsEqualGUID( &IID_IUnknown, riid) )
168  return E_NOINTERFACE;
169 
170  for (i = 0; i < ARRAY_SIZE(object_creation); i++)
171  {
172  if (IsEqualGUID(object_creation[i].clsid, rclsid))
173  break;
174  }
175 
176  if (i == ARRAY_SIZE(object_creation))
177  {
178  FIXME("%s: no class found.\n", debugstr_guid(rclsid));
180  }
181 
182  factory = CoTaskMemAlloc(sizeof(*factory));
183  if (factory == NULL) return E_OUTOFMEMORY;
184 
186  factory->ref = 1;
187 
188  factory->pfnCreateInstance = object_creation[i].pfnCreateInstance;
189 
191  return S_OK;
192 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: main.c:438
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
static const struct object_creation_info object_creation[]
Definition: main.c:59
#define debugstr_guid
Definition: kernel32.h:35
static const IClassFactoryVtbl DSCF_Vtbl
Definition: main.c:126
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
REFCLSID clsid
Definition: msctf.c:82
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static ClassFactoryImpl factory
Definition: ole_server.c:234
const GUID IID_IClassFactory
IClassFactory IClassFactory_iface
Definition: main.c:440
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
LPVOID  lpv 
)

Definition at line 28 of file main.c.

29 {
30  switch(fdwReason) {
31  case DLL_PROCESS_ATTACH:
32  instance = hInstDLL;
33  DisableThreadLibraryCalls(hInstDLL);
34  break;
35  }
36  return TRUE;
37 }
#define TRUE
Definition: types.h:120
static HINSTANCE instance
Definition: main.c:26
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 197 of file main.c.

198 {
200 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
static HINSTANCE instance
Definition: main.c:26

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 205 of file main.c.

206 {
208 }
static HINSTANCE instance
Definition: main.c:26
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ DSCF_AddRef()

static ULONG WINAPI DSCF_AddRef ( IClassFactory iface)
static

Definition at line 81 of file main.c.

82 {
84  return InterlockedIncrement(&This->ref);
85 }
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:48
#define InterlockedIncrement
Definition: armddk.h:53

◆ DSCF_CreateInstance()

static HRESULT WINAPI DSCF_CreateInstance ( IClassFactory iface,
IUnknown pOuter,
REFIID  riid,
void **  ppobj 
)
static

Definition at line 98 of file main.c.

100 {
102  HRESULT hres;
103  LPUNKNOWN punk;
104 
105  TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
106 
107  *ppobj = NULL;
108  if (pOuter && !IsEqualGUID(&IID_IUnknown, riid))
109  return E_INVALIDARG;
110 
111  hres = This->pfnCreateInstance(pOuter, (LPVOID *) &punk);
112  if (SUCCEEDED(hres)) {
113  hres = IUnknown_QueryInterface(punk, riid, ppobj);
114  IUnknown_Release(punk);
115  }
116  return hres;
117 }
REFIID riid
Definition: precomp.h:44
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:48
static LPUNKNOWN
Definition: ndr_ole.c:49
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
const GUID IID_IUnknown
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ DSCF_LockServer()

static HRESULT WINAPI DSCF_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 119 of file main.c.

120 {
122  FIXME("(%p)->(%d),stub!\n",This,dolock);
123  return S_OK;
124 }
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:48
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59

◆ DSCF_QueryInterface()

static HRESULT WINAPI DSCF_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppobj 
)
static

Definition at line 66 of file main.c.

67 {
70  {
71  IClassFactory_AddRef(iface);
72  *ppobj = iface;
73  return S_OK;
74  }
75 
76  *ppobj = NULL;
77  WARN("(%p)->(%s,%p), not found\n", iface, debugstr_guid(riid), ppobj);
78  return E_NOINTERFACE;
79 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
const GUID IID_IClassFactory

◆ DSCF_Release()

static ULONG WINAPI DSCF_Release ( IClassFactory iface)
static

Definition at line 87 of file main.c.

88 {
91 
92  if (ref == 0)
94 
95  return ref;
96 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:48
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1

◆ impl_from_IClassFactory()

static IClassFactoryImpl* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 48 of file main.c.

49 {
50  return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface);
51 }
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 DSCF_AddRef(), DSCF_CreateInstance(), DSCF_LockServer(), and DSCF_Release().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( qedit  )

Variable Documentation

◆ DSCF_Vtbl

const IClassFactoryVtbl DSCF_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI DSCF_QueryInterface(IClassFactory *iface, REFIID riid, void **ppobj)
Definition: main.c:66
static ULONG WINAPI DSCF_Release(IClassFactory *iface)
Definition: main.c:87
static HRESULT WINAPI DSCF_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppobj)
Definition: main.c:98
static ULONG WINAPI DSCF_AddRef(IClassFactory *iface)
Definition: main.c:81
static HRESULT WINAPI DSCF_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:119

Definition at line 126 of file main.c.

Referenced by DllGetClassObject().

◆ instance

HINSTANCE instance
static

Definition at line 26 of file main.c.

Referenced by DllMain(), DllRegisterServer(), and DllUnregisterServer().

◆ object_creation

const struct object_creation_info object_creation[]
static
Initial value:
=
{
{ &CLSID_AMTimeline, AMTimeline_create },
{ &CLSID_MediaDet, MediaDet_create },
{ &CLSID_SampleGrabber, SampleGrabber_create },
}
HRESULT AMTimeline_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN
Definition: timeline.c:424
HRESULT MediaDet_create(IUnknown *pUnkOuter, LPVOID *ppv)
Definition: mediadet.c:639
HRESULT SampleGrabber_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN

Definition at line 59 of file main.c.

Referenced by DllGetClassObject().