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