2 * Copyright 2008 James Hawkins
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include "wine/test.h"
30 #include "wine/list.h"
32 static HRESULT (WINAPI
*pCreateAssemblyEnum
)(IAssemblyEnum
**pEnum
,
33 IUnknown
*pUnkReserved
,
35 DWORD dwFlags
, LPVOID pvReserved
);
36 static HRESULT (WINAPI
*pCreateAssemblyNameObject
)(LPASSEMBLYNAME
*ppAssemblyNameObj
,
37 LPCWSTR szAssemblyName
, DWORD dwFlags
,
39 static HRESULT (WINAPI
*pGetCachePath
)(ASM_CACHE_FLAGS dwCacheFlags
,
40 LPWSTR pwzCachePath
, PDWORD pcchPath
);
41 static HRESULT (WINAPI
*pLoadLibraryShim
)(LPCWSTR szDllName
, LPCWSTR szVersion
,
42 LPVOID pvReserved
, HMODULE
*phModDll
);
44 static BOOL
init_functionpointers(void)
50 static const WCHAR szFusion
[] = {'f','u','s','i','o','n','.','d','l','l',0};
52 hmscoree
= LoadLibraryA("mscoree.dll");
55 win_skip("mscoree.dll not available\n");
59 pLoadLibraryShim
= (void *)GetProcAddress(hmscoree
, "LoadLibraryShim");
60 if (!pLoadLibraryShim
)
62 win_skip("LoadLibraryShim not available\n");
63 FreeLibrary(hmscoree
);
67 hr
= pLoadLibraryShim(szFusion
, NULL
, NULL
, &hfusion
);
70 win_skip("fusion.dll not available\n");
71 FreeLibrary(hmscoree
);
75 pCreateAssemblyEnum
= (void *)GetProcAddress(hfusion
, "CreateAssemblyEnum");
76 pCreateAssemblyNameObject
= (void *)GetProcAddress(hfusion
, "CreateAssemblyNameObject");
77 pGetCachePath
= (void *)GetProcAddress(hfusion
, "GetCachePath");
79 if (!pCreateAssemblyEnum
||
80 !pCreateAssemblyNameObject
|| !pGetCachePath
)
82 win_skip("fusion.dll not implemented\n");
86 FreeLibrary(hmscoree
);
90 static inline void to_widechar(LPWSTR dest
, LPCSTR src
)
92 MultiByteToWideChar(CP_ACP
, 0, src
, -1, dest
, MAX_PATH
);
95 static inline void to_multibyte(LPSTR dest
, LPWSTR src
)
97 WideCharToMultiByte(CP_ACP
, 0, src
, -1, dest
, MAX_PATH
, NULL
, NULL
);
100 static BOOL
create_full_path(LPCSTR path
)
106 new_path
= HeapAlloc(GetProcessHeap(), 0, lstrlenA(path
) + 1);
110 lstrcpyA(new_path
, path
);
112 while ((len
= lstrlenA(new_path
)) && new_path
[len
- 1] == '\\')
113 new_path
[len
- 1] = 0;
115 while (!CreateDirectoryA(new_path
, NULL
))
118 DWORD last_error
= GetLastError();
120 if(last_error
== ERROR_ALREADY_EXISTS
)
123 if(last_error
!= ERROR_PATH_NOT_FOUND
)
129 if(!(slash
= strrchr(new_path
, '\\')))
135 len
= slash
- new_path
;
137 if(!create_full_path(new_path
))
143 new_path
[len
] = '\\';
146 HeapFree(GetProcessHeap(), 0, new_path
);
150 static void create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
155 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
156 ok(file
!= INVALID_HANDLE_VALUE
, "Failure to open file %s\n", name
);
157 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
161 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
168 #define create_file(name, size) create_file_data(name, name, size)
170 static void test_CreateAssemblyEnum(void)
173 WCHAR namestr
[MAX_PATH
];
174 IAssemblyEnum
*asmenum
;
175 IAssemblyName
*asmname
;
177 to_widechar(namestr
, "wine");
179 hr
= pCreateAssemblyNameObject(&asmname
, namestr
, CANOF_PARSE_DISPLAY_NAME
, NULL
);
180 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
181 ok(asmname
!= NULL
, "Expected non-NULL asmname\n");
186 /* Crashes on .NET 1.x */
187 hr
= pCreateAssemblyEnum(NULL
, NULL
, asmname
, ASM_CACHE_GAC
, NULL
);
188 ok(hr
== E_INVALIDARG
, "Expected E_INVALIDARG, got %08x\n", hr
);
193 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, NULL
, ASM_CACHE_GAC
, NULL
);
194 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
195 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
197 IAssemblyEnum_Release(asmenum
);
199 /* dwFlags is ASM_CACHE_ROOT */
200 asmenum
= (IAssemblyEnum
*)0xdeadbeef;
201 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, NULL
, ASM_CACHE_ROOT
, NULL
);
202 ok(hr
== E_INVALIDARG
, "Expected E_INVALIDARG, got %08x\n", hr
);
203 ok(asmenum
== (IAssemblyEnum
*)0xdeadbeef,
204 "Expected asmenum to be unchanged, got %p\n", asmenum
);
206 /* invalid dwFlags */
207 asmenum
= (IAssemblyEnum
*)0xdeadbeef;
208 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, NULL
, 0, NULL
);
209 ok(hr
== E_INVALIDARG
, "Expected E_INVALIDARG, got %08x\n", hr
);
210 ok(asmenum
== (IAssemblyEnum
*)0xdeadbeef,
211 "Expected asmenum to be unchanged, got %p\n", asmenum
);
214 typedef struct _tagASMNAME
220 static BOOL
enum_gac_assemblies(struct list
*assemblies
, int depth
, LPSTR path
)
222 WIN32_FIND_DATAA ffd
;
229 static CHAR parent
[MAX_PATH
];
231 sprintf(buf
, "%s\\*", path
);
232 hfind
= FindFirstFileA(buf
, &ffd
);
233 if (hfind
== INVALID_HANDLE_VALUE
)
238 if (!lstrcmpA(ffd
.cFileName
, ".") || !lstrcmpA(ffd
.cFileName
, ".."))
243 lstrcpyA(parent
, ffd
.cFileName
);
247 char culture
[MAX_PATH
];
248 char dll
[MAX_PATH
], exe
[MAX_PATH
];
250 /* Directories with no dll or exe will not be enumerated */
251 sprintf(dll
, "%s\\%s\\%s.dll", path
, ffd
.cFileName
, parent
);
252 sprintf(exe
, "%s\\%s\\%s.exe", path
, ffd
.cFileName
, parent
);
253 if (GetFileAttributesA(dll
) == INVALID_FILE_ATTRIBUTES
&&
254 GetFileAttributesA(exe
) == INVALID_FILE_ATTRIBUTES
)
257 ptr
= strstr(ffd
.cFileName
, "_");
263 lstrcpyA(culture
, ptr
);
264 *strstr(culture
, "_") = '\0';
267 lstrcpyA(culture
, "neutral");
269 ptr
= strchr(ptr
, '_');
271 sprintf(buf
, ", Version=%s, Culture=%s, PublicKeyToken=%s",
272 ffd
.cFileName
, culture
, ptr
);
273 lstrcpyA(disp
, parent
);
276 name
= HeapAlloc(GetProcessHeap(), 0, sizeof(ASMNAME
));
277 name
->data
= HeapAlloc(GetProcessHeap(), 0, lstrlenA(disp
) + 1);
278 lstrcpyA(name
->data
, disp
);
279 list_add_tail(assemblies
, &name
->entry
);
284 sprintf(buf
, "%s\\%s", path
, ffd
.cFileName
);
285 enum_gac_assemblies(assemblies
, depth
+ 1, buf
);
286 } while (FindNextFileA(hfind
, &ffd
) != 0);
292 static void test_enumerate(void)
294 struct list assemblies
= LIST_INIT(assemblies
);
295 struct list
*item
, *cursor
;
296 IAssemblyEnum
*asmenum
;
306 hr
= pGetCachePath(ASM_CACHE_GAC
, buf
, &size
);
307 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
309 to_multibyte(path
, buf
);
310 lstrcatA(path
, "_32");
311 enum_gac_assemblies(&assemblies
, 0, path
);
313 to_multibyte(path
, buf
);
314 lstrcatA(path
, "_64");
315 enum_gac_assemblies(&assemblies
, 0, path
);
317 to_multibyte(path
, buf
);
318 lstrcatA(path
, "_MSIL");
319 enum_gac_assemblies(&assemblies
, 0, path
);
321 to_multibyte(path
, buf
);
322 enum_gac_assemblies(&assemblies
, 0, path
);
325 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, NULL
, ASM_CACHE_GAC
, NULL
);
326 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
327 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
329 while (IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0) == S_OK
)
332 IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
333 to_multibyte(disp
, buf
);
336 LIST_FOR_EACH_SAFE(item
, cursor
, &assemblies
)
338 ASMNAME
*asmname
= LIST_ENTRY(item
, ASMNAME
, entry
);
340 if (!lstrcmpA(asmname
->data
, disp
))
344 list_remove(&asmname
->entry
);
345 HeapFree(GetProcessHeap(), 0, asmname
->data
);
346 HeapFree(GetProcessHeap(), 0, asmname
);
351 ok(found
, "Extra assembly enumerated: %s\n", disp
);
352 IAssemblyName_Release(next
);
355 /* enumeration is exhausted */
356 next
= (IAssemblyName
*)0xdeadbeef;
357 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
358 ok(hr
== S_FALSE
, "Expected S_FALSE, got %08x\n", hr
);
359 ok(next
== (IAssemblyName
*)0xdeadbeef,
360 "Expected next to be unchanged, got %p\n", next
);
362 LIST_FOR_EACH_SAFE(item
, cursor
, &assemblies
)
364 ASMNAME
*asmname
= LIST_ENTRY(item
, ASMNAME
, entry
);
366 ok(FALSE
, "Assembly not enumerated: %s\n", asmname
->data
);
368 list_remove(&asmname
->entry
);
369 HeapFree(GetProcessHeap(), 0, asmname
->data
);
370 HeapFree(GetProcessHeap(), 0, asmname
);
373 IAssemblyEnum_Release(asmenum
);
376 static void test_enumerate_name(void)
378 IAssemblyEnum
*asmenum
;
379 IAssemblyName
*asmname
, *next
;
384 WCHAR namestr
[MAX_PATH
];
385 CHAR exp
[6][MAX_PATH
];
389 lstrcpyA(exp
[0], "wine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=16a3fcd171e93a8d");
390 lstrcpyA(exp
[1], "wine, Version=1.0.1.2, Culture=neutral, PublicKeyToken=123456789abcdef0");
391 lstrcpyA(exp
[2], "wine, Version=1.0.1.2, Culture=neutral, PublicKeyToken=16a3fcd171e93a8d");
392 lstrcpyA(exp
[3], "Wine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=16a3fcd171e93a8d");
393 lstrcpyA(exp
[4], "Wine, Version=1.0.1.2, Culture=neutral, PublicKeyToken=123456789abcdef0");
394 lstrcpyA(exp
[5], "Wine, Version=1.0.1.2, Culture=neutral, PublicKeyToken=16a3fcd171e93a8d");
397 hr
= pGetCachePath(ASM_CACHE_GAC
, buf
, &size
);
398 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
400 to_multibyte(gac
, buf
);
401 create_full_path(gac
);
403 sprintf(path
, "%s\\Wine", gac
);
404 CreateDirectoryA(path
, NULL
);
406 sprintf(path
, "%s\\Wine\\1.0.0.0__16a3fcd171e93a8d", gac
);
407 CreateDirectoryA(path
, NULL
);
409 lstrcatA(path
, "\\Wine.dll");
410 create_file(path
, 100);
412 sprintf(path
, "%s\\Wine\\1.0.1.2__16a3fcd171e93a8d", gac
);
413 CreateDirectoryA(path
, NULL
);
415 lstrcatA(path
, "\\Wine.dll");
416 create_file(path
, 100);
418 sprintf(path
, "%s\\Wine\\1.0.1.2__123456789abcdef0", gac
);
419 CreateDirectoryA(path
, NULL
);
421 lstrcatA(path
, "\\Wine.dll");
422 create_file(path
, 100);
424 /* test case sensitivity */
425 to_widechar(namestr
, "wine");
427 hr
= pCreateAssemblyNameObject(&asmname
, namestr
, CANOF_PARSE_DISPLAY_NAME
, NULL
);
428 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
429 ok(asmname
!= NULL
, "Expected non-NULL asmname\n");
432 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, asmname
, ASM_CACHE_GAC
, NULL
);
433 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
434 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
437 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
438 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
439 ok(next
!= NULL
, "Expected non-NULL next\n");
442 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
443 to_multibyte(disp
, buf
);
444 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
445 ok(!lstrcmpA(disp
, exp
[0]) ||
446 !lstrcmpA(disp
, exp
[1]),
447 "Expected \"%s\" or \"%s\", got \"%s\"\n", exp
[0], exp
[1], disp
);
449 IAssemblyName_Release(next
);
452 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
453 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
454 ok(next
!= NULL
, "Expected non-NULL next\n");
457 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
458 to_multibyte(disp
, buf
);
459 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
460 ok(!lstrcmpA(disp
, exp
[1]) ||
461 !lstrcmpA(disp
, exp
[2]),
462 "Expected \"%s\" or \"%s\", got \"%s\"\n", exp
[1], exp
[2], disp
);
464 IAssemblyName_Release(next
);
467 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
468 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
469 ok(next
!= NULL
, "Expected non-NULL next\n");
472 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
473 to_multibyte(disp
, buf
);
474 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
475 ok(!lstrcmpA(disp
, exp
[2]), "Expected \"%s\", got \"%s\"\n", exp
[2], disp
);
477 IAssemblyName_Release(next
);
479 next
= (IAssemblyName
*)0xdeadbeef;
480 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
481 ok(hr
== S_FALSE
, "Expected S_FALSE, got %08x\n", hr
);
482 ok(next
== (IAssemblyName
*)0xdeadbeef,
483 "Expected next to be unchanged, got %p\n", next
);
485 IAssemblyEnum_Release(asmenum
);
486 IAssemblyName_Release(asmname
);
489 to_widechar(namestr
, "Wine, Version=1.0.1.2");
491 hr
= pCreateAssemblyNameObject(&asmname
, namestr
, CANOF_PARSE_DISPLAY_NAME
, NULL
);
492 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
493 ok(asmname
!= NULL
, "Expected non-NULL asmname\n");
496 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, asmname
, ASM_CACHE_GAC
, NULL
);
497 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
498 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
501 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
502 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
503 ok(next
!= NULL
, "Expected non-NULL next\n");
506 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
507 to_multibyte(disp
, buf
);
508 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
509 ok(!lstrcmpA(disp
, exp
[4]), "Expected \"%s\", got \"%s\"\n", exp
[4], disp
);
511 IAssemblyName_Release(next
);
514 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
515 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
516 ok(next
!= NULL
, "Expected non-NULL next\n");
519 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
520 to_multibyte(disp
, buf
);
521 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
522 ok(!lstrcmpA(disp
, exp
[5]), "Expected \"%s\", got \"%s\"\n", exp
[5], disp
);
524 IAssemblyName_Release(next
);
526 next
= (IAssemblyName
*)0xdeadbeef;
527 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
528 ok(hr
== S_FALSE
, "Expected S_FALSE, got %08x\n", hr
);
529 ok(next
== (IAssemblyName
*)0xdeadbeef,
530 "Expected next to be unchanged, got %p\n", next
);
532 IAssemblyEnum_Release(asmenum
);
533 IAssemblyName_Release(asmname
);
535 /* only PublicKeyToken */
536 to_widechar(namestr
, "Wine, PublicKeyToken=16a3fcd171e93a8d");
538 hr
= pCreateAssemblyNameObject(&asmname
, namestr
, CANOF_PARSE_DISPLAY_NAME
, NULL
);
539 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
540 ok(asmname
!= NULL
, "Expected non-NULL asmname\n");
543 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, asmname
, ASM_CACHE_GAC
, NULL
);
544 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
545 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
548 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
549 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
550 ok(next
!= NULL
, "Expected non-NULL next\n");
553 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
554 to_multibyte(disp
, buf
);
555 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
556 ok(!lstrcmpA(disp
, exp
[3]), "Expected \"%s\", got \"%s\"\n", exp
[3], disp
);
558 IAssemblyName_Release(next
);
561 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
562 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
563 ok(next
!= NULL
, "Expected non-NULL next\n");
566 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
567 to_multibyte(disp
, buf
);
568 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
569 ok(!lstrcmpA(disp
, exp
[5]), "Expected \"%s\", got \"%s\"\n", exp
[5], disp
);
571 IAssemblyName_Release(next
);
573 next
= (IAssemblyName
*)0xdeadbeef;
574 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
575 ok(hr
== S_FALSE
, "Expected S_FALSE, got %08x\n", hr
);
576 ok(next
== (IAssemblyName
*)0xdeadbeef,
577 "Expected next to be unchanged, got %p\n", next
);
579 IAssemblyEnum_Release(asmenum
);
580 IAssemblyName_Release(asmname
);
583 to_widechar(namestr
, "wine, Culture=neutral");
585 hr
= pCreateAssemblyNameObject(&asmname
, namestr
, CANOF_PARSE_DISPLAY_NAME
, NULL
);
586 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
587 ok(asmname
!= NULL
, "Expected non-NULL asmname\n");
590 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, asmname
, ASM_CACHE_GAC
, NULL
);
591 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
592 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
595 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
596 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
597 ok(next
!= NULL
, "Expected non-NULL next\n");
600 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
601 to_multibyte(disp
, buf
);
602 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
603 ok(!lstrcmpA(disp
, exp
[0]), "Expected \"%s\", got \"%s\"\n", exp
[0], disp
);
605 IAssemblyName_Release(next
);
608 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
609 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
610 ok(next
!= NULL
, "Expected non-NULL next\n");
613 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
614 to_multibyte(disp
, buf
);
615 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
616 ok(!lstrcmpA(disp
, exp
[1]) ||
617 !lstrcmpA(disp
, exp
[2]),
618 "Expected \"%s\" or \"%s\", got \"%s\"\n", exp
[1], exp
[2], disp
);
620 IAssemblyName_Release(next
);
623 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
624 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
625 ok(next
!= NULL
, "Expected non-NULL next\n");
628 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
629 to_multibyte(disp
, buf
);
630 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
631 ok(!lstrcmpA(disp
, exp
[1]) ||
632 !lstrcmpA(disp
, exp
[2]),
633 "Expected \"%s\" or \"%s\", got \"%s\"\n", exp
[1], exp
[2], disp
);
635 IAssemblyName_Release(next
);
637 next
= (IAssemblyName
*)0xdeadbeef;
638 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
639 ok(hr
== S_FALSE
, "Expected S_FALSE, got %08x\n", hr
);
640 ok(next
== (IAssemblyName
*)0xdeadbeef,
641 "Expected next to be unchanged, got %p\n", next
);
643 IAssemblyEnum_Release(asmenum
);
644 IAssemblyName_Release(asmname
);
646 sprintf(path
, "%s\\Wine\\1.0.0.0__16a3fcd171e93a8d\\Wine.dll", gac
);
648 sprintf(path
, "%s\\Wine\\1.0.1.2__16a3fcd171e93a8d\\Wine.dll", gac
);
650 sprintf(path
, "%s\\Wine\\1.0.1.2__123456789abcdef0\\Wine.dll", gac
);
652 sprintf(path
, "%s\\Wine\\1.0.0.0__16a3fcd171e93a8d", gac
);
653 RemoveDirectoryA(path
);
654 sprintf(path
, "%s\\Wine\\1.0.1.2__16a3fcd171e93a8d", gac
);
655 RemoveDirectoryA(path
);
656 sprintf(path
, "%s\\Wine\\1.0.1.2__123456789abcdef0", gac
);
657 RemoveDirectoryA(path
);
658 sprintf(path
, "%s\\Wine", gac
);
659 RemoveDirectoryA(path
);
664 if (!init_functionpointers())
667 test_CreateAssemblyEnum();
669 test_enumerate_name();