Refactor DllImports for System.Security.Cryptography.Pkcs to share in Common/Interop
authorRoman Marusyk <Marusyk@users.noreply.github.com>
Thu, 3 Jan 2019 18:28:46 +0000 (20:28 +0200)
committerJeremy Barton <jbarton@microsoft.com>
Thu, 3 Jan 2019 18:28:46 +0000 (10:28 -0800)
Commit migrated from https://github.com/dotnet/corefx/commit/e32bdde06baadcc02143e012bdc7929ceb57c071

62 files changed:
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CERT_CONTEXT.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CERT_CONTEXT.cs with 89% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CERT_ID.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CERT_ID.cs with 90% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CERT_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CERT_INFO.cs with 87% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CERT_ISSUER_SERIAL_NUMBER.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CERT_ISSUER_SERIAL_NUMBER.cs with 84% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CERT_PUBLIC_KEY_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CERT_PUBLIC_KEY_INFO.cs with 85% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_CMS_RECIPIENT_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_CMS_RECIPIENT_INFO.cs with 96% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_CTRL_DECRYPT_PARA.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_CTRL_DECRYPT_PARA.cs with 91% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_CTRL_KEY_AGREE_DECRYPT_PARA.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_CTRL_KEY_AGREE_DECRYPT_PARA.cs with 93% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_ENVELOPED_ENCODE_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_ENVELOPED_ENCODE_INFO.cs with 94% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO.cs with 94% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_KEY_AGREE_RECIPIENT_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_KEY_AGREE_RECIPIENT_INFO.cs with 96% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO.cs with 90% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_KEY_TRANS_RECIPIENT_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_KEY_TRANS_RECIPIENT_INFO.cs with 87% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_RC2_AUX_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_RC2_AUX_INFO.cs with 84% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_RECIPIENT_ENCODE_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_RECIPIENT_ENCODE_INFO.cs with 92% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO.cs with 81% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO.cs with 79% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMsgCmsRecipientChoice.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMsgCmsRecipientChoice.cs with 78% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CMsgKeyAgreeOriginatorChoice.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CMsgKeyAgreeOriginatorChoice.cs with 78% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_ALGORITHM_IDENTIFIER.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CRYPT_ALGORITHM_IDENTIFIER.cs with 87% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_ATTRIBUTE.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CRYPT_ATTRIBUTE.cs with 87% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_ATTRIBUTES.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CRYPT_ATTRIBUTES.cs with 84% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_ATTRIBUTE_TYPE_VALUE.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CRYPT_ATTRIBUTE_TYPE_VALUE.cs with 86% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_BIT_BLOB.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CRYPT_BIT_BLOB.cs with 90% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_KEY_PROV_INFO.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CRYPT_KEY_PROV_INFO.cs with 90% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CRYPT_RC2_CBC_PARAMETERS.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CRYPT_RC2_CBC_PARAMETERS.cs with 89% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertContextPropId.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CertContextPropId.cs with 84% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateContext.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CertCreateCertificateContext.cs with 66% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs with 67% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertGetPublicKeyLength.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CertGetPublicKeyLength.cs with 85% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertIdChoice.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CertIdChoice.cs with 78% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameStrTypeAndFlags.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CertNameStrTypeAndFlags.cs with 90% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CertNameToStr.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CmsKeyAgreeKeyChoice.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CmsKeyAgreeKeyChoice.cs with 77% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs [new file with mode: 0644]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKeyFlags.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKeyFlags.cs with 89% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptDecodeObject.cs with 72% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectStructType.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptDecodeObjectStructType.cs with 90% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeDecodeWrappers.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptEncodeDecodeWrappers.cs with 98% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptEncodeObject.cs with 73% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptKeySpec.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptKeySpec.cs with 80% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgClose.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgControl.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgControl.cs with 55% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs [new file with mode: 0644]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToDecode.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToDecode.cs with 72% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgOpenToEncode.cs with 65% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgParamType.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgParamType.cs with 93% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgType.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgType.cs with 80% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgUpdate.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgUpdate.cs with 94% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptRc2Version.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptRc2Version.cs with 79% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptReleaseContext.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptReleaseContext.cs with 71% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.ErrorCode.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.Crypt32.ErrorCode.cs with 84% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.FindOidInfo.cs
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.MsgControlType.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.MsgControlType.cs with 89% similarity]
src/libraries/Common/src/Interop/Windows/Crypt32/Interop.MsgEncodingType.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.MsgEncodingType.cs with 81% similarity]
src/libraries/Common/src/Interop/Windows/kernel32/Interop.Heap.cs [moved from src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Heap/Interop.Heap.cs with 86% similarity]
src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CertDuplicateCertificateContext.cs
src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs [deleted file]
src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs [deleted file]
src/libraries/System.Security.Cryptography.Pkcs/src/Microsoft/Win32/SafeHandles/SafeHeapAllocHandle.cs
src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.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
@@ -24,4 +20,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -34,4 +29,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -3,13 +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 FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
-
-using Microsoft.Win32.SafeHandles;
+using System.Runtime.InteropServices.ComTypes;
 
 internal static partial class Interop
 {
@@ -33,4 +28,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -21,4 +16,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -21,4 +16,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,9 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -2,11 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -23,4 +19,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,9 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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;
@@ -26,4 +23,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -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
@@ -41,4 +37,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -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
@@ -34,4 +30,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,9 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -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
@@ -25,4 +21,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -23,4 +18,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -21,4 +16,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -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
@@ -31,4 +27,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,14 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System;
-using System.Text;
-using System.Diagnostics;
 using System.Runtime.InteropServices;
-
-using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
-
-using Microsoft.Win32.SafeHandles;
+using System.Runtime.InteropServices.ComTypes;
 
 internal static partial class Interop
 {
@@ -26,4 +20,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,15 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System;
-using System.Text;
-using System.Diagnostics;
 using System.Runtime.InteropServices;
-
-using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
-
-
-using Microsoft.Win32.SafeHandles;
+using System.Runtime.InteropServices.ComTypes;
 
 internal static partial class Interop
 {
@@ -26,4 +19,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -21,4 +14,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -20,4 +13,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -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
@@ -21,4 +17,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -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
@@ -22,4 +18,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -21,4 +16,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -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
@@ -21,4 +17,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -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
@@ -30,4 +26,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -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
@@ -26,4 +22,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -29,4 +24,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -26,4 +19,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -1,12 +1,8 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -14,7 +10,9 @@ internal static partial class Interop
     internal static partial class Crypt32
     {
         [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern unsafe SafeCertContextHandle CertCreateCertificateContext(MsgEncodingType dwCertEncodingType, void* pbCertEncoded, int cbCertEncoded);
+        internal static extern unsafe SafeCertContextHandle CertCreateCertificateContext(
+            MsgEncodingType dwCertEncodingType,
+            void* pbCertEncoded,
+            int cbCertEncoded);
     }
 }
-
index 756dfef..aaace4e 100644 (file)
@@ -10,7 +10,7 @@ internal static partial class Interop
 {
     internal static partial class Crypt32
     {
-        [DllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static extern SafeCertContextHandle CertDuplicateCertificateContext(IntPtr pCertContext);
     }
 }
@@ -4,7 +4,6 @@
 
 using System;
 using System.Runtime.InteropServices;
-
 using Microsoft.Win32.SafeHandles;
 
 internal static partial class Interop
@@ -12,10 +11,17 @@ internal static partial class Interop
     internal static partial class Crypt32
     {
         [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern bool CertGetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, [Out] byte[] pvData, [In, Out] ref int pcbData);
+        internal static extern bool CertGetCertificateContextProperty(
+            SafeCertContextHandle pCertContext,
+            CertContextPropId dwPropId,
+            [Out] byte[] pvData,
+            [In, Out] ref int pcbData);
 
         [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern bool CertGetCertificateContextProperty(SafeCertContextHandle pCertContext, CertContextPropId dwPropId, out IntPtr pvData, [In, Out] ref int pcbData);
+        internal static extern bool CertGetCertificateContextProperty(
+            SafeCertContextHandle pCertContext,
+            CertContextPropId dwPropId,
+            out IntPtr pvData,
+            [In, Out] ref int pcbData);
     }
 }
-
@@ -2,13 +2,8 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -17,4 +12,3 @@ internal static partial class Interop
         internal static extern int CertGetPublicKeyLength(MsgEncodingType dwCertEncodingType, [In] ref CERT_PUBLIC_KEY_INFO pPublicKey);
     }
 }
-
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -21,4 +14,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -3,11 +3,6 @@
 // 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
 {
@@ -34,4 +29,3 @@ internal static partial class Interop
         }
     }
 }
-
index 95177b6..17520a8 100644 (file)
@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-using System;
 using System.Runtime.InteropServices;
 
 internal static partial class Interop
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -20,4 +13,3 @@ internal static partial class Interop
         }
     }
 }
-
diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs
new file mode 100644 (file)
index 0000000..8a6fd2b
--- /dev/null
@@ -0,0 +1,22 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.InteropServices;
+using Microsoft.Win32.SafeHandles;
+
+internal static partial class Interop
+{
+    internal static partial class Crypt32
+    {
+        [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        internal static extern bool CryptAcquireCertificatePrivateKey(
+            SafeCertContextHandle pCert,
+            CryptAcquireCertificatePrivateKeyFlags dwFlags,
+            IntPtr pvParameters,
+            out IntPtr phCryptProvOrNCryptKey,
+            out CryptKeySpec pdwKeySpec,
+            out bool pfCallerFreeProvOrNCryptKey);
+    }
+}
@@ -3,11 +3,6 @@
 // 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
 {
@@ -31,4 +26,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -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
@@ -19,7 +15,13 @@ internal static partial class Interop
         }
 
         [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        private static extern unsafe bool CryptDecodeObject(MsgEncodingType dwCertEncodingType, IntPtr lpszStructType, IntPtr pbEncoded, int cbEncoded, int dwFlags, void* pvStructInfo, ref int pcbStructInfo);
+        private static extern unsafe bool CryptDecodeObject(
+            MsgEncodingType dwCertEncodingType,
+            IntPtr lpszStructType,
+            IntPtr pbEncoded,
+            int cbEncoded,
+            int dwFlags,
+            void* pvStructInfo,
+            ref int pcbStructInfo);
     }
 }
-
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -40,4 +33,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -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
@@ -19,7 +15,11 @@ internal static partial class Interop
         }
 
         [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        private static extern unsafe bool CryptEncodeObject(MsgEncodingType dwCertEncodingType, IntPtr lpszStructType, void* pvStructInfo, [Out] byte[] pbEncoded, [In, Out] ref int pcbEncoded);
+        private static extern unsafe bool CryptEncodeObject(
+            MsgEncodingType dwCertEncodingType,
+            IntPtr lpszStructType,
+            void* pvStructInfo,
+            [Out] byte[] pbEncoded,
+            [In, Out] ref int pcbEncoded);
     }
 }
-
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -21,4 +14,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,11 +2,7 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -14,10 +10,17 @@ internal static partial class Interop
     internal static partial class Crypt32
     {
         [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern bool CryptMsgControl(SafeCryptMsgHandle hCryptMsg, int dwFlags, MsgControlType dwCtrlType, [In] ref CMSG_CTRL_DECRYPT_PARA pvCtrlPara);
+        internal static extern bool CryptMsgControl(
+            SafeCryptMsgHandle hCryptMsg,
+            int dwFlags,
+            MsgControlType dwCtrlType,
+            [In] ref CMSG_CTRL_DECRYPT_PARA pvCtrlPara);
 
         [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern bool CryptMsgControl(SafeCryptMsgHandle hCryptMsg, int dwFlags, MsgControlType dwCtrlType, [In] ref CMSG_CTRL_KEY_AGREE_DECRYPT_PARA pvCtrlPara);
+        internal static extern bool CryptMsgControl(
+            SafeCryptMsgHandle hCryptMsg,
+            int dwFlags,
+            MsgControlType dwCtrlType,
+            [In] ref CMSG_CTRL_KEY_AGREE_DECRYPT_PARA pvCtrlPara);
     }
 }
-
diff --git a/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs b/src/libraries/Common/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs
new file mode 100644 (file)
index 0000000..63fdff1
--- /dev/null
@@ -0,0 +1,45 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Runtime.InteropServices;
+using Microsoft.Win32.SafeHandles;
+
+internal static partial class Interop
+{
+    internal static partial class Crypt32
+    {
+        [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        internal static extern bool CryptMsgGetParam(
+            SafeCryptMsgHandle hCryptMsg,
+            CryptMsgParamType dwParamType,
+            int dwIndex,
+            out int pvData,
+            [In, Out] ref int pcbData);
+
+        [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        internal static extern bool CryptMsgGetParam(
+            SafeCryptMsgHandle hCryptMsg,
+            CryptMsgParamType dwParamType,
+            int dwIndex,
+            out CryptMsgType pvData,
+            [In, Out] ref int pcbData);
+
+        [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        internal static extern bool CryptMsgGetParam(
+            SafeCryptMsgHandle hCryptMsg,
+            CryptMsgParamType dwParamType,
+            int dwIndex,
+            [Out] byte[] pvData,
+            [In, Out] ref int pcbData);
+
+        [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
+        internal static extern bool CryptMsgGetParam(
+            SafeCryptMsgHandle hCryptMsg,
+            CryptMsgParamType dwParamType,
+            int dwIndex,
+            IntPtr pvData,
+            [In, Out] ref int pcbData);
+    }
+}
@@ -3,10 +3,7 @@
 // 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
@@ -14,7 +11,12 @@ internal static partial class Interop
     internal static partial class Crypt32
     {
         [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern SafeCryptMsgHandle CryptMsgOpenToDecode(MsgEncodingType dwMsgEncodingType, int dwFlags, int dwMsgType, IntPtr hCryptProv, IntPtr pRecipientInfo, IntPtr pStreamInfo);
+        internal static extern SafeCryptMsgHandle CryptMsgOpenToDecode(
+            MsgEncodingType dwMsgEncodingType,
+            int dwFlags,
+            int dwMsgType,
+            IntPtr hCryptProv,
+            IntPtr pRecipientInfo,
+            IntPtr pStreamInfo);
     }
 }
-
@@ -3,10 +3,7 @@
 // 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
@@ -14,7 +11,12 @@ internal static partial class Interop
     internal static partial class Crypt32
     {
         [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern unsafe SafeCryptMsgHandle CryptMsgOpenToEncode(MsgEncodingType dwMsgEncodingType, int dwFlags, CryptMsgType dwMsgType, CMSG_ENVELOPED_ENCODE_INFO* pvMsgEncodeInfo, [MarshalAs(UnmanagedType.LPStr)] string pszInnerContentObjID, IntPtr pStreamInfo);
+        internal static extern unsafe SafeCryptMsgHandle CryptMsgOpenToEncode(
+            MsgEncodingType dwMsgEncodingType,
+            int dwFlags,
+            CryptMsgType dwMsgType,
+            CMSG_ENVELOPED_ENCODE_INFO* pvMsgEncodeInfo,
+            [MarshalAs(UnmanagedType.LPStr)] string pszInnerContentObjID,
+            IntPtr pStreamInfo);
     }
 }
-
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -53,4 +46,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -24,4 +17,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -3,10 +3,7 @@
 // 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
@@ -20,4 +17,3 @@ internal static partial class Interop
         internal static extern bool CryptMsgUpdate(SafeCryptMsgHandle hCryptMsg, IntPtr pbData, int cbData, bool fFinal);
     }
 }
-
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -22,4 +15,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -3,18 +3,13 @@
 // 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
     {
-        [DllImport(Interop.Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [DllImport(Libraries.Advapi32, CharSet = CharSet.Unicode, SetLastError = true)]
         internal static extern bool CryptReleaseContext(IntPtr hCryptProv, uint dwFlags);
     }
 }
-
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -25,4 +18,3 @@ internal static partial class Interop
         }
     }
 }
-
index 586045f..29bacd3 100644 (file)
@@ -4,8 +4,8 @@
 
 using System;
 using System.Diagnostics;
-using System.Security.Cryptography;
 using System.Runtime.InteropServices;
+using System.Security.Cryptography;
 
 internal static partial class Interop
 {
@@ -2,13 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -37,4 +30,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -3,11 +3,6 @@
 // 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
 {
@@ -23,4 +18,3 @@ internal static partial class Interop
         }
     }
 }
-
@@ -3,17 +3,14 @@
 // 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 partial class Interop
 {
-    internal static partial class Heap
+    internal partial class Kernel32
     {
-        [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode)]
         internal static extern IntPtr GetProcessHeap();
 
         [Flags]
@@ -30,11 +27,10 @@ internal static partial class Interop
             return HeapAlloc(hHeap, dwFlags, new IntPtr(dwBytes));
         }
 
-        [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode)]
         private static extern SafeHeapAllocHandle HeapAlloc(IntPtr hHeap, HeapAllocFlags dwFlags, IntPtr dwBytes);
 
-        [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true)]
+        [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode)]
         internal static extern bool HeapFree(IntPtr hHeap, HeapAllocFlags dwFlags, IntPtr lpMem);
     }
 }
-
index 9b1e965..fa38511 100644 (file)
@@ -1,14 +1,10 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT license.
 // 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
@@ -17,4 +13,3 @@ internal static partial class Interop
         internal static extern IntPtr CertDuplicateCertificateContext(IntPtr pCertContext);
     }
 }
-
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptAcquireCertificatePrivateKey.cs
deleted file mode 100644 (file)
index 43cdae3..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// 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
-    {
-        [DllImport(Interop.Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern bool CryptAcquireCertificatePrivateKey(SafeCertContextHandle pCert, CryptAcquireCertificatePrivateKeyFlags dwFlags, IntPtr pvParameters, out IntPtr phCryptProvOrNCryptKey, out CryptKeySpec pdwKeySpec, out bool pfCallerFreeProvOrNCryptKey);
-    }
-}
-
diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs b/src/libraries/System.Security.Cryptography.Pkcs/src/Interop/Windows/Crypt32/Interop.CryptMsgGetParam.cs
deleted file mode 100644 (file)
index 19e5202..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// 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
-    {
-        [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern bool CryptMsgGetParam(SafeCryptMsgHandle hCryptMsg, CryptMsgParamType dwParamType, int dwIndex, out int pvData, [In, Out] ref int pcbData);
-
-        [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern bool CryptMsgGetParam(SafeCryptMsgHandle hCryptMsg, CryptMsgParamType dwParamType, int dwIndex, out CryptMsgType pvData, [In, Out] ref int pcbData);
-
-        [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern bool CryptMsgGetParam(SafeCryptMsgHandle hCryptMsg, CryptMsgParamType dwParamType, int dwIndex, [Out] byte[] pvData, [In, Out] ref int pcbData);
-
-        [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)]
-        internal static extern bool CryptMsgGetParam(SafeCryptMsgHandle hCryptMsg, CryptMsgParamType dwParamType, int dwIndex, IntPtr pvData, [In, Out] ref int pcbData);
-    }
-}
-
index 482235b..5de425b 100644 (file)
@@ -5,7 +5,7 @@
 using System;
 using System.Runtime.InteropServices;
 
-using HeapAllocFlags = Interop.Heap.HeapAllocFlags;
+using HeapAllocFlags = Interop.Kernel32.HeapAllocFlags;
 
 namespace Microsoft.Win32.SafeHandles
 {
@@ -15,7 +15,7 @@ namespace Microsoft.Win32.SafeHandles
 
         internal static SafeHeapAllocHandle Alloc(int size)
         {
-            SafeHeapAllocHandle result = Interop.Heap.HeapAlloc(s_hHeap, HeapAllocFlags.None, size);
+            SafeHeapAllocHandle result = Interop.Kernel32.HeapAlloc(s_hHeap, HeapAllocFlags.None, size);
             if (result.IsInvalid)
             {
                 result.SetHandleAsInvalid();
@@ -47,13 +47,13 @@ namespace Microsoft.Win32.SafeHandles
                 }
             }
 #endif
-            bool success = Interop.Heap.HeapFree(s_hHeap, HeapAllocFlags.None, handle);
+            bool success = Interop.Kernel32.HeapFree(s_hHeap, HeapAllocFlags.None, handle);
             return success;
         }
 
 #if DEBUG
         private int _size;
 #endif
-        private static readonly IntPtr s_hHeap = Interop.Heap.GetProcessHeap();
+        private static readonly IntPtr s_hHeap = Interop.Kernel32.GetProcessHeap();
     }
 }
index 73295fb..9152532 100644 (file)
@@ -10,7 +10,7 @@
     <NoWarn>$(NoWarn);CS1574;CS3016</NoWarn>
     <Configurations>net461-Windows_NT-Debug;net461-Windows_NT-Release;netcoreapp-Debug;netcoreapp-Release;netcoreapp-Windows_NT-Debug;netcoreapp-Windows_NT-Release;netfx-Windows_NT-Debug;netfx-Windows_NT-Release;netstandard-Debug;netstandard-Release;netstandard-Windows_NT-Debug;netstandard-Windows_NT-Release</Configurations>
   </PropertyGroup>
-  <Import Project="$(CommonPath)\System\Security\Cryptography\Asn1\AsnXml.targets"/>
+  <Import Project="$(CommonPath)\System\Security\Cryptography\Asn1\AsnXml.targets" />
   <!-- Don't delete these clauses even if they look useless. They tell the VS IDE that "Windows_Debug", etc., are
        valid configuration for this project and stop it from trying to "fix up" the .sln file -->
   <!-- API types (platform independent) -->
     <Compile Include="Microsoft\Win32\SafeHandles\SafeHeapAllocHandle.cs" />
     <Compile Include="Microsoft\Win32\SafeHandles\SafeProvOrNCryptKeyHandle.cs" />
     <Compile Include="Microsoft\Win32\SafeHandles\SafeProvOrNCryptKeyHandleUwp.cs" />
+    <Compile Include="Interop\Windows\Crypt32\Interop.CertDuplicateCertificateContext.cs" />
   </ItemGroup>
   <!-- Interop types (platform: Windows) -->
   <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(IsPartialFacadeAssembly)' != 'true'">
-    <Compile Include="$(CommonPath)\Interop\Windows\advapi32\Interop.CryptGetProvParam.cs">
-      <Link>Common\Interop\Windows\advapi32\Interop.CryptGetProvParam.cs</Link>
-    </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\advapi32\Interop.CryptAcquireContext.cs">
       <Link>Common\Interop\Windows\advapi32\Interop.CryptAcquireContext.cs</Link>
     </Compile>
-    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CertNameToStr.cs">
-      <Link>Common\Interop\Windows\Crypt32\Interop.CertNameToStr.cs</Link>
-    </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\advapi32\Interop.CryptDestroyHash.cs">
       <Link>Common\Interop\Windows\advapi32\Interop.CryptDestroyHash.cs</Link>
     </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\advapi32\Interop.CryptDestroyKey.cs">
       <Link>Common\Interop\Windows\advapi32\Interop.CryptDestroyKey.cs</Link>
     </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\advapi32\Interop.CryptGetProvParam.cs">
+      <Link>Common\Interop\Windows\advapi32\Interop.CryptGetProvParam.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\advapi32\Interop.CryptReleaseContext.cs">
       <Link>Common\Interop\Windows\advapi32\Interop.CryptReleaseContext.cs</Link>
     </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\advapi32\SafeProvHandle.cs">
       <Link>Common\Interop\Windows\advapi32\SafeProvHandle.cs</Link>
     </Compile>
-    <Compile Include="Interop\Windows\Crypt32\Interop.CERT_CONTEXT.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CERT_ID.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CERT_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CERT_ISSUER_SERIAL_NUMBER.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CERT_PUBLIC_KEY_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CertContextPropId.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CertCreateCertificateContext.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CertDuplicateCertificateContext.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CertGetCertificateContextProperty.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CertGetPublicKeyLength.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CertIdChoice.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CertNameStrTypeAndFlags.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_CMS_RECIPIENT_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_CTRL_DECRYPT_PARA.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_CTRL_KEY_AGREE_DECRYPT_PARA.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_ENVELOPED_ENCODE_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_KEY_AGREE_RECIPIENT_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_KEY_TRANS_RECIPIENT_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_RC2_AUX_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_RECIPIENT_ENCODE_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMsgCmsRecipientChoice.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CMsgKeyAgreeOriginatorChoice.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CmsKeyAgreeKeyChoice.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CRYPT_ALGORITHM_IDENTIFIER.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CRYPT_ATTRIBUTE.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CRYPT_ATTRIBUTE_TYPE_VALUE.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CRYPT_ATTRIBUTES.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CRYPT_BIT_BLOB.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CRYPT_KEY_PROV_INFO.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CRYPT_RC2_CBC_PARAMETERS.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.Crypt32.ErrorCode.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptAcquireCertificatePrivateKey.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptAcquireCertificatePrivateKeyFlags.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptDecodeObject.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptDecodeObjectStructType.cs" />
-    <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.CryptMsgControl.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptMsgGetParam.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptMsgOpenToDecode.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptMsgOpenToEncode.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptMsgParamType.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptMsgType.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptMsgUpdate.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptRc2Version.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.CryptReleaseContext.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.MsgControlType.cs" />
-    <Compile Include="Interop\Windows\Crypt32\Interop.MsgEncodingType.cs" />
-    <Compile Include="Interop\Windows\Heap\Interop.Heap.cs" />
-  </ItemGroup>
-  <!-- Common types (platform: Windows) -->
-  <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(IsPartialFacadeAssembly)' != 'true'">
-    <Compile Include="$(CommonPath)\Internal\Cryptography\Windows\CryptoThrowHelper.cs">
-      <Link>Common\Internal\Cryptography\Windows\CryptoThrowHelper.cs</Link>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CERT_CONTEXT.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CERT_CONTEXT.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CERT_ID.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CERT_ID.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CERT_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CERT_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CERT_ISSUER_SERIAL_NUMBER.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CERT_ISSUER_SERIAL_NUMBER.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CERT_PUBLIC_KEY_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CERT_PUBLIC_KEY_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CertContextPropId.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CertContextPropId.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CertCreateCertificateContext.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CertCreateCertificateContext.cs</Link>
     </Compile>
     <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.CertGetCertificateContextProperty.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CertGetCertificateContextProperty.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CertGetPublicKeyLength.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CertGetPublicKeyLength.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CertIdChoice.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CertIdChoice.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CertNameStrTypeAndFlags.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CertNameStrTypeAndFlags.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CertNameToStr.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CertNameToStr.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_CMS_RECIPIENT_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_CMS_RECIPIENT_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_CTRL_DECRYPT_PARA.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_CTRL_DECRYPT_PARA.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_CTRL_KEY_AGREE_DECRYPT_PARA.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_CTRL_KEY_AGREE_DECRYPT_PARA.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_ENVELOPED_ENCODE_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_ENVELOPED_ENCODE_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_KEY_AGREE_RECIPIENT_ENCODE_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_KEY_AGREE_RECIPIENT_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_KEY_AGREE_RECIPIENT_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_KEY_TRANS_RECIPIENT_ENCODE_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_KEY_TRANS_RECIPIENT_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_KEY_TRANS_RECIPIENT_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_RC2_AUX_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_RC2_AUX_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_RECIPIENT_ENCODE_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_RECIPIENT_ENCODE_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_RECIPIENT_ENCRYPTED_KEY_ENCODE_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMSG_RECIPIENT_ENCRYPTED_KEY_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMsgCmsRecipientChoice.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMsgCmsRecipientChoice.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CMsgKeyAgreeOriginatorChoice.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CMsgKeyAgreeOriginatorChoice.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CmsKeyAgreeKeyChoice.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CmsKeyAgreeKeyChoice.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CRYPT_ALGORITHM_IDENTIFIER.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CRYPT_ALGORITHM_IDENTIFIER.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CRYPT_ATTRIBUTE.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CRYPT_ATTRIBUTE.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CRYPT_ATTRIBUTE_TYPE_VALUE.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CRYPT_ATTRIBUTE_TYPE_VALUE.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CRYPT_ATTRIBUTES.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CRYPT_ATTRIBUTES.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CRYPT_BIT_BLOB.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CRYPT_BIT_BLOB.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CRYPT_KEY_PROV_INFO.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CRYPT_KEY_PROV_INFO.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CRYPT_RC2_CBC_PARAMETERS.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CRYPT_RC2_CBC_PARAMETERS.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptAcquireCertificatePrivateKey.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptAcquireCertificatePrivateKey.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptAcquireCertificatePrivateKeyFlags.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptAcquireCertificatePrivateKeyFlags.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptDecodeObject.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptDecodeObject.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptDecodeObjectStructType.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptDecodeObjectStructType.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptEncodeDecodeWrappers.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptEncodeDecodeWrappers.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptEncodeObject.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptEncodeObject.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptKeySpec.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptKeySpec.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.CryptMsgControl.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptMsgControl.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptMsgGetParam.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptMsgGetParam.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptMsgOpenToDecode.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptMsgOpenToDecode.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptMsgOpenToEncode.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptMsgOpenToEncode.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptMsgParamType.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptMsgParamType.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptMsgType.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptMsgType.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptMsgUpdate.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptMsgUpdate.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptRc2Version.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptRc2Version.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.CryptReleaseContext.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.CryptReleaseContext.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs">
       <Link>Common\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs</Link>
     </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.ErrorCode.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.ErrorCode.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.FindOidInfo.cs">
       <Link>Common\Interop\Windows\Crypt32\Interop.FindOidInfo.cs</Link>
     </Compile>
-    <Compile Include="$(CommonPath)\Interop\Windows\Interop.Libraries.cs">
-      <Link>Common\Interop\Windows\Interop.Libraries.cs</Link>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.MsgControlType.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.MsgControlType.cs</Link>
+    </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Crypt32\Interop.MsgEncodingType.cs">
+      <Link>Common\Interop\Windows\Crypt32\Interop.MsgEncodingType.cs</Link>
     </Compile>
     <Compile Include="$(CommonPath)\CoreLib\Interop\Windows\Kernel32\Interop.FormatMessage.cs">
       <Link>Common\Interop\Windows\kernel32\Interop.FormatMessage.cs</Link>
     </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Kernel32\Interop.Heap.cs">
+      <Link>Common\Interop\Windows\kernel32\Interop.Heap.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\NCrypt\Interop.ErrorCode.cs">
       <Link>Common\Interop\Windows\NCrypt\Interop.ErrorCode.cs</Link>
     </Compile>
     <Compile Include="$(CommonPath)\Interop\Windows\NCrypt\Interop.NCryptFreeObject.cs">
       <Link>Common\Interop\Windows\NCrypt\Interop.NCryptFreeObject.cs</Link>
     </Compile>
+    <Compile Include="$(CommonPath)\Interop\Windows\Interop.Libraries.cs">
+      <Link>Common\Interop\Windows\Interop.Libraries.cs</Link>
+    </Compile>
+  </ItemGroup>
+  <!-- Common types (platform: Windows) -->
+  <ItemGroup Condition="'$(TargetsWindows)' == 'true' AND '$(IsPartialFacadeAssembly)' != 'true'">
+    <Compile Include="$(CommonPath)\Internal\Cryptography\Windows\CryptoThrowHelper.cs">
+      <Link>Common\Internal\Cryptography\Windows\CryptoThrowHelper.cs</Link>
+    </Compile>
     <Compile Include="$(CommonPath)\Microsoft\Win32\SafeHandles\SafeHandleCache.cs">
       <Link>Common\Microsoft\Win32\SafeHandles\SafeHandleCache.cs</Link>
     </Compile>