mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-01 09:50:52 +00:00
fusion: Install assemblies into correct directory for architecture.
This commit is contained in:
parent
eb7c206114
commit
c6d34d7b05
3 changed files with 37 additions and 5 deletions
|
@ -91,15 +91,32 @@ static BOOL create_full_path(LPCWSTR path)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static BOOL get_assembly_directory(LPWSTR dir, DWORD size)
|
||||
static BOOL get_assembly_directory(LPWSTR dir, DWORD size, BYTE architecture)
|
||||
{
|
||||
static const WCHAR gac[] =
|
||||
{'\\','a','s','s','e','m','b','l','y','\\','G','A','C','_','M','S','I','L',0};
|
||||
static const WCHAR gac[] = {'\\','a','s','s','e','m','b','l','y','\\','G','A','C',0};
|
||||
|
||||
FIXME("Ignoring assembly architecture\n");
|
||||
static const WCHAR msil[] = {'_','M','S','I','L',0};
|
||||
static const WCHAR x86[] = {'_','3','2',0};
|
||||
static const WCHAR amd64[] = {'_','6','4',0};
|
||||
|
||||
GetWindowsDirectoryW(dir, size);
|
||||
strcatW(dir, gac);
|
||||
|
||||
switch (architecture)
|
||||
{
|
||||
case peMSIL:
|
||||
strcatW(dir, msil);
|
||||
break;
|
||||
|
||||
case peI386:
|
||||
strcatW(dir, x86);
|
||||
break;
|
||||
|
||||
case peAMD64:
|
||||
strcatW(dir, amd64);
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -291,7 +308,7 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
|
|||
if (FAILED(hr))
|
||||
goto done;
|
||||
|
||||
get_assembly_directory(asmdir, MAX_PATH);
|
||||
get_assembly_directory(asmdir, MAX_PATH, assembly_get_architecture(assembly));
|
||||
|
||||
sprintfW(path, format, asmdir, name, version, token);
|
||||
|
||||
|
|
|
@ -811,6 +811,20 @@ HRESULT assembly_get_version(ASSEMBLY *assembly, LPWSTR *version)
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
BYTE assembly_get_architecture(ASSEMBLY *assembly)
|
||||
{
|
||||
if ((assembly->corhdr->MajorRuntimeVersion == 2) && (assembly->corhdr->MinorRuntimeVersion == 0))
|
||||
return 0; /* .NET 1.x assembly */
|
||||
|
||||
if (assembly->nthdr->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
|
||||
return peAMD64; /* AMD64/IA64 assembly */
|
||||
|
||||
if ((assembly->corhdr->Flags & COMIMAGE_FLAGS_ILONLY) && !(assembly->corhdr->Flags & COMIMAGE_FLAGS_32BITREQUIRED))
|
||||
return peMSIL; /* MSIL assembly */
|
||||
|
||||
return peI386; /* x86 assembly */
|
||||
}
|
||||
|
||||
static BYTE *assembly_get_blob(ASSEMBLY *assembly, WORD index, ULONG *size)
|
||||
{
|
||||
return GetData(&assembly->blobs[index], size);
|
||||
|
|
|
@ -433,6 +433,7 @@ HRESULT assembly_release(ASSEMBLY *assembly);
|
|||
HRESULT assembly_get_name(ASSEMBLY *assembly, LPWSTR *name);
|
||||
HRESULT assembly_get_path(ASSEMBLY *assembly, LPWSTR *path);
|
||||
HRESULT assembly_get_version(ASSEMBLY *assembly, LPWSTR *version);
|
||||
BYTE assembly_get_architecture(ASSEMBLY *assembly);
|
||||
HRESULT assembly_get_pubkey_token(ASSEMBLY *assembly, LPWSTR *token);
|
||||
|
||||
static inline LPWSTR strdupW(LPCWSTR src)
|
||||
|
|
Loading…
Reference in a new issue