For NetCore for CoreCLR System.Uri was moved from System.dll to Internal.Uri.dll. This change updates the WinRT projection for this change.
This is a temporary workaround while we investigate a complete fix and will break phone and .NET 4.6 scenarios.
[tfs-changeset: 1457678]
DEFINE_PROJECTED_STRUCT ("Windows.Foundation", "Rect", "Windows.Foundation", "Rect", SystemRuntimeWindowsRuntime, SystemRuntimeWindowsRuntime, Windows_Foundation_Rect, Windows_Foundation_Rect_clr, STRUCT_FIELDS(W("Single"), W("Single"), W("Single"), W("Single")))
DEFINE_PROJECTED_STRUCT ("Windows.Foundation", "Size", "Windows.Foundation", "Size", SystemRuntimeWindowsRuntime, SystemRuntimeWindowsRuntime, Windows_Foundation_Size, Windows_Foundation_Size_clr, STRUCT_FIELDS(W("Single"), W("Single")))
DEFINE_PROJECTED_STRUCT ("Windows.Foundation", "TimeSpan", "System", "TimeSpan", Mscorlib, SystemRuntime, Windows_Foundation_TimeSpan, System_TimeSpan, STRUCT_FIELDS(W("Int64")))
-DEFINE_PROJECTED_RUNTIMECLASS("Windows.Foundation", "Uri", "System", "Uri", System, SystemRuntime, Windows_Foundation_Uri, System_Uri, "Windows.Foundation.IUriRuntimeClass", __uuidof(ABI::Windows::Foundation::IUriRuntimeClass))
+DEFINE_PROJECTED_RUNTIMECLASS("Windows.Foundation", "Uri", "System", "Uri", InternalUri, SystemRuntime, Windows_Foundation_Uri, System_Uri, "Windows.Foundation.IUriRuntimeClass", __uuidof(ABI::Windows::Foundation::IUriRuntimeClass))
DEFINE_PROJECTED_INTERFACE ("Windows.Foundation", "IClosable", "System", "IDisposable", Mscorlib, SystemRuntime, Windows_Foundation_IClosable, System_IDisposable, PIID(0x30d5a829, 0x7fa4, 0x4026, {0x83, 0xbb, 0xd7, 0x5b, 0xae, 0x4e, 0xa9, 0x9e}))
else
#endif
{
- if (index == FrameworkAssembly_SystemNumericsVectors)
+ if (index == FrameworkAssembly_SystemNumericsVectors || index == FrameworkAssembly_InternalUri)
{
*ppPublicKeytoken = s_pbContractPublicKeyToken;
*pTokenLength = sizeof(s_pbContractPublicKeyToken);
FrameworkAssembly_SystemRuntimeWindowsRuntime,
FrameworkAssembly_SystemRuntimeWindowsRuntimeUIXaml,
FrameworkAssembly_SystemNumericsVectors,
+ FrameworkAssembly_InternalUri,
FrameworkAssembly_Count,
};
return "System.Runtime.WindowsRuntime.UI.Xaml";
case FrameworkAssembly_SystemNumericsVectors:
return "System.Numerics.Vectors";
+ case FrameworkAssembly_InternalUri:
+ return "Internal.Uri";
default:
_ASSERTE(!"Invalid AssemblyRef token!");
return NULL;
m_pSystemRuntimeWindowsRuntimeDll = nullptr;
m_pSystemRuntimeWindowsRuntimeUIXamlDll = nullptr;
m_pSystemNumericsVectors = nullptr;
+ m_pInternalUri = nullptr;
#endif // FEATURE_COMINTEROP
m_pUMEntryThunkCache = NULL;
*pIndex = WinMDAdapter::FrameworkAssembly_SystemNumericsVectors;
return true;
}
+ else if (pDomainAssembly == m_pInternalUri)
+ {
+ *pIndex = WinMDAdapter::FrameworkAssembly_InternalUri;
+ return true;
+ }
return false;
}
LIMITED_METHOD_CONTRACT;
// If new redirected assemblies are added, this function probably needs to be updated
- C_ASSERT(WinMDAdapter::FrameworkAssembly_Count == 5);
+ C_ASSERT(WinMDAdapter::FrameworkAssembly_Count == 6);
DomainAssembly * pDomainAssembly = NULL;
{
pDomainAssembly = m_pSystemNumericsVectors;
}
+ else if (index == WinMDAdapter::FrameworkAssembly_InternalUri)
+ {
+ pDomainAssembly = m_pInternalUri;
+ }
if (pDomainAssembly != NULL)
{
}
}
}
+ if (m_pInternalUri == nullptr)
+ {
+ PEAssembly *pPEAssembly = assem->GetFile();
+
+ if (strcmp("Internal.Uri", pPEAssembly->GetSimpleName()) == 0)
+ {
+ DWORD cbPublicKey;
+ const BYTE *pbPublicKey = static_cast<const BYTE *>(pPEAssembly->GetPublicKey(&cbPublicKey));
+
+ if (cbPublicKey == sizeof(s_pbContractPublicKey) && memcmp(pbPublicKey, s_pbContractPublicKey, cbPublicKey) == 0)
+ {
+ m_pInternalUri = assem;
+ }
+ }
+ }
#endif // FEATURE_COMINTEROP
}
PTR_DomainAssembly m_pSystemRuntimeWindowsRuntimeDll; // System.Runtime.WindowsRuntime.dll loaded into this domain
PTR_DomainAssembly m_pSystemRuntimeWindowsRuntimeUIXamlDll; // System.Runtime.WindowsRuntime.UI.Xaml.dll loaded into this domain
PTR_DomainAssembly m_pSystemNumericsVectors; // System.Numerics.Vectors.dll loaded into this domain
+ PTR_DomainAssembly m_pInternalUri; // Internal.Uri.dll loaded into this domain
public:
BOOL FindRedirectedAssemblyFromIndexIfLoaded(WinMDAdapter::FrameworkAssemblyIndex index, Assembly** ppAssembly);