d3drm: Avoid LPDIRECT3DRMMESH.
[wine.git] / dlls / msimtf / main.c
blobdaae81757da6f3f22d1290d24a0426e140d422fd
1 /*
2 * Copyright 2007 Jacek Caban for CodeWeavers
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.
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.
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
19 #include "config.h"
21 #include <stdarg.h>
22 #include <stdio.h>
24 #define COBJMACROS
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "winuser.h"
30 #include "ole2.h"
31 #include "rpcproxy.h"
32 #include "dimm.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(msimtf);
38 extern HRESULT ActiveIMMApp_Constructor(IUnknown *punkOuter, IUnknown **ppOut);
40 static HINSTANCE msimtf_instance;
42 /******************************************************************
43 * DllMain (msimtf.@)
45 BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
47 switch(fdwReason)
49 case DLL_WINE_PREATTACH:
50 return FALSE; /* prefer native version */
51 case DLL_PROCESS_ATTACH:
52 msimtf_instance = hInstDLL;
53 DisableThreadLibraryCalls(hInstDLL);
54 break;
56 return TRUE;
59 typedef struct {
60 IClassFactory IClassFactory_iface;
62 HRESULT (*cf)(IUnknown*,IUnknown**);
63 } ClassFactory;
65 static inline ClassFactory *impl_from_IClassFactory(IClassFactory *iface)
67 return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface);
70 static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface,
71 REFIID riid, void **ppv)
73 *ppv = NULL;
75 if(IsEqualGUID(&IID_IUnknown, riid)) {
76 TRACE("(IID_IUnknown %p)\n", ppv);
77 *ppv = iface;
78 }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
79 TRACE("IID_IClassFactory %p)\n", ppv);
80 *ppv = iface;
83 if(*ppv) {
84 IUnknown_AddRef((IUnknown*)*ppv);
85 return S_OK;
88 FIXME("(%s %p)\n", debugstr_guid(riid), ppv);
89 return E_NOINTERFACE;
92 static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
94 return 2;
97 static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
99 return 1;
102 static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface,
103 IUnknown *pOuter, REFIID riid, void **ppv)
105 ClassFactory *This = impl_from_IClassFactory(iface);
106 HRESULT ret;
107 IUnknown *obj;
108 TRACE("(%p, %p, %s, %p)\n", iface, pOuter, debugstr_guid(riid), ppv);
110 ret = This->cf(pOuter, &obj);
111 if (FAILED(ret))
112 return ret;
114 ret = IUnknown_QueryInterface(obj,riid,ppv);
115 IUnknown_Release(obj);
116 return ret;
119 static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
121 FIXME("(%d)\n", dolock);
122 return S_OK;
125 static const IClassFactoryVtbl ClassFactoryVtbl = {
126 ClassFactory_QueryInterface,
127 ClassFactory_AddRef,
128 ClassFactory_Release,
129 ClassFactory_CreateInstance,
130 ClassFactory_LockServer
133 /******************************************************************
134 * DllGetClassObject (msimtf.@)
136 HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
138 if(IsEqualGUID(&CLSID_CActiveIMM, rclsid)) {
139 static ClassFactory cf = {
140 { &ClassFactoryVtbl },
141 ActiveIMMApp_Constructor,
144 return IClassFactory_QueryInterface((IClassFactory*)&cf, riid, ppv);
147 FIXME("(%s %s %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
148 return CLASS_E_CLASSNOTAVAILABLE;
151 /******************************************************************
152 * DllCanUnloadNow (msimtf.@)
154 HRESULT WINAPI DllCanUnloadNow(void)
156 return S_FALSE;
159 /***********************************************************************
160 * DllRegisterServer (msimtf.@)
162 HRESULT WINAPI DllRegisterServer(void)
164 return __wine_register_resources( msimtf_instance );
167 /***********************************************************************
168 * DllUnregisterServer (msimtf.@)
170 HRESULT WINAPI DllUnregisterServer(void)
172 return __wine_unregister_resources( msimtf_instance );