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

PFXIsPFXBlob

関数
指定したBLOBがPFX形式かどうかを判定する。
DLLCRYPT32.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

BOOL PFXIsPFXBlob(
    CRYPT_INTEGER_BLOB* pPFX
);

パラメーター

名前方向
pPFXCRYPT_INTEGER_BLOB*in

戻り値の型: BOOL

各言語での呼び出し定義

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

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

PFXIsPFXBlob = ctypes.windll.crypt32.PFXIsPFXBlob
PFXIsPFXBlob.restype = wintypes.BOOL
PFXIsPFXBlob.argtypes = [
    ctypes.c_void_p,  # pPFX : CRYPT_INTEGER_BLOB*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	crypt32 = windows.NewLazySystemDLL("CRYPT32.dll")
	procPFXIsPFXBlob = crypt32.NewProc("PFXIsPFXBlob")
)

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