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

FlushIpNetTable

関数
指定インターフェイスのARPテーブルをすべて消去する。
DLLIPHLPAPI.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

DWORD FlushIpNetTable(
    DWORD dwIfIndex
);

パラメーター

名前方向
dwIfIndexDWORDin

戻り値の型: DWORD

各言語での呼び出し定義

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

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

FlushIpNetTable = ctypes.windll.iphlpapi.FlushIpNetTable
FlushIpNetTable.restype = wintypes.DWORD
FlushIpNetTable.argtypes = [
    wintypes.DWORD,  # dwIfIndex : DWORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	iphlpapi = windows.NewLazySystemDLL("IPHLPAPI.dll")
	procFlushIpNetTable = iphlpapi.NewProc("FlushIpNetTable")
)

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