ReactOS  0.4.15-dev-2956-g61e7ea5
main.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "ole2.h"
#include "rpcproxy.h"
#include "dimm.h"
#include "wine/debug.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

class  ClassFactory
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msimtf)
 
HRESULT ActiveIMMApp_Constructor (IUnknown *punkOuter, IUnknown **ppOut)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
 
static ClassFactoryimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClassFactory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI ClassFactory_Release (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_CreateInstance (IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

static HINSTANCE msimtf_instance
 
static const IClassFactoryVtbl ClassFactoryVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file main.c.

Function Documentation

◆ ActiveIMMApp_Constructor()

HRESULT ActiveIMMApp_Constructor ( IUnknown punkOuter,
IUnknown **  ppOut 
)

Definition at line 892 of file activeimmapp.c.

893 {
895  if (pUnkOuter)
896  return CLASS_E_NOAGGREGATION;
897 
899  if (This == NULL)
900  return E_OUTOFMEMORY;
901 
902  This->IActiveIMMApp_iface.lpVtbl = &ActiveIMMAppVtbl;
903  This->IActiveIMMMessagePumpOwner_iface.lpVtbl = &ActiveIMMMessagePumpOwnerVtbl;
904  This->refCount = 1;
905 
906  TRACE("returning %p\n",This);
907  *ppOut = (IUnknown *)&This->IActiveIMMApp_iface;
908  return S_OK;
909 }
static const IActiveIMMMessagePumpOwnerVtbl ActiveIMMMessagePumpOwnerVtbl
Definition: activeimmapp.c:880
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const IActiveIMMAppVtbl ActiveIMMAppVtbl
Definition: activeimmapp.c:741
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define S_OK
Definition: intsafe.h:52
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134

Referenced by DllGetClassObject().

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 90 of file main.c.

91 {
92  return 2;
93 }

◆ ClassFactory_CreateInstance()

static HRESULT WINAPI ClassFactory_CreateInstance ( IClassFactory iface,
IUnknown pOuter,
REFIID  riid,
void **  ppv 
)
static

Definition at line 100 of file main.c.

102 {
104  HRESULT ret;
105  IUnknown *obj;
106  TRACE("(%p, %p, %s, %p)\n", iface, pOuter, debugstr_guid(riid), ppv);
107 
108  ret = This->cf(pOuter, &obj);
109  if (FAILED(ret))
110  return ret;
111 
112  ret = IUnknown_QueryInterface(obj,riid,ppv);
113  IUnknown_Release(obj);
114  return ret;
115 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
static ClassFactory * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:63
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
int ret

◆ ClassFactory_LockServer()

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

Definition at line 117 of file main.c.

118 {
119  FIXME("(%d)\n", dolock);
120  return S_OK;
121 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define S_OK
Definition: intsafe.h:52

◆ ClassFactory_QueryInterface()

static HRESULT WINAPI ClassFactory_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 68 of file main.c.

70 {
71  *ppv = NULL;
72 
74  TRACE("(IID_IUnknown %p)\n", ppv);
75  *ppv = iface;
76  }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
77  TRACE("IID_IClassFactory %p)\n", ppv);
78  *ppv = iface;
79  }
80 
81  if(*ppv) {
82  IUnknown_AddRef((IUnknown*)*ppv);
83  return S_OK;
84  }
85 
86  FIXME("(%s %p)\n", debugstr_guid(riid), ppv);
87  return E_NOINTERFACE;
88 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#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
const GUID IID_IClassFactory

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 95 of file main.c.

96 {
97  return 1;
98 }

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 152 of file main.c.

153 {
154  return S_FALSE;
155 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 134 of file main.c.

135 {
136  if(IsEqualGUID(&CLSID_CActiveIMM, rclsid)) {
137  static ClassFactory cf = {
138  { &ClassFactoryVtbl },
140  };
141 
142  return IClassFactory_QueryInterface(&cf.IClassFactory_iface, riid, ppv);
143  }
144 
145  FIXME("(%s %s %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
147 }
IClassFactory IClassFactory_iface
Definition: inetcomm_main.c:74
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT ActiveIMMApp_Constructor(IUnknown *punkOuter, IUnknown **ppOut)
Definition: activeimmapp.c:892
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
static const IClassFactoryVtbl ClassFactoryVtbl
Definition: main.c:123
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ DllMain()

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

Definition at line 43 of file main.c.

44 {
45  switch(fdwReason)
46  {
47  case DLL_WINE_PREATTACH:
48  return FALSE; /* prefer native version */
49  case DLL_PROCESS_ATTACH:
50  msimtf_instance = hInstDLL;
51  DisableThreadLibraryCalls(hInstDLL);
52  break;
53  }
54  return TRUE;
55 }
static HINSTANCE msimtf_instance
Definition: main.c:38
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define FALSE
Definition: types.h:117

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 160 of file main.c.

161 {
163 }
static HINSTANCE msimtf_instance
Definition: main.c:38
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 168 of file main.c.

169 {
171 }
static HINSTANCE msimtf_instance
Definition: main.c:38
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ impl_from_IClassFactory()

static ClassFactory* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 63 of file main.c.

64 {
65  return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface);
66 }
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 ClassFactory_CreateInstance().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msimtf  )

Variable Documentation

◆ ClassFactoryVtbl

const IClassFactoryVtbl ClassFactoryVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:117
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pOuter, REFIID riid, void **ppv)
Definition: main.c:100
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: main.c:68
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: main.c:95
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: main.c:90

Definition at line 123 of file main.c.

Referenced by DllGetClassObject().

◆ msimtf_instance

HINSTANCE msimtf_instance
static

Definition at line 38 of file main.c.

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