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

FwpmConnectionDestroyEnumHandle0

関数
WFP接続オブジェクトの列挙用ハンドルを破棄する。
DLLfwpuclnt.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

DWORD FwpmConnectionDestroyEnumHandle0(
    FWPM_ENGINE_HANDLE engineHandle,
    FWPM_CONNECTION_ENUM_HANDLE enumHandle
);

パラメーター

名前方向説明
engineHandleFWPM_ENGINE_HANDLEinフィルタリングエンジンへのセッションハンドル。
enumHandleFWPM_CONNECTION_ENUM_HANDLEin破棄する接続列挙ハンドル。

戻り値の型: DWORD

各言語での呼び出し定義

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

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

FwpmConnectionDestroyEnumHandle0 = ctypes.windll.fwpuclnt.FwpmConnectionDestroyEnumHandle0
FwpmConnectionDestroyEnumHandle0.restype = wintypes.DWORD
FwpmConnectionDestroyEnumHandle0.argtypes = [
    FWPM_ENGINE_HANDLE,  # engineHandle : FWPM_ENGINE_HANDLE
    FWPM_CONNECTION_ENUM_HANDLE,  # enumHandle : FWPM_CONNECTION_ENUM_HANDLE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	fwpuclnt = windows.NewLazySystemDLL("fwpuclnt.dll")
	procFwpmConnectionDestroyEnumHandle0 = fwpuclnt.NewProc("FwpmConnectionDestroyEnumHandle0")
)

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

extern "fwpuclnt" fn FwpmConnectionDestroyEnumHandle0(
    engineHandle: FWPM_ENGINE_HANDLE, // FWPM_ENGINE_HANDLE
    enumHandle: FWPM_CONNECTION_ENUM_HANDLE // FWPM_CONNECTION_ENUM_HANDLE
) callconv(std.os.windows.WINAPI) u32;
proc FwpmConnectionDestroyEnumHandle0(
    engineHandle: FWPM_ENGINE_HANDLE,  # FWPM_ENGINE_HANDLE
    enumHandle: FWPM_CONNECTION_ENUM_HANDLE  # FWPM_CONNECTION_ENUM_HANDLE
): uint32 {.importc: "FwpmConnectionDestroyEnumHandle0", stdcall, dynlib: "fwpuclnt.dll".}
pragma(lib, "fwpuclnt");
extern(Windows)
uint FwpmConnectionDestroyEnumHandle0(
    FWPM_ENGINE_HANDLE engineHandle,   // FWPM_ENGINE_HANDLE
    FWPM_CONNECTION_ENUM_HANDLE enumHandle   // FWPM_CONNECTION_ENUM_HANDLE
);
ccall((:FwpmConnectionDestroyEnumHandle0, "fwpuclnt.dll"), stdcall, UInt32,
      (FWPM_ENGINE_HANDLE, FWPM_CONNECTION_ENUM_HANDLE),
      engineHandle, enumHandle)
# engineHandle : FWPM_ENGINE_HANDLE -> FWPM_ENGINE_HANDLE
# enumHandle : FWPM_CONNECTION_ENUM_HANDLE -> FWPM_CONNECTION_ENUM_HANDLE
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
uint32_t FwpmConnectionDestroyEnumHandle0(
    FWPM_ENGINE_HANDLE engineHandle,
    FWPM_CONNECTION_ENUM_HANDLE enumHandle);
]]
local fwpuclnt = ffi.load("fwpuclnt")
-- fwpuclnt.FwpmConnectionDestroyEnumHandle0(engineHandle, enumHandle)
-- engineHandle : FWPM_ENGINE_HANDLE
-- enumHandle : FWPM_CONNECTION_ENUM_HANDLE
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('fwpuclnt.dll');
const FwpmConnectionDestroyEnumHandle0 = lib.func('__stdcall', 'FwpmConnectionDestroyEnumHandle0', 'uint32_t', ['FWPM_ENGINE_HANDLE', 'FWPM_CONNECTION_ENUM_HANDLE']);
// FwpmConnectionDestroyEnumHandle0(engineHandle, enumHandle)
// engineHandle : FWPM_ENGINE_HANDLE -> 'FWPM_ENGINE_HANDLE'
// enumHandle : FWPM_CONNECTION_ENUM_HANDLE -> 'FWPM_CONNECTION_ENUM_HANDLE'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("fwpuclnt.dll", {
  FwpmConnectionDestroyEnumHandle0: { parameters: ["buffer", "buffer"], result: "u32" },
});
// lib.symbols.FwpmConnectionDestroyEnumHandle0(engineHandle, enumHandle)
// engineHandle : FWPM_ENGINE_HANDLE -> "buffer"
// enumHandle : FWPM_CONNECTION_ENUM_HANDLE -> "buffer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
uint32_t FwpmConnectionDestroyEnumHandle0(
    FWPM_ENGINE_HANDLE engineHandle,
    FWPM_CONNECTION_ENUM_HANDLE enumHandle);
C, "fwpuclnt.dll");
// $ffi->FwpmConnectionDestroyEnumHandle0(engineHandle, enumHandle);
// engineHandle : FWPM_ENGINE_HANDLE
// enumHandle : FWPM_CONNECTION_ENUM_HANDLE
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Fwpuclnt extends StdCallLibrary {
    Fwpuclnt INSTANCE = Native.load("fwpuclnt", Fwpuclnt.class);
    int FwpmConnectionDestroyEnumHandle0(
        FWPM_ENGINE_HANDLE /* extends Structure (by value) */ engineHandle,   // FWPM_ENGINE_HANDLE
        FWPM_CONNECTION_ENUM_HANDLE /* extends Structure (by value) */ enumHandle   // FWPM_CONNECTION_ENUM_HANDLE
    );
}
@[Link("fwpuclnt")]
lib Libfwpuclnt
  fun FwpmConnectionDestroyEnumHandle0 = FwpmConnectionDestroyEnumHandle0(
    engineHandle : FWPM_ENGINE_HANDLE,   # FWPM_ENGINE_HANDLE
    enumHandle : FWPM_CONNECTION_ENUM_HANDLE   # FWPM_CONNECTION_ENUM_HANDLE
  ) : UInt32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef FwpmConnectionDestroyEnumHandle0Native = Uint32 Function(FWPM_ENGINE_HANDLE, FWPM_CONNECTION_ENUM_HANDLE);
typedef FwpmConnectionDestroyEnumHandle0Dart = int Function(int, int);
final FwpmConnectionDestroyEnumHandle0 = DynamicLibrary.open('fwpuclnt.dll')
    .lookupFunction<FwpmConnectionDestroyEnumHandle0Native, FwpmConnectionDestroyEnumHandle0Dart>('FwpmConnectionDestroyEnumHandle0');
// engineHandle : FWPM_ENGINE_HANDLE -> FWPM_ENGINE_HANDLE
// enumHandle : FWPM_CONNECTION_ENUM_HANDLE -> FWPM_CONNECTION_ENUM_HANDLE
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function FwpmConnectionDestroyEnumHandle0(
  engineHandle: FWPM_ENGINE_HANDLE;   // FWPM_ENGINE_HANDLE
  enumHandle: FWPM_CONNECTION_ENUM_HANDLE   // FWPM_CONNECTION_ENUM_HANDLE
): DWORD; stdcall;
  external 'fwpuclnt.dll' name 'FwpmConnectionDestroyEnumHandle0';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "FwpmConnectionDestroyEnumHandle0"
  c_FwpmConnectionDestroyEnumHandle0 :: FWPM_ENGINE_HANDLE -> FWPM_CONNECTION_ENUM_HANDLE -> IO Word32
-- engineHandle : FWPM_ENGINE_HANDLE -> FWPM_ENGINE_HANDLE
-- enumHandle : FWPM_CONNECTION_ENUM_HANDLE -> FWPM_CONNECTION_ENUM_HANDLE
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
-- ※値渡し構造体は GHC FFI で直接渡せません。Ptr で渡すラッパ(C側)経由にしてください。
open Ctypes
open Foreign

let fwpmconnectiondestroyenumhandle0 =
  foreign "FwpmConnectionDestroyEnumHandle0"
    (FWPM_ENGINE_HANDLE @-> FWPM_CONNECTION_ENUM_HANDLE @-> returning uint32_t)
(* engineHandle : FWPM_ENGINE_HANDLE -> FWPM_ENGINE_HANDLE *)
(* enumHandle : FWPM_CONNECTION_ENUM_HANDLE -> FWPM_CONNECTION_ENUM_HANDLE *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library fwpuclnt (t "fwpuclnt.dll"))
(cffi:use-foreign-library fwpuclnt)

(cffi:defcfun ("FwpmConnectionDestroyEnumHandle0" fwpm-connection-destroy-enum-handle0 :convention :stdcall) :uint32
  (engine-handle (:struct fwpm-engine-handle))   ; FWPM_ENGINE_HANDLE
  (enum-handle (:struct fwpm-connection-enum-handle)))   ; FWPM_CONNECTION_ENUM_HANDLE
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $FwpmConnectionDestroyEnumHandle0 = Win32::API::More->new('fwpuclnt',
    'DWORD FwpmConnectionDestroyEnumHandle0(LPVOID engineHandle, LPVOID enumHandle)');
# my $ret = $FwpmConnectionDestroyEnumHandle0->Call($engineHandle, $enumHandle);
# engineHandle : FWPM_ENGINE_HANDLE -> LPVOID
# enumHandle : FWPM_CONNECTION_ENUM_HANDLE -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型