diff options
author | Jim Ma <mazong1123@gmail.com> | 2017-04-19 16:39:23 +0000 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-04-19 11:39:23 -0500 |
commit | 1399794fd221fc97bce1a3b1f1fe4dbb03c8686d (patch) | |
tree | 12cd3cbd894e2a1ae7e40da3c3a1a63503c1c8b3 /src/coreclr | |
parent | e8414af792d6a2082d0cb1c5133344e9af0f2982 (diff) | |
download | coreclr-1399794fd221fc97bce1a3b1f1fe4dbb03c8686d.tar.gz coreclr-1399794fd221fc97bce1a3b1f1fe4dbb03c8686d.tar.bz2 coreclr-1399794fd221fc97bce1a3b1f1fe4dbb03c8686d.zip |
Change ICLRRuntimeHost2 to ICLRRuntimeHost4 for Windows corerun. (#10967)
* Change ICLRRuntimeHost2 to ICLRRuntimeHost4 for Windows corerun.
Since we've introduced ICLRRuntimeHost4 in PR #10842 for Unix, we apply it for Windows corerun as well.
Fix #10960
Diffstat (limited to 'src/coreclr')
-rw-r--r-- | src/coreclr/hosts/coreconsole/coreconsole.cpp | 24 | ||||
-rw-r--r-- | src/coreclr/hosts/corerun/corerun.cpp | 24 |
2 files changed, 26 insertions, 22 deletions
diff --git a/src/coreclr/hosts/coreconsole/coreconsole.cpp b/src/coreclr/hosts/coreconsole/coreconsole.cpp index ea4e2e72c5..e3813d49b3 100644 --- a/src/coreclr/hosts/coreconsole/coreconsole.cpp +++ b/src/coreclr/hosts/coreconsole/coreconsole.cpp @@ -71,7 +71,7 @@ class HostEnvironment // The list of paths to the assemblies that will be trusted by CoreCLR StringBuffer m_tpaList; - ICLRRuntimeHost2* m_CLRRuntimeHost; + ICLRRuntimeHost4* m_CLRRuntimeHost; HMODULE m_coreCLRModule; @@ -326,8 +326,8 @@ public: return m_hostExeName; } - // Returns the ICLRRuntimeHost2 instance, loading it from CoreCLR.dll if necessary, or nullptr on failure. - ICLRRuntimeHost2* GetCLRRuntimeHost() { + // Returns the ICLRRuntimeHost4 instance, loading it from CoreCLR.dll if necessary, or nullptr on failure. + ICLRRuntimeHost4* GetCLRRuntimeHost() { if (!m_CLRRuntimeHost) { if (!m_coreCLRModule) { @@ -347,9 +347,9 @@ public: *m_log << W("Calling GetCLRRuntimeHost(...)") << Logger::endl; - HRESULT hr = pfnGetCLRRuntimeHost(IID_ICLRRuntimeHost2, (IUnknown**)&m_CLRRuntimeHost); + HRESULT hr = pfnGetCLRRuntimeHost(IID_ICLRRuntimeHost4, (IUnknown**)&m_CLRRuntimeHost); if (FAILED(hr)) { - *m_log << W("Failed to get ICLRRuntimeHost2 interface. ERRORCODE: ") << hr << Logger::endl; + *m_log << W("Failed to get ICLRRuntimeHost4 interface. ERRORCODE: ") << hr << Logger::endl; return nullptr; } } @@ -405,14 +405,14 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo // Start the CoreCLR - ICLRRuntimeHost2 *host = hostEnvironment.GetCLRRuntimeHost(); + ICLRRuntimeHost4 *host = hostEnvironment.GetCLRRuntimeHost(); if (!host) { return false; } HRESULT hr; - log << W("Setting ICLRRuntimeHost2 startup flags") << Logger::endl; + log << W("Setting ICLRRuntimeHost4 startup flags") << Logger::endl; // Default startup flags hr = host->SetStartupFlags((STARTUP_FLAGS) @@ -424,7 +424,7 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo return false; } - log << W("Starting ICLRRuntimeHost2") << Logger::endl; + log << W("Starting ICLRRuntimeHost4") << Logger::endl; hr = host->Start(); if (FAILED(hr)) { @@ -541,15 +541,17 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo log << W("Unloading the AppDomain") << Logger::endl; - hr = host->UnloadAppDomain( + hr = host->UnloadAppDomain2( domainId, - true); // Wait until done + true, + (int *)&exitCode); // Wait until done if (FAILED(hr)) { log << W("Failed to unload the AppDomain. ERRORCODE: ") << hr << Logger::endl; return false; } + log << W("App domain unloaded exit value = ") << exitCode << Logger::endl; //------------------------------------------------------------- @@ -568,7 +570,7 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo // Release the reference to the host - log << W("Releasing ICLRRuntimeHost2") << Logger::endl; + log << W("Releasing ICLRRuntimeHost4") << Logger::endl; host->Release(); diff --git a/src/coreclr/hosts/corerun/corerun.cpp b/src/coreclr/hosts/corerun/corerun.cpp index dfbb79c0d2..c65c626615 100644 --- a/src/coreclr/hosts/corerun/corerun.cpp +++ b/src/coreclr/hosts/corerun/corerun.cpp @@ -47,7 +47,7 @@ class HostEnvironment // The list of paths to the assemblies that will be trusted by CoreCLR SString m_tpaList; - ICLRRuntimeHost2* m_CLRRuntimeHost; + ICLRRuntimeHost4* m_CLRRuntimeHost; HMODULE m_coreCLRModule; @@ -298,8 +298,8 @@ public: return m_hostExeName; } - // Returns the ICLRRuntimeHost2 instance, loading it from CoreCLR.dll if necessary, or nullptr on failure. - ICLRRuntimeHost2* GetCLRRuntimeHost() { + // Returns the ICLRRuntimeHost4 instance, loading it from CoreCLR.dll if necessary, or nullptr on failure. + ICLRRuntimeHost4* GetCLRRuntimeHost() { if (!m_CLRRuntimeHost) { if (!m_coreCLRModule) { @@ -319,9 +319,9 @@ public: *m_log << W("Calling GetCLRRuntimeHost(...)") << Logger::endl; - HRESULT hr = pfnGetCLRRuntimeHost(IID_ICLRRuntimeHost2, (IUnknown**)&m_CLRRuntimeHost); + HRESULT hr = pfnGetCLRRuntimeHost(IID_ICLRRuntimeHost4, (IUnknown**)&m_CLRRuntimeHost); if (FAILED(hr)) { - *m_log << W("Failed to get ICLRRuntimeHost2 interface. ERRORCODE: ") << Logger::hresult << hr << Logger::endl; + *m_log << W("Failed to get ICLRRuntimeHost4 interface. ERRORCODE: ") << Logger::hresult << hr << Logger::endl; return nullptr; } } @@ -442,7 +442,7 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo // Start the CoreCLR - ICLRRuntimeHost2 *host = hostEnvironment.GetCLRRuntimeHost(); + ICLRRuntimeHost4 *host = hostEnvironment.GetCLRRuntimeHost(); if (!host) { return false; } @@ -451,7 +451,7 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo STARTUP_FLAGS flags = CreateStartupFlags(); - log << W("Setting ICLRRuntimeHost2 startup flags") << Logger::endl; + log << W("Setting ICLRRuntimeHost4 startup flags") << Logger::endl; log << W("Server GC enabled: ") << HAS_FLAG(flags, STARTUP_FLAGS::STARTUP_SERVER_GC) << Logger::endl; log << W("Concurrent GC enabled: ") << HAS_FLAG(flags, STARTUP_FLAGS::STARTUP_CONCURRENT_GC) << Logger::endl; @@ -462,7 +462,7 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo return false; } - log << W("Starting ICLRRuntimeHost2") << Logger::endl; + log << W("Starting ICLRRuntimeHost4") << Logger::endl; hr = host->Start(); if (FAILED(hr)) { @@ -581,15 +581,17 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo log << W("Unloading the AppDomain") << Logger::endl; - hr = host->UnloadAppDomain( + hr = host->UnloadAppDomain2( domainId, - true); // Wait until done + true, + (int *)&exitCode); // Wait until done if (FAILED(hr)) { log << W("Failed to unload the AppDomain. ERRORCODE: ") << Logger::hresult << hr << Logger::endl; return false; } + log << W("App domain unloaded exit value = ") << exitCode << Logger::endl; //------------------------------------------------------------- @@ -608,7 +610,7 @@ bool TryRun(const int argc, const wchar_t* argv[], Logger &log, const bool verbo // Release the reference to the host - log << W("Releasing ICLRRuntimeHost2") << Logger::endl; + log << W("Releasing ICLRRuntimeHost4") << Logger::endl; host->Release(); |