summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-03-23 19:31:27 -0700
committerJan Kotas <jkotas@microsoft.com>2016-03-23 19:31:27 -0700
commit15c0f394827c7c9902fe5f41dd62d9be16d14ce9 (patch)
tree74de266cd6052857b8357a1d87c5c249b004cd43
parentb01396d16e90106e8c4e19ddbecc967d54d2690b (diff)
parent4d3b8acd161bcd5890be78af5130526575264ccc (diff)
downloadcoreclr-15c0f394827c7c9902fe5f41dd62d9be16d14ce9.tar.gz
coreclr-15c0f394827c7c9902fe5f41dd62d9be16d14ce9.tar.bz2
coreclr-15c0f394827c7c9902fe5f41dd62d9be16d14ce9.zip
Merge pull request #3888 from jkotas/platform-assemblies
Remove special casing of platform assemblies
-rw-r--r--CMakeLists.txt4
-rw-r--r--clr.defines.targets3
-rw-r--r--src/inc/MSCOREE.IDL4
-rw-r--r--src/mscorlib/src/System/Reflection/Assembly.cs39
-rw-r--r--src/mscorlib/src/mscorlib.Friends.cs32
-rw-r--r--src/strongname/api/strongnameinternal.cpp76
-rw-r--r--src/strongname/inc/strongnameinternal.h5
-rw-r--r--src/strongname/inc/thetestkey.h86
-rw-r--r--src/vm/appdomain.hpp60
-rw-r--r--src/vm/assembly.cpp159
-rw-r--r--src/vm/assembly.hpp114
-rw-r--r--src/vm/assemblynative.cpp44
-rw-r--r--src/vm/assemblynative.hpp15
-rw-r--r--src/vm/clsload.cpp17
-rw-r--r--src/vm/corhost.cpp36
-rw-r--r--src/vm/dllimport.cpp8
-rw-r--r--src/vm/domainfile.cpp19
-rw-r--r--src/vm/ecalllist.h33
-rw-r--r--src/vm/interoputil.cpp12
-rw-r--r--src/vm/jithelpers.cpp17
-rw-r--r--src/vm/jitinterface.cpp9
-rw-r--r--src/vm/pefile.cpp122
-rw-r--r--src/vm/pefile.h3
-rw-r--r--src/vm/security.cpp7
-rw-r--r--src/vm/security.h4
-rw-r--r--src/vm/security.inl33
-rw-r--r--src/vm/securitydescriptorassembly.cpp88
-rw-r--r--src/vm/securitydescriptorassembly.h8
-rw-r--r--src/vm/securitydescriptorassembly.inl22
-rw-r--r--src/vm/securitymeta.cpp11
-rw-r--r--src/vm/securitymeta.h5
-rw-r--r--src/vm/securitymeta.inl7
-rw-r--r--src/vm/securitytransparentassembly.cpp36
-rw-r--r--tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall.il416
-rw-r--r--tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall.ilproj52
-rw-r--r--tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall_Lib.il332
-rw-r--r--tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall_Lib.ilproj50
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/OverwriteArray.il70
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/OverwriteArray.ilproj42
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/app.config27
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/app.config27
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/b431011.il107
-rw-r--r--tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/b431011.ilproj42
43 files changed, 40 insertions, 2263 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d9836ba8cc..79a98a0e91 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -787,7 +787,6 @@ if(FEATURE_EVENT_TRACE)
endif(CLR_CMAKE_PLATFORM_UNIX)
endif(FEATURE_EVENT_TRACE)
add_definitions(-DFEATURE_EXCEPTIONDISPATCHINFO)
-add_definitions(-DFEATURE_FRAMEWORK_INTERNAL)
# NetBSD doesn't implement this feature
if(NOT CLR_CMAKE_PLATFORM_UNIX_TARGET_ARM AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
add_definitions(-DFEATURE_HIJACK)
@@ -838,9 +837,6 @@ endif(WIN32)
add_definitions(-DFEATURE_STANDALONE_SN)
add_definitions(-DFEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED)
add_definitions(-DFEATURE_STRONGNAME_MIGRATION)
-if(WIN32)
- add_definitions(-DFEATURE_STRONGNAME_TESTKEY_ALLOWED)
-endif(WIN32)
if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
add_definitions(-DFEATURE_STUBS_AS_IL)
endif(CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_PLATFORM_ARCH_ARM64)
diff --git a/clr.defines.targets b/clr.defines.targets
index 3897b89e22..a7876feabb 100644
--- a/clr.defines.targets
+++ b/clr.defines.targets
@@ -40,7 +40,6 @@
<CDefines Condition="'$(FeatureXplatEventSource)' == 'true'">$(CDefines);FEATURE_EVENTSOURCE_XPLAT</CDefines>
<CDefines Condition="'$(FeatureExceptionDispatchInfo)' == 'true'">$(CDefines);FEATURE_EXCEPTIONDISPATCHINFO</CDefines>
<CDefines Condition="'$(FeatureExceptionNotifications)' == 'true'">$(CDefines);FEATURE_EXCEPTION_NOTIFICATIONS</CDefines>
- <CDefines Condition="'$(FeatureFrameworkInternal)' == 'true'">$(CDefines);FEATURE_FRAMEWORK_INTERNAL</CDefines>
<CDefines Condition="'$(FeatureFullNGen)' == 'true'">$(CDefines);FEATURE_FULL_NGEN</CDefines>
<CDefines Condition="'$(FeatureFusion)' == 'true'">$(CDefines);FEATURE_FUSION</CDefines>
<CDefines Condition="'$(FeatureHijack)' == 'true'">$(CDefines);FEATURE_HIJACK</CDefines>
@@ -101,7 +100,6 @@
<CDefines Condition="'$(FeatureStandaloneSn)' == 'true'">$(CDefines);FEATURE_STANDALONE_SN</CDefines>
<CDefines Condition="'$(FeatureStrongnameDelaySigningAllowed)' == 'true'">$(CDefines);FEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED</CDefines>
<CDefines Condition="'$(FeatureStrongnameMigration)' == 'true'">$(CDefines);FEATURE_STRONGNAME_MIGRATION</CDefines>
- <CDefines Condition="'$(FeatureStrongnameTestkeyAllowed)' == 'true'">$(CDefines);FEATURE_STRONGNAME_TESTKEY_ALLOWED</CDefines>
<CDefines Condition="'$(FeatureSvrGc)' == 'true'">$(CDefines);FEATURE_SVR_GC</CDefines>
<CDefines Condition="'$(FeaturePerfMap)' == 'true'">$(CDefines);FEATURE_PERFMAP</CDefines>
<CDefines Condition="'$(FeatureSynchronizationcontextWait)' == 'true'">$(CDefines);FEATURE_SYNCHRONIZATIONCONTEXT_WAIT</CDefines>
@@ -163,7 +161,6 @@
<DefineConstants Condition="'$(FeatureEncodingNls)' == 'true'">$(DefineConstants);FEATURE_ENCODINGNLS</DefineConstants>
<DefineConstants Condition="'$(FeatureExceptionDispatchInfo)' == 'true'">$(DefineConstants);FEATURE_EXCEPTIONDISPATCHINFO</DefineConstants>
<DefineConstants Condition="'$(FeatureExceptionNotifications)' == 'true'">$(DefineConstants);FEATURE_EXCEPTION_NOTIFICATIONS</DefineConstants>
- <DefineConstants Condition="'$(FeatureFrameworkInternal)' == 'true'">$(DefineConstants);FEATURE_FRAMEWORK_INTERNAL</DefineConstants>
<DefineConstants Condition="'$(FeatureFusion)' == 'true'">$(DefineConstants);FEATURE_FUSION</DefineConstants>
<DefineConstants Condition="'$(FeatureHostAssemblyResolver)' == 'true'">$(DefineConstants);FEATURE_HOST_ASSEMBLY_RESOLVER</DefineConstants>
<DefineConstants Condition="'$(FeatureHostedBinder)' == 'true'">$(DefineConstants);FEATURE_HOSTED_BINDER</DefineConstants>
diff --git a/src/inc/MSCOREE.IDL b/src/inc/MSCOREE.IDL
index e292069ec9..832783c36f 100644
--- a/src/inc/MSCOREE.IDL
+++ b/src/inc/MSCOREE.IDL
@@ -365,10 +365,6 @@ typedef enum
// Otherwise, by default, only platform assemblies can perform those operations.
APPDOMAIN_ENABLE_PINVOKE_AND_CLASSIC_COMINTEROP = 0x10,
-#if defined(FEATURE_WINDOWSPHONE) && defined(FEATURE_STRONGNAME_TESTKEY_ALLOWED)
- APPDOMAIN_SET_TEST_KEY = 0x20,
-#endif // defined(FEATURE_WINDOWSPHONE) && defined(FEATURE_STRONGNAME_TESTKEY_ALLOWED)
-
APPDOMAIN_ENABLE_PLATFORM_SPECIFIC_APPS = 0x40,
APPDOMAIN_ENABLE_ASSEMBLY_LOADFILE = 0x80,
diff --git a/src/mscorlib/src/System/Reflection/Assembly.cs b/src/mscorlib/src/System/Reflection/Assembly.cs
index b05fb42953..b666566066 100644
--- a/src/mscorlib/src/System/Reflection/Assembly.cs
+++ b/src/mscorlib/src/System/Reflection/Assembly.cs
@@ -855,17 +855,6 @@ namespace System.Reflection
throw new NotImplementedException();
}
-#if FEATURE_CORECLR
- internal virtual bool IsProfileAssembly
- {
- [System.Security.SecurityCritical]
- get
- {
- throw new NotImplementedException();
- }
- }
-#endif // FEATURE_CORECLR
-
public virtual IList<CustomAttributeData> GetCustomAttributesData()
{
throw new NotImplementedException();
@@ -1165,11 +1154,10 @@ namespace System.Reflection
{
ASSEMBLY_FLAGS flags = ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_UNKNOWN;
-#if !FEATURE_CORECLR
- if (RuntimeAssembly.IsFrameworkAssembly(GetName()))
+#if FEATURE_CORECLR
+ flags |= ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_FRAMEWORK | ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_SAFE_REFLECTION;
#else
- if (IsProfileAssembly)
-#endif
+ if (RuntimeAssembly.IsFrameworkAssembly(GetName()))
{
flags |= ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_FRAMEWORK | ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_SAFE_REFLECTION;
@@ -1206,6 +1194,7 @@ namespace System.Reflection
{
flags = ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_SAFE_REFLECTION;
}
+#endif
m_flags = flags | ASSEMBLY_FLAGS.ASSEMBLY_FLAGS_INITIALIZED;
}
@@ -1213,7 +1202,7 @@ namespace System.Reflection
return m_flags;
}
}
-#endif // FEATURE_APPX
+#endif // FEATURE_CORECLR
internal object SyncRoot
{
@@ -2532,24 +2521,6 @@ namespace System.Reflection
newGrant = granted; newDenied = denied;
}
-#if FEATURE_CORECLR
- [System.Security.SecurityCritical]
- [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
- [SuppressUnmanagedCodeSecurity]
- [return: MarshalAs(UnmanagedType.Bool)]
- internal static extern bool GetIsProfileAssembly(RuntimeAssembly assembly);
-
- // True if the assembly is a trusted platform assembly
- internal override bool IsProfileAssembly
- {
- [System.Security.SecurityCritical]
- get
- {
- return GetIsProfileAssembly(GetNativeHandle());
- }
- }
-#endif // FEATURE_CORECLR
-
[System.Security.SecurityCritical] // auto-generated
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
[SuppressUnmanagedCodeSecurity]
diff --git a/src/mscorlib/src/mscorlib.Friends.cs b/src/mscorlib/src/mscorlib.Friends.cs
index f0232157ff..fc24b2b853 100644
--- a/src/mscorlib/src/mscorlib.Friends.cs
+++ b/src/mscorlib/src/mscorlib.Friends.cs
@@ -7,48 +7,16 @@ using System.Runtime.CompilerServices;
// AssemblyAttributes.cspp model for the other build types at a future point in time.
#if FEATURE_CORESYSTEM
-// System and System.Core depend on all kinds of things.
-[assembly: InternalsVisibleTo("System, PublicKey=" + _InternalsVisibleToKeys.SilverlightPlatformPublicKeyFull, AllInternalsVisible=false)]
-[assembly: InternalsVisibleTo("System.Core, PublicKey=" + _InternalsVisibleToKeys.SilverlightPlatformPublicKeyFull, AllInternalsVisible=false)]
-
// Depends on things like SuppressUnmanagedCodeAttribute and WindowsRuntimeImportAttribute
[assembly: InternalsVisibleTo("System.Runtime.WindowsRuntime, PublicKey=" + _InternalsVisibleToKeys.EcmaPublicKeyFull, AllInternalsVisible=false)]
// Depends on WindowsRuntimeImportAttribute
[assembly: InternalsVisibleTo("System.Runtime.WindowsRuntime.UI.Xaml, PublicKey=" + _InternalsVisibleToKeys.EcmaPublicKeyFull, AllInternalsVisible=false)]
-// Depends on things like FormattingServices and System.Reflection.Pointer
-// For mango appcompat also needs access to System.Version..ctor() in order to deserialize Version
-[assembly: InternalsVisibleTo("System.Runtime.Serialization, PublicKey=" + _InternalsVisibleToKeys.SilverlightPlatformPublicKeyFull, AllInternalsVisible=false)]
-
-// Depends on things like System.Number
-[assembly: InternalsVisibleTo("System.Numerics, PublicKey=" + _InternalsVisibleToKeys.SilverlightPublicKeyFull, AllInternalsVisible=false)]
-
-// Depends on things like internal constructor on TypeInfo as well as few other internal reflection members
-[assembly: InternalsVisibleTo("System.Reflection.Context, PublicKey=" + _InternalsVisibleToKeys.SilverlightPlatformPublicKeyFull, AllInternalsVisible=false)]
-
-// Depends on things like EncoderExptionFallback and EncoderFallback
-[assembly: InternalsVisibleTo("System.Xml, PublicKey=" + _InternalsVisibleToKeys.SilverlightPlatformPublicKeyFull, AllInternalsVisible=false)]
-
-// See ndp\fx\src\ReferenceAssemblies\WindowsPhone\v8.0\mscorlib\mscorlib.Private.cs for the exact set of internal API's
-// System.Windows, System.Windows.RuntimeHost, and System.Net use.
-[assembly: InternalsVisibleTo("System.Windows, PublicKey=" + _InternalsVisibleToKeys.SilverlightPlatformPublicKeyFull, AllInternalsVisible=false)]
-[assembly: InternalsVisibleTo("System.Windows.RuntimeHost, PublicKey=" + _InternalsVisibleToKeys.SilverlightPlatformPublicKeyFull, AllInternalsVisible=false)]
-[assembly: InternalsVisibleTo("System.Net, PublicKey=" + _InternalsVisibleToKeys.SilverlightPlatformPublicKeyFull, AllInternalsVisible=false)]
-
internal class _InternalsVisibleToKeys
{
// Token = b77a5c561934e089
internal const string EcmaPublicKeyFull = "00000000000000000400000000000000";
-
- // Token = b03f5f7f11d50a3a
- internal const string MicrosoftPublicKeyFull = "002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293";
-
- // Token = 7cec85d7bea7798e
- internal const string SilverlightPlatformPublicKeyFull= "00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB";
-
- // Token = 31bf3856ad364e35 (also known as SharedLibPublicKey)
- internal const string SilverlightPublicKeyFull = "0024000004800000940000000602000000240000525341310004000001000100B5FC90E7027F67871E773A8FDE8938C81DD402BA65B9201D60593E96C492651E889CC13F1415EBB53FAC1131AE0BD333C5EE6021672D9718EA31A8AEBD0DA0072F25D87DBA6FC90FFD598ED4DA35E44C398C454307E8E33B8426143DAEC9F596836F97C8F74750E5975C64E2189F45DEF46B2A2B1247ADC3652BF5C308055DA9";
}
#endif // FEATURE_CORESYS
diff --git a/src/strongname/api/strongnameinternal.cpp b/src/strongname/api/strongnameinternal.cpp
index 6b4472b1a0..843436772c 100644
--- a/src/strongname/api/strongnameinternal.cpp
+++ b/src/strongname/api/strongnameinternal.cpp
@@ -11,12 +11,6 @@
#include "thekey.h"
#include "ecmakey.h"
-#ifdef FEATURE_STRONGNAME_TESTKEY_ALLOWED
-#include "thetestkey.h"
-
-BYTE g_rbTestKeyBuffer[] = { TEST_KEY_HEADER TEST_KEY_BUFFER };
-#endif // FEATURE_STRONGNAME_TESTKEY_ALLOWED
-
//---------------------------------------------------------------------------------------
//
// Check to see if a public key blob is the ECMA public key blob
@@ -143,76 +137,6 @@ bool StrongNameIsSilverlightPlatformKey(const PublicKeyBlob &keyPublicKey)
}
#endif //FEATURE_CORECLR
-#ifdef FEATURE_STRONGNAME_TESTKEY_ALLOWED
-
-//---------------------------------------------------------------------------------------
-//
-// Check to see if a public key blob is the Silverlight Platform public key blob
-//
-// See code:g_rbTestKeyBuffer#TestKeyStamping
-//
-// Arguments:
-// pbKey - public key blob to check
-// cbKey - size in bytes of pbKey
-//
-
-bool StrongNameIsTestKey(__in_ecount(cbKey) const BYTE *pbKey, DWORD cbKey)
-{
- CONTRACTL
- {
- NOTHROW;
- GC_NOTRIGGER;
- }
- CONTRACTL_END;
-
- // The key should be the same size as the ECMA key
- if (cbKey != sizeof(g_rbTestKeyBuffer) - 2 * sizeof(GUID))
- {
- return false;
- }
-
- const PublicKeyBlob *pKeyBlob = reinterpret_cast<const PublicKeyBlob *>(pbKey);
- return StrongNameIsTestKey(*pKeyBlob);
-}
-
-//---------------------------------------------------------------------------------------
-//
-// Determine if the public key blob is the test public key stamped into the VM.
-//
-// See code:g_rbTestKeyBuffer#TestKeyStamping
-//
-// Arguments:
-// keyPublicKey - public key blob to check for emptyness
-//
-
-bool StrongNameIsTestKey(const PublicKeyBlob &keyPublicKey)
-{
- CONTRACTL
- {
- NOTHROW;
- GC_NOTRIGGER;
- }
- CONTRACTL_END;
-
- // Find the blob in the VM by looking past the two header GUIDs in the buffer
- _ASSERTE(sizeof(g_rbTestKeyBuffer) > 2 * sizeof(GUID) + sizeof(PublicKeyBlob));
- const PublicKeyBlob *pbTestPublicKey = reinterpret_cast<const PublicKeyBlob *>(g_rbTestKeyBuffer + 2 * sizeof(GUID));
-
- DWORD cbTestPublicKey = StrongNameSizeOfPublicKey(*pbTestPublicKey);
- DWORD cbCheckPublicKey = StrongNameSizeOfPublicKey(keyPublicKey);
-
- // Check whether valid test key was stamped in
- if (cbTestPublicKey == 0)
- return false;
-
- // This is the test public key if it is the same size as the public key in the buffer, and is identical
- // to the test key as well.
- return cbTestPublicKey == cbCheckPublicKey &&
- memcmp(reinterpret_cast<const void *>(pbTestPublicKey), reinterpret_cast<const void *>(&keyPublicKey), cbTestPublicKey) == 0;
-}
-
-#endif // FEATURE_STRONGNAME_TESTKEY_ALLOWED
-
//---------------------------------------------------------------------------------------
//
// Verify that a public key blob looks like a reasonable public key
diff --git a/src/strongname/inc/strongnameinternal.h b/src/strongname/inc/strongnameinternal.h
index 3b66607533..614fdfb53a 100644
--- a/src/strongname/inc/strongnameinternal.h
+++ b/src/strongname/inc/strongnameinternal.h
@@ -23,11 +23,6 @@
#define CALG_SHA_512 (ALG_CLASS_HASH | ALG_TYPE_ANY | ALG_SID_SHA_512)
#endif //ALG_SID_SHA_256
-#ifdef FEATURE_STRONGNAME_TESTKEY_ALLOWED
-bool StrongNameIsTestKey(__in_ecount(cbKey) const BYTE *pbKey, DWORD cbKey);
-bool StrongNameIsTestKey(const PublicKeyBlob &keyPublicKey);
-#endif // FEATURE_STRONGNAME_TESTKEY_ALLOWED
-
// Determine the number of bytes in a public key
DWORD StrongNameSizeOfPublicKey(const PublicKeyBlob &keyPublicKey);
diff --git a/src/strongname/inc/thetestkey.h b/src/strongname/inc/thetestkey.h
deleted file mode 100644
index 89ccdd7687..0000000000
--- a/src/strongname/inc/thetestkey.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// 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.
-
-// This file allows customization of the test strongname key used in place of the real MS key
-
-#ifdef FEATURE_STRONGNAME_TESTKEY_ALLOWED
-
-//
-// #TestKeyStamping
-//
-// On CoreCLR, we have a requirement that only keys signed with the Microsoft public key can be considered
-// part of the platform and therefore contain critical code. This leads to an issue with testing the
-// product, since any tests which need to test platform only feautres would need to be signed by the
-// Microsoft public key, and for a variety of reasons it is not feasable to sign all of our test assemblies
-// with that key.
-//
-// Instead, we provide an extension where any assembly signed with the public key contained in the
-// g_rbTestKeyBuffer will also be considered part of the platform. The buffer is filled with a zero key,
-// which means by default non-Microsoft signatures will not be accepted. However, the slstampkey tool looks
-// for the two GUIDs in the beginning of the buffer, and can replace the key with a real one of the test
-// team's choosing. Once this modification is in place, test assemblies can be considered part of the
-// platform and can access critical APIs.
-//
-// Since this buffer is searched for in the VM using external tools, it's very important that it only appear
-// once in the final image of the runtime. If it appears multiple times, tools will be unable to determine
-// which test key buffer is the real buffer, and therefore tests which rely on containing platform code will
-// be unable to run on the build.
-//
-
-#define TEST_KEY_HEADER \
- /* Test key buffer header 1: { cd517db8-a1b1-44bf-aa64-bf66fefa3831 } */ \
- 0xb8, 0x7d, 0x51, 0xcd, 0xb1, 0xa1, 0xbf, 0x44, 0x64, 0xaa, 0xbf, 0x66, 0xfe, 0xfa, 0x38, 0x31, \
- \
- /* Test key buffer header 2: { 5f363032-eaaf-4103-b312-ab2c8e35cf58 } */ \
- 0x32, 0x30, 0x36, 0x5f, 0xaf, 0xea, 0x03, 0x41, 0x12, 0xb3, 0xab, 0x2c, 0x8e, 0x35, 0xcf, 0x58,
-
-
-#define TEST_KEY_VALUE \
- /* SigAlgId = */\
- 0x00, 0x24, 0x00, 0x00, \
- \
- /* HashAlgId = */\
- 0x04, 0x80, 0x00, 0x00, \
- \
- /* cbPublicKey = 0x94 */ \
- 0x94, 0x00, 0x00, 0x00, \
- \
- /* 1024 bit public key */ \
- 0x06, 0x02, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x52, 0x53, 0x41, 0x31, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, \
- 0x0f, 0xc5, 0x99, 0x3e, 0x0f, 0x51, 0x1a, 0xd5, 0xe1, 0x6e, 0x8b, 0x22, 0x65, 0x53, 0x49, 0x3e, 0x09, 0x06, 0x7a, 0xfc, \
- 0x41, 0x03, 0x9f, 0x70, 0xda, 0xeb, 0x94, 0xa9, 0x68, 0xd6, 0x64, 0xf4, 0x0e, 0x69, 0xa4, 0x6b, 0x61, 0x7d, 0x15, 0xd3, \
- 0xd5, 0x32, 0x8b, 0xe7, 0xdb, 0xed, 0xd0, 0x59, 0xeb, 0x98, 0x49, 0x5a, 0x3b, 0x03, 0xcb, 0x4e, 0xa4, 0xba, 0x12, 0x74, \
- 0x44, 0x67, 0x1c, 0x3c, 0x84, 0xcb, 0xc1, 0xfd, 0xc3, 0x93, 0xd7, 0xe1, 0x0b, 0x5e, 0xe3, 0xf3, 0x1f, 0x5a, 0x29, 0xf0, \
- 0x05, 0xe5, 0xee, 0xd7, 0xe3, 0xc9, 0xc8, 0xaf, 0x74, 0xf4, 0x13, 0xf0, 0x00, 0x4f, 0x0c, 0x2c, 0xab, 0xb2, 0x2f, 0x9d, \
- 0xd4, 0xf7, 0x5a, 0x6f, 0x59, 0x97, 0x84, 0xe1, 0xba, 0xb7, 0x09, 0x85, 0xef, 0x81, 0x74, 0xca, 0x6c, 0x68, 0x42, 0x78, \
- 0xbe, 0x82, 0xce, 0x05, 0x5a, 0x03, 0xeb, 0xaf
-
- //
- // Test Public key blob
- //
-
- //
- // No prestamped test key - create an empty key buffer
- //
-#define TEST_KEY_BUFFER \
- /* SigAlgId */ \
- 0x00, 0x00, 0x00, 0x00, \
- \
- /* HashAlgId */ \
- 0x00, 0x00, 0x00, 0x00, \
- \
- /* cbPublicKey = 0x94 - this needs to match the size of the public key section below */ \
- 0x94, 0x00, 0x00, 0x00, \
- \
- /* 1024 bit public key - 0x94 bytes */ \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-
-#endif // FEATURE_STRONGNAME_TESTKEY_ALLOWED
diff --git a/src/vm/appdomain.hpp b/src/vm/appdomain.hpp
index 0ec336dffa..19d22bde91 100644
--- a/src/vm/appdomain.hpp
+++ b/src/vm/appdomain.hpp
@@ -2867,66 +2867,6 @@ public:
return (m_dwFlags & IGNORE_UNHANDLED_EXCEPTIONS);
}
-#if defined(FEATURE_CORECLR)
- void SetEnablePInvokeAndClassicComInterop()
- {
- LIMITED_METHOD_CONTRACT;
-
- m_dwFlags |= ENABLE_PINVOKE_AND_CLASSIC_COMINTEROP;
- }
-
- BOOL EnablePInvokeAndClassicComInterop()
- {
- LIMITED_METHOD_CONTRACT;
-
- return (m_dwFlags & ENABLE_PINVOKE_AND_CLASSIC_COMINTEROP);
- }
-
- void SetAllowPlatformSpecificAppAssemblies()
- {
- LIMITED_METHOD_CONTRACT;
-
- m_dwFlags |= ENABLE_SKIP_PLAT_CHECKS;
- }
-
- BOOL AllowPlatformSpecificAppAssemblies()
- {
- LIMITED_METHOD_CONTRACT;
- if(IsCompilationDomain())
- return TRUE;
-
- return (m_dwFlags & ENABLE_SKIP_PLAT_CHECKS);
- }
-
- void SetAllowLoadFile()
- {
- LIMITED_METHOD_CONTRACT;
-
- m_dwFlags |= ENABLE_ASSEMBLY_LOADFILE;
- }
-
- BOOL IsLoadFileAllowed()
- {
- LIMITED_METHOD_CONTRACT;
-
- return (m_dwFlags & ENABLE_ASSEMBLY_LOADFILE);
- }
-
- void DisableTransparencyEnforcement()
- {
- LIMITED_METHOD_CONTRACT;
-
- m_dwFlags |= DISABLE_TRANSPARENCY_ENFORCEMENT;
- }
-
- BOOL IsTransparencyEnforcementDisabled()
- {
- LIMITED_METHOD_CONTRACT;
-
- return (m_dwFlags & DISABLE_TRANSPARENCY_ENFORCEMENT);
- }
-#endif // defined(FEATURE_CORECLR)
-
void SetPassiveDomain()
{
LIMITED_METHOD_CONTRACT;
diff --git a/src/vm/assembly.cpp b/src/vm/assembly.cpp
index 45c1fb0cc7..3de92206d4 100644
--- a/src/vm/assembly.cpp
+++ b/src/vm/assembly.cpp
@@ -4704,22 +4704,8 @@ Assembly::EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
#ifndef DACCESS_COMPILE
-#ifdef FEATURE_FRAMEWORK_INTERNAL
-
-// static
-const LPCSTR FriendAssemblyDescriptor::AllInternalsVisibleProperty = "AllInternalsVisible";
-
-#endif // FEATURE_FRAMEWORK_INTERNAL
-
FriendAssemblyDescriptor::FriendAssemblyDescriptor()
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- : m_crstFriendMembersCache(CrstFriendAccessCache)
-#endif // FEATURE_FRAMEWORK_INTERNAL
{
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- LockOwner lockOwner = { &m_crstFriendMembersCache, IsOwnerOfCrst };
- m_htFriendMembers.Init(FriendMemberHashSize, &lockOwner);
-#endif // FEATURE_FRAMEWORK_INTERNAL
}
FriendAssemblyDescriptor::~FriendAssemblyDescriptor()
@@ -4740,19 +4726,6 @@ FriendAssemblyDescriptor::~FriendAssemblyDescriptor()
delete pFriendAssemblyName;
#endif // FEATURE_FUSION
}
-
-#if FEATURE_FRAMEWORK_INTERNAL
- ArrayList::Iterator itPartialAccessAssemblies = m_alPartialAccessFriendAssemblies.Iterate();
- while (itPartialAccessAssemblies.Next())
- {
- FriendAssemblyName_t *pFriendAssemblyName = static_cast<FriendAssemblyName_t *>(itPartialAccessAssemblies.GetElement());
-#ifdef FEATURE_FUSION
- pFriendAssemblyName->Release();
-#else // FEATURE_FUSION
- delete pFriendAssemblyName;
-#endif // FEATURE_FUSION
- }
-#endif // FEATURE_FRAMEWORK_INTERNAL
}
@@ -4890,33 +4863,7 @@ FriendAssemblyDescriptor *FriendAssemblyDescriptor::CreateFriendAssemblyDescript
}
#endif // !defined(FEATURE_CORECLR)
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- bool fAllInternalsVisible = true;
-
- // Framework internal is only available for framework assemblies
- if (pAssembly->IsProfileAssembly())
- {
- //
- // Find out if the friend assembly is allowed access to all internals, or only selected internals.
- // We default to true for compatibility with behavior of previous runtimes.
- //
-
- CaNamedArg allInternalsArg;
- allInternalsArg.InitBoolField(const_cast<LPCSTR>(AllInternalsVisibleProperty), true);
- hr = ParseKnownCaNamedArgs(cap, &allInternalsArg, 1);
- if (FAILED(hr) && hr != META_E_CA_UNKNOWN_ARGUMENT)
- {
- IfFailThrow(hr);
- }
-
- fAllInternalsVisible = !!allInternalsArg.val.u1;
- }
-
- pFriendAssemblies->AddFriendAssembly(pFriendAssemblyName, fAllInternalsVisible);
-
-#else // FEATURE_FRAMEWORK_INTERNAL
pFriendAssemblies->AddFriendAssembly(pFriendAssemblyName);
-#endif // FEATURE_FRAMEWORK_INTERNAL
pFriendAssemblyName.SuppressRelease();
}
@@ -4940,11 +4887,7 @@ FriendAssemblyDescriptor *FriendAssemblyDescriptor::CreateFriendAssemblyDescript
// see if an assembly has already been added to the friend assembly list.
//
-#ifdef FEATURE_FRAMEWORK_INTERNAL
-void FriendAssemblyDescriptor::AddFriendAssembly(FriendAssemblyName_t *pFriendAssembly, bool fAllInternalsVisible)
-#else // FEATURE_FRAMEWORK_INTERNAL
void FriendAssemblyDescriptor::AddFriendAssembly(FriendAssemblyName_t *pFriendAssembly)
-#endif // FEATURE_FRAMEWORK_INTERNAL
{
CONTRACTL
{
@@ -4954,18 +4897,7 @@ void FriendAssemblyDescriptor::AddFriendAssembly(FriendAssemblyName_t *pFriendAs
}
CONTRACTL_END
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- if (fAllInternalsVisible)
-#endif // FEATURE_FRAMEWORK_INTERNAL
- {
- m_alFullAccessFriendAssemblies.Append(pFriendAssembly);
- }
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- else
- {
- m_alPartialAccessFriendAssemblies.Append(pFriendAssembly);
- }
-#endif // FEATURE_FRAMEWORK_INTERNAL
+ m_alFullAccessFriendAssemblies.Append(pFriendAssembly);
}
void FriendAssemblyDescriptor::AddSubjectAssembly(FriendAssemblyName_t *pFriendAssembly)
@@ -4981,95 +4913,6 @@ void FriendAssemblyDescriptor::AddSubjectAssembly(FriendAssemblyName_t *pFriendA
m_subjectAssemblies.Append(pFriendAssembly);
}
-#ifdef FEATURE_FRAMEWORK_INTERNAL
-
-//
-// Helpers to see if a member is internal, and therefore could be considered for friend access.
-//
-
-// static
-bool FriendAssemblyDescriptor::FriendAccessAppliesTo(FieldDesc *pFD)
-{
- LIMITED_METHOD_CONTRACT;
-
- DWORD dwFieldProtection = pFD->GetFieldProtection();
- return IsFdAssembly(dwFieldProtection) ||
- IsFdFamANDAssem(dwFieldProtection) ||
- IsFdFamORAssem(dwFieldProtection);
-}
-
-// static
-bool FriendAssemblyDescriptor::FriendAccessAppliesTo(MethodDesc *pMD)
-{
- LIMITED_METHOD_CONTRACT;
-
- DWORD dwMethodProtection = pMD->GetAttrs();
- return IsMdAssem(dwMethodProtection) ||
- IsMdFamANDAssem(dwMethodProtection) ||
- IsMdFamORAssem(dwMethodProtection);
-}
-
-// static
-bool FriendAssemblyDescriptor::FriendAccessAppliesTo(MethodTable *pMT)
-{
- LIMITED_METHOD_CONTRACT;
-
- DWORD dwTypeProtection = pMT->GetClass()->GetProtection();
- return IsTdNotPublic(dwTypeProtection) ||
- IsTdNestedAssembly(dwTypeProtection) ||
- IsTdNestedFamANDAssem(dwTypeProtection) ||
- IsTdNestedFamORAssem(dwTypeProtection);
-}
-
-//
-// Helper methods to get the metadata token for items that may have the FriendAccessAllowed attribute.
-//
-
-// static
-mdToken FriendAssemblyDescriptor::GetMetadataToken(FieldDesc *pFD)
-{
- WRAPPER_NO_CONTRACT;
- return pFD->GetMemberDef();
-}
-
-// static
-mdToken FriendAssemblyDescriptor::GetMetadataToken(MethodDesc *pMD)
-{
- WRAPPER_NO_CONTRACT;
- return pMD->GetMemberDef();
-}
-
-// static
-mdToken FriendAssemblyDescriptor::GetMetadataToken(MethodTable *pMT)
-{
- WRAPPER_NO_CONTRACT;
- return pMT->GetCl();
-}
-
-// static
-bool FriendAssemblyDescriptor::HasFriendAccessAttribute(IMDInternalImport *pMDImport, mdToken tkMember)
-{
- CONTRACTL
- {
- THROWS;
- GC_TRIGGERS;
- PRECONDITION(CheckPointer(pMDImport));
- }
- CONTRACTL_END;
-
- const BYTE *pbAttribute = NULL;
- ULONG cbAttribute = 0;
- HRESULT hr = pMDImport->GetCustomAttributeByName(tkMember,
- FRIEND_ACCESS_ALLOWED_ATTRIBUTE_TYPE,
- reinterpret_cast<const void **>(&pbAttribute),
- &cbAttribute);
- IfFailThrow(hr);
-
- return hr == S_OK;
-}
-
-#endif // FEATURE_FRAMEWORK_INTERNAL
-
// static
bool FriendAssemblyDescriptor::IsAssemblyOnList(PEAssembly *pAssembly, const ArrayList &alAssemblyNames)
{
diff --git a/src/vm/assembly.hpp b/src/vm/assembly.hpp
index f8f6b3535e..83fc53bcb8 100644
--- a/src/vm/assembly.hpp
+++ b/src/vm/assembly.hpp
@@ -923,32 +923,7 @@ public:
}
CONTRACTL_END;
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- if (IsAssemblyOnList(pAccessingAssembly, m_alPartialAccessFriendAssemblies))
- {
- return FriendAccessAppliesTo(pMember) && IsMemberVisibleToFriends(pMember);
- }
- else
-#endif // FEATURE_FRAMEWORK_INTERNAL
- if (IsAssemblyOnList(pAccessingAssembly, m_alFullAccessFriendAssemblies))
- {
- return true;
- }
-#if defined(FEATURE_STRONGNAME_TESTKEY_ALLOWED) && defined(FEATURE_FRAMEWORK_INTERNAL)
- else if (pMember->GetModule()->GetFile()->GetAssembly()->IsProfileAssembly()&&
- pAccessingAssembly->GetManifestFile() != NULL &&
- pAccessingAssembly->GetManifestFile()->IsProfileTestAssembly())
- {
- // Test hook - All platoform assemblies consider any test assembly which is part of the profile to implicitly
- // be on the friends list. This allows test access to the framework internal attributes, without
- // having to add test assemblies to the explicit friend assembly list.
- return FriendAccessAppliesTo(pMember) && IsMemberVisibleToFriends(pMember);
- }
-#endif // FEATURE_STRONGNAME_TESTKEY_ALLOWED && FEATURE_FRAMEWORK_INTERNAL
- else
- {
- return false;
- }
+ return IsAssemblyOnList(pAccessingAssembly, m_alFullAccessFriendAssemblies);
}
#ifndef FEATURE_CORECLR
@@ -967,18 +942,7 @@ public:
}
CONTRACTL_END;
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- if (IsAssemblyOnList(pAccessingAssembly, m_alPartialAccessFriendAssemblies))
- {
- return true;
- }
- else
-#endif // FEATURE_FRAMEWORK_INTERNAL
- if (IsAssemblyOnList(pAccessingAssembly, m_alFullAccessFriendAssemblies))
- {
- return true;
- }
- return false;
+ return IsAssemblyOnList(pAccessingAssembly, m_alFullAccessFriendAssemblies);
}
#endif // !FEATURE_CORECLR
@@ -988,11 +952,6 @@ public:
}
private:
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- static const LPCSTR AllInternalsVisibleProperty;
- static const DWORD FriendMemberHashSize = 31; // Number of buckets in the friend member hash table
-#endif // FEATURE_FRAMEWORK_INTERNAL
-
#ifdef FEATURE_FUSION
typedef IAssemblyName FriendAssemblyName_t;
typedef NonVMComHolder<IAssemblyName> FriendAssemblyNameHolder;
@@ -1004,44 +963,11 @@ private:
ArrayList m_alFullAccessFriendAssemblies; // Friend assemblies which have access to all internals
ArrayList m_subjectAssemblies; // Subject assemblies which we will not perform access checks against
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- ArrayList m_alPartialAccessFriendAssemblies; // Friend assemblies which have access to only specific internals
- EEPtrHashTable m_htFriendMembers; // Cache of internal members checked for visibility to friend assemblies
- Crst m_crstFriendMembersCache; // Critical section guarding m_htFriendMembers
-#endif // FEATURE_FRAMEWORK_INTERNAL
-
FriendAssemblyDescriptor();
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- void AddFriendAssembly(FriendAssemblyName_t *pFriendAssembly, bool fAllInternalsVisible);
-#else // FEATURE_FRAMEWORK_INTERNAL
void AddFriendAssembly(FriendAssemblyName_t *pFriendAssembly);
-#endif // FEATURE_FRAMEWORK_INTERNAL
void AddSubjectAssembly(FriendAssemblyName_t *pSubjectAssembly);
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- static
- bool FriendAccessAppliesTo(FieldDesc *pFD);
-
- static
- bool FriendAccessAppliesTo(MethodDesc *pMD);
-
- static
- bool FriendAccessAppliesTo(MethodTable *pMT);
-
- static
- mdToken GetMetadataToken(FieldDesc *pFD);
-
- static
- mdToken GetMetadataToken(MethodDesc *pMD);
-
- static
- mdToken GetMetadataToken(MethodTable *pMT);
-
- static
- bool HasFriendAccessAttribute(IMDInternalImport *pMDImport);
-#endif // FEATURE_FRAMEWORK_INTERNAL
-
static
bool IsAssemblyOnList(Assembly *pAssembly, const ArrayList &alAssemblyNames)
{
@@ -1050,42 +976,6 @@ private:
static
bool IsAssemblyOnList(PEAssembly *pAssembly, const ArrayList &alAssemblyNames);
-
-#ifdef FEATURE_FRAMEWORK_INTERNAL
- bool HasFriendAccessAttribute(IMDInternalImport *pMDImport, mdToken tkMember);
-
- //---------------------------------------------------------------------------------------
- //
- // Checks to see if a specific member has the FriendAccessAllowed attribute
- //
- //
-
- template<class T>
- bool IsMemberVisibleToFriends(T *pMember)
- {
- CONTRACTL
- {
- THROWS;
- GC_TRIGGERS;
- PRECONDITION(CheckPointer(pMember));
- PRECONDITION(FriendAccessAppliesTo(pMember));
- }
- CONTRACTL_END;
-
- CrstHolder lock(&m_crstFriendMembersCache);
-
- HashDatum hd;
- if (!m_htFriendMembers.GetValue(pMember, &hd))
- {
- bool fAllowsAccess = HasFriendAccessAttribute(pMember->GetMDImport(), GetMetadataToken(pMember));
- hd = reinterpret_cast<HashDatum>(fAllowsAccess);
-
- m_htFriendMembers.InsertValue(pMember, hd);
- }
-
- return static_cast<bool>(!!hd);
- }
-#endif // FEATURE_FRAMEWORK_INTERNAL
};
#endif // !DACCESS_COMPILE
diff --git a/src/vm/assemblynative.cpp b/src/vm/assemblynative.cpp
index c89e927404..1e199bac94 100644
--- a/src/vm/assemblynative.cpp
+++ b/src/vm/assemblynative.cpp
@@ -530,28 +530,6 @@ Assembly* AssemblyNative::LoadFromBuffer(BOOL fForIntrospection, const BYTE* pAs
return pAssembly;
}
-#ifdef FEATURE_CORECLR
-// static
-void QCALLTYPE AssemblyNative::LoadFromUnmanagedArray(CLR_BOOL fForIntrospection, BYTE* pAssemblyData, UINT64 uAssemblyLength, BYTE* pPDBData, UINT64 uPDBLength, QCall::StackCrawlMarkHandle stackMark, QCall::ObjectHandleOnStack retAssembly)
-{
- QCALL_CONTRACT;
-
- DomainAssembly * pDomainAssembly = NULL;
-
- BEGIN_QCALL;
- Assembly* pAssembly = NULL;
- GCX_COOP();
- pAssembly=LoadFromBuffer(fForIntrospection, pAssemblyData, uAssemblyLength, pPDBData, uPDBLength, stackMark, NULL, kCurrentAppDomain);
- pDomainAssembly = pAssembly->GetDomainAssembly();
- retAssembly.Set(pDomainAssembly->GetExposedAssemblyObject());
- END_QCALL;
-}
-#endif // FEATURE_CORECLR
-
-
-
-
-
FCIMPL6(Object*, AssemblyNative::LoadImage, U1Array* PEByteArrayUNSAFE,
U1Array* SymByteArrayUNSAFE, Object* securityUNSAFE,
StackCrawlMark* stackMark, CLR_BOOL fForIntrospection, SecurityContextSource securityContextSource)
@@ -636,11 +614,6 @@ FCIMPL2(Object*, AssemblyNative::LoadFile, StringObject* pathUNSAFE, Object* sec
HELPER_METHOD_FRAME_BEGIN_RET_PROTECT(gc);
-#ifdef FEATURE_CORECLR
- if(!GetAppDomain()->IsLoadFileAllowed())
- COMPlusThrow(kNotSupportedException);
-#endif
-
if(CorHost2::IsLoadFromBlocked())
COMPlusThrow(kFileLoadException, FUSION_E_LOADFROM_BLOCKED);
@@ -2221,23 +2194,6 @@ void QCALLTYPE AssemblyNative::GetGrantSet(QCall::AssemblyHandle pAssembly, QCal
END_QCALL;
}
-#ifdef FEATURE_LEGACYNETCF
-BOOL QCALLTYPE AssemblyNative::GetIsProfileAssembly(QCall::AssemblyHandle pAssembly)
-{
- QCALL_CONTRACT;
-
- BOOL fIsProfile = FALSE;
-
- BEGIN_QCALL;
-
- fIsProfile = pAssembly->GetFile()->IsProfileAssembly();
-
- END_QCALL;
-
- return fIsProfile;
-}
-#endif // FEATURE_LEGACYNETCF
-
//
// QCalls to determine if everything introduced by the assembly is either security critical or safe critical
//
diff --git a/src/vm/assemblynative.hpp b/src/vm/assemblynative.hpp
index 35c2fb1c3c..0c0df020c2 100644
--- a/src/vm/assemblynative.hpp
+++ b/src/vm/assemblynative.hpp
@@ -49,16 +49,6 @@ public:
static FCDECL2(Object*, LoadFile, StringObject* pathUNSAFE,
Object* securityUNSAFE);
static FCDECL6(Object*, LoadImage, U1Array* PEByteArrayUNSAFE, U1Array* SymByteArrayUNSAFE, Object* securityUNSAFE, StackCrawlMark* stackMark, CLR_BOOL fForIntrospection, SecurityContextSource securityContextSource);
-#ifdef FEATURE_CORECLR
- static
- void QCALLTYPE LoadFromUnmanagedArray(CLR_BOOL fForIntrospection,
- BYTE* pAssembly,
- UINT64 uAssemblyLength,
- BYTE* pPDB,
- UINT64 uPDBLength,
- QCall::StackCrawlMarkHandle stackMark,
- QCall::ObjectHandleOnStack retAssembly);
-#endif
#ifdef FEATURE_HOSTED_BINDER
static FCDECL9(Object*, Load, AssemblyNameBaseObject* assemblyNameUNSAFE,
@@ -193,11 +183,6 @@ public:
static
void QCALLTYPE GetImageRuntimeVersion(QCall::AssemblyHandle pAssembly, QCall::StringHandleOnStack retString);
-#ifdef FEATURE_LEGACYNETCF
- static
- BOOL QCALLTYPE GetIsProfileAssembly(QCall::AssemblyHandle pAssembly);
-#endif // FEATURE_LEGACYNETCF
-
static
INT64 QCALLTYPE GetHostContext(QCall::AssemblyHandle pAssembly);
diff --git a/src/vm/clsload.cpp b/src/vm/clsload.cpp
index dfe2f38260..533b9c698b 100644
--- a/src/vm/clsload.cpp
+++ b/src/vm/clsload.cpp
@@ -5015,8 +5015,7 @@ BOOL AccessCheckOptions::DemandMemberAccess(AccessCheckContext *pContext, Method
if (visibilityCheck && Security::IsTransparencyEnforcementEnabled())
{
// In CoreCLR RMA means visibility checks always succeed if the target is user code.
- if ((m_accessCheckType == kRestrictedMemberAccess || m_accessCheckType == kRestrictedMemberAccessNoTransparency) &&
- !Security::IsMicrosoftPlatform(pTargetMT->GetAssembly()->GetSecurityDescriptor()))
+ if (m_accessCheckType == kRestrictedMemberAccess || m_accessCheckType == kRestrictedMemberAccessNoTransparency)
return TRUE;
// Accessing private types/members in platform code.
@@ -5036,10 +5035,9 @@ BOOL AccessCheckOptions::DemandMemberAccess(AccessCheckContext *pContext, Method
MethodDesc* pCallerMD = pContext->GetCallerMethod();
- // Platform critical code is exempted from all accessibility rules, regardless of the AccessCheckType.
+ // critical code is exempted from all accessibility rules, regardless of the AccessCheckType.
if (pCallerMD != NULL &&
- !Security::IsMethodTransparent(pCallerMD)
- && Security::IsMicrosoftPlatform(pCallerMD->GetAssembly()->GetSecurityDescriptor()))
+ !Security::IsMethodTransparent(pCallerMD))
{
return TRUE;
}
@@ -5238,15 +5236,6 @@ BOOL AccessCheckOptions::DemandMemberAccessOrFail(AccessCheckContext *pContext,
return TRUE;
}
-#if defined(FEATURE_CORECLR) && defined(CROSSGEN_COMPILE)
- CONSISTENCY_CHECK_MSGF(!pContext->GetCallerAssembly()->GetManifestFile()->IsProfileAssembly(),
- ("Accessibility check failed while compiling platform assembly. Are you missing FriendAccessAllowed attribute? Caller: %s %s %s Target: %s",
- pContext->GetCallerAssembly() ? pContext->GetCallerAssembly()->GetSimpleName() : "",
- pContext->GetCallerMT() ? pContext->GetCallerMT()->GetDebugClassName() : "",
- pContext->GetCallerMethod() ? pContext->GetCallerMethod()->GetName() : "",
- pTargetMT ? pTargetMT->GetDebugClassName() : ""));
-#endif
-
if (m_fThrowIfTargetIsInaccessible)
{
ThrowAccessException(pContext, pTargetMT);
diff --git a/src/vm/corhost.cpp b/src/vm/corhost.cpp
index f0e90291b7..f3f9adbb7e 100644
--- a/src/vm/corhost.cpp
+++ b/src/vm/corhost.cpp
@@ -55,10 +55,6 @@
#include "clrprivtypecachewinrt.h"
#endif
-#ifdef FEATURE_WINDOWSPHONE
-#include "thetestkey.h"
-#endif
-
GVAL_IMPL_INIT(DWORD, g_fHostConfig, 0);
#ifdef FEATURE_IMPLICIT_TLS
@@ -1588,15 +1584,6 @@ HRESULT CorHost2::_CreateAppDomain(
#ifdef FEATURE_CORECLR
if (!m_fStarted)
return HOST_E_INVALIDOPERATION;
-
-#if defined(FEATURE_WINDOWSPHONE) && defined(FEATURE_STRONGNAME_TESTKEY_ALLOWED)
- if((APPDOMAIN_SET_TEST_KEY & dwFlags) && (m_dwStartupFlags & STARTUP_SINGLE_APPDOMAIN))
- {
- const BYTE testKey[] = { TEST_KEY_VALUE };
- memcpy_s(g_rbTestKeyBuffer + sizeof(GUID)*2, sizeof(testKey), testKey, sizeof(testKey));
- }
-#endif // defined(FEATURE_WINDOWSPHONE) && defined(FEATURE_STRONGNAME_TESTKEY_ALLOWED)
-
#endif // FEATURE_CORECLR
if(wszFriendlyName == NULL)
@@ -1631,30 +1618,9 @@ HRESULT CorHost2::_CreateAppDomain(
{
pDomain->SetIgnoreUnhandledExceptions();
}
-
- // Enable interop for all assemblies if the host has asked us to.
- if (dwFlags & APPDOMAIN_ENABLE_PINVOKE_AND_CLASSIC_COMINTEROP)
- {
- pDomain->SetEnablePInvokeAndClassicComInterop();
- }
-
- if (dwFlags & APPDOMAIN_ENABLE_PLATFORM_SPECIFIC_APPS)
- {
- pDomain->SetAllowPlatformSpecificAppAssemblies();
- }
-
- if (dwFlags & APPDOMAIN_ENABLE_ASSEMBLY_LOADFILE)
- {
- pDomain->SetAllowLoadFile();
- }
-
- if (dwFlags & APPDOMAIN_DISABLE_TRANSPARENCY_ENFORCEMENT)
- {
- pDomain->DisableTransparencyEnforcement();
- }
#endif // FEATURE_CORECLR
- if (dwFlags & APPDOMAIN_SECURITY_FORBID_CROSSAD_REVERSE_PINVOKE)
+ if (dwFlags & APPDOMAIN_SECURITY_FORBID_CROSSAD_REVERSE_PINVOKE)
pDomain->SetReversePInvokeCannotEnter();
if (dwFlags & APPDOMAIN_FORCE_TRIVIAL_WAIT_OPERATIONS)
diff --git a/src/vm/dllimport.cpp b/src/vm/dllimport.cpp
index 1332c72d1b..45a33e2854 100644
--- a/src/vm/dllimport.cpp
+++ b/src/vm/dllimport.cpp
@@ -7272,14 +7272,6 @@ VOID NDirect::NDirectLink(NDirectMethodDesc *pMD)
// On the phone, we only allow platform assemblies to define pinvokes
// unless the host has asked us otherwise.
//
-#ifdef FEATURE_WINDOWSPHONE
- if (!GetAppDomain()->EnablePInvokeAndClassicComInterop())
- {
- if (!pMD->GetModule()->GetFile()->GetAssembly()->IsProfileAssembly())
- COMPlusThrow(kNotSupportedException, W("NotSupported_UserDllImport"));
- }
-#endif //FEATURE_WINDOWS_PHONE
-
if (pMD->IsClassConstructorTriggeredAtLinkTime())
{
diff --git a/src/vm/domainfile.cpp b/src/vm/domainfile.cpp
index e16f9d8ab5..3837e82a60 100644
--- a/src/vm/domainfile.cpp
+++ b/src/vm/domainfile.cpp
@@ -3519,6 +3519,10 @@ BOOL DomainAssembly::CheckZapSecurity(PEImage *pNativeImage)
}
CONTRACTL_END;
+#ifdef FEATURE_CORECLR
+ return TRUE;
+#else
+
//
// System libraries are a special case, the security info's always OK.
//
@@ -3536,21 +3540,6 @@ BOOL DomainAssembly::CheckZapSecurity(PEImage *pNativeImage)
return TRUE;
#endif
-#if defined(FEATURE_CORECLR)
- // Lets first check whether the assembly is going to receive full trust
- BOOL fAssemblyIsFullyTrusted = this->GetAppDomain()->IsImageFullyTrusted(pNativeImage);
-
- // Check if the assembly was ngen as platform
- Module * pNativeModule = pNativeImage->GetLoadedLayout()->GetPersistedModuleImage();
- BOOL fImageAndDependenciesAreFullTrust = pNativeModule->m_pModuleSecurityDescriptor->IsMicrosoftPlatform();
-
- // return true only if image was ngen at the same trust level as the current trust level.
- // images ngen'd as fulltrust can only be loaded in fulltrust and
- // non-trusted transparent assembly ngen image can only be loaded in partial trust
- // ( only tranparent assemblies can be ngen'd as partial trust.....if it has critical code ngen will error out)
- return (fAssemblyIsFullyTrusted == fImageAndDependenciesAreFullTrust);
-
-#else // FEATURE_CORECLR
ETWOnStartup (SecurityCatchCall_V1, SecurityCatchCallEnd_V1);
#ifdef CROSSGEN_COMPILE
diff --git a/src/vm/ecalllist.h b/src/vm/ecalllist.h
index 2966ab5dbe..babb2676f4 100644
--- a/src/vm/ecalllist.h
+++ b/src/vm/ecalllist.h
@@ -527,9 +527,6 @@ FCFuncStart(gSignatureNative)
FCFuncElement("GetSignature", SignatureNative::GetSignature)
FCFuncElement("GetCustomModifiers", SignatureNative::GetCustomModifiers)
FCFuncElement("CompareSig", SignatureNative::CompareSig)
-#if FEATURE_LEGACYNETCF
- FCFuncElement("CompareSigForAppCompat", SignatureNative::CompareSigForAppCompat)
-#endif
FCFuncEnd()
FCFuncStart(gRuntimeMethodHandle)
@@ -569,10 +566,10 @@ FCFuncStart(gRuntimeMethodHandle)
FCFuncElement("IsConstructor", RuntimeMethodHandle::IsConstructor)
QCFuncElement("Destroy", RuntimeMethodHandle::Destroy)
FCFuncElement("GetResolver", RuntimeMethodHandle::GetResolver)
- QCFuncElement("GetCallerType", RuntimeMethodHandle::GetCallerType)
FCFuncElement("GetLoaderAllocator", RuntimeMethodHandle::GetLoaderAllocator)
FCFuncElement("GetSpecialSecurityFlags", ReflectionInvocation::GetSpecialSecurityFlags)
#ifndef FEATURE_CORECLR
+ QCFuncElement("GetCallerType", RuntimeMethodHandle::GetCallerType)
FCFuncElement("PerformSecurityCheck", ReflectionInvocation::PerformSecurityCheck)
#endif // FEATURE_CORECLR
FCFuncEnd()
@@ -687,7 +684,6 @@ FCFuncStart(gCOMClassWriter)
QCFuncElement("SetMethodIL", COMDynamicWrite::SetMethodIL)
QCFuncElement("TermCreateClass", COMDynamicWrite::TermCreateClass)
QCFuncElement("DefineField", COMDynamicWrite::DefineField)
- QCFuncElement("SetPInvokeData", COMDynamicWrite::SetPInvokeData)
QCFuncElement("DefineProperty", COMDynamicWrite::DefineProperty)
QCFuncElement("DefineEvent", COMDynamicWrite::DefineEvent)
QCFuncElement("DefineMethodSemantics", COMDynamicWrite::DefineMethodSemantics)
@@ -698,6 +694,7 @@ FCFuncStart(gCOMClassWriter)
QCFuncElement("SetClassLayout", COMDynamicWrite::SetClassLayout)
QCFuncElement("SetParamInfo", COMDynamicWrite::SetParamInfo)
#ifndef FEATURE_CORECLR
+ QCFuncElement("SetPInvokeData", COMDynamicWrite::SetPInvokeData)
QCFuncElement("SetFieldMarshal", COMDynamicWrite::SetFieldMarshal)
#endif // FEATURE_CORECLR
QCFuncElement("SetConstantValue", COMDynamicWrite::SetConstantValue)
@@ -736,9 +733,9 @@ FCFuncEnd()
#endif // FEATURE_CAS_POLICY
FCFuncStart(gCompatibilitySwitchFuncs)
- FCFuncElement("IsEnabledInternalCall", CompatibilitySwitch::IsEnabled)
FCFuncElement("GetValueInternalCall", CompatibilitySwitch::GetValue)
#ifndef FEATURE_CORECLR
+ FCFuncElement("IsEnabledInternalCall", CompatibilitySwitch::IsEnabled)
FCFuncElement("GetAppContextOverridesInternalCall", CompatibilitySwitch::GetAppContextOverrides)
#endif
FCFuncEnd()
@@ -970,8 +967,6 @@ FCFuncStart(gAppDomainFuncs)
#ifndef FEATURE_CORECLR
FCFuncElement("GetSecurityDescriptor", AppDomainNative::GetSecurityDescriptor)
FCFuncElement("nIsDefaultAppDomainForEvidence", AppDomainNative::IsDefaultAppDomainForEvidence)
-#endif
-#if defined(FEATURE_CORESYSTEM) || !defined(FEATURE_CORECLR)
FCFuncElement("nGetAssemblies", AppDomainNative::GetAssemblies)
#endif
#ifdef FEATURE_CAS_POLICY
@@ -987,7 +982,9 @@ FCFuncStart(gAppDomainFuncs)
#if FEATURE_COMINTEROP
FCFuncElement("nSetDisableInterfaceCache", AppDomainNative::SetDisableInterfaceCache)
#endif // FEATURE_COMINTEROP
+#ifndef FEATURE_CORECLR
FCFuncElement("_nExecuteAssembly", AppDomainNative::ExecuteAssembly)
+#endif
#ifdef FEATURE_VERSIONING
FCFuncElement("nCreateContext", AppDomainNative::CreateContext)
#endif // FEATURE_VERSIONING
@@ -1099,11 +1096,8 @@ FCFuncStart(gAssemblyFuncs)
FCFuncElement("IsNewPortableAssembly", AssemblyNative::IsNewPortableAssembly)
#endif
FCFuncElement("nLoadImage", AssemblyNative::LoadImage)
-#ifdef FEATURE_CORECLR
- QCFuncElement("nLoadFromUnmanagedArray", AssemblyNative::LoadFromUnmanagedArray)
-#endif
- FCFuncElement("nLoadFile", AssemblyNative::LoadFile)
#ifndef FEATURE_CORECLR
+ FCFuncElement("nLoadFile", AssemblyNative::LoadFile)
QCFuncElement("LoadModule", AssemblyNative::LoadModule)
#endif // FEATURE_CORECLR
QCFuncElement("GetType", AssemblyNative::GetType)
@@ -1120,9 +1114,6 @@ FCFuncStart(gAssemblyFuncs)
QCFuncElement("GetExportedTypes", AssemblyNative::GetExportedTypes)
FCFuncElement("GetManifestResourceNames", AssemblyNative::GetManifestResourceNames)
QCFuncElement("GetEntryPoint", AssemblyNative::GetEntryPoint)
-#ifdef FEATURE_LEGACYNETCF
- QCFuncElement("GetIsProfileAssembly", AssemblyNative::GetIsProfileAssembly)
-#endif // FEATURE_LEGACYNETCF
QCFuncElement("IsAllSecurityTransparent", AssemblyNative::IsAllSecurityTransparent)
QCFuncElement("IsAllSecurityCritical", AssemblyNative::IsAllSecurityCritical)
#ifndef FEATURE_CORECLR
@@ -1178,16 +1169,14 @@ FCFuncEnd()
#endif // defined(FEATURE_HOST_ASSEMBLY_RESOLVER)
FCFuncStart(gAssemblyNameFuncs)
-#ifndef FEATURE_CORECLR
- FCFuncElement("nGetFileInformation", AssemblyNameNative::GetFileInformation)
-#endif // FEATURE_CORECLR
+ FCFuncElement("nInit", AssemblyNameNative::Init)
FCFuncElement("nToString", AssemblyNameNative::ToString)
FCFuncElement("nGetPublicKeyToken", AssemblyNameNative::GetPublicKeyToken)
#ifndef FEATURE_CORECLR
FCFuncElement("EscapeCodeBase", AssemblyNameNative::EscapeCodeBase)
-#endif // !FEATURE_CORECLR
- FCFuncElement("nInit", AssemblyNameNative::Init)
FCFuncElement("ReferenceMatchesDefinitionInternal", AssemblyNameNative::ReferenceMatchesDefinition)
+ FCFuncElement("nGetFileInformation", AssemblyNameNative::GetFileInformation)
+#endif // !FEATURE_CORECLR
FCFuncEnd()
FCFuncStart(gLoaderAllocatorFuncs)
@@ -1355,9 +1344,9 @@ FCFuncStart(gThreadFuncs)
FCFuncEnd()
FCFuncStart(gThreadPoolFuncs)
- FCFuncElement("PostQueuedCompletionStatus", ThreadPoolNative::CorPostQueuedCompletionStatus)
#ifndef FEATURE_CORECLR
- FCFuncElement("GetAvailableThreadsNative", ThreadPoolNative::CorGetAvailableThreads)
+ FCFuncElement("PostQueuedCompletionStatus", ThreadPoolNative::CorPostQueuedCompletionStatus)
+ FCFuncElement("GetAvailableThreadsNative", ThreadPoolNative::CorGetAvailableThreads)
#endif // FEATURE_CORECLR
FCFuncElement("SetMinThreadsNative", ThreadPoolNative::CorSetMinThreads)
FCFuncElement("GetMinThreadsNative", ThreadPoolNative::CorGetMinThreads)
diff --git a/src/vm/interoputil.cpp b/src/vm/interoputil.cpp
index 6b5f897a3b..a9ab7d0039 100644
--- a/src/vm/interoputil.cpp
+++ b/src/vm/interoputil.cpp
@@ -5315,18 +5315,6 @@ ClassFactoryBase *GetComClassFactory(MethodTable* pClassMT)
}
else
{
-#ifdef FEATURE_WINDOWSPHONE
- //
- // On the phone, anyone can activate WinRT objects, but only platform code can do legacy COM interop.
- // (Hosts can override this.)
- //
- if (!pClassMT->GetModule()->GetFile()->GetAssembly()->IsProfileAssembly() &&
- !GetAppDomain()->EnablePInvokeAndClassicComInterop())
- {
- COMPlusThrow(kNotSupportedException, W("NotSupported_UserCOM"));
- }
-#endif //FEATURE_WINDOWSPHONE
-
GUID guid;
pClassMT->GetGuid(&guid, TRUE);
diff --git a/src/vm/jithelpers.cpp b/src/vm/jithelpers.cpp
index 07f263cd55..95ba2b4ae2 100644
--- a/src/vm/jithelpers.cpp
+++ b/src/vm/jithelpers.cpp
@@ -6039,24 +6039,7 @@ NOINLINE HCIMPL1(void, JIT_VerificationRuntimeCheck_Internal, CORINFO_METHOD_HAN
#ifdef FEATURE_CORECLR
// Transparent methods that contains unverifiable code is not allowed.
MethodDesc *pMethod = GetMethod(methHnd_);
-
-#if defined(FEATURE_CORECLR_COVERAGE_BUILD) && defined(FEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED)
- // For code coverage builds we have an issue where the inserted IL is not verifiable.
- // This means that transparent methods in platform assemblies will throw verification exceptions.
- // Temporary fix is to allow transparent methods in platform assemblies to be unverifiable only on coverage builds.
- // Paranoia: allow this only on non ret builds - all builds except the RET type will have
- // FEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED defined. So we can use that to figure out if this is a RET build
- // type that someone is trying to relax that constraint on and not allow that.
- if (!pMethod->GetModule()->GetFile()->GetAssembly()->IsProfileAssembly())
- {
- // Only throw if pMethod is not in any platform assembly.
- SecurityTransparent::ThrowMethodAccessException(pMethod);
- }
-#else // defined(FEATURE_CORECLR_COVERAGE_BUILD) && defined(FEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED)
-
SecurityTransparent::ThrowMethodAccessException(pMethod);
-#endif // defined(FEATURE_CORECLR_COVERAGE_BUILD) && defined(FEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED)
-
#else // FEATURE_CORECLR
//
// inject a full-demand for unmanaged code permission at runtime
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index 0a5154aa4f..3247ccb100 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -7671,15 +7671,6 @@ CorInfoInstantiationVerification
goto exit;
}
-#ifdef FEATURE_CORECLR
- //Skip verification of all methods in profile assemblies. We will ensure that they are all verifiable.
- if (pMethod->GetModule()->GetFile()->GetAssembly()->IsProfileAssembly())
- {
- result = INSTVER_GENERIC_PASSED_VERIFICATION;
- goto exit;
- }
-#endif
-
result = pMethod->IsVerifiable() ? INSTVER_GENERIC_PASSED_VERIFICATION
: INSTVER_GENERIC_FAILED_VERIFICATION;
diff --git a/src/vm/pefile.cpp b/src/vm/pefile.cpp
index f4abb5f2f5..f6bf408cac 100644
--- a/src/vm/pefile.cpp
+++ b/src/vm/pefile.cpp
@@ -266,57 +266,6 @@ BOOL PEFile::CanLoadLibrary()
return IsILOnly();
}
-
-#ifdef FEATURE_CORECLR
-void PEFile::ValidateImagePlatformNeutrality()
-{
- STANDARD_VM_CONTRACT;
-
- //--------------------------------------------------------------------------------
- // There are no useful applications of the "/platform" switch for CoreCLR.
- // CoreCLR will do the conservative thing and by default only accept appbase assemblies
- // compiled with "/platform:anycpu" (or no "/platform" switch at all.)
- // However, with hosting flags it is possible to suppress this check and allow
- // platform specific assemblies. This was primarily added to support C++/CLI
- // generated assemblies build with /CLR:PURE flags. This was a need for the CoreSystem
- // server work.
- //
- // We do allow Platform assemblies to have platform specific code (because they
- // in fact do have such code.
- //--------------------------------------------------------------------------------
- if (!(GetAssembly()->IsProfileAssembly()) && !GetAppDomain()->AllowPlatformSpecificAppAssemblies())
- {
-
- DWORD machine, kind;
- BOOL fMachineOk,fPlatformFlagsOk;
-
-#ifdef FEATURE_TREAT_NI_AS_MSIL_DURING_DIAGNOSTICS
- if (ShouldTreatNIAsMSIL() && GetILimage()->HasNativeHeader())
- {
- GetILimage()->GetNativeILPEKindAndMachine(&kind, &machine);
- }
- else
-#endif // FEATURE_TREAT_NI_AS_MSIL_DURING_DIAGNOSTICS
- {
- //The following function gets the kind and machine given by the IL image.
- //In the case of NGened images- It gets the original kind and machine of the IL image
- //from the copy maintained by NI
- GetPEKindAndMachine(&kind, &machine);
- }
-
- fMachineOk = (machine == IMAGE_FILE_MACHINE_I386);
- fPlatformFlagsOk = ((kind & (peILonly | pe32Plus | pe32BitRequired)) == peILonly);
-
- if (!(fMachineOk &&
- fPlatformFlagsOk))
- {
- // This exception matches what the desktop OS hook throws - unfortunate that this is so undescriptive.
- COMPlusThrowHR(COR_E_BADIMAGEFORMAT);
- }
- }
-}
-#endif
-
#ifdef FEATURE_MIXEDMODE
#ifndef CROSSGEN_COMPILE
@@ -595,11 +544,6 @@ void PEFile::LoadLibrary(BOOL allowNativeSkip/*=TRUE*/) // if allowNativeSkip==F
// See if we've already loaded it.
if (CheckLoaded(allowNativeSkip))
{
-#ifdef FEATURE_CORECLR
- if (!IsResource() && !IsDynamic())
- ValidateImagePlatformNeutrality();
-#endif //FEATURE_CORECLR
-
#ifdef FEATURE_MIXEDMODE
// Prevent loading C++/CLI images into multiple runtimes in the same process. Note that if ILOnly images
// stop being LoadLibrary'ed, the check for pure 2.0 C++/CLI images will need to be done somewhere else.
@@ -618,10 +562,6 @@ void PEFile::LoadLibrary(BOOL allowNativeSkip/*=TRUE*/) // if allowNativeSkip==F
RETURN;
}
-#ifdef FEATURE_CORECLR
- ValidateImagePlatformNeutrality();
-#endif //FEATURE_CORECLR
-
#if !defined(_WIN64)
if (!HasNativeImage() && (!GetILimage()->Has32BitNTHeaders()) && !IsIntrospectionOnly())
{
@@ -4397,72 +4337,10 @@ BOOL PEAssembly::IsProfileAssembly()
// from the old Silverlight binder, people took advantage of it and we cannot easily get rid of it now. See DevDiv #710462.
//
BOOL bProfileAssembly = IsSourceGAC() && (IsSystem() || m_bIsOnTpaList);
- if(!AppX::IsAppXProcess())
- {
- bProfileAssembly |= IsSourceGAC() && IsSilverlightPlatformStrongNameSignature();
- }
m_fProfileAssembly = bProfileAssembly ? 1 : -1;
return bProfileAssembly;
}
-
-BOOL PEAssembly::IsSilverlightPlatformStrongNameSignature()
-{
- CONTRACTL
- {
- THROWS;
- GC_TRIGGERS;
- MODE_ANY;
- }
- CONTRACTL_END;
-
- if (IsDynamic())
- return FALSE;
-
- DWORD cbPublicKey;
- const BYTE *pbPublicKey = static_cast<const BYTE *>(GetPublicKey(&cbPublicKey));
- if (pbPublicKey == nullptr)
- {
- return false;
- }
-
- if (StrongNameIsSilverlightPlatformKey(pbPublicKey, cbPublicKey))
- return true;
-
-#ifdef FEATURE_STRONGNAME_TESTKEY_ALLOWED
- if (StrongNameIsTestKey(pbPublicKey, cbPublicKey))
- return true;
-#endif
-
- return false;
-}
-
-#ifdef FEATURE_STRONGNAME_TESTKEY_ALLOWED
-BOOL PEAssembly::IsProfileTestAssembly()
-{
- WRAPPER_NO_CONTRACT;
-
- return IsSourceGAC() && IsTestKeySignature();
-}
-
-BOOL PEAssembly::IsTestKeySignature()
-{
- WRAPPER_NO_CONTRACT;
-
- if (IsDynamic())
- return FALSE;
-
- DWORD cbPublicKey;
- const BYTE *pbPublicKey = static_cast<const BYTE *>(GetPublicKey(&cbPublicKey));
- if (pbPublicKey == nullptr)
- {
- return false;
- }
-
- return StrongNameIsTestKey(pbPublicKey, cbPublicKey);
-}
-#endif // FEATURE_STRONGNAME_TESTKEY_ALLOWED
-
#endif // FEATURE_CORECLR
// ------------------------------------------------------------
diff --git a/src/vm/pefile.h b/src/vm/pefile.h
index 1d1b715feb..5cf5dfb937 100644
--- a/src/vm/pefile.h
+++ b/src/vm/pefile.h
@@ -834,9 +834,6 @@ class PEAssembly : public PEFile
BOOL IsSourceGAC();
#ifdef FEATURE_CORECLR
BOOL IsProfileAssembly();
- BOOL IsSilverlightPlatformStrongNameSignature();
- BOOL IsProfileTestAssembly();
- BOOL IsTestKeySignature();
#endif // FEATURE_CORECLR
ULONG HashIdentity();
diff --git a/src/vm/security.cpp b/src/vm/security.cpp
index daa32be6e9..95c16bf5cd 100644
--- a/src/vm/security.cpp
+++ b/src/vm/security.cpp
@@ -55,9 +55,9 @@ BOOL Security::IsTransparencyEnforcementEnabled()
LIMITED_METHOD_CONTRACT;
#ifdef FEATURE_CORECLR
- if (GetAppDomain()->IsTransparencyEnforcementDisabled())
- return FALSE;
-#endif
+ // No transparency enforcement in .NET Core
+ return FALSE;
+#else
#ifdef _DEBUG
if (g_pConfig->DisableTransparencyEnforcement())
@@ -65,6 +65,7 @@ BOOL Security::IsTransparencyEnforcementEnabled()
#endif
return TRUE;
+#endif // FEATURE_CORECLR
}
//---------------------------------------------------------------------------------------
diff --git a/src/vm/security.h b/src/vm/security.h
index e5698e6575..2238279cd7 100644
--- a/src/vm/security.h
+++ b/src/vm/security.h
@@ -236,10 +236,6 @@ namespace Security
inline SString GetConditionalAptcaAccessExceptionContext(Assembly *pTargetAssembly);
#endif // FEATURE_APTCA
-#ifdef FEATURE_CORECLR
- inline BOOL IsMicrosoftPlatform(IAssemblySecurityDescriptor *pSecDesc);
-#endif // FEATURE_CORECLR
-
inline bool SecurityCalloutQuickCheck(MethodDesc *pCallerMD);
inline bool CanShareAssembly(DomainAssembly *pAssembly);
diff --git a/src/vm/security.inl b/src/vm/security.inl
index 745de2866d..2f1f96cca8 100644
--- a/src/vm/security.inl
+++ b/src/vm/security.inl
@@ -550,6 +550,11 @@ inline BOOL Security::CanSkipVerification(MethodDesc * pMD)
}
CONTRACTL_END;
+#ifdef FEATURE_CORECLR
+ // Always skip verification on CoreCLR
+ return TRUE;
+#else
+
// Special case the System.Object..ctor:
// System.Object..ctor is not verifiable according to current verifier rules (that require to call the base
// class ctor). But since we want System.Object..ctor() to be marked transparent, it cannot be unverifiable
@@ -570,32 +575,18 @@ inline BOOL Security::CanSkipVerification(MethodDesc * pMD)
BOOL fCanSkipVerification = Security::CanSkipVerification(pMD->GetAssembly()->GetDomainAssembly());
if (fCanSkipVerification)
{
-#ifdef FEATURE_CORECLR
- //For Profile assemblies, do not verify any code. All Transparent methods are guaranteed to be
- //verifiable (verified by tests). Therefore, skip all verification on platform assemblies.
- if(pMD->GetAssembly()->GetDomainAssembly()->GetFile()->IsProfileAssembly())
- return TRUE;
-#endif
// check for transparency
if (SecurityTransparent::IsMethodTransparent(pMD))
{
-#ifndef FEATURE_CORECLR
ModuleSecurityDescriptor *pModuleSecDesc = ModuleSecurityDescriptor::GetModuleSecurityDescriptor(pMD->GetAssembly());
if (!pModuleSecDesc->CanTransparentCodeSkipVerification())
-#endif // !FEATURE_CORECLR
{
return FALSE;
}
}
}
-#if defined(_DEBUG) && defined(FEATURE_CORECLR)
- else
- {
- //Profile assemblies must have skip verification.
- _ASSERTE(!pMD->GetAssembly()->GetDomainAssembly()->GetFile()->IsProfileAssembly());
- }
-#endif //_DEBUG && FEATURE_CORECLR
return fCanSkipVerification;
+#endif // !FEATURE_CORECLR
}
#endif //!DACCESS_COMPILE
@@ -657,18 +648,6 @@ inline SString Security::GetConditionalAptcaAccessExceptionContext(Assembly *pTa
#endif // FEATURE_APTCA
-#ifdef FEATURE_CORECLR
-#ifndef DACCESS_COMPILE
-
-inline BOOL Security::IsMicrosoftPlatform(IAssemblySecurityDescriptor *pSecDesc)
-{
- WRAPPER_NO_CONTRACT;
- return static_cast<AssemblySecurityDescriptor*>(pSecDesc)->IsMicrosoftPlatform();
-}
-#endif // DACCESS_COMPILE
-#endif // FEATURE_CORECLR
-
-
inline bool Security::SecurityCalloutQuickCheck(MethodDesc *pCallerMD)
{
WRAPPER_NO_CONTRACT;
diff --git a/src/vm/securitydescriptorassembly.cpp b/src/vm/securitydescriptorassembly.cpp
index fb28bd4c7b..c2aef22019 100644
--- a/src/vm/securitydescriptorassembly.cpp
+++ b/src/vm/securitydescriptorassembly.cpp
@@ -486,90 +486,7 @@ void AssemblySecurityDescriptor::ResolveWorker()
} CONTRACTL_END;
#ifdef FEATURE_CORECLR
-
- if (NingenEnabled())
- {
- int dwSpecialFlags;
- BOOL platformAssembly = FALSE;
-
- if (IsSystem())
- {
- dwSpecialFlags = 0xFFFFFFFF;
- platformAssembly = TRUE;
- }
- else
- {
- // Decide if this is a platform assembly
- if (m_pAssem->GetFile()->IsProfileAssembly())
- platformAssembly = TRUE;
-
- // Decide trust level
- if (platformAssembly)
- {
- dwSpecialFlags = 0xFFFFFFFF;
- }
- else
- {
- dwSpecialFlags = m_pAppDomain->GetSecurityDescriptor()->GetSpecialFlags();
- }
- }
-
- SetGrantedPermissionSet(NULL, NULL, dwSpecialFlags);
- if (platformAssembly)
- SetMicrosoftPlatform();
-
- return;
- }
-
-#ifndef CROSSGEN_COMPILE
- int dwSpecialFlags;
- BOOL platformAssembly = FALSE;
- BOOL trustedAssembly = FALSE;
-
- struct _gc {
- OBJECTREF granted; // Policy based Granted Permission
- } gc;
- ZeroMemory(&gc, sizeof(gc));
- GCPROTECT_BEGIN(gc);
-
- if (IsSystem())
- {
- // mscorlib is always FT, but we can't create permissionsets yet. So grantset for mscorlib will be NULL: we should never look at it though.
- dwSpecialFlags = 0xFFFFFFFF;
- platformAssembly = TRUE;
- }
- else
- {
- // Decide if this is a platform assembly
- if (m_pAssem->GetFile()->IsProfileAssembly())
- platformAssembly = TRUE;
-
- // Decide trust level
- if (platformAssembly || trustedAssembly)
- {
- Security::GetPermissionInstance(&gc.granted, SECURITY_FULL_TRUST);
- dwSpecialFlags = 0xFFFFFFFF;
- }
- else
- {
- // get grant from AppDomain grant set.
- gc.granted = m_pAppDomain->GetSecurityDescriptor()->GetGrantedPermissionSet(NULL);
- dwSpecialFlags = m_pAppDomain->GetSecurityDescriptor()->GetSpecialFlags();
- }
-
- }
- SetGrantedPermissionSet(gc.granted, NULL, dwSpecialFlags);
- if (platformAssembly)
- SetMicrosoftPlatform();
-
- // Only fully trusted assemblies are allowed to be loaded when
- // the AppDomain is in the initialization phase.
- if (m_pAppDomain->GetSecurityDescriptor()->IsInitializationInProgress() && !IsFullyTrusted())
- COMPlusThrow(kApplicationException, W("Policy_CannotLoadSemiTrustAssembliesDuringInit"));
-
- GCPROTECT_END();
-#endif // CROSSGEN_COMPILE
-
+ SetGrantedPermissionSet(NULL, NULL, 0xFFFFFFFF);
#else
if (CanSkipPolicyResolution() || NingenEnabled()) {
SetGrantedPermissionSet(NULL, NULL, 0xFFFFFFFF);
@@ -1017,9 +934,6 @@ void SharedSecurityDescriptor::Resolve(IAssemblySecurityDescriptor *pSecDesc)
m_fFullyTrusted = pSecDesc->IsFullyTrusted();
m_fCanCallUnmanagedCode = pSecDesc->CanCallUnmanagedCode();
m_fCanAssert = pSecDesc->CanAssert();
-#ifdef FEATURE_CORECLR
- m_fMicrosoftPlatform = static_cast<AssemblySecurityDescriptor*>(pSecDesc)->IsMicrosoftPlatform();
-#endif // FEATURE_CORECLR
m_fResolved = TRUE;
}
diff --git a/src/vm/securitydescriptorassembly.h b/src/vm/securitydescriptorassembly.h
index 132a1d8c86..15bc83eef6 100644
--- a/src/vm/securitydescriptorassembly.h
+++ b/src/vm/securitydescriptorassembly.h
@@ -133,10 +133,6 @@ public:
virtual void CheckAllowAssemblyLoad();
-#ifdef FEATURE_CORECLR
- inline BOOL IsMicrosoftPlatform();
-#endif // FEATURE_CORECLR
-
private:
BOOL CanSkipPolicyResolution();
OBJECTREF UpgradePEFileEvidenceToAssemblyEvidence(const OBJECTREF& objPEFileEvidence);
@@ -156,9 +152,6 @@ private:
inline BOOL IsConditionalAptca();
#endif // FEATURE_APTCA
-#ifdef FEATURE_CORECLR
- inline void SetMicrosoftPlatform();
-#endif // FEAUTRE_CORECLR
#endif // #ifndef DACCESS_COMPILE
};
@@ -193,7 +186,6 @@ public:
virtual BOOL IsSystem();
virtual Assembly* GetAssembly();
- inline BOOL IsMicrosoftPlatform();
BOOL IsFullyTrusted();
BOOL CanCallUnmanagedCode() const;
BOOL CanAssert();
diff --git a/src/vm/securitydescriptorassembly.inl b/src/vm/securitydescriptorassembly.inl
index a72efa2123..44b49a32c9 100644
--- a/src/vm/securitydescriptorassembly.inl
+++ b/src/vm/securitydescriptorassembly.inl
@@ -57,22 +57,6 @@ inline void AssemblySecurityDescriptor::SetSignatureLoaded()
#endif // FEATURE_CAS_POLICY
-#ifdef FEATURE_CORECLR
-
-inline BOOL AssemblySecurityDescriptor::IsMicrosoftPlatform()
-{
- LIMITED_METHOD_CONTRACT;
- return m_fMicrosoftPlatform;
-}
-
-inline void AssemblySecurityDescriptor::SetMicrosoftPlatform()
-{
- LIMITED_METHOD_CONTRACT;
- m_fMicrosoftPlatform = TRUE;
-}
-
-#endif // FEATURE_CORECLR
-
#ifdef FEATURE_APTCA
inline BOOL AssemblySecurityDescriptor::IsConditionalAptca()
@@ -86,12 +70,6 @@ inline BOOL AssemblySecurityDescriptor::IsConditionalAptca()
#endif // !DACCESS_COMPILE
-inline BOOL SharedSecurityDescriptor::IsMicrosoftPlatform()
-{
- LIMITED_METHOD_CONTRACT;
- return m_fMicrosoftPlatform;
-}
-
inline AssemblyLoadSecurity::AssemblyLoadSecurity() :
m_pEvidence(NULL),
m_pAdditionalEvidence(NULL),
diff --git a/src/vm/securitymeta.cpp b/src/vm/securitymeta.cpp
index 85c81f75db..980958d49f 100644
--- a/src/vm/securitymeta.cpp
+++ b/src/vm/securitymeta.cpp
@@ -1712,17 +1712,6 @@ void ModuleSecurityDescriptor::VerifyDataComputed()
}
#endif // _DEBUG
-#ifdef FEATURE_CORECLR
- if (pAssembly->IsSystem() || (pAssembly->GetManifestFile()->HasOpenedILimage() && GetAppDomain()->IsImageFullyTrusted(pAssembly->GetManifestFile()->GetOpenedILimage())))
- {
- // Set the flag if the assembly is microsoft platform. This gets saved in Ngen Image
- // to determinne if the NI was genrated as full-trust. If NI is generated as full-trust
- // the codegen is generated different as compared to non-trusted.
- _ASSERTE(!(moduleFlags & ModuleSecurityDescriptorFlags_IsMicrosoftPlatform));
- moduleFlags |= ModuleSecurityDescriptorFlags_IsMicrosoftPlatform;
- }
-#endif
-
// Mark the module as having its security state computed
moduleFlags |= ModuleSecurityDescriptorFlags_IsComputed;
InterlockedCompareExchange(reinterpret_cast<LONG *>(&m_flags),
diff --git a/src/vm/securitymeta.h b/src/vm/securitymeta.h
index 01b7e325a2..d78b7bde54 100644
--- a/src/vm/securitymeta.h
+++ b/src/vm/securitymeta.h
@@ -559,8 +559,6 @@ enum ModuleSecurityDescriptorFlags
ModuleSecurityDescriptorFlags_IsOpportunisticallyCritical = 0x0020, // Ensure that the assembly follows all transparency rules by making all methods critical or safe critical as needed
ModuleSecurityDescriptorFlags_SkipFullTrustVerification = 0x0040, // Fully trusted transparent code does not require verification
ModuleSecurityDescriptorFlags_TransparentDueToPartialTrust = 0x0080, // Whether we made the assembly all transparent because it was partially-trusted
- ModuleSecurityDescriptorFlags_IsMicrosoftPlatform = 0x0100, // Whether we made the assembly microsoft platform. Stored in ngen image to determine if the ngen
- // was generated as microsoft platform assembly (full trust) or not.
};
inline ModuleSecurityDescriptorFlags operator|(ModuleSecurityDescriptorFlags lhs,
@@ -615,9 +613,6 @@ public:
inline ModuleSecurityDescriptorFlags GetRawFlags();
#endif // DACCESS_COMPILE
- // Is Microsoft Platform
- inline BOOL IsMicrosoftPlatform();
-
// Is every method and type in the assembly transparent
inline BOOL IsAllTransparent();
diff --git a/src/vm/securitymeta.inl b/src/vm/securitymeta.inl
index a735599c61..adb6faa5ac 100644
--- a/src/vm/securitymeta.inl
+++ b/src/vm/securitymeta.inl
@@ -1060,13 +1060,6 @@ inline ModuleSecurityDescriptorFlags ModuleSecurityDescriptor::GetRawFlags()
}
#endif // DACCESS_COMPILE
-inline BOOL ModuleSecurityDescriptor::IsMicrosoftPlatform()
-{
- WRAPPER_NO_CONTRACT;
- VerifyDataComputed();
- return !!(m_flags & ModuleSecurityDescriptorFlags_IsMicrosoftPlatform);
-}
-
inline BOOL ModuleSecurityDescriptor::IsAllTransparent()
{
WRAPPER_NO_CONTRACT;
diff --git a/src/vm/securitytransparentassembly.cpp b/src/vm/securitytransparentassembly.cpp
index f3ab6e22cd..4a23c276d8 100644
--- a/src/vm/securitytransparentassembly.cpp
+++ b/src/vm/securitytransparentassembly.cpp
@@ -528,29 +528,7 @@ CorInfoCanSkipVerificationResult SecurityTransparent::JITCanSkipVerification(Met
CorInfoCanSkipVerificationResult canSkipVerif = hasSkipVerificationPermisson ? CORINFO_VERIFICATION_CAN_SKIP : CORINFO_VERIFICATION_CANNOT_SKIP;
-#ifdef FEATURE_CORECLR
- //For Profile assemblies, do not verify any code. All Transparent methods are guaranteed to be
- //verifiable (verified by tests). Therefore, skip all verification on platform assemblies.
-
- //All profile assemblies have skip verification.
- _ASSERTE(!(pDomainAssembly->GetFile()->IsProfileAssembly() && !hasSkipVerificationPermisson));
-
-#ifdef FEATURE_CORESYSTEM
- //
- // On Phone, at runtime, enable verification for user code that will run as transparent:
- // - All Mango applications
- // - Apollo applications with transparent code
- //
- if (hasSkipVerificationPermisson && !pDomainAssembly->GetFile()->IsProfileAssembly())
- {
- if (SecurityTransparent::IsMethodTransparent(pMD))
- {
- canSkipVerif = CORINFO_VERIFICATION_CANNOT_SKIP;
- }
- }
-#endif // FEATURE_CORESYSTEM
-
-#else //FEATURE_CORECLR
+#ifndef FEATURE_CORECLR
// also check to see if the method is marked transparent
if (hasSkipVerificationPermisson)
{
@@ -943,17 +921,7 @@ static void ConvertLinkDemandToFullDemand(MethodDesc* pCallerMD, MethodDesc* pCa
}
else
{
-#if defined(FEATURE_CORECLR_COVERAGE_BUILD) && defined(FEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED)
- // For code coverage builds we have an issue where the inserted types/methods are not annotated.
- // In patricular, there may be p/invokes from transparent code. Allow that on cov builds for platform assemblies.
- // Paranoia: allow this only on non shp builds - all builds except the SHP type will have
- // FEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED defined. So we can use that to figure out if this is a SHP build
- // type that someone is trying to relax that constraint on and not allow that.
- if (!pCalleeMD->GetModule()->GetFile()->GetAssembly()->IsProfileAssembly())
-#endif // defined(FEATURE_CORECLR_COVERAGE_BUILD) && defined(FEATURE_STRONGNAME_DELAY_SIGNING_ALLOWED)
- {
- ::ThrowMethodAccessException(pCallerMD, pCalleeMD, FALSE, IDS_E_TRANSPARENT_CALL_NATIVE);
- }
+ ::ThrowMethodAccessException(pCallerMD, pCalleeMD, FALSE, IDS_E_TRANSPARENT_CALL_NATIVE);
}
}
diff --git a/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall.il b/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall.il
deleted file mode 100644
index b8e731caba..0000000000
--- a/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall.il
+++ /dev/null
@@ -1,416 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-
-.assembly extern System.Console
-{
- .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
- .ver 4:0:0:0
-}
-
-.assembly extern mscorlib {}
-.assembly extern NonVirtualCall_Lib {}
-.assembly NonVirtualCall
-{
-.custom instance void [mscorlib]System.Security.SecurityTransparentAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Security.SecurityRulesAttribute::.ctor(valuetype [mscorlib]System.Security.SecurityRuleSet) = ( 01 00 02 00 00 )
-}
-
-
-.method public static void Test_CallNonFinalVirtualOutside_Neg()
-{
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::VirtualMethod()
- ret
-}
-
-.method public static void Test_DelegateNonFinalVirtualOutside_Neg()
-{
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- ldftn instance void [NonVirtualCall_Lib]ChildClass::VirtualMethod()
- newobj instance void [NonVirtualCall_Lib]TestDelegate::.ctor(object, native int)
- call instance void [NonVirtualCall_Lib]TestDelegate::Invoke()
- ret
-}
-
-.method public static void Test_CallFinalVirtualOutside_Pos()
-{
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::FinalVirtualMethod()
- ret
-}
-
-.method public static void Test_DelegateFinalVirtualOutside_Pos()
-{
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- ldftn instance void [NonVirtualCall_Lib]ChildClass::FinalVirtualMethod()
- newobj instance void [NonVirtualCall_Lib]TestDelegate::.ctor(object, native int)
- call instance void [NonVirtualCall_Lib]TestDelegate::Invoke()
- ret
-}
-
-.method public static void Test_CallSealedVirtualOutside_Pos()
-{
- newobj instance void [NonVirtualCall_Lib]SealedClass::.ctor()
- call instance void [NonVirtualCall_Lib]SealedClass::VirtualMethod()
- ret
-}
-
-.method public static void Test_DelegateSealedVirtualOutside_Pos()
-{
- newobj instance void [NonVirtualCall_Lib]SealedClass::.ctor()
- ldftn instance void [NonVirtualCall_Lib]SealedClass::VirtualMethod()
- newobj instance void [NonVirtualCall_Lib]TestDelegate::.ctor(object, native int)
- call instance void [NonVirtualCall_Lib]TestDelegate::Invoke()
- ret
-}
-
-.method public static void Test_CallNonFinalVirtualBoxedValueType_Pos()
-{
- .locals init (value class [NonVirtualCall_Lib]TestValueType)
- ldloc 0
- box value class [NonVirtualCall_Lib]TestValueType
- call instance string [mscorlib]System.Object::ToString()
- pop
- ret
-}
-
-.method public static void Test_DelegateNonFinalVirtualBoxedValueType_Pos()
-{
- .locals init (value class [NonVirtualCall_Lib]TestValueType)
- ldloc 0
- box value class [NonVirtualCall_Lib]TestValueType
- ldftn instance string [mscorlib]System.Object::ToString()
- newobj instance void [NonVirtualCall_Lib]ToStringDelegate::.ctor(object, native int)
- call instance string [NonVirtualCall_Lib]ToStringDelegate::Invoke()
- pop
- ret
-}
-
-.method public static int32 Main()
-{
- .entrypoint
-
- .try
- {
- call void Test_CallNonFinalVirtualOutside_Neg()
- ldstr "Error: Test_CallNonFinalVirtualOutside_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next0
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_CallNonFinalVirtualOutside_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next0:
- .try
- {
- call void Test_DelegateNonFinalVirtualOutside_Neg()
- ldstr "Error: Test_DelegateNonFinalVirtualOutside_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next1
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_DelegateNonFinalVirtualOutside_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-
-Next1:
- call void Test_CallFinalVirtualOutside_Pos()
- call void Test_DelegateFinalVirtualOutside_Pos()
- call void Test_CallSealedVirtualOutside_Pos()
- call void Test_CallSealedVirtualOutside_Pos()
-
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- dup
- dup
- dup
- dup
- dup
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallNonFinalVirtualInside_Pos()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_DelegateNonFinalVirtualInside_Pos()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualInside_Pos()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_DelegateParentNonFinalVirtualInside_Pos()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallGrandparentNonFinalVirtualInside_Pos()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_DelegateGrandparentNonFinalVirtualInside_Pos()
-
- call void Test_CallNonFinalVirtualBoxedValueType_Pos()
- call void Test_DelegateNonFinalVirtualBoxedValueType_Pos()
-
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualAfterLdarga_Neg()
- ldstr "Error: Test_CallParentNonFinalVirtualAfterLdarga_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next2
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_CallParentNonFinalVirtualAfterLdarga_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next2:
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualAfterLdargaS_Neg()
- ldstr "Error: Test_CallParentNonFinalVirtualAfterLdargaS_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next3
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_CallParentNonFinalVirtualAfterLdargaS_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next3:
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualAfterStarg_Neg()
- ldstr "Error: Test_CallParentNonFinalVirtualAfterStarg_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next4
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_CallParentNonFinalVirtualAfterStarg_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next4:
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualAfterStargS_Neg()
- ldstr "Error: Test_CallParentNonFinalVirtualAfterStargS_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next5
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_CallParentNonFinalVirtualAfterStargS_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next5:
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- dup
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualAfterStargNonZero_Pos(class [NonVirtualCall_Lib]ChildClass)
-
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_DelegateParentNonFinalVirtualAfterStarg_Neg()
- ldstr "Error: Test_DelegateParentNonFinalVirtualAfterStarg_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next6
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_DelegateParentNonFinalVirtualAfterStarg_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next6:
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualAfterLdlocStloc_Neg()
- ldstr "Error: Test_CallParentNonFinalVirtualAfterLdlocStloc_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next7
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_CallParentNonFinalVirtualAfterLdlocStloc_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next7:
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualAfterNewobj_Neg()
- ldstr "Error: Test_CallParentNonFinalVirtualAfterNewobj_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next8
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_CallParentNonFinalVirtualAfterNewobj_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next8:
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualWithNull_Neg()
- ldstr "Error: Test_CallParentNonFinalVirtualWithNull_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next9
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_CallParentNonFinalVirtualWithNull_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next9:
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_DelegateParentNonFinalVirtualWithNull_Neg()
- ldstr "Error: Test_DelegateParentNonFinalVirtualWithNull_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next10
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_DelegateParentNonFinalVirtualWithNull_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next10:
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualWithDup_Pos()
-
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- ldc.i4.0
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualAfterCondStarg_Neg(int32)
- ldstr "Error: Test_CallParentNonFinalVirtualAfterCondStarg_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next11
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_CallParentNonFinalVirtualAfterCondStarg_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next11:
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualInException_Neg()
- ldstr "Error: Test_CallParentNonFinalVirtualInException_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next12
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_CallParentNonFinalVirtualInException_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next12:
- .try
- {
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallParentNonFinalVirtualBeforeStarg_Neg()
- ldstr "Error: Test_CallParentNonFinalVirtualBeforeStarg_Neg did not throw an exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
- catch [mscorlib]System.Security.VerificationException
- {
- leave Next13
- }
- catch [mscorlib]System.Exception
- {
- ldstr "Error: Test_CallParentNonFinalVirtualBeforeStarg_Neg threw an unexpected exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave Fail
- }
-
-Next13:
- newobj instance void [NonVirtualCall_Lib]ChildClass::.ctor()
- call instance void [NonVirtualCall_Lib]ChildClass::Test_CallNonFinalVirtualBoxedValueTypeAfterStarg_Pos()
-
- ldstr "Test Passed"
- call void [System.Console]System.Console::WriteLine(string)
- ldc.i4 100
- br End
-
-Fail:
- ldstr "Test Failed"
- call void [System.Console]System.Console::WriteLine(string)
- ldc.i4 101
-
-End:
- ret
-}
diff --git a/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall.ilproj b/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall.ilproj
deleted file mode 100644
index 1910251e08..0000000000
--- a/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall.ilproj
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- </PropertyGroup>
- <!-- Default configurations to help VS understand the configurations -->
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- </PropertyGroup>
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
- <PropertyGroup>
- <DebugType>Full</DebugType>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="NonVirtualCall.il" />
- </ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
- <None Include="app.config" />
- </ItemGroup>
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
- </PropertyGroup>
- <ItemGroup>
- <ProjectReference Include="NonVirtualCall_Lib.ilproj" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
- </PropertyGroup>
-</Project>
diff --git a/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall_Lib.il b/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall_Lib.il
deleted file mode 100644
index 5904bf1298..0000000000
--- a/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall_Lib.il
+++ /dev/null
@@ -1,332 +0,0 @@
-
-// Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50620.00
-// Microsoft Corporation. All rights reserved.
-
-
-
-// Metadata version: v2.0.50620
-.assembly extern mscorlib
-{
- .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
- .ver 2:0:0:0
-}
-.assembly NonVirtualCall_Lib
-{
- .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
- .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
- 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
- .custom instance void [mscorlib]System.Security.SecurityTransparentAttribute::.ctor() = ( 01 00 00 00 )
- .custom instance void [mscorlib]System.Security.SecurityRulesAttribute::.ctor(valuetype [mscorlib]System.Security.SecurityRuleSet) = ( 01 00 02 00 00 )
- .hash algorithm 0x00008004
- .ver 0:0:0:0
-}
-.module NonVirtualCall_Lib.dll
-// MVID: {06A0A842-CB0F-4CC1-9439-EECC24ABD077}
-.imagebase 0x00400000
-.file alignment 0x00000200
-.stackreserve 0x00100000
-.subsystem 0x0003 // WINDOWS_CUI
-.corflags 0x00000001 // ILONLY
-// Image base: 0x01010000
-
-
-// =============== CLASS MEMBERS DECLARATION ===================
-
-.class public ChildClass extends ParentClass
-{
- .method public instance void .ctor()
- {
- ldarg 0
- call instance void ParentClass::.ctor()
- ret
- }
-
- .method public virtual void VirtualMethod()
- {
- ret
- }
-
- .method public final virtual void FinalVirtualMethod()
- {
- ret
- }
-
- // In-class Testcases
- //
- .method public instance void Test_CallNonFinalVirtualInside_Pos()
- {
- ldarg 0
- call instance void ChildClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_DelegateNonFinalVirtualInside_Pos()
- {
- ldarg 0
- ldftn instance void ChildClass::VirtualMethod()
- newobj instance void TestDelegate::.ctor(object, native int)
- call instance void TestDelegate::Invoke()
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualInside_Pos()
- {
- ldarg 0
- call instance void ParentClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_DelegateParentNonFinalVirtualInside_Pos()
- {
- ldarg 0
- ldftn instance void ParentClass::VirtualMethod()
- newobj instance void TestDelegate::.ctor(object, native int)
- call instance void TestDelegate::Invoke()
- ret
- }
-
- .method public instance void Test_CallGrandparentNonFinalVirtualInside_Pos()
- {
- ldarg 0
- call instance void GrandparentClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_DelegateGrandparentNonFinalVirtualInside_Pos()
- {
- ldarg 0
- ldftn instance void GrandparentClass::VirtualMethod()
- newobj instance void TestDelegate::.ctor(object, native int)
- call instance void TestDelegate::Invoke()
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualAfterLdarga_Neg()
- {
- ldarg 0
- ldarga 0
- pop
- call instance void ParentClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualAfterLdargaS_Neg()
- {
- // Switched the order of ldarg/ldarga to cover both opcodes, plus before/after ldarg opcode
- //
- ldarga.s 0
- pop
- ldarg 0
- call instance void ParentClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualAfterStarg_Neg()
- {
- ldarg 0
- dup
- starg 0
- call instance void ParentClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualAfterStargS_Neg()
- {
- // Switched the order of ldarg/starg to cover both opcodes, plus before/after ldarg opcode
- //
- ldarg 0
- starg.s 0
- ldarg 0
- call instance void ParentClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualAfterStargNonZero_Pos(class ChildClass)
- {
- ldarg 0
- starg 1
- ldarg 0
- call instance void ParentClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_DelegateParentNonFinalVirtualAfterStarg_Neg()
- {
- ldarg 0
- starg 0
- ldarg 0
- ldftn instance void ParentClass::VirtualMethod()
- newobj instance void TestDelegate::.ctor(object, native int)
- call instance void TestDelegate::Invoke()
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualAfterLdlocStloc_Neg()
- {
- .locals init (class ChildClass)
- ldarg 0
- stloc 0
- ldloc 0
- call instance void ParentClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualAfterNewobj_Neg()
- {
- newobj instance void ChildClass::.ctor()
- call instance void ParentClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualWithNull_Neg()
- {
- ldnull
- call instance void ParentClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_DelegateParentNonFinalVirtualWithNull_Neg()
- {
- ldnull
- ldftn instance void ParentClass::VirtualMethod()
- newobj instance void TestDelegate::.ctor(object, native int)
- pop
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualWithDup_Pos()
- {
- ldarg 0
- dup
- call instance void ParentClass::VirtualMethod()
- pop
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualAfterCondStarg_Neg(int32)
- {
- ldarg 1
- brfalse Label
- ldarg 0
- starg 0
-Label:
- ldarg 0
- call instance void ParentClass::VirtualMethod()
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualInException_Neg()
- {
- .try
- {
- ldarg 0
- starg 0
- newobj instance void [mscorlib]System.Exception::.ctor()
- throw
- }
- catch [mscorlib]System.Exception
- {
- ldarg 0
- call instance void ParentClass::VirtualMethod()
- leave EndSEH
- }
-
-EndSEH:
- ret
- }
-
- .method public instance void Test_CallParentNonFinalVirtualBeforeStarg_Neg()
- {
- ldarg 0
- call instance void ParentClass::VirtualMethod()
- ldarg 0
- starg 0
- ret
- }
-
- .method public instance void Test_CallNonFinalVirtualBoxedValueTypeAfterStarg_Pos()
- {
- .locals init (value class TestValueType)
- ldarg 0
- starg 0
- ldloc 0
- box value class TestValueType
- call instance string [mscorlib]System.Object::ToString()
- pop
- ret
- }
-}
-.class public GrandparentClass extends [mscorlib]System.Object
-{
- .method public instance void .ctor()
- {
- ldarg 0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
- .method public virtual void VirtualMethod()
- {
- ret
- }
-}
-
-.class public ParentClass extends GrandparentClass
-{
- .method public instance void .ctor()
- {
- ldarg 0
- call instance void GrandparentClass::.ctor()
- ret
- }
-
- .method public virtual void VirtualMethod()
- {
- ret
- }
-}
-
-
-// Helper Classes
-//
-.class sealed public TestDelegate extends [mscorlib]System.MulticastDelegate
-{
- .method public instance void .ctor(object, native int) runtime { }
- .method public instance void Invoke() runtime { }
-}
-
-.class sealed public ToStringDelegate extends [mscorlib]System.MulticastDelegate
-{
- .method public instance void .ctor(object, native int) runtime { }
- .method public instance string Invoke() runtime { }
-}
-
-.class public sealed auto TestValueType extends [mscorlib]System.ValueType
-{
- .field public int32 i
-
- .method public virtual void VirtualMethod()
- {
- ret
- }
-}
-.class public sealed SealedClass extends [mscorlib]System.Object
-{
- .method public instance void .ctor()
- {
- ldarg 0
- call instance void [mscorlib]System.Object::.ctor()
- ret
- }
-
- .method public virtual void VirtualMethod()
- {
- ret
- }
-}
-
-
-// =============================================================
-
-// *********** DISASSEMBLY COMPLETE ***********************
-// WARNING: Created Win32 resource file NonVirtualCall_Lib.res
diff --git a/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall_Lib.ilproj b/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall_Lib.ilproj
deleted file mode 100644
index 9e5ff2d25c..0000000000
--- a/tests/src/JIT/Methodical/flowgraph/bug619534/NonVirtualCall_Lib.ilproj
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages</ReferencePath>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- <RestorePackages>true</RestorePackages>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- <CLRTestKind>BuildOnly</CLRTestKind>
- <GenerateRunScript>false</GenerateRunScript>
- </PropertyGroup>
- <!-- Default configurations to help VS understand the configurations -->
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- </PropertyGroup>
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
- <PropertyGroup>
- <DebugType></DebugType>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="NonVirtualCall_Lib.il" />
- </ItemGroup>
- <ItemGroup>
- <None Include="$(JitPackagesConfigFileDirectory)minimal\project.json" />
- </ItemGroup>
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <PropertyGroup>
- <ProjectJson>$(JitPackagesConfigFileDirectory)minimal\project.json</ProjectJson>
- <ProjectLockJson>$(JitPackagesConfigFileDirectory)minimal\project.lock.json</ProjectLockJson>
- </PropertyGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
- </PropertyGroup>
-</Project>
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/OverwriteArray.il b/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/OverwriteArray.il
deleted file mode 100644
index 25273d53a3..0000000000
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/OverwriteArray.il
+++ /dev/null
@@ -1,70 +0,0 @@
-
-.assembly extern System.Console
-{
- .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
- .ver 4:0:0:0
-}
-.assembly extern mscorlib { }
-
-.assembly OverwriteArray
-{
- .custom instance void [mscorlib]System.Security.SecurityRulesAttribute::.ctor(valuetype [mscorlib]System.Security.SecurityRuleSet) = ( 01 00 02 00 00 ) .custom instance void [mscorlib]System.Security.SecurityTransparentAttribute::.ctor() = ( 01 00 00 00 )
-}
-
-.class public OverwriteArray extends [mscorlib]System.Object
-{
- .method public static int32 Main() cil managed
- {
- .entrypoint
- .maxstack 4
-
- .try
- {
- ldstr "Trying to stelem.i4 directly into an int32[0...]"
- call void [System.Console]System.Console::WriteLine(string)
-
- ldc.i4 2
- ldc.i4 3
- newobj instance void int32[...]::.ctor(int32, int32)
-
- ldc.i4 0
- ldc.i4 0xc8
- stelem.i4
- ldstr "Shouldn't be here..."
- call void [System.Console]System.Console::WriteLine(string)
- leave FAIL
- }
- catch [mscorlib]System.Security.VerificationException
- {
- ldstr "Got a verification exception"
- call void [System.Console]System.Console::WriteLine(string)
- leave PASS
- }
- catch [mscorlib]System.InvalidProgramException
- {
- ldstr "Got an invalid program exeption"
- call void [System.Console]System.Console::WriteLine(string)
- leave PASS
- }
- catch [mscorlib]System.Exception
- {
- callvirt instance string [mscorlib]System.Object::ToString()
- ldstr "Got an unknown exception"
- call void [System.Console]System.Console::WriteLine(string)
- call void [System.Console]System.Console::WriteLine(string)
- leave FAIL
- }
-
-PASS:
- ldc.i4 100
- ldstr "Pass"
- call void [System.Console]System.Console::WriteLine(string)
- ret
-
-FAIL:
- ldc.i4 101
- ldstr "FAIL"
- call void [System.Console]System.Console::WriteLine(string)
- ret
- }
-}
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/OverwriteArray.ilproj b/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/OverwriteArray.ilproj
deleted file mode 100644
index ac0d0cad87..0000000000
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/OverwriteArray.ilproj
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT .0\UITestExtensionPackages</ReferencePath>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- </PropertyGroup>
- <!-- Default configurations to help VS understand the configurations -->
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- </PropertyGroup>
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
- <PropertyGroup>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="OverwriteArray.il" />
- </ItemGroup>
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
- </PropertyGroup>
-</Project>
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/app.config b/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/app.config
deleted file mode 100644
index 6f7bbd9d2b..0000000000
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b309042/app.config
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/app.config b/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/app.config
deleted file mode 100644
index 6f7bbd9d2b..0000000000
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/app.config
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<configuration>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.20.0" newVersion="4.0.20.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Text.Encoding" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Reflection" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
-</configuration>
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/b431011.il b/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/b431011.il
deleted file mode 100644
index 4d96a01be4..0000000000
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/b431011.il
+++ /dev/null
@@ -1,107 +0,0 @@
-
-
-.module extern user32.dll
-
-.assembly extern System.Console
-{
- .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
- .ver 4:0:0:0
-}
-.assembly extern mscorlib
-{
- .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
- .ver 1:0:5000:0
-}
-.assembly LdfldEnum
-{
- .custom instance void [mscorlib]System.Security.SecurityRulesAttribute::.ctor(valuetype [mscorlib]System.Security.SecurityRuleSet) = ( 01 00 02 00 00 ) .custom instance void [mscorlib]System.Security.SecurityTransparentAttribute::.ctor() = ( 01 00 00 00 )
- .hash algorithm 0x00008004
- .ver 0:0:0:0
-}
-.module LdfldEnum.exe
-.imagebase 0x00400000
-.subsystem 0x00000003
-.file alignment 512
-.corflags 0x00000001
-.class public auto ansi sealed MyEnum
- extends [mscorlib]System.Enum
-{
-}
-
-.class public auto ansi beforefieldinit cs1
- extends [mscorlib]System.Object
-{
-}
-
-
-
-
-
-
-
-
-
-.class public auto ansi sealed MyEnum
- extends [mscorlib]System.Enum
-{
- .field public specialname rtspecialname int32 value__
-}
-
-.class public auto ansi beforefieldinit cs1
- extends [mscorlib]System.Object
-{
- .field private static literal int32 DEFAULT_PE_FILE_BASE_ADDRESS = int32(0x00400000)
- .method public hidebysig static pinvokeimpl("user32.dll" winapi)
- int32 MessageBox(native int hWnd,
- string lpText,
- string lpCaption,
- int32 uType) cil managed preservesig
- {
- }
- .method public hidebysig static int32 Main(string[] args) cil managed noinlining
- {
- .entrypoint
- .maxstack 1
- .locals init (valuetype MyEnum V_0)
- IL_0000: ldc.i4.0
- IL_0001: stloc.0
- IL_0002: ldc.i4 0x400000
- IL_0007: stloc.0
- IL_0008: ldloc.0
- ldfld int32 valuetype MyEnum::value__
- IL_0009: call void [System.Console]System.Console::WriteLine(int32)
-
- leave FAILURE
- CATCHVERIFICATION:
- leave SUCCESS
-
- FAILURE:
- ldstr "Test FAILURE"
- call void [System.Console]System.Console::WriteLine(string)
- ldc.i4 101
- ret
-
- SUCCESS:
- ldstr "Test SUCCESS"
- call void [System.Console]System.Console::WriteLine(string)
- ldc.i4 100
- ret
-
- .try IL_0000 to CATCHVERIFICATION
- catch [mscorlib]System.Security.VerificationException
- handler CATCHVERIFICATION to FAILURE
- }
-
- .method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
- {
- .maxstack 1
- IL_0000: ldarg.0
- IL_0001: call instance void [mscorlib]System.Object::.ctor()
- IL_0006: ret
- }
-
-}
-
-
-
diff --git a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/b431011.ilproj b/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/b431011.ilproj
deleted file mode 100644
index 9489cb1bb2..0000000000
--- a/tests/src/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b431011/b431011.ilproj
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <AssemblyName>$(MSBuildProjectName)</AssemblyName>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{95DFC527-4DC1-495E-97D7-E94EE1F7140D}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT .0\UITestExtensionPackages</ReferencePath>
- <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
- <NuGetPackageImportStamp>7a9bfb7d</NuGetPackageImportStamp>
- </PropertyGroup>
- <!-- Default configurations to help VS understand the configurations -->
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- </PropertyGroup>
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
- <PropertyGroup>
- </PropertyGroup>
- <ItemGroup>
- <Compile Include="b431011.il" />
- </ItemGroup>
- <ItemGroup>
- <None Include="app.config" />
- </ItemGroup>
- <ItemGroup>
- <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
- </ItemGroup>
- <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
- <PropertyGroup Condition=" '$(MsBuildProjectDirOverride)' != '' ">
- </PropertyGroup>
-</Project>