ReactOS 0.4.17-dev-966-gf06eace
asmcache.c File Reference
#include <stdio.h>
#include <windows.h>
#include <mscoree.h>
#include <fusion.h>
#include <corerror.h>
#include "wine/test.h"
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for asmcache.c:

Go to the source code of this file.

Classes

struct  METADATAHDR
 
struct  METADATASTREAMHDR
 
struct  METADATATABLESHDR
 
struct  MODULETABLE
 
struct  TYPEDEFTABLE
 
struct  ASSEMBLYTABLE
 
struct  MANIFESTRESTABLE
 
struct  IMPORTTABLE
 
struct  IMPORTLOOKUPTABLE
 
struct  HINTNAMETABLE
 
struct  RELOCATION
 
struct  VS_VERSIONINFO
 
struct  VARFILEINFO
 
struct  VAR
 
struct  STRINGFILEINFO
 
struct  STRINGTABLE
 
struct  STRINGHDR
 
struct  RESOURCE
 
struct  _tagASSEMBLY
 

Macros

#define COBJMACROS
 
#define INITGUID
 
#define create_file(name, size)   create_file_data(name, name, size)
 
#define INIT_ASM_INFO()
 

Typedefs

typedef struct _tagASSEMBLY ASSEMBLY
 

Functions

static HRESULT (WINAPI *pCreateAssemblyCache)(IAssemblyCache **ppAsmCache
 
static BOOL init_functionpointers (void)
 
static void create_file_data (LPCSTR name, LPCSTR data, DWORD size)
 
static void create_assembly (LPCSTR file)
 
static BOOL check_dotnet20 (void)
 
static void test_CreateAssemblyCache (void)
 
static void test_CreateAssemblyCacheItem (void)
 
static void test_InstallAssembly (void)
 
static void test_QueryAssemblyInfo (void)
 
 START_TEST (asmcache)
 

Variables

static struct _tagASSEMBLY assembly
 
static DWORD dwReserved
 
static LPWSTR pwzCachePath
 
static LPWSTR PDWORD pcchPath
 
static LPCWSTR szVersion
 
static LPCWSTR LPVOID pvReserved
 
static LPCWSTR LPVOID HMODULE * phModDll
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file asmcache.c.

◆ create_file

#define create_file (   name,
  size 
)    create_file_data(name, name, size)

Definition at line 811 of file asmcache.c.

◆ INIT_ASM_INFO

#define INIT_ASM_INFO ( )
Value:
info.cbAssemblyInfo = sizeof(ASSEMBLY_INFO); \
info.pszCurrentAssemblyPathBuf = path; \
info.cchBuf = MAX_PATH; \
path[0] = '\0';
#define MAX_PATH
Definition: compat.h:34
#define ZeroMemory
Definition: minwinbase.h:31
struct _ASSEMBLY_INFO ASSEMBLY_INFO

Definition at line 993 of file asmcache.c.

◆ INITGUID

#define INITGUID

Definition at line 20 of file asmcache.c.

Typedef Documentation

◆ ASSEMBLY

Definition at line 31 of file asmcache.c.

Function Documentation

◆ check_dotnet20()

static BOOL check_dotnet20 ( void  )
static

Definition at line 836 of file asmcache.c.

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}
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define CLDB_E_FILE_OLDVER
Definition: corerror.h:191
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
return ret
Definition: mutex.c:147
#define L(x)
Definition: resources.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_OK
Definition: intsafe.h:52
#define win_skip
Definition: minitest.h:67
static void create_assembly(LPCSTR file)
Definition: asmcache.c:813
Definition: cache.c:41
uint32_t ULONG
Definition: typedefs.h:59
#define E_ACCESSDENIED
Definition: winerror.h:4116

Referenced by START_TEST().

◆ create_assembly()

static void create_assembly ( LPCSTR  file)
static

Definition at line 813 of file asmcache.c.

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}
#define CloseHandle
Definition: compat.h:739
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
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
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CREATE_ALWAYS
Definition: disk.h:72
#define GENERIC_WRITE
Definition: nt_native.h:90
Definition: fci.c:123

Referenced by check_dotnet20(), test_InstallAssembly(), and test_QueryAssemblyInfo().

◆ create_file_data()

static void create_file_data ( LPCSTR  name,
LPCSTR  data,
DWORD  size 
)
static

Definition at line 793 of file asmcache.c.

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}
#define FILE_BEGIN
Definition: compat.h:761
#define SetFilePointer
Definition: compat.h:743
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
BOOL WINAPI SetEndOfFile(HANDLE hFile)
Definition: fileinfo.c:989
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
Definition: name.c:39

Referenced by create_test_file(), test_binary_import(), test_controlevent(), test_dbmerge(), test_externalui_message(), test_forcecodepage(), test_MsiConfigureProductEx(), test_MsiGetFileHash(), test_MsiGetFileSignatureInformation(), test_MsiProvideQualifiedComponentEx(), test_publish_assemblies(), and test_top_level_action().

◆ HRESULT()

static HRESULT ( WINAPI *  pCreateAssemblyCache)
static

◆ init_functionpointers()

static BOOL init_functionpointers ( void  )
static

Definition at line 751 of file asmcache.c.

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}
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
#define FAILED(hr)
Definition: intsafe.h:51
static HMODULE hmscoree
Definition: fusion.c:24

Referenced by START_TEST().

◆ START_TEST()

START_TEST ( asmcache  )

Definition at line 1497 of file asmcache.c.

1498{
1499 if (!init_functionpointers())
1500 return;
1501
1502 if (!check_dotnet20())
1503 return;
1504
1509}
static BOOL init_functionpointers(void)
Definition: asmcache.c:751
static void test_QueryAssemblyInfo(void)
Definition: asmcache.c:1000
static void test_CreateAssemblyCache(void)
Definition: asmcache.c:864
static void test_CreateAssemblyCacheItem(void)
Definition: asmcache.c:880
static BOOL check_dotnet20(void)
Definition: asmcache.c:836
static void test_InstallAssembly(void)
Definition: asmcache.c:915

◆ test_CreateAssemblyCache()

static void test_CreateAssemblyCache ( void  )
static

Definition at line 864 of file asmcache.c.

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}
#define E_INVALIDARG
Definition: ddrawi.h:101

Referenced by START_TEST().

◆ test_CreateAssemblyCacheItem()

static void test_CreateAssemblyCacheItem ( void  )
static

Definition at line 880 of file asmcache.c.

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}

Referenced by START_TEST().

◆ test_InstallAssembly()

static void test_InstallAssembly ( void  )
static

Definition at line 915 of file asmcache.c.

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}
#define COR_E_ASSEMBLYEXPECTED
Definition: corerror.h:53
#define ERROR_INVALID_NAME
Definition: compat.h:103
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:620
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2355
WCHAR dllpath[MAX_PATH]
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
#define create_file(name, size)
Definition: asmcache.c:811
strcat
Definition: string.h:92
Definition: cookie.c:202
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define S_FALSE
Definition: winerror.h:3451
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210

Referenced by START_TEST().

◆ test_QueryAssemblyInfo()

static void test_QueryAssemblyInfo ( void  )
static

Definition at line 1000 of file asmcache.c.

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}
#define FUSION_E_PRIVATE_ASM_DISALLOWED
Definition: corerror.h:172
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4152
#define ASSEMBLYINFO_FLAG_INSTALLED
Definition: fusion.idl:103
@ ASM_CACHE_GAC
Definition: fusion.idl:29
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
#define todo_wine
Definition: minitest.h:80
#define INIT_ASM_INFO()
Definition: asmcache.c:993
short WCHAR
Definition: pedump.c:58
#define memset(x, y, z)
Definition: compat.h:39
#define E_NOT_SUFFICIENT_BUFFER
Definition: winerror.h:3437

Referenced by START_TEST().

Variable Documentation

◆ assembly

◆ dwReserved

Definition at line 745 of file asmcache.c.

◆ pcchPath

◆ phModDll

LPCWSTR LPVOID HMODULE* phModDll

Definition at line 749 of file asmcache.c.

Referenced by LoadLibraryShim().

◆ pvReserved

◆ pwzCachePath

LPWSTR pwzCachePath

Definition at line 747 of file asmcache.c.

Referenced by GetCachePath().

◆ szVersion