ReactOS 0.4.16-dev-2332-g4cba65d
mscoree.c
Go to the documentation of this file.
1/*
2 * Copyright 2010 Louis Lenders
3 * Copyright 2011 André Hentschel
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20#include <stdio.h>
21
22#define COBJMACROS
23
24#include "corerror.h"
25#include "mscoree.h"
26#include "metahost.h"
27#include "shlwapi.h"
28#include "initguid.h"
29#include "wine/test.h"
30
31#if !defined(__i386__) && !defined(__x86_64__)
32static int has_mono = 0;
33#else
34static int has_mono = 1;
35#endif
36
37DEFINE_GUID(IID__AppDomain, 0x05f696dc,0x2b29,0x3663,0xad,0x8b,0xc4,0x38,0x9c,0xf2,0xa7,0x13);
38
39static const WCHAR v4_0[] = {'v','4','.','0','.','3','0','3','1','9',0};
40
42
43static HRESULT (WINAPI *pGetCORVersion)(LPWSTR, DWORD, DWORD*);
44static HRESULT (WINAPI *pCorIsLatestSvc)(INT*, INT*);
45static HRESULT (WINAPI *pGetCORSystemDirectory)(LPWSTR, DWORD, DWORD*);
46static HRESULT (WINAPI *pGetRequestedRuntimeInfo)(LPCWSTR, LPCWSTR, LPCWSTR, DWORD, DWORD, LPWSTR, DWORD, DWORD*, LPWSTR, DWORD, DWORD*);
47static HRESULT (WINAPI *pLoadLibraryShim)(LPCWSTR, LPCWSTR, LPVOID, HMODULE*);
48static HRESULT (WINAPI *pCreateConfigStream)(LPCWSTR, IStream**);
49static HRESULT (WINAPI *pCreateInterface)(REFCLSID, REFIID, VOID**);
50static HRESULT (WINAPI *pCLRCreateInstance)(REFCLSID, REFIID, VOID**);
51
53
55{
56 hmscoree = LoadLibraryA("mscoree.dll");
57
58 if (!hmscoree)
59 {
60 win_skip("mscoree.dll not available\n");
61 return FALSE;
62 }
63
64 pGetCORVersion = (void *)GetProcAddress(hmscoree, "GetCORVersion");
65 pCorIsLatestSvc = (void *)GetProcAddress(hmscoree, "CorIsLatestSvc");
66 pGetCORSystemDirectory = (void *)GetProcAddress(hmscoree, "GetCORSystemDirectory");
67 pGetRequestedRuntimeInfo = (void *)GetProcAddress(hmscoree, "GetRequestedRuntimeInfo");
68 pLoadLibraryShim = (void *)GetProcAddress(hmscoree, "LoadLibraryShim");
69 pCreateConfigStream = (void *)GetProcAddress(hmscoree, "CreateConfigStream");
70 pCreateInterface = (void *)GetProcAddress(hmscoree, "CreateInterface");
71 pCLRCreateInstance = (void *)GetProcAddress(hmscoree, "CLRCreateInstance");
72
73 if (!pGetCORVersion || !pGetCORSystemDirectory || !pGetRequestedRuntimeInfo || !pLoadLibraryShim ||
74 !pCreateInterface || !pCLRCreateInstance || !pCorIsLatestSvc
75 )
76 {
77 win_skip("functions not available\n");
79 return FALSE;
80 }
81
82 return TRUE;
83}
84
85static int check_runtime(void)
86{
88 ICLRRuntimeInfo *runtimeinfo;
89 ICorRuntimeHost *runtimehost;
90 HRESULT hr;
91
92 if (!pCLRCreateInstance)
93 {
94 win_skip("Function CLRCreateInstance not found.\n");
95 return 1;
96 }
97
98 hr = pCLRCreateInstance(&CLSID_CLRMetaHost, &IID_ICLRMetaHost, (void **)&metahost);
99 if (hr == E_NOTIMPL)
100 {
101 win_skip("CLRCreateInstance not implemented\n");
102 return 1;
103 }
104 ok(SUCCEEDED(hr), "CLRCreateInstance failed, hr=%#.8lx\n", hr);
105 if (FAILED(hr))
106 return 1;
107
108 hr = ICLRMetaHost_GetRuntime(metahost, v4_0, &IID_ICLRRuntimeInfo, (void **)&runtimeinfo);
109 ok(SUCCEEDED(hr), "ICLRMetaHost::GetRuntime failed, hr=%#.8lx\n", hr);
110 if (FAILED(hr))
111 return 1;
112
113 hr = ICLRRuntimeInfo_GetInterface(runtimeinfo, &CLSID_CorRuntimeHost, &IID_ICorRuntimeHost,
114 (void **)&runtimehost);
115 todo_wine_if(!has_mono) ok(SUCCEEDED(hr), "ICLRRuntimeInfo::GetInterface failed, hr=%#.8lx\n", hr);
116 if (FAILED(hr))
117 return 1;
118
119 hr = ICorRuntimeHost_Start(runtimehost);
120 ok(SUCCEEDED(hr), "ICorRuntimeHost::Start failed, hr=%#.8lx\n", hr);
121 if (FAILED(hr))
122 return 1;
123
124 ICorRuntimeHost_Release(runtimehost);
125
126 ICLRRuntimeInfo_Release(runtimeinfo);
127
128 ICLRMetaHost_ExitProcess(metahost, 0);
129
130 ok(0, "ICLRMetaHost_ExitProcess is not supposed to return\n");
131 return 1;
132}
133
135{
136 static const char cmdline_format[] = "\"%s\" mscoree check_runtime";
137 char** argv;
138 char cmdline[MAX_PATH + sizeof(cmdline_format)];
139 STARTUPINFOA si = {0};
141 BOOL ret;
142 DWORD exitcode;
143
145
146 sprintf(cmdline, cmdline_format, argv[0]);
147
148 si.cb = sizeof(si);
149
151 ok(ret, "Could not create process: %lu\n", GetLastError());
152 if (!ret)
153 return FALSE;
154
156
158
159 ret = GetExitCodeProcess(pi.hProcess, &exitcode);
160 ok(ret, "GetExitCodeProcess failed: %lu\n", GetLastError());
162
163 if (!ret || exitcode != 0)
164 {
165 todo_wine_if(!has_mono) win_skip(".NET 4.0 runtime is not usable\n");
166 return FALSE;
167 }
168
169 return TRUE;
170}
171
172static void test_versioninfo(void)
173{
174 const WCHAR v9_0[] = {'v','9','.','0','.','3','0','3','1','9',0};
175 const WCHAR v2_0cap[] = {'V','2','.','0','.','5','0','7','2','7',0};
176 const WCHAR v2_0[] = {'v','2','.','0','.','5','0','7','2','7',0};
177 const WCHAR v2_0_0[] = {'v','2','.','0','.','0',0};
178 const WCHAR v1_1[] = {'v','1','.','1','.','4','3','2','2',0};
179 const WCHAR v1_1_0[] = {'v','1','.','1','.','0',0};
180
184 HRESULT hr;
185
186 if (0) /* crashes on <= w2k3 */
187 {
188 hr = pGetCORVersion(NULL, MAX_PATH, &size);
189 ok(hr == E_POINTER,"GetCORVersion returned %08lx\n", hr);
190 }
191
192 hr = pGetCORVersion(version, 1, &size);
193 if (hr == CLR_E_SHIM_RUNTIME)
194 {
196 win_skip("No legacy .NET runtimes are installed\n");
197 return;
198 }
199
200 ok(hr == E_NOT_SUFFICIENT_BUFFER, "GetCORVersion returned %08lx\n", hr);
201
202 hr = pGetCORVersion(version, MAX_PATH, &size);
203 ok(hr == S_OK,"GetCORVersion returned %08lx\n", hr);
204
205 trace("latest installed .net runtime: %s\n", wine_dbgstr_w(version));
206
207 hr = pGetCORSystemDirectory(path, MAX_PATH , &size);
208 todo_wine_if(!has_mono) ok(hr == S_OK, "GetCORSystemDirectory returned %08lx\n", hr);
209 /* size includes terminating null-character */
210 todo_wine_if(!has_mono) ok(size == (lstrlenW(path) + 1),"size is %ld instead of %d\n", size, (lstrlenW(path) + 1));
211
212 path_len = size;
213
214 hr = pGetCORSystemDirectory(path, path_len-1 , &size);
215 todo_wine_if(!has_mono) ok(hr == E_NOT_SUFFICIENT_BUFFER, "GetCORSystemDirectory returned %08lx\n", hr);
216
217 if (0) /* crashes on <= w2k3 */
218 {
219 hr = pGetCORSystemDirectory(NULL, MAX_PATH , &size);
220 ok(hr == E_NOT_SUFFICIENT_BUFFER, "GetCORSystemDirectory returned %08lx\n", hr);
221 }
222
223 hr = pGetCORSystemDirectory(path, MAX_PATH , NULL);
224 ok(hr == E_POINTER,"GetCORSystemDirectory returned %08lx\n", hr);
225
226 trace("latest installed .net installed in directory: %s\n", wine_dbgstr_w(path));
227
228 /* test GetRequestedRuntimeInfo, first get info about different versions of runtime */
229 hr = pGetRequestedRuntimeInfo( NULL, v2_0, NULL, 0, 0, path, MAX_PATH, &path_len, version, MAX_PATH, &size);
230
231 if(hr == CLR_E_SHIM_RUNTIME) return; /* skipping rest of tests on win2k as .net 2.0 not installed */
232
233 todo_wine_if(!has_mono) ok(hr == S_OK, "GetRequestedRuntimeInfo returned %08lx\n", hr);
234 trace(" installed in directory %s is .net version %s\n", wine_dbgstr_w(path), wine_dbgstr_w(version));
235
236 hr = pGetRequestedRuntimeInfo( NULL, v1_1, NULL, 0, 0, path, MAX_PATH, &path_len, version, MAX_PATH, &size);
237 todo_wine_if(!has_mono) ok(hr == S_OK || hr == CLR_E_SHIM_RUNTIME /*v1_1 not installed*/, "GetRequestedRuntimeInfo returned %08lx\n", hr);
238 if(hr == S_OK)
239 trace(" installed in directory %s is .net version %s\n", wine_dbgstr_w(path), wine_dbgstr_w(version));
240 /* version number NULL not allowed without RUNTIME_INFO_UPGRADE_VERSION flag */
241 hr = pGetRequestedRuntimeInfo( NULL, NULL, NULL, 0, 0, path, MAX_PATH, &path_len, version, MAX_PATH, &size);
242 ok(hr == CLR_E_SHIM_RUNTIME, "GetRequestedRuntimeInfo returned %08lx\n", hr);
243 /* with RUNTIME_INFO_UPGRADE_VERSION flag and version number NULL, latest installed version is returned */
244 hr = pGetRequestedRuntimeInfo( NULL, NULL, NULL, 0, RUNTIME_INFO_UPGRADE_VERSION, path, MAX_PATH, &path_len, version, MAX_PATH, &size);
245 todo_wine_if(!has_mono) ok(hr == S_OK, "GetRequestedRuntimeInfo returned %08lx\n", hr);
246
247 hr = pGetRequestedRuntimeInfo( NULL, v2_0, NULL, 0, 0, path, 1, &path_len, version, MAX_PATH, &size);
248 todo_wine_if(!has_mono) ok(hr == E_NOT_SUFFICIENT_BUFFER, "GetRequestedRuntimeInfo returned %08lx\n", hr);
249
250 /* if one of the buffers is NULL, the other one is still happily filled */
251 memset(version, 0, sizeof(version));
252 hr = pGetRequestedRuntimeInfo( NULL, v2_0, NULL, 0, 0, NULL, MAX_PATH, &path_len, version, MAX_PATH, &size);
253 todo_wine_if(!has_mono) ok(hr == S_OK, "GetRequestedRuntimeInfo returned %08lx\n", hr);
254 ok(!wcscmp(version, v2_0), "version is %s , expected %s\n", wine_dbgstr_w(version), wine_dbgstr_w(v2_0));
255 /* With NULL-pointer for bufferlength, the buffer itself still gets filled with correct string */
256 memset(version, 0, sizeof(version));
257 hr = pGetRequestedRuntimeInfo( NULL, v2_0, NULL, 0, 0, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
258 todo_wine_if(!has_mono) ok(hr == S_OK, "GetRequestedRuntimeInfo returned %08lx\n", hr);
259 ok(!wcscmp(version, v2_0), "version is %s , expected %s\n", wine_dbgstr_w(version), wine_dbgstr_w(v2_0));
260
261 memset(version, 0, sizeof(version));
262 hr = pGetRequestedRuntimeInfo( NULL, v2_0cap, NULL, 0, 0, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
263 todo_wine_if(!has_mono) ok(hr == S_OK, "GetRequestedRuntimeInfo returned %08lx\n", hr);
264 ok(!wcscmp(version, v2_0cap), "version is %s , expected %s\n", wine_dbgstr_w(version), wine_dbgstr_w(v2_0cap));
265
266 /* Invalid Version and RUNTIME_INFO_UPGRADE_VERSION flag*/
267 memset(version, 0, sizeof(version));
268 hr = pGetRequestedRuntimeInfo( NULL, v1_1, NULL, 0, RUNTIME_INFO_UPGRADE_VERSION, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
269 todo_wine_if(!has_mono) ok(hr == S_OK || hr == CLR_E_SHIM_RUNTIME , "GetRequestedRuntimeInfo returned %08lx\n", hr);
270 if(hr == S_OK)
271 {
272 /* .NET 1.1 may not be installed. */
273 ok(!wcscmp(version, v1_1) || !wcscmp(version, v2_0),
274 "version is %s , expected %s or %s\n", wine_dbgstr_w(version), wine_dbgstr_w(v1_1), wine_dbgstr_w(v2_0));
275
276 }
277
278 memset(version, 0, sizeof(version));
279 hr = pGetRequestedRuntimeInfo( NULL, v9_0, NULL, 0, RUNTIME_INFO_UPGRADE_VERSION, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
280 ok(hr == CLR_E_SHIM_RUNTIME, "GetRequestedRuntimeInfo returned %08lx\n", hr);
281
282 memset(version, 0, sizeof(version));
283 hr = pGetRequestedRuntimeInfo( NULL, v1_1_0, NULL, 0, 0, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
284 ok(hr == CLR_E_SHIM_RUNTIME, "GetRequestedRuntimeInfo returned %08lx\n", hr);
285
286 memset(version, 0, sizeof(version));
287 hr = pGetRequestedRuntimeInfo( NULL, v1_1_0, NULL, 0, RUNTIME_INFO_UPGRADE_VERSION, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
288 todo_wine_if(!has_mono) ok(hr == S_OK, "GetRequestedRuntimeInfo returned %08lx\n", hr);
289 ok(!wcscmp(version, v2_0), "version is %s , expected %s\n", wine_dbgstr_w(version), wine_dbgstr_w(v2_0));
290
291 memset(version, 0, sizeof(version));
292 hr = pGetRequestedRuntimeInfo( NULL, v2_0_0, NULL, 0, 0, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
293 ok(hr == CLR_E_SHIM_RUNTIME, "GetRequestedRuntimeInfo returned %08lx\n", hr);
294
295 memset(version, 0, sizeof(version));
296 hr = pGetRequestedRuntimeInfo( NULL, v2_0_0, NULL, 0, RUNTIME_INFO_UPGRADE_VERSION, path, MAX_PATH, &path_len, version, MAX_PATH, NULL);
297 todo_wine_if(!has_mono) ok(hr == S_OK, "GetRequestedRuntimeInfo returned %08lx\n", hr);
298 ok(!wcscmp(version, v2_0), "version is %s , expected %s\n", wine_dbgstr_w(version), wine_dbgstr_w(v2_0));
299
300 hr = pCorIsLatestSvc(NULL, NULL);
301 ok(hr == E_POINTER, "CorIsLatestSvc returned %08lx\n", hr);
302}
303
304static void test_loadlibraryshim(void)
305{
306 const WCHAR v2_0[] = {'v','2','.','0','.','5','0','7','2','7',0};
307 const WCHAR v1_1[] = {'v','1','.','1','.','4','3','2','2',0};
308 const WCHAR vbogus[] = {'v','b','o','g','u','s',0};
309 const WCHAR fusion[] = {'f','u','s','i','o','n',0};
310 const WCHAR fusiondll[] = {'f','u','s','i','o','n','.','d','l','l',0};
311 const WCHAR nosuchdll[] = {'j','n','v','n','l','.','d','l','l',0};
312 const WCHAR gdidll[] = {'g','d','i','3','2','.','d','l','l',0};
313 HRESULT hr;
314 const WCHAR *latest = NULL;
315 CHAR latestA[MAX_PATH];
318
320 {
321 win_skip("No legacy .NET runtimes are installed\n");
322 return;
323 }
324
325 hr = pLoadLibraryShim(fusion, v1_1, NULL, &hdll);
326 ok(hr == S_OK || hr == E_HANDLE, "LoadLibraryShim failed, hr=%lx\n", hr);
327 if (SUCCEEDED(hr))
328 {
329 latest = v1_1;
330
332
333 todo_wine_if(!has_mono) ok(StrStrIA(dllpath, "v1.1.4322") != 0, "incorrect fusion.dll path %s\n", dllpath);
334 ok(StrStrIA(dllpath, "fusion.dll") != 0, "incorrect fusion.dll path %s\n", dllpath);
335
337 }
338
339 hr = pLoadLibraryShim(fusion, v2_0, NULL, &hdll);
340 ok(hr == S_OK || hr == E_HANDLE, "LoadLibraryShim failed, hr=%lx\n", hr);
341 if (SUCCEEDED(hr))
342 {
343 latest = v2_0;
344
346
347 todo_wine_if(!has_mono) ok(StrStrIA(dllpath, "v2.0.50727") != 0, "incorrect fusion.dll path %s\n", dllpath);
348 ok(StrStrIA(dllpath, "fusion.dll") != 0, "incorrect fusion.dll path %s\n", dllpath);
349
351 }
352
353 hr = pLoadLibraryShim(fusion, v4_0, NULL, &hdll);
354 ok(hr == S_OK || hr == E_HANDLE, "LoadLibraryShim failed, hr=%lx\n", hr);
355 if (SUCCEEDED(hr))
356 {
357 /* LoadLibraryShim with a NULL version prefers 2.0 and earlier */
358 if (!latest)
359 latest = v4_0;
360
362
363 todo_wine_if(!has_mono) ok(StrStrIA(dllpath, "v4.0.30319") != 0, "incorrect fusion.dll path %s\n", dllpath);
364 ok(StrStrIA(dllpath, "fusion.dll") != 0, "incorrect fusion.dll path %s\n", dllpath);
365
367 }
368
369 hr = pLoadLibraryShim(fusion, vbogus, NULL, &hdll);
370 ok(hr == E_HANDLE, "LoadLibraryShim failed, hr=%lx\n", hr);
371 if (SUCCEEDED(hr))
373
374 WideCharToMultiByte(CP_ACP, 0, latest, -1, latestA, MAX_PATH, NULL, NULL);
375
376 hr = pLoadLibraryShim(fusion, NULL, NULL, &hdll);
377 ok(hr == S_OK, "LoadLibraryShim failed, hr=%lx\n", hr);
378 if (SUCCEEDED(hr))
379 {
381
382 if (latest)
383 todo_wine_if(!has_mono) ok(StrStrIA(dllpath, latestA) != 0, "incorrect fusion.dll path %s\n", dllpath);
384 ok(StrStrIA(dllpath, "fusion.dll") != 0, "incorrect fusion.dll path %s\n", dllpath);
385
387 }
388
389 hr = pLoadLibraryShim(fusiondll, NULL, NULL, &hdll);
390 ok(hr == S_OK, "LoadLibraryShim failed, hr=%lx\n", hr);
391 if (SUCCEEDED(hr))
392 {
394
395 if (latest)
396 todo_wine_if(!has_mono) ok(StrStrIA(dllpath, latestA) != 0, "incorrect fusion.dll path %s\n", dllpath);
397 ok(StrStrIA(dllpath, "fusion.dll") != 0, "incorrect fusion.dll path %s\n", dllpath);
398
400 }
401
402 hr = pLoadLibraryShim(nosuchdll, latest, NULL, &hdll);
403 ok(hr == E_HANDLE, "LoadLibraryShim failed, hr=%lx\n", hr);
404 if (SUCCEEDED(hr))
406
407 hr = pLoadLibraryShim(gdidll, latest, NULL, &hdll);
408 ok(hr == E_HANDLE, "LoadLibraryShim failed, hr=%lx\n", hr);
409 if (SUCCEEDED(hr))
411}
412
413static const char xmldata[] =
414 "<?xml version=\"1.0\" ?>\n"
415 "<!DOCTYPE Config>\n"
416 "<Configuration>\n"
417 " <Name>Test</Name>\n"
418 " <Value>1234</Value>\n"
419 "</Configuration>";
420
422{
423 DWORD dwNumberOfBytesWritten;
426 ok(hfile != INVALID_HANDLE_VALUE, "Could not open %s for writing: %lu\n", wine_dbgstr_w(filename), GetLastError());
427 WriteFile(hfile, xmldata, sizeof(xmldata) - 1, &dwNumberOfBytesWritten, NULL);
428 CloseHandle(hfile);
429}
430
431static void test_createconfigstream(void)
432{
434 WCHAR file[] = {'c', 'o', 'n', 'f', '.', 'x', 'm', 'l', 0};
435 WCHAR nonexistent[] = {'n', 'o', 'n', 'e', 'x', 'i', 's', 't', '.', 'x', 'm', 'l', 0};
437 HRESULT hr;
438 char buffer[256] = {0};
439
440 if (!pCreateConfigStream)
441 {
442 win_skip("CreateConfigStream not available\n");
443 return;
444 }
445
448
449 hr = pCreateConfigStream(NULL, &stream);
450 ok(hr == E_FAIL ||
451 broken(hr == HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND)) || /* some WinXP, Win2K3 and Win7 */
452 broken(hr == S_OK && !stream), /* some Win2K3 */
453 "CreateConfigStream returned %lx\n", hr);
454
455 hr = pCreateConfigStream(path, NULL);
456 ok(hr == COR_E_NULLREFERENCE, "CreateConfigStream returned %lx\n", hr);
457
458 hr = pCreateConfigStream(NULL, NULL);
459 ok(hr == COR_E_NULLREFERENCE, "CreateConfigStream returned %lx\n", hr);
460
461 hr = pCreateConfigStream(nonexistent, &stream);
462 ok(hr == COR_E_FILENOTFOUND, "CreateConfigStream returned %lx\n", hr);
463 ok(stream == NULL, "Expected stream to be NULL\n");
464
465 hr = pCreateConfigStream(path, &stream);
466 ok(hr == S_OK, "CreateConfigStream failed, hr=%lx\n", hr);
467 ok(stream != NULL, "Expected non-NULL stream\n");
468
469 if (stream)
470 {
471 DWORD count;
474 IStream *stream2 = NULL;
475 ULONG ref;
476
477 hr = IStream_Read(stream, buffer, strlen(xmldata), &count);
478 ok(hr == S_OK, "IStream_Read failed, hr=%lx\n", hr);
479 ok(count == strlen(xmldata), "wrong count: %lu\n", count);
480 ok(!strcmp(buffer, xmldata), "Strings do not match\n");
481
482 hr = IStream_Read(stream, buffer, sizeof(buffer), &count);
483 ok(hr == S_OK, "IStream_Read failed, hr=%lx\n", hr);
484 ok(!count, "wrong count: %lu\n", count);
485
486 hr = IStream_Write(stream, xmldata, strlen(xmldata), &count);
487 ok(hr == E_FAIL, "IStream_Write returned hr=%lx\n", hr);
488
489 pos.QuadPart = strlen(xmldata);
490 hr = IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL);
491 ok(hr == E_NOTIMPL, "IStream_Seek returned hr=%lx\n", hr);
492
493 size.QuadPart = strlen(xmldata);
494 hr = IStream_SetSize(stream, size);
495 ok(hr == E_NOTIMPL, "IStream_SetSize returned hr=%lx\n", hr);
496
497 hr = IStream_Clone(stream, &stream2);
498 ok(hr == E_NOTIMPL, "IStream_Clone returned hr=%lx\n", hr);
499
500 hr = IStream_Commit(stream, STGC_DEFAULT);
501 ok(hr == E_NOTIMPL, "IStream_Commit returned hr=%lx\n", hr);
502
503 hr = IStream_Revert(stream);
504 ok(hr == E_NOTIMPL, "IStream_Revert returned hr=%lx\n", hr);
505
506 ref = IStream_Release(stream);
507 ok(!ref, "IStream_Release returned %lu\n", ref);
508 }
510}
511
512static void test_createinstance(void)
513{
514 HRESULT hr;
516
518 {
519 /* If we don't have 1.x or 2.0 runtimes, we should at least have .NET 4. */
520 ok(pCreateInterface != NULL, "no legacy runtimes or .NET 4 interfaces available\n");
521 }
522
523 if(!pCreateInterface)
524 {
525 win_skip("Function CreateInterface not found.\n");
526 return;
527 }
528
529 hr = pCreateInterface(&CLSID_CLRMetaHost, &IID_ICLRMetaHost, (void**)&host);
530 if(SUCCEEDED(hr))
531 {
532 ICLRMetaHost_Release(host);
533 }
534 else
535 {
536 win_skip(".NET 4 not installed.\n");
537 }
538}
539
541{
542 HANDLE file;
543 HRSRC rsrc;
544 void *data;
545 DWORD size;
546 BOOL ret;
547
549 if (!rsrc) return FALSE;
550
552 if (!data) return FALSE;
553
555 if (!size) return FALSE;
556
558 if (file == INVALID_HANDLE_VALUE) return FALSE;
559
562 return ret;
563}
564
565static BOOL compile_cs(const WCHAR *source, const WCHAR *target, const WCHAR *type, const WCHAR *args)
566{
567 static const WCHAR *csc = L"C:\\windows\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe";
568 WCHAR cmdline[2 * MAX_PATH + 74];
570 STARTUPINFOW si = { 0 };
571 BOOL ret;
572
573 if (!PathFileExistsW(csc))
574 {
575 skip("Can't find csc.exe\n");
576 return FALSE;
577 }
578
579 swprintf(cmdline, ARRAY_SIZE(cmdline), L"%s /t:%s %s /out:\"%s\" \"%s\"", csc, type, args, target, source);
580
581 si.cb = sizeof(si);
583 ok(ret, "Could not create process: %lu\n", GetLastError());
584
588
590 ok(ret, "Compilation failed\n");
591
592 return ret;
593}
594
596{
598 BOOL try_tmpdir = TRUE;
599 static unsigned i = 0;
600
602
603 while (1)
604 {
605 swprintf(newdir, MAX_PATH, L"%s\\%s%04d", path, prefix, i);
606 if (CreateDirectoryW(newdir, NULL))
607 return TRUE;
608 switch (GetLastError())
609 {
611 if (!try_tmpdir)
612 return FALSE;
613 try_tmpdir = FALSE;
615 path[wcslen(path) - 1] = 0; /* redundant trailing backslash */
616 break;
618 i++;
619 break;
620 default:
621 return FALSE;
622 }
623 }
624}
625
626static void test_loadpaths_execute(const WCHAR *exe_name, const WCHAR *dll_name, const WCHAR *cfg_name,
627 const WCHAR *dll_dest, BOOL expect_failure, BOOL todo)
628{
629 WCHAR tmpdir[MAX_PATH], tmpexe[MAX_PATH], tmpcfg[MAX_PATH], tmpdll[MAX_PATH];
631 STARTUPINFOW si = { 0 };
632 WCHAR *ptr, *end;
633 DWORD exit_code = 0xdeadbeef, err;
634 BOOL ret;
635
636 ret = create_new_dir(tmpdir, L"loadpaths");
637 ok(ret, "failed to create a new dir %lu\n", GetLastError());
638 end = tmpdir + wcslen(tmpdir);
639
640 wcscpy(tmpexe, tmpdir);
641 PathAppendW(tmpexe, exe_name);
642 ret = CopyFileW(exe_name, tmpexe, FALSE);
643 ok(ret, "CopyFileW(%s) failed: %lu\n", debugstr_w(tmpexe), GetLastError());
644
645 if (cfg_name)
646 {
647 wcscpy(tmpcfg, tmpdir);
648 PathAppendW(tmpcfg, cfg_name);
649 ret = CopyFileW(cfg_name, tmpcfg, FALSE);
650 ok(ret, "CopyFileW(%s) failed: %lu\n", debugstr_w(tmpcfg), GetLastError());
651 }
652
653 ptr = tmpdir + wcslen(tmpdir);
654 PathAppendW(tmpdir, dll_dest);
655 while (*ptr && (ptr = wcschr(ptr + 1, '\\')))
656 {
657 *ptr = '\0';
659 ok(ret, "CreateDirectoryW(%s) failed: %lu\n", debugstr_w(tmpdir), GetLastError());
660 *ptr = '\\';
661 }
662
663 wcscpy(tmpdll, tmpdir);
664 if ((ptr = wcsrchr(tmpdir, '\\'))) *ptr = '\0';
665
666 ret = CopyFileW(dll_name, tmpdll, FALSE);
667 ok(ret, "CopyFileW(%s) failed: %lu\n", debugstr_w(tmpdll), GetLastError());
668
669 si.cb = sizeof(si);
670 ret = CreateProcessW(tmpexe, tmpexe, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
671 ok(ret, "CreateProcessW(%s) failed: %lu\n", debugstr_w(tmpexe), GetLastError());
672
673 if (expect_failure) ret = WaitForSingleObject(pi.hProcess, 2000);
674 else
675 {
677 ok(ret == WAIT_OBJECT_0, "%s: WaitForSingleObject returned %d: %lu\n", debugstr_w(dll_dest), ret, GetLastError());
678 }
679
681 if (ret == WAIT_TIMEOUT) TerminateProcess(pi.hProcess, 0xdeadbeef);
684
685 if (expect_failure) todo_wine_if(todo) ok(exit_code != 0, "%s: Succeeded to execute process\n", debugstr_w(dll_dest));
686 else ok(exit_code == 0, "%s: Failed to execute process\n", debugstr_w(dll_dest));
687
688 /* sometimes the failing process never returns, in which case cleaning up won't work */
689 if (ret == WAIT_TIMEOUT && expect_failure) return;
690
691 if (cfg_name)
692 {
693 ret = DeleteFileW(tmpcfg);
694 ok(ret, "DeleteFileW(%s) failed: %lu\n", debugstr_w(tmpcfg), GetLastError());
695 }
696 ret = DeleteFileW(tmpdll);
697 ok(ret, "DeleteFileW(%s) failed: %lu\n", debugstr_w(tmpdll), GetLastError());
698 ret = DeleteFileW(tmpexe);
699 ok(ret, "DeleteFileW(%s) failed: %lu\n", debugstr_w(tmpexe), GetLastError());
700
701 ptr = end;
702 while (ptr >= end && (ptr = wcsrchr(tmpdir, '\\')))
703 {
705 err = GetLastError();
706 ok(ret, "RemoveDirectoryW(%s) failed: %lu\n", debugstr_w(tmpdir), err);
707
708 if (!ret && err == ERROR_DIR_NOT_EMPTY)
709 {
711 HANDLE hfind;
712
713 wcscat(tmpdir, L"\\*");
714 hfind = FindFirstFileW(tmpdir, &fd);
715 while (hfind != INVALID_HANDLE_VALUE && (!wcscmp(fd.cFileName, L".") || !wcscmp(fd.cFileName, L"..")))
716 {
717 if (!FindNextFileW(hfind, &fd))
718 {
719 FindClose(hfind);
720 hfind = INVALID_HANDLE_VALUE;
721 }
722 }
723 if (hfind != INVALID_HANDLE_VALUE)
724 {
725 trace("file %s still present in tmpdir\n", debugstr_w(fd.cFileName));
726 FindClose(hfind);
727 }
728 }
729
730 *ptr = '\0';
731 }
732}
733
734static void test_loadpaths(BOOL neutral)
735{
736 static const WCHAR *loadpaths[] = {L"", L"en", L"libloadpaths", L"en\\libloadpaths"};
737 static const WCHAR *dll_source = L"loadpaths.dll.cs";
738 static const WCHAR *dll_name = L"libloadpaths.dll";
739 static const WCHAR *exe_source = L"loadpaths.exe.cs";
740 static const WCHAR *exe_name = L"loadpaths.exe";
741 static const WCHAR *cfg_name = L"loadpaths.exe.config";
742 WCHAR tmp[MAX_PATH];
743 BOOL ret;
744 int i;
745
746 DeleteFileW(dll_source);
747 ret = write_resource(dll_source, dll_source);
748 ok(ret, "Could not write resource: %lu\n", GetLastError());
749 DeleteFileW(dll_name);
750 ret = compile_cs(dll_source, dll_name, L"library", neutral ? L"-define:NEUTRAL" : L"");
751 if (!ret) return;
752 ret = DeleteFileW(dll_source);
753 ok(ret, "DeleteFileW failed: %lu\n", GetLastError());
754
755 DeleteFileW(exe_source);
756 ret = write_resource(exe_source, exe_source);
757 ok(ret, "Could not write resource: %lu\n", GetLastError());
758 DeleteFileW(exe_name);
759 ret = compile_cs(exe_source, exe_name, L"winexe", L"/reference:libloadpaths.dll");
760 if (!ret) return;
761 ret = DeleteFileW(exe_source);
762 ok(ret, "DeleteFileW failed: %lu\n", GetLastError());
763
764 DeleteFileW(cfg_name);
765 ret = write_resource(cfg_name, cfg_name);
766 ok(ret, "Could not write resource: %lu\n", GetLastError());
767
768 for (i = 0; i < ARRAY_SIZE(loadpaths); ++i)
769 {
770 const WCHAR *path = loadpaths[i];
771 BOOL expect_failure = neutral ? wcsstr(path, L"en") != NULL
772 : wcsstr(path, L"en") == NULL;
773
774 wcscpy(tmp, path);
775 PathAppendW(tmp, dll_name);
776 test_loadpaths_execute(exe_name, dll_name, NULL, tmp, expect_failure, !neutral && !*path);
777
778 wcscpy(tmp, L"private");
779 if (*path) PathAppendW(tmp, path);
780 PathAppendW(tmp, dll_name);
781
782 test_loadpaths_execute(exe_name, dll_name, NULL, tmp, TRUE, FALSE);
783 test_loadpaths_execute(exe_name, dll_name, cfg_name, tmp, expect_failure, FALSE);
784
785 /* exe name for dll should work too */
786 if (*path)
787 {
788 wcscpy(tmp, path);
789 PathAppendW(tmp, dll_name);
790 wcscpy(tmp + wcslen(tmp) - 4, L".exe");
791 test_loadpaths_execute(exe_name, dll_name, NULL, tmp, expect_failure, FALSE);
792 }
793
794 wcscpy(tmp, L"private");
795 if (*path) PathAppendW(tmp, path);
796 PathAppendW(tmp, dll_name);
797 wcscpy(tmp + wcslen(tmp) - 4, L".exe");
798
799 test_loadpaths_execute(exe_name, dll_name, NULL, tmp, TRUE, FALSE);
800 test_loadpaths_execute(exe_name, dll_name, cfg_name, tmp, expect_failure, FALSE);
801 }
802
803 ret = DeleteFileW(cfg_name);
804 ok(ret, "DeleteFileW failed: %lu\n", GetLastError());
805 ret = DeleteFileW(exe_name);
806 ok(ret, "DeleteFileW failed: %lu\n", GetLastError());
807 ret = DeleteFileW(dll_name);
808 ok(ret, "DeleteFileW failed: %lu\n", GetLastError());
809}
810
811static void test_createdomain(void)
812{
813 static const WCHAR test_name[] = {'t','e','s','t',0};
814 static const WCHAR test2_name[] = {'t','e','s','t','2',0};
816 ICLRRuntimeInfo *runtimeinfo;
817 ICorRuntimeHost *runtimehost;
818 IUnknown *domain, *defaultdomain_unk, *defaultdomain, *newdomain_unk, *newdomain, *domainsetup,
819 *newdomain2_unk, *newdomain2;
820 HRESULT hr;
821
822 if (!pCLRCreateInstance)
823 {
824 win_skip("Function CLRCreateInstance not found.\n");
825 return;
826 }
827
828 hr = pCLRCreateInstance(&CLSID_CLRMetaHost, &IID_ICLRMetaHost, (void **)&metahost);
829 ok(SUCCEEDED(hr), "CLRCreateInstance failed, hr=%#.8lx\n", hr);
830
831 hr = ICLRMetaHost_GetRuntime(metahost, v4_0, &IID_ICLRRuntimeInfo, (void **)&runtimeinfo);
832 ok(SUCCEEDED(hr), "ICLRMetaHost::GetRuntime failed, hr=%#.8lx\n", hr);
833
834 hr = ICLRRuntimeInfo_GetInterface(runtimeinfo, &CLSID_CorRuntimeHost, &IID_ICorRuntimeHost,
835 (void **)&runtimehost);
836 ok(SUCCEEDED(hr), "ICLRRuntimeInfo::GetInterface failed, hr=%#.8lx\n", hr);
837
838 hr = ICorRuntimeHost_Start(runtimehost);
839 ok(SUCCEEDED(hr), "ICorRuntimeHost::Start failed, hr=%#.8lx\n", hr);
840
841 hr = ICorRuntimeHost_GetDefaultDomain(runtimehost, &domain);
842 ok(SUCCEEDED(hr), "ICorRuntimeHost::GetDefaultDomain failed, hr=%#.8lx\n", hr);
843
844 hr = IUnknown_QueryInterface(domain, &IID_IUnknown, (void **)&defaultdomain_unk);
845 ok(SUCCEEDED(hr), "COM object doesn't support IUnknown?!\n");
846
847 hr = IUnknown_QueryInterface(domain, &IID__AppDomain, (void **)&defaultdomain);
848 ok(SUCCEEDED(hr), "AppDomain object doesn't support _AppDomain interface\n");
849
850 IUnknown_Release(domain);
851
852 hr = ICorRuntimeHost_CreateDomain(runtimehost, test_name, NULL, &domain);
853 ok(SUCCEEDED(hr), "ICorRuntimeHost::CreateDomain failed, hr=%#.8lx\n", hr);
854
855 hr = IUnknown_QueryInterface(domain, &IID_IUnknown, (void **)&newdomain_unk);
856 ok(SUCCEEDED(hr), "COM object doesn't support IUnknown?!\n");
857
858 hr = IUnknown_QueryInterface(domain, &IID__AppDomain, (void **)&newdomain);
859 ok(SUCCEEDED(hr), "AppDomain object doesn't support _AppDomain interface\n");
860
861 IUnknown_Release(domain);
862
863 ok(defaultdomain_unk != newdomain_unk, "New and default domain objects are the same\n");
864
865 hr = ICorRuntimeHost_CreateDomainSetup(runtimehost, &domainsetup);
866 ok(SUCCEEDED(hr), "ICorRuntimeHost::CreateDomainSetup failed, hr=%#.8lx\n", hr);
867
868 hr = ICorRuntimeHost_CreateDomainEx(runtimehost, test2_name, domainsetup, NULL, &domain);
869 ok(SUCCEEDED(hr), "ICorRuntimeHost::CreateDomainEx failed, hr=%#.8lx\n", hr);
870
871 hr = IUnknown_QueryInterface(domain, &IID_IUnknown, (void **)&newdomain2_unk);
872 ok(SUCCEEDED(hr), "COM object doesn't support IUnknown?!\n");
873
874 hr = IUnknown_QueryInterface(domain, &IID__AppDomain, (void **)&newdomain2);
875 ok(SUCCEEDED(hr), "AppDomain object doesn't support _AppDomain interface\n");
876
877 IUnknown_Release(domain);
878
879 ok(defaultdomain_unk != newdomain2_unk, "New and default domain objects are the same\n");
880 ok(newdomain_unk != newdomain2_unk, "Both new domain objects are the same\n");
881
882 IUnknown_Release(newdomain2);
883 IUnknown_Release(newdomain2_unk);
884 IUnknown_Release(domainsetup);
885 IUnknown_Release(newdomain);
886 IUnknown_Release(newdomain_unk);
887 IUnknown_Release(defaultdomain);
888 IUnknown_Release(defaultdomain_unk);
889
890 ICorRuntimeHost_Release(runtimehost);
891
892 ICLRRuntimeInfo_Release(runtimeinfo);
893
894 ICLRMetaHost_Release(metahost);
895}
896
898{
899 int argc;
900 char** argv;
901
903 return;
904
906 if (argc >= 3 && !strcmp(argv[2], "check_runtime"))
907 {
908 int result = check_runtime();
910 exit(result);
911 }
912
917
918 if (runtime_is_usable())
919 {
921 }
922
925
927}
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define broken(x)
Definition: atltest.h:178
#define START_TEST(x)
Definition: atltest.h:75
#define ARRAY_SIZE(A)
Definition: main.h:20
const GUID IID_IUnknown
#define CLR_E_SHIM_RUNTIME
Definition: corerror.h:226
#define COR_E_FILENOTFOUND
Definition: corerror.h:43
#define COR_E_NULLREFERENCE
Definition: corerror.h:36
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
static IUnknown **const WCHAR v2_0[]
Definition: debugging.c:37
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LPSTR WINAPI StrStrIA(LPCSTR lpszStr, LPCSTR lpszSearch)
Definition: string.c:351
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756
#define wcsrchr
Definition: compat.h:16
#define CP_ACP
Definition: compat.h:109
#define GetProcAddress(x, y)
Definition: compat.h:753
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
#define CreateFileW
Definition: compat.h:741
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define WideCharToMultiByte
Definition: compat.h:111
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define lstrlenW
Definition: compat.h:750
static const WCHAR version[]
Definition: asmname.c:66
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
Definition: copy.c:365
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:58
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
Definition: dir.c:700
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
Definition: loader.c:111
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:1999
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4442
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1166
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1376
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
LPVOID WINAPI LockResource(HGLOBAL handle)
Definition: res.c:550
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
BOOL WINAPI PathFileExistsW(const WCHAR *path)
Definition: path.c:2607
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(const char *app_name, char *cmd_line, SECURITY_ATTRIBUTES *process_attr, SECURITY_ATTRIBUTES *thread_attr, BOOL inherit, DWORD flags, void *env, const char *cur_dir, STARTUPINFOA *startup_info, PROCESS_INFORMATION *info)
Definition: process.c:686
MonoAssembly int argc
Definition: metahost.c:107
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2983
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1972
_ACRTIMP wchar_t *__cdecl wcsstr(const wchar_t *, const wchar_t *)
Definition: wcs.c:2993
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3319
#define swprintf
Definition: precomp.h:40
return ret
Definition: mutex.c:146
#define L(x)
Definition: resources.c:13
#define INFINITE
Definition: serial.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLuint64EXT * result
Definition: glext.h:11304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
const char * filename
Definition: ioapi.h:137
#define debugstr_w
Definition: kernel32.h:32
#define wine_dbgstr_w
Definition: kernel32.h:34
WCHAR dllpath[MAX_PATH]
#define win_skip
Definition: minitest.h:67
#define todo_wine_if(is_todo)
Definition: minitest.h:81
#define CREATE_ALWAYS
Definition: disk.h:72
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
static PVOID ptr
Definition: dispmode.c:27
#define sprintf
Definition: sprintf.c:45
static DWORD path_len
Definition: batch.c:31
BOOL todo
Definition: filedlg.c:313
static const WCHAR nonexistent[]
Definition: font.c:33
static const char * test_name
Definition: run.c:177
static PROCESS_INFORMATION pi
Definition: debugger.c:2303
static UINT exit_code
Definition: process.c:80
static SYSTEM_INFO si
Definition: virtual.c:39
static ICLRMetaHost * metahost
Definition: metahost.c:42
#define argv
Definition: mplay32.c:18
static int check_runtime(void)
Definition: mscoree.c:85
static void test_createdomain(void)
Definition: mscoree.c:811
static BOOL init_functionpointers(void)
Definition: mscoree.c:54
static BOOL write_resource(const WCHAR *resource, const WCHAR *filename)
Definition: mscoree.c:540
static DWORD
Definition: mscoree.c:43
static DWORD *static INT *static DWORD *static LPCWSTR
Definition: mscoree.c:46
static const char xmldata[]
Definition: mscoree.c:413
static void test_createconfigstream(void)
Definition: mscoree.c:431
static DWORD *static INT *static DWORD *static DWORD DWORD *static HMODULE *static IStream **static REFIID
Definition: mscoree.c:49
static void create_xml_file(LPCWSTR filename)
Definition: mscoree.c:421
static BOOL create_new_dir(WCHAR newdir[MAX_PATH], const WCHAR *prefix)
Definition: mscoree.c:595
static DWORD *static INT *static DWORD *static LPWSTR
Definition: mscoree.c:46
static DWORD *static INT *static DWORD *static DWORD DWORD *static HMODULE *static IStream **static VOID **static VOID **static BOOL no_legacy_runtimes
Definition: mscoree.c:52
static DWORD *static INT *static DWORD *static DWORD DWORD *static LPVOID
Definition: mscoree.c:47
static HMODULE hmscoree
Definition: mscoree.c:41
static void test_versioninfo(void)
Definition: mscoree.c:172
static int has_mono
Definition: mscoree.c:32
static void test_createinstance(void)
Definition: mscoree.c:512
static BOOL runtime_is_usable(void)
Definition: mscoree.c:134
static void test_loadpaths_execute(const WCHAR *exe_name, const WCHAR *dll_name, const WCHAR *cfg_name, const WCHAR *dll_dest, BOOL expect_failure, BOOL todo)
Definition: mscoree.c:626
static void test_loadpaths(BOOL neutral)
Definition: mscoree.c:734
static void test_loadlibraryshim(void)
Definition: mscoree.c:304
static const WCHAR v4_0[]
Definition: mscoree.c:39
static BOOL compile_cs(const WCHAR *source, const WCHAR *target, const WCHAR *type, const WCHAR *args)
Definition: mscoree.c:565
@ RUNTIME_INFO_UPGRADE_VERSION
Definition: mscoree.idl:40
#define GENERIC_WRITE
Definition: nt_native.h:90
#define PathAppendW
Definition: pathcch.h:310
#define RT_RCDATA
Definition: pedump.c:372
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
Definition: guiddef.h:68
#define REFCLSID
Definition: guiddef.h:117
#define err(...)
wcscat
wcscpy
int winetest_get_mainargs(char ***pargv)
#define wait_child_process
Definition: test.h:177
#define exit(n)
Definition: config.h:202
static int fd
Definition: io.c:51
#define memset(x, y, z)
Definition: compat.h:39
static PVOID hdll
Definition: shimdbg.c:126
static char tmpdir[MAX_PATH]
Definition: shlexec.c:52
HRESULT hr
Definition: shlfolder.c:183
TCHAR * cmdline
Definition: stretchblt.cpp:32
Definition: match.c:390
Definition: cookie.c:42
Definition: fci.c:127
Definition: txthost.c:37
Definition: send.c:48
Definition: parse.h:23
Definition: tools.h:99
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
Character const *const prefix
Definition: tempnam.cpp:195
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG
Definition: typedefs.h:59
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WAIT_OBJECT_0
Definition: winbase.h:383
#define DETACHED_PROCESS
Definition: winbase.h:183
#define HRESULT
Definition: msvc.h:7
#define WINAPI
Definition: msvc.h:6
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define E_NOT_SUFFICIENT_BUFFER
Definition: winerror.h:3437
#define E_HANDLE
Definition: winerror.h:4117
#define ERROR_DIR_NOT_EMPTY
Definition: winerror.h:339
#define ERROR_PROC_NOT_FOUND
Definition: winerror.h:321
#define E_POINTER
Definition: winerror.h:3480
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175