ReactOS 0.4.17-dev-934-g091855f
sti_main.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winerror.h"
#include "objbase.h"
#include "initguid.h"
#include "wia_lh.h"
#include "sti.h"
#include "wine/debug.h"
Include dependency graph for sti_main.c:

Go to the source code of this file.

Classes

struct  sti_cf
 

Macros

#define COBJMACROS
 

Typedefs

typedef HRESULT(* fnCreateInstance) (REFIID riid, IUnknown *pUnkOuter, LPVOID *ppObj)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (sti)
 
HRESULT WINAPI STI_DllGetClassObject (REFCLSID, REFIID, LPVOID *)
 
BOOL WINAPI STI_DllMain (HINSTANCE, DWORD, LPVOID)
 
HRESULT WINAPI STI_DllRegisterServer (void)
 
HRESULT WINAPI STI_DllUnregisterServer (void)
 
static sti_cf * impl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT sti_create (REFIID riid, IUnknown *pUnkOuter, LPVOID *ppObj)
 
static HRESULT WINAPI sti_cf_QueryInterface (IClassFactory *iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI sti_cf_AddRef (IClassFactory *iface)
 
static ULONG WINAPI sti_cf_Release (IClassFactory *iface)
 
static HRESULT WINAPI sti_cf_CreateInstance (IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
 
static HRESULT WINAPI sti_cf_LockServer (IClassFactory *iface, BOOL dolock)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID iid, LPVOID *ppv)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

static const struct IClassFactoryVtbl sti_cf_vtbl
 
static sti_cf the_sti_cf = { { &sti_cf_vtbl }, sti_create }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file sti_main.c.

Typedef Documentation

◆ fnCreateInstance

typedef HRESULT(* fnCreateInstance) (REFIID riid, IUnknown *pUnkOuter, LPVOID *ppObj)

Definition at line 42 of file sti_main.c.

Function Documentation

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  iid,
LPVOID *  ppv 
)

Definition at line 146 of file sti_main.c.

147{
149
150 TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
151
152 if (IsEqualGUID( rclsid, &CLSID_Sti ))
153 {
155 }
156
157 if (cf)
158 return IClassFactory_QueryInterface( cf, iid, ppv );
159 return STI_DllGetClassObject( rclsid, iid, ppv );
160}
#define NULL
Definition: types.h:112
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI STI_DllGetClassObject(REFCLSID, REFIID, LPVOID *)
static sti_cf the_sti_cf
Definition: sti_main.c:134
IClassFactory IClassFactory_iface
Definition: sti_main.c:46

◆ DllMain()

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

Definition at line 136 of file sti_main.c.

137{
138 TRACE("(0x%p, %ld, %p)\n",hInstDLL,fdwReason,lpvReserved);
139
140 return STI_DllMain(hInstDLL, fdwReason, lpvReserved);
141}
static DWORD const fdwReason
static IN DWORD IN LPVOID lpvReserved
BOOL WINAPI STI_DllMain(HINSTANCE, DWORD, LPVOID)

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 165 of file sti_main.c.

166{
167 return STI_DllRegisterServer();
168}
HRESULT WINAPI STI_DllRegisterServer(void)

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 173 of file sti_main.c.

174{
176}
HRESULT WINAPI STI_DllUnregisterServer(void)

◆ impl_from_IClassFactory()

static sti_cf * impl_from_IClassFactory ( IClassFactory *  iface)
inlinestatic

Definition at line 50 of file sti_main.c.

51{
52 return CONTAINING_RECORD(iface, sti_cf, IClassFactory_iface);
53}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by sti_cf_CreateInstance().

◆ sti_cf_AddRef()

static ULONG WINAPI sti_cf_AddRef ( IClassFactory *  iface)
static

Definition at line 86 of file sti_main.c.

87{
88 return 2;
89}

◆ sti_cf_CreateInstance()

static HRESULT WINAPI sti_cf_CreateInstance ( IClassFactory *  iface,
LPUNKNOWN  pOuter,
REFIID  riid,
LPVOID *  ppobj 
)
static

Definition at line 96 of file sti_main.c.

98{
100 HRESULT r;
101 IUnknown *punk;
102
103 TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj);
104
105 *ppobj = NULL;
106
107 r = This->pfnCreateInstance( riid, pOuter, (LPVOID *)&punk );
108 if (FAILED(r))
109 return r;
110
111 r = IUnknown_QueryInterface( punk, riid, ppobj );
112 if (FAILED(r))
113 return r;
114
115 IUnknown_Release( punk );
116 return r;
117}
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
REFIID riid
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
_In_opt_ IUnknown * punk
Definition: shlwapi.h:158
static sti_cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: sti_main.c:50

◆ sti_cf_LockServer()

static HRESULT WINAPI sti_cf_LockServer ( IClassFactory *  iface,
BOOL  dolock 
)
static

Definition at line 119 of file sti_main.c.

120{
121 FIXME("(%p)->(%d)\n", iface, dolock);
122 return S_OK;
123}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define S_OK
Definition: intsafe.h:52

◆ sti_cf_QueryInterface()

static HRESULT WINAPI sti_cf_QueryInterface ( IClassFactory *  iface,
REFIID  riid,
LPVOID *  ppobj 
)
static

Definition at line 73 of file sti_main.c.

74{
77 {
78 IClassFactory_AddRef( iface );
79 *ppobj = iface;
80 return S_OK;
81 }
82 FIXME("interface %s not implemented\n", debugstr_guid(riid));
83 return E_NOINTERFACE;
84}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ sti_cf_Release()

static ULONG WINAPI sti_cf_Release ( IClassFactory *  iface)
static

Definition at line 91 of file sti_main.c.

92{
93 return 1;
94}

◆ sti_create()

static HRESULT sti_create ( REFIID  riid,
IUnknown *  pUnkOuter,
LPVOID *  ppObj 
)
static

Definition at line 55 of file sti_main.c.

56{
57 if (pUnkOuter != NULL && !IsEqualIID(riid, &IID_IUnknown))
59
62 else if (IsEqualGUID(riid, &IID_IStillImageW))
64 else if (IsEqualGUID(riid, &IID_IStillImageA))
66 else
67 {
68 FIXME("no interface %s\n", debugstr_guid(riid));
69 return E_NOINTERFACE;
70 }
71}
#define GetCurrentProcess()
Definition: compat.h:759
HRESULT WINAPI StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, PSTIA *ppSti, LPUNKNOWN pUnkOuter)
Definition: sti.c:311
HRESULT WINAPI StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, PSTIW *ppSti, LPUNKNOWN pUnkOuter)
Definition: sti.c:320
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define STI_VERSION_FLAG_UNICODE
Definition: sti.h:39
struct IStillImageW * PSTIW
Definition: sti.h:50
struct IStillImageA * PSTIA
Definition: sti.h:49
#define STI_VERSION_REAL
Definition: sti.h:38
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:3771

◆ STI_DllGetClassObject()

HRESULT WINAPI STI_DllGetClassObject ( REFCLSID  ,
REFIID  ,
LPVOID *   
)

Referenced by DllGetClassObject().

◆ STI_DllMain()

BOOL WINAPI STI_DllMain ( HINSTANCE  ,
DWORD  ,
LPVOID   
)

Referenced by DllMain().

◆ STI_DllRegisterServer()

HRESULT WINAPI STI_DllRegisterServer ( void  )

Referenced by DllRegisterServer().

◆ STI_DllUnregisterServer()

HRESULT WINAPI STI_DllUnregisterServer ( void  )

Referenced by DllUnregisterServer().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( sti  )

Variable Documentation

◆ sti_cf_vtbl

const struct IClassFactoryVtbl sti_cf_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI sti_cf_AddRef(IClassFactory *iface)
Definition: sti_main.c:86
static HRESULT WINAPI sti_cf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: sti_main.c:73
static HRESULT WINAPI sti_cf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: sti_main.c:119
static HRESULT WINAPI sti_cf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: sti_main.c:96
static ULONG WINAPI sti_cf_Release(IClassFactory *iface)
Definition: sti_main.c:91

Definition at line 125 of file sti_main.c.

◆ the_sti_cf

sti_cf the_sti_cf = { { &sti_cf_vtbl }, sti_create }
static

Definition at line 134 of file sti_main.c.

Referenced by DllGetClassObject().