Module: wine Branch: master Commit: 0c6ab2464fec5c41a21e1a52d5d10eee5bc0a48f URL: http://source.winehq.org/git/wine.git/?a=commit;h=0c6ab2464fec5c41a21e1a52d5... Author: Hans Leidekker <hans(a)codeweavers.com> Date: Mon May 21 11:25:43 2012 +0200 fusion: Add support for enumerating version 4.0 assemblies. --- dlls/fusion/asmenum.c | 38 ++++++++++++++++++++++++++++---------- 1 files changed, 28 insertions(+), 10 deletions(-) diff --git a/dlls/fusion/asmenum.c b/dlls/fusion/asmenum.c index 52229a8..e4f73e8 100644 --- a/dlls/fusion/asmenum.c +++ b/dlls/fusion/asmenum.c @@ -382,32 +382,50 @@ static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name, static HRESULT enumerate_gac(IAssemblyEnumImpl *asmenum, IAssemblyName *pName) { - WCHAR path[MAX_PATH]; - WCHAR buf[MAX_PATH]; + static const WCHAR gac[] = {'\\','G','A','C',0}; + static const WCHAR gac_32[] = {'\\','G','A','C','_','3','2',0}; + static const WCHAR gac_msil[] = {'\\','G','A','C','_','M','S','I','L',0}; + WCHAR path[MAX_PATH], buf[MAX_PATH]; HRESULT hr; DWORD size; - static WCHAR under32[] = {'_','3','2',0}; - static WCHAR msil[] = {'_','M','S','I','L',0}; + size = MAX_PATH; + hr = GetCachePath(ASM_CACHE_ROOT_EX, buf, &size); + if (FAILED(hr)) + return hr; + + strcpyW(path, buf); + strcpyW(path + size - 1, gac_32); + hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, path); + if (FAILED(hr)) + return hr; + + strcpyW(path, buf); + strcpyW(path + size - 1, gac_msil); + hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, path); + if (FAILED(hr)) + return hr; size = MAX_PATH; - hr = GetCachePath(ASM_CACHE_GAC, buf, &size); + hr = GetCachePath(ASM_CACHE_ROOT, buf, &size); if (FAILED(hr)) return hr; - lstrcpyW(path, buf); - lstrcatW(path, under32); + strcpyW(path, buf); + strcpyW(path + size - 1, gac_32); hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, path); if (FAILED(hr)) return hr; - lstrcpyW(path, buf); - lstrcatW(path, msil); + strcpyW(path, buf); + strcpyW(path + size - 1, gac_msil); hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, path); if (FAILED(hr)) return hr; - hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, buf); + strcpyW(path, buf); + strcpyW(path + size - 1, gac); + hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, path); if (FAILED(hr)) return hr;