Win32 API 日本語リファレンス
ホームSecurity.Cryptography.UI › CryptUIDlgCertMgr

CryptUIDlgCertMgr

関数
証明書マネージャーのダイアログを表示する。
DLLCRYPTUI.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

// CRYPTUI.dll
#include <windows.h>

BOOL CryptUIDlgCertMgr(
    CRYPTUI_CERT_MGR_STRUCT* pCryptUICertMgr
);

パラメーター

名前方向
pCryptUICertMgrCRYPTUI_CERT_MGR_STRUCT*in

戻り値の型: BOOL

各言語での呼び出し定義

// CRYPTUI.dll
#include <windows.h>

BOOL CryptUIDlgCertMgr(
    CRYPTUI_CERT_MGR_STRUCT* pCryptUICertMgr
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("CRYPTUI.dll", ExactSpelling = true)]
static extern bool CryptUIDlgCertMgr(
    IntPtr pCryptUICertMgr   // CRYPTUI_CERT_MGR_STRUCT*
);
<DllImport("CRYPTUI.dll", ExactSpelling:=True)>
Public Shared Function CryptUIDlgCertMgr(
    pCryptUICertMgr As IntPtr   ' CRYPTUI_CERT_MGR_STRUCT*
) As Boolean
End Function
' pCryptUICertMgr : CRYPTUI_CERT_MGR_STRUCT*
Declare PtrSafe Function CryptUIDlgCertMgr Lib "cryptui" ( _
    ByVal pCryptUICertMgr As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CryptUIDlgCertMgr = ctypes.windll.cryptui.CryptUIDlgCertMgr
CryptUIDlgCertMgr.restype = wintypes.BOOL
CryptUIDlgCertMgr.argtypes = [
    ctypes.c_void_p,  # pCryptUICertMgr : CRYPTUI_CERT_MGR_STRUCT*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('CRYPTUI.dll')
CryptUIDlgCertMgr = Fiddle::Function.new(
  lib['CryptUIDlgCertMgr'],
  [
    Fiddle::TYPE_VOIDP,  # pCryptUICertMgr : CRYPTUI_CERT_MGR_STRUCT*
  ],
  Fiddle::TYPE_INT)
#[link(name = "cryptui")]
extern "system" {
    fn CryptUIDlgCertMgr(
        pCryptUICertMgr: *mut CRYPTUI_CERT_MGR_STRUCT  // CRYPTUI_CERT_MGR_STRUCT*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("CRYPTUI.dll")]
public static extern bool CryptUIDlgCertMgr(IntPtr pCryptUICertMgr);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CRYPTUI_CryptUIDlgCertMgr' -Namespace Win32 -PassThru
# $api::CryptUIDlgCertMgr(pCryptUICertMgr)
#uselib "CRYPTUI.dll"
#func global CryptUIDlgCertMgr "CryptUIDlgCertMgr" sptr
; CryptUIDlgCertMgr varptr(pCryptUICertMgr)   ; 戻り値は stat
; pCryptUICertMgr : CRYPTUI_CERT_MGR_STRUCT* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "CRYPTUI.dll"
#cfunc global CryptUIDlgCertMgr "CryptUIDlgCertMgr" var
; res = CryptUIDlgCertMgr(pCryptUICertMgr)
; pCryptUICertMgr : CRYPTUI_CERT_MGR_STRUCT* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL CryptUIDlgCertMgr(CRYPTUI_CERT_MGR_STRUCT* pCryptUICertMgr)
#uselib "CRYPTUI.dll"
#cfunc global CryptUIDlgCertMgr "CryptUIDlgCertMgr" var
; res = CryptUIDlgCertMgr(pCryptUICertMgr)
; pCryptUICertMgr : CRYPTUI_CERT_MGR_STRUCT* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	cryptui = windows.NewLazySystemDLL("CRYPTUI.dll")
	procCryptUIDlgCertMgr = cryptui.NewProc("CryptUIDlgCertMgr")
)

// pCryptUICertMgr (CRYPTUI_CERT_MGR_STRUCT*)
r1, _, err := procCryptUIDlgCertMgr.Call(
	uintptr(pCryptUICertMgr),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function CryptUIDlgCertMgr(
  pCryptUICertMgr: Pointer   // CRYPTUI_CERT_MGR_STRUCT*
): BOOL; stdcall;
  external 'CRYPTUI.dll' name 'CryptUIDlgCertMgr';
result := DllCall("CRYPTUI\CryptUIDlgCertMgr"
    , "Ptr", pCryptUICertMgr   ; CRYPTUI_CERT_MGR_STRUCT*
    , "Int")   ; return: BOOL
●CryptUIDlgCertMgr(pCryptUICertMgr) = DLL("CRYPTUI.dll", "bool CryptUIDlgCertMgr(void*)")
# 呼び出し: CryptUIDlgCertMgr(pCryptUICertMgr)
# pCryptUICertMgr : CRYPTUI_CERT_MGR_STRUCT* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。