Revert earlier CAS changes to Eventing/** and put under !if !CORECLR (dotnet/coreclr...
authorDan Moseley <danmose@microsoft.com>
Fri, 10 Feb 2017 02:45:47 +0000 (18:45 -0800)
committerJan Kotas <jkotas@microsoft.com>
Fri, 10 Feb 2017 02:45:47 +0000 (18:45 -0800)
* Revert earlier CAS changes to Eventing/** and put under !if !CORECLR

Commit migrated from https://github.com/dotnet/coreclr/commit/ebac716ebbd34046916744f8d0d50829fbeb3104

src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/EventProvider.cs
src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs
src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/FrameworkEventSource.cs
src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/StubEnvironment.cs

index 1fc18a8..1da6a46 100644 (file)
@@ -8,6 +8,9 @@ using System.Diagnostics.CodeAnalysis;
 using System.Globalization;
 using System.Runtime.InteropServices;
 using System.Security;
+#if !CORECLR
+using System.Security.Permissions;
+#endif // !CORECLR
 using System.Threading;
 using System;
 
index ff1a210..a558a16 100644 (file)
@@ -187,6 +187,9 @@ using System.Globalization;
 using System.Reflection;
 using System.Resources;
 using System.Security;
+#if !CORECLR
+using System.Security.Permissions;
+#endif // !CORECLR
 
 using System.Text;
 using System.Threading;
index 3ace9c3..80c524b 100644 (file)
@@ -87,6 +87,9 @@ namespace System.Diagnostics.Tracing {
 
         // optimized for common signatures (used by the ThreadTransferSend/Receive events)
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
         private unsafe void WriteEvent(int eventId, long arg1, int arg2, string arg3, bool arg4)
         {
@@ -111,6 +114,9 @@ namespace System.Diagnostics.Tracing {
 
         // optimized for common signatures (used by the ThreadTransferSend/Receive events)
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
         private unsafe void WriteEvent(int eventId, long arg1, int arg2, string arg3)
         {
@@ -133,6 +139,9 @@ namespace System.Diagnostics.Tracing {
 
         // optimized for common signatures (used by the BeginGetResponse/BeginGetRequestStream events)
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
         private unsafe void WriteEvent(int eventId, long arg1, string arg2, bool arg3, bool arg4)
         {
@@ -157,6 +166,9 @@ namespace System.Diagnostics.Tracing {
 
         // optimized for common signatures (used by the EndGetRequestStream event)
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
         private unsafe void WriteEvent(int eventId, long arg1, bool arg2, bool arg3)
         {
@@ -175,6 +187,9 @@ namespace System.Diagnostics.Tracing {
 
         // optimized for common signatures (used by the EndGetResponse event)
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Concurrency", "CA8001", Justification = "This does not need to be correct when racing with other threads")]
         private unsafe void WriteEvent(int eventId, long arg1, bool arg2, bool arg3, int arg4)
         {
@@ -480,6 +495,9 @@ namespace System.Diagnostics.Tracing {
             WriteEvent(30, workID);
         }
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         public unsafe void ThreadPoolEnqueueWorkObject(object workID) {
             // convert the Object Id to a long
             ThreadPoolEnqueueWork((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref workID)));
@@ -491,6 +509,9 @@ namespace System.Diagnostics.Tracing {
         }
 
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         public unsafe void ThreadPoolDequeueWorkObject(object workID) {
             // convert the Object Id to a long
             ThreadPoolDequeueWork((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref workID)));
@@ -525,24 +546,36 @@ namespace System.Diagnostics.Tracing {
         }
 
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         public unsafe void BeginGetResponse(object id, string uri, bool success, bool synchronous) {
             if (IsEnabled())
                 GetResponseStart(IdForObject(id), uri, success, synchronous);
         }
             
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         public unsafe void EndGetResponse(object id, bool success, bool synchronous, int statusCode) {
             if (IsEnabled())
                 GetResponseStop(IdForObject(id), success, synchronous, statusCode);
         }
 
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         public unsafe void BeginGetRequestStream(object id, string uri, bool success, bool synchronous) {
             if (IsEnabled())
                 GetRequestStreamStart(IdForObject(id), uri, success, synchronous);
         }
 
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         public unsafe void EndGetRequestStream(object id, bool success, bool synchronous) {
             if (IsEnabled())
                 GetRequestStreamStop(IdForObject(id), success, synchronous);
@@ -564,6 +597,9 @@ namespace System.Diagnostics.Tracing {
         //      keep track of GC movements in order to correlate the value passed to XyzSend with the
         //      (possibly changed) value passed to XyzReceive
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         public unsafe void ThreadTransferSendObj(object id, int kind, string info, bool multiDequeues) {
             ThreadTransferSend((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref id)), kind, info, multiDequeues);
         }
@@ -584,6 +620,9 @@ namespace System.Diagnostics.Tracing {
         //      keep track of GC movements in order to correlate the value passed to XyzSend with the
         //      (possibly changed) value passed to XyzReceive
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         public unsafe void ThreadTransferReceiveObj(object id, int kind, string info) {
             ThreadTransferReceive((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref id)), kind, info);
         }
@@ -604,6 +643,9 @@ namespace System.Diagnostics.Tracing {
         //      keep track of GC movements in order to correlate the value passed to XyzSend with the
         //      (possibly changed) value passed to XyzReceive
         [NonEvent]
+#if !CORECLR
+        [System.Security.SecuritySafeCritical]
+#endif // !CORECLR
         public unsafe void ThreadTransferReceiveHandledObj(object id, int kind, string info) {
             ThreadTransferReceive((long) *((void**) JitHelpers.UnsafeCastToStackPointer(ref id)), kind, info);
         }
index c439973..e090c4f 100644 (file)
@@ -350,6 +350,7 @@ namespace System.Security
 }
 namespace System.Security.Permissions
 {
+    class HostProtectionAttribute : Attribute { public bool MayLeakOnAbort { get; set; } }
     class PermissionSetAttribute : Attribute
     { 
         public PermissionSetAttribute(System.Security.SecurityAction action) { }