-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shim coreclr policy between singlefile and standalone hosts
- Loading branch information
Showing
9 changed files
with
234 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/installer/corehost/cli/hostpolicy/standalone/coreclr_resolver_t.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
#include <cassert> | ||
#include <error_codes.h> | ||
#include <utils.h> | ||
#include "coreclr_resolver_t.h" | ||
#include <pal.h> | ||
#include <trace.h> | ||
|
||
bool coreclr_resolver_t::resolve_coreclr(const pal::string_t& libcoreclr_path, coreclr_resolver_contract_t& coreclr_resolver_contract) | ||
{ | ||
pal::string_t coreclr_dll_path(libcoreclr_path); | ||
append_path(&coreclr_dll_path, LIBCORECLR_NAME); | ||
|
||
pal::dll_t g_coreclr = nullptr; | ||
if (!pal::load_library(&coreclr_dll_path, &g_coreclr)) | ||
{ | ||
return false; | ||
} | ||
|
||
coreclr_resolver_contract.coreclr_initialize = reinterpret_cast<coreclr_initialize_fn>(pal::get_symbol(g_coreclr, "coreclr_initialize")); | ||
coreclr_resolver_contract.coreclr_shutdown = reinterpret_cast<coreclr_shutdown_fn>(pal::get_symbol(g_coreclr, "coreclr_shutdown_2")); | ||
coreclr_resolver_contract.coreclr_execute_assembly = reinterpret_cast<coreclr_execute_assembly_fn>(pal::get_symbol(g_coreclr, "coreclr_execute_assembly")); | ||
coreclr_resolver_contract.coreclr_create_delegate = reinterpret_cast<coreclr_create_delegate_fn>(pal::get_symbol(g_coreclr, "coreclr_create_delegate")); | ||
|
||
assert(coreclr_resolver_contract.coreclr_initialize != nullptr | ||
&& coreclr_resolver_contract.coreclr_shutdown != nullptr | ||
&& coreclr_resolver_contract.coreclr_execute_assembly != nullptr | ||
&& coreclr_resolver_contract.coreclr_create_delegate != nullptr); | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.