ReactOS 0.4.16-dev-297-gc569aee
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
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 ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
static const struct object_creation_info object_creation[]
Definition: main.c:74
static const IClassFactoryVtbl DSCF_Vtbl
Definition: main.c:140
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
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define debugstr_guid
Definition: kernel32.h:35
REFCLSID clsid
Definition: msctf.c:82
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define TRACE(s)
Definition: solgame.cpp:4
Definition: main.c:439
IClassFactory IClassFactory_iface
Definition: main.c:440
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllMain()

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

Definition at line 28 of file main.c.

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

◆ 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

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 205 of file main.c.

206{
208}
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}
#define InterlockedIncrement
Definition: armddk.h:53
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:63

◆ 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{
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}
#define E_INVALIDARG
Definition: ddrawi.h:101
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hres
Definition: protocol.c:465
static LPUNKNOWN
Definition: ndr_ole.c:49

◆ 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}

◆ 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 WARN(fmt,...)
Definition: precomp.h:61

◆ 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}
#define InterlockedDecrement
Definition: armddk.h:52
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

◆ 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}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( qedit  )

Variable Documentation

◆ DSCF_Vtbl

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

Definition at line 126 of file main.c.

◆ instance

HINSTANCE instance
static

Definition at line 26 of file main.c.

◆ 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 MediaDet_create(IUnknown *pUnkOuter, LPVOID *ppv)
Definition: mediadet.c:639
HRESULT AMTimeline_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN
Definition: timeline.c:424
HRESULT SampleGrabber_create(IUnknown *pUnkOuter, LPVOID *ppObj) DECLSPEC_HIDDEN

Definition at line 59 of file main.c.