ReactOS  0.4.15-dev-1397-g19779b3
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.

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (sti)
 
HRESULT WINAPI STI_DllGetClassObject (REFCLSID, REFIID, LPVOID *)
 
static sti_cfimpl_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 DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

 sti_cf
 
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.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 167 of file sti_main.c.

168 {
169  return S_FALSE;
170 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 148 of file sti_main.c.

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

◆ DllMain()

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

Definition at line 136 of file sti_main.c.

137 {
138  TRACE("(0x%p, %d, %p)\n",hInstDLL,fdwReason,lpvReserved);
139 
140  if (fdwReason == DLL_WINE_PREATTACH)
141  return FALSE;
142  return STI_DllMain(hInstDLL, fdwReason, lpvReserved);
143 }
static IN DWORD IN LPVOID lpvReserved
#define FALSE
Definition: types.h:117
#define TRACE(s)
Definition: solgame.cpp:4

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 175 of file sti_main.c.

176 {
177  return STI_DllRegisterServer();
178 }

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 183 of file sti_main.c.

184 {
185  return STI_DllUnregisterServer();
186 }

◆ 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 }
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
sti_cf
Definition: sti_main.c:48

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 }
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
static sti_cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: sti_main.c:50
#define NULL
Definition: types.h:112
sti_cf
Definition: sti_main.c:48

◆ 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: debug.h:111
#define S_OK
Definition: intsafe.h:51

◆ 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 {
75  if (IsEqualGUID(riid, &IID_IUnknown) ||
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 }
#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
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:51
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
const GUID IID_IClassFactory

◆ 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))
58  return CLASS_E_NOAGGREGATION;
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 STI_VERSION_REAL
Definition: sti.h:38
struct IStillImageW * PSTIW
Definition: sti.h:50
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
HRESULT WINAPI StiCreateInstanceA(HINSTANCE hinst, DWORD dwVer, PSTIA *ppSti, LPUNKNOWN pUnkOuter)
Definition: sti.c:320
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define STI_VERSION_FLAG_UNICODE
Definition: sti.h:39
struct IStillImageA * PSTIA
Definition: sti.h:49
const GUID IID_IUnknown
#define GetCurrentProcess()
Definition: compat.h:618
#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
HRESULT WINAPI StiCreateInstanceW(HINSTANCE hinst, DWORD dwVer, PSTIW *ppSti, LPUNKNOWN pUnkOuter)
Definition: sti.c:329
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ STI_DllGetClassObject()

HRESULT WINAPI STI_DllGetClassObject ( REFCLSID  ,
REFIID  ,
LPVOID  
)

Definition at line 37 of file sti_main.c.

45 {
46  IClassFactory IClassFactory_iface;
47  fnCreateInstance pfnCreateInstance;
48 } sti_cf;
HRESULT(* fnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj)
Definition: hnetcfg.c:37
sti_cf
Definition: sti_main.c:48

Referenced by DllGetClassObject().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( sti  )

Variable Documentation

◆ sti_cf

sti_cf

Definition at line 48 of file sti_main.c.

Referenced by impl_from_IClassFactory(), and sti_cf_CreateInstance().

◆ 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 ULONG WINAPI sti_cf_Release(IClassFactory *iface)
Definition: sti_main.c:91
static HRESULT WINAPI sti_cf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj)
Definition: sti_main.c:73
static HRESULT WINAPI sti_cf_CreateInstance(IClassFactory *iface, LPUNKNOWN pOuter, REFIID riid, LPVOID *ppobj)
Definition: sti_main.c:96
static HRESULT WINAPI sti_cf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: sti_main.c:119

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