ホーム › Security.Cryptography › BCryptRegisterConfigChangeNotify
BCryptRegisterConfigChangeNotify
関数CNG構成変更の通知を受け取るイベントを登録する。
シグネチャ
// bcrypt.dll
#include <windows.h>
NTSTATUS BCryptRegisterConfigChangeNotify(
HANDLE* phEvent
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| phEvent | HANDLE* | out |
戻り値の型: NTSTATUS
各言語での呼び出し定義
// bcrypt.dll
#include <windows.h>
NTSTATUS BCryptRegisterConfigChangeNotify(
HANDLE* phEvent
);[DllImport("bcrypt.dll", ExactSpelling = true)]
static extern int BCryptRegisterConfigChangeNotify(
IntPtr phEvent // HANDLE* out
);<DllImport("bcrypt.dll", ExactSpelling:=True)>
Public Shared Function BCryptRegisterConfigChangeNotify(
phEvent As IntPtr ' HANDLE* out
) As Integer
End Function' phEvent : HANDLE* out
Declare PtrSafe Function BCryptRegisterConfigChangeNotify Lib "bcrypt" ( _
ByVal phEvent As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
BCryptRegisterConfigChangeNotify = ctypes.windll.bcrypt.BCryptRegisterConfigChangeNotify
BCryptRegisterConfigChangeNotify.restype = ctypes.c_int
BCryptRegisterConfigChangeNotify.argtypes = [
ctypes.c_void_p, # phEvent : HANDLE* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('bcrypt.dll')
BCryptRegisterConfigChangeNotify = Fiddle::Function.new(
lib['BCryptRegisterConfigChangeNotify'],
[
Fiddle::TYPE_VOIDP, # phEvent : HANDLE* out
],
Fiddle::TYPE_INT)#[link(name = "bcrypt")]
extern "system" {
fn BCryptRegisterConfigChangeNotify(
phEvent: *mut *mut core::ffi::c_void // HANDLE* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("bcrypt.dll")]
public static extern int BCryptRegisterConfigChangeNotify(IntPtr phEvent);
"@
$api = Add-Type -MemberDefinition $sig -Name 'bcrypt_BCryptRegisterConfigChangeNotify' -Namespace Win32 -PassThru
# $api::BCryptRegisterConfigChangeNotify(phEvent)#uselib "bcrypt.dll"
#func global BCryptRegisterConfigChangeNotify "BCryptRegisterConfigChangeNotify" sptr
; BCryptRegisterConfigChangeNotify phEvent ; 戻り値は stat
; phEvent : HANDLE* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "bcrypt.dll"
#cfunc global BCryptRegisterConfigChangeNotify "BCryptRegisterConfigChangeNotify" sptr
; res = BCryptRegisterConfigChangeNotify(phEvent)
; phEvent : HANDLE* out -> "sptr"; NTSTATUS BCryptRegisterConfigChangeNotify(HANDLE* phEvent)
#uselib "bcrypt.dll"
#cfunc global BCryptRegisterConfigChangeNotify "BCryptRegisterConfigChangeNotify" intptr
; res = BCryptRegisterConfigChangeNotify(phEvent)
; phEvent : HANDLE* out -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
bcrypt = windows.NewLazySystemDLL("bcrypt.dll")
procBCryptRegisterConfigChangeNotify = bcrypt.NewProc("BCryptRegisterConfigChangeNotify")
)
// phEvent (HANDLE* out)
r1, _, err := procBCryptRegisterConfigChangeNotify.Call(
uintptr(phEvent),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // NTSTATUSfunction BCryptRegisterConfigChangeNotify(
phEvent: Pointer // HANDLE* out
): Integer; stdcall;
external 'bcrypt.dll' name 'BCryptRegisterConfigChangeNotify';result := DllCall("bcrypt\BCryptRegisterConfigChangeNotify"
, "Ptr", phEvent ; HANDLE* out
, "Int") ; return: NTSTATUS●BCryptRegisterConfigChangeNotify(phEvent) = DLL("bcrypt.dll", "int BCryptRegisterConfigChangeNotify(void*)")
# 呼び出し: BCryptRegisterConfigChangeNotify(phEvent)
# phEvent : HANDLE* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。