summaryrefslogtreecommitdiff
path: root/src/vm/assemblyspec.cpp
diff options
context:
space:
mode:
authorJeremy Koritzinsky <jkoritzinsky@gmail.com>2019-04-04 11:04:13 -0700
committerGitHub <noreply@github.com>2019-04-04 11:04:13 -0700
commitfdc9998609263d9f531079e2cbe0f3f31eba3382 (patch)
tree2901d0c8a9aae057825289290547b65eaaa489ec /src/vm/assemblyspec.cpp
parent8a13881ea1d274067ac03b317fdbd9bcc9369990 (diff)
downloadcoreclr-fdc9998609263d9f531079e2cbe0f3f31eba3382.tar.gz
coreclr-fdc9998609263d9f531079e2cbe0f3f31eba3382.tar.bz2
coreclr-fdc9998609263d9f531079e2cbe0f3f31eba3382.zip
Runtime support for upcoming .NET Core WinRT Host (#23402)
* First pass at adding winrt host entry-point. * There's no way to specify HResult-swapping on a function called via hosted-interop so just return the HResult instead. * Use the WindowsRuntimeMarshal class to create the activation factory and initialize it. * Implement loading the dependent assemblies of a WinRT assembly into an isolated load context. * PR Feedback. * Fail to get the activation factory if the found type is not a managed type exported from a winmd. * Rearrange parameters based on PR feedback. * Remove unneeded include. * Make ActivationFactoryLoader internal. * Fix null-ref in WinRT-dependent-assembly loading * Remove extraneous "System."
Diffstat (limited to 'src/vm/assemblyspec.cpp')
-rw-r--r--src/vm/assemblyspec.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/vm/assemblyspec.cpp b/src/vm/assemblyspec.cpp
index a2323afe6b..a044456ff9 100644
--- a/src/vm/assemblyspec.cpp
+++ b/src/vm/assemblyspec.cpp
@@ -870,8 +870,18 @@ ICLRPrivBinder* AssemblySpec::GetBindingContextFromParentAssembly(AppDomain *pDo
// types being referenced from Windows.Foundation.Winmd).
//
// If the AssemblySpec does not correspond to WinRT type but our parent assembly binder is a WinRT binder,
- // then such an assembly will not be found by the binder. In such a case, we reset our binder reference.
+ // then such an assembly will not be found by the binder.
+ // In such a case, the parent binder should be the fallback binder for the WinRT assembly if one exists.
+ ICLRPrivBinder* pParentWinRTBinder = pParentAssemblyBinder;
pParentAssemblyBinder = NULL;
+ ReleaseHolder<ICLRPrivAssemblyID_WinRT> assembly;
+ if (SUCCEEDED(pParentWinRTBinder->QueryInterface<ICLRPrivAssemblyID_WinRT>(&assembly)))
+ {
+ pParentAssemblyBinder = dac_cast<PTR_CLRPrivAssemblyWinRT>(assembly.GetValue())->GetFallbackBinder();
+
+ // The fallback binder should not be a WinRT binder.
+ _ASSERTE(!AreSameBinderInstance(pWinRTBinder, pParentAssemblyBinder));
+ }
}
}
#endif // defined(FEATURE_COMINTEROP)