imm32: Semi-stub implement ImmGetConversionList using loaded IME.
[wine/wine64.git] / dlls / fusion / asmcache.c
blob68a8240684b5e0e85de06baebce4fce5a22e4fb5
1 /*
2 * IAssemblyCache implementation
4 * Copyright 2008 James Hawkins
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winuser.h"
28 #include "ole2.h"
29 #include "fusion.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(fusion);
34 /* IAssemblyCache */
36 typedef struct {
37 const IAssemblyCacheVtbl *lpIAssemblyCacheVtbl;
39 LONG ref;
40 } IAssemblyCacheImpl;
42 static HRESULT WINAPI IAssemblyCacheImpl_QueryInterface(IAssemblyCache *iface,
43 REFIID riid, LPVOID *ppobj)
45 IAssemblyCacheImpl *This = (IAssemblyCacheImpl *)iface;
47 TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj);
49 *ppobj = NULL;
51 if (IsEqualIID(riid, &IID_IUnknown) ||
52 IsEqualIID(riid, &IID_IAssemblyCache))
54 IUnknown_AddRef(iface);
55 *ppobj = This;
56 return S_OK;
59 WARN("(%p, %s, %p): not found\n", This, debugstr_guid(riid), ppobj);
60 return E_NOINTERFACE;
63 static ULONG WINAPI IAssemblyCacheImpl_AddRef(IAssemblyCache *iface)
65 IAssemblyCacheImpl *This = (IAssemblyCacheImpl *)iface;
66 ULONG refCount = InterlockedIncrement(&This->ref);
68 TRACE("(%p)->(ref before = %u)\n", This, refCount - 1);
70 return refCount;
73 static ULONG WINAPI IAssemblyCacheImpl_Release(IAssemblyCache *iface)
75 IAssemblyCacheImpl *This = (IAssemblyCacheImpl *)iface;
76 ULONG refCount = InterlockedDecrement(&This->ref);
78 TRACE("(%p)->(ref before = %u)\n", This, refCount + 1);
80 if (!refCount)
81 HeapFree(GetProcessHeap(), 0, This);
83 return refCount;
86 static HRESULT WINAPI IAssemblyCacheImpl_UninstallAssembly(IAssemblyCache *iface,
87 DWORD dwFlags,
88 LPCWSTR pszAssemblyName,
89 LPCFUSION_INSTALL_REFERENCE pRefData,
90 ULONG *pulDisposition)
92 FIXME("(%p, %d, %s, %p, %p) stub!\n", iface, dwFlags,
93 debugstr_w(pszAssemblyName), pRefData, pulDisposition);
95 return E_NOTIMPL;
98 static HRESULT WINAPI IAssemblyCacheImpl_QueryAssemblyInfo(IAssemblyCache *iface,
99 DWORD dwFlags,
100 LPCWSTR pszAssemblyName,
101 ASSEMBLY_INFO *pAsmInfo)
103 FIXME("(%p, %d, %s, %p) stub!\n", iface, dwFlags,
104 debugstr_w(pszAssemblyName), pAsmInfo);
106 return E_NOTIMPL;
109 static HRESULT WINAPI IAssemblyCacheImpl_CreateAssemblyCacheItem(IAssemblyCache *iface,
110 DWORD dwFlags,
111 PVOID pvReserved,
112 IAssemblyCacheItem **ppAsmItem,
113 LPCWSTR pszAssemblyName)
115 FIXME("(%p, %d, %p, %p, %s) stub!\n", iface, dwFlags, pvReserved,
116 ppAsmItem, debugstr_w(pszAssemblyName));
118 return E_NOTIMPL;
121 static HRESULT WINAPI IAssemblyCacheImpl_CreateAssemblyScavenger(IAssemblyCache *iface,
122 IUnknown **ppUnkReserved)
124 FIXME("(%p, %p) stub!\n", iface, ppUnkReserved);
125 return E_NOTIMPL;
128 static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
129 DWORD dwFlags,
130 LPCWSTR pszManifestFilePath,
131 LPCFUSION_INSTALL_REFERENCE pRefData)
133 FIXME("(%p, %d, %s, %p) stub!\n", iface, dwFlags,
134 debugstr_w(pszManifestFilePath), pRefData);
136 return E_NOTIMPL;
139 static const IAssemblyCacheVtbl AssemblyCacheVtbl = {
140 IAssemblyCacheImpl_QueryInterface,
141 IAssemblyCacheImpl_AddRef,
142 IAssemblyCacheImpl_Release,
143 IAssemblyCacheImpl_UninstallAssembly,
144 IAssemblyCacheImpl_QueryAssemblyInfo,
145 IAssemblyCacheImpl_CreateAssemblyCacheItem,
146 IAssemblyCacheImpl_CreateAssemblyScavenger,
147 IAssemblyCacheImpl_InstallAssembly
150 /******************************************************************
151 * CreateAssemblyCache (FUSION.@)
153 HRESULT WINAPI CreateAssemblyCache(IAssemblyCache **ppAsmCache, DWORD dwReserved)
155 IAssemblyCacheImpl *cache;
157 TRACE("(%p, %d)\n", ppAsmCache, dwReserved);
159 if (!ppAsmCache)
160 return E_INVALIDARG;
162 *ppAsmCache = NULL;
164 cache = HeapAlloc(GetProcessHeap(), 0, sizeof(IAssemblyCacheImpl));
165 if (!cache)
166 return E_OUTOFMEMORY;
168 cache->lpIAssemblyCacheVtbl = &AssemblyCacheVtbl;
169 cache->ref = 1;
171 *ppAsmCache = (IAssemblyCache *)cache;
173 return S_OK;
176 /* IAssemblyCacheItem */
178 typedef struct {
179 const IAssemblyCacheItemVtbl *lpIAssemblyCacheItemVtbl;
181 LONG ref;
182 } IAssemblyCacheItemImpl;
184 static HRESULT WINAPI IAssemblyCacheItemImpl_QueryInterface(IAssemblyCacheItem *iface,
185 REFIID riid, LPVOID *ppobj)
187 IAssemblyCacheItemImpl *This = (IAssemblyCacheItemImpl *)iface;
189 TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj);
191 *ppobj = NULL;
193 if (IsEqualIID(riid, &IID_IUnknown) ||
194 IsEqualIID(riid, &IID_IAssemblyCacheItem))
196 IUnknown_AddRef(iface);
197 *ppobj = This;
198 return S_OK;
201 WARN("(%p, %s, %p): not found\n", This, debugstr_guid(riid), ppobj);
202 return E_NOINTERFACE;
205 static ULONG WINAPI IAssemblyCacheItemImpl_AddRef(IAssemblyCacheItem *iface)
207 IAssemblyCacheItemImpl *This = (IAssemblyCacheItemImpl *)iface;
208 ULONG refCount = InterlockedIncrement(&This->ref);
210 TRACE("(%p)->(ref before = %u)\n", This, refCount - 1);
212 return refCount;
215 static ULONG WINAPI IAssemblyCacheItemImpl_Release(IAssemblyCacheItem *iface)
217 IAssemblyCacheItemImpl *This = (IAssemblyCacheItemImpl *)iface;
218 ULONG refCount = InterlockedDecrement(&This->ref);
220 TRACE("(%p)->(ref before = %u)\n", This, refCount + 1);
222 if (!refCount)
223 HeapFree(GetProcessHeap(), 0, This);
225 return refCount;
228 static HRESULT WINAPI IAssemblyCacheItemImpl_CreateStream(IAssemblyCacheItem *iface,
229 DWORD dwFlags,
230 LPCWSTR pszStreamName,
231 DWORD dwFormat,
232 DWORD dwFormatFlags,
233 IStream **ppIStream,
234 ULARGE_INTEGER *puliMaxSize)
236 FIXME("(%p, %d, %s, %d, %d, %p, %p) stub!\n", iface, dwFlags,
237 debugstr_w(pszStreamName), dwFormat, dwFormatFlags, ppIStream, puliMaxSize);
239 return E_NOTIMPL;
242 static HRESULT WINAPI IAssemblyCacheItemImpl_Commit(IAssemblyCacheItem *iface,
243 DWORD dwFlags,
244 ULONG *pulDisposition)
246 FIXME("(%p, %d, %p) stub!\n", iface, dwFlags, pulDisposition);
247 return E_NOTIMPL;
250 static HRESULT WINAPI IAssemblyCacheItemImpl_AbortItem(IAssemblyCacheItem *iface)
252 FIXME("(%p) stub!\n", iface);
253 return E_NOTIMPL;
256 static const IAssemblyCacheItemVtbl AssemblyCacheItemVtbl = {
257 IAssemblyCacheItemImpl_QueryInterface,
258 IAssemblyCacheItemImpl_AddRef,
259 IAssemblyCacheItemImpl_Release,
260 IAssemblyCacheItemImpl_CreateStream,
261 IAssemblyCacheItemImpl_Commit,
262 IAssemblyCacheItemImpl_AbortItem
265 /* IAssemblyEnum */
267 typedef struct {
268 const IAssemblyEnumVtbl *lpIAssemblyEnumVtbl;
270 LONG ref;
271 } IAssemblyEnumImpl;
273 static HRESULT WINAPI IAssemblyEnumImpl_QueryInterface(IAssemblyEnum *iface,
274 REFIID riid, LPVOID *ppobj)
276 IAssemblyEnumImpl *This = (IAssemblyEnumImpl *)iface;
278 TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj);
280 *ppobj = NULL;
282 if (IsEqualIID(riid, &IID_IUnknown) ||
283 IsEqualIID(riid, &IID_IAssemblyEnum))
285 IUnknown_AddRef(iface);
286 *ppobj = This;
287 return S_OK;
290 WARN("(%p, %s, %p): not found\n", This, debugstr_guid(riid), ppobj);
291 return E_NOINTERFACE;
294 static ULONG WINAPI IAssemblyEnumImpl_AddRef(IAssemblyEnum *iface)
296 IAssemblyEnumImpl *This = (IAssemblyEnumImpl *)iface;
297 ULONG refCount = InterlockedIncrement(&This->ref);
299 TRACE("(%p)->(ref before = %u)\n", This, refCount - 1);
301 return refCount;
304 static ULONG WINAPI IAssemblyEnumImpl_Release(IAssemblyEnum *iface)
306 IAssemblyEnumImpl *This = (IAssemblyEnumImpl *)iface;
307 ULONG refCount = InterlockedDecrement(&This->ref);
309 TRACE("(%p)->(ref before = %u)\n", This, refCount + 1);
311 if (!refCount)
312 HeapFree(GetProcessHeap(), 0, This);
314 return refCount;
317 static HRESULT WINAPI IAssemblyEnumImpl_GetNextAssembly(IAssemblyEnum *iface,
318 LPVOID pvReserved,
319 IAssemblyName **ppName,
320 DWORD dwFlags)
322 FIXME("(%p, %p, %p, %d) stub!\n", iface, pvReserved, ppName, dwFlags);
323 return E_NOTIMPL;
326 static HRESULT WINAPI IAssemblyEnumImpl_Reset(IAssemblyEnum *iface)
328 FIXME("(%p) stub!\n", iface);
329 return E_NOTIMPL;
332 static HRESULT WINAPI IAssemblyEnumImpl_Clone(IAssemblyEnum *iface,
333 IAssemblyEnum **ppEnum)
335 FIXME("(%p, %p) stub!\n", iface, ppEnum);
336 return E_NOTIMPL;
339 static const IAssemblyEnumVtbl AssemblyEnumVtbl = {
340 IAssemblyEnumImpl_QueryInterface,
341 IAssemblyEnumImpl_AddRef,
342 IAssemblyEnumImpl_Release,
343 IAssemblyEnumImpl_GetNextAssembly,
344 IAssemblyEnumImpl_Reset,
345 IAssemblyEnumImpl_Clone