ホーム › Security.Cryptography › CertDuplicateCRLContext
CertDuplicateCRLContext
関数CRLコンテキストを複製して参照を増やす。
シグネチャ
// CRYPT32.dll
#include <windows.h>
CRL_CONTEXT* CertDuplicateCRLContext(
CRL_CONTEXT* pCrlContext // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pCrlContext | CRL_CONTEXT* | inoptional |
戻り値の型: CRL_CONTEXT*
各言語での呼び出し定義
// CRYPT32.dll
#include <windows.h>
CRL_CONTEXT* CertDuplicateCRLContext(
CRL_CONTEXT* pCrlContext // optional
);[DllImport("CRYPT32.dll", ExactSpelling = true)]
static extern IntPtr CertDuplicateCRLContext(
IntPtr pCrlContext // CRL_CONTEXT* optional
);<DllImport("CRYPT32.dll", ExactSpelling:=True)>
Public Shared Function CertDuplicateCRLContext(
pCrlContext As IntPtr ' CRL_CONTEXT* optional
) As IntPtr
End Function' pCrlContext : CRL_CONTEXT* optional
Declare PtrSafe Function CertDuplicateCRLContext Lib "crypt32" ( _
ByVal pCrlContext As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CertDuplicateCRLContext = ctypes.windll.crypt32.CertDuplicateCRLContext
CertDuplicateCRLContext.restype = ctypes.c_void_p
CertDuplicateCRLContext.argtypes = [
ctypes.c_void_p, # pCrlContext : CRL_CONTEXT* optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('CRYPT32.dll')
CertDuplicateCRLContext = Fiddle::Function.new(
lib['CertDuplicateCRLContext'],
[
Fiddle::TYPE_VOIDP, # pCrlContext : CRL_CONTEXT* optional
],
Fiddle::TYPE_VOIDP)#[link(name = "crypt32")]
extern "system" {
fn CertDuplicateCRLContext(
pCrlContext: *mut CRL_CONTEXT // CRL_CONTEXT* optional
) -> *mut CRL_CONTEXT;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("CRYPT32.dll")]
public static extern IntPtr CertDuplicateCRLContext(IntPtr pCrlContext);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CRYPT32_CertDuplicateCRLContext' -Namespace Win32 -PassThru
# $api::CertDuplicateCRLContext(pCrlContext)#uselib "CRYPT32.dll"
#func global CertDuplicateCRLContext "CertDuplicateCRLContext" sptr
; CertDuplicateCRLContext varptr(pCrlContext) ; 戻り値は stat
; pCrlContext : CRL_CONTEXT* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "CRYPT32.dll" #cfunc global CertDuplicateCRLContext "CertDuplicateCRLContext" var ; res = CertDuplicateCRLContext(pCrlContext) ; pCrlContext : CRL_CONTEXT* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "CRYPT32.dll" #cfunc global CertDuplicateCRLContext "CertDuplicateCRLContext" sptr ; res = CertDuplicateCRLContext(varptr(pCrlContext)) ; pCrlContext : CRL_CONTEXT* optional -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; CRL_CONTEXT* CertDuplicateCRLContext(CRL_CONTEXT* pCrlContext) #uselib "CRYPT32.dll" #cfunc global CertDuplicateCRLContext "CertDuplicateCRLContext" var ; res = CertDuplicateCRLContext(pCrlContext) ; pCrlContext : CRL_CONTEXT* optional -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; CRL_CONTEXT* CertDuplicateCRLContext(CRL_CONTEXT* pCrlContext) #uselib "CRYPT32.dll" #cfunc global CertDuplicateCRLContext "CertDuplicateCRLContext" intptr ; res = CertDuplicateCRLContext(varptr(pCrlContext)) ; pCrlContext : CRL_CONTEXT* optional -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
crypt32 = windows.NewLazySystemDLL("CRYPT32.dll")
procCertDuplicateCRLContext = crypt32.NewProc("CertDuplicateCRLContext")
)
// pCrlContext (CRL_CONTEXT* optional)
r1, _, err := procCertDuplicateCRLContext.Call(
uintptr(pCrlContext),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // CRL_CONTEXT*function CertDuplicateCRLContext(
pCrlContext: Pointer // CRL_CONTEXT* optional
): Pointer; stdcall;
external 'CRYPT32.dll' name 'CertDuplicateCRLContext';result := DllCall("CRYPT32\CertDuplicateCRLContext"
, "Ptr", pCrlContext ; CRL_CONTEXT* optional
, "Ptr") ; return: CRL_CONTEXT*●CertDuplicateCRLContext(pCrlContext) = DLL("CRYPT32.dll", "void* CertDuplicateCRLContext(void*)")
# 呼び出し: CertDuplicateCRLContext(pCrlContext)
# pCrlContext : CRL_CONTEXT* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。