ReactOS 0.4.15-dev-7834-g00c4b3d
cache.c File Reference
#include <stdio.h>
#include <windows.h>
#include <winsxs.h>
#include "wine/test.h"
Include dependency graph for cache.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 

Functions

static void test_QueryAssemblyInfo (void)
 
 START_TEST (cache)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file cache.c.

Function Documentation

◆ START_TEST()

START_TEST ( cache  )

Definition at line 208 of file cache.c.

209{
211}
static void test_QueryAssemblyInfo(void)
Definition: cache.c:28

◆ test_QueryAssemblyInfo()

static void test_QueryAssemblyInfo ( void  )
static

Definition at line 28 of file cache.c.

29{
30 static const WCHAR emptyW[] = {0};
31 static const WCHAR wine1W[] = {'w','i','n','e',0};
32 static const WCHAR wine2W[] =
33 {'w','i','n','e',',',
34 'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',0};
35 static const WCHAR wine3W[] =
36 {'w','i','n','e',',',
37 'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',',',
38 't','y','p','e','=','\"','w','i','n','3','2','\"',0};
39 static const WCHAR wine4W[] =
40 {'w','i','n','e',',',
41 'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',',',
42 't','y','p','e','=','\"','w','i','n','3','2','\"',',',
43 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
44 '\"','x','8','6','\"',0};
45 static const WCHAR wine5W[] =
46 {'w','i','n','e',',',
47 'v','e','r','s','i','o','n','=','\"','1','.','2','.','3','.','4','\"',',',
48 't','y','p','e','=','\"','w','i','n','3','2','\"',',',
49 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
50 '\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
51 '\"','1','2','3','4','5','6','7','8','9','0','a','b','c','d','e','f','\"',0};
52 static const WCHAR comctl1W[] =
53 {'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.',
54 'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',',
55 'v','e','r','s','i','o','n','=','\"','6','.','0','.','2','6','0','0','.','2','9','8','2','\"',',',
56 't','y','p','e','=','\"','w','i','n','3','2','\"',',',
57 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
58 '\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
59 '\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0};
60 static const WCHAR comctl2W[] =
61 {'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.',
62 'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',',
63 'v','e','r','s','i','o','n','=','\"','6','.','0','.','3','7','9','0','.','4','7','7','0','\"',',',
64 't','y','p','e','=','\"','w','i','n','3','2','\"',',',
65 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
66 '\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
67 '\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0};
68 static const WCHAR comctl3W[] =
69 {'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.',
70 'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',',
71 'v','e','r','s','i','o','n','=','\"','6','.','0','.','8','2','5','0','.','0','\"',',',
72 't','y','p','e','=','\"','w','i','n','3','2','\"',',',
73 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
74 '\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
75 '\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0};
76 static const WCHAR comctl4W[] =
77 {'m','i','c','r','o','s','o','f','t','.','w','i','n','d','o','w','s','.',
78 'c','o','m','m','o','n','-','c','o','n','t','r','o','l','s',',',
79 'v','e','r','s','i','o','n','=','\"','6','.','0','.','7','6','0','1','.','1','7','5','1','4','\"',',',
80 't','y','p','e','=','\"','w','i','n','3','2','\"',',',
81 'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',
82 '\"','x','8','6','\"',',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',
83 '\"','6','5','9','5','b','6','4','1','4','4','c','c','f','1','d','f','\"',0};
84 HRESULT hr;
88 char comctl_path1[MAX_PATH], comctl_path2[MAX_PATH], comctl_path3[MAX_PATH], comctl_path4[MAX_PATH];
89 const WCHAR *comctlW;
90
92 ok( hr == S_OK, "got %08x\n", hr );
93 ok( cache != NULL, "got %08x\n", hr );
94
95 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, NULL, NULL );
96 ok( hr == E_INVALIDARG, "got %08x\n", hr );
97
98 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, emptyW, NULL );
99 ok( hr == E_INVALIDARG, "got %08x\n", hr );
100
101 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine1W, NULL );
103 broken(hr == E_INVALIDARG) /* winxp */, "got %08x\n", hr );
104
105 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine2W, NULL );
107 broken(hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND )) /* winxp */, "got %08x\n", hr );
108
109 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine3W, NULL );
111 broken(hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND )) /* winxp */, "got %08x\n", hr );
112
113 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine4W, NULL );
114 todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08x\n", hr );
115
116 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine5W, NULL );
117 todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08x\n", hr );
118
119 GetWindowsDirectoryA( comctl_path1, MAX_PATH );
120 lstrcatA( comctl_path1, "\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2982_none_deadbeef" );
121 GetWindowsDirectoryA( comctl_path2, MAX_PATH );
122 lstrcatA( comctl_path2, "\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.3790.4770_x-ww_05fdf087" );
123 GetWindowsDirectoryA( comctl_path3, MAX_PATH );
124 lstrcatA( comctl_path3, "\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.8250.0_none_c119e7cca62b92bd" );
125 GetWindowsDirectoryA( comctl_path4, MAX_PATH );
126 lstrcatA( comctl_path4, "\\winsxs\\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2" );
127 if (GetFileAttributesA( comctl_path1 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl1W;
128 else if (GetFileAttributesA( comctl_path2 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl2W;
129 else if (GetFileAttributesA( comctl_path3 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl3W;
130 else if (GetFileAttributesA( comctl_path4 ) != INVALID_FILE_ATTRIBUTES) comctlW = comctl4W;
131 else
132 {
133 skip( "no assembly to test with\n" );
134 IAssemblyCache_Release( cache );
135 return;
136 }
137
138 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, NULL );
139 ok( hr == S_OK, "got %08x\n", hr );
140
141 memset( &info, 0, sizeof(info) );
142 info.cbAssemblyInfo = sizeof(info);
143 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, wine5W, &info );
144 todo_wine ok( hr == HRESULT_FROM_WIN32( ERROR_NOT_FOUND ), "got %08x\n", hr );
145
146 memset( &info, 0, sizeof(info) );
147 info.cbAssemblyInfo = sizeof(info);
148 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, &info );
149 ok( hr == S_OK, "got %08x\n", hr );
150 ok( info.dwAssemblyFlags == 1, "got %08x\n", info.dwAssemblyFlags );
151 ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
152 ok( info.pszCurrentAssemblyPathBuf == NULL, "got %p\n", info.pszCurrentAssemblyPathBuf );
153 ok( !info.cchBuf, "got %u\n", info.cchBuf );
154
155 memset( &info, 0, sizeof(info) );
156 info.cbAssemblyInfo = sizeof(info);
157 info.pszCurrentAssemblyPathBuf = path;
158 info.cchBuf = ARRAY_SIZE( path );
159 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, &info );
160 ok( hr == S_OK, "got %08x\n", hr );
161 ok( info.dwAssemblyFlags == 1, "got %08x\n", info.dwAssemblyFlags );
162 ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
163 ok( info.cchBuf == ARRAY_SIZE( path ), "got %u\n", info.cchBuf );
164 ok( path[0], "empty path\n" );
165
166 memset( &info, 0, sizeof(info) );
167 info.cbAssemblyInfo = sizeof(info);
168 info.pszCurrentAssemblyPathBuf = path;
169 hr = IAssemblyCache_QueryAssemblyInfo( cache, 0, comctlW, &info );
170 ok( hr == HRESULT_FROM_WIN32( ERROR_INSUFFICIENT_BUFFER ), "got %08x\n", hr );
171 ok( info.dwAssemblyFlags == 1, "got %08x\n", info.dwAssemblyFlags );
172 ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
173 ok( info.cchBuf, "got %u\n", info.cchBuf );
174
175 memset( &info, 0, sizeof(info) );
176 info.cbAssemblyInfo = sizeof(info);
177 hr = IAssemblyCache_QueryAssemblyInfo( cache, 1, comctlW, &info );
178 ok( hr == E_INVALIDARG, "got %08x\n", hr );
179 ok( !info.dwAssemblyFlags, "got %08x\n", info.dwAssemblyFlags );
180 ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
181 ok( info.pszCurrentAssemblyPathBuf == NULL, "got %p\n", info.pszCurrentAssemblyPathBuf );
182 ok( !info.cchBuf, "got %u\n", info.cchBuf );
183
184 memset( &info, 0, sizeof(info) );
185 info.cbAssemblyInfo = sizeof(info);
186 hr = IAssemblyCache_QueryAssemblyInfo( cache, 2, comctlW, &info );
187 ok( hr == E_INVALIDARG, "got %08x\n", hr );
188 ok( !info.dwAssemblyFlags, "got %08x\n", info.dwAssemblyFlags );
189 ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
190 ok( info.pszCurrentAssemblyPathBuf == NULL, "got %p\n", info.pszCurrentAssemblyPathBuf );
191 ok( !info.cchBuf, "got %u\n", info.cchBuf );
192
193 memset( &info, 0, sizeof(info) );
194 info.cbAssemblyInfo = sizeof(info);
195 info.pszCurrentAssemblyPathBuf = path;
196 info.cchBuf = ARRAY_SIZE( path );
197 path[0] = 0;
198 hr = IAssemblyCache_QueryAssemblyInfo( cache, 2, comctlW, &info );
199 ok( hr == E_INVALIDARG, "got %08x\n", hr );
200 ok( !info.dwAssemblyFlags, "got %08x\n", info.dwAssemblyFlags );
201 ok( !info.uliAssemblySizeInKB.u.LowPart, "got %u\n", info.uliAssemblySizeInKB.u.LowPart );
202 ok( info.cchBuf == ARRAY_SIZE( path ), "got %u\n", info.cchBuf );
203 ok( !path[0], "got %s\n", wine_dbgstr_w(path) );
204
205 IAssemblyCache_Release( cache );
206}
#define broken(x)
Definition: _sntprintf.h:21
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define ARRAY_SIZE(A)
Definition: main.h:33
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
HRESULT WINAPI CreateAssemblyCache(IAssemblyCache **ppAsmCache, DWORD dwReserved)
Definition: asmcache.c:555
DWORD WINAPI GetFileAttributesA(LPCSTR lpFileName)
Definition: fileinfo.c:636
UINT WINAPI GetWindowsDirectoryA(OUT LPSTR lpBuffer, IN UINT uSize)
Definition: path.c:2337
static const WCHAR emptyW[]
Definition: navigate.c:40
#define S_OK
Definition: intsafe.h:52
#define wine_dbgstr_w
Definition: kernel32.h:34
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
#define todo_wine
Definition: custom.c:79
static const WCHAR wine4W[]
Definition: name.c:35
static const WCHAR wine1W[]
Definition: name.c:29
static const WCHAR wine3W[]
Definition: name.c:33
static const WCHAR wine2W[]
Definition: name.c:31
static const WCHAR wine5W[]
Definition: name.c:37
#define memset(x, y, z)
Definition: compat.h:39
HRESULT hr
Definition: shlfolder.c:183
Definition: cache.c:49
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
#define ERROR_SXS_MISSING_ASSEMBLY_IDENTITY_ATTRIBUTE
Definition: winerror.h:2220
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define ERROR_NOT_FOUND
Definition: winerror.h:690
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by START_TEST().