3 * Copyright 2011 Alistair Leslie-Hughes
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(mmc
);
36 static HINSTANCE MMC_hInstance
;
38 static HRESULT WINAPI
mmcversion_QueryInterface(IMMCVersionInfo
*iface
, REFIID riid
, void **ppv
)
40 TRACE("(%p)->(%s %p)\n", iface
, debugstr_guid(riid
), ppv
);
42 if ( IsEqualGUID( riid
, &IID_IMMCVersionInfo
) ||
43 IsEqualGUID( riid
, &IID_IUnknown
) )
49 TRACE("Unsupported interface %s\n", debugstr_guid(riid
));
54 IMMCVersionInfo_AddRef(iface
);
58 static ULONG WINAPI
mmcversion_AddRef(IMMCVersionInfo
*iface
)
63 static ULONG WINAPI
mmcversion_Release(IMMCVersionInfo
*iface
)
68 static HRESULT WINAPI
mmcversion_GetMMCVersion(IMMCVersionInfo
*iface
, LONG
*pVersionMajor
, LONG
*pVersionMinor
)
70 TRACE("(%p, %p, %p): stub\n", iface
, pVersionMajor
, pVersionMinor
);
81 static const struct IMMCVersionInfoVtbl mmcversionVtbl
=
83 mmcversion_QueryInterface
,
86 mmcversion_GetMMCVersion
89 static IMMCVersionInfo mmcVersionInfo
= { &mmcversionVtbl
};
91 /***********************************************************
92 * ClassFactory implementation
94 typedef HRESULT (*CreateInstanceFunc
)(IUnknown
*,REFIID
,void**);
96 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFGUID riid
, void **ppvObject
)
98 if(IsEqualGUID(&IID_IClassFactory
, riid
) || IsEqualGUID(&IID_IUnknown
, riid
)) {
99 IClassFactory_AddRef(iface
);
104 WARN("not supported iid %s\n", debugstr_guid(riid
));
106 return E_NOINTERFACE
;
109 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
111 TRACE("(%p)\n", iface
);
115 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
117 TRACE("(%p)\n", iface
);
122 static HRESULT WINAPI
ClassFactory_CreateInstance(IClassFactory
*iface
, IUnknown
*outer
,
123 REFIID riid
, void **ppv
)
125 TRACE("(%p %s %p)\n", outer
, debugstr_guid(riid
), ppv
);
126 return IMMCVersionInfo_QueryInterface(&mmcVersionInfo
, riid
, ppv
);
129 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL fLock
)
131 TRACE("(%p)->(%x)\n", iface
, fLock
);
135 static const IClassFactoryVtbl MMCClassFactoryVtbl
= {
136 ClassFactory_QueryInterface
,
138 ClassFactory_Release
,
139 ClassFactory_CreateInstance
,
140 ClassFactory_LockServer
143 static IClassFactory MMCVersionInfoFactory
= { &MMCClassFactoryVtbl
};
145 HRESULT WINAPI
DllGetClassObject( REFCLSID riid
, REFIID iid
, LPVOID
*ppv
)
147 TRACE("%s %s %p\n", debugstr_guid(riid
), debugstr_guid(iid
), ppv
);
149 if( IsEqualCLSID( riid
, &CLSID_MMCVersionInfo
))
151 TRACE("(CLSID_MMCVersionInfo %s %p)\n", debugstr_guid(riid
), ppv
);
152 return IClassFactory_QueryInterface(&MMCVersionInfoFactory
, iid
, ppv
);
155 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
156 return CLASS_E_CLASSNOTAVAILABLE
;
159 HRESULT WINAPI
DllRegisterServer(void)
161 return __wine_register_resources( MMC_hInstance
);
164 HRESULT WINAPI
DllUnregisterServer(void)
166 return __wine_unregister_resources( MMC_hInstance
);
169 HRESULT WINAPI
DllCanUnloadNow(void)
174 BOOL WINAPI
DllMain(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
176 TRACE("(%p, %d, %p)\n", hinstDLL
, fdwReason
, lpvReserved
);
180 case DLL_WINE_PREATTACH
:
181 return FALSE
; /* prefer native version */
182 case DLL_PROCESS_ATTACH
:
183 MMC_hInstance
= hinstDLL
;