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

OnDemandUnRegisterNotification

関数
オンデマンド接続の通知登録を解除する。
DLLOnDemandConnRouteHelper.dll呼出規約winapi対応OSWindows 8.1 以降

シグネチャ

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

HRESULT OnDemandUnRegisterNotification(
    HANDLE registrationHandle
);

パラメーター

名前方向
registrationHandleHANDLEin

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

OnDemandUnRegisterNotification = ctypes.windll.ondemandconnroutehelper.OnDemandUnRegisterNotification
OnDemandUnRegisterNotification.restype = ctypes.c_int
OnDemandUnRegisterNotification.argtypes = [
    wintypes.HANDLE,  # registrationHandle : HANDLE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	ondemandconnroutehelper = windows.NewLazySystemDLL("OnDemandConnRouteHelper.dll")
	procOnDemandUnRegisterNotification = ondemandconnroutehelper.NewProc("OnDemandUnRegisterNotification")
)

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