Commit fdfeb33f authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

fusion: Assembly version must be taken from the metadata, not the file version.

Office 2007 SP1 installer depends on this. I will supply a test as soon as I figure out how to create a variation of the test assembly in dlls/fusion/tests/asmcache.c.
parent 9ae0e899
......@@ -793,45 +793,27 @@ HRESULT assembly_get_path(ASSEMBLY *assembly, LPSTR *path)
HRESULT assembly_get_version(ASSEMBLY *assembly, LPSTR *version)
{
LPSTR verdata;
VS_FIXEDFILEINFO *ffi;
HRESULT hr = S_OK;
DWORD size;
ASSEMBLYTABLE *asmtbl;
LONG offset;
size = GetFileVersionInfoSizeA(assembly->path, NULL);
if (!size)
return HRESULT_FROM_WIN32(GetLastError());
*version = NULL;
verdata = HeapAlloc(GetProcessHeap(), 0, size);
if (!verdata)
return E_OUTOFMEMORY;
if (!GetFileVersionInfoA(assembly->path, 0, size, verdata))
{
hr = HRESULT_FROM_WIN32(GetLastError());
goto done;
}
offset = assembly->tables[TableFromToken(mdtAssembly)].offset;
if (offset == -1)
return E_FAIL;
if (!VerQueryValueA(verdata, "\\", (LPVOID *)&ffi, &size))
{
hr = HRESULT_FROM_WIN32(GetLastError());
goto done;
}
asmtbl = assembly_data_offset(assembly, offset);
if (!asmtbl)
return E_FAIL;
*version = HeapAlloc(GetProcessHeap(), 0, MAX_PATH);
*version = HeapAlloc(GetProcessHeap(), 0, sizeof("%u.%u.%u.%u") + 4 * strlen("65535"));
if (!*version)
{
hr = E_OUTOFMEMORY;
goto done;
}
return E_OUTOFMEMORY;
sprintf(*version, "%d.%d.%d.%d", HIWORD(ffi->dwFileVersionMS),
LOWORD(ffi->dwFileVersionMS), HIWORD(ffi->dwFileVersionLS),
LOWORD(ffi->dwFileVersionLS));
sprintf(*version, "%u.%u.%u.%u", asmtbl->MajorVersion, asmtbl->MinorVersion,
asmtbl->BuildNumber, asmtbl->RevisionNumber);
done:
HeapFree(GetProcessHeap(), 0, verdata);
return hr;
return S_OK;
}
HRESULT assembly_get_architecture(ASSEMBLY *assembly, DWORD fixme)
......
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