Move CryptMsgClose to Common Interop from Pkcs and X509
authorAdam Gauthier <adamgauthier12@gmail.com>
Sat, 28 Jul 2018 23:34:05 +0000 (19:34 -0400)
committerJeremy Barton <jbarton@microsoft.com>
Sat, 28 Jul 2018 23:34:05 +0000 (16:34 -0700)
Commit migrated from https://github.com/dotnet/corefx/commit/96f782f1cededf1528510f4ddfb5721a056d68b5

src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs with 86% similarity]
src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/Interop.crypt32.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/Internal/Cryptography/Pal.Windows/Native/SafeHandles.cs
src/libraries/System.Security.Cryptography.X509Certificates/src/System.Security.Cryptography.X509Certificates.csproj

@@ -3,12 +3,8 @@
 // See the LICENSE file in the project root for more information.
 
 using System;
-using System.Text;
-using System.Diagnostics;
 using System.Runtime.InteropServices;
 
-using Microsoft.Win32.SafeHandles;
-
 internal static partial class Interop
 {
     internal static partial class Crypt32
index cbf1634..d01c70b 100644 (file)
     <Compile Include="Interop\Windows\Crypt32\Interop.CryptEncodeDecodeWrappers.cs" />
     <Compile Include="Interop\Windows\Crypt32\Interop.CryptEncodeObject.cs" />
     <Compile Include="Interop\Windows\Crypt32\Interop.CryptKeySpec.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptMsgClose.cs" />
     <Compile Include="Interop\Windows\Crypt32\Interop.CryptMsgControl.cs" />
     <Compile Include="Interop\Windows\Crypt32\Interop.CryptMsgGetParam.cs" />
     <Compile Include="Interop\Windows\Crypt32\Interop.CryptMsgOpenToDecode.cs" />
     <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CertFreeCertificateContext.cs">
       <Link>Common\Interop\Windows\Crypt32\Interop.CertFreeCertificateContext.cs</Link>
     </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptMsgClose.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptMsgClose.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs">
       <Link>Common\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs</Link>
     </Compile>
index 656e096..ddf2a99 100644 (file)
@@ -312,9 +312,6 @@ internal static partial class Interop
         private static extern bool CertVerifyCertificateChainPolicy(IntPtr pszPolicyOID, SafeX509ChainHandle pChainContext, [In] ref CERT_CHAIN_POLICY_PARA pPolicyPara, [In, Out] ref CERT_CHAIN_POLICY_STATUS pPolicyStatus);
 
         [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        public static extern bool CryptMsgClose(IntPtr hCryptMsg);
-        
-        [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
         public static extern unsafe bool CryptImportPublicKeyInfoEx2(CertEncodingType dwCertEncodingType, CERT_PUBLIC_KEY_INFO* pInfo, int dwFlags, void* pvAuxInfo, out SafeBCryptKeyHandle phKey);
 
         [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
index 1e84ae7..cd892af 100644 (file)
@@ -215,7 +215,7 @@ namespace Internal.Cryptography.Pal.Native
     {
         protected sealed override bool ReleaseHandle()
         {
-            bool success = Interop.crypt32.CryptMsgClose(handle);
+            bool success = Interop.Crypt32.CryptMsgClose(handle);
             return success;
         }
     }
index fee5e8d..c406914 100644 (file)
     <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CertCloseStore.cs">
       <Link>Common\Interop\Windows\Crypt32\Interop.CertCloseStore.cs</Link>
     </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptMsgClose.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptMsgClose.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CertFreeCertificateContext.cs">
       <Link>Common\Interop\Windows\Crypt32\Interop.CertFreeCertificateContext.cs</Link>
     </Compile>