Expose a member of StrongNameKeyPair, fix bug in SynchronizationContext (dotnet/corec...
authorKoundinya Veluri <kouvel@microsoft.com>
Wed, 16 Nov 2016 20:55:53 +0000 (12:55 -0800)
committerGitHub <noreply@github.com>
Wed, 16 Nov 2016 20:55:53 +0000 (12:55 -0800)
Related to dotnet/corefxdotnet/coreclr#11636
Related to dotnet/corefxdotnet/coreclr#11808

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

src/coreclr/src/mscorlib/model.xml
src/coreclr/src/mscorlib/src/System/Reflection/StrongNameKeyPair.cs
src/coreclr/src/mscorlib/src/System/Threading/SynchronizationContext.cs
src/coreclr/src/vm/ecalllist.h

index c47940e..0ca6412 100644 (file)
     </Type>
     <Type Name="System.Reflection.StrongNameKeyPair">
       <Member Name="#ctor(System.Byte[])" />
-      <!--      <Member Name="#ctor(System.IO.FileStream)" /> -->
+      <Member Name="#ctor(System.IO.FileStream)" />
       <Member Name="#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
       <Member Name="#ctor(System.String)" />
       <Member Name="get_PublicKey" />
index f9fbb63..1a38faf 100644 (file)
@@ -39,7 +39,6 @@ namespace System.Reflection
         private String  _keyPairContainer;
         private byte[]  _publicKey;
 
-#if !FEATURE_CORECLR
         // Build key pair from file.
         [System.Security.SecuritySafeCritical]  // auto-generated
 #pragma warning disable 618
@@ -57,7 +56,6 @@ namespace System.Reflection
 
             _keyPairExported = true;
         }
-#endif// FEATURE_CORECLR
 
         // Build key pair from byte array in memory.
         [System.Security.SecuritySafeCritical]  // auto-generated
index 2f2dc36..a9422c1 100644 (file)
@@ -143,28 +143,39 @@ namespace System.Threading
         }
 
 #if FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
-        // Method called when the CLR does a wait operation 
+        // Method called when the CLR does a wait operation
         [System.Security.SecurityCritical]  // auto-generated_required
         [CLSCompliant(false)]
         [PrePrepareMethod]
         public virtual int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)
         {
+            return WaitHelper(waitHandles, waitAll, millisecondsTimeout);
+        }
+
+        // Method that can be called by Wait overrides
+        [System.Security.SecurityCritical]  // auto-generated_required
+        [CLSCompliant(false)]
+        [PrePrepareMethod]
+        [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
+        protected static int WaitHelper(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout)
+        {
             if (waitHandles == null)
             {
                 throw new ArgumentNullException(nameof(waitHandles));
             }
             Contract.EndContractBlock();
-            return WaitHelper(waitHandles, waitAll, millisecondsTimeout);
+
+            return WaitHelperNative(waitHandles, waitAll, millisecondsTimeout);
         }
-                                
-        // Static helper to which the above method can delegate to in order to get the default 
+
+        // Static helper to which the above method can delegate to in order to get the default
         // COM behavior.
         [System.Security.SecurityCritical]  // auto-generated_required
         [CLSCompliant(false)]
         [PrePrepareMethod]
-        [MethodImplAttribute(MethodImplOptions.InternalCall)]       
+        [MethodImplAttribute(MethodImplOptions.InternalCall)]
         [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
-        protected static extern int WaitHelper(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout);
+        private static extern int WaitHelperNative(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout);
 #endif
 
 #if FEATURE_CORECLR
index 331bfe6..d5063c4 100644 (file)
@@ -1860,7 +1860,7 @@ FCFuncEnd()
 
 FCFuncStart(gContextSynchronizationFuncs)
 #ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
-    FCFuncElement("WaitHelper", SynchronizationContextNative::WaitHelper)
+    FCFuncElement("WaitHelperNative", SynchronizationContextNative::WaitHelper)
 #endif // #ifdef FEATURE_SYNCHRONIZATIONCONTEXT_WAIT
 #ifdef FEATURE_APPX
     QCFuncElement("GetWinRTDispatcherForCurrentThread", SynchronizationContextNative::GetWinRTDispatcherForCurrentThread)