Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CertFreeCRLContext #112207

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Runtime.InteropServices;

internal static partial class Interop
{
internal static partial class Crypt32
{
// https://learn.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-certfreecrlcontext
[LibraryImport(Libraries.Crypt32)]
public static partial int CertFreeCRLContext(IntPtr certContext);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ internal static partial class Ldap
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial int ldap_control_free(IntPtr control);

[LibraryImport("Crypt32.dll", EntryPoint = "CertFreeCRLContext")]
public static partial int CertFreeCRLContext(IntPtr certContext);

[LibraryImport(Libraries.Wldap32, EntryPoint = "ldap_result2error")]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
public static partial int ldap_result2error(ConnectionHandle ldapHandle, IntPtr result, int freeIt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<Compile Include="System\DirectoryServices\Protocols\Interop\SafeHandles.Windows.cs" />

<Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs" Link="Common\Interop\Windows\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CertFreeCRLContext.cs" Link="Common\Interop\Windows\Crypt32\Interop.CertFreeCRLContext.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Wldap32\Interop.Ldap.cs" Link="Common\Interop\Windows\Wldap32\Interop.Ldap.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Wldap32\Interop.Ber.cs" Link="Common\Interop\Windows\Wldap32\Interop.Ber.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace System.DirectoryServices.Protocols
{
public partial class LdapSessionOptions
{
private static void PALCertFreeCRLContext(IntPtr certPtr) => Interop.Ldap.CertFreeCRLContext(certPtr);
private static void PALCertFreeCRLContext(IntPtr certPtr) => Interop.Crypt32.CertFreeCRLContext(certPtr);

public bool SecureSocketLayer
{
Expand Down