ホーム › Security.Cryptography › CertDeleteCTLFromStore
CertDeleteCTLFromStore
関数CTLをストアから削除する。
シグネチャ
// CRYPT32.dll
#include <windows.h>
BOOL CertDeleteCTLFromStore(
CTL_CONTEXT* pCtlContext
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pCtlContext | CTL_CONTEXT* | in |
戻り値の型: BOOL
各言語での呼び出し定義
// CRYPT32.dll
#include <windows.h>
BOOL CertDeleteCTLFromStore(
CTL_CONTEXT* pCtlContext
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("CRYPT32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool CertDeleteCTLFromStore(
IntPtr pCtlContext // CTL_CONTEXT*
);<DllImport("CRYPT32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function CertDeleteCTLFromStore(
pCtlContext As IntPtr ' CTL_CONTEXT*
) As Boolean
End Function' pCtlContext : CTL_CONTEXT*
Declare PtrSafe Function CertDeleteCTLFromStore Lib "crypt32" ( _
ByVal pCtlContext As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CertDeleteCTLFromStore = ctypes.windll.crypt32.CertDeleteCTLFromStore
CertDeleteCTLFromStore.restype = wintypes.BOOL
CertDeleteCTLFromStore.argtypes = [
ctypes.c_void_p, # pCtlContext : CTL_CONTEXT*
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('CRYPT32.dll')
CertDeleteCTLFromStore = Fiddle::Function.new(
lib['CertDeleteCTLFromStore'],
[
Fiddle::TYPE_VOIDP, # pCtlContext : CTL_CONTEXT*
],
Fiddle::TYPE_INT)#[link(name = "crypt32")]
extern "system" {
fn CertDeleteCTLFromStore(
pCtlContext: *mut CTL_CONTEXT // CTL_CONTEXT*
) -> 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 CertDeleteCTLFromStore(IntPtr pCtlContext);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CRYPT32_CertDeleteCTLFromStore' -Namespace Win32 -PassThru
# $api::CertDeleteCTLFromStore(pCtlContext)#uselib "CRYPT32.dll"
#func global CertDeleteCTLFromStore "CertDeleteCTLFromStore" sptr
; CertDeleteCTLFromStore varptr(pCtlContext) ; 戻り値は stat
; pCtlContext : CTL_CONTEXT* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "CRYPT32.dll" #cfunc global CertDeleteCTLFromStore "CertDeleteCTLFromStore" var ; res = CertDeleteCTLFromStore(pCtlContext) ; pCtlContext : CTL_CONTEXT* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "CRYPT32.dll" #cfunc global CertDeleteCTLFromStore "CertDeleteCTLFromStore" sptr ; res = CertDeleteCTLFromStore(varptr(pCtlContext)) ; pCtlContext : CTL_CONTEXT* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL CertDeleteCTLFromStore(CTL_CONTEXT* pCtlContext) #uselib "CRYPT32.dll" #cfunc global CertDeleteCTLFromStore "CertDeleteCTLFromStore" var ; res = CertDeleteCTLFromStore(pCtlContext) ; pCtlContext : CTL_CONTEXT* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL CertDeleteCTLFromStore(CTL_CONTEXT* pCtlContext) #uselib "CRYPT32.dll" #cfunc global CertDeleteCTLFromStore "CertDeleteCTLFromStore" intptr ; res = CertDeleteCTLFromStore(varptr(pCtlContext)) ; pCtlContext : CTL_CONTEXT* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
crypt32 = windows.NewLazySystemDLL("CRYPT32.dll")
procCertDeleteCTLFromStore = crypt32.NewProc("CertDeleteCTLFromStore")
)
// pCtlContext (CTL_CONTEXT*)
r1, _, err := procCertDeleteCTLFromStore.Call(
uintptr(pCtlContext),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction CertDeleteCTLFromStore(
pCtlContext: Pointer // CTL_CONTEXT*
): BOOL; stdcall;
external 'CRYPT32.dll' name 'CertDeleteCTLFromStore';result := DllCall("CRYPT32\CertDeleteCTLFromStore"
, "Ptr", pCtlContext ; CTL_CONTEXT*
, "Int") ; return: BOOL●CertDeleteCTLFromStore(pCtlContext) = DLL("CRYPT32.dll", "bool CertDeleteCTLFromStore(void*)")
# 呼び出し: CertDeleteCTLFromStore(pCtlContext)
# pCtlContext : CTL_CONTEXT* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。