This repository was archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 216
Add host context-based entry points for native hosting #5859
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f0eaff8
Native hosting - add host context-based entry points
elinor-fung 9cc62b8
Update native host test exe to use host context entry points
elinor-fung d0f9054
Allow getting properties of active context without context handle
elinor-fung 43b8ea9
Check for initializing / already initialized context when running with
elinor-fung 5df4088
Use specific error code for getting runtime property that doesn't exist
elinor-fung 478e2cd
Update COM-activation.md
elinor-fung 30f5772
PR feedback
elinor-fung 418b185
Make native host test exe get properties of active context
elinor-fung 0912eeb
Add coreclr to hostpolicy context instead of tracking a separate global
elinor-fung b94665b
Add functions for getting context from handle
elinor-fung 377a626
Rename context instance -> handle. Add helper for tracing hostfxr entry.
elinor-fung 93b2ac9
Separate helper function to create/initialize first vs secondary context
elinor-fung 859e960
Remove exposed concept of context from hostpolicy
elinor-fung 3f9f772
Split getting init info for secondary scenario into separate function
elinor-fung 550d090
Add initialization option to block waiting for a different initializa…
elinor-fung bc5d799
Fix missed cases of handling initialize failure/abort
elinor-fung 0100d5b
PR feedback
elinor-fung 72b24f7
Add struct for corehost_initialize (instead of full host interface)
elinor-fung 14bd34f
Add basic test using context-based entry points and mock coreclr
elinor-fung f7d4fd4
Merge branch 'master' into hostContext
elinor-fung a9cacdf
Fix unix build
elinor-fung a431efa
PR feedback
elinor-fung bf32916
Fix test output messages
elinor-fung cbdf212
Rename g_context_cv -> g_context_initializing_cv
elinor-fung 4758989
Block initialization for self-contained components
elinor-fung File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,66 @@ | ||
| // 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. | ||
|
|
||
| #ifndef __COREHOST_CONTEXT_CONTRACT_H__ | ||
| #define __COREHOST_CONTEXT_CONTRACT_H__ | ||
|
|
||
| #include "host_interface.h" | ||
| #include <pal.h> | ||
|
|
||
| enum intialization_options_t : int32_t | ||
| { | ||
| none = 0x0, | ||
| wait_for_initialized = 0x1, // Wait until initialization through a different request is completed | ||
| }; | ||
|
|
||
| enum class coreclr_delegate_type | ||
| { | ||
| invalid, | ||
| com_activation, | ||
| load_in_memory_assembly, | ||
| winrt_activation | ||
| }; | ||
|
|
||
| #pragma pack(push, _HOST_INTERFACE_PACK) | ||
| struct corehost_initialize_request_t | ||
| { | ||
| size_t version; | ||
| strarr_t config_keys; | ||
| strarr_t config_values; | ||
| }; | ||
| static_assert(offsetof(corehost_initialize_request_t, version) == 0 * sizeof(size_t), "Struct offset breaks backwards compatibility"); | ||
| static_assert(offsetof(corehost_initialize_request_t, config_keys) == 1 * sizeof(size_t), "Struct offset breaks backwards compatibility"); | ||
| static_assert(offsetof(corehost_initialize_request_t, config_values) == 3 * sizeof(size_t), "Struct offset breaks backwards compatibility"); | ||
|
|
||
| struct corehost_context_contract | ||
|
elinor-fung marked this conversation as resolved.
|
||
| { | ||
| size_t version; | ||
| int (__cdecl *get_property_value)( | ||
| const pal::char_t* key, | ||
| /*out*/ const pal::char_t** value); | ||
| int (__cdecl *set_property_value)( | ||
| const pal::char_t* key, | ||
| const pal::char_t* value); | ||
| int (__cdecl *get_properties)( | ||
| /*inout*/ size_t *count, | ||
| /*out*/ const pal::char_t** keys, | ||
| /*out*/ const pal::char_t** values); | ||
| int (__cdecl *load_runtime)(); | ||
| int (__cdecl *run_app)( | ||
| const int argc, | ||
| const pal::char_t* argv[]); | ||
| int (__cdecl *get_runtime_delegate)( | ||
| coreclr_delegate_type type, | ||
| /*out*/ void** delegate); | ||
| }; | ||
| static_assert(offsetof(corehost_context_contract, version) == 0 * sizeof(size_t), "Struct offset breaks backwards compatibility"); | ||
| static_assert(offsetof(corehost_context_contract, get_property_value) == 1 * sizeof(size_t), "Struct offset breaks backwards compatibility"); | ||
| static_assert(offsetof(corehost_context_contract, set_property_value) == 2 * sizeof(size_t), "Struct offset breaks backwards compatibility"); | ||
| static_assert(offsetof(corehost_context_contract, get_properties) == 3 * sizeof(size_t), "Struct offset breaks backwards compatibility"); | ||
| static_assert(offsetof(corehost_context_contract, load_runtime) == 4 * sizeof(size_t), "Struct offset breaks backwards compatibility"); | ||
| static_assert(offsetof(corehost_context_contract, run_app) == 5 * sizeof(size_t), "Struct offset breaks backwards compatibility"); | ||
| static_assert(offsetof(corehost_context_contract, get_runtime_delegate) == 6 * sizeof(size_t), "Struct offset breaks backwards compatibility"); | ||
| #pragma pack(pop) | ||
|
|
||
| #endif // __COREHOST_CONTEXT_CONTRACT_H__ | ||
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.