ReactOS 0.4.15-dev-7961-gdcf9eb0
asmenum.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "ole2.h"
#include "guiddef.h"
#include "fusion.h"
#include "corerror.h"
#include "fusionpriv.h"
#include "wine/debug.h"
#include "wine/list.h"
Include dependency graph for asmenum.c:

Go to the source code of this file.

Classes

struct  _tagASMNAME
 
struct  IAssemblyEnumImpl
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define NONAMELESSSTRUCT
 

Typedefs

typedef struct _tagASMNAME ASMNAME
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (fusion)
 
static IAssemblyEnumImplimpl_from_IAssemblyEnum (IAssemblyEnum *iface)
 
static HRESULT WINAPI IAssemblyEnumImpl_QueryInterface (IAssemblyEnum *iface, REFIID riid, LPVOID *ppobj)
 
static ULONG WINAPI IAssemblyEnumImpl_AddRef (IAssemblyEnum *iface)
 
static ULONG WINAPI IAssemblyEnumImpl_Release (IAssemblyEnum *iface)
 
static HRESULT WINAPI IAssemblyEnumImpl_GetNextAssembly (IAssemblyEnum *iface, LPVOID pvReserved, IAssemblyName **ppName, DWORD dwFlags)
 
static HRESULT WINAPI IAssemblyEnumImpl_Reset (IAssemblyEnum *iface)
 
static HRESULT WINAPI IAssemblyEnumImpl_Clone (IAssemblyEnum *iface, IAssemblyEnum **ppEnum)
 
static void build_file_mask (IAssemblyName *name, int depth, const WCHAR *path, const WCHAR *prefix, WCHAR *buf)
 
static int compare_assembly_names (ASMNAME *asmname1, ASMNAME *asmname2)
 
static void insert_assembly (struct list *assemblies, ASMNAME *to_insert)
 
static HRESULT enum_gac_assemblies (struct list *assemblies, IAssemblyName *name, int depth, const WCHAR *prefix, LPWSTR path)
 
static HRESULT enumerate_gac (IAssemblyEnumImpl *asmenum, IAssemblyName *pName)
 
HRESULT WINAPI CreateAssemblyEnum (IAssemblyEnum **pEnum, IUnknown *pUnkReserved, IAssemblyName *pName, DWORD dwFlags, LPVOID pvReserved)
 

Variables

static const IAssemblyEnumVtbl AssemblyEnumVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 28 of file asmenum.c.

◆ NONAMELESSSTRUCT

#define NONAMELESSSTRUCT

Definition at line 30 of file asmenum.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 29 of file asmenum.c.

Typedef Documentation

◆ ASMNAME

Function Documentation

◆ build_file_mask()

static void build_file_mask ( IAssemblyName name,
int  depth,
const WCHAR path,
const WCHAR prefix,
WCHAR buf 
)
static

Definition at line 173 of file asmenum.c.

175{
176 static const WCHAR star[] = {'*',0};
177 static const WCHAR ss_fmt[] = {'%','s','\\','%','s',0};
178 static const WCHAR sss_fmt[] = {'%','s','\\','%','s','_','_','%','s',0};
179 static const WCHAR ssss_fmt[] = {'%','s','\\','%','s','%','s','_','_','%','s',0};
180 static const WCHAR ver_fmt[] = {'%','u','.','%','u','.','%','u','.','%','u',0};
181 static const WCHAR star_fmt[] = {'%','s','\\','*',0};
182 static const WCHAR star_prefix_fmt[] = {'%','s','\\','%','s','*',0};
183 WCHAR disp[MAX_PATH], version[24]; /* strlen("65535") * 4 + 3 + 1 */
184 LPCWSTR verptr, pubkeyptr;
185 HRESULT hr;
186 DWORD size, major_size, minor_size, build_size, revision_size;
187 WORD major, minor, build, revision;
188 WCHAR token_str[TOKEN_LENGTH + 1];
190
191 if (!name)
192 {
193 if (prefix && depth == 1)
194 swprintf(buf, star_prefix_fmt, path, prefix);
195 else
196 swprintf(buf, star_fmt, path);
197 return;
198 }
199 if (depth == 0)
200 {
201 size = MAX_PATH;
202 *disp = '\0';
203 hr = IAssemblyName_GetName(name, &size, disp);
204 if (SUCCEEDED(hr))
205 swprintf(buf, ss_fmt, path, disp);
206 else
207 swprintf(buf, ss_fmt, path, star);
208 }
209 else if (depth == 1)
210 {
211 major_size = sizeof(major);
212 IAssemblyName_GetProperty(name, ASM_NAME_MAJOR_VERSION, &major, &major_size);
213
214 minor_size = sizeof(minor);
215 IAssemblyName_GetProperty(name, ASM_NAME_MINOR_VERSION, &minor, &minor_size);
216
217 build_size = sizeof(build);
218 IAssemblyName_GetProperty(name, ASM_NAME_BUILD_NUMBER, &build, &build_size);
219
220 revision_size = sizeof(revision);
221 IAssemblyName_GetProperty(name, ASM_NAME_REVISION_NUMBER, &revision, &revision_size);
222
223 if (!major_size || !minor_size || !build_size || !revision_size) verptr = star;
224 else
225 {
226 swprintf(version, ver_fmt, major, minor, build, revision);
227 verptr = version;
228 }
229
230 size = sizeof(token);
231 IAssemblyName_GetProperty(name, ASM_NAME_PUBLIC_KEY_TOKEN, token, &size);
232
233 if (!size) pubkeyptr = star;
234 else
235 {
236 token_to_str(token, token_str);
237 pubkeyptr = token_str;
238 }
239
240 if (prefix)
241 swprintf(buf, ssss_fmt, path, prefix, verptr, pubkeyptr);
242 else
243 swprintf(buf, sss_fmt, path, verptr, pubkeyptr);
244 }
245}
#define MAX_PATH
Definition: compat.h:34
static const WCHAR version[]
Definition: asmname.c:66
#define swprintf
Definition: precomp.h:40
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
#define TOKEN_LENGTH
Definition: fusionpriv.h:468
#define BYTES_PER_TOKEN
Definition: fusionpriv.h:466
static void token_to_str(BYTE *bytes, LPWSTR str)
Definition: fusionpriv.h:470
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928
HRESULT hr
Definition: shlfolder.c:183
Definition: name.c:39
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193

Referenced by enum_gac_assemblies().

◆ compare_assembly_names()

static int compare_assembly_names ( ASMNAME asmname1,
ASMNAME asmname2 
)
static

Definition at line 247 of file asmenum.c.

248{
249 int ret;
250 WORD version1, version2;
252 WCHAR token_str1[TOKEN_LENGTH + 1], token_str2[TOKEN_LENGTH + 1];
253 BYTE token1[BYTES_PER_TOKEN], token2[BYTES_PER_TOKEN];
254 DWORD size, i;
255
256 size = sizeof(name1);
257 IAssemblyName_GetProperty(asmname1->name, ASM_NAME_NAME, name1, &size);
258 size = sizeof(name2);
259 IAssemblyName_GetProperty(asmname2->name, ASM_NAME_NAME, name2, &size);
260
261 if ((ret = wcsicmp(name1, name2))) return ret;
262
263 for (i = ASM_NAME_MAJOR_VERSION; i < ASM_NAME_CULTURE; i++)
264 {
265 size = sizeof(version1);
266 IAssemblyName_GetProperty(asmname1->name, i, &version1, &size);
267 size = sizeof(version2);
268 IAssemblyName_GetProperty(asmname2->name, i, &version2, &size);
269
270 if (version1 < version2) return -1;
271 if (version1 > version2) return 1;
272 }
273
274 /* FIXME: compare cultures */
275
276 size = sizeof(token1);
277 IAssemblyName_GetProperty(asmname1->name, ASM_NAME_PUBLIC_KEY_TOKEN, token1, &size);
278 size = sizeof(token2);
279 IAssemblyName_GetProperty(asmname2->name, ASM_NAME_PUBLIC_KEY_TOKEN, token2, &size);
280
281 token_to_str(token1, token_str1);
282 token_to_str(token2, token_str2);
283
284 if ((ret = wcsicmp(token_str1, token_str2))) return ret;
285
286 return 0;
287}
#define wcsicmp
Definition: compat.h:15
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static WCHAR name1[]
Definition: record.c:34
static WCHAR name2[]
Definition: record.c:35
IAssemblyName * name
Definition: asmenum.c:49
int ret

Referenced by insert_assembly().

◆ CreateAssemblyEnum()

HRESULT WINAPI CreateAssemblyEnum ( IAssemblyEnum **  pEnum,
IUnknown pUnkReserved,
IAssemblyName pName,
DWORD  dwFlags,
LPVOID  pvReserved 
)

Definition at line 468 of file asmenum.c.

470{
471 IAssemblyEnumImpl *asmenum;
472 HRESULT hr;
473
474 TRACE("(%p, %p, %p, %08x, %p)\n", pEnum, pUnkReserved,
476
477 if (!pEnum)
478 return E_INVALIDARG;
479
480 if (dwFlags == 0 || dwFlags == ASM_CACHE_ROOT)
481 return E_INVALIDARG;
482
483 if (!(asmenum = heap_alloc(sizeof(*asmenum)))) return E_OUTOFMEMORY;
484
485 asmenum->IAssemblyEnum_iface.lpVtbl = &AssemblyEnumVtbl;
486 asmenum->ref = 1;
487 list_init(&asmenum->assemblies);
488
490 {
491 hr = enumerate_gac(asmenum, pName);
492 if (FAILED(hr))
493 {
494 heap_free(asmenum);
495 return hr;
496 }
497 }
498
499 asmenum->iter = list_head(&asmenum->assemblies);
500 *pEnum = &asmenum->IAssemblyEnum_iface;
501
502 return S_OK;
503}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
static void list_init(struct list_entry *head)
Definition: list.h:51
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
static const IAssemblyEnumVtbl AssemblyEnumVtbl
Definition: asmenum.c:164
static HRESULT enumerate_gac(IAssemblyEnumImpl *asmenum, IAssemblyName *pName)
Definition: asmenum.c:398
@ ASM_CACHE_ROOT
Definition: fusion.idl:31
@ ASM_CACHE_GAC
Definition: fusion.idl:29
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
static LPSTR pName
Definition: security.c:75
static LPCSTR DWORD void * pvReserved
Definition: str.c:196
static IUnknown * pUnkReserved
Definition: asmenum.c:33
#define TRACE(s)
Definition: solgame.cpp:4
IAssemblyEnum IAssemblyEnum_iface
Definition: asmenum.c:54
struct list assemblies
Definition: asmenum.c:56
struct list * iter
Definition: asmenum.c:57
Definition: list.h:15
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by IAssemblyCacheImpl_QueryAssemblyInfo(), and IAssemblyCacheImpl_UninstallAssembly().

◆ enum_gac_assemblies()

static HRESULT enum_gac_assemblies ( struct list assemblies,
IAssemblyName name,
int  depth,
const WCHAR prefix,
LPWSTR  path 
)
static

Definition at line 307 of file asmenum.c.

309{
310 static const WCHAR dot[] = {'.',0};
311 static const WCHAR dotdot[] = {'.','.',0};
312 static const WCHAR dblunder[] = {'_','_',0};
313 static const WCHAR path_fmt[] = {'%','s','\\','%','s','\\','%','s','.','d','l','l',0};
314 static const WCHAR name_fmt[] = {'%','s',',',' ','V','e','r','s','i','o','n','=','%','s',',',' ',
315 'C','u','l','t','u','r','e','=','n','e','u','t','r','a','l',',',' ',
316 'P','u','b','l','i','c','K','e','y','T','o','k','e','n','=','%','s',0};
317 static const WCHAR ss_fmt[] = {'%','s','\\','%','s',0};
319 WCHAR buf[MAX_PATH], disp[MAX_PATH], asmpath[MAX_PATH], *ptr;
320 static WCHAR parent[MAX_PATH];
321 ASMNAME *asmname;
322 HANDLE hfind;
323 HRESULT hr = S_OK;
324
325 build_file_mask(name, depth, path, prefix, buf);
326 hfind = FindFirstFileW(buf, &ffd);
327 if (hfind == INVALID_HANDLE_VALUE)
328 return S_OK;
329
330 do
331 {
332 if (!lstrcmpW(ffd.cFileName, dot) || !lstrcmpW(ffd.cFileName, dotdot))
333 continue;
334
335 if (depth == 0)
336 {
337 if (name)
338 ptr = wcsrchr(buf, '\\') + 1;
339 else
340 ptr = ffd.cFileName;
341
343 }
344 else if (depth == 1)
345 {
346 const WCHAR *token, *version = ffd.cFileName;
347
348 swprintf(asmpath, path_fmt, path, ffd.cFileName, parent);
349 ptr = wcsstr(ffd.cFileName, dblunder);
350 *ptr = '\0';
351 token = ptr + 2;
352
353 if (prefix)
354 {
355 unsigned int prefix_len = lstrlenW(prefix);
356 if (lstrlenW(ffd.cFileName) >= prefix_len &&
357 !_wcsnicmp(ffd.cFileName, prefix, prefix_len))
358 version += prefix_len;
359 }
360 swprintf(disp, name_fmt, parent, version, token);
361
362 if (!(asmname = heap_alloc(sizeof(*asmname))))
363 {
365 break;
366 }
367
368 hr = CreateAssemblyNameObject(&asmname->name, disp,
370 if (FAILED(hr))
371 {
372 heap_free(asmname);
373 break;
374 }
375
376 hr = IAssemblyName_SetPath(asmname->name, asmpath);
377 if (FAILED(hr))
378 {
379 IAssemblyName_Release(asmname->name);
380 heap_free(asmname);
381 break;
382 }
383
384 insert_assembly(assemblies, asmname);
385 continue;
386 }
387
388 swprintf(buf, ss_fmt, path, ffd.cFileName);
389 hr = enum_gac_assemblies(assemblies, name, depth + 1, prefix, buf);
390 if (FAILED(hr))
391 break;
392 } while (FindNextFileW(hfind, &ffd) != 0);
393
394 FindClose(hfind);
395 return hr;
396}
#define NULL
Definition: types.h:112
#define wcsrchr
Definition: compat.h:16
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
static HRESULT enum_gac_assemblies(struct list *assemblies, IAssemblyName *name, int depth, const WCHAR *prefix, LPWSTR path)
Definition: asmenum.c:307
static void insert_assembly(struct list *assemblies, ASMNAME *to_insert)
Definition: asmenum.c:290
static void build_file_mask(IAssemblyName *name, int depth, const WCHAR *path, const WCHAR *prefix, WCHAR *buf)
Definition: asmenum.c:173
HRESULT IAssemblyName_SetPath(IAssemblyName *iface, LPCWSTR path)
Definition: asmname.c:523
HRESULT WINAPI CreateAssemblyNameObject(IAssemblyName **ppAssemblyNameObj, LPCWSTR szAssemblyName, DWORD dwFlags, LPVOID pvReserved)
Definition: asmname.c:797
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
r parent
Definition: btrfs.c:3010
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static PVOID ptr
Definition: dispmode.c:27
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
@ CANOF_PARSE_DISPLAY_NAME
Definition: winsxs.idl:193

Referenced by enum_gac_assemblies(), enumerate_gac(), and test_enumerate().

◆ enumerate_gac()

static HRESULT enumerate_gac ( IAssemblyEnumImpl asmenum,
IAssemblyName pName 
)
static

Definition at line 398 of file asmenum.c.

399{
400 static const WCHAR gac[] = {'\\','G','A','C',0};
401 static const WCHAR gac_32[] = {'\\','G','A','C','_','3','2',0};
402 static const WCHAR gac_64[] = {'\\','G','A','C','_','6','4',0};
403 static const WCHAR gac_msil[] = {'\\','G','A','C','_','M','S','I','L',0};
404 static const WCHAR v40[] = {'v','4','.','0','_',0};
407 HRESULT hr;
408 DWORD size;
409
410 size = MAX_PATH;
412 if (FAILED(hr))
413 return hr;
414
415 lstrcpyW(path, buf);
417 if (info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
418 {
419 lstrcpyW(path + size - 1, gac_64);
420 hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, v40, path);
421 if (FAILED(hr))
422 return hr;
423 }
424 lstrcpyW(path + size - 1, gac_32);
425 hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, v40, path);
426 if (FAILED(hr))
427 return hr;
428
429 lstrcpyW(path + size - 1, gac_msil);
430 hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, v40, path);
431 if (FAILED(hr))
432 return hr;
433
434 size = MAX_PATH;
436 if (FAILED(hr))
437 return hr;
438
439 lstrcpyW(path, buf);
440 if (info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
441 {
442 lstrcpyW(path + size - 1, gac_64);
443 hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, NULL, path);
444 if (FAILED(hr))
445 return hr;
446 }
447 lstrcpyW(path + size - 1, gac_32);
448 hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, NULL, path);
449 if (FAILED(hr))
450 return hr;
451
452 lstrcpyW(path + size - 1, gac_msil);
453 hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, NULL, path);
454 if (FAILED(hr))
455 return hr;
456
457 lstrcpyW(path + size - 1, gac);
458 hr = enum_gac_assemblies(&asmenum->assemblies, pName, 0, NULL, path);
459 if (FAILED(hr))
460 return hr;
461
462 return S_OK;
463}
HRESULT WINAPI GetCachePath(ASM_CACHE_FLAGS dwCacheFlags, LPWSTR pwzCachePath, PDWORD pcchPath)
Definition: fusion.c:111
VOID WINAPI GetNativeSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:207
@ ASM_CACHE_ROOT_EX
Definition: fusion.idl:32
#define PROCESSOR_ARCHITECTURE_AMD64
Definition: ketypes.h:114

Referenced by CreateAssemblyEnum().

◆ IAssemblyEnumImpl_AddRef()

static ULONG WINAPI IAssemblyEnumImpl_AddRef ( IAssemblyEnum iface)
static

Definition at line 87 of file asmenum.c.

88{
90 ULONG refCount = InterlockedIncrement(&This->ref);
91
92 TRACE("(%p)->(ref before = %u)\n", This, refCount - 1);
93
94 return refCount;
95}
#define InterlockedIncrement
Definition: armddk.h:53
static IAssemblyEnumImpl * impl_from_IAssemblyEnum(IAssemblyEnum *iface)
Definition: asmenum.c:61
uint32_t ULONG
Definition: typedefs.h:59

◆ IAssemblyEnumImpl_Clone()

static HRESULT WINAPI IAssemblyEnumImpl_Clone ( IAssemblyEnum iface,
IAssemblyEnum **  ppEnum 
)
static

Definition at line 157 of file asmenum.c.

159{
160 FIXME("(%p, %p) stub!\n", iface, ppEnum);
161 return E_NOTIMPL;
162}
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IAssemblyEnumImpl_GetNextAssembly()

static HRESULT WINAPI IAssemblyEnumImpl_GetNextAssembly ( IAssemblyEnum iface,
LPVOID  pvReserved,
IAssemblyName **  ppName,
DWORD  dwFlags 
)
static

Definition at line 122 of file asmenum.c.

126{
128 ASMNAME *asmname;
129
130 TRACE("(%p, %p, %p, %d)\n", iface, pvReserved, ppName, dwFlags);
131
132 if (!ppName)
133 return E_INVALIDARG;
134
135 asmname = LIST_ENTRY(asmenum->iter, ASMNAME, entry);
136 if (!asmname)
137 return S_FALSE;
138
139 *ppName = asmname->name;
140 IAssemblyName_AddRef(*ppName);
141
142 asmenum->iter = list_next(&asmenum->assemblies, asmenum->iter);
143
144 return S_OK;
145}
uint32_t entry
Definition: isohybrid.c:63
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115
#define LIST_ENTRY(type)
Definition: queue.h:175
#define S_FALSE
Definition: winerror.h:2357

◆ IAssemblyEnumImpl_QueryInterface()

static HRESULT WINAPI IAssemblyEnumImpl_QueryInterface ( IAssemblyEnum iface,
REFIID  riid,
LPVOID ppobj 
)
static

Definition at line 66 of file asmenum.c.

68{
70
71 TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppobj);
72
73 *ppobj = NULL;
74
76 IsEqualIID(riid, &IID_IAssemblyEnum))
77 {
78 IAssemblyEnum_AddRef(iface);
79 *ppobj = &This->IAssemblyEnum_iface;
80 return S_OK;
81 }
82
83 WARN("(%p, %s, %p): not found\n", This, debugstr_guid(riid), ppobj);
84 return E_NOINTERFACE;
85}
const GUID IID_IUnknown
#define WARN(fmt,...)
Definition: debug.h:112
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ IAssemblyEnumImpl_Release()

static ULONG WINAPI IAssemblyEnumImpl_Release ( IAssemblyEnum iface)
static

Definition at line 97 of file asmenum.c.

98{
100 ULONG refCount = InterlockedDecrement(&This->ref);
101 struct list *item, *cursor;
102
103 TRACE("(%p)->(ref before = %u)\n", This, refCount + 1);
104
105 if (!refCount)
106 {
107 LIST_FOR_EACH_SAFE(item, cursor, &This->assemblies)
108 {
109 ASMNAME *asmname = LIST_ENTRY(item, ASMNAME, entry);
110
111 list_remove(&asmname->entry);
112 IAssemblyName_Release(asmname->name);
113 heap_free(asmname);
114 }
115
117 }
118
119 return refCount;
120}
#define InterlockedDecrement
Definition: armddk.h:52
static void list_remove(struct list_entry *entry)
Definition: list.h:90
Definition: list.h:37
const char cursor[]
Definition: icontest.c:13
static ATOM item
Definition: dde.c:856
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
struct list entry
Definition: asmenum.c:48

◆ IAssemblyEnumImpl_Reset()

static HRESULT WINAPI IAssemblyEnumImpl_Reset ( IAssemblyEnum iface)
static

Definition at line 147 of file asmenum.c.

148{
150
151 TRACE("(%p)\n", iface);
152
153 asmenum->iter = list_head(&asmenum->assemblies);
154 return S_OK;
155}

◆ impl_from_IAssemblyEnum()

static IAssemblyEnumImpl * impl_from_IAssemblyEnum ( IAssemblyEnum iface)
inlinestatic

Definition at line 61 of file asmenum.c.

62{
63 return CONTAINING_RECORD(iface, IAssemblyEnumImpl, IAssemblyEnum_iface);
64}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by IAssemblyEnumImpl_AddRef(), IAssemblyEnumImpl_GetNextAssembly(), IAssemblyEnumImpl_QueryInterface(), IAssemblyEnumImpl_Release(), and IAssemblyEnumImpl_Reset().

◆ insert_assembly()

static void insert_assembly ( struct list assemblies,
ASMNAME to_insert 
)
static

Definition at line 290 of file asmenum.c.

291{
292 struct list *item;
293
294 LIST_FOR_EACH(item, assemblies)
295 {
297
298 if (compare_assembly_names(name, to_insert) > 0)
299 {
300 list_add_before(&name->entry, &to_insert->entry);
301 return;
302 }
303 }
304 list_add_tail(assemblies, &to_insert->entry);
305}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static int compare_assembly_names(ASMNAME *asmname1, ASMNAME *asmname2)
Definition: asmenum.c:247
#define LIST_FOR_EACH(cursor, list)
Definition: list.h:188
__WINE_SERVER_LIST_INLINE void list_add_before(struct list *elem, struct list *to_add)
Definition: list.h:87

Referenced by enum_gac_assemblies().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( fusion  )

Variable Documentation

◆ AssemblyEnumVtbl

const IAssemblyEnumVtbl AssemblyEnumVtbl
static
Initial value:
= {
}
static HRESULT WINAPI IAssemblyEnumImpl_Reset(IAssemblyEnum *iface)
Definition: asmenum.c:147
static ULONG WINAPI IAssemblyEnumImpl_AddRef(IAssemblyEnum *iface)
Definition: asmenum.c:87
static ULONG WINAPI IAssemblyEnumImpl_Release(IAssemblyEnum *iface)
Definition: asmenum.c:97
static HRESULT WINAPI IAssemblyEnumImpl_QueryInterface(IAssemblyEnum *iface, REFIID riid, LPVOID *ppobj)
Definition: asmenum.c:66
static HRESULT WINAPI IAssemblyEnumImpl_Clone(IAssemblyEnum *iface, IAssemblyEnum **ppEnum)
Definition: asmenum.c:157
static HRESULT WINAPI IAssemblyEnumImpl_GetNextAssembly(IAssemblyEnum *iface, LPVOID pvReserved, IAssemblyName **ppName, DWORD dwFlags)
Definition: asmenum.c:122

Definition at line 164 of file asmenum.c.

Referenced by CreateAssemblyEnum().