ホーム › Security.Cryptography › CertEnumPhysicalStore
CertEnumPhysicalStore
関数システムストアに属する物理ストアを列挙する。
シグネチャ
// CRYPT32.dll
#include <windows.h>
BOOL CertEnumPhysicalStore(
const void* pvSystemStore,
DWORD dwFlags,
void* pvArg, // optional
PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pvSystemStore | void* | in |
| dwFlags | DWORD | in |
| pvArg | void* | inoutoptional |
| pfnEnum | PFN_CERT_ENUM_PHYSICAL_STORE | in |
戻り値の型: BOOL
各言語での呼び出し定義
// CRYPT32.dll
#include <windows.h>
BOOL CertEnumPhysicalStore(
const void* pvSystemStore,
DWORD dwFlags,
void* pvArg, // optional
PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("CRYPT32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool CertEnumPhysicalStore(
IntPtr pvSystemStore, // void*
uint dwFlags, // DWORD
IntPtr pvArg, // void* optional, in/out
IntPtr pfnEnum // PFN_CERT_ENUM_PHYSICAL_STORE
);<DllImport("CRYPT32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function CertEnumPhysicalStore(
pvSystemStore As IntPtr, ' void*
dwFlags As UInteger, ' DWORD
pvArg As IntPtr, ' void* optional, in/out
pfnEnum As IntPtr ' PFN_CERT_ENUM_PHYSICAL_STORE
) As Boolean
End Function' pvSystemStore : void*
' dwFlags : DWORD
' pvArg : void* optional, in/out
' pfnEnum : PFN_CERT_ENUM_PHYSICAL_STORE
Declare PtrSafe Function CertEnumPhysicalStore Lib "crypt32" ( _
ByVal pvSystemStore As LongPtr, _
ByVal dwFlags As Long, _
ByVal pvArg As LongPtr, _
ByVal pfnEnum As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CertEnumPhysicalStore = ctypes.windll.crypt32.CertEnumPhysicalStore
CertEnumPhysicalStore.restype = wintypes.BOOL
CertEnumPhysicalStore.argtypes = [
ctypes.POINTER(None), # pvSystemStore : void*
wintypes.DWORD, # dwFlags : DWORD
ctypes.POINTER(None), # pvArg : void* optional, in/out
ctypes.c_void_p, # pfnEnum : PFN_CERT_ENUM_PHYSICAL_STORE
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('CRYPT32.dll')
CertEnumPhysicalStore = Fiddle::Function.new(
lib['CertEnumPhysicalStore'],
[
Fiddle::TYPE_VOIDP, # pvSystemStore : void*
-Fiddle::TYPE_INT, # dwFlags : DWORD
Fiddle::TYPE_VOIDP, # pvArg : void* optional, in/out
Fiddle::TYPE_VOIDP, # pfnEnum : PFN_CERT_ENUM_PHYSICAL_STORE
],
Fiddle::TYPE_INT)#[link(name = "crypt32")]
extern "system" {
fn CertEnumPhysicalStore(
pvSystemStore: *const (), // void*
dwFlags: u32, // DWORD
pvArg: *mut (), // void* optional, in/out
pfnEnum: *const core::ffi::c_void // PFN_CERT_ENUM_PHYSICAL_STORE
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("CRYPT32.dll", SetLastError = true)]
public static extern bool CertEnumPhysicalStore(IntPtr pvSystemStore, uint dwFlags, IntPtr pvArg, IntPtr pfnEnum);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CRYPT32_CertEnumPhysicalStore' -Namespace Win32 -PassThru
# $api::CertEnumPhysicalStore(pvSystemStore, dwFlags, pvArg, pfnEnum)#uselib "CRYPT32.dll"
#func global CertEnumPhysicalStore "CertEnumPhysicalStore" sptr, sptr, sptr, sptr
; CertEnumPhysicalStore pvSystemStore, dwFlags, pvArg, pfnEnum ; 戻り値は stat
; pvSystemStore : void* -> "sptr"
; dwFlags : DWORD -> "sptr"
; pvArg : void* optional, in/out -> "sptr"
; pfnEnum : PFN_CERT_ENUM_PHYSICAL_STORE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "CRYPT32.dll"
#cfunc global CertEnumPhysicalStore "CertEnumPhysicalStore" sptr, int, sptr, sptr
; res = CertEnumPhysicalStore(pvSystemStore, dwFlags, pvArg, pfnEnum)
; pvSystemStore : void* -> "sptr"
; dwFlags : DWORD -> "int"
; pvArg : void* optional, in/out -> "sptr"
; pfnEnum : PFN_CERT_ENUM_PHYSICAL_STORE -> "sptr"; BOOL CertEnumPhysicalStore(void* pvSystemStore, DWORD dwFlags, void* pvArg, PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum)
#uselib "CRYPT32.dll"
#cfunc global CertEnumPhysicalStore "CertEnumPhysicalStore" intptr, int, intptr, intptr
; res = CertEnumPhysicalStore(pvSystemStore, dwFlags, pvArg, pfnEnum)
; pvSystemStore : void* -> "intptr"
; dwFlags : DWORD -> "int"
; pvArg : void* optional, in/out -> "intptr"
; pfnEnum : PFN_CERT_ENUM_PHYSICAL_STORE -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
crypt32 = windows.NewLazySystemDLL("CRYPT32.dll")
procCertEnumPhysicalStore = crypt32.NewProc("CertEnumPhysicalStore")
)
// pvSystemStore (void*), dwFlags (DWORD), pvArg (void* optional, in/out), pfnEnum (PFN_CERT_ENUM_PHYSICAL_STORE)
r1, _, err := procCertEnumPhysicalStore.Call(
uintptr(pvSystemStore),
uintptr(dwFlags),
uintptr(pvArg),
uintptr(pfnEnum),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction CertEnumPhysicalStore(
pvSystemStore: Pointer; // void*
dwFlags: DWORD; // DWORD
pvArg: Pointer; // void* optional, in/out
pfnEnum: Pointer // PFN_CERT_ENUM_PHYSICAL_STORE
): BOOL; stdcall;
external 'CRYPT32.dll' name 'CertEnumPhysicalStore';result := DllCall("CRYPT32\CertEnumPhysicalStore"
, "Ptr", pvSystemStore ; void*
, "UInt", dwFlags ; DWORD
, "Ptr", pvArg ; void* optional, in/out
, "Ptr", pfnEnum ; PFN_CERT_ENUM_PHYSICAL_STORE
, "Int") ; return: BOOL●CertEnumPhysicalStore(pvSystemStore, dwFlags, pvArg, pfnEnum) = DLL("CRYPT32.dll", "bool CertEnumPhysicalStore(void*, dword, void*, void*)")
# 呼び出し: CertEnumPhysicalStore(pvSystemStore, dwFlags, pvArg, pfnEnum)
# pvSystemStore : void* -> "void*"
# dwFlags : DWORD -> "dword"
# pvArg : void* optional, in/out -> "void*"
# pfnEnum : PFN_CERT_ENUM_PHYSICAL_STORE -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。