ReactOS 0.4.16-dev-257-g6aa11ac
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)
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 IActiveIMMAppVtbl ActiveIMMAppVtbl
Definition: activeimmapp.c:741
static const IActiveIMMMessagePumpOwnerVtbl ActiveIMMMessagePumpOwnerVtbl
Definition: activeimmapp.c:880
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define S_OK
Definition: intsafe.h:52
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

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}
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:63
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
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: precomp.h:53

◆ 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;
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}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ 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}
HRESULT ActiveIMMApp_Constructor(IUnknown *punkOuter, IUnknown **ppOut)
Definition: activeimmapp.c:892
static const IClassFactoryVtbl ClassFactoryVtbl
Definition: main.c:123
IClassFactory IClassFactory_iface
Definition: inetcomm_main.c:74
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ 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 */
50 msimtf_instance = hInstDLL;
52 break;
53 }
54 return TRUE;
55}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
static HINSTANCE msimtf_instance
Definition: main.c:38

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 160 of file main.c.

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

◆ 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:262
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFGUID riid, void **ppvObject)
Definition: main.c:220
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: main.c:241
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: main.c:233
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppvObject)
Definition: main.c:255

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