Win32 API 日本語リファレンス
ホームSystem.Memory › RemoveSecureMemoryCacheCallback

RemoveSecureMemoryCacheCallback

関数
登録済みのセキュアメモリキャッシュコールバックを削除する。
DLLKERNEL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// KERNEL32.dll
#include <windows.h>

BOOL RemoveSecureMemoryCacheCallback(
    PSECURE_MEMORY_CACHE_CALLBACK pfnCallBack
);

パラメーター

名前方向
pfnCallBackPSECURE_MEMORY_CACHE_CALLBACKin

戻り値の型: BOOL

各言語での呼び出し定義

// KERNEL32.dll
#include <windows.h>

BOOL RemoveSecureMemoryCacheCallback(
    PSECURE_MEMORY_CACHE_CALLBACK pfnCallBack
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("KERNEL32.dll", ExactSpelling = true)]
static extern bool RemoveSecureMemoryCacheCallback(
    IntPtr pfnCallBack   // PSECURE_MEMORY_CACHE_CALLBACK
);
<DllImport("KERNEL32.dll", ExactSpelling:=True)>
Public Shared Function RemoveSecureMemoryCacheCallback(
    pfnCallBack As IntPtr   ' PSECURE_MEMORY_CACHE_CALLBACK
) As Boolean
End Function
' pfnCallBack : PSECURE_MEMORY_CACHE_CALLBACK
Declare PtrSafe Function RemoveSecureMemoryCacheCallback Lib "kernel32" ( _
    ByVal pfnCallBack As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

RemoveSecureMemoryCacheCallback = ctypes.windll.kernel32.RemoveSecureMemoryCacheCallback
RemoveSecureMemoryCacheCallback.restype = wintypes.BOOL
RemoveSecureMemoryCacheCallback.argtypes = [
    ctypes.c_void_p,  # pfnCallBack : PSECURE_MEMORY_CACHE_CALLBACK
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('KERNEL32.dll')
RemoveSecureMemoryCacheCallback = Fiddle::Function.new(
  lib['RemoveSecureMemoryCacheCallback'],
  [
    Fiddle::TYPE_VOIDP,  # pfnCallBack : PSECURE_MEMORY_CACHE_CALLBACK
  ],
  Fiddle::TYPE_INT)
#[link(name = "kernel32")]
extern "system" {
    fn RemoveSecureMemoryCacheCallback(
        pfnCallBack: *const core::ffi::c_void  // PSECURE_MEMORY_CACHE_CALLBACK
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("KERNEL32.dll")]
public static extern bool RemoveSecureMemoryCacheCallback(IntPtr pfnCallBack);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_RemoveSecureMemoryCacheCallback' -Namespace Win32 -PassThru
# $api::RemoveSecureMemoryCacheCallback(pfnCallBack)
#uselib "KERNEL32.dll"
#func global RemoveSecureMemoryCacheCallback "RemoveSecureMemoryCacheCallback" sptr
; RemoveSecureMemoryCacheCallback pfnCallBack   ; 戻り値は stat
; pfnCallBack : PSECURE_MEMORY_CACHE_CALLBACK -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "KERNEL32.dll"
#cfunc global RemoveSecureMemoryCacheCallback "RemoveSecureMemoryCacheCallback" sptr
; res = RemoveSecureMemoryCacheCallback(pfnCallBack)
; pfnCallBack : PSECURE_MEMORY_CACHE_CALLBACK -> "sptr"
; BOOL RemoveSecureMemoryCacheCallback(PSECURE_MEMORY_CACHE_CALLBACK pfnCallBack)
#uselib "KERNEL32.dll"
#cfunc global RemoveSecureMemoryCacheCallback "RemoveSecureMemoryCacheCallback" intptr
; res = RemoveSecureMemoryCacheCallback(pfnCallBack)
; pfnCallBack : PSECURE_MEMORY_CACHE_CALLBACK -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procRemoveSecureMemoryCacheCallback = kernel32.NewProc("RemoveSecureMemoryCacheCallback")
)

// pfnCallBack (PSECURE_MEMORY_CACHE_CALLBACK)
r1, _, err := procRemoveSecureMemoryCacheCallback.Call(
	uintptr(pfnCallBack),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function RemoveSecureMemoryCacheCallback(
  pfnCallBack: Pointer   // PSECURE_MEMORY_CACHE_CALLBACK
): BOOL; stdcall;
  external 'KERNEL32.dll' name 'RemoveSecureMemoryCacheCallback';
result := DllCall("KERNEL32\RemoveSecureMemoryCacheCallback"
    , "Ptr", pfnCallBack   ; PSECURE_MEMORY_CACHE_CALLBACK
    , "Int")   ; return: BOOL
●RemoveSecureMemoryCacheCallback(pfnCallBack) = DLL("KERNEL32.dll", "bool RemoveSecureMemoryCacheCallback(void*)")
# 呼び出し: RemoveSecureMemoryCacheCallback(pfnCallBack)
# pfnCallBack : PSECURE_MEMORY_CACHE_CALLBACK -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。