summaryrefslogtreecommitdiff
path: root/src/vm/assembly.hpp
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-03-23 12:38:37 -0700
committerJan Kotas <jkotas@microsoft.com>2016-03-23 13:11:31 -0700
commite8a39ef3ee0501ff62d3fc8cdb8d063e7f0d149f (patch)
tree0e694fc322211aa6721ad605f4a34f637654e55c /src/vm/assembly.hpp
parent21cbca6a3165ac9f3e2a3c1753ac6ee023aa9443 (diff)
downloadcoreclr-e8a39ef3ee0501ff62d3fc8cdb8d063e7f0d149f.tar.gz
coreclr-e8a39ef3ee0501ff62d3fc8cdb8d063e7f0d149f.tar.bz2
coreclr-e8a39ef3ee0501ff62d3fc8cdb8d063e7f0d149f.zip
Remove special casing of platform assemblies
Diffstat (limited to 'src/vm/assembly.hpp')
-rw-r--r--src/vm/assembly.hpp114
1 files changed, 2 insertions, 112 deletions
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