fusion: Add a "v4.0_" prefix to version 4.0 assembly directories.
Hans Leidekker
hans at codeweavers.com
Wed May 23 02:14:58 CDT 2012
---
dlls/fusion/asmcache.c | 10 ++++++++--
dlls/fusion/asmenum.c | 29 ++++++++++++++++-------------
2 files changed, 24 insertions(+), 15 deletions(-)
diff --git a/dlls/fusion/asmcache.c b/dlls/fusion/asmcache.c
index 93047d4..1cba6f6 100644
--- a/dlls/fusion/asmcache.c
+++ b/dlls/fusion/asmcache.c
@@ -375,7 +375,10 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
LPCWSTR pszManifestFilePath,
LPCFUSION_INSTALL_REFERENCE pRefData)
{
- static const WCHAR format[] = {'%','s','\\','%','s','\\','%','s','_','_','%','s','\\',0};
+ static const WCHAR format[] =
+ {'%','s','\\','%','s','\\','%','s','_','_','%','s','\\',0};
+ static const WCHAR format_v40[] =
+ {'%','s','\\','%','s','\\','v','4','.','0','_','%','s','_','_','%','s','\\',0};
static const WCHAR ext_exe[] = {'.','e','x','e',0};
static const WCHAR ext_dll[] = {'.','d','l','l',0};
IAssemblyCacheImpl *cache = impl_from_IAssemblyCache(iface);
@@ -430,7 +433,10 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
architecture = assembly_get_architecture(assembly);
get_assembly_directory(asmdir, MAX_PATH, clr_version, architecture);
- sprintfW(path, format, asmdir, name, version, token);
+ if (!strcmp(clr_version, "v4.0.30319"))
+ sprintfW(path, format_v40, asmdir, name, version, token);
+ else
+ sprintfW(path, format, asmdir, name, version, token);
create_full_path(path);
diff --git a/dlls/fusion/asmenum.c b/dlls/fusion/asmenum.c
index f4da88a..641ed2f 100644
--- a/dlls/fusion/asmenum.c
+++ b/dlls/fusion/asmenum.c
@@ -291,17 +291,6 @@ static void insert_assembly(struct list *assemblies, ASMNAME *to_insert)
static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name,
int depth, LPWSTR path)
{
- WIN32_FIND_DATAW ffd;
- WCHAR buf[MAX_PATH];
- WCHAR disp[MAX_PATH];
- WCHAR asmpath[MAX_PATH];
- ASMNAME *asmname;
- HANDLE hfind;
- LPWSTR ptr;
- HRESULT hr = S_OK;
-
- static WCHAR parent[MAX_PATH];
-
static const WCHAR dot[] = {'.',0};
static const WCHAR dotdot[] = {'.','.',0};
static const WCHAR search_fmt[] = {'%','s','\\','*',0};
@@ -311,6 +300,14 @@ static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name,
'C','u','l','t','u','r','e','=','n','e','u','t','r','a','l',',',' ',
'P','u','b','l','i','c','K','e','y','T','o','k','e','n','=','%','s',0};
static const WCHAR ss_fmt[] = {'%','s','\\','%','s',0};
+ static const WCHAR v40[] = {'v','4','.','0','_'};
+ WIN32_FIND_DATAW ffd;
+ WCHAR buf[MAX_PATH], disp[MAX_PATH], asmpath[MAX_PATH];
+ static WCHAR parent[MAX_PATH];
+ ASMNAME *asmname;
+ HANDLE hfind;
+ WCHAR *ptr;
+ HRESULT hr = S_OK;
if (name)
parse_name(name, depth, path, buf);
@@ -337,13 +334,19 @@ static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name,
}
else if (depth == 1)
{
+ unsigned int prefix_len = sizeof(v40)/sizeof(WCHAR);
+ const WCHAR *token, *version = ffd.cFileName;
+
sprintfW(asmpath, path_fmt, path, ffd.cFileName, parent);
ptr = strstrW(ffd.cFileName, dblunder);
*ptr = '\0';
- ptr += 2;
+ token = ptr + 2;
+
+ if (strlenW(ffd.cFileName) >= prefix_len &&
+ !memcmp(ffd.cFileName, v40, sizeof(v40))) version += prefix_len;
- sprintfW(disp, fmt, parent, ffd.cFileName, ptr);
+ sprintfW(disp, fmt, parent, version, token);
asmname = HeapAlloc(GetProcessHeap(), 0, sizeof(ASMNAME));
if (!asmname)
--
1.7.10
More information about the wine-patches
mailing list