ホーム › NetworkManagement.IpHelper › FlushIpPathTable
FlushIpPathTable
関数指定アドレスファミリのIPパステーブルを消去する。
シグネチャ
// IPHLPAPI.dll
#include <windows.h>
WIN32_ERROR FlushIpPathTable(
ADDRESS_FAMILY Family
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Family | ADDRESS_FAMILY | in |
戻り値の型: WIN32_ERROR
各言語での呼び出し定義
// IPHLPAPI.dll
#include <windows.h>
WIN32_ERROR FlushIpPathTable(
ADDRESS_FAMILY Family
);[DllImport("IPHLPAPI.dll", ExactSpelling = true)]
static extern uint FlushIpPathTable(
ushort Family // ADDRESS_FAMILY
);<DllImport("IPHLPAPI.dll", ExactSpelling:=True)>
Public Shared Function FlushIpPathTable(
Family As UShort ' ADDRESS_FAMILY
) As UInteger
End Function' Family : ADDRESS_FAMILY
Declare PtrSafe Function FlushIpPathTable Lib "iphlpapi" ( _
ByVal Family As Integer) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
FlushIpPathTable = ctypes.windll.iphlpapi.FlushIpPathTable
FlushIpPathTable.restype = wintypes.DWORD
FlushIpPathTable.argtypes = [
ctypes.c_ushort, # Family : ADDRESS_FAMILY
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('IPHLPAPI.dll')
FlushIpPathTable = Fiddle::Function.new(
lib['FlushIpPathTable'],
[
-Fiddle::TYPE_SHORT, # Family : ADDRESS_FAMILY
],
-Fiddle::TYPE_INT)#[link(name = "iphlpapi")]
extern "system" {
fn FlushIpPathTable(
Family: u16 // ADDRESS_FAMILY
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("IPHLPAPI.dll")]
public static extern uint FlushIpPathTable(ushort Family);
"@
$api = Add-Type -MemberDefinition $sig -Name 'IPHLPAPI_FlushIpPathTable' -Namespace Win32 -PassThru
# $api::FlushIpPathTable(Family)#uselib "IPHLPAPI.dll"
#func global FlushIpPathTable "FlushIpPathTable" sptr
; FlushIpPathTable Family ; 戻り値は stat
; Family : ADDRESS_FAMILY -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "IPHLPAPI.dll"
#cfunc global FlushIpPathTable "FlushIpPathTable" int
; res = FlushIpPathTable(Family)
; Family : ADDRESS_FAMILY -> "int"; WIN32_ERROR FlushIpPathTable(ADDRESS_FAMILY Family)
#uselib "IPHLPAPI.dll"
#cfunc global FlushIpPathTable "FlushIpPathTable" int
; res = FlushIpPathTable(Family)
; Family : ADDRESS_FAMILY -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
iphlpapi = windows.NewLazySystemDLL("IPHLPAPI.dll")
procFlushIpPathTable = iphlpapi.NewProc("FlushIpPathTable")
)
// Family (ADDRESS_FAMILY)
r1, _, err := procFlushIpPathTable.Call(
uintptr(Family),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // WIN32_ERRORfunction FlushIpPathTable(
Family: Word // ADDRESS_FAMILY
): DWORD; stdcall;
external 'IPHLPAPI.dll' name 'FlushIpPathTable';result := DllCall("IPHLPAPI\FlushIpPathTable"
, "UShort", Family ; ADDRESS_FAMILY
, "UInt") ; return: WIN32_ERROR●FlushIpPathTable(Family) = DLL("IPHLPAPI.dll", "dword FlushIpPathTable(int)")
# 呼び出し: FlushIpPathTable(Family)
# Family : ADDRESS_FAMILY -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。