From: Jan Kotas Date: Sun, 19 Nov 2017 06:41:39 +0000 (-0800) Subject: Delete unnecesary SuppressUnmanagedCodeSecurity annotations (#15102) X-Git-Tag: accepted/tizen/base/20180629.140029~535 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9affb49f79ed8319923c2f5b07b4aeeb04efe36;p=platform%2Fupstream%2Fcoreclr.git Delete unnecesary SuppressUnmanagedCodeSecurity annotations (#15102) --- diff --git a/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs b/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs index 1b2b695..17fa69e 100644 --- a/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs +++ b/src/mscorlib/src/Internal/Runtime/Augments/RuntimeThread.cs @@ -189,7 +189,6 @@ namespace Internal.Runtime.Augments public static void Sleep(int millisecondsTimeout) => Thread.Sleep(millisecondsTimeout); [DllImport(JitHelpers.QCall)] - [SuppressUnmanagedCodeSecurity] private static extern int GetOptimalMaxSpinWaitsPerSpinIterationInternal(); /// diff --git a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs index 64dbb2c..1338596 100644 --- a/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs +++ b/src/mscorlib/src/Microsoft/Win32/SafeHandles/SafeRegistryHandle.cs @@ -33,7 +33,6 @@ namespace Microsoft.Win32.SafeHandles } [DllImport(Win32Native.ADVAPI32)] - [SuppressUnmanagedCodeSecurity] internal static extern int RegCloseKey(IntPtr hKey); } } diff --git a/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs b/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs index f36bc18..6ce6263 100644 --- a/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs +++ b/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs @@ -11,7 +11,6 @@ namespace Microsoft.Win32 using System.Security; using System.Text; - [SuppressUnmanagedCodeSecurityAttribute()] internal static class UnsafeNativeMethods { [DllImport(Interop.Libraries.Kernel32, EntryPoint = "GetTimeZoneInformation", SetLastError = true, ExactSpelling = true)] @@ -45,7 +44,6 @@ namespace Microsoft.Win32 ref int fileMuiPathLength, ref Int64 enumerator); - [SuppressUnmanagedCodeSecurityAttribute()] internal static unsafe class ManifestEtw { // @@ -98,11 +96,9 @@ namespace Microsoft.Win32 ); // - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")] [DllImport(Win32Native.ADVAPI32, ExactSpelling = true, EntryPoint = "EventUnregister", CharSet = System.Runtime.InteropServices.CharSet.Unicode)] internal static extern uint EventUnregister([In] long registrationHandle); - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")] [DllImport(Win32Native.ADVAPI32, ExactSpelling = true, EntryPoint = "EventWriteString", CharSet = System.Runtime.InteropServices.CharSet.Unicode)] internal static extern unsafe int EventWriteString( [In] long registrationHandle, @@ -141,9 +137,7 @@ namespace Microsoft.Win32 return HResult; } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")] [DllImport(Win32Native.ADVAPI32, ExactSpelling = true, EntryPoint = "EventWriteTransfer", CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - [SuppressUnmanagedCodeSecurityAttribute] // Don't do security checks private static extern int EventWriteTransfer( [In] long registrationHandle, [In] ref EventDescriptor eventDescriptor, @@ -162,9 +156,7 @@ namespace Microsoft.Win32 EVENT_ACTIVITY_CTRL_CREATE_SET_ID = 5 }; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")] [DllImport(Win32Native.ADVAPI32, ExactSpelling = true, EntryPoint = "EventActivityIdControl", CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - [SuppressUnmanagedCodeSecurityAttribute] // Don't do security checks internal static extern int EventActivityIdControl([In] ActivityControl ControlCode, [In][Out] ref Guid ActivityId); internal enum EVENT_INFO_CLASS @@ -174,9 +166,7 @@ namespace Microsoft.Win32 SetTraits, } - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")] [DllImport(Win32Native.ADVAPI32, ExactSpelling = true, EntryPoint = "EventSetInformation", CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - [SuppressUnmanagedCodeSecurityAttribute] // Don't do security checks internal static extern int EventSetInformation( [In] long registrationHandle, [In] EVENT_INFO_CLASS informationClass, @@ -219,9 +209,7 @@ namespace Microsoft.Win32 public long MatchAllKeyword; }; - [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage")] [DllImport(Win32Native.ADVAPI32, ExactSpelling = true, EntryPoint = "EnumerateTraceGuidsEx", CharSet = System.Runtime.InteropServices.CharSet.Unicode)] - [SuppressUnmanagedCodeSecurityAttribute] // Don't do security checks internal static extern int EnumerateTraceGuidsEx( TRACE_QUERY_INFO_CLASS TraceQueryInfoClass, void* InBuffer, diff --git a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs index 4e47ecc..1c16c13 100644 --- a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs +++ b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs @@ -110,7 +110,6 @@ namespace Microsoft.Win32 // Remove the default demands for all P/Invoke methods with this // global declaration on the class. - [SuppressUnmanagedCodeSecurityAttribute()] internal static class Win32Native { internal const int KEY_QUERY_VALUE = 0x0001; diff --git a/src/mscorlib/src/System/AppDomain.cs b/src/mscorlib/src/System/AppDomain.cs index 5f7c720..302d623 100644 --- a/src/mscorlib/src/System/AppDomain.cs +++ b/src/mscorlib/src/System/AppDomain.cs @@ -163,7 +163,6 @@ namespace System #if FEATURE_APPX [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.I4)] private static extern APPX_FLAGS nGetAppXFlags(); #endif @@ -407,7 +406,6 @@ namespace System internal extern void nCreateContext(); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void nSetupBindingPaths(String trustedPlatformAssemblies, String platformResourceRoots, String appPath, String appNiPaths, String appLocalWinMD); internal void SetupBindingPaths(String trustedPlatformAssemblies, String platformResourceRoots, String appPath, String appNiPaths, String appLocalWinMD) @@ -624,7 +622,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void nSetNativeDllSearchDirectories(string paths); private void SetupFusionStore(AppDomainSetup info, AppDomainSetup oldInfo) diff --git a/src/mscorlib/src/System/AppDomainManager.cs b/src/mscorlib/src/System/AppDomainManager.cs index 830de29..f8ea51d 100644 --- a/src/mscorlib/src/System/AppDomainManager.cs +++ b/src/mscorlib/src/System/AppDomainManager.cs @@ -24,7 +24,7 @@ namespace System // By default, InitializeNewDomain does nothing. AppDomain.CreateAppDomainManager relies on this fact. } - [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] + [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] private static extern void GetEntryAssembly(ObjectHandleOnStack retAssembly); private Assembly m_entryAssembly = null; diff --git a/src/mscorlib/src/System/Buffer.cs b/src/mscorlib/src/System/Buffer.cs index b21ee71..4fef6f9 100644 --- a/src/mscorlib/src/System/Buffer.cs +++ b/src/mscorlib/src/System/Buffer.cs @@ -447,7 +447,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] extern private unsafe static void __Memmove(byte* dest, byte* src, nuint len); // The attributes on this method are chosen for best JIT performance. diff --git a/src/mscorlib/src/System/CLRConfig.cs b/src/mscorlib/src/System/CLRConfig.cs index 4c208cd..de7c9b0 100644 --- a/src/mscorlib/src/System/CLRConfig.cs +++ b/src/mscorlib/src/System/CLRConfig.cs @@ -21,7 +21,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static bool GetConfigBoolValue(string configSwitchName, out bool exist); } } // namespace System diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs b/src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs index d166bf8..539c60b 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/EventPipe.cs @@ -146,34 +146,27 @@ namespace System.Diagnostics.Tracing // These PInvokes are used by the configuration APIs to interact with EventPipe. // [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern void Enable(string outputFile, uint circularBufferSizeInMB, long profilerSamplingRateInNanoseconds, EventPipeProviderConfiguration[] providers, int numProviders); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern void Disable(); // // These PInvokes are used by EventSource to interact with the EventPipe. // [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern IntPtr CreateProvider(string providerName, UnsafeNativeMethods.ManifestEtw.EtwEnableCallback callbackFunc); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern unsafe IntPtr DefineEvent(IntPtr provHandle, uint eventID, Int64 keywords, uint eventVersion, uint level, void *pMetadata, uint metadataLength); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern void DeleteProvider(IntPtr provHandle); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern unsafe void WriteEvent(IntPtr eventHandle, uint eventID, void* pData, uint length, Guid* activityId, Guid* relatedActivityId); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern unsafe void WriteEventData(IntPtr eventHandle, uint eventID, EventProvider.EventData** pEventData, uint dataCount, Guid* activityId, Guid* relatedActivityId); } } diff --git a/src/mscorlib/src/System/Enum.cs b/src/mscorlib/src/System/Enum.cs index af6cc9c..eae46cf 100644 --- a/src/mscorlib/src/System/Enum.cs +++ b/src/mscorlib/src/System/Enum.cs @@ -275,7 +275,6 @@ namespace System internal static extern RuntimeType InternalGetUnderlyingType(RuntimeType enumType); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [System.Security.SuppressUnmanagedCodeSecurity] private static extern void GetEnumValuesAndNames(RuntimeTypeHandle enumType, ObjectHandleOnStack values, ObjectHandleOnStack names, bool getNames); [MethodImplAttribute(MethodImplOptions.InternalCall)] diff --git a/src/mscorlib/src/System/Environment.cs b/src/mscorlib/src/System/Environment.cs index f7e4e92..1594440 100644 --- a/src/mscorlib/src/System/Environment.cs +++ b/src/mscorlib/src/System/Environment.cs @@ -76,7 +76,6 @@ namespace System // Terminates this process with the given exit code. [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern void _Exit(int exitCode); public static void Exit(int exitCode) @@ -173,7 +172,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern Int32 GetProcessorCount(); public static int ProcessorCount @@ -328,7 +326,6 @@ namespace System internal static bool IsWinRTSupported => s_IsWinRTSupported.Value; [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] private static extern bool WinRTSupported(); #endif // FEATURE_COMINTEROP diff --git a/src/mscorlib/src/System/Exception.cs b/src/mscorlib/src/System/Exception.cs index 095b33a..3de41ca 100644 --- a/src/mscorlib/src/System/Exception.cs +++ b/src/mscorlib/src/System/Exception.cs @@ -753,7 +753,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetMessageFromNativeResources(ExceptionMessageKind kind, StringHandleOnStack retMesg); } diff --git a/src/mscorlib/src/System/GC.cs b/src/mscorlib/src/System/GC.cs index 46333bc..7119302 100644 --- a/src/mscorlib/src/System/GC.cs +++ b/src/mscorlib/src/System/GC.cs @@ -67,11 +67,9 @@ namespace System internal static extern int SetGCLatencyMode(int newLatencyMode); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern int _StartNoGCRegion(long totalSize, bool lohSizeKnown, long lohSize, bool disallowFullBlockingGC); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern int _EndNoGCRegion(); [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -84,11 +82,9 @@ namespace System private static extern int GetGenerationWR(IntPtr handle); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern long GetTotalMemory(); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void _Collect(int generation, int mode); [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -100,10 +96,10 @@ namespace System [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern bool IsServerGC(); - [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] + [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] private static extern void _AddMemoryPressure(UInt64 bytesAllocated); - [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] + [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] private static extern void _RemoveMemoryPressure(UInt64 bytesAllocated); public static void AddMemoryPressure(long bytesAllocated) @@ -273,7 +269,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void _WaitForPendingFinalizers(); public static void WaitForPendingFinalizers() diff --git a/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs b/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs index fb64e4f..cad9696 100644 --- a/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs +++ b/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs @@ -390,7 +390,6 @@ namespace System.Globalization } [DllImport(JitHelpers.QCall)] - [SuppressUnmanagedCodeSecurity] private static unsafe extern int InternalHashSortKey(byte* sortKey, int sortKeyLength); private static CompareOptions GetOrdinalCompareOptions(CompareOptions options) diff --git a/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs b/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs index ff0c240..4e56581 100644 --- a/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs +++ b/src/mscorlib/src/System/Globalization/CompareInfo.Windows.cs @@ -511,7 +511,6 @@ namespace System.Globalization #if CORECLR // Get a locale sensitive sort hash code from native code -- COMNlsInfo::InternalGetGlobalizedHashCode [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern int InternalGetGlobalizedHashCode(IntPtr handle, string localeName, string source, int length, int dwFlags); #endif } diff --git a/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs b/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs index bd35045..b839ddb 100644 --- a/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs +++ b/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs @@ -36,11 +36,9 @@ namespace System.IO } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetFileLoadExceptionMessage(int hResult, StringHandleOnStack retString); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetMessageForHR(int hresult, StringHandleOnStack retString); } } diff --git a/src/mscorlib/src/System/Reflection/Emit/AQNBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/AQNBuilder.cs index e7499e5..fa53c10 100644 --- a/src/mscorlib/src/System/Reflection/Emit/AQNBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/AQNBuilder.cs @@ -23,46 +23,32 @@ namespace System.Reflection.Emit #region QCalls [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern IntPtr CreateTypeNameBuilder(); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void ReleaseTypeNameBuilder(IntPtr pAQN); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void OpenGenericArguments(IntPtr tnb); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void CloseGenericArguments(IntPtr tnb); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void OpenGenericArgument(IntPtr tnb); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void CloseGenericArgument(IntPtr tnb); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void AddName(IntPtr tnb, string name); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void AddPointer(IntPtr tnb); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void AddByRef(IntPtr tnb); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void AddSzArray(IntPtr tnb); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void AddArray(IntPtr tnb, int rank); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void AddAssemblySpec(IntPtr tnb, string assemblySpec); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void ToString(IntPtr tnb, StringHandleOnStack retString); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void Clear(IntPtr tnb); #endregion diff --git a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs index c7e6e59..9662105 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs @@ -148,11 +148,9 @@ namespace System.Reflection.Emit [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static int GetTypeRef(RuntimeModule module, String strFullName, RuntimeModule refedModule, String strRefedModuleFileName, int tkResolution); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static int GetMemberRef(RuntimeModule module, RuntimeModule refedModule, int tr, int defToken); private int GetMemberRef(Module refedModule, int tr, int defToken) @@ -161,7 +159,6 @@ namespace System.Reflection.Emit } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static int GetMemberRefFromSignature(RuntimeModule module, int tr, String methodName, byte[] signature, int length); private int GetMemberRefFromSignature(int tr, String methodName, byte[] signature, int length) @@ -170,7 +167,6 @@ namespace System.Reflection.Emit } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static int GetMemberRefOfMethodInfo(RuntimeModule module, int tr, IRuntimeMethodInfo method); private int GetMemberRefOfMethodInfo(int tr, RuntimeMethodInfo method) @@ -188,7 +184,6 @@ namespace System.Reflection.Emit } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static int GetMemberRefOfFieldInfo(RuntimeModule module, int tkType, RuntimeTypeHandle declaringType, int tkField); private int GetMemberRefOfFieldInfo(int tkType, RuntimeTypeHandle declaringType, RuntimeFieldInfo runtimeField) @@ -199,7 +194,6 @@ namespace System.Reflection.Emit } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static int GetTokenFromTypeSpec(RuntimeModule pModule, byte[] signature, int length); private int GetTokenFromTypeSpec(byte[] signature, int length) @@ -208,15 +202,12 @@ namespace System.Reflection.Emit } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static int GetArrayMethodToken(RuntimeModule module, int tkTypeSpec, String methodName, byte[] signature, int sigLength); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static int GetStringConstant(RuntimeModule module, String str, int length); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal extern static void SetFieldRVAContent(RuntimeModule module, int fdToken, byte[] data, int length); #endregion diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs index c07f9e7..ef971a5 100644 --- a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs @@ -163,31 +163,25 @@ namespace System.Reflection.Emit #region Private Static FCalls [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void SetParentType(RuntimeModule module, int tdTypeDef, int tkParent); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void AddInterfaceImpl(RuntimeModule module, int tdTypeDef, int tkInterface); #endregion #region Internal Static FCalls [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern int DefineMethod(RuntimeModule module, int tkParent, String name, byte[] signature, int sigLength, MethodAttributes attributes); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern int DefineMethodSpec(RuntimeModule module, int tkParent, byte[] signature, int sigLength); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern int DefineField(RuntimeModule module, int tkParent, String name, byte[] signature, int sigLength, FieldAttributes attributes); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void SetMethodIL(RuntimeModule module, int tk, bool isInitLocals, byte[] body, int bodyLength, byte[] LocalSig, int sigLength, @@ -196,7 +190,6 @@ namespace System.Reflection.Emit int[] tokenFixups, int numTokenFixups); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void DefineCustomAttribute(RuntimeModule module, int tkAssociate, int tkConstructor, byte[] attr, int attrLength, bool toDisk, bool updateCompilerFlags); @@ -216,46 +209,36 @@ namespace System.Reflection.Emit } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern int DefineProperty(RuntimeModule module, int tkParent, String name, PropertyAttributes attributes, byte[] signature, int sigLength); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern int DefineEvent(RuntimeModule module, int tkParent, String name, EventAttributes attributes, int tkEventType); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern void DefineMethodSemantics(RuntimeModule module, int tkAssociation, MethodSemanticsAttributes semantics, int tkMethod); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern void DefineMethodImpl(RuntimeModule module, int tkType, int tkBody, int tkDecl); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern void SetMethodImpl(RuntimeModule module, int tkMethod, MethodImplAttributes MethodImplAttributes); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern int SetParamInfo(RuntimeModule module, int tkMethod, int iSequence, ParameterAttributes iParamAttributes, String strParamName); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern int GetTokenFromSig(RuntimeModule module, byte[] signature, int sigLength); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern void SetFieldLayoutOffset(RuntimeModule module, int fdToken, int iOffset); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern void SetClassLayout(RuntimeModule module, int tk, PackingSize iPackingSize, int iTypeSize); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern unsafe void SetConstantValue(RuntimeModule module, int tk, int corType, void* pValue); #endregion @@ -694,17 +677,14 @@ namespace System.Reflection.Emit #region FCalls [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static int DefineType(RuntimeModule module, String fullname, int tkParent, TypeAttributes attributes, int tkEnclosingType, int[] interfaceTokens); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static int DefineGenericParam(RuntimeModule module, String name, int tkParent, GenericParameterAttributes attributes, int position, int[] constraints); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void TermCreateClass(RuntimeModule module, int tk, ObjectHandleOnStack type); #endregion diff --git a/src/mscorlib/src/System/Reflection/LoaderAllocator.cs b/src/mscorlib/src/System/Reflection/LoaderAllocator.cs index 035f158..7a34a15 100644 --- a/src/mscorlib/src/System/Reflection/LoaderAllocator.cs +++ b/src/mscorlib/src/System/Reflection/LoaderAllocator.cs @@ -33,7 +33,6 @@ namespace System.Reflection // This field is set by the VM to atomically transfer the ownership to the managed loader allocator internal IntPtr m_nativeLoaderAllocator; - [SuppressUnmanagedCodeSecurity] [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] private static extern bool Destroy(IntPtr nativeLoaderAllocator); diff --git a/src/mscorlib/src/System/Reflection/Metadata/AssemblyExtensions.cs b/src/mscorlib/src/System/Reflection/Metadata/AssemblyExtensions.cs index 388e4f4..2397518 100644 --- a/src/mscorlib/src/System/Reflection/Metadata/AssemblyExtensions.cs +++ b/src/mscorlib/src/System/Reflection/Metadata/AssemblyExtensions.cs @@ -11,7 +11,6 @@ namespace System.Reflection.Metadata public static class AssemblyExtensions { [DllImport(JitHelpers.QCall)] - [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] private unsafe static extern bool InternalTryGetRawMetadata(RuntimeAssembly assembly, ref byte* blob, ref int length); diff --git a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs index 138955b..4c574e5 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs @@ -56,7 +56,6 @@ namespace System.Reflection private const String s_localFilePrefix = "file:"; [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetCodeBase(RuntimeAssembly assembly, bool copiedName, StringHandleOnStack retString); @@ -118,7 +117,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetFullName(RuntimeAssembly assembly, StringHandleOnStack retString); public override String FullName @@ -138,7 +136,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetEntryPoint(RuntimeAssembly assembly, ObjectHandleOnStack retMethod); public override MethodInfo EntryPoint @@ -156,7 +153,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetType(RuntimeAssembly assembly, String name, bool throwOnError, @@ -179,7 +175,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes); public override Type[] GetExportedTypes() @@ -380,7 +375,6 @@ namespace System.Reflection // Returns the module in this assembly with name 'name' [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetModule(RuntimeAssembly assembly, String name, ObjectHandleOnStack retModule); public override Module GetModule(String name) @@ -429,7 +423,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetExecutingAssembly(StackCrawlMarkHandle stackMark, ObjectHandleOnStack retAssembly); internal static RuntimeAssembly GetExecutingAssembly(ref StackCrawlMark stackMark) @@ -449,7 +442,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern int GetManifestResourceInfo(RuntimeAssembly assembly, String resourceName, ObjectHandleOnStack assemblyRef, @@ -475,7 +467,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetLocation(RuntimeAssembly assembly, StringHandleOnStack retString); public override String Location @@ -491,7 +482,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetImageRuntimeVersion(RuntimeAssembly assembly, StringHandleOnStack retString); public override String ImageRuntimeVersion @@ -579,7 +569,6 @@ namespace System.Reflection // GetResource will return a pointer to the resources in memory. [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static unsafe extern byte* GetResource(RuntimeAssembly assembly, String resourceName, out ulong length, @@ -605,7 +594,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetVersion(RuntimeAssembly assembly, out int majVer, out int minVer, @@ -620,7 +608,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetLocale(RuntimeAssembly assembly, StringHandleOnStack retString); internal CultureInfo GetLocale() @@ -647,7 +634,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetSimpleName(RuntimeAssembly assembly, StringHandleOnStack retSimpleName); internal String GetSimpleName() @@ -658,7 +644,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static AssemblyHashAlgorithm GetHashAlgorithm(RuntimeAssembly assembly); private AssemblyHashAlgorithm GetHashAlgorithm() @@ -667,7 +652,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static AssemblyNameFlags GetFlags(RuntimeAssembly assembly); private AssemblyNameFlags GetFlags() @@ -676,7 +660,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetPublicKey(RuntimeAssembly assembly, ObjectHandleOnStack retPublicKey); internal byte[] GetPublicKey() @@ -766,7 +749,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetModules(RuntimeAssembly assembly, bool loadIfNotFound, bool getResourceModules, @@ -866,7 +848,6 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetForwardedType(RuntimeAssembly assembly, MetadataToken mdtExternalType, ObjectHandleOnStack type); } } diff --git a/src/mscorlib/src/System/Reflection/RuntimeModule.cs b/src/mscorlib/src/System/Reflection/RuntimeModule.cs index 2ddbb27..2f8d195 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeModule.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeModule.cs @@ -17,19 +17,15 @@ namespace System.Reflection #region FCalls [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetType(RuntimeModule module, String className, bool throwOnError, bool ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive); [DllImport(JitHelpers.QCall)] - [SuppressUnmanagedCodeSecurity] private static extern bool nIsTransientInternal(RuntimeModule module); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetScopeName(RuntimeModule module, StringHandleOnStack retString); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetFullyQualifiedName(RuntimeModule module, StringHandleOnStack retString); [MethodImplAttribute(MethodImplOptions.InternalCall)] diff --git a/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs b/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs index 83d5b6c..0986616 100644 --- a/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs +++ b/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs @@ -521,7 +521,6 @@ namespace System.Resources } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [System.Security.SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] internal static extern bool GetNeutralResourcesLanguageAttribute(RuntimeAssembly assemblyHandle, StringHandleOnStack cultureName, out short fallbackLocation); } diff --git a/src/mscorlib/src/System/RtType.cs b/src/mscorlib/src/System/RtType.cs index 141cb16..eff9291 100644 --- a/src/mscorlib/src/System/RtType.cs +++ b/src/mscorlib/src/System/RtType.cs @@ -4930,11 +4930,9 @@ namespace System private static extern unsafe bool EqualsCaseSensitive(void* szLhs, void* szRhs, int cSz); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern unsafe bool EqualsCaseInsensitive(void* szLhs, void* szRhs, int cSz); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern unsafe uint HashCaseInsensitive(void* sz, int cSz); private static int GetUtf8StringByteLength(void* pUtf8String) diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs index b46c598..b340e4a 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs @@ -83,7 +83,7 @@ namespace System.Runtime.CompilerServices } - [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] + [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] internal static extern void _CompileMethod(IRuntimeMethodInfo method); public static void PrepareMethod(RuntimeMethodHandle method) { } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/CriticalHandle.cs b/src/mscorlib/src/System/Runtime/InteropServices/CriticalHandle.cs index 2bce2ec..342c153 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/CriticalHandle.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/CriticalHandle.cs @@ -73,10 +73,6 @@ using System.IO; should be decorated with a reliability contract of the appropriate level. In most cases this should be: ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success) - Also, any P/Invoke methods should use the - SuppressUnmanagedCodeSecurity attribute to avoid a runtime security - check that can also inject failures (even if the check is guaranteed - to pass). Subclasses must also implement the IsInvalid property so that the infrastructure can tell when critical finalization is actually required. diff --git a/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs b/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs index 39624c1..efa5125 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs @@ -875,7 +875,7 @@ namespace System.Runtime.InteropServices InternalPrelink(rmi); } - [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] + [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] private static extern void InternalPrelink(IRuntimeMethodInfo m); public static void PrelinkAll(Type c) @@ -999,8 +999,7 @@ namespace System.Runtime.InteropServices return GetHINSTANCE(rtModule.GetNativeHandle()); } - [SuppressUnmanagedCodeSecurity] - [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode), SuppressUnmanagedCodeSecurity] + [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] private extern static IntPtr GetHINSTANCE(RuntimeModule m); #endif // FEATURE_COMINTEROP @@ -1735,15 +1734,12 @@ namespace System.Runtime.InteropServices } [DllImport(Interop.Libraries.Ole32, PreserveSig = false)] - [SuppressUnmanagedCodeSecurity] private static extern void CreateBindCtx(UInt32 reserved, out IBindCtx ppbc); [DllImport(Interop.Libraries.Ole32, PreserveSig = false)] - [SuppressUnmanagedCodeSecurity] private static extern void MkParseDisplayName(IBindCtx pbc, [MarshalAs(UnmanagedType.LPWStr)] String szUserName, out UInt32 pchEaten, out IMoniker ppmk); [DllImport(Interop.Libraries.Ole32, PreserveSig = false)] - [SuppressUnmanagedCodeSecurity] private static extern void BindMoniker(IMoniker pmk, UInt32 grfOpt, ref Guid iidResult, [MarshalAs(UnmanagedType.Interface)] out Object ppvResult); //======================================================================== diff --git a/src/mscorlib/src/System/Runtime/InteropServices/NativeMethods.cs b/src/mscorlib/src/System/Runtime/InteropServices/NativeMethods.cs index ddd15c2..ccc8d20 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/NativeMethods.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/NativeMethods.cs @@ -17,7 +17,6 @@ namespace System.Runtime.InteropServices internal static class NativeMethods { [ - System.Security.SuppressUnmanagedCodeSecurity, ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("00020400-0000-0000-C000-000000000046") diff --git a/src/mscorlib/src/System/Runtime/InteropServices/SafeHandle.cs b/src/mscorlib/src/System/Runtime/InteropServices/SafeHandle.cs index 7970324..a8bfbdc 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/SafeHandle.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/SafeHandle.cs @@ -47,9 +47,6 @@ namespace System.Runtime.InteropServices decorated with a reliability contract of the appropriate level. In most cases this should be: ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success) - Also, any P/Invoke methods should use the SuppressUnmanagedCodeSecurity - attribute to avoid a runtime security check that can also inject failures - (even if the check is guaranteed to pass). The GC will run ReleaseHandle methods after any normal finalizers have been run for objects that were collected at the same time. This ensures classes @@ -111,7 +108,6 @@ namespace System.Runtime.InteropServices class's default constructor. Also, you probably want to define CloseHandle somewhere, and remember to apply a reliability contract to it. - [SuppressUnmanagedCodeSecurity] internal static class MyNativeMethods { [DllImport("kernel32")] private static extern MySafeHandleSubclass CreateHandle(int someState); diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/NativeMethods.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/NativeMethods.cs index ccae412..94e4351 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/NativeMethods.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/NativeMethods.cs @@ -22,37 +22,30 @@ namespace System.Runtime.InteropServices.WindowsRuntime internal static class UnsafeNativeMethods { [DllImport("api-ms-win-core-winrt-error-l1-1-0.dll", PreserveSig = false)] - [SuppressUnmanagedCodeSecurity] internal static extern IRestrictedErrorInfo GetRestrictedErrorInfo(); [DllImport("api-ms-win-core-winrt-error-l1-1-1.dll")] - [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] internal static extern bool RoOriginateLanguageException(int error, [MarshalAs(UnmanagedType.HString)]string message, IntPtr languageException); [DllImport("api-ms-win-core-winrt-error-l1-1-1.dll", PreserveSig = false)] - [SuppressUnmanagedCodeSecurity] internal static extern void RoReportUnhandledError(IRestrictedErrorInfo error); [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = CallingConvention.StdCall)] - [SuppressUnmanagedCodeSecurity] internal static unsafe extern int WindowsCreateString([MarshalAs(UnmanagedType.LPWStr)] string sourceString, int length, [Out] IntPtr* hstring); [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = CallingConvention.StdCall)] - [SuppressUnmanagedCodeSecurity] internal static unsafe extern int WindowsCreateStringReference(char* sourceString, int length, [Out] HSTRING_HEADER* hstringHeader, [Out] IntPtr* hstring); [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = CallingConvention.StdCall)] - [SuppressUnmanagedCodeSecurity] internal static extern int WindowsDeleteString(IntPtr hstring); [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = CallingConvention.StdCall)] - [SuppressUnmanagedCodeSecurity] internal static unsafe extern char* WindowsGetStringRawBuffer(IntPtr hstring, [Out] uint* length); } } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeBufferHelper.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeBufferHelper.cs index 55c356d..f871d94 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeBufferHelper.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeBufferHelper.cs @@ -19,7 +19,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime internal static class WindowsRuntimeBufferHelper { [DllImport(JitHelpers.QCall)] - [SuppressUnmanagedCodeSecurity] private unsafe extern static void StoreOverlappedPtrInCCW(ObjectHandleOnStack windowsRuntimeBuffer, NativeOverlapped* overlapped); diff --git a/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs b/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs index 0481581..4a81364 100644 --- a/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs +++ b/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs @@ -18,23 +18,18 @@ namespace System.Runtime.Loader public abstract class AssemblyLoadContext { [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern bool CanUseAppPathAssemblyLoadContextInCurrentDomain(); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern IntPtr InitializeAssemblyLoadContext(IntPtr ptrAssemblyLoadContext, bool fRepresentsTPALoadContext); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern IntPtr LoadFromStream(IntPtr ptrNativeAssemblyLoadContext, IntPtr ptrAssemblyArray, int iAssemblyArrayLen, IntPtr ptrSymbols, int iSymbolArrayLen, ObjectHandleOnStack retAssembly); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern void InternalSetProfileRoot(string directoryPath); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern void InternalStartProfile(string profile, IntPtr ptrNativeAssemblyLoadContext); protected AssemblyLoadContext() @@ -67,7 +62,6 @@ namespace System.Runtime.Loader } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, string ilPath, string niPath, ObjectHandleOnStack retAssembly); public static Assembly[] GetLoadedAssemblies() @@ -277,7 +271,6 @@ namespace System.Runtime.Loader } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern IntPtr InternalLoadUnmanagedDllFromPath(string unmanagedDllPath); // This method provides a way for overriders of LoadUnmanagedDll() to load an unmanaged DLL from a specific path in a @@ -353,7 +346,6 @@ namespace System.Runtime.Loader } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern IntPtr GetLoadContextForAssembly(RuntimeAssembly assembly); // Returns the load context in which the specified assembly has been loaded diff --git a/src/mscorlib/src/System/RuntimeHandles.cs b/src/mscorlib/src/System/RuntimeHandles.cs index 428155a..eda28c6 100644 --- a/src/mscorlib/src/System/RuntimeHandles.cs +++ b/src/mscorlib/src/System/RuntimeHandles.cs @@ -329,7 +329,6 @@ namespace System internal extern static Type[] GetInterfaces(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetConstraints(RuntimeTypeHandle handle, ObjectHandleOnStack types); internal Type[] GetConstraints() @@ -341,7 +340,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static IntPtr GetGCHandle(RuntimeTypeHandle handle, GCHandleType type); internal IntPtr GetGCHandle(GCHandleType type) @@ -353,7 +351,6 @@ namespace System internal extern static int GetNumVirtuals(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void VerifyInterfaceIsImplemented(RuntimeTypeHandle handle, RuntimeTypeHandle interfaceHandle); internal void VerifyInterfaceIsImplemented(RuntimeTypeHandle interfaceHandle) @@ -362,7 +359,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static int GetInterfaceMethodImplementationSlot(RuntimeTypeHandle handle, RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle); internal int GetInterfaceMethodImplementationSlot(RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle) @@ -380,7 +376,6 @@ namespace System internal extern static bool IsByRefLike(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] private extern static bool _IsVisible(RuntimeTypeHandle typeHandle); @@ -393,7 +388,6 @@ namespace System internal extern static bool IsValueType(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void ConstructName(RuntimeTypeHandle handle, TypeNameFormatFlags formatFlags, StringHandleOnStack retString); internal string ConstructName(TypeNameFormatFlags formatFlags) @@ -421,7 +415,6 @@ namespace System internal extern static IRuntimeMethodInfo GetDeclaringMethod(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetDefaultConstructor(RuntimeTypeHandle handle, ObjectHandleOnStack method); internal IRuntimeMethodInfo GetDefaultConstructor() @@ -432,7 +425,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, bool loadTypeFromPartialName, ObjectHandleOnStack type, ObjectHandleOnStack keepalive); @@ -468,7 +460,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetTypeByNameUsingCARules(string name, RuntimeModule scope, ObjectHandleOnStack type); internal static RuntimeType GetTypeByNameUsingCARules(string name, RuntimeModule scope) @@ -483,7 +474,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal extern static void GetInstantiation(RuntimeTypeHandle type, ObjectHandleOnStack types, bool fAsRuntimeTypeArray); internal RuntimeType[] GetInstantiationInternal() @@ -501,7 +491,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void Instantiate(RuntimeTypeHandle handle, IntPtr* pInst, int numGenericArgs, ObjectHandleOnStack type); internal RuntimeType Instantiate(Type[] inst) @@ -520,7 +509,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void MakeArray(RuntimeTypeHandle handle, int rank, ObjectHandleOnStack type); internal RuntimeType MakeArray(int rank) @@ -531,7 +519,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void MakeSZArray(RuntimeTypeHandle handle, ObjectHandleOnStack type); internal RuntimeType MakeSZArray() @@ -542,7 +529,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void MakeByRef(RuntimeTypeHandle handle, ObjectHandleOnStack type); internal RuntimeType MakeByRef() @@ -553,7 +539,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void MakePointer(RuntimeTypeHandle handle, ObjectHandleOnStack type); internal RuntimeType MakePointer() @@ -564,14 +549,12 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal extern static bool IsCollectible(RuntimeTypeHandle handle); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal extern static bool HasInstantiation(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetGenericTypeDefinition(RuntimeTypeHandle type, ObjectHandleOnStack retType); internal static RuntimeType GetGenericTypeDefinition(RuntimeType type) @@ -810,7 +793,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal extern static IntPtr GetFunctionPointer(RuntimeMethodHandleInternal handle); public IntPtr GetFunctionPointer() @@ -821,7 +803,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal extern static bool IsCAVisibleFromDecoratedType( RuntimeTypeHandle attrTypeHandle, IRuntimeMethodInfo attrCtor, @@ -849,7 +830,6 @@ namespace System internal static extern MethodImplAttributes GetImplAttributes(IRuntimeMethodInfo method); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void ConstructInstantiation(IRuntimeMethodInfo method, TypeNameFormatFlags format, StringHandleOnStack retString); internal static string ConstructInstantiation(IRuntimeMethodInfo method, TypeNameFormatFlags format) @@ -922,7 +902,6 @@ namespace System #endregion [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack types, bool fAsRuntimeTypeArray); internal static RuntimeType[] GetMethodInstantiationInternal(IRuntimeMethodInfo method) @@ -978,7 +957,6 @@ namespace System internal extern static bool IsTypicalMethodDefinition(IRuntimeMethodInfo method); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetTypicalMethodDefinition(IRuntimeMethodInfo method, ObjectHandleOnStack outMethod); internal static IRuntimeMethodInfo GetTypicalMethodDefinition(IRuntimeMethodInfo method) @@ -995,7 +973,6 @@ namespace System internal static int GetGenericParameterCount(IRuntimeMethodInfo method) => GetGenericParameterCount(method.Value); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void StripMethodInstantiation(IRuntimeMethodInfo method, ObjectHandleOnStack outMethod); internal static IRuntimeMethodInfo StripMethodInstantiation(IRuntimeMethodInfo method) @@ -1011,7 +988,6 @@ namespace System internal extern static bool IsDynamicMethod(RuntimeMethodHandleInternal method); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal extern static void Destroy(RuntimeMethodHandleInternal method); [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -1314,7 +1290,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void ResolveType(RuntimeModule module, int typeToken, IntPtr* typeInstArgs, @@ -1360,7 +1335,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static RuntimeMethodHandleInternal ResolveMethod(RuntimeModule module, int methodToken, IntPtr* typeInstArgs, @@ -1397,7 +1371,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void ResolveField(RuntimeModule module, int fieldToken, IntPtr* typeInstArgs, @@ -1407,7 +1380,6 @@ namespace System ObjectHandleOnStack retField); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static bool _ContainsPropertyMatchingHash(RuntimeModule module, int propertyToken, uint hash); internal static bool ContainsPropertyMatchingHash(RuntimeModule module, int propertyToken, uint hash) @@ -1416,7 +1388,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal extern static void GetModuleType(RuntimeModule handle, ObjectHandleOnStack type); internal static RuntimeType GetModuleType(RuntimeModule module) @@ -1427,7 +1398,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private extern static void GetPEKind(RuntimeModule handle, out int peKind, out int machine); // making this internal, used by Module.GetPEKind diff --git a/src/mscorlib/src/System/StubHelpers.cs b/src/mscorlib/src/System/StubHelpers.cs index 8bdcb76..2c7bc04 100644 --- a/src/mscorlib/src/System/StubHelpers.cs +++ b/src/mscorlib/src/System/StubHelpers.cs @@ -633,7 +633,7 @@ namespace System.StubHelpers [MethodImplAttribute(MethodImplOptions.InternalCall)] static internal extern object ConvertToManaged(IntPtr pUnk, IntPtr itfMT, IntPtr classMT, int flags); - [DllImport(JitHelpers.QCall), SuppressUnmanagedCodeSecurity] + [DllImport(JitHelpers.QCall)] static internal extern void ClearNative(IntPtr pUnk); [FriendAccessAllowed] @@ -689,10 +689,10 @@ namespace System.StubHelpers } [FriendAccessAllowed] - [DllImport(JitHelpers.QCall), SuppressUnmanagedCodeSecurity] + [DllImport(JitHelpers.QCall)] static extern internal IntPtr CreateNativePCEventArgsInstance([MarshalAs(UnmanagedType.HString)]string name); - [DllImport(JitHelpers.QCall), SuppressUnmanagedCodeSecurity] + [DllImport(JitHelpers.QCall)] static extern internal IntPtr CreateNativeNCCEventArgsInstanceHelper(int action, IntPtr newItem, IntPtr oldItem, int newIndex, int oldIndex); } #endif // FEATURE_COMINTEROP @@ -1547,7 +1547,6 @@ namespace System.StubHelpers } } // class CleanupWorkList - [SuppressUnmanagedCodeSecurityAttribute()] internal static class StubHelpers { [MethodImplAttribute(MethodImplOptions.InternalCall)] diff --git a/src/mscorlib/src/System/Threading/Interlocked.cs b/src/mscorlib/src/System/Threading/Interlocked.cs index 7e2c2ae..0a7968e 100644 --- a/src/mscorlib/src/System/Threading/Interlocked.cs +++ b/src/mscorlib/src/System/Threading/Interlocked.cs @@ -194,7 +194,6 @@ namespace System.Threading public static extern void MemoryBarrier(); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void _MemoryBarrierProcessWide(); public static void MemoryBarrierProcessWide() diff --git a/src/mscorlib/src/System/Threading/SynchronizationContext.cs b/src/mscorlib/src/System/Threading/SynchronizationContext.cs index be4bff7..f4ca1ae 100644 --- a/src/mscorlib/src/System/Threading/SynchronizationContext.cs +++ b/src/mscorlib/src/System/Threading/SynchronizationContext.cs @@ -224,7 +224,6 @@ namespace System.Threading } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Interface)] private static extern object GetWinRTDispatcherForCurrentThread(); #endif //FEATURE_APPX diff --git a/src/mscorlib/src/System/Threading/Thread.cs b/src/mscorlib/src/System/Threading/Thread.cs index 22984d9..a57b10f 100644 --- a/src/mscorlib/src/System/Threading/Thread.cs +++ b/src/mscorlib/src/System/Threading/Thread.cs @@ -337,7 +337,6 @@ namespace System.Threading } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern bool YieldInternal(); internal static new bool Yield() @@ -482,7 +481,6 @@ namespace System.Threading } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void nativeInitCultureAccessors(); /*====================================================================== @@ -537,7 +535,6 @@ namespace System.Threading } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void InformThreadNameChange(ThreadHandle t, String name, int len); } // End of class Thread diff --git a/src/mscorlib/src/System/Threading/ThreadPool.cs b/src/mscorlib/src/System/Threading/ThreadPool.cs index 40cb7ea..1b59163 100644 --- a/src/mscorlib/src/System/Threading/ThreadPool.cs +++ b/src/mscorlib/src/System/Threading/ThreadPool.cs @@ -1401,7 +1401,6 @@ namespace System.Threading ToObjectArray(GetLocallyQueuedWorkItems()); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] internal static extern bool RequestWorkerThread(); [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -1463,7 +1462,6 @@ namespace System.Threading internal static extern void NotifyWorkItemProgressNative(); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void InitializeVMTp(ref bool enableWorkerTracking); [MethodImplAttribute(MethodImplOptions.InternalCall)] diff --git a/src/mscorlib/src/System/Threading/Timer.cs b/src/mscorlib/src/System/Threading/Timer.cs index 84839e7..991f53f 100644 --- a/src/mscorlib/src/System/Threading/Timer.cs +++ b/src/mscorlib/src/System/Threading/Timer.cs @@ -200,15 +200,12 @@ namespace System.Threading } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern AppDomainTimerSafeHandle CreateAppDomainTimer(uint dueTime, int id); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern bool ChangeAppDomainTimer(AppDomainTimerSafeHandle handle, uint dueTime); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern bool DeleteAppDomainTimer(IntPtr handle); #endregion diff --git a/src/mscorlib/src/System/TypeLoadException.cs b/src/mscorlib/src/System/TypeLoadException.cs index e00d174..4f31747 100644 --- a/src/mscorlib/src/System/TypeLoadException.cs +++ b/src/mscorlib/src/System/TypeLoadException.cs @@ -113,7 +113,6 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void GetTypeLoadExceptionMessage(int resourceId, StringHandleOnStack retString); public override void GetObjectData(SerializationInfo info, StreamingContext context) diff --git a/src/mscorlib/src/System/TypeNameParser.cs b/src/mscorlib/src/System/TypeNameParser.cs index 9bd772e..2fe7cec 100644 --- a/src/mscorlib/src/System/TypeNameParser.cs +++ b/src/mscorlib/src/System/TypeNameParser.cs @@ -20,7 +20,6 @@ namespace System { #region QCalls [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void _ReleaseTypeNameParser(IntPtr pTypeNameParser); #endregion @@ -41,23 +40,18 @@ namespace System { #region QCalls [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void _CreateTypeNameParser(string typeName, ObjectHandleOnStack retHandle, bool throwOnError); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void _GetNames(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void _GetTypeArguments(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void _GetModifiers(SafeTypeNameParserHandle pTypeNameParser, ObjectHandleOnStack retArray); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - [SuppressUnmanagedCodeSecurity] private static extern void _GetAssemblyName(SafeTypeNameParserHandle pTypeNameParser, StringHandleOnStack retString); #endregion