summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRyan Byington <ryanbyi@microsoft.com>2015-04-21 16:15:59 -0700
committerRyan Byington <ryanbyi@microsoft.com>2015-04-21 16:15:59 -0700
commit103680193d2f61308103a113bd2dac97e0206c99 (patch)
treeca728f37a53c91d4d6cf7626bb9f6f2a8ea977c3 /src
parent55cbbaf98515d13ae6c08a28da1eb9196093e1dc (diff)
downloadcoreclr-103680193d2f61308103a113bd2dac97e0206c99.tar.gz
coreclr-103680193d2f61308103a113bd2dac97e0206c99.tar.bz2
coreclr-103680193d2f61308103a113bd2dac97e0206c99.zip
Update framework assembly for System.Uri WinRT projection from System.dll to Internal.Uri.dll
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]
Diffstat (limited to 'src')
-rw-r--r--src/inc/winrtprojectedtypes.h2
-rw-r--r--src/md/winmd/adapter.cpp2
-rw-r--r--src/md/winmd/inc/adapter.h3
-rw-r--r--src/vm/appdomain.cpp27
-rw-r--r--src/vm/appdomain.hpp1
5 files changed, 32 insertions, 3 deletions
diff --git a/src/inc/winrtprojectedtypes.h b/src/inc/winrtprojectedtypes.h
index 140493801f..f8e0d11bb3 100644
--- a/src/inc/winrtprojectedtypes.h
+++ b/src/inc/winrtprojectedtypes.h
@@ -140,7 +140,7 @@ DEFINE_PROJECTED_STRUCT ("Windows.Foundation", "Point",
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}))
diff --git a/src/md/winmd/adapter.cpp b/src/md/winmd/adapter.cpp
index 0a93f88d58..64cc25ce49 100644
--- a/src/md/winmd/adapter.cpp
+++ b/src/md/winmd/adapter.cpp
@@ -1134,7 +1134,7 @@ void WinMDAdapter::GetExtraAssemblyRefProps(FrameworkAssemblyIndex index,
else
#endif
{
- if (index == FrameworkAssembly_SystemNumericsVectors)
+ if (index == FrameworkAssembly_SystemNumericsVectors || index == FrameworkAssembly_InternalUri)
{
*ppPublicKeytoken = s_pbContractPublicKeyToken;
*pTokenLength = sizeof(s_pbContractPublicKeyToken);
diff --git a/src/md/winmd/inc/adapter.h b/src/md/winmd/inc/adapter.h
index 8b1be4cfb9..14a26b56b1 100644
--- a/src/md/winmd/inc/adapter.h
+++ b/src/md/winmd/inc/adapter.h
@@ -87,6 +87,7 @@ public:
FrameworkAssembly_SystemRuntimeWindowsRuntime,
FrameworkAssembly_SystemRuntimeWindowsRuntimeUIXaml,
FrameworkAssembly_SystemNumericsVectors,
+ FrameworkAssembly_InternalUri,
FrameworkAssembly_Count,
};
@@ -633,6 +634,8 @@ public:
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;
diff --git a/src/vm/appdomain.cpp b/src/vm/appdomain.cpp
index 9188c26c05..4c02f35f7f 100644
--- a/src/vm/appdomain.cpp
+++ b/src/vm/appdomain.cpp
@@ -4869,6 +4869,7 @@ AppDomain::AppDomain()
m_pSystemRuntimeWindowsRuntimeDll = nullptr;
m_pSystemRuntimeWindowsRuntimeUIXamlDll = nullptr;
m_pSystemNumericsVectors = nullptr;
+ m_pInternalUri = nullptr;
#endif // FEATURE_COMINTEROP
m_pUMEntryThunkCache = NULL;
@@ -5949,6 +5950,11 @@ bool AppDomain::FindRedirectedAssembly(Assembly* pAssembly, WinMDAdapter::Framew
*pIndex = WinMDAdapter::FrameworkAssembly_SystemNumericsVectors;
return true;
}
+ else if (pDomainAssembly == m_pInternalUri)
+ {
+ *pIndex = WinMDAdapter::FrameworkAssembly_InternalUri;
+ return true;
+ }
return false;
}
@@ -5964,7 +5970,7 @@ BOOL AppDomain::FindRedirectedAssemblyFromIndexIfLoaded(WinMDAdapter::FrameworkA
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;
@@ -5989,6 +5995,10 @@ BOOL AppDomain::FindRedirectedAssemblyFromIndexIfLoaded(WinMDAdapter::FrameworkA
{
pDomainAssembly = m_pSystemNumericsVectors;
}
+ else if (index == WinMDAdapter::FrameworkAssembly_InternalUri)
+ {
+ pDomainAssembly = m_pInternalUri;
+ }
if (pDomainAssembly != NULL)
{
@@ -6108,6 +6118,21 @@ void AppDomain::AddAssembly(DomainAssembly * assem)
}
}
}
+ 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
}
diff --git a/src/vm/appdomain.hpp b/src/vm/appdomain.hpp
index 4840b904df..49e6a72759 100644
--- a/src/vm/appdomain.hpp
+++ b/src/vm/appdomain.hpp
@@ -3413,6 +3413,7 @@ private:
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);