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
19 #define WIN32_NO_STATUS
21 #define COM_NO_WINDOWS_H
27 //#include <windows.h>
33 //#include <mscoree.h>
35 //#include <corerror.h>
37 #include <wine/test.h>
38 #include <wine/list.h>
40 static HRESULT (WINAPI
*pCreateAssemblyEnum
)(IAssemblyEnum
**pEnum
,
41 IUnknown
*pUnkReserved
,
43 DWORD dwFlags
, LPVOID pvReserved
);
44 static HRESULT (WINAPI
*pCreateAssemblyNameObject
)(LPASSEMBLYNAME
*ppAssemblyNameObj
,
45 LPCWSTR szAssemblyName
, DWORD dwFlags
,
47 static HRESULT (WINAPI
*pGetCachePath
)(ASM_CACHE_FLAGS dwCacheFlags
,
48 LPWSTR pwzCachePath
, PDWORD pcchPath
);
49 static HRESULT (WINAPI
*pLoadLibraryShim
)(LPCWSTR szDllName
, LPCWSTR szVersion
,
50 LPVOID pvReserved
, HMODULE
*phModDll
);
52 static BOOL
init_functionpointers(void)
58 static const WCHAR szFusion
[] = {'f','u','s','i','o','n','.','d','l','l',0};
60 hmscoree
= LoadLibraryA("mscoree.dll");
63 win_skip("mscoree.dll not available\n");
67 pLoadLibraryShim
= (void *)GetProcAddress(hmscoree
, "LoadLibraryShim");
68 if (!pLoadLibraryShim
)
70 win_skip("LoadLibraryShim not available\n");
71 FreeLibrary(hmscoree
);
75 hr
= pLoadLibraryShim(szFusion
, NULL
, NULL
, &hfusion
);
78 win_skip("fusion.dll not available\n");
79 FreeLibrary(hmscoree
);
83 pCreateAssemblyEnum
= (void *)GetProcAddress(hfusion
, "CreateAssemblyEnum");
84 pCreateAssemblyNameObject
= (void *)GetProcAddress(hfusion
, "CreateAssemblyNameObject");
85 pGetCachePath
= (void *)GetProcAddress(hfusion
, "GetCachePath");
87 if (!pCreateAssemblyEnum
||
88 !pCreateAssemblyNameObject
|| !pGetCachePath
)
90 win_skip("fusion.dll not implemented\n");
94 FreeLibrary(hmscoree
);
98 static inline void to_widechar(LPWSTR dest
, LPCSTR src
)
100 MultiByteToWideChar(CP_ACP
, 0, src
, -1, dest
, MAX_PATH
);
103 static inline void to_multibyte(LPSTR dest
, LPWSTR src
)
105 WideCharToMultiByte(CP_ACP
, 0, src
, -1, dest
, MAX_PATH
, NULL
, NULL
);
108 static BOOL
create_full_path(LPCSTR path
)
114 new_path
= HeapAlloc(GetProcessHeap(), 0, lstrlenA(path
) + 1);
118 lstrcpyA(new_path
, path
);
120 while ((len
= lstrlenA(new_path
)) && new_path
[len
- 1] == '\\')
121 new_path
[len
- 1] = 0;
123 while (!CreateDirectoryA(new_path
, NULL
))
126 DWORD last_error
= GetLastError();
128 if(last_error
== ERROR_ALREADY_EXISTS
)
131 if(last_error
!= ERROR_PATH_NOT_FOUND
)
137 if(!(slash
= strrchr(new_path
, '\\')))
143 len
= slash
- new_path
;
145 if(!create_full_path(new_path
))
151 new_path
[len
] = '\\';
154 HeapFree(GetProcessHeap(), 0, new_path
);
158 static BOOL
create_file_data(LPCSTR name
, LPCSTR data
, DWORD size
)
163 file
= CreateFileA(name
, GENERIC_WRITE
, 0, NULL
, CREATE_ALWAYS
, 0, NULL
);
164 if (file
== INVALID_HANDLE_VALUE
)
167 WriteFile(file
, data
, strlen(data
), &written
, NULL
);
171 SetFilePointer(file
, size
, NULL
, FILE_BEGIN
);
179 static void test_CreateAssemblyEnum(void)
182 WCHAR namestr
[MAX_PATH
];
183 IAssemblyEnum
*asmenum
;
184 IAssemblyName
*asmname
;
186 to_widechar(namestr
, "wine");
188 hr
= pCreateAssemblyNameObject(&asmname
, namestr
, CANOF_PARSE_DISPLAY_NAME
, NULL
);
189 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
190 ok(asmname
!= NULL
, "Expected non-NULL asmname\n");
195 /* Crashes on .NET 1.x */
196 hr
= pCreateAssemblyEnum(NULL
, NULL
, asmname
, ASM_CACHE_GAC
, NULL
);
197 ok(hr
== E_INVALIDARG
, "Expected E_INVALIDARG, got %08x\n", hr
);
202 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, NULL
, ASM_CACHE_GAC
, NULL
);
203 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
204 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
206 IAssemblyEnum_Release(asmenum
);
208 /* dwFlags is ASM_CACHE_ROOT */
209 asmenum
= (IAssemblyEnum
*)0xdeadbeef;
210 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, NULL
, ASM_CACHE_ROOT
, NULL
);
211 ok(hr
== E_INVALIDARG
, "Expected E_INVALIDARG, got %08x\n", hr
);
212 ok(asmenum
== (IAssemblyEnum
*)0xdeadbeef,
213 "Expected asmenum to be unchanged, got %p\n", asmenum
);
215 /* invalid dwFlags */
216 asmenum
= (IAssemblyEnum
*)0xdeadbeef;
217 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, NULL
, 0, NULL
);
218 ok(hr
== E_INVALIDARG
, "Expected E_INVALIDARG, got %08x\n", hr
);
219 ok(asmenum
== (IAssemblyEnum
*)0xdeadbeef,
220 "Expected asmenum to be unchanged, got %p\n", asmenum
);
222 IAssemblyName_Release(asmname
);
225 typedef struct _tagASMNAME
231 static BOOL
enum_gac_assemblies(struct list
*assemblies
, int depth
, LPSTR path
)
233 WIN32_FIND_DATAA ffd
;
240 static CHAR parent
[MAX_PATH
];
242 sprintf(buf
, "%s\\*", path
);
243 hfind
= FindFirstFileA(buf
, &ffd
);
244 if (hfind
== INVALID_HANDLE_VALUE
)
249 if (!lstrcmpA(ffd
.cFileName
, ".") || !lstrcmpA(ffd
.cFileName
, ".."))
254 lstrcpyA(parent
, ffd
.cFileName
);
258 char culture
[MAX_PATH
];
259 char dll
[MAX_PATH
], exe
[MAX_PATH
];
261 /* Directories with no dll or exe will not be enumerated */
262 sprintf(dll
, "%s\\%s\\%s.dll", path
, ffd
.cFileName
, parent
);
263 sprintf(exe
, "%s\\%s\\%s.exe", path
, ffd
.cFileName
, parent
);
264 if (GetFileAttributesA(dll
) == INVALID_FILE_ATTRIBUTES
&&
265 GetFileAttributesA(exe
) == INVALID_FILE_ATTRIBUTES
)
268 ptr
= strstr(ffd
.cFileName
, "_");
274 lstrcpyA(culture
, ptr
);
275 *strstr(culture
, "_") = '\0';
278 lstrcpyA(culture
, "neutral");
280 ptr
= strchr(ptr
, '_');
282 sprintf(buf
, ", Version=%s, Culture=%s, PublicKeyToken=%s",
283 ffd
.cFileName
, culture
, ptr
);
284 lstrcpyA(disp
, parent
);
287 name
= HeapAlloc(GetProcessHeap(), 0, sizeof(ASMNAME
));
288 name
->data
= HeapAlloc(GetProcessHeap(), 0, lstrlenA(disp
) + 1);
289 lstrcpyA(name
->data
, disp
);
290 list_add_tail(assemblies
, &name
->entry
);
295 sprintf(buf
, "%s\\%s", path
, ffd
.cFileName
);
296 enum_gac_assemblies(assemblies
, depth
+ 1, buf
);
297 } while (FindNextFileA(hfind
, &ffd
) != 0);
303 static void test_enumerate(void)
305 struct list assemblies
= LIST_INIT(assemblies
);
306 struct list
*item
, *cursor
;
307 IAssemblyEnum
*asmenum
;
317 hr
= pGetCachePath(ASM_CACHE_GAC
, buf
, &size
);
318 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
320 to_multibyte(path
, buf
);
321 lstrcatA(path
, "_32");
322 enum_gac_assemblies(&assemblies
, 0, path
);
324 to_multibyte(path
, buf
);
325 lstrcatA(path
, "_64");
326 enum_gac_assemblies(&assemblies
, 0, path
);
328 to_multibyte(path
, buf
);
329 lstrcatA(path
, "_MSIL");
330 enum_gac_assemblies(&assemblies
, 0, path
);
332 to_multibyte(path
, buf
);
333 enum_gac_assemblies(&assemblies
, 0, path
);
336 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, NULL
, ASM_CACHE_GAC
, NULL
);
337 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
338 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
340 while (IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0) == S_OK
)
343 IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
344 to_multibyte(disp
, buf
);
347 LIST_FOR_EACH_SAFE(item
, cursor
, &assemblies
)
349 ASMNAME
*asmname
= LIST_ENTRY(item
, ASMNAME
, entry
);
351 if (!lstrcmpA(asmname
->data
, disp
))
355 list_remove(&asmname
->entry
);
356 HeapFree(GetProcessHeap(), 0, asmname
->data
);
357 HeapFree(GetProcessHeap(), 0, asmname
);
362 ok(found
, "Extra assembly enumerated: %s\n", disp
);
363 IAssemblyName_Release(next
);
366 /* enumeration is exhausted */
367 next
= (IAssemblyName
*)0xdeadbeef;
368 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
369 ok(hr
== S_FALSE
, "Expected S_FALSE, got %08x\n", hr
);
370 ok(next
== (IAssemblyName
*)0xdeadbeef,
371 "Expected next to be unchanged, got %p\n", next
);
373 LIST_FOR_EACH_SAFE(item
, cursor
, &assemblies
)
375 ASMNAME
*asmname
= LIST_ENTRY(item
, ASMNAME
, entry
);
377 ok(FALSE
, "Assembly not enumerated: %s\n", asmname
->data
);
379 list_remove(&asmname
->entry
);
380 HeapFree(GetProcessHeap(), 0, asmname
->data
);
381 HeapFree(GetProcessHeap(), 0, asmname
);
384 IAssemblyEnum_Release(asmenum
);
387 static void test_enumerate_name(void)
389 IAssemblyEnum
*asmenum
;
390 IAssemblyName
*asmname
, *next
;
395 WCHAR namestr
[MAX_PATH
];
396 CHAR exp
[6][MAX_PATH
];
400 lstrcpyA(exp
[0], "wine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=16a3fcd171e93a8d");
401 lstrcpyA(exp
[1], "wine, Version=1.0.1.2, Culture=neutral, PublicKeyToken=123456789abcdef0");
402 lstrcpyA(exp
[2], "wine, Version=1.0.1.2, Culture=neutral, PublicKeyToken=16a3fcd171e93a8d");
403 lstrcpyA(exp
[3], "Wine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=16a3fcd171e93a8d");
404 lstrcpyA(exp
[4], "Wine, Version=1.0.1.2, Culture=neutral, PublicKeyToken=123456789abcdef0");
405 lstrcpyA(exp
[5], "Wine, Version=1.0.1.2, Culture=neutral, PublicKeyToken=16a3fcd171e93a8d");
408 hr
= pGetCachePath(ASM_CACHE_GAC
, buf
, &size
);
409 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
411 to_multibyte(gac
, buf
);
412 create_full_path(gac
);
414 sprintf(path
, "%s\\Wine", gac
);
415 CreateDirectoryA(path
, NULL
);
417 sprintf(path
, "%s\\Wine\\1.0.0.0__16a3fcd171e93a8d", gac
);
418 CreateDirectoryA(path
, NULL
);
420 lstrcatA(path
, "\\Wine.dll");
421 if (!create_file_data(path
, path
, 100))
423 win_skip("Failed to open file %s, skipping name enumeration tests\n", path
);
427 sprintf(path
, "%s\\Wine\\1.0.1.2__16a3fcd171e93a8d", gac
);
428 CreateDirectoryA(path
, NULL
);
430 lstrcatA(path
, "\\Wine.dll");
431 if (!create_file_data(path
, path
, 100))
433 win_skip("Failed to open file %s, skipping name enumeration tests\n", path
);
437 sprintf(path
, "%s\\Wine\\1.0.1.2__123456789abcdef0", gac
);
438 CreateDirectoryA(path
, NULL
);
440 lstrcatA(path
, "\\Wine.dll");
441 if (!create_file_data(path
, path
, 100))
443 win_skip("Failed to open file %s, skipping name enumeration tests\n", path
);
447 /* test case sensitivity */
448 to_widechar(namestr
, "wine");
450 hr
= pCreateAssemblyNameObject(&asmname
, namestr
, CANOF_PARSE_DISPLAY_NAME
, NULL
);
451 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
452 ok(asmname
!= NULL
, "Expected non-NULL asmname\n");
455 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, asmname
, ASM_CACHE_GAC
, NULL
);
456 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
457 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
460 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
461 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
462 ok(next
!= NULL
, "Expected non-NULL next\n");
465 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
466 to_multibyte(disp
, buf
);
467 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
468 ok(!lstrcmpA(disp
, exp
[0]),
469 "Expected \"%s\" or \"%s\", got \"%s\"\n", exp
[0], exp
[1], disp
);
471 IAssemblyName_Release(next
);
474 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
475 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
476 ok(next
!= NULL
, "Expected non-NULL next\n");
479 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
480 to_multibyte(disp
, buf
);
481 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
482 ok(!lstrcmpA(disp
, exp
[1]) ||
483 !lstrcmpA(disp
, exp
[2]), /* Win98 */
484 "Expected \"%s\" or \"%s\", got \"%s\"\n", exp
[1], exp
[2], disp
);
486 IAssemblyName_Release(next
);
489 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
490 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
491 ok(next
!= NULL
, "Expected non-NULL next\n");
494 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
495 to_multibyte(disp
, buf
);
496 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
497 ok(!lstrcmpA(disp
, exp
[2]) ||
498 !lstrcmpA(disp
, exp
[1]), /* Win98 */
499 "Expected \"%s\" or \"%s\", got \"%s\"\n", exp
[2], exp
[1], disp
);
501 IAssemblyName_Release(next
);
503 next
= (IAssemblyName
*)0xdeadbeef;
504 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
505 ok(hr
== S_FALSE
, "Expected S_FALSE, got %08x\n", hr
);
506 ok(next
== (IAssemblyName
*)0xdeadbeef,
507 "Expected next to be unchanged, got %p\n", next
);
509 IAssemblyEnum_Release(asmenum
);
510 IAssemblyName_Release(asmname
);
513 to_widechar(namestr
, "Wine, Version=1.0.1.2");
515 hr
= pCreateAssemblyNameObject(&asmname
, namestr
, CANOF_PARSE_DISPLAY_NAME
, NULL
);
516 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
517 ok(asmname
!= NULL
, "Expected non-NULL asmname\n");
520 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, asmname
, ASM_CACHE_GAC
, NULL
);
521 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
522 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
525 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
526 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
527 ok(next
!= NULL
, "Expected non-NULL next\n");
530 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
531 to_multibyte(disp
, buf
);
532 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
533 ok(!lstrcmpA(disp
, exp
[4]) ||
534 !lstrcmpA(disp
, exp
[5]), /* Win98 */
535 "Expected \"%s\" or \"%s\", got \"%s\"\n", exp
[4], exp
[5], disp
);
537 IAssemblyName_Release(next
);
540 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
541 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
542 ok(next
!= NULL
, "Expected non-NULL next\n");
545 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
546 to_multibyte(disp
, buf
);
547 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
548 ok(!lstrcmpA(disp
, exp
[5]) ||
549 !lstrcmpA(disp
, exp
[4]), /* Win98 */
550 "Expected \"%s\" or \"%s\", got \"%s\"\n", exp
[5], exp
[4], disp
);
552 IAssemblyName_Release(next
);
554 next
= (IAssemblyName
*)0xdeadbeef;
555 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
556 ok(hr
== S_FALSE
, "Expected S_FALSE, got %08x\n", hr
);
557 ok(next
== (IAssemblyName
*)0xdeadbeef,
558 "Expected next to be unchanged, got %p\n", next
);
560 IAssemblyEnum_Release(asmenum
);
561 IAssemblyName_Release(asmname
);
563 /* only PublicKeyToken */
564 to_widechar(namestr
, "Wine, PublicKeyToken=16a3fcd171e93a8d");
566 hr
= pCreateAssemblyNameObject(&asmname
, namestr
, CANOF_PARSE_DISPLAY_NAME
, NULL
);
567 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
568 ok(asmname
!= NULL
, "Expected non-NULL asmname\n");
571 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, asmname
, ASM_CACHE_GAC
, NULL
);
572 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
573 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
576 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
577 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
578 ok(next
!= NULL
, "Expected non-NULL next\n");
581 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
582 to_multibyte(disp
, buf
);
583 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
584 ok(!lstrcmpA(disp
, exp
[3]), "Expected \"%s\", got \"%s\"\n", exp
[3], disp
);
586 IAssemblyName_Release(next
);
589 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
590 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
591 ok(next
!= NULL
, "Expected non-NULL next\n");
594 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
595 to_multibyte(disp
, buf
);
596 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
597 ok(!lstrcmpA(disp
, exp
[5]), "Expected \"%s\", got \"%s\"\n", exp
[5], disp
);
599 IAssemblyName_Release(next
);
601 next
= (IAssemblyName
*)0xdeadbeef;
602 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
603 ok(hr
== S_FALSE
, "Expected S_FALSE, got %08x\n", hr
);
604 ok(next
== (IAssemblyName
*)0xdeadbeef,
605 "Expected next to be unchanged, got %p\n", next
);
607 IAssemblyEnum_Release(asmenum
);
608 IAssemblyName_Release(asmname
);
611 to_widechar(namestr
, "wine, Culture=neutral");
613 hr
= pCreateAssemblyNameObject(&asmname
, namestr
, CANOF_PARSE_DISPLAY_NAME
, NULL
);
614 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
615 ok(asmname
!= NULL
, "Expected non-NULL asmname\n");
618 hr
= pCreateAssemblyEnum(&asmenum
, NULL
, asmname
, ASM_CACHE_GAC
, NULL
);
619 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
620 ok(asmenum
!= NULL
, "Expected non-NULL asmenum\n");
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
[0]), "Expected \"%s\", got \"%s\"\n", exp
[0], disp
);
633 IAssemblyName_Release(next
);
636 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
637 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
638 ok(next
!= NULL
, "Expected non-NULL next\n");
641 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
642 to_multibyte(disp
, buf
);
643 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
644 ok(!lstrcmpA(disp
, exp
[1]) ||
645 !lstrcmpA(disp
, exp
[2]), /* Win98 */
646 "Expected \"%s\" or \"%s\", got \"%s\"\n", exp
[1], exp
[2], disp
);
648 IAssemblyName_Release(next
);
651 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
652 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
653 ok(next
!= NULL
, "Expected non-NULL next\n");
656 hr
= IAssemblyName_GetDisplayName(next
, buf
, &size
, 0);
657 to_multibyte(disp
, buf
);
658 ok(hr
== S_OK
, "Expected S_OK, got %08x\n", hr
);
659 ok(!lstrcmpA(disp
, exp
[2]) ||
660 !lstrcmpA(disp
, exp
[1]), /* Win98 */
661 "Expected \"%s\" or \"%s\", got \"%s\"\n", exp
[2], exp
[1], disp
);
663 IAssemblyName_Release(next
);
665 next
= (IAssemblyName
*)0xdeadbeef;
666 hr
= IAssemblyEnum_GetNextAssembly(asmenum
, NULL
, &next
, 0);
667 ok(hr
== S_FALSE
, "Expected S_FALSE, got %08x\n", hr
);
668 ok(next
== (IAssemblyName
*)0xdeadbeef,
669 "Expected next to be unchanged, got %p\n", next
);
671 IAssemblyEnum_Release(asmenum
);
672 IAssemblyName_Release(asmname
);
675 sprintf(path
, "%s\\Wine\\1.0.0.0__16a3fcd171e93a8d\\Wine.dll", gac
);
677 sprintf(path
, "%s\\Wine\\1.0.1.2__16a3fcd171e93a8d\\Wine.dll", gac
);
679 sprintf(path
, "%s\\Wine\\1.0.1.2__123456789abcdef0\\Wine.dll", gac
);
681 sprintf(path
, "%s\\Wine\\1.0.0.0__16a3fcd171e93a8d", gac
);
682 RemoveDirectoryA(path
);
683 sprintf(path
, "%s\\Wine\\1.0.1.2__16a3fcd171e93a8d", gac
);
684 RemoveDirectoryA(path
);
685 sprintf(path
, "%s\\Wine\\1.0.1.2__123456789abcdef0", gac
);
686 RemoveDirectoryA(path
);
687 sprintf(path
, "%s\\Wine", gac
);
688 RemoveDirectoryA(path
);
693 if (!init_functionpointers())
696 test_CreateAssemblyEnum();
698 test_enumerate_name();