ReactOS 0.4.16-dev-1946-g52006dd
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:3771

Referenced by DllGetClassObject().

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 92 of file main.c.

93{
94 return 2;
95}

◆ ClassFactory_CreateInstance()

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

Definition at line 102 of file main.c.

104{
106 HRESULT ret;
107 IUnknown *obj;
108 TRACE("(%p, %p, %s, %p)\n", iface, pOuter, debugstr_guid(riid), ppv);
109
110 ret = This->cf(pOuter, &obj);
111 if (FAILED(ret))
112 return ret;
113
114 ret = IUnknown_QueryInterface(obj,riid,ppv);
115 IUnknown_Release(obj);
116 return ret;
117}
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:63
return ret
Definition: mutex.c:146
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

◆ ClassFactory_LockServer()

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

Definition at line 119 of file main.c.

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

◆ ClassFactory_QueryInterface()

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

Definition at line 70 of file main.c.

72{
73 *ppv = NULL;
74
76 TRACE("(IID_IUnknown %p)\n", ppv);
77 *ppv = iface;
79 TRACE("IID_IClassFactory %p)\n", ppv);
80 *ppv = iface;
81 }
82
83 if(*ppv) {
84 IUnknown_AddRef((IUnknown*)*ppv);
85 return S_OK;
86 }
87
88 FIXME("(%s %p)\n", debugstr_guid(riid), ppv);
89 return E_NOINTERFACE;
90}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 97 of file main.c.

98{
99 return 1;
100}

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 154 of file main.c.

155{
156 return S_FALSE;
157}
#define S_FALSE
Definition: winerror.h:3451

◆ DllGetClassObject()

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

Definition at line 136 of file main.c.

137{
138 if(IsEqualGUID(&CLSID_CActiveIMM, rclsid)) {
139 static ClassFactory cf = {
140 { &ClassFactoryVtbl },
142 };
143
144 return IClassFactory_QueryInterface(&cf.IClassFactory_iface, riid, ppv);
145 }
146
147 FIXME("(%s %s %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
149}
HRESULT ActiveIMMApp_Constructor(IUnknown *punkOuter, IUnknown **ppOut)
Definition: activeimmapp.c:892
static const IClassFactoryVtbl ClassFactoryVtbl
Definition: main.c:125
IClassFactory IClassFactory_iface
Definition: inetcomm_main.c:76
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772

◆ DllMain()

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

Definition at line 43 of file main.c.

44{
45 switch(fdwReason)
46 {
47#ifndef __REACTOS__
48 case DLL_WINE_PREATTACH:
49 return FALSE; /* prefer native version */
50#endif
52 msimtf_instance = hInstDLL;
54 break;
55 }
56 return TRUE;
57}
static DWORD const fdwReason
#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 162 of file main.c.

163{
165}
HRESULT __wine_register_resources(HMODULE module)
Definition: register.c:112

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 170 of file main.c.

171{
173}
HRESULT __wine_unregister_resources(HMODULE module)
Definition: register.c:124

◆ impl_from_IClassFactory()

static ClassFactory * impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 65 of file main.c.

66{
67 return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface);
68}
#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 125 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().