ホーム › Security.Cryptography.Catalog › CryptCATAdminAcquireContext2
CryptCATAdminAcquireContext2
関数ハッシュアルゴリズムや署名ポリシーを指定してカタログ管理コンテキストを取得する。
シグネチャ
// WINTRUST.dll
#include <windows.h>
BOOL CryptCATAdminAcquireContext2(
INT_PTR* phCatAdmin,
const GUID* pgSubsystem, // optional
LPCWSTR pwszHashAlgorithm, // optional
CERT_STRONG_SIGN_PARA* pStrongHashPolicy, // optional
DWORD dwFlags // optional
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| phCatAdmin | INT_PTR* | out | 取得したカタログ管理コンテキストハンドルを受け取る出力ポインタ。 |
| pgSubsystem | GUID* | inoptional | 対象サブシステムを示すGUIDへのポインタ。NULLで既定を使用する。 |
| pwszHashAlgorithm | LPCWSTR | inoptional | 使用するハッシュアルゴリズム名(例: SHA256)。NULL終端のワイド文字列。NULL可。 |
| pStrongHashPolicy | CERT_STRONG_SIGN_PARA* | inoptional | 強力署名ポリシーを指定するCERT_STRONG_SIGN_PARA構造体へのポインタ。NULL可。 |
| dwFlags | DWORD | optional | 予約済みフラグ。通常は0を指定する。 |
戻り値の型: BOOL
各言語での呼び出し定義
// WINTRUST.dll
#include <windows.h>
BOOL CryptCATAdminAcquireContext2(
INT_PTR* phCatAdmin,
const GUID* pgSubsystem, // optional
LPCWSTR pwszHashAlgorithm, // optional
CERT_STRONG_SIGN_PARA* pStrongHashPolicy, // optional
DWORD dwFlags // optional
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WINTRUST.dll", SetLastError = true, ExactSpelling = true)]
static extern bool CryptCATAdminAcquireContext2(
out IntPtr phCatAdmin, // INT_PTR* out
IntPtr pgSubsystem, // GUID* optional
[MarshalAs(UnmanagedType.LPWStr)] string pwszHashAlgorithm, // LPCWSTR optional
IntPtr pStrongHashPolicy, // CERT_STRONG_SIGN_PARA* optional
uint dwFlags // DWORD optional
);<DllImport("WINTRUST.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function CryptCATAdminAcquireContext2(
<Out> ByRef phCatAdmin As IntPtr, ' INT_PTR* out
pgSubsystem As IntPtr, ' GUID* optional
<MarshalAs(UnmanagedType.LPWStr)> pwszHashAlgorithm As String, ' LPCWSTR optional
pStrongHashPolicy As IntPtr, ' CERT_STRONG_SIGN_PARA* optional
dwFlags As UInteger ' DWORD optional
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function' phCatAdmin : INT_PTR* out
' pgSubsystem : GUID* optional
' pwszHashAlgorithm : LPCWSTR optional
' pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional
' dwFlags : DWORD optional
Declare PtrSafe Function CryptCATAdminAcquireContext2 Lib "wintrust" ( _
ByRef phCatAdmin As LongPtr, _
ByVal pgSubsystem As LongPtr, _
ByVal pwszHashAlgorithm As LongPtr, _
ByVal pStrongHashPolicy As LongPtr, _
ByVal dwFlags As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CryptCATAdminAcquireContext2 = ctypes.windll.wintrust.CryptCATAdminAcquireContext2
CryptCATAdminAcquireContext2.restype = wintypes.BOOL
CryptCATAdminAcquireContext2.argtypes = [
ctypes.POINTER(ctypes.c_ssize_t), # phCatAdmin : INT_PTR* out
ctypes.c_void_p, # pgSubsystem : GUID* optional
wintypes.LPCWSTR, # pwszHashAlgorithm : LPCWSTR optional
ctypes.c_void_p, # pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional
wintypes.DWORD, # dwFlags : DWORD optional
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WINTRUST.dll')
CryptCATAdminAcquireContext2 = Fiddle::Function.new(
lib['CryptCATAdminAcquireContext2'],
[
Fiddle::TYPE_VOIDP, # phCatAdmin : INT_PTR* out
Fiddle::TYPE_VOIDP, # pgSubsystem : GUID* optional
Fiddle::TYPE_VOIDP, # pwszHashAlgorithm : LPCWSTR optional
Fiddle::TYPE_VOIDP, # pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional
-Fiddle::TYPE_INT, # dwFlags : DWORD optional
],
Fiddle::TYPE_INT)#[link(name = "wintrust")]
extern "system" {
fn CryptCATAdminAcquireContext2(
phCatAdmin: *mut isize, // INT_PTR* out
pgSubsystem: *const GUID, // GUID* optional
pwszHashAlgorithm: *const u16, // LPCWSTR optional
pStrongHashPolicy: *mut CERT_STRONG_SIGN_PARA, // CERT_STRONG_SIGN_PARA* optional
dwFlags: u32 // DWORD optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WINTRUST.dll", SetLastError = true)]
public static extern bool CryptCATAdminAcquireContext2(out IntPtr phCatAdmin, IntPtr pgSubsystem, [MarshalAs(UnmanagedType.LPWStr)] string pwszHashAlgorithm, IntPtr pStrongHashPolicy, uint dwFlags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WINTRUST_CryptCATAdminAcquireContext2' -Namespace Win32 -PassThru
# $api::CryptCATAdminAcquireContext2(phCatAdmin, pgSubsystem, pwszHashAlgorithm, pStrongHashPolicy, dwFlags)#uselib "WINTRUST.dll"
#func global CryptCATAdminAcquireContext2 "CryptCATAdminAcquireContext2" sptr, sptr, sptr, sptr, sptr
; CryptCATAdminAcquireContext2 varptr(phCatAdmin), varptr(pgSubsystem), pwszHashAlgorithm, varptr(pStrongHashPolicy), dwFlags ; 戻り値は stat
; phCatAdmin : INT_PTR* out -> "sptr"
; pgSubsystem : GUID* optional -> "sptr"
; pwszHashAlgorithm : LPCWSTR optional -> "sptr"
; pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> "sptr"
; dwFlags : DWORD optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WINTRUST.dll" #cfunc global CryptCATAdminAcquireContext2 "CryptCATAdminAcquireContext2" var, var, wstr, var, int ; res = CryptCATAdminAcquireContext2(phCatAdmin, pgSubsystem, pwszHashAlgorithm, pStrongHashPolicy, dwFlags) ; phCatAdmin : INT_PTR* out -> "var" ; pgSubsystem : GUID* optional -> "var" ; pwszHashAlgorithm : LPCWSTR optional -> "wstr" ; pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> "var" ; dwFlags : DWORD optional -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WINTRUST.dll" #cfunc global CryptCATAdminAcquireContext2 "CryptCATAdminAcquireContext2" sptr, sptr, wstr, sptr, int ; res = CryptCATAdminAcquireContext2(varptr(phCatAdmin), varptr(pgSubsystem), pwszHashAlgorithm, varptr(pStrongHashPolicy), dwFlags) ; phCatAdmin : INT_PTR* out -> "sptr" ; pgSubsystem : GUID* optional -> "sptr" ; pwszHashAlgorithm : LPCWSTR optional -> "wstr" ; pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> "sptr" ; dwFlags : DWORD optional -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL CryptCATAdminAcquireContext2(INT_PTR* phCatAdmin, GUID* pgSubsystem, LPCWSTR pwszHashAlgorithm, CERT_STRONG_SIGN_PARA* pStrongHashPolicy, DWORD dwFlags) #uselib "WINTRUST.dll" #cfunc global CryptCATAdminAcquireContext2 "CryptCATAdminAcquireContext2" var, var, wstr, var, int ; res = CryptCATAdminAcquireContext2(phCatAdmin, pgSubsystem, pwszHashAlgorithm, pStrongHashPolicy, dwFlags) ; phCatAdmin : INT_PTR* out -> "var" ; pgSubsystem : GUID* optional -> "var" ; pwszHashAlgorithm : LPCWSTR optional -> "wstr" ; pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> "var" ; dwFlags : DWORD optional -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL CryptCATAdminAcquireContext2(INT_PTR* phCatAdmin, GUID* pgSubsystem, LPCWSTR pwszHashAlgorithm, CERT_STRONG_SIGN_PARA* pStrongHashPolicy, DWORD dwFlags) #uselib "WINTRUST.dll" #cfunc global CryptCATAdminAcquireContext2 "CryptCATAdminAcquireContext2" intptr, intptr, wstr, intptr, int ; res = CryptCATAdminAcquireContext2(varptr(phCatAdmin), varptr(pgSubsystem), pwszHashAlgorithm, varptr(pStrongHashPolicy), dwFlags) ; phCatAdmin : INT_PTR* out -> "intptr" ; pgSubsystem : GUID* optional -> "intptr" ; pwszHashAlgorithm : LPCWSTR optional -> "wstr" ; pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> "intptr" ; dwFlags : DWORD optional -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wintrust = windows.NewLazySystemDLL("WINTRUST.dll")
procCryptCATAdminAcquireContext2 = wintrust.NewProc("CryptCATAdminAcquireContext2")
)
// phCatAdmin (INT_PTR* out), pgSubsystem (GUID* optional), pwszHashAlgorithm (LPCWSTR optional), pStrongHashPolicy (CERT_STRONG_SIGN_PARA* optional), dwFlags (DWORD optional)
r1, _, err := procCryptCATAdminAcquireContext2.Call(
uintptr(phCatAdmin),
uintptr(pgSubsystem),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pwszHashAlgorithm))),
uintptr(pStrongHashPolicy),
uintptr(dwFlags),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction CryptCATAdminAcquireContext2(
phCatAdmin: Pointer; // INT_PTR* out
pgSubsystem: PGUID; // GUID* optional
pwszHashAlgorithm: PWideChar; // LPCWSTR optional
pStrongHashPolicy: Pointer; // CERT_STRONG_SIGN_PARA* optional
dwFlags: DWORD // DWORD optional
): BOOL; stdcall;
external 'WINTRUST.dll' name 'CryptCATAdminAcquireContext2';result := DllCall("WINTRUST\CryptCATAdminAcquireContext2"
, "Ptr", phCatAdmin ; INT_PTR* out
, "Ptr", pgSubsystem ; GUID* optional
, "WStr", pwszHashAlgorithm ; LPCWSTR optional
, "Ptr", pStrongHashPolicy ; CERT_STRONG_SIGN_PARA* optional
, "UInt", dwFlags ; DWORD optional
, "Int") ; return: BOOL●CryptCATAdminAcquireContext2(phCatAdmin, pgSubsystem, pwszHashAlgorithm, pStrongHashPolicy, dwFlags) = DLL("WINTRUST.dll", "bool CryptCATAdminAcquireContext2(void*, void*, char*, void*, dword)")
# 呼び出し: CryptCATAdminAcquireContext2(phCatAdmin, pgSubsystem, pwszHashAlgorithm, pStrongHashPolicy, dwFlags)
# phCatAdmin : INT_PTR* out -> "void*"
# pgSubsystem : GUID* optional -> "void*"
# pwszHashAlgorithm : LPCWSTR optional -> "char*"
# pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> "void*"
# dwFlags : DWORD optional -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "wintrust" fn CryptCATAdminAcquireContext2(
phCatAdmin: [*c]isize, // INT_PTR* out
pgSubsystem: [*c]GUID, // GUID* optional
pwszHashAlgorithm: [*c]const u16, // LPCWSTR optional
pStrongHashPolicy: [*c]CERT_STRONG_SIGN_PARA, // CERT_STRONG_SIGN_PARA* optional
dwFlags: u32 // DWORD optional
) callconv(std.os.windows.WINAPI) i32;proc CryptCATAdminAcquireContext2(
phCatAdmin: ptr int, # INT_PTR* out
pgSubsystem: ptr GUID, # GUID* optional
pwszHashAlgorithm: WideCString, # LPCWSTR optional
pStrongHashPolicy: ptr CERT_STRONG_SIGN_PARA, # CERT_STRONG_SIGN_PARA* optional
dwFlags: uint32 # DWORD optional
): int32 {.importc: "CryptCATAdminAcquireContext2", stdcall, dynlib: "WINTRUST.dll".}pragma(lib, "wintrust");
extern(Windows)
int CryptCATAdminAcquireContext2(
ptrdiff_t* phCatAdmin, // INT_PTR* out
GUID* pgSubsystem, // GUID* optional
const(wchar)* pwszHashAlgorithm, // LPCWSTR optional
CERT_STRONG_SIGN_PARA* pStrongHashPolicy, // CERT_STRONG_SIGN_PARA* optional
uint dwFlags // DWORD optional
);ccall((:CryptCATAdminAcquireContext2, "WINTRUST.dll"), stdcall, Int32,
(Ptr{Int}, Ptr{GUID}, Cwstring, Ptr{CERT_STRONG_SIGN_PARA}, UInt32),
phCatAdmin, pgSubsystem, pwszHashAlgorithm, pStrongHashPolicy, dwFlags)
# phCatAdmin : INT_PTR* out -> Ptr{Int}
# pgSubsystem : GUID* optional -> Ptr{GUID}
# pwszHashAlgorithm : LPCWSTR optional -> Cwstring
# pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> Ptr{CERT_STRONG_SIGN_PARA}
# dwFlags : DWORD optional -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t CryptCATAdminAcquireContext2(
intptr_t* phCatAdmin,
void* pgSubsystem,
const uint16_t* pwszHashAlgorithm,
void* pStrongHashPolicy,
uint32_t dwFlags);
]]
local wintrust = ffi.load("wintrust")
-- wintrust.CryptCATAdminAcquireContext2(phCatAdmin, pgSubsystem, pwszHashAlgorithm, pStrongHashPolicy, dwFlags)
-- phCatAdmin : INT_PTR* out
-- pgSubsystem : GUID* optional
-- pwszHashAlgorithm : LPCWSTR optional
-- pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional
-- dwFlags : DWORD optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('WINTRUST.dll');
const CryptCATAdminAcquireContext2 = lib.func('__stdcall', 'CryptCATAdminAcquireContext2', 'int32_t', ['intptr_t *', 'void *', 'str16', 'void *', 'uint32_t']);
// CryptCATAdminAcquireContext2(phCatAdmin, pgSubsystem, pwszHashAlgorithm, pStrongHashPolicy, dwFlags)
// phCatAdmin : INT_PTR* out -> 'intptr_t *'
// pgSubsystem : GUID* optional -> 'void *'
// pwszHashAlgorithm : LPCWSTR optional -> 'str16'
// pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> 'void *'
// dwFlags : DWORD optional -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("WINTRUST.dll", {
CryptCATAdminAcquireContext2: { parameters: ["pointer", "pointer", "buffer", "pointer", "u32"], result: "i32" },
});
// lib.symbols.CryptCATAdminAcquireContext2(phCatAdmin, pgSubsystem, pwszHashAlgorithm, pStrongHashPolicy, dwFlags)
// phCatAdmin : INT_PTR* out -> "pointer"
// pgSubsystem : GUID* optional -> "pointer"
// pwszHashAlgorithm : LPCWSTR optional -> "buffer"
// pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> "pointer"
// dwFlags : DWORD optional -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t CryptCATAdminAcquireContext2(
intptr_t* phCatAdmin,
void* pgSubsystem,
const uint16_t* pwszHashAlgorithm,
void* pStrongHashPolicy,
uint32_t dwFlags);
C, "WINTRUST.dll");
// $ffi->CryptCATAdminAcquireContext2(phCatAdmin, pgSubsystem, pwszHashAlgorithm, pStrongHashPolicy, dwFlags);
// phCatAdmin : INT_PTR* out
// pgSubsystem : GUID* optional
// pwszHashAlgorithm : LPCWSTR optional
// pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional
// dwFlags : DWORD optional
// 構造体/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 Wintrust extends StdCallLibrary {
Wintrust INSTANCE = Native.load("wintrust", Wintrust.class);
boolean CryptCATAdminAcquireContext2(
LongByReference phCatAdmin, // INT_PTR* out
Pointer pgSubsystem, // GUID* optional
WString pwszHashAlgorithm, // LPCWSTR optional
Pointer pStrongHashPolicy, // CERT_STRONG_SIGN_PARA* optional
int dwFlags // DWORD optional
);
}@[Link("wintrust")]
lib LibWINTRUST
fun CryptCATAdminAcquireContext2 = CryptCATAdminAcquireContext2(
phCatAdmin : LibC::SSizeT*, # INT_PTR* out
pgSubsystem : GUID*, # GUID* optional
pwszHashAlgorithm : UInt16*, # LPCWSTR optional
pStrongHashPolicy : CERT_STRONG_SIGN_PARA*, # CERT_STRONG_SIGN_PARA* optional
dwFlags : UInt32 # DWORD optional
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef CryptCATAdminAcquireContext2Native = Int32 Function(Pointer<IntPtr>, Pointer<Void>, Pointer<Utf16>, Pointer<Void>, Uint32);
typedef CryptCATAdminAcquireContext2Dart = int Function(Pointer<IntPtr>, Pointer<Void>, Pointer<Utf16>, Pointer<Void>, int);
final CryptCATAdminAcquireContext2 = DynamicLibrary.open('WINTRUST.dll')
.lookupFunction<CryptCATAdminAcquireContext2Native, CryptCATAdminAcquireContext2Dart>('CryptCATAdminAcquireContext2');
// phCatAdmin : INT_PTR* out -> Pointer<IntPtr>
// pgSubsystem : GUID* optional -> Pointer<Void>
// pwszHashAlgorithm : LPCWSTR optional -> Pointer<Utf16>
// pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> Pointer<Void>
// dwFlags : DWORD optional -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function CryptCATAdminAcquireContext2(
phCatAdmin: Pointer; // INT_PTR* out
pgSubsystem: PGUID; // GUID* optional
pwszHashAlgorithm: PWideChar; // LPCWSTR optional
pStrongHashPolicy: Pointer; // CERT_STRONG_SIGN_PARA* optional
dwFlags: DWORD // DWORD optional
): BOOL; stdcall;
external 'WINTRUST.dll' name 'CryptCATAdminAcquireContext2';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "CryptCATAdminAcquireContext2"
c_CryptCATAdminAcquireContext2 :: Ptr CIntPtr -> Ptr () -> CWString -> Ptr () -> Word32 -> IO CInt
-- phCatAdmin : INT_PTR* out -> Ptr CIntPtr
-- pgSubsystem : GUID* optional -> Ptr ()
-- pwszHashAlgorithm : LPCWSTR optional -> CWString
-- pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> Ptr ()
-- dwFlags : DWORD optional -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let cryptcatadminacquirecontext2 =
foreign "CryptCATAdminAcquireContext2"
((ptr intptr_t) @-> (ptr void) @-> (ptr uint16_t) @-> (ptr void) @-> uint32_t @-> returning int32_t)
(* phCatAdmin : INT_PTR* out -> (ptr intptr_t) *)
(* pgSubsystem : GUID* optional -> (ptr void) *)
(* pwszHashAlgorithm : LPCWSTR optional -> (ptr uint16_t) *)
(* pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> (ptr void) *)
(* dwFlags : DWORD optional -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library wintrust (t "WINTRUST.dll"))
(cffi:use-foreign-library wintrust)
(cffi:defcfun ("CryptCATAdminAcquireContext2" crypt-catadmin-acquire-context2 :convention :stdcall) :int32
(ph-cat-admin :pointer) ; INT_PTR* out
(pg-subsystem :pointer) ; GUID* optional
(pwsz-hash-algorithm (:string :encoding :utf-16le)) ; LPCWSTR optional
(p-strong-hash-policy :pointer) ; CERT_STRONG_SIGN_PARA* optional
(dw-flags :uint32)) ; DWORD optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $CryptCATAdminAcquireContext2 = Win32::API::More->new('WINTRUST',
'BOOL CryptCATAdminAcquireContext2(LPVOID phCatAdmin, LPVOID pgSubsystem, LPCWSTR pwszHashAlgorithm, LPVOID pStrongHashPolicy, DWORD dwFlags)');
# my $ret = $CryptCATAdminAcquireContext2->Call($phCatAdmin, $pgSubsystem, $pwszHashAlgorithm, $pStrongHashPolicy, $dwFlags);
# phCatAdmin : INT_PTR* out -> LPVOID
# pgSubsystem : GUID* optional -> LPVOID
# pwszHashAlgorithm : LPCWSTR optional -> LPCWSTR
# pStrongHashPolicy : CERT_STRONG_SIGN_PARA* optional -> LPVOID
# dwFlags : DWORD optional -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
類似 API
- f CryptCATAdminAcquireContext — 指定サブシステムのカタログ管理コンテキストハンドルを取得する。