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