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