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

FreeInterfaceContextTable

関数
インターフェイスコンテキストテーブルのメモリを解放する。
DLLOnDemandConnRouteHelper.dll呼出規約winapi対応OSWindows 10 以降

シグネチャ

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

void FreeInterfaceContextTable(
    NET_INTERFACE_CONTEXT_TABLE* InterfaceContextTable
);

パラメーター

名前方向
InterfaceContextTableNET_INTERFACE_CONTEXT_TABLE*in

戻り値の型: void

各言語での呼び出し定義

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

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

FreeInterfaceContextTable = ctypes.windll.ondemandconnroutehelper.FreeInterfaceContextTable
FreeInterfaceContextTable.restype = None
FreeInterfaceContextTable.argtypes = [
    ctypes.c_void_p,  # InterfaceContextTable : NET_INTERFACE_CONTEXT_TABLE*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('OnDemandConnRouteHelper.dll')
FreeInterfaceContextTable = Fiddle::Function.new(
  lib['FreeInterfaceContextTable'],
  [
    Fiddle::TYPE_VOIDP,  # InterfaceContextTable : NET_INTERFACE_CONTEXT_TABLE*
  ],
  Fiddle::TYPE_VOID)
#[link(name = "ondemandconnroutehelper")]
extern "system" {
    fn FreeInterfaceContextTable(
        InterfaceContextTable: *mut NET_INTERFACE_CONTEXT_TABLE  // NET_INTERFACE_CONTEXT_TABLE*
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("OnDemandConnRouteHelper.dll")]
public static extern void FreeInterfaceContextTable(IntPtr InterfaceContextTable);
"@
$api = Add-Type -MemberDefinition $sig -Name 'OnDemandConnRouteHelper_FreeInterfaceContextTable' -Namespace Win32 -PassThru
# $api::FreeInterfaceContextTable(InterfaceContextTable)
#uselib "OnDemandConnRouteHelper.dll"
#func global FreeInterfaceContextTable "FreeInterfaceContextTable" sptr
; FreeInterfaceContextTable varptr(InterfaceContextTable)
; InterfaceContextTable : NET_INTERFACE_CONTEXT_TABLE* -> "sptr"
出力引数:
#uselib "OnDemandConnRouteHelper.dll"
#func global FreeInterfaceContextTable "FreeInterfaceContextTable" var
; FreeInterfaceContextTable InterfaceContextTable
; InterfaceContextTable : NET_INTERFACE_CONTEXT_TABLE* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; void FreeInterfaceContextTable(NET_INTERFACE_CONTEXT_TABLE* InterfaceContextTable)
#uselib "OnDemandConnRouteHelper.dll"
#func global FreeInterfaceContextTable "FreeInterfaceContextTable" var
; FreeInterfaceContextTable InterfaceContextTable
; InterfaceContextTable : NET_INTERFACE_CONTEXT_TABLE* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	ondemandconnroutehelper = windows.NewLazySystemDLL("OnDemandConnRouteHelper.dll")
	procFreeInterfaceContextTable = ondemandconnroutehelper.NewProc("FreeInterfaceContextTable")
)

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