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

PfDeleteInterface

関数
パケットフィルタリング用インターフェイスを削除する。
DLLIPHLPAPI.dll呼出規約winapi

シグネチャ

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

DWORD PfDeleteInterface(
    void* pInterface
);

パラメーター

名前方向
pInterfacevoid*inout

戻り値の型: DWORD

各言語での呼び出し定義

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

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

PfDeleteInterface = ctypes.windll.iphlpapi.PfDeleteInterface
PfDeleteInterface.restype = wintypes.DWORD
PfDeleteInterface.argtypes = [
    ctypes.POINTER(None),  # pInterface : void* in/out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	iphlpapi = windows.NewLazySystemDLL("IPHLPAPI.dll")
	procPfDeleteInterface = iphlpapi.NewProc("PfDeleteInterface")
)

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