2 * Implementation of the Fusion API
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"
31 #include "wine/unicode.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(fusion);
35 /******************************************************************
36 * ClearDownloadCache (FUSION.@)
38 HRESULT WINAPI ClearDownloadCache(void)
44 /******************************************************************
45 * CompareAssemblyIdentity (FUSION.@)
47 HRESULT WINAPI CompareAssemblyIdentity(LPCWSTR pwzAssemblyIdentity1, BOOL fUnified1,
48 LPCWSTR pwzAssemblyIdentity2, BOOL fUnified2,
49 BOOL *pfEquivalent, AssemblyComparisonResult *pResult)
51 FIXME("(%s, %d, %s, %d, %p, %p) stub!\n", debugstr_w(pwzAssemblyIdentity1),
52 fUnified1, debugstr_w(pwzAssemblyIdentity2), fUnified2, pfEquivalent, pResult);
57 /******************************************************************
58 * CreateAssemblyEnum (FUSION.@)
60 HRESULT WINAPI CreateAssemblyEnum(IAssemblyEnum **pEnum, IUnknown *pUnkReserved,
61 IAssemblyName *pName, DWORD dwFlags, LPVOID pvReserved)
63 FIXME("(%p, %p, %p, %08x, %p) stub!\n", pEnum, pUnkReserved,
64 pName, dwFlags, pvReserved);
69 /******************************************************************
70 * CreateInstallReferenceEnum (FUSION.@)
72 HRESULT WINAPI CreateInstallReferenceEnum(IInstallReferenceEnum **ppRefEnum,
73 IAssemblyName *pName, DWORD dwFlags,
76 FIXME("(%p, %p, %08x, %p) stub!\n", ppRefEnum, pName, dwFlags, pvReserved);
80 /******************************************************************
81 * GetAssemblyIdentityFromFile (FUSION.@)
83 HRESULT WINAPI GetAssemblyIdentityFromFile(LPCWSTR pwzFilePath, REFIID riid,
84 IUnknown **ppIdentity)
86 FIXME("(%s, %s, %p) stub!\n", debugstr_w(pwzFilePath), debugstr_guid(riid),
92 static HRESULT (WINAPI *pGetCORVersion)(LPWSTR pbuffer, DWORD cchBuffer,
95 static HRESULT get_corversion(LPWSTR version, DWORD size)
101 hmscoree = LoadLibraryA("mscoree.dll");
105 pGetCORVersion = (void *)GetProcAddress(hmscoree, "GetCORVersion");
109 hr = pGetCORVersion(version, size, &len);
111 FreeLibrary(hmscoree);
115 /******************************************************************
116 * GetCachePath (FUSION.@)
118 HRESULT WINAPI GetCachePath(ASM_CACHE_FLAGS dwCacheFlags, LPWSTR pwzCachePath,
121 WCHAR path[MAX_PATH];
122 WCHAR windir[MAX_PATH];
123 WCHAR version[MAX_PATH];
127 static const WCHAR backslash[] = {'\\',0};
128 static const WCHAR assembly[] = {'a','s','s','e','m','b','l','y',0};
129 static const WCHAR gac[] = {'G','A','C',0};
130 static const WCHAR nativeimg[] = {
131 'N','a','t','i','v','e','I','m','a','g','e','s','_',0};
132 static const WCHAR zapfmt[] = {
133 '%','s','\\','%','s','\\','%','s','%','s','_','3','2',0};
135 TRACE("(%08x, %p, %p)\n", dwCacheFlags, pwzCachePath, pcchPath);
140 GetWindowsDirectoryW(windir, MAX_PATH);
141 lstrcpyW(path, windir);
142 lstrcatW(path, backslash);
143 lstrcatW(path, assembly);
145 switch (dwCacheFlags)
149 hr = get_corversion(version, MAX_PATH);
153 sprintfW(path, zapfmt, windir, assembly, nativeimg, version);
159 lstrcatW(path, backslash);
164 case ASM_CACHE_DOWNLOAD:
166 FIXME("Download cache not implemented\n");
171 break; /* already set */
177 len = lstrlenW(path) + 1;
178 if (*pcchPath <= len || !pwzCachePath)
179 hr = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
180 else if (pwzCachePath)
181 lstrcpyW(pwzCachePath, path);