diff options
Diffstat (limited to 'src/dlls')
-rw-r--r-- | src/dlls/mscordac/mscordac_unixexports.src | 5 | ||||
-rw-r--r-- | src/dlls/mscoree/coreclr/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/dlls/mscoree/mscoree.cpp | 2 | ||||
-rw-r--r-- | src/dlls/mscoree/mscorwks_ntdef.src | 1 | ||||
-rw-r--r-- | src/dlls/mscoree/mscorwks_unixexports.src | 1 | ||||
-rw-r--r-- | src/dlls/mscoree/unixinterface.cpp | 41 |
6 files changed, 48 insertions, 6 deletions
diff --git a/src/dlls/mscordac/mscordac_unixexports.src b/src/dlls/mscordac/mscordac_unixexports.src index ab73c4fcb8..b0c3b0463c 100644 --- a/src/dlls/mscordac/mscordac_unixexports.src +++ b/src/dlls/mscordac/mscordac_unixexports.src @@ -21,9 +21,11 @@ PAL_GetPALDirectoryW PAL_GetResourceString PAL_get_stdout PAL_get_stderr +PAL_GetCurrentThread PAL_GetSymbolModuleBase PAL_GetTransportPipeName PAL_InitializeDLL +PAL_TerminateEx PAL_IsDebuggerPresent PAL_ProbeMemory PAL_iswspace @@ -119,6 +121,9 @@ IID_IClassFactory IID_ISequentialStream IID_IStream IID_IUnknown +IID_ICLRDataTarget +IID_ICorDebugDataTarget4 +IID_ICLRDataEnumMemoryRegionsCallback InitializeCriticalSection IsDBCSLeadByte LeaveCriticalSection diff --git a/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/dlls/mscoree/coreclr/CMakeLists.txt index 3144b5139f..afa253f08f 100644 --- a/src/dlls/mscoree/coreclr/CMakeLists.txt +++ b/src/dlls/mscoree/coreclr/CMakeLists.txt @@ -5,6 +5,10 @@ if (WIN32) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ENTRY:CoreDllMain") + # Incremental linking results in the linker inserting extra padding and routing function calls via thunks that can break the + # invariants (e.g. size of region between Jit_PatchedCodeLast-Jit_PatchCodeStart needs to fit in a page). + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /INCREMENTAL:NO") + # Delay load libraries required for WinRT as that is not supported on all platforms set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:api-ms-win-core-winrt-string-l1-1-0.dll") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll") diff --git a/src/dlls/mscoree/mscoree.cpp b/src/dlls/mscoree/mscoree.cpp index f33f0955e4..f3e22da46b 100644 --- a/src/dlls/mscoree/mscoree.cpp +++ b/src/dlls/mscoree/mscoree.cpp @@ -48,7 +48,7 @@ HINSTANCE g_hThisInst; // This library. #include <process.h> // for __security_init_cookie() -extern "C" IExecutionEngine* __stdcall IEE(); +extern "C" IExecutionEngine* IEE(); #ifdef NO_CRT_INIT #define _CRT_INIT(hInstance, dwReason, lpReserved) (TRUE) diff --git a/src/dlls/mscoree/mscorwks_ntdef.src b/src/dlls/mscoree/mscorwks_ntdef.src index 8115475418..d7e6a2dcf4 100644 --- a/src/dlls/mscoree/mscorwks_ntdef.src +++ b/src/dlls/mscoree/mscorwks_ntdef.src @@ -21,6 +21,7 @@ EXPORTS coreclr_execute_assembly coreclr_initialize coreclr_shutdown + coreclr_shutdown_2 ; il{d}asm MetaDataGetDispenser diff --git a/src/dlls/mscoree/mscorwks_unixexports.src b/src/dlls/mscoree/mscorwks_unixexports.src index f7862d3afe..28e9ac223f 100644 --- a/src/dlls/mscoree/mscorwks_unixexports.src +++ b/src/dlls/mscoree/mscorwks_unixexports.src @@ -3,6 +3,7 @@ coreclr_create_delegate coreclr_execute_assembly coreclr_initialize coreclr_shutdown +coreclr_shutdown_2 ; il{d}asm MetaDataGetDispenser diff --git a/src/dlls/mscoree/unixinterface.cpp b/src/dlls/mscoree/unixinterface.cpp index edd361c0c2..cf9bbc5c72 100644 --- a/src/dlls/mscoree/unixinterface.cpp +++ b/src/dlls/mscoree/unixinterface.cpp @@ -183,9 +183,9 @@ int coreclr_initialize( } #endif - ReleaseHolder<ICLRRuntimeHost2> host; + ReleaseHolder<ICLRRuntimeHost4> host; - hr = CorHost2::CreateObject(IID_ICLRRuntimeHost2, (void**)&host); + hr = CorHost2::CreateObject(IID_ICLRRuntimeHost4, (void**)&host); IfFailRet(hr); ConstWStringHolder appDomainFriendlyNameW = StringToUnicode(appDomainFriendlyName); @@ -284,7 +284,7 @@ int coreclr_shutdown( void* hostHandle, unsigned int domainId) { - ReleaseHolder<ICLRRuntimeHost2> host(reinterpret_cast<ICLRRuntimeHost2*>(hostHandle)); + ReleaseHolder<ICLRRuntimeHost4> host(reinterpret_cast<ICLRRuntimeHost4*>(hostHandle)); HRESULT hr = host->UnloadAppDomain(domainId, true); // Wait until done IfFailRet(hr); @@ -299,6 +299,37 @@ int coreclr_shutdown( } // +// Shutdown CoreCLR. It unloads the app domain and stops the CoreCLR host. +// +// Parameters: +// hostHandle - Handle of the host +// domainId - Id of the domain +// latchedExitCode - Latched exit code after domain unloaded +// +// Returns: +// HRESULT indicating status of the operation. S_OK if the assembly was successfully executed +// +extern "C" +int coreclr_shutdown_2( + void* hostHandle, + unsigned int domainId, + int* latchedExitCode) +{ + ReleaseHolder<ICLRRuntimeHost4> host(reinterpret_cast<ICLRRuntimeHost4*>(hostHandle)); + + HRESULT hr = host->UnloadAppDomain2(domainId, true, latchedExitCode); // Wait until done + IfFailRet(hr); + + hr = host->Stop(); + +#ifdef FEATURE_PAL + PAL_Shutdown(); +#endif + + return hr; +} + +// // Create a native callable delegate for a managed method. // // Parameters: @@ -321,7 +352,7 @@ int coreclr_create_delegate( const char* entryPointMethodName, void** delegate) { - ICLRRuntimeHost2* host = reinterpret_cast<ICLRRuntimeHost2*>(hostHandle); + ICLRRuntimeHost4* host = reinterpret_cast<ICLRRuntimeHost4*>(hostHandle); ConstWStringHolder entryPointAssemblyNameW = StringToUnicode(entryPointAssemblyName); ConstWStringHolder entryPointTypeNameW = StringToUnicode(entryPointTypeName); @@ -366,7 +397,7 @@ int coreclr_execute_assembly( } *exitCode = -1; - ICLRRuntimeHost2* host = reinterpret_cast<ICLRRuntimeHost2*>(hostHandle); + ICLRRuntimeHost4* host = reinterpret_cast<ICLRRuntimeHost4*>(hostHandle); ConstWStringArrayHolder argvW; argvW.Set(StringArrayToUnicode(argc, argv), argc); |