ReactOS 0.4.17-dev-966-gf06eace
asmcache.c
Go to the documentation of this file.
1/*
2 * Copyright 2008 James Hawkins
3 *
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.
8 *
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.
13 *
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
17 */
18
19#define COBJMACROS
20#define INITGUID
21
22#include <stdio.h>
23
24#include <windows.h>
25#include <mscoree.h>
26#include <fusion.h>
27#include <corerror.h>
28
29#include "wine/test.h"
30
31typedef struct _tagASSEMBLY ASSEMBLY;
32
33typedef struct
34{
39 ULONG VersionLength;
41 BYTE Flags;
42 WORD Streams;
44
45#include <pshpack1.h>
46
47typedef struct
48{
50 DWORD Size;
52
53typedef struct
54{
58 BYTE HeapOffsetSizes;
60 LARGE_INTEGER MaskValid;
61 LARGE_INTEGER MaskSorted;
63
64typedef struct
65{
66 WORD Generation;
67 WORD Name;
68 WORD Mvid;
69 WORD EncId;
70 WORD EncBaseId;
72
73typedef struct
74{
76 WORD Name;
77 WORD Namespace;
78 WORD Extends;
79 WORD FieldList;
80 WORD MethodList;
82
83typedef struct
84{
85 DWORD HashAlgId;
89 WORD RevisionNumber;
91 WORD PublicKey;
92 WORD Name;
93 WORD Culture;
95
96typedef struct
97{
100 WORD Name;
101 WORD Implementation;
103
104typedef struct
105{
106 DWORD ImportLookupTable;
107 DWORD DateTimeStamp;
108 DWORD ForwarderChain;
109 DWORD Name;
110 DWORD ImportAddressTable;
111 BYTE pad[20];
113
114typedef struct
115{
116 DWORD HintNameTableRVA;
117 BYTE pad[8];
119
120typedef struct
121{
122 WORD Hint;
123 BYTE Name[12];
124 BYTE Module[12];
126 WORD EntryPoint;
127 DWORD RVA;
129
130typedef struct
131{
132 DWORD PageRVA;
133 DWORD Size;
134 DWORD Relocation;
135} RELOCATION;
136
137typedef struct
138{
139 WORD wLength;
140 WORD wValueLength;
141 WORD wType;
142 WCHAR szKey[17];
145
146typedef struct
147{
148 WORD wLength;
149 WORD wValueLength;
150 WORD wType;
151 WCHAR szKey[13];
153
154typedef struct
155{
156 WORD wLength;
157 WORD wValueLength;
158 WORD wType;
159 WCHAR szKey[13];
160 DWORD Value;
161} VAR;
162
163typedef struct
164{
165 WORD wLength;
166 WORD wValueLength;
167 WORD wType;
168 WCHAR szKey[15];
170
171typedef struct
172{
173 WORD wLength;
174 WORD wValueLength;
175 WORD wType;
176 WCHAR szKey[9];
178
179typedef struct
180{
181 WORD wLength;
182 WORD wValueLength;
183 WORD wType;
184} STRINGHDR;
185
186typedef struct
187{
188 DWORD Size;
190 DWORD HeaderVersion;
192 BYTE Data[168];
193} RESOURCE;
194
195#include <poppack.h>
196
197static struct _tagASSEMBLY
198{
237 BYTE pad5[108];
271 WORD pad6[182];
273 WORD pad7[250];
274} assembly =
275{
276 /* IMAGE_DOS_HEADER */
277 {
278 IMAGE_DOS_SIGNATURE, 144, 3, 0, 4, 0, 0xFFFF, 0, 0xB8, 0, 0, 0, 0x40,
279 0, { 0 }, 0, 0, { 0 }, 0x80
280 },
281 /* binary to print "This program cannot be run in DOS mode." */
282 {
283 0x1F0E, 0x0EBA, 0xB400, 0xCD09, 0xB821, 0x4C01, 0x21CD, 0x6854, 0x7369,
284 0x7020, 0x6F72, 0x7267, 0x6D61, 0x6320, 0x6E61, 0x6F6E, 0x2074, 0x6562,
285 0x7220, 0x6E75, 0x6920, 0x206E, 0x4F44, 0x2053, 0x6F6D, 0x6564, 0x0D2E,
286 0x0A0D, 0x0024, 0x0000, 0x0000, 0x0000
287 },
288 /* IMAGE_NT_HEADERS32 */
289 {
290 IMAGE_NT_SIGNATURE, /* Signature */
291 /* IMAGE_FILE_HEADER */
292 {
293 IMAGE_FILE_MACHINE_I386, /* Machine */
294 3, /* NumberOfSections */
295 0x47EFDF09, /* TimeDateStamp */
296 0, /* PointerToSymbolTable */
297 0, /* NumberOfSymbols */
298 0xE0, /* SizeOfOptionalHeader */
301 IMAGE_FILE_DLL, /* Characteristics */
302 },
303 /* IMAGE_OPTIONAL_HEADER32 */
304 {
306 8, /* MajorLinkerVersion */
307 0, /* MinorLinkerVersion */
308 0x400, /* SizeOfCode */
309 0x600, /* SizeOfInitializedData */
310 0, /* SizeOfUninitializedData */
311 0x238E, /* AddressOfEntryPoint */
312 0x2000, /* BaseOfCode */
313 0x4000, /* BaseOfData */
314 0x400000, /* ImageBase */
315 0x2000, /* SectionAlignment */
316 0x200, /* FileAlignment */
317 4, /* MajorOperatingSystemVersion */
318 0, /* MinorOperatingSystemVersion */
319 0, /* MajorImageVersion */
320 0, /* MinorImageVersion */
321 4, /* MajorSubsystemVersion */
322 0, /* MinorSubsystemVersion */
323 0, /* Win32VersionValue */
324 0x8000, /* SizeOfImage */
325 0x200, /* SizeOfHeaders */
326 0xB576, /* CheckSum */
327 IMAGE_SUBSYSTEM_WINDOWS_CUI, /* Subsystem */
330 IMAGE_DLLCHARACTERISTICS_NX_COMPAT, /* DllCharacteristics */
331 0x100000, /* SizeOfStackReserve */
332 0x1000, /* SizeOfStackCommit */
333 0x100000, /* SizeOfHeapReserve */
334 0x1000, /* SizeOfHeapCommit */
335 0, /* LoaderFlags */
336 0x10, /* NumberOfRvaAndSizes */
337 /* IMAGE_DATA_DIRECTORY */
338 {
339 { 0 }, /* Export Table */
340 { 0x233C, 0x4F }, /* Import Table */
341 { 0x4000, 0x298 }, /* Resource Table */
342 { 0 }, /* Exception Table */
343 { 0 }, /* Certificate Table */
344 { 0x6000, 0xC }, /* Base Relocation Table */
345 { 0 }, /* Debug */
346 { 0 }, /* Copyright */
347 { 0 }, /* Global Ptr */
348 { 0 }, /* TLS Table */
349 { 0 }, /* Load Config Table */
350 { 0 }, /* Bound Import */
351 { 0x2000, 8 }, /* IAT */
352 { 0 }, /* Delay Import Descriptor */
353 { 0x2008, 0x48 }, /* CLI Header */
354 { 0 } /* Reserved */
355 }
356 }
357 },
358 /* IMAGE_SECTION_HEADER */
359 {
360 ".text", /* Name */
361 { 0x394 }, /* Misc.VirtualSize */
362 0x2000, /* VirtualAddress */
363 0x400, /* SizeOfRawData */
364 0x200, /* PointerToRawData */
365 0, /* PointerToRelocations */
366 0, /* PointerToLinenumbers */
367 0, /* NumberOfRelocations */
368 0, /* NumberOfLinenumbers */
370 IMAGE_SCN_CNT_CODE, /* Characteristics */
371 },
372 /* IMAGE_SECTION_HEADER */
373 {
374 ".rsrc", /* Name */
375 { 0x298 }, /* Misc.VirtualSize */
376 0x4000, /* VirtualAddress */
377 0x400, /* SizeOfRawData */
378 0x600, /* PointerToRawData */
379 0, /* PointerToRelocations */
380 0, /* PointerToLinenumbers */
381 0, /* NumberOfRelocations */
382 0, /* NumberOfLinenumbers */
384 },
385 /* IMAGE_SECTION_HEADER */
386 {
387 ".reloc", /* Name */
388 { 0xC }, /* Misc.VirtualSize */
389 0x6000, /* VirtualAddress */
390 0x200, /* SizeOfRawData */
391 0xA00, /* PointerToRawData */
392 0, /* PointerToRelocations */
393 0, /* PointerToLinenumbers */
394 0, /* NumberOfRelocations */
395 0, /* NumberOfLinenumbers */
397 IMAGE_SCN_MEM_DISCARDABLE, /* Characteristics */
398 },
399 /* fill */
400 { 0 },
401 /* IMAGE_IMPORT_BY_NAME */
402 {
403 0x2370, /* Hint */
404 { 0 } /* Name */
405 },
406 /* fill */
407 { 0 },
408 /* IMAGE_COR20_HEADER */
409 {
410 0x48, /* Cb */
411 2, /* MajorRuntimeVersion */
412 5, /* MinorRuntimeVersion */
413 { 0x2188, 0x1B4 }, /* MetaData */
415 { 0 }, /* EntryPointToken */
416 { 0x20D0, 0xB8 }, /* Resources */
417 { 0x2050, 0x80 }, /* StrongNameSignature */
418 { 0 }, /* CodeManagerTable */
419 { 0 }, /* VTableFixups */
420 { 0 }, /* ExportAddressTableJumps */
421 { 0 } /* ManagedNativeHeader */
422 },
423 { 0xE496, 0x9A6E, 0xD95E, 0xA2A1, 0x5D72, 0x9CEF, 0x41E3, 0xD483,
424 0xCB5C, 0x329A, 0x887C, 0xE18E, 0xE664, 0x2E1C, 0x0E61, 0xB361,
425 0x8B88, 0xC8D0, 0x47A5, 0x9260, 0x6CC5, 0xE60F, 0x1F61, 0x1E3E,
426 0xAFEE, 0x925A, 0xA084, 0x6B44, 0x2DC6, 0x8126, 0xEBC9, 0xD812,
427 0xF3E9, 0xA3F3, 0xD0D5, 0x2C7F, 0x4592, 0xA0AF, 0x8B15, 0xD91E,
428 0x693E, 0x7A4F, 0x5567, 0xC466, 0xC410, 0x3D29, 0xB25F, 0xCD6C,
429 0x53EF, 0x0D29, 0x085A, 0xEC39, 0xE3BD, 0x58E0, 0x78F5, 0x0587,
430 0xF8D8, 0x14E4, 0x77CE, 0xCCC9, 0x4DCF, 0x8A18, 0x90E8, 0x1A52
431 },
432 /* RESOURCE */
433 {
434 0xB4, /* Size */
435 0xBEEFCACE, /* Signature */
436 1, /* HeaderVersion */
437 0x91, /* SkipBytes */
438 { 'l','S','y','s','t','e','m','.','R','e','s','o','u','r','c','e','s','.',
439 'R','e','s','o','u','r','c','e','R','e','a','d','e','r',',',' ',
440 'm','s','c','o','r','l','i','b',',',' ','V','e','r','s','i','o','n','=',
441 '2','.','0','.','0','.','0',',',' ','C','u','l','t','u','r','e','=',
442 'n','e','u','t','r','a','l',',',' ','P','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
443 'b','7','7','a','5','c','5','6','1','9','3','4','e','0','8','9',
444 '#','S','y','s','t','e','m','.','R','e','s','o','u','r','c','e','s','.',
445 'R','u','n','t','i','m','e','R','e','s','o','u','r','c','e','S','e','t',
446 2,0,0,0,0,0,0,0,0,0,0,0,'P','A','D','P','A','D','P',180,0,0,0
447 }
448 },
449 /* METADATAHDR */
450 {
451 0x424A5342, /* Signature */
452 1, /* MajorVersion */
453 1, /* MinorVersion */
454 0, /* Reserved */
455 0xC, /* VersionLength */
456 "v2.0.50727", /* Version */
457 0, /* Flags */
458 5 /* Streams */
459 },
460 /* METADATASTREAMHDR */
461 {
462 0x6C, /* Offset */
463 0x64, /* Size */
464 },
465 "#~\0\0",
466 /* METADATASTREAMHDR */
467 {
468 0xD0, /* Offset */
469 0x28, /* Size */
470 },
471 "#Strings\0\0\0\0",
472 /* METADATASTREAMHDR */
473 {
474 0xF8, /* Offset */
475 0x8, /* Size */
476 },
477 "#US\0",
478 /* METADATASTREAMHDR */
479 {
480 0x100, /* Offset */
481 0x10, /* Size */
482 },
483 "#GUID\0\0\0",
484 /* METADATASTREAMHDR */
485 {
486 0x110, /* Offset */
487 0xA4, /* Size */
488 },
489 "#Blob\0\0\0",
490 /* METADATATABLESHDR */
491 {
492 0, /* Reserved1 */
493 2, /* MajorVersion */
494 0, /* MinorVersion */
495 0, /* HeapOffsetSizes */
496 1, /* Reserved2 */
497 { { 0 } }, /* MaskValid */
498 { { 0 } } /* MaskSorted */
499 },
500 /* numrows */
501 { 1, 1, 1, 1 },
502 /* MODULETABLE */
503 {
504 0, /* Generation */
505 0xA, /* Name */
506 1, /* Mvid */
507 0, /* EncId */
508 0 /* EncBaseId */
509 },
510 /* TYPEDEFTABLE */
511 {
512 0, /* Flags */
513 0x1, /* Name */
514 0, /* Namespace */
515 0, /* Extends */
516 1, /* FieldList */
517 1 /* MethodList */
518 },
519 /* ASSEMBLYTABLE */
520 {
521 0x8004, /* HashAlgId */
522 1, /* MajorVersion */
523 0, /* MinorVersion */
524 0, /* BuildNumber */
525 0, /* RevisionNumber */
526 1, /* Flags */
527 1, /* PublicKey */
528 0x13, /* Name */
529 0 /* Culture */
530 },
531 /* MANIFESTRESTABLE */
532 {
533 0, /* Offset */
534 0x2, /* Flags */
535 0x18, /* Name */
536 0 /* Implementation */
537 },
538 /* pad */
539 0,
540 /* String heap */
541 "\0<Module>\0wine.dll\0wine\0wine.resources\0\0",
542 /* US heap */
543 { 0x0300, 0x0020 },
544 /* GUID heap */
545 { 0x86EF, 0x5B5A, 0x2C5E, 0x4F6D, 0xC2AB, 0x0A94, 0xD658, 0x31DA },
546 /* BLOB heap */
547 { 0x8000, 0x00A0, 0x0024, 0x0400, 0x0080, 0x9400, 0x0000, 0x0600,
548 0x0002, 0x0000, 0x0024, 0x5200, 0x4153, 0x0031, 0x0004, 0x0100,
549 0x0100, 0x2F00, 0x60E0, 0x4D76, 0x5E5C, 0x430A, 0x6FF3, 0x77D6,
550 0x04CA, 0xF6AD, 0xF54D, 0x0AD2, 0x9FB6, 0x39C2, 0x2E66, 0xD30F,
551 0x916F, 0x1826, 0xFB52, 0x78A0, 0x8262, 0x6902, 0xBD47, 0xAF30,
552 0xBAB1, 0x29DA, 0xAA6D, 0xF189, 0x296A, 0x0F13, 0x4982, 0x531D,
553 0x8283, 0x1343, 0x5A33, 0x5D36, 0xEB3F, 0x0863, 0xA771, 0x0679,
554 0x4DFF, 0xD30A, 0xBEAD, 0x2A9F, 0x12A8, 0x4319, 0x5706, 0x333D,
555 0x0CAC, 0xE80A, 0xFD99, 0xC82D, 0x3D3B, 0xBFFE, 0xF256, 0x25E3,
556 0x1A12, 0xC116, 0x8936, 0xF237, 0x5F26, 0xC68A, 0x1E42, 0xCE41,
557 0xC17C, 0x00C4
558 },
559 /* IMAGE_IMPORT_DESCRIPTOR */
560 {
561 { 0x2364 }, /* OriginalFirstThunk */
562 0, /* TimeDateStamp */
563 0, /* ForwarderChain */
564 0x237E, /* Name */
565 0x2000, /* FirstThunk */
566 },
567 /* pad */
568 { 0 },
569 /* IMPORTLOOKUPTABLE */
570 {
571 0x2370, /* HintNameTableRVA */
572 { 0 }, /* pad */
573 },
574 /* HINTNAMETABLE */
575 {
576 0, /* Hint */
577 "_CorDllMain", /* Name */
578 "mscoree.dll", /* Module */
579 0, /* Reserved */
580 0x25FF, /* EntryPoint */
581 0x402000 /* RVA */
582 },
583 /* pad to 0x600 */
584 { 0 },
585 /* IMAGE_RESOURCE_DIRECTORY */
586 {
587 0, /* Characteristics */
588 0, /* TimeDateStamp */
589 0, /* MajorVersion */
590 0, /* MinorVersion */
591 0, /* NumberOfNamedEntries */
592 1, /* NumberOfIdEntries */
593 },
594 /* IMAGE_RESOURCE_DIRECTORY_ENTRY */
595 { { { 0 } }, { 0 } }, /* nameless unions initialized later */
596 /* IMAGE_RESOURCE_DIRECTORY */
597 {
598 0, /* Characteristics */
599 0, /* TimeDateStamp */
600 0, /* MajorVersion */
601 0, /* MinorVersion */
602 0, /* NumberOfNamedEntries */
603 1, /* NumberOfIdEntries */
604 },
605 /* IMAGE_RESOURCE_DIRECTORY_ENTRY */
606 { { { 0 } }, { 0 } }, /* nameless unions initialized later */
607 /* IMAGE_RESOURCE_DIRECTORY */
608 {
609 0, /* Characteristics */
610 0, /* TimeDateStamp */
611 0, /* MajorVersion */
612 0, /* MinorVersion */
613 0, /* NumberOfNamedEntries */
614 1, /* NumberOfIdEntries */
615 },
616 /* IMAGE_RESOURCE_DIRECTORY_ENTRY */
617 { { { 0 } }, { 0 } }, /* nameless unions initialized later */
618 /* IMAGE_RESOURCE_DATA_ENTRY */
619 {
620 0x4058, /* OffsetToData */
621 0x23C, /* Size */
622 0, /* CodePage */
623 0, /* Reserved */
624 },
625 /* VS_VERSIONINFO */
626 {
627 0x23C, /* wLength */
628 0x34, /* wValueLength */
629 0, /* wType */
630 { L"VS_VERSION_INFO" }, /* szKey */
631 /* VS_FIXEDFILEINFO */
632 {
633 VS_FFI_SIGNATURE, /* dwSignature */
634 VS_FFI_STRUCVERSION, /* dwStrucVersion */
635 0x10000, /* dwFileVersionMS */
636 0x00000, /* dwFileVersionLS */
637 0x10000, /* dwProductVersionMS */
638 0x00000, /* dwProductVersionLS */
639 VS_FFI_FILEFLAGSMASK, /* dwFileFlagsMask */
640 0x0, /* dwFileFlags */
641 VOS__WINDOWS32, /* dwFileOS */
642 VFT_DLL, /* dwFileType */
643 VFT2_UNKNOWN, /* dwFileSubtype */
644 0, /* dwFileDateMS */
645 0, /* dwFileDateLS */
646 },
647 },
648 /* VARFILEINFO */
649 {
650 0x44, /* wLength */
651 0, /* wValueLength */
652 1, /* wType */
653 { L"VarFileInfo" } /* szKey */
654 },
655 /* VAR */
656 {
657 0x24, /* wLength */
658 0x4, /* wValueLength */
659 0, /* wType */
660 { L"Translation" }, /* szKey */
661 0x4B00000, /* Value */
662 },
663 /* STRINGFILEINFO */
664 {
665 0x19C, /* wLength */
666 0, /* wValueLength */
667 1, /* wType */
668 { L"StringFileInfo" }, /* szKey */
669 },
670 /* STRINGTABLE */
671 {
672 0x178, /* wLength */
673 0, /* wValueLength */
674 1, /* wType */
675 { L"000004b0" }, /* szKey */
676 },
677 /* STRINGHDR */
678 {
679 0x2C, /* wLength */
680 2, /* wValueLength */
681 1, /* wType */
682 },
683 { L"FileDescription" }, /* szKey */
684 { L" " }, /* szValue */
685 /* STRINGHDR */
686 {
687 0x30, /* wLength */
688 8, /* wValueLength */
689 1, /* wType */
690 },
691 { L"FileVersion" }, /* szKey */
692 { L"1.0.0.0" }, /* szValue */
693 /* STRINGHDR */
694 {
695 0x34, /* wLength */
696 9, /* wValueLength */
697 1, /* wType */
698 },
699 { L"InternalName" }, /* szKey */
700 { L"wine.dll" }, /* szValue */
701 /* STRINGHDR */
702 {
703 0x28, /* wLength */
704 2, /* wValueLength */
705 1, /* wType */
706 },
707 { L"LegalCopyright" }, /* szKey */
708 { L" " }, /* szValue */
709 /* STRINGHDR */
710 {
711 0x3C, /* wLength */
712 9, /* wValueLength */
713 1, /* wType */
714 },
715 { L"OriginalFilename" }, /* szKey */
716 { L"wine.dll" }, /* szValue */
717 /* STRINGHDR */
718 {
719 0x34, /* wLength */
720 8, /* wValueLength */
721 1, /* wType */
722 },
723 { L"ProductVersion" }, /* szKey */
724 { L"1.0.0.0" }, /* szValue */
725 /* STRINGHDR */
726 {
727 0x38, /* wLength */
728 8, /* wValueLength */
729 1, /* wType */
730 },
731 { L"Assembly Version" }, /* szKey */
732 { L"1.0.0.0" }, /* szValue */
733 { 0 }, /* pad */
734 /* RELOCATION */
735 {
736 0x2000, /* PageRVA */
737 0xC, /* Size */
738 0x3390, /* Relocation */
739 },
740 { 0 }
742
743
744static HRESULT (WINAPI *pCreateAssemblyCache)(IAssemblyCache **ppAsmCache,
746static HRESULT (WINAPI *pGetCachePath)(ASM_CACHE_FLAGS dwCacheFlags,
748static HRESULT (WINAPI *pLoadLibraryShim)(LPCWSTR szDllName, LPCWSTR szVersion,
750
752{
753 HRESULT hr;
754 HMODULE hfusion;
756
757 hmscoree = LoadLibraryA("mscoree.dll");
758 if (!hmscoree)
759 {
760 win_skip("mscoree.dll not available\n");
761 return FALSE;
762 }
763
764 pLoadLibraryShim = (void *)GetProcAddress(hmscoree, "LoadLibraryShim");
765 if (!pLoadLibraryShim)
766 {
767 win_skip("LoadLibraryShim not available\n");
769 return FALSE;
770 }
771
772 hr = pLoadLibraryShim(L"fusion.dll", NULL, NULL, &hfusion);
773 if (FAILED(hr))
774 {
775 win_skip("fusion.dll not available\n");
777 return FALSE;
778 }
779
780 pCreateAssemblyCache = (void *)GetProcAddress(hfusion, "CreateAssemblyCache");
781 pGetCachePath = (void *)GetProcAddress(hfusion, "GetCachePath");
782
783 if (!pCreateAssemblyCache || !pGetCachePath)
784 {
785 win_skip("fusion.dll not implemented\n");
786 return FALSE;
787 }
788
790 return TRUE;
791}
792
794{
795 HANDLE file;
796 DWORD written;
797
799 ok(file != INVALID_HANDLE_VALUE, "Failure to open file %s\n", name);
800 WriteFile(file, data, strlen(data), &written, NULL);
801
802 if (size)
803 {
806 }
807
809}
810
811#define create_file(name, size) create_file_data(name, name, size)
812
814{
815 HANDLE hfile;
816 DWORD written;
817
818 /* nameless unions initialized here */
819 assembly.tableshdr.MaskValid.u.HighPart = 0x101;
820 assembly.tableshdr.MaskValid.u.LowPart = 0x00000005;
821 assembly.tableshdr.MaskSorted.u.HighPart = 0x1600;
822 assembly.tableshdr.MaskSorted.u.LowPart = 0x3301FA00;
823 assembly.labelres.Name = 0x10;
824 assembly.labelres.OffsetToData = 0x80000018;
825 assembly.label11res.Name = 0x1;
826 assembly.label11res.OffsetToData = 0x80000030;
827 assembly.label10res.Name = 0x0;
828 assembly.label10res.OffsetToData = 0x48;
829
830 hfile = CreateFileA(file, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0);
831
832 WriteFile(hfile, &assembly, sizeof(ASSEMBLY), &written, NULL);
833 CloseHandle(hfile);
834}
835
837{
839 HRESULT hr;
840 BOOL ret = FALSE;
841 ULONG disp;
842
843 create_assembly("wine.dll");
844
845 hr = pCreateAssemblyCache(&cache, 0);
846 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
847
848 hr = IAssemblyCache_InstallAssembly(cache, 0, L"wine.dll", NULL);
849 if (hr == S_OK)
850 ret = TRUE;
851 else if (hr == CLDB_E_FILE_OLDVER)
852 win_skip("Tests can't be run on older .NET version (.NET 1.1)\n");
853 else if (hr == E_ACCESSDENIED)
854 skip("Not enough rights to install an assembly\n");
855 else
856 ok(0, "Expected S_OK, got %08lx\n", hr);
857
858 DeleteFileA("wine.dll");
859 IAssemblyCache_UninstallAssembly(cache, 0, L"wine.dll", NULL, &disp);
860 IAssemblyCache_Release(cache);
861 return ret;
862}
863
865{
867 HRESULT hr;
868
869 /* NULL ppAsmCache */
870 hr = pCreateAssemblyCache(NULL, 0);
871 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
872
873 /* dwReserved is non-zero */
874 hr = pCreateAssemblyCache(&cache, 42);
875 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
876
877 IAssemblyCache_Release(cache);
878}
879
881{
884 HRESULT hr;
885
886 hr = pCreateAssemblyCache(&cache, 0);
887 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
888
889 hr = IAssemblyCache_CreateAssemblyCacheItem(cache, 0, NULL, NULL, NULL);
890 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
891
892 hr = IAssemblyCache_CreateAssemblyCacheItem(cache, 0, NULL, &item, NULL);
893 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
894 IAssemblyCacheItem_Release(item);
895
896 hr = IAssemblyCache_CreateAssemblyCacheItem(cache, 0, NULL, &item, L"wine");
897 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
898 IAssemblyCacheItem_Release(item);
899
900 hr = IAssemblyCache_CreateAssemblyCacheItem(cache, 1, (void *)0xdeadbeef, &item, NULL);
901 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
902 IAssemblyCacheItem_Release(item);
903
904 hr = IAssemblyCache_CreateAssemblyCacheItem(cache, 1, NULL, &item, NULL);
905 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
906 IAssemblyCacheItem_Release(item);
907
908 hr = IAssemblyCache_CreateAssemblyCacheItem(cache, 0, (void *)0xdeadbeef, &item, NULL);
909 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
910 IAssemblyCacheItem_Release(item);
911
912 IAssemblyCache_Release(cache);
913}
914
915static void test_InstallAssembly(void)
916{
918 HRESULT hr;
919 ULONG disp;
920 DWORD attr;
921 char dllpath[MAX_PATH];
922
923 create_file("test.dll", 100);
924 create_assembly("wine.dll");
925
926 hr = pCreateAssemblyCache(&cache, 0);
927 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
928
929 /* NULL pszManifestFilePath */
930 hr = IAssemblyCache_InstallAssembly(cache, 0, NULL, NULL);
931 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
932
933 /* empty pszManifestFilePath */
934 hr = IAssemblyCache_InstallAssembly(cache, 0, L"", NULL);
935 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
936
937 /* pszManifestFilePath has no extension */
938 hr = IAssemblyCache_InstallAssembly(cache, 0, L"file", NULL);
940 "Expected HRESULT_FROM_WIN32(ERROR_INVALID_NAME), got %08lx\n", hr);
941
942 /* pszManifestFilePath has bad extension */
943 hr = IAssemblyCache_InstallAssembly(cache, 0, L"file.bad", NULL);
945 "Expected HRESULT_FROM_WIN32(ERROR_INVALID_NAME), got %08lx\n", hr);
946
947 /* pszManifestFilePath has dll extension */
948 hr = IAssemblyCache_InstallAssembly(cache, 0, L"file.dll", NULL);
950 "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08lx\n", hr);
951
952 /* pszManifestFilePath has exe extension */
953 hr = IAssemblyCache_InstallAssembly(cache, 0, L"file.exe", NULL);
955 "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08lx\n", hr);
956
957 /* empty file */
958 hr = IAssemblyCache_InstallAssembly(cache, 0, L"test.dll", NULL);
960 "Expected COR_E_ASSEMBLYEXPECTED, got %08lx\n", hr);
961
962 /* wine assembly */
963 hr = IAssemblyCache_InstallAssembly(cache, 0, L"wine.dll", NULL);
964 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
965
967 strcat(dllpath, "\\assembly\\GAC_MSIL\\wine\\\\1.0.0.0__2d03617b1c31e2f5\\wine.dll");
968
970 ok(attr != INVALID_FILE_ATTRIBUTES, "Expected assembly to exist\n");
971
972 /* uninstall the assembly from the GAC */
973 disp = 0xf00dbad;
974 hr = IAssemblyCache_UninstallAssembly(cache, 0, L"wine", NULL, &disp);
975 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
976 ok(disp == IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED,
977 "Expected IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED, got %ld\n", disp);
978
980 ok(attr == INVALID_FILE_ATTRIBUTES, "Expected assembly not to exist\n");
981
982 disp = 0xf00dbad;
983 hr = IAssemblyCache_UninstallAssembly(cache, 0, L"wine", NULL, &disp);
984 ok(hr == S_FALSE, "Expected S_FALSE, got %08lx\n", hr);
985 ok(disp == IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED,
986 "Expected IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED, got %ld\n", disp);
987
988 DeleteFileA("test.dll");
989 DeleteFileA("wine.dll");
990 IAssemblyCache_Release(cache);
991}
992
993#define INIT_ASM_INFO() \
994 ZeroMemory(&info, sizeof(ASSEMBLY_INFO)); \
995 info.cbAssemblyInfo = sizeof(ASSEMBLY_INFO); \
996 info.pszCurrentAssemblyPathBuf = path; \
997 info.cchBuf = MAX_PATH; \
998 path[0] = '\0';
999
1000static void test_QueryAssemblyInfo(void)
1001{
1005 WCHAR asmpath[MAX_PATH];
1007 HRESULT hr;
1008 DWORD size;
1009 ULONG disp;
1010
1011 size = MAX_PATH;
1012 hr = pGetCachePath(ASM_CACHE_GAC, asmpath, &size);
1013 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1014
1015 lstrcatW(asmpath, L"_MSIL\\wine\\1.0.0.0__2d03617b1c31e2f5\\wine.dll");
1016
1017 create_assembly("wine.dll");
1018
1019 hr = pCreateAssemblyCache(&cache, 0);
1020 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1021
1022 /* assembly not installed yet */
1023 INIT_ASM_INFO();
1024 hr = IAssemblyCache_QueryAssemblyInfo(cache, 0, L"wine", &info);
1026 "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08lx\n", hr);
1027 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1028 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1029 ok(info.dwAssemblyFlags == 0, "Expected 0, got %08lx\n", info.dwAssemblyFlags);
1030 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1031 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1032 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1033 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1034 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, L""),
1035 "Assembly path was changed\n");
1036 ok(info.cchBuf == MAX_PATH, "Expected MAX_PATH, got %ld\n", info.cchBuf);
1037
1038 hr = IAssemblyCache_InstallAssembly(cache, 0, L"wine.dll", NULL);
1039 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1040
1041 /* NULL pszAssemblyName */
1042 INIT_ASM_INFO();
1043 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_VALIDATE,
1044 NULL, &info);
1045 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
1046 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1047 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1048 ok(info.dwAssemblyFlags == 0, "Expected 0, got %08lx\n", info.dwAssemblyFlags);
1049 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1050 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1051 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1052 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1053 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, L""),
1054 "Assembly path was changed\n");
1055 ok(info.cchBuf == MAX_PATH, "Expected MAX_PATH, got %ld\n", info.cchBuf);
1056
1057 /* empty pszAssemblyName */
1058 INIT_ASM_INFO();
1059 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_VALIDATE, L"", &info);
1060 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
1061 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1062 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1063 ok(info.dwAssemblyFlags == 0, "Expected 0, got %08lx\n", info.dwAssemblyFlags);
1064 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1065 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1066 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1067 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1068 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, L""),
1069 "Assembly path was changed\n");
1070 ok(info.cchBuf == MAX_PATH, "Expected MAX_PATH, got %ld\n", info.cchBuf);
1071
1072 /* no dwFlags */
1073 INIT_ASM_INFO();
1074 hr = IAssemblyCache_QueryAssemblyInfo(cache, 0, L"wine", &info);
1075 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1076 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1077 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1078 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1079 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1080 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1081 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1082 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1083 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1084 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, asmpath),
1085 "Wrong assembly path returned\n");
1086 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1087 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1088
1089 /* pwzCachePath is full filename */
1090 INIT_ASM_INFO();
1091 hr = IAssemblyCache_QueryAssemblyInfo(cache, 0, L"wine.dll", &info);
1093 "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08lx\n", hr);
1094 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1095 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1096 ok(info.dwAssemblyFlags == 0, "Expected 0, got %08lx\n", info.dwAssemblyFlags);
1097 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1098 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1099 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1100 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1101 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, L""),
1102 "Assembly path was changed\n");
1103 ok(info.cchBuf == MAX_PATH, "Expected MAX_PATH, got %ld\n", info.cchBuf);
1104
1105 /* NULL pAsmInfo, QUERYASMINFO_FLAG_VALIDATE */
1106 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_VALIDATE, L"wine", NULL);
1107 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1108
1109 /* NULL pAsmInfo, QUERYASMINFO_FLAG_GETSIZE */
1110 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE, L"wine", NULL);
1111 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1112
1113 /* info.cbAssemblyInfo is 0 */
1114 INIT_ASM_INFO();
1115 info.cbAssemblyInfo = 0;
1116 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_VALIDATE, L"wine", &info);
1117 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1118 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1119 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1120 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1121 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1122 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1123 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1124 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1125 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1126 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, asmpath),
1127 "Wrong assembly path returned\n");
1128 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1129 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1130
1131 /* info.cbAssemblyInfo is 1 */
1132 INIT_ASM_INFO();
1133 info.cbAssemblyInfo = 1;
1134 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_VALIDATE, L"wine", &info);
1135 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
1136 ok(info.cbAssemblyInfo == 1, "Expected 1, got %ld\n", info.cbAssemblyInfo);
1137 ok(info.dwAssemblyFlags == 0, "Expected 0, got %08lx\n", info.dwAssemblyFlags);
1138 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1139 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1140 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1141 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1142 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, L""),
1143 "Assembly path was changed\n");
1144 ok(info.cchBuf == MAX_PATH, "Expected MAX_PATH, got %ld\n", info.cchBuf);
1145
1146 /* info.cbAssemblyInfo is > sizeof(ASSEMBLY_INFO) */
1147 INIT_ASM_INFO();
1148 info.cbAssemblyInfo = sizeof(ASSEMBLY_INFO) * 2;
1149 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE, L"wine", &info);
1150 ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08lx\n", hr);
1151 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO) * 2,
1152 "Expected sizeof(ASSEMBLY_INFO) * 2, got %ld\n", info.cbAssemblyInfo);
1153 ok(info.dwAssemblyFlags == 0, "Expected 0, got %08lx\n", info.dwAssemblyFlags);
1154 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1155 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1156 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1157 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1158 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, L""),
1159 "Assembly path was changed\n");
1160 ok(info.cchBuf == MAX_PATH, "Expected MAX_PATH, got %ld\n", info.cchBuf);
1161
1162 /* QUERYASMINFO_FLAG_GETSIZE */
1163 INIT_ASM_INFO();
1164 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE, L"wine", &info);
1165 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1166 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1167 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1168 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1169 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1170 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1171 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1172 todo_wine
1173 {
1174 ok((info.uliAssemblySizeInKB.u.LowPart == 4),
1175 "Expected 4, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1176 }
1177 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, asmpath),
1178 "Wrong assembly path returned\n");
1179 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1180 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1181
1182 /* QUERYASMINFO_FLAG_GETSIZE and QUERYASMINFO_FLAG_VALIDATE */
1183 INIT_ASM_INFO();
1184 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE |
1185 QUERYASMINFO_FLAG_VALIDATE, L"wine", &info);
1186 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1187 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1188 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1189 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1190 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1191 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1192 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1193 todo_wine
1194 {
1195 ok((info.uliAssemblySizeInKB.u.LowPart == 4),
1196 "Expected 4, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1197 }
1198 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, asmpath),
1199 "Wrong assembly path returned\n");
1200 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1201 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1202
1203 /* info.pszCurrentAssemblyPathBuf is NULL */
1204 INIT_ASM_INFO();
1205 info.pszCurrentAssemblyPathBuf = NULL;
1206 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE, L"wine", &info);
1207 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1208 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1209 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1210 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1211 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1212 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1213 ok(hr == E_NOT_SUFFICIENT_BUFFER, "Expected E_NOT_SUFFICIENT_BUFFER, got %08lx\n", hr);
1214 todo_wine
1215 {
1216 ok((info.uliAssemblySizeInKB.u.LowPart == 4),
1217 "Expected 4, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1218 }
1219 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1220 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1221
1222 /* info.cchBuf is exactly size of asmpath */
1223 INIT_ASM_INFO();
1224 info.cchBuf = lstrlenW(asmpath);
1225 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE, L"wine", &info);
1226 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1227 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1228 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1229 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1230 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1231 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1232 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, L""),
1233 "Assembly path was changed\n");
1234 ok(hr == E_NOT_SUFFICIENT_BUFFER, "Expected E_NOT_SUFFICIENT_BUFFER, got %08lx\n", hr);
1235 todo_wine
1236 {
1237 ok((info.uliAssemblySizeInKB.u.LowPart == 4),
1238 "Expected 4, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1239 }
1240 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1241 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1242
1243 /* info.cchBuf has room for NULL-terminator */
1244 INIT_ASM_INFO();
1245 info.cchBuf = lstrlenW(asmpath) + 1;
1246 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE, L"wine", &info);
1247 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1248 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1249 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1250 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1251 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1252 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1253 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1254 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1255 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1256 todo_wine
1257 {
1258 ok((info.uliAssemblySizeInKB.u.LowPart == 4),
1259 "Expected 4, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1260 }
1261 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, asmpath),
1262 "Wrong assembly path returned\n");
1263
1264 /* display name is "wine, Version=1.0.0.0" */
1265 INIT_ASM_INFO();
1266 lstrcpyW(name, L"wine, Version=1.0.0.0");
1267 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE,
1268 name, &info);
1269 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1270 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1271 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1272 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1273 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1274 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1275 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1276 todo_wine
1277 {
1278 ok((info.uliAssemblySizeInKB.u.LowPart == 4),
1279 "Expected 4, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1280 }
1281 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, asmpath),
1282 "Wrong assembly path returned\n");
1283 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1284 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1285
1286 /* short buffer, QUERYASMINFO_FLAG_VALIDATE */
1287 memset(&info, 0, sizeof(info));
1288 lstrcpyW(name, L"wine, Version=1.0.0.00000");
1289 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_VALIDATE,
1290 name, &info);
1291 ok(hr == E_NOT_SUFFICIENT_BUFFER, "got %08lx\n", hr);
1292 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED, "got %08lx\n", info.dwAssemblyFlags);
1293
1294 /* short buffer, QUERYASMINFO_FLAG_GETSIZE */
1295 memset(&info, 0, sizeof(info));
1296 lstrcpyW(name, L"wine, Version=1.0.0.00000");
1297 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE,
1298 name, &info);
1299 ok(hr == E_NOT_SUFFICIENT_BUFFER, "got %08lx\n", hr);
1300 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED, "got %08lx\n", info.dwAssemblyFlags);
1301
1302 /* display name is "wine, Version=1.0.0.00000" */
1303 INIT_ASM_INFO();
1304 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE,
1305 name, &info);
1306 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1307 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1308 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1309 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1310 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1311 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1312 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1313 todo_wine
1314 {
1315 ok((info.uliAssemblySizeInKB.u.LowPart == 4),
1316 "Expected 4, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1317 }
1318 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, asmpath),
1319 "Wrong assembly path returned\n");
1320 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1321 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1322
1323 /* display name is "wine, Version=1.0.0.1", versions don't match */
1324 INIT_ASM_INFO();
1325 lstrcpyW(name, L"wine, Version=1.0.0.1");
1326 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE,
1327 name, &info);
1329 "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08lx\n", hr);
1330 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1331 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1332 ok(info.dwAssemblyFlags == 0, "Expected 0, got %08lx\n", info.dwAssemblyFlags);
1333 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1334 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1335 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1336 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1337 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, L""),
1338 "Assembly path was changed\n");
1339 ok(info.cchBuf == MAX_PATH, "Expected MAX_PATH, got %ld\n", info.cchBuf);
1340
1341 /* display name is "wine,version=1.0.0.1,publicKeyToken=2d03617b1c31e2f5,culture=neutral" */
1342 INIT_ASM_INFO();
1343 lstrcpyW(name, L"wine,version=1.0.0.1,publicKeyToken=2d03617b1c31e2f5,culture=neutral");
1344 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE,
1345 name, &info);
1347 "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08lx\n", hr);
1348 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1349 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1350 ok(info.dwAssemblyFlags == 0, "Expected 0, got %08lx\n", info.dwAssemblyFlags);
1351 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1352 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1353 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1354 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1355 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, L""),
1356 "Assembly path was changed\n");
1357 ok(info.cchBuf == MAX_PATH, "Expected MAX_PATH, got %ld\n", info.cchBuf);
1358
1359 /* display name is "mscorlib.dll,version=0.0.0.0,culture=neutral,publicKeyToken=null" */
1360 INIT_ASM_INFO();
1361 lstrcpyW(name, L"mscorlib.dll,version=0.0.0.0,culture=neutral,publicKeyToken=null");
1362 hr = IAssemblyCache_QueryAssemblyInfo(cache, 0, name, &info);
1363 ok(hr == FUSION_E_PRIVATE_ASM_DISALLOWED, "got %08lx\n", hr);
1364
1365 /* display name is "mscorlib.dll,publicKeyToken=nuLl" */
1366 INIT_ASM_INFO();
1367 lstrcpyW(name, L"mscorlib.dll,publicKeyToken=nuLl");
1368 hr = IAssemblyCache_QueryAssemblyInfo(cache, 0, name, &info);
1369 ok(hr == FUSION_E_PRIVATE_ASM_DISALLOWED, "got %08lx\n", hr);
1370
1371 /* display name is "wine, Culture=neutral" */
1372 INIT_ASM_INFO();
1373 lstrcpyW(name, L"wine, Culture=neutral");
1374 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE,
1375 name, &info);
1376 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1377 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1378 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1379 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1380 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1381 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1382 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1383 todo_wine
1384 {
1385 ok((info.uliAssemblySizeInKB.u.LowPart == 4),
1386 "Expected 4, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1387 }
1388 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, asmpath),
1389 "Wrong assembly path returned\n");
1390 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1391 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1392
1393 /* display name is "wine, Culture=en", cultures don't match */
1394 INIT_ASM_INFO();
1395 lstrcpyW(name, L"wine, Culture=en");
1396 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE,
1397 name, &info);
1399 "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08lx\n", hr);
1400 ok(info.dwAssemblyFlags == 0, "Expected 0, got %08lx\n", info.dwAssemblyFlags);
1401 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1402 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1403 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1404 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1405 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1406 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1407 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, L""),
1408 "Assembly path was changed\n");
1409 ok(info.cchBuf == MAX_PATH, "Expected MAX_PATH, got %ld\n", info.cchBuf);
1410
1411 /* display name is "wine, PublicKeyTokens=2d03617b1c31e2f5" */
1412 INIT_ASM_INFO();
1413 lstrcpyW(name, L"wine, PublicKeyToken=2d03617b1c31e2f5");
1414 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE,
1415 name, &info);
1416 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1417 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1418 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1419 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1420 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1421 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1422 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1423 todo_wine
1424 {
1425 ok((info.uliAssemblySizeInKB.u.LowPart == 4),
1426 "Expected 4, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1427 }
1428 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, asmpath),
1429 "Wrong assembly path returned\n");
1430 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1431 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1432
1433 /* display name is "wine, PublicKeyToken=aaaaaaaaaaaaaaaa", pubkeys don't match */
1434 INIT_ASM_INFO();
1435 lstrcpyW(name, L"wine, PublicKeyToken=aaaaaaaaaaaaaaaa");
1436 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE,
1437 name, &info);
1439 "Expected HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), got %08lx\n", hr);
1440 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1441 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1442 ok(info.dwAssemblyFlags == 0, "Expected 0, got %08lx\n", info.dwAssemblyFlags);
1443 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1444 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1445 ok(info.uliAssemblySizeInKB.u.LowPart == 0,
1446 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1447 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, L""),
1448 "Assembly path was changed\n");
1449 ok(info.cchBuf == MAX_PATH, "Expected MAX_PATH, got %ld\n", info.cchBuf);
1450
1451 /* display name is "wine, BadProp=buh", bad property */
1452 INIT_ASM_INFO();
1453 lstrcpyW(name, L"wine, BadProp=buh");
1454 hr = IAssemblyCache_QueryAssemblyInfo(cache, QUERYASMINFO_FLAG_GETSIZE,
1455 name, &info);
1456 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1457 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1458 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1459 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1460 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1461 ok(info.uliAssemblySizeInKB.u.HighPart == 0,
1462 "Expected 0, got %ld\n", info.uliAssemblySizeInKB.u.HighPart);
1463 todo_wine
1464 {
1465 ok((info.uliAssemblySizeInKB.u.LowPart == 4),
1466 "Expected 4, got %ld\n", info.uliAssemblySizeInKB.u.LowPart);
1467 }
1468 ok(!lstrcmpW(info.pszCurrentAssemblyPathBuf, asmpath),
1469 "Wrong assembly path returned\n");
1470 ok(info.cchBuf == lstrlenW(asmpath) + 1,
1471 "Expected %d, got %ld\n", lstrlenW(asmpath) + 1, info.cchBuf);
1472
1473 /* no flags, display name is "wine, Version=1.0.0.0" */
1474 INIT_ASM_INFO();
1475 info.pszCurrentAssemblyPathBuf = NULL;
1476 info.cchBuf = 0;
1477 lstrcpyW(name, L"wine, Version=1.0.0.0");
1478 hr = IAssemblyCache_QueryAssemblyInfo(cache, 0, name, &info);
1479 ok(hr == E_NOT_SUFFICIENT_BUFFER, "Expected E_NOT_SUFFICIENT_BUFFER, got %08lx\n", hr);
1480 ok(info.cbAssemblyInfo == sizeof(ASSEMBLY_INFO),
1481 "Expected sizeof(ASSEMBLY_INFO), got %ld\n", info.cbAssemblyInfo);
1482 ok(info.dwAssemblyFlags == ASSEMBLYINFO_FLAG_INSTALLED,
1483 "Expected ASSEMBLYINFO_FLAG_INSTALLED, got %08lx\n", info.dwAssemblyFlags);
1484
1485 /* uninstall the assembly from the GAC */
1486 disp = 0xf00dbad;
1487 hr = IAssemblyCache_UninstallAssembly(cache, 0, L"wine", NULL, &disp);
1488 ok(hr == S_OK, "Expected S_OK, got %08lx\n", hr);
1489 ok(disp == IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED,
1490 "Expected IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED, got %ld\n", disp);
1491
1492 DeleteFileA("test.dll");
1493 DeleteFileA("wine.dll");
1494 IAssemblyCache_Release(cache);
1495}
1496
1497START_TEST(asmcache)
1498{
1499 if (!init_functionpointers())
1500 return;
1501
1502 if (!check_dotnet20())
1503 return;
1504
1509}
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define FUSION_E_PRIVATE_ASM_DISALLOWED
Definition: corerror.h:172
#define COR_E_ASSEMBLYEXPECTED
Definition: corerror.h:53
#define CLDB_E_FILE_OLDVER
Definition: corerror.h:191
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT hr
Definition: delayimp.cpp:582
LPWSTR Name
Definition: desk.c:124
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG Flags
Definition: dispmprt.h:245
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define CloseHandle
Definition: compat.h:739
#define FILE_BEGIN
Definition: compat.h:761
#define SetFilePointer
Definition: compat.h:743
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
#define lstrcpyW
Definition: compat.h:749
#define ERROR_INVALID_NAME
Definition: compat.h:103
#define lstrlenW
Definition: compat.h:750
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI SetEndOfFile(HANDLE hFile)
Definition: fileinfo.c:989
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:620
BOOL WINAPI WriteFile(_In_ HANDLE hFile, _In_reads_bytes_opt_(nNumberOfBytesToWrite) LPCVOID lpBuffer, _In_ DWORD nNumberOfBytesToWrite, _Out_opt_ LPDWORD lpNumberOfBytesWritten, _Inout_opt_ LPOVERLAPPED lpOverlapped)
Definition: rw.c:25
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2355
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
static const WCHAR Signature[]
Definition: parser.c:141
#define ASSEMBLYINFO_FLAG_INSTALLED
Definition: fusion.idl:103
static const WCHAR szDllName[]
Definition: system.c:43
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
ULONG BuildNumber
Definition: ros_glue.cpp:6
ULONG MajorVersion
Definition: ros_glue.cpp:4
ULONG MinorVersion
Definition: ros_glue.cpp:5
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define RVA(m, b)
Definition: freeldr.h:35
ASM_CACHE_FLAGS
Definition: fusion.idl:27
@ ASM_CACHE_GAC
Definition: fusion.idl:29
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
WCHAR dllpath[MAX_PATH]
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define win_skip
Definition: minitest.h:67
#define todo_wine
Definition: minitest.h:80
#define CREATE_ALWAYS
Definition: disk.h:72
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define INIT_ASM_INFO()
Definition: asmcache.c:993
static BOOL init_functionpointers(void)
Definition: asmcache.c:751
static void test_QueryAssemblyInfo(void)
Definition: asmcache.c:1000
static LPWSTR pwzCachePath
Definition: asmcache.c:747
static void test_CreateAssemblyCache(void)
Definition: asmcache.c:864
static void create_file_data(LPCSTR name, LPCSTR data, DWORD size)
Definition: asmcache.c:793
static void test_CreateAssemblyCacheItem(void)
Definition: asmcache.c:880
static void create_assembly(LPCSTR file)
Definition: asmcache.c:813
#define create_file(name, size)
Definition: asmcache.c:811
static BOOL check_dotnet20(void)
Definition: asmcache.c:836
static LPCWSTR LPVOID pvReserved
Definition: asmcache.c:749
static LPCWSTR szVersion
Definition: asmcache.c:748
static void test_InstallAssembly(void)
Definition: asmcache.c:915
static LPCWSTR LPVOID HMODULE * phModDll
Definition: asmcache.c:749
static LPWSTR PDWORD pcchPath
Definition: asmcache.c:747
static DWORD dwReserved
Definition: asmcache.c:745
static HMODULE hmscoree
Definition: fusion.c:24
#define GENERIC_WRITE
Definition: nt_native.h:90
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC
Definition: ntimage.h:376
#define IMAGE_SUBSYSTEM_WINDOWS_CUI
Definition: ntimage.h:438
#define IMAGE_DLLCHARACTERISTICS_NX_COMPAT
Definition: ntimage.h:457
#define IMAGE_SCN_CNT_INITIALIZED_DATA
Definition: ntimage.h:231
#define IMAGE_SCN_CNT_CODE
Definition: ntimage.h:230
#define IMAGE_SCN_MEM_EXECUTE
Definition: ntimage.h:239
#define IMAGE_SCN_MEM_DISCARDABLE
Definition: ntimage.h:235
#define IMAGE_DLLCHARACTERISTICS_NO_SEH
Definition: ntimage.h:459
#define IMAGE_SCN_MEM_READ
Definition: ntimage.h:240
#define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
Definition: ntimage.h:455
#define IMAGE_FILE_EXECUTABLE_IMAGE
Definition: pedump.c:160
#define IMAGE_FILE_MACHINE_I386
Definition: pedump.c:174
#define IMAGE_FILE_LOCAL_SYMS_STRIPPED
Definition: pedump.c:162
short WCHAR
Definition: pedump.c:58
DWORD * PDWORD
Definition: pedump.c:68
#define IMAGE_NT_SIGNATURE
Definition: pedump.c:93
#define IMAGE_FILE_DLL
Definition: pedump.c:169
#define IMAGE_FILE_LINE_NUMS_STRIPPED
Definition: pedump.c:161
unsigned short USHORT
Definition: pedump.c:61
#define IMAGE_DOS_SIGNATURE
Definition: pedump.c:89
#define IMAGE_FILE_32BIT_MACHINE
Definition: pedump.c:164
@ Reserved2
Definition: sacdrv.h:1470
@ Reserved1
Definition: sacdrv.h:1464
strcat
Definition: string.h:92
#define memset(x, y, z)
Definition: compat.h:39
DWORD SkipBytes
Definition: asmcache.c:191
Definition: pedump.c:458
Definition: pedump.c:414
WCHAR intnameval[10]
Definition: asmcache.c:258
WCHAR asmverval[8]
Definition: asmcache.c:270
IMAGE_COR20_HEADER clrhdr
Definition: asmcache.c:208
WORD unknown[32]
Definition: asmcache.c:200
VS_VERSIONINFO verinfo
Definition: asmcache.c:245
WORD usheap[4]
Definition: asmcache.c:230
WCHAR orignameval[10]
Definition: asmcache.c:264
IMAGE_IMPORT_DESCRIPTOR importdesc
Definition: asmcache.c:233
VARFILEINFO varfileinfo
Definition: asmcache.c:246
BYTE pad4[20]
Definition: asmcache.c:234
STRINGHDR asmverhdr
Definition: asmcache.c:268
IMAGE_RESOURCE_DIRECTORY topresdir
Definition: asmcache.c:238
METADATASTREAMHDR guidhdr
Definition: asmcache.c:218
WCHAR copyrightkey[15]
Definition: asmcache.c:260
STRINGHDR intnamehdr
Definition: asmcache.c:256
BYTE rootname[4]
Definition: asmcache.c:213
TYPEDEFTABLE tdtable
Definition: asmcache.c:225
IMPORTLOOKUPTABLE importlookup
Definition: asmcache.c:235
IMAGE_RESOURCE_DIRECTORY res10dir
Definition: asmcache.c:242
WORD pad7[250]
Definition: asmcache.c:273
STRINGHDR fileverhdr
Definition: asmcache.c:253
IMAGE_SECTION_HEADER rsrc
Definition: asmcache.c:203
WORD guidheap[8]
Definition: asmcache.c:231
IMAGE_NT_HEADERS32 nthdrs
Definition: asmcache.c:201
IMAGE_RESOURCE_DIRECTORY_ENTRY label10res
Definition: asmcache.c:243
IMAGE_RESOURCE_DATA_ENTRY resdata
Definition: asmcache.c:244
BYTE guidname[8]
Definition: asmcache.c:219
WORD blobheap[82]
Definition: asmcache.c:232
ASSEMBLYTABLE asmtable
Definition: asmcache.c:226
IMAGE_RESOURCE_DIRECTORY_ENTRY label11res
Definition: asmcache.c:241
WCHAR prodverval[8]
Definition: asmcache.c:267
IMAGE_DOS_HEADER doshdr
Definition: asmcache.c:199
WCHAR orignamekey[17]
Definition: asmcache.c:263
STRINGHDR orignamehdr
Definition: asmcache.c:262
BYTE blobname[8]
Definition: asmcache.c:221
WCHAR copyrightval[2]
Definition: asmcache.c:261
STRINGHDR copyrighthdr
Definition: asmcache.c:259
WORD strongname[64]
Definition: asmcache.c:209
RESOURCE resource
Definition: asmcache.c:210
WCHAR filedesckey[17]
Definition: asmcache.c:251
BYTE pad2[3]
Definition: asmcache.c:207
METADATASTREAMHDR roothdr
Definition: asmcache.c:212
WCHAR fileverval[8]
Definition: asmcache.c:255
IMAGE_RESOURCE_DIRECTORY res11dir
Definition: asmcache.c:240
WCHAR fileverkey[13]
Definition: asmcache.c:254
STRINGHDR filedeschdr
Definition: asmcache.c:250
STRINGTABLE strtable
Definition: asmcache.c:249
METADATASTREAMHDR ushdr
Definition: asmcache.c:216
DWORD numrows[4]
Definition: asmcache.c:223
BYTE usname[4]
Definition: asmcache.c:217
VAR translation
Definition: asmcache.c:247
IMAGE_IMPORT_BY_NAME iat
Definition: asmcache.c:206
MODULETABLE modtable
Definition: asmcache.c:224
MANIFESTRESTABLE manifestrestable
Definition: asmcache.c:227
IMAGE_RESOURCE_DIRECTORY_ENTRY labelres
Definition: asmcache.c:239
BYTE stringheap[40]
Definition: asmcache.c:229
BYTE pad[16]
Definition: asmcache.c:205
HINTNAMETABLE hintnametable
Definition: asmcache.c:236
IMAGE_SECTION_HEADER reloc
Definition: asmcache.c:204
STRINGHDR prodverhdr
Definition: asmcache.c:265
STRINGFILEINFO strfileinfo
Definition: asmcache.c:248
METADATASTREAMHDR blobhdr
Definition: asmcache.c:220
IMAGE_SECTION_HEADER text
Definition: asmcache.c:202
WORD pad6[182]
Definition: asmcache.c:271
METADATATABLESHDR tableshdr
Definition: asmcache.c:222
WCHAR filedescval[2]
Definition: asmcache.c:252
METADATAHDR metadatahdr
Definition: asmcache.c:211
WCHAR intnamekey[13]
Definition: asmcache.c:257
WCHAR asmverkey[17]
Definition: asmcache.c:269
BYTE pad5[108]
Definition: asmcache.c:237
WCHAR prodverkey[15]
Definition: asmcache.c:266
METADATASTREAMHDR stringshdr
Definition: asmcache.c:214
BYTE stringsname[12]
Definition: asmcache.c:215
RELOCATION relocation
Definition: asmcache.c:272
Definition: cookie.c:202
Definition: cache.c:41
Definition: fci.c:123
Definition: name.c:39
const char * LPCSTR
Definition: typedefs.h:52
const uint16_t * LPCWSTR
Definition: typedefs.h:57
uint16_t * LPWSTR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define VFT_DLL
Definition: verrsrc.h:76
#define VFT2_UNKNOWN
Definition: verrsrc.h:84
#define VS_FFI_SIGNATURE
Definition: verrsrc.h:37
#define VS_FFI_STRUCVERSION
Definition: verrsrc.h:38
#define VOS__WINDOWS32
Definition: verrsrc.h:64
#define VS_FFI_FILEFLAGSMASK
Definition: verrsrc.h:39
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:3451
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define E_NOT_SUFFICIENT_BUFFER
Definition: winerror.h:3437
#define E_ACCESSDENIED
Definition: winerror.h:4116
@ COMIMAGE_FLAGS_ILONLY
Definition: winnt_old.h:3503
@ COMIMAGE_FLAGS_STRONGNAMESIGNED
Definition: winnt_old.h:3506
struct _ASSEMBLY_INFO ASSEMBLY_INFO
unsigned char BYTE
Definition: xxhash.c:193