ホーム › Security.Authentication.Identity › SslFreeCertificate
SslFreeCertificate
関数SslCrackCertificateで取得した証明書構造体を解放する。
シグネチャ
// SCHANNEL.dll
#include <windows.h>
void SslFreeCertificate(
X509Certificate* pCertificate
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pCertificate | X509Certificate* | inout |
戻り値の型: void
各言語での呼び出し定義
// SCHANNEL.dll
#include <windows.h>
void SslFreeCertificate(
X509Certificate* pCertificate
);[DllImport("SCHANNEL.dll", ExactSpelling = true)]
static extern void SslFreeCertificate(
IntPtr pCertificate // X509Certificate* in/out
);<DllImport("SCHANNEL.dll", ExactSpelling:=True)>
Public Shared Sub SslFreeCertificate(
pCertificate As IntPtr ' X509Certificate* in/out
)
End Sub' pCertificate : X509Certificate* in/out
Declare PtrSafe Sub SslFreeCertificate Lib "schannel" ( _
ByVal pCertificate As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SslFreeCertificate = ctypes.windll.schannel.SslFreeCertificate
SslFreeCertificate.restype = None
SslFreeCertificate.argtypes = [
ctypes.c_void_p, # pCertificate : X509Certificate* in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SCHANNEL.dll')
SslFreeCertificate = Fiddle::Function.new(
lib['SslFreeCertificate'],
[
Fiddle::TYPE_VOIDP, # pCertificate : X509Certificate* in/out
],
Fiddle::TYPE_VOID)#[link(name = "schannel")]
extern "system" {
fn SslFreeCertificate(
pCertificate: *mut X509Certificate // X509Certificate* in/out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SCHANNEL.dll")]
public static extern void SslFreeCertificate(IntPtr pCertificate);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SCHANNEL_SslFreeCertificate' -Namespace Win32 -PassThru
# $api::SslFreeCertificate(pCertificate)#uselib "SCHANNEL.dll"
#func global SslFreeCertificate "SslFreeCertificate" sptr
; SslFreeCertificate varptr(pCertificate)
; pCertificate : X509Certificate* in/out -> "sptr"出力引数:
#uselib "SCHANNEL.dll" #func global SslFreeCertificate "SslFreeCertificate" var ; SslFreeCertificate pCertificate ; pCertificate : X509Certificate* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "SCHANNEL.dll" #func global SslFreeCertificate "SslFreeCertificate" sptr ; SslFreeCertificate varptr(pCertificate) ; pCertificate : X509Certificate* in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void SslFreeCertificate(X509Certificate* pCertificate) #uselib "SCHANNEL.dll" #func global SslFreeCertificate "SslFreeCertificate" var ; SslFreeCertificate pCertificate ; pCertificate : X509Certificate* in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void SslFreeCertificate(X509Certificate* pCertificate) #uselib "SCHANNEL.dll" #func global SslFreeCertificate "SslFreeCertificate" intptr ; SslFreeCertificate varptr(pCertificate) ; pCertificate : X509Certificate* in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
schannel = windows.NewLazySystemDLL("SCHANNEL.dll")
procSslFreeCertificate = schannel.NewProc("SslFreeCertificate")
)
// pCertificate (X509Certificate* in/out)
r1, _, err := procSslFreeCertificate.Call(
uintptr(pCertificate),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure SslFreeCertificate(
pCertificate: Pointer // X509Certificate* in/out
); stdcall;
external 'SCHANNEL.dll' name 'SslFreeCertificate';result := DllCall("SCHANNEL\SslFreeCertificate"
, "Ptr", pCertificate ; X509Certificate* in/out
, "Int") ; return: void●SslFreeCertificate(pCertificate) = DLL("SCHANNEL.dll", "int SslFreeCertificate(void*)")
# 呼び出し: SslFreeCertificate(pCertificate)
# pCertificate : X509Certificate* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。