fusion: Allow null to be the value of the public key
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Thu Jan 31 02:35:01 CST 2013
Hi,
Changelog:
fusion: Allow null to be the value of the public key
Best Regards
Alistair Leslie-Hughes
-------------- next part --------------
>From 647ce793f2dfacb8815696d42fed55b11b88681b Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date: Thu, 31 Jan 2013 16:08:38 +1100
Subject: [PATCH] Allow null to be the value of the public key
To: wine-patches <wine-patches at winehq.org>
---
dlls/fusion/asmname.c | 4 ++++
dlls/fusion/tests/asmcache.c | 15 +++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/dlls/fusion/asmname.c b/dlls/fusion/asmname.c
index 162a76b..2c4b379 100644
--- a/dlls/fusion/asmname.c
+++ b/dlls/fusion/asmname.c
@@ -561,6 +561,10 @@ static HRESULT parse_pubkey(IAssemblyNameImpl *name, LPCWSTR pubkey)
{
int i;
BYTE val;
+ static WCHAR nullstr[] = {'n','u','l','l',0};
+
+ if(lstrcmpiW(pubkey, nullstr) == 0)
+ return S_OK;
if (lstrlenW(pubkey) < CHARS_PER_PUBKEY)
return FUSION_E_INVALID_NAME;
diff --git a/dlls/fusion/tests/asmcache.c b/dlls/fusion/tests/asmcache.c
index e97cfbe..79f8709 100644
--- a/dlls/fusion/tests/asmcache.c
+++ b/dlls/fusion/tests/asmcache.c
@@ -1016,6 +1016,10 @@ static void test_QueryAssemblyInfo(void)
'p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
'2','d','0','3','6','1','7','b','1','c','3','1','e','2','f','5',',',
'c','u','l','t','u','r','e','=','n','e','u','t','r','a','l',0};
+ static const WCHAR nullpublickey[] = {
+ 'm','s','c','o','r','l','i','n',',','v','e','r','s','i','o','n','=','0',
+ 'p','u','b','l','i','c','K','e','y','T','o','k','e','n','=','n','u','l',
+ 'c','u','l','t','u','r','e','=','n','e','u','t','r','a','l',0};
size = MAX_PATH;
hr = pGetCachePath(ASM_CACHE_GAC, asmpath, &size);
@@ -1386,6 +1390,17 @@ static void test_QueryAssemblyInfo(void)
"Assembly path was changed\n");
ok(info.cchBuf == MAX_PATH, "Expected MAX_PATH, got %d\n", info.cchBuf);
+ /* display name is "mscorlib.dll,version=0.0.0.0,publicKeyToken=null,culture=neutral" */
+ INIT_ASM_INFO();
+ lstrcpyW(name, nullpublickey);
+ hr = IAssemblyCache_QueryAssemblyInfo(cache, 0, name, &info);
+ ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
+ "Expected sizeof(ASSEMBLY_INFO), got %d\n", info.cbAssemblyInfo);
+ ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
+ "Expected sizeof(ASSEMBLY_INFO), got %d\n", info.cbAssemblyInfo);
+ ok(info.dwAssemblyFlags == 0,
+ "Expected 0, got %08x\n", info.dwAssemblyFlags);
+
/* display name is "wine, Culture=neutral" */
INIT_ASM_INFO();
lstrcpyW(name, wine);
--
1.7.10.4
More information about the wine-patches
mailing list