31#if !defined(__i386__) && !defined(__x86_64__)
37DEFINE_GUID(IID__AppDomain, 0x05f696dc,0x2b29,0x3663,0xad,0x8b,0xc4,0x38,0x9c,0xf2,0xa7,0x13);
39static const WCHAR v4_0[] = {
'v',
'4',
'.',
'0',
'.',
'3',
'0',
'3',
'1',
'9',0};
46static HRESULT (
WINAPI *pGetRequestedRuntimeInfo)(
LPCWSTR,
LPCWSTR,
LPCWSTR,
DWORD,
DWORD,
LPWSTR,
DWORD,
DWORD*,
LPWSTR,
DWORD,
DWORD*);
60 win_skip(
"mscoree.dll not available\n");
73 if (!pGetCORVersion || !pGetCORSystemDirectory || !pGetRequestedRuntimeInfo || !pLoadLibraryShim ||
74 !pCreateInterface || !pCLRCreateInstance || !pCorIsLatestSvc
77 win_skip(
"functions not available\n");
88 ICLRRuntimeInfo *runtimeinfo;
92 if (!pCLRCreateInstance)
94 win_skip(
"Function CLRCreateInstance not found.\n");
98 hr = pCLRCreateInstance(&CLSID_CLRMetaHost, &IID_ICLRMetaHost, (
void **)&
metahost);
101 win_skip(
"CLRCreateInstance not implemented\n");
108 hr = ICLRMetaHost_GetRuntime(
metahost,
v4_0, &IID_ICLRRuntimeInfo, (
void **)&runtimeinfo);
113 hr = ICLRRuntimeInfo_GetInterface(runtimeinfo, &CLSID_CorRuntimeHost, &IID_ICorRuntimeHost,
114 (
void **)&runtimehost);
119 hr = ICorRuntimeHost_Start(runtimehost);
124 ICorRuntimeHost_Release(runtimehost);
126 ICLRRuntimeInfo_Release(runtimeinfo);
128 ICLRMetaHost_ExitProcess(
metahost, 0);
130 ok(0,
"ICLRMetaHost_ExitProcess is not supposed to return\n");
136 static const char cmdline_format[] =
"\"%s\" mscoree check_runtime";
163 if (!
ret || exitcode != 0)
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};
196 win_skip(
"No legacy .NET runtimes are installed\n");
203 ok(
hr ==
S_OK,
"GetCORVersion returned %08lx\n",
hr);
229 hr = pGetRequestedRuntimeInfo(
NULL,
v2_0,
NULL, 0, 0,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH, &
size);
236 hr = pGetRequestedRuntimeInfo(
NULL, v1_1,
NULL, 0, 0,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH, &
size);
241 hr = pGetRequestedRuntimeInfo(
NULL,
NULL,
NULL, 0, 0,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH, &
size);
244 hr = pGetRequestedRuntimeInfo(
NULL,
NULL,
NULL, 0,
RUNTIME_INFO_UPGRADE_VERSION,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH, &
size);
247 hr = pGetRequestedRuntimeInfo(
NULL,
v2_0,
NULL, 0, 0,
path, 1, &
path_len,
version,
MAX_PATH, &
size);
252 hr = pGetRequestedRuntimeInfo(
NULL,
v2_0,
NULL, 0, 0,
NULL,
MAX_PATH, &
path_len,
version,
MAX_PATH, &
size);
257 hr = pGetRequestedRuntimeInfo(
NULL,
v2_0,
NULL, 0, 0,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH,
NULL);
262 hr = pGetRequestedRuntimeInfo(
NULL, v2_0cap,
NULL, 0, 0,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH,
NULL);
268 hr = pGetRequestedRuntimeInfo(
NULL, v1_1,
NULL, 0,
RUNTIME_INFO_UPGRADE_VERSION,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH,
NULL);
279 hr = pGetRequestedRuntimeInfo(
NULL, v9_0,
NULL, 0,
RUNTIME_INFO_UPGRADE_VERSION,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH,
NULL);
283 hr = pGetRequestedRuntimeInfo(
NULL, v1_1_0,
NULL, 0, 0,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH,
NULL);
287 hr = pGetRequestedRuntimeInfo(
NULL, v1_1_0,
NULL, 0,
RUNTIME_INFO_UPGRADE_VERSION,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH,
NULL);
292 hr = pGetRequestedRuntimeInfo(
NULL, v2_0_0,
NULL, 0, 0,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH,
NULL);
296 hr = pGetRequestedRuntimeInfo(
NULL, v2_0_0,
NULL, 0,
RUNTIME_INFO_UPGRADE_VERSION,
path,
MAX_PATH, &
path_len,
version,
MAX_PATH,
NULL);
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};
321 win_skip(
"No legacy .NET runtimes are installed\n");
325 hr = pLoadLibraryShim(fusion, v1_1,
NULL, &
hdll);
369 hr = pLoadLibraryShim(fusion, vbogus,
NULL, &
hdll);
377 ok(
hr ==
S_OK,
"LoadLibraryShim failed, hr=%lx\n",
hr);
390 ok(
hr ==
S_OK,
"LoadLibraryShim failed, hr=%lx\n",
hr);
402 hr = pLoadLibraryShim(nosuchdll, latest,
NULL, &
hdll);
407 hr = pLoadLibraryShim(gdidll, latest,
NULL, &
hdll);
414 "<?xml version=\"1.0\" ?>\n"
415 "<!DOCTYPE Config>\n"
417 " <Name>Test</Name>\n"
418 " <Value>1234</Value>\n"
423 DWORD dwNumberOfBytesWritten;
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};
440 if (!pCreateConfigStream)
442 win_skip(
"CreateConfigStream not available\n");
453 "CreateConfigStream returned %lx\n",
hr);
466 ok(
hr ==
S_OK,
"CreateConfigStream failed, hr=%lx\n",
hr);
478 ok(
hr ==
S_OK,
"IStream_Read failed, hr=%lx\n",
hr);
483 ok(
hr ==
S_OK,
"IStream_Read failed, hr=%lx\n",
hr);
487 ok(
hr ==
E_FAIL,
"IStream_Write returned hr=%lx\n",
hr);
497 hr = IStream_Clone(
stream, &stream2);
500 hr = IStream_Commit(
stream, STGC_DEFAULT);
507 ok(!
ref,
"IStream_Release returned %lu\n",
ref);
520 ok(pCreateInterface !=
NULL,
"no legacy runtimes or .NET 4 interfaces available\n");
523 if(!pCreateInterface)
525 win_skip(
"Function CreateInterface not found.\n");
529 hr = pCreateInterface(&CLSID_CLRMetaHost, &IID_ICLRMetaHost, (
void**)&
host);
532 ICLRMetaHost_Release(
host);
536 win_skip(
".NET 4 not installed.\n");
549 if (!rsrc)
return FALSE;
567 static const WCHAR *csc =
L"C:\\windows\\Microsoft.NET\\Framework\\v2.0.50727\\csc.exe";
575 skip(
"Can't find csc.exe\n");
590 ok(
ret,
"Compilation failed\n");
599 static unsigned i = 0;
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";
750 ret =
compile_cs(dll_source, dll_name,
L"library", neutral ?
L"-define:NEUTRAL" :
L"");
759 ret =
compile_cs(exe_source, exe_name,
L"winexe",
L"/reference:libloadpaths.dll");
814 static const WCHAR test2_name[] = {
't',
'e',
's',
't',
'2',0};
816 ICLRRuntimeInfo *runtimeinfo;
818 IUnknown *
domain, *defaultdomain_unk, *defaultdomain, *newdomain_unk, *newdomain, *domainsetup,
819 *newdomain2_unk, *newdomain2;
822 if (!pCLRCreateInstance)
824 win_skip(
"Function CLRCreateInstance not found.\n");
828 hr = pCLRCreateInstance(&CLSID_CLRMetaHost, &IID_ICLRMetaHost, (
void **)&
metahost);
831 hr = ICLRMetaHost_GetRuntime(
metahost,
v4_0, &IID_ICLRRuntimeInfo, (
void **)&runtimeinfo);
834 hr = ICLRRuntimeInfo_GetInterface(runtimeinfo, &CLSID_CorRuntimeHost, &IID_ICorRuntimeHost,
835 (
void **)&runtimehost);
836 ok(
SUCCEEDED(
hr),
"ICLRRuntimeInfo::GetInterface failed, hr=%#.8lx\n",
hr);
838 hr = ICorRuntimeHost_Start(runtimehost);
841 hr = ICorRuntimeHost_GetDefaultDomain(runtimehost, &
domain);
842 ok(
SUCCEEDED(
hr),
"ICorRuntimeHost::GetDefaultDomain failed, hr=%#.8lx\n",
hr);
845 ok(
SUCCEEDED(
hr),
"COM object doesn't support IUnknown?!\n");
847 hr = IUnknown_QueryInterface(
domain, &IID__AppDomain, (
void **)&defaultdomain);
848 ok(
SUCCEEDED(
hr),
"AppDomain object doesn't support _AppDomain interface\n");
853 ok(
SUCCEEDED(
hr),
"ICorRuntimeHost::CreateDomain failed, hr=%#.8lx\n",
hr);
856 ok(
SUCCEEDED(
hr),
"COM object doesn't support IUnknown?!\n");
858 hr = IUnknown_QueryInterface(
domain, &IID__AppDomain, (
void **)&newdomain);
859 ok(
SUCCEEDED(
hr),
"AppDomain object doesn't support _AppDomain interface\n");
863 ok(defaultdomain_unk != newdomain_unk,
"New and default domain objects are the same\n");
865 hr = ICorRuntimeHost_CreateDomainSetup(runtimehost, &domainsetup);
866 ok(
SUCCEEDED(
hr),
"ICorRuntimeHost::CreateDomainSetup failed, hr=%#.8lx\n",
hr);
868 hr = ICorRuntimeHost_CreateDomainEx(runtimehost, test2_name, domainsetup,
NULL, &
domain);
869 ok(
SUCCEEDED(
hr),
"ICorRuntimeHost::CreateDomainEx failed, hr=%#.8lx\n",
hr);
872 ok(
SUCCEEDED(
hr),
"COM object doesn't support IUnknown?!\n");
874 hr = IUnknown_QueryInterface(
domain, &IID__AppDomain, (
void **)&newdomain2);
875 ok(
SUCCEEDED(
hr),
"AppDomain object doesn't support _AppDomain interface\n");
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");
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);
890 ICorRuntimeHost_Release(runtimehost);
892 ICLRRuntimeInfo_Release(runtimeinfo);
#define CLR_E_SHIM_RUNTIME
#define COR_E_FILENOTFOUND
#define COR_E_NULLREFERENCE
static IUnknown **const WCHAR v2_0[]
LPSTR WINAPI StrStrIA(LPCSTR lpszStr, LPCSTR lpszSearch)
#define GetCurrentDirectoryW(x, y)
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define FILE_ATTRIBUTE_NORMAL
#define WideCharToMultiByte
#define ERROR_ACCESS_DENIED
static const WCHAR version[]
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindClose(HANDLE hFindFile)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
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)
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
BOOL WINAPI PathFileExistsW(const WCHAR *path)
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)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
_ACRTIMP wchar_t *__cdecl wcsstr(const wchar_t *, const wchar_t *)
_ACRTIMP size_t __cdecl strlen(const char *)
_ACRTIMP int __cdecl strcmp(const char *, const char *)
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
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
#define todo_wine_if(is_todo)
#define ERROR_ALREADY_EXISTS
static const WCHAR nonexistent[]
static const char * test_name
static PROCESS_INFORMATION pi
static int check_runtime(void)
static void test_createdomain(void)
static BOOL init_functionpointers(void)
static BOOL write_resource(const WCHAR *resource, const WCHAR *filename)
static DWORD *static INT *static DWORD *static LPCWSTR
static const char xmldata[]
static void test_createconfigstream(void)
static DWORD *static INT *static DWORD *static DWORD DWORD *static HMODULE *static IStream **static REFIID
static void create_xml_file(LPCWSTR filename)
static BOOL create_new_dir(WCHAR newdir[MAX_PATH], const WCHAR *prefix)
static DWORD *static INT *static DWORD *static LPWSTR
static DWORD *static INT *static DWORD *static DWORD DWORD *static HMODULE *static IStream **static VOID **static VOID **static BOOL no_legacy_runtimes
static DWORD *static INT *static DWORD *static DWORD DWORD *static LPVOID
static void test_versioninfo(void)
static void test_createinstance(void)
static BOOL runtime_is_usable(void)
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)
static void test_loadpaths(BOOL neutral)
static void test_loadlibraryshim(void)
static const WCHAR v4_0[]
static BOOL compile_cs(const WCHAR *source, const WCHAR *target, const WCHAR *type, const WCHAR *args)
@ RUNTIME_INFO_UPGRADE_VERSION
#define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
int winetest_get_mainargs(char ***pargv)
#define wait_child_process
static char tmpdir[MAX_PATH]
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Character const *const prefix
DWORD WINAPI GetLastError(void)
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
#define E_NOT_SUFFICIENT_BUFFER
#define ERROR_DIR_NOT_EMPTY
#define ERROR_PROC_NOT_FOUND
#define MAKEINTRESOURCEW(i)