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