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

FwpmSystemPortsUnsubscribe0

関数
WFPシステムポート変更通知の購読を解除する。
DLLfwpuclnt.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

DWORD FwpmSystemPortsUnsubscribe0(
    FWPM_ENGINE_HANDLE engineHandle,   // optional
    HANDLE sysPortsHandle
);

パラメーター

名前方向
engineHandleFWPM_ENGINE_HANDLEinoptional
sysPortsHandleHANDLEinout

戻り値の型: DWORD

各言語での呼び出し定義

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

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

FwpmSystemPortsUnsubscribe0 = ctypes.windll.fwpuclnt.FwpmSystemPortsUnsubscribe0
FwpmSystemPortsUnsubscribe0.restype = wintypes.DWORD
FwpmSystemPortsUnsubscribe0.argtypes = [
    FWPM_ENGINE_HANDLE,  # engineHandle : FWPM_ENGINE_HANDLE optional
    wintypes.HANDLE,  # sysPortsHandle : HANDLE in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('fwpuclnt.dll')
FwpmSystemPortsUnsubscribe0 = Fiddle::Function.new(
  lib['FwpmSystemPortsUnsubscribe0'],
  [
    Fiddle::TYPE_VOIDP,  # engineHandle : FWPM_ENGINE_HANDLE optional
    Fiddle::TYPE_VOIDP,  # sysPortsHandle : HANDLE in/out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "fwpuclnt")]
extern "system" {
    fn FwpmSystemPortsUnsubscribe0(
        engineHandle: FWPM_ENGINE_HANDLE,  // FWPM_ENGINE_HANDLE optional
        sysPortsHandle: *mut core::ffi::c_void  // HANDLE in/out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("fwpuclnt.dll")]
public static extern uint FwpmSystemPortsUnsubscribe0(FWPM_ENGINE_HANDLE engineHandle, IntPtr sysPortsHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'fwpuclnt_FwpmSystemPortsUnsubscribe0' -Namespace Win32 -PassThru
# $api::FwpmSystemPortsUnsubscribe0(engineHandle, sysPortsHandle)
#uselib "fwpuclnt.dll"
#func global FwpmSystemPortsUnsubscribe0 "FwpmSystemPortsUnsubscribe0" sptr, sptr
; FwpmSystemPortsUnsubscribe0 engineHandle, sysPortsHandle   ; 戻り値は stat
; engineHandle : FWPM_ENGINE_HANDLE optional -> "sptr"
; sysPortsHandle : HANDLE in/out -> "sptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "fwpuclnt.dll"
#cfunc global FwpmSystemPortsUnsubscribe0 "FwpmSystemPortsUnsubscribe0" int, sptr
; res = FwpmSystemPortsUnsubscribe0(engineHandle, sysPortsHandle)
; engineHandle : FWPM_ENGINE_HANDLE optional -> "int"
; sysPortsHandle : HANDLE in/out -> "sptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; DWORD FwpmSystemPortsUnsubscribe0(FWPM_ENGINE_HANDLE engineHandle, HANDLE sysPortsHandle)
#uselib "fwpuclnt.dll"
#cfunc global FwpmSystemPortsUnsubscribe0 "FwpmSystemPortsUnsubscribe0" int, intptr
; res = FwpmSystemPortsUnsubscribe0(engineHandle, sysPortsHandle)
; engineHandle : FWPM_ENGINE_HANDLE optional -> "int"
; sysPortsHandle : HANDLE in/out -> "intptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	fwpuclnt = windows.NewLazySystemDLL("fwpuclnt.dll")
	procFwpmSystemPortsUnsubscribe0 = fwpuclnt.NewProc("FwpmSystemPortsUnsubscribe0")
)

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