fusion: Fix IAssemblyNameImpl_GetDisplayName behavior on PublicKeyToken containing 0.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2017-11-10 12:25:17 +01:00 committed by Alexandre Julliard
parent d790b160f9
commit a437382f4d
2 changed files with 6 additions and 6 deletions

View file

@ -361,8 +361,8 @@ static HRESULT WINAPI IAssemblyNameImpl_GetDisplayName(IAssemblyName *iface,
if ((dwDisplayFlags & ASM_DISPLAYF_PUBLIC_KEY_TOKEN) && (name->haspubkey))
{
WCHAR pkt[CHARS_PER_PUBKEY + 1];
static const WCHAR spec[] = {'%','0','x','%','0','x','%','0','x',
'%','0','x','%','0','x','%','0','x','%','0','x','%','0','x',0};
static const WCHAR spec[] = {'%','0','2','x','%','0','2','x','%','0','2','x',
'%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x',0};
lstrcatW(szDisplayName, separator);

View file

@ -306,7 +306,7 @@ static const ASMPROP_RES enname[ASM_NAME_MAX_PARAMS] =
static const ASMPROP_RES pubkeyname[ASM_NAME_MAX_PARAMS] =
{
{S_OK, "", 0},
{S_OK, "\x12\x34\x56\x78\x90\xab\xcd\xef", 8},
{S_OK, "\x01\x23\x45\x67\x89\x0a\xbc\xde", 8},
{S_OK, "", 0},
{S_OK, "wine", 10},
{S_OK, "", 0},
@ -748,8 +748,8 @@ static void test_CreateAssemblyNameObject(void)
IAssemblyName_Release(name);
/* 'wine, PublicKeyToken=1234567890abcdef' */
to_widechar(namestr, "wine, PublicKeyToken=1234567890abcdef");
/* 'wine, PublicKeyToken=01234567890abcde' */
to_widechar(namestr, "wine, PublicKeyToken=01234567890abcde");
name = NULL;
hr = pCreateAssemblyNameObject(&name, namestr, CANOF_PARSE_DISPLAY_NAME, NULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
@ -758,7 +758,7 @@ static void test_CreateAssemblyNameObject(void)
size = MAX_PATH;
hr = IAssemblyName_GetDisplayName(name, str, &size, ASM_DISPLAYF_FULL);
ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
ok_aw("wine, PublicKeyToken=1234567890abcdef", str);
ok_aw("wine, PublicKeyToken=01234567890abcde", str);
ok(size == 38, "Expected 38, got %d\n", size);
size = MAX_PATH;