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
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(fusion);
37 const IAssemblyCacheVtbl *lpIAssemblyCacheVtbl;
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);
51 if (IsEqualIID(riid, &IID_IUnknown) ||
52 IsEqualIID(riid, &IID_IAssemblyCache))
54 IUnknown_AddRef(iface);
59 WARN("(%p, %s, %p): not found\n", This, debugstr_guid(riid), ppobj);
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);
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);
81 HeapFree(GetProcessHeap(), 0, This);
86 static HRESULT WINAPI IAssemblyCacheImpl_UninstallAssembly(IAssemblyCache *iface,
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);
98 static HRESULT WINAPI IAssemblyCacheImpl_QueryAssemblyInfo(IAssemblyCache *iface,
100 LPCWSTR pszAssemblyName,
101 ASSEMBLY_INFO *pAsmInfo)
103 FIXME("(%p, %d, %s, %p) stub!\n", iface, dwFlags,
104 debugstr_w(pszAssemblyName), pAsmInfo);
109 static HRESULT WINAPI IAssemblyCacheImpl_CreateAssemblyCacheItem(IAssemblyCache *iface,
112 IAssemblyCacheItem **ppAsmItem,
113 LPCWSTR pszAssemblyName)
115 FIXME("(%p, %d, %p, %p, %s) stub!\n", iface, dwFlags, pvReserved,
116 ppAsmItem, debugstr_w(pszAssemblyName));
121 static HRESULT WINAPI IAssemblyCacheImpl_CreateAssemblyScavenger(IAssemblyCache *iface,
122 IUnknown **ppUnkReserved)
124 FIXME("(%p, %p) stub!\n", iface, ppUnkReserved);
128 static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
130 LPCWSTR pszManifestFilePath,
131 LPCFUSION_INSTALL_REFERENCE pRefData)
133 FIXME("(%p, %d, %s, %p) stub!\n", iface, dwFlags,
134 debugstr_w(pszManifestFilePath), pRefData);
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);
164 cache = HeapAlloc(GetProcessHeap(), 0, sizeof(IAssemblyCacheImpl));
166 return E_OUTOFMEMORY;
168 cache->lpIAssemblyCacheVtbl = &AssemblyCacheVtbl;
171 *ppAsmCache = (IAssemblyCache *)cache;
176 /* IAssemblyCacheItem */
179 const IAssemblyCacheItemVtbl *lpIAssemblyCacheItemVtbl;
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);
193 if (IsEqualIID(riid, &IID_IUnknown) ||
194 IsEqualIID(riid, &IID_IAssemblyCacheItem))
196 IUnknown_AddRef(iface);
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);
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);
223 HeapFree(GetProcessHeap(), 0, This);
228 static HRESULT WINAPI IAssemblyCacheItemImpl_CreateStream(IAssemblyCacheItem *iface,
230 LPCWSTR pszStreamName,
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);
242 static HRESULT WINAPI IAssemblyCacheItemImpl_Commit(IAssemblyCacheItem *iface,
244 ULONG *pulDisposition)
246 FIXME("(%p, %d, %p) stub!\n", iface, dwFlags, pulDisposition);
250 static HRESULT WINAPI IAssemblyCacheItemImpl_AbortItem(IAssemblyCacheItem *iface)
252 FIXME("(%p) stub!\n", iface);
256 static const IAssemblyCacheItemVtbl AssemblyCacheItemVtbl = {
257 IAssemblyCacheItemImpl_QueryInterface,
258 IAssemblyCacheItemImpl_AddRef,
259 IAssemblyCacheItemImpl_Release,
260 IAssemblyCacheItemImpl_CreateStream,
261 IAssemblyCacheItemImpl_Commit,
262 IAssemblyCacheItemImpl_AbortItem
268 const IAssemblyEnumVtbl *lpIAssemblyEnumVtbl;
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);
282 if (IsEqualIID(riid, &IID_IUnknown) ||
283 IsEqualIID(riid, &IID_IAssemblyEnum))
285 IUnknown_AddRef(iface);
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);
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);
312 HeapFree(GetProcessHeap(), 0, This);
317 static HRESULT WINAPI IAssemblyEnumImpl_GetNextAssembly(IAssemblyEnum *iface,
319 IAssemblyName **ppName,
322 FIXME("(%p, %p, %p, %d) stub!\n", iface, pvReserved, ppName, dwFlags);
326 static HRESULT WINAPI IAssemblyEnumImpl_Reset(IAssemblyEnum *iface)
328 FIXME("(%p) stub!\n", iface);
332 static HRESULT WINAPI IAssemblyEnumImpl_Clone(IAssemblyEnum *iface,
333 IAssemblyEnum **ppEnum)
335 FIXME("(%p, %p) stub!\n", iface, ppEnum);
339 static const IAssemblyEnumVtbl AssemblyEnumVtbl = {
340 IAssemblyEnumImpl_QueryInterface,
341 IAssemblyEnumImpl_AddRef,
342 IAssemblyEnumImpl_Release,
343 IAssemblyEnumImpl_GetNextAssembly,
344 IAssemblyEnumImpl_Reset,
345 IAssemblyEnumImpl_Clone