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