ReactOS 0.4.17-dev-966-gf06eace
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
38typedef struct {
39 IClassFactory IClassFactory_iface;
40
43
45{
46 return CONTAINING_RECORD(iface, ClassFactory, IClassFactory_iface);
47}
48
50 REFIID riid, void **ppv)
51{
52 *ppv = NULL;
53
55 TRACE("(IID_IUnknown %p)\n", ppv);
56 *ppv = iface;
58 TRACE("IID_IClassFactory %p)\n", ppv);
59 *ppv = iface;
60 }
61
62 if(*ppv) {
63 IUnknown_AddRef((IUnknown*)*ppv);
64 return S_OK;
65 }
66
67 FIXME("(%s %p)\n", debugstr_guid(riid), ppv);
68 return E_NOINTERFACE;
69}
70
72{
73 return 2;
74}
75
77{
78 return 1;
79}
80
82 IUnknown *pOuter, REFIID riid, void **ppv)
83{
87 TRACE("(%p, %p, %s, %p)\n", iface, pOuter, debugstr_guid(riid), ppv);
88
89 ret = This->cf(pOuter, &obj);
90 if (FAILED(ret))
91 return ret;
92
93 ret = IUnknown_QueryInterface(obj,riid,ppv);
94 IUnknown_Release(obj);
95 return ret;
96}
97
99{
100 FIXME("(%d)\n", dolock);
101 return S_OK;
102}
103
104static const IClassFactoryVtbl ClassFactoryVtbl = {
110};
111
112/******************************************************************
113 * DllGetClassObject (msimtf.@)
114 */
116{
117 if(IsEqualGUID(&CLSID_CActiveIMM, rclsid)) {
118 static ClassFactory cf = {
119 { &ClassFactoryVtbl },
121 };
122
123 return IClassFactory_QueryInterface(&cf.IClassFactory_iface, riid, ppv);
124 }
125
126 FIXME("(%s %s %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
128}
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define NULL
Definition: types.h:112
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
Definition: main.c:153
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:49
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:890
static const IClassFactoryVtbl ClassFactoryVtbl
Definition: main.c:104
return ret
Definition: mutex.c:147
unsigned int BOOL
Definition: ntddk_ex.h:94
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
#define TRACE(s)
Definition: solgame.cpp:4
IClassFactory IClassFactory_iface
Definition: inetcomm_main.c:69
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:3479
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772