Commit 2a51df3b authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

fusion: Handle DWORD-sized string indices when loading the assembly name.

parent 0edab123
......@@ -735,7 +735,7 @@ HRESULT assembly_release(ASSEMBLY *assembly)
return S_OK;
}
static LPSTR assembly_dup_str(ASSEMBLY *assembly, WORD index)
static LPSTR assembly_dup_str(ASSEMBLY *assembly, DWORD index)
{
LPSTR str = (LPSTR)&assembly->strings[index];
LPSTR cpy = HeapAlloc(GetProcessHeap(), 0, strlen(str)+1);
......@@ -746,18 +746,25 @@ static LPSTR assembly_dup_str(ASSEMBLY *assembly, WORD index)
HRESULT assembly_get_name(ASSEMBLY *assembly, LPSTR *name)
{
ASSEMBLYTABLE *asmtbl;
BYTE *ptr;
ULONG offset;
DWORD stridx;
offset = assembly->tables[TableFromToken(mdtAssembly)].offset;
if (offset == -1)
return E_FAIL;
asmtbl = (ASSEMBLYTABLE *)assembly_data_offset(assembly, offset);
if (!asmtbl)
ptr = assembly_data_offset(assembly, offset);
if (!ptr)
return E_FAIL;
*name = assembly_dup_str(assembly, asmtbl->Name);
ptr += FIELD_OFFSET(ASSEMBLYTABLE, PublicKey) + assembly->blobsz;
if (assembly->stringsz == sizeof(DWORD))
stridx = *((DWORD *)ptr);
else
stridx = *((WORD *)ptr);
*name = assembly_dup_str(assembly, stridx);
if (!*name)
return E_OUTOFMEMORY;
......
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