Commit 08cbe5d2 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

fusion: Use the PEKIND type where appropriate.

parent 2ed8056a
......@@ -94,7 +94,7 @@ static BOOL create_full_path(LPCWSTR path)
return ret;
}
static BOOL get_assembly_directory(LPWSTR dir, DWORD size, BYTE architecture)
static BOOL get_assembly_directory(LPWSTR dir, DWORD size, PEKIND architecture)
{
static const WCHAR gac[] = {'\\','a','s','s','e','m','b','l','y','\\','G','A','C',0};
......@@ -107,6 +107,9 @@ static BOOL get_assembly_directory(LPWSTR dir, DWORD size, BYTE architecture)
switch (architecture)
{
case peNone:
break;
case peMSIL:
strcatW(dir, msil);
break;
......@@ -118,6 +121,10 @@ static BOOL get_assembly_directory(LPWSTR dir, DWORD size, BYTE architecture)
case peAMD64:
strcatW(dir, amd64);
break;
default:
WARN("unhandled architecture %u\n", architecture);
return FALSE;
}
return TRUE;
......@@ -372,6 +379,7 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
WCHAR path[MAX_PATH];
WCHAR asmdir[MAX_PATH];
LPWSTR ext;
PEKIND architecture;
HRESULT hr;
TRACE("(%p, %d, %s, %p)\n", iface, dwFlags,
......@@ -410,7 +418,8 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
cache_lock( cache );
get_assembly_directory(asmdir, MAX_PATH, assembly_get_architecture(assembly));
architecture = assembly_get_architecture(assembly);
get_assembly_directory(asmdir, MAX_PATH, architecture);
sprintfW(path, format, asmdir, name, version, token);
......
......@@ -811,10 +811,10 @@ HRESULT assembly_get_version(ASSEMBLY *assembly, LPWSTR *version)
return S_OK;
}
BYTE assembly_get_architecture(ASSEMBLY *assembly)
PEKIND assembly_get_architecture(ASSEMBLY *assembly)
{
if ((assembly->corhdr->MajorRuntimeVersion == 2) && (assembly->corhdr->MinorRuntimeVersion == 0))
return 0; /* .NET 1.x assembly */
return peNone; /* .NET 1.x assembly */
if (assembly->nthdr->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC)
return peAMD64; /* AMD64/IA64 assembly */
......
......@@ -433,7 +433,7 @@ HRESULT assembly_release(ASSEMBLY *assembly) DECLSPEC_HIDDEN;
HRESULT assembly_get_name(ASSEMBLY *assembly, LPWSTR *name) DECLSPEC_HIDDEN;
HRESULT assembly_get_path(const ASSEMBLY *assembly, LPWSTR *path) DECLSPEC_HIDDEN;
HRESULT assembly_get_version(ASSEMBLY *assembly, LPWSTR *version) DECLSPEC_HIDDEN;
BYTE assembly_get_architecture(ASSEMBLY *assembly) DECLSPEC_HIDDEN;
PEKIND assembly_get_architecture(ASSEMBLY *assembly) DECLSPEC_HIDDEN;
HRESULT assembly_get_pubkey_token(ASSEMBLY *assembly, LPWSTR *token) DECLSPEC_HIDDEN;
HRESULT assembly_get_runtime_version(ASSEMBLY *assembly, LPSTR *version) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment