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

IPsecDospSetSecurityInfo0

関数
IPsec DoS保護機能のセキュリティ情報を設定する。
DLLfwpuclnt.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

DWORD IPsecDospSetSecurityInfo0(
    FWPM_ENGINE_HANDLE engineHandle,
    DWORD securityInfo,
    const SID* sidOwner,   // optional
    const SID* sidGroup,   // optional
    const ACL* dacl,   // optional
    const ACL* sacl   // optional
);

パラメーター

名前方向
engineHandleFWPM_ENGINE_HANDLEin
securityInfoDWORDin
sidOwnerSID*inoptional
sidGroupSID*inoptional
daclACL*inoptional
saclACL*inoptional

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD IPsecDospSetSecurityInfo0(
    FWPM_ENGINE_HANDLE engineHandle,
    DWORD securityInfo,
    const SID* sidOwner,   // optional
    const SID* sidGroup,   // optional
    const ACL* dacl,   // optional
    const ACL* sacl   // optional
);
[DllImport("fwpuclnt.dll", ExactSpelling = true)]
static extern uint IPsecDospSetSecurityInfo0(
    FWPM_ENGINE_HANDLE engineHandle,   // FWPM_ENGINE_HANDLE
    uint securityInfo,   // DWORD
    IntPtr sidOwner,   // SID* optional
    IntPtr sidGroup,   // SID* optional
    IntPtr dacl,   // ACL* optional
    IntPtr sacl   // ACL* optional
);
<DllImport("fwpuclnt.dll", ExactSpelling:=True)>
Public Shared Function IPsecDospSetSecurityInfo0(
    engineHandle As FWPM_ENGINE_HANDLE,   ' FWPM_ENGINE_HANDLE
    securityInfo As UInteger,   ' DWORD
    sidOwner As IntPtr,   ' SID* optional
    sidGroup As IntPtr,   ' SID* optional
    dacl As IntPtr,   ' ACL* optional
    sacl As IntPtr   ' ACL* optional
) As UInteger
End Function
' engineHandle : FWPM_ENGINE_HANDLE
' securityInfo : DWORD
' sidOwner : SID* optional
' sidGroup : SID* optional
' dacl : ACL* optional
' sacl : ACL* optional
Declare PtrSafe Function IPsecDospSetSecurityInfo0 Lib "fwpuclnt" ( _
    ByVal engineHandle As LongPtr, _
    ByVal securityInfo As Long, _
    ByVal sidOwner As LongPtr, _
    ByVal sidGroup As LongPtr, _
    ByVal dacl As LongPtr, _
    ByVal sacl As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

IPsecDospSetSecurityInfo0 = ctypes.windll.fwpuclnt.IPsecDospSetSecurityInfo0
IPsecDospSetSecurityInfo0.restype = wintypes.DWORD
IPsecDospSetSecurityInfo0.argtypes = [
    FWPM_ENGINE_HANDLE,  # engineHandle : FWPM_ENGINE_HANDLE
    wintypes.DWORD,  # securityInfo : DWORD
    ctypes.c_void_p,  # sidOwner : SID* optional
    ctypes.c_void_p,  # sidGroup : SID* optional
    ctypes.c_void_p,  # dacl : ACL* optional
    ctypes.c_void_p,  # sacl : ACL* optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('fwpuclnt.dll')
IPsecDospSetSecurityInfo0 = Fiddle::Function.new(
  lib['IPsecDospSetSecurityInfo0'],
  [
    Fiddle::TYPE_VOIDP,  # engineHandle : FWPM_ENGINE_HANDLE
    -Fiddle::TYPE_INT,  # securityInfo : DWORD
    Fiddle::TYPE_VOIDP,  # sidOwner : SID* optional
    Fiddle::TYPE_VOIDP,  # sidGroup : SID* optional
    Fiddle::TYPE_VOIDP,  # dacl : ACL* optional
    Fiddle::TYPE_VOIDP,  # sacl : ACL* optional
  ],
  -Fiddle::TYPE_INT)
#[link(name = "fwpuclnt")]
extern "system" {
    fn IPsecDospSetSecurityInfo0(
        engineHandle: FWPM_ENGINE_HANDLE,  // FWPM_ENGINE_HANDLE
        securityInfo: u32,  // DWORD
        sidOwner: *const SID,  // SID* optional
        sidGroup: *const SID,  // SID* optional
        dacl: *const ACL,  // ACL* optional
        sacl: *const ACL  // ACL* optional
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("fwpuclnt.dll")]
public static extern uint IPsecDospSetSecurityInfo0(FWPM_ENGINE_HANDLE engineHandle, uint securityInfo, IntPtr sidOwner, IntPtr sidGroup, IntPtr dacl, IntPtr sacl);
"@
$api = Add-Type -MemberDefinition $sig -Name 'fwpuclnt_IPsecDospSetSecurityInfo0' -Namespace Win32 -PassThru
# $api::IPsecDospSetSecurityInfo0(engineHandle, securityInfo, sidOwner, sidGroup, dacl, sacl)
#uselib "fwpuclnt.dll"
#func global IPsecDospSetSecurityInfo0 "IPsecDospSetSecurityInfo0" sptr, sptr, sptr, sptr, sptr, sptr
; IPsecDospSetSecurityInfo0 engineHandle, securityInfo, varptr(sidOwner), varptr(sidGroup), varptr(dacl), varptr(sacl)   ; 戻り値は stat
; engineHandle : FWPM_ENGINE_HANDLE -> "sptr"
; securityInfo : DWORD -> "sptr"
; sidOwner : SID* optional -> "sptr"
; sidGroup : SID* optional -> "sptr"
; dacl : ACL* optional -> "sptr"
; sacl : ACL* optional -> "sptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "fwpuclnt.dll"
#cfunc global IPsecDospSetSecurityInfo0 "IPsecDospSetSecurityInfo0" int, int, var, var, var, var
; res = IPsecDospSetSecurityInfo0(engineHandle, securityInfo, sidOwner, sidGroup, dacl, sacl)
; engineHandle : FWPM_ENGINE_HANDLE -> "int"
; securityInfo : DWORD -> "int"
; sidOwner : SID* optional -> "var"
; sidGroup : SID* optional -> "var"
; dacl : ACL* optional -> "var"
; sacl : ACL* optional -> "var"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD IPsecDospSetSecurityInfo0(FWPM_ENGINE_HANDLE engineHandle, DWORD securityInfo, SID* sidOwner, SID* sidGroup, ACL* dacl, ACL* sacl)
#uselib "fwpuclnt.dll"
#cfunc global IPsecDospSetSecurityInfo0 "IPsecDospSetSecurityInfo0" int, int, var, var, var, var
; res = IPsecDospSetSecurityInfo0(engineHandle, securityInfo, sidOwner, sidGroup, dacl, sacl)
; engineHandle : FWPM_ENGINE_HANDLE -> "int"
; securityInfo : DWORD -> "int"
; sidOwner : SID* optional -> "var"
; sidGroup : SID* optional -> "var"
; dacl : ACL* optional -> "var"
; sacl : ACL* optional -> "var"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	fwpuclnt = windows.NewLazySystemDLL("fwpuclnt.dll")
	procIPsecDospSetSecurityInfo0 = fwpuclnt.NewProc("IPsecDospSetSecurityInfo0")
)

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