ホーム › Security.Cryptography › CertEnumCRLContextProperties
CertEnumCRLContextProperties
関数CRLコンテキストのプロパティを順に列挙する。
シグネチャ
// CRYPT32.dll
#include <windows.h>
DWORD CertEnumCRLContextProperties(
CRL_CONTEXT* pCrlContext,
DWORD dwPropId
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| pCrlContext | CRL_CONTEXT* | in | CRL_CONTEXT 構造体へのポインターです。 |
| dwPropId | DWORD | in | 最後に列挙されたプロパティのプロパティ番号です。最初のプロパティを取得するには、dwPropId を 0 にします。後続のプロパティを取得するには、dwPropId に、この関数の最後の呼び出しで返されたプロパティ番号を設定します。すべてのプロパティを列挙するには、この関数が 0 を返すまで関数呼び出しを続けます。 アプリケーションは、この関数が返した dwPropId を指定して CertGetCRLContextProperty を呼び出すことで、そのプロパティのデータを取得できます。 |
戻り値の型: DWORD
公式ドキュメント
CertEnumCRLContextProperties 関数は、証明書失効リスト (CRL) コンテキストに関連付けられた最初の拡張プロパティ、または次の拡張プロパティを取得します。
戻り値
戻り値は、CRL コンテキストのプロパティを識別する DWORD 値です。ある呼び出しで返された DWORD 値は、後続の呼び出しで dwPropId として指定できます。列挙すべきプロパティがこれ以上ない場合、または関数が失敗した場合は 0 が返されます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// CRYPT32.dll
#include <windows.h>
DWORD CertEnumCRLContextProperties(
CRL_CONTEXT* pCrlContext,
DWORD dwPropId
);[DllImport("CRYPT32.dll", ExactSpelling = true)]
static extern uint CertEnumCRLContextProperties(
IntPtr pCrlContext, // CRL_CONTEXT*
uint dwPropId // DWORD
);<DllImport("CRYPT32.dll", ExactSpelling:=True)>
Public Shared Function CertEnumCRLContextProperties(
pCrlContext As IntPtr, ' CRL_CONTEXT*
dwPropId As UInteger ' DWORD
) As UInteger
End Function' pCrlContext : CRL_CONTEXT*
' dwPropId : DWORD
Declare PtrSafe Function CertEnumCRLContextProperties Lib "crypt32" ( _
ByVal pCrlContext As LongPtr, _
ByVal dwPropId As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CertEnumCRLContextProperties = ctypes.windll.crypt32.CertEnumCRLContextProperties
CertEnumCRLContextProperties.restype = wintypes.DWORD
CertEnumCRLContextProperties.argtypes = [
ctypes.c_void_p, # pCrlContext : CRL_CONTEXT*
wintypes.DWORD, # dwPropId : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('CRYPT32.dll')
CertEnumCRLContextProperties = Fiddle::Function.new(
lib['CertEnumCRLContextProperties'],
[
Fiddle::TYPE_VOIDP, # pCrlContext : CRL_CONTEXT*
-Fiddle::TYPE_INT, # dwPropId : DWORD
],
-Fiddle::TYPE_INT)#[link(name = "crypt32")]
extern "system" {
fn CertEnumCRLContextProperties(
pCrlContext: *mut CRL_CONTEXT, // CRL_CONTEXT*
dwPropId: u32 // DWORD
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("CRYPT32.dll")]
public static extern uint CertEnumCRLContextProperties(IntPtr pCrlContext, uint dwPropId);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CRYPT32_CertEnumCRLContextProperties' -Namespace Win32 -PassThru
# $api::CertEnumCRLContextProperties(pCrlContext, dwPropId)#uselib "CRYPT32.dll"
#func global CertEnumCRLContextProperties "CertEnumCRLContextProperties" sptr, sptr
; CertEnumCRLContextProperties varptr(pCrlContext), dwPropId ; 戻り値は stat
; pCrlContext : CRL_CONTEXT* -> "sptr"
; dwPropId : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "CRYPT32.dll" #cfunc global CertEnumCRLContextProperties "CertEnumCRLContextProperties" var, int ; res = CertEnumCRLContextProperties(pCrlContext, dwPropId) ; pCrlContext : CRL_CONTEXT* -> "var" ; dwPropId : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "CRYPT32.dll" #cfunc global CertEnumCRLContextProperties "CertEnumCRLContextProperties" sptr, int ; res = CertEnumCRLContextProperties(varptr(pCrlContext), dwPropId) ; pCrlContext : CRL_CONTEXT* -> "sptr" ; dwPropId : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD CertEnumCRLContextProperties(CRL_CONTEXT* pCrlContext, DWORD dwPropId) #uselib "CRYPT32.dll" #cfunc global CertEnumCRLContextProperties "CertEnumCRLContextProperties" var, int ; res = CertEnumCRLContextProperties(pCrlContext, dwPropId) ; pCrlContext : CRL_CONTEXT* -> "var" ; dwPropId : DWORD -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD CertEnumCRLContextProperties(CRL_CONTEXT* pCrlContext, DWORD dwPropId) #uselib "CRYPT32.dll" #cfunc global CertEnumCRLContextProperties "CertEnumCRLContextProperties" intptr, int ; res = CertEnumCRLContextProperties(varptr(pCrlContext), dwPropId) ; pCrlContext : CRL_CONTEXT* -> "intptr" ; dwPropId : DWORD -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
crypt32 = windows.NewLazySystemDLL("CRYPT32.dll")
procCertEnumCRLContextProperties = crypt32.NewProc("CertEnumCRLContextProperties")
)
// pCrlContext (CRL_CONTEXT*), dwPropId (DWORD)
r1, _, err := procCertEnumCRLContextProperties.Call(
uintptr(pCrlContext),
uintptr(dwPropId),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction CertEnumCRLContextProperties(
pCrlContext: Pointer; // CRL_CONTEXT*
dwPropId: DWORD // DWORD
): DWORD; stdcall;
external 'CRYPT32.dll' name 'CertEnumCRLContextProperties';result := DllCall("CRYPT32\CertEnumCRLContextProperties"
, "Ptr", pCrlContext ; CRL_CONTEXT*
, "UInt", dwPropId ; DWORD
, "UInt") ; return: DWORD●CertEnumCRLContextProperties(pCrlContext, dwPropId) = DLL("CRYPT32.dll", "dword CertEnumCRLContextProperties(void*, dword)")
# 呼び出し: CertEnumCRLContextProperties(pCrlContext, dwPropId)
# pCrlContext : CRL_CONTEXT* -> "void*"
# dwPropId : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "crypt32" fn CertEnumCRLContextProperties(
pCrlContext: [*c]CRL_CONTEXT, // CRL_CONTEXT*
dwPropId: u32 // DWORD
) callconv(std.os.windows.WINAPI) u32;proc CertEnumCRLContextProperties(
pCrlContext: ptr CRL_CONTEXT, # CRL_CONTEXT*
dwPropId: uint32 # DWORD
): uint32 {.importc: "CertEnumCRLContextProperties", stdcall, dynlib: "CRYPT32.dll".}pragma(lib, "crypt32");
extern(Windows)
uint CertEnumCRLContextProperties(
CRL_CONTEXT* pCrlContext, // CRL_CONTEXT*
uint dwPropId // DWORD
);ccall((:CertEnumCRLContextProperties, "CRYPT32.dll"), stdcall, UInt32,
(Ptr{CRL_CONTEXT}, UInt32),
pCrlContext, dwPropId)
# pCrlContext : CRL_CONTEXT* -> Ptr{CRL_CONTEXT}
# dwPropId : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
uint32_t CertEnumCRLContextProperties(
void* pCrlContext,
uint32_t dwPropId);
]]
local crypt32 = ffi.load("crypt32")
-- crypt32.CertEnumCRLContextProperties(pCrlContext, dwPropId)
-- pCrlContext : CRL_CONTEXT*
-- dwPropId : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('CRYPT32.dll');
const CertEnumCRLContextProperties = lib.func('__stdcall', 'CertEnumCRLContextProperties', 'uint32_t', ['void *', 'uint32_t']);
// CertEnumCRLContextProperties(pCrlContext, dwPropId)
// pCrlContext : CRL_CONTEXT* -> 'void *'
// dwPropId : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("CRYPT32.dll", {
CertEnumCRLContextProperties: { parameters: ["pointer", "u32"], result: "u32" },
});
// lib.symbols.CertEnumCRLContextProperties(pCrlContext, dwPropId)
// pCrlContext : CRL_CONTEXT* -> "pointer"
// dwPropId : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
uint32_t CertEnumCRLContextProperties(
void* pCrlContext,
uint32_t dwPropId);
C, "CRYPT32.dll");
// $ffi->CertEnumCRLContextProperties(pCrlContext, dwPropId);
// pCrlContext : CRL_CONTEXT*
// dwPropId : DWORD
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Crypt32 extends StdCallLibrary {
Crypt32 INSTANCE = Native.load("crypt32", Crypt32.class);
int CertEnumCRLContextProperties(
Pointer pCrlContext, // CRL_CONTEXT*
int dwPropId // DWORD
);
}@[Link("crypt32")]
lib LibCRYPT32
fun CertEnumCRLContextProperties = CertEnumCRLContextProperties(
pCrlContext : CRL_CONTEXT*, # CRL_CONTEXT*
dwPropId : UInt32 # DWORD
) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef CertEnumCRLContextPropertiesNative = Uint32 Function(Pointer<Void>, Uint32);
typedef CertEnumCRLContextPropertiesDart = int Function(Pointer<Void>, int);
final CertEnumCRLContextProperties = DynamicLibrary.open('CRYPT32.dll')
.lookupFunction<CertEnumCRLContextPropertiesNative, CertEnumCRLContextPropertiesDart>('CertEnumCRLContextProperties');
// pCrlContext : CRL_CONTEXT* -> Pointer<Void>
// dwPropId : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function CertEnumCRLContextProperties(
pCrlContext: Pointer; // CRL_CONTEXT*
dwPropId: DWORD // DWORD
): DWORD; stdcall;
external 'CRYPT32.dll' name 'CertEnumCRLContextProperties';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "CertEnumCRLContextProperties"
c_CertEnumCRLContextProperties :: Ptr () -> Word32 -> IO Word32
-- pCrlContext : CRL_CONTEXT* -> Ptr ()
-- dwPropId : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let certenumcrlcontextproperties =
foreign "CertEnumCRLContextProperties"
((ptr void) @-> uint32_t @-> returning uint32_t)
(* pCrlContext : CRL_CONTEXT* -> (ptr void) *)
(* dwPropId : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library crypt32 (t "CRYPT32.dll"))
(cffi:use-foreign-library crypt32)
(cffi:defcfun ("CertEnumCRLContextProperties" cert-enum-crlcontext-properties :convention :stdcall) :uint32
(p-crl-context :pointer) ; CRL_CONTEXT*
(dw-prop-id :uint32)) ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $CertEnumCRLContextProperties = Win32::API::More->new('CRYPT32',
'DWORD CertEnumCRLContextProperties(LPVOID pCrlContext, DWORD dwPropId)');
# my $ret = $CertEnumCRLContextProperties->Call($pCrlContext, $dwPropId);
# pCrlContext : CRL_CONTEXT* -> LPVOID
# dwPropId : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
公式の関連項目
- f CertGetCRLContextProperty — CRLコンテキストの指定プロパティを取得する。
使用する型