ReactOS 0.4.16-dev-1109-gd06d9f3
main.c
Go to the documentation of this file.
1/*
2 * Copyright 2007 Jacek Caban for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include <stdarg.h>
20#include <stdio.h>
21
22#define COBJMACROS
23
24#include "windef.h"
25#include "winbase.h"
26#include "wingdi.h"
27#include "winuser.h"
28#include "ole2.h"
29#include "rpcproxy.h"
30#include "dimm.h"
31
32#include "wine/debug.h"
33
35
36extern HRESULT ActiveIMMApp_Constructor(IUnknown *punkOuter, IUnknown **ppOut);
37
39
40/******************************************************************
41 * DllMain (msimtf.@)
42 */
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}
58
59typedef struct {
60 IClassFactory IClassFactory_iface;
61
64
66{
67 return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface);
68}
69
71 REFIID riid, void **ppv)
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}
91
93{
94 return 2;
95}
96
98{
99 return 1;
100}
101
103 IUnknown *pOuter, REFIID riid, void **ppv)
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}
118
120{
121 FIXME("(%d)\n", dolock);
122 return S_OK;
123}
124
125static const IClassFactoryVtbl ClassFactoryVtbl = {
131};
132
133/******************************************************************
134 * DllGetClassObject (msimtf.@)
135 */
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}
150
151/******************************************************************
152 * DllCanUnloadNow (msimtf.@)
153 */
155{
156 return S_FALSE;
157}
158
159/***********************************************************************
160 * DllRegisterServer (msimtf.@)
161 */
163{
165}
166
167/***********************************************************************
168 * DllUnregisterServer (msimtf.@)
169 */
171{
173}
static DWORD const fdwReason
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
BOOL NTAPI DllMain(_In_ HINSTANCE hDll, _In_ ULONG dwReason, _In_opt_ PVOID pReserved)
Definition: main.c:33
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT WINAPI DllRegisterServer(void)
Definition: main.c:212
HRESULT WINAPI DllUnregisterServer(void)
Definition: main.c:220
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: main.c:166
HRESULT WINAPI DllCanUnloadNow(void)
Definition: main.c:204
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:63
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
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
HRESULT ActiveIMMApp_Constructor(IUnknown *punkOuter, IUnknown **ppOut)
Definition: activeimmapp.c:892
static const IClassFactoryVtbl ClassFactoryVtbl
Definition: main.c:125
static HINSTANCE msimtf_instance
Definition: main.c:38
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
#define REFCLSID
Definition: guiddef.h:117
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
#define TRACE(s)
Definition: solgame.cpp:4
IClassFactory IClassFactory_iface
Definition: inetcomm_main.c:76
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
int ret
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663