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