Win32 API 日本語リファレンス
ホームNetworkManagement.IpHelper › CancelMibChangeNotify2

CancelMibChangeNotify2

関数
MIB変更通知の登録をキャンセルする。
DLLIPHLPAPI.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

WIN32_ERROR CancelMibChangeNotify2(
    HANDLE NotificationHandle
);

パラメーター

名前方向
NotificationHandleHANDLEin

戻り値の型: WIN32_ERROR

各言語での呼び出し定義

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

WIN32_ERROR CancelMibChangeNotify2(
    HANDLE NotificationHandle
);
[DllImport("IPHLPAPI.dll", ExactSpelling = true)]
static extern uint CancelMibChangeNotify2(
    IntPtr NotificationHandle   // HANDLE
);
<DllImport("IPHLPAPI.dll", ExactSpelling:=True)>
Public Shared Function CancelMibChangeNotify2(
    NotificationHandle As IntPtr   ' HANDLE
) As UInteger
End Function
' NotificationHandle : HANDLE
Declare PtrSafe Function CancelMibChangeNotify2 Lib "iphlpapi" ( _
    ByVal NotificationHandle As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CancelMibChangeNotify2 = ctypes.windll.iphlpapi.CancelMibChangeNotify2
CancelMibChangeNotify2.restype = wintypes.DWORD
CancelMibChangeNotify2.argtypes = [
    wintypes.HANDLE,  # NotificationHandle : HANDLE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	iphlpapi = windows.NewLazySystemDLL("IPHLPAPI.dll")
	procCancelMibChangeNotify2 = iphlpapi.NewProc("CancelMibChangeNotify2")
)

// NotificationHandle (HANDLE)
r1, _, err := procCancelMibChangeNotify2.Call(
	uintptr(NotificationHandle),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // WIN32_ERROR
function CancelMibChangeNotify2(
  NotificationHandle: THandle   // HANDLE
): DWORD; stdcall;
  external 'IPHLPAPI.dll' name 'CancelMibChangeNotify2';
result := DllCall("IPHLPAPI\CancelMibChangeNotify2"
    , "Ptr", NotificationHandle   ; HANDLE
    , "UInt")   ; return: WIN32_ERROR
●CancelMibChangeNotify2(NotificationHandle) = DLL("IPHLPAPI.dll", "dword CancelMibChangeNotify2(void*)")
# 呼び出し: CancelMibChangeNotify2(NotificationHandle)
# NotificationHandle : HANDLE -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。