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

UnregisterBadMemoryNotification

関数
登録済みの不良メモリ通知を解除する。
DLLKERNEL32.dll呼出規約winapiSetLastErrorあり対応OSwindows8.0

シグネチャ

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

BOOL UnregisterBadMemoryNotification(
    void* RegistrationHandle
);

パラメーター

名前方向
RegistrationHandlevoid*in

戻り値の型: BOOL

各言語での呼び出し定義

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

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

UnregisterBadMemoryNotification = ctypes.windll.kernel32.UnregisterBadMemoryNotification
UnregisterBadMemoryNotification.restype = wintypes.BOOL
UnregisterBadMemoryNotification.argtypes = [
    ctypes.POINTER(None),  # RegistrationHandle : void*
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

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

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procUnregisterBadMemoryNotification = kernel32.NewProc("UnregisterBadMemoryNotification")
)

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