ホーム › NetworkManagement.WindowsFilteringPlatform › IPsecKeyManagerSetSecurityInfoByKey0
IPsecKeyManagerSetSecurityInfoByKey0
関数IPsecキーマネージャーのセキュリティ情報を設定する。
シグネチャ
// fwpuclnt.dll
#include <windows.h>
DWORD IPsecKeyManagerSetSecurityInfoByKey0(
FWPM_ENGINE_HANDLE engineHandle,
const void* reserved, // optional
DWORD securityInfo,
const SID* sidOwner, // optional
const SID* sidGroup, // optional
const ACL* dacl, // optional
const ACL* sacl // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| engineHandle | FWPM_ENGINE_HANDLE | in |
| reserved | void* | optional |
| securityInfo | DWORD | in |
| sidOwner | SID* | inoptional |
| sidGroup | SID* | inoptional |
| dacl | ACL* | inoptional |
| sacl | ACL* | inoptional |
戻り値の型: DWORD
各言語での呼び出し定義
// fwpuclnt.dll
#include <windows.h>
DWORD IPsecKeyManagerSetSecurityInfoByKey0(
FWPM_ENGINE_HANDLE engineHandle,
const void* reserved, // optional
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 IPsecKeyManagerSetSecurityInfoByKey0(
FWPM_ENGINE_HANDLE engineHandle, // FWPM_ENGINE_HANDLE
IntPtr reserved, // void* optional
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 IPsecKeyManagerSetSecurityInfoByKey0(
engineHandle As FWPM_ENGINE_HANDLE, ' FWPM_ENGINE_HANDLE
reserved As IntPtr, ' void* optional
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
' reserved : void* optional
' securityInfo : DWORD
' sidOwner : SID* optional
' sidGroup : SID* optional
' dacl : ACL* optional
' sacl : ACL* optional
Declare PtrSafe Function IPsecKeyManagerSetSecurityInfoByKey0 Lib "fwpuclnt" ( _
ByVal engineHandle As LongPtr, _
ByVal reserved 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
IPsecKeyManagerSetSecurityInfoByKey0 = ctypes.windll.fwpuclnt.IPsecKeyManagerSetSecurityInfoByKey0
IPsecKeyManagerSetSecurityInfoByKey0.restype = wintypes.DWORD
IPsecKeyManagerSetSecurityInfoByKey0.argtypes = [
FWPM_ENGINE_HANDLE, # engineHandle : FWPM_ENGINE_HANDLE
ctypes.POINTER(None), # reserved : void* optional
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')
IPsecKeyManagerSetSecurityInfoByKey0 = Fiddle::Function.new(
lib['IPsecKeyManagerSetSecurityInfoByKey0'],
[
Fiddle::TYPE_VOIDP, # engineHandle : FWPM_ENGINE_HANDLE
Fiddle::TYPE_VOIDP, # reserved : void* optional
-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 IPsecKeyManagerSetSecurityInfoByKey0(
engineHandle: FWPM_ENGINE_HANDLE, // FWPM_ENGINE_HANDLE
reserved: *const (), // void* optional
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 IPsecKeyManagerSetSecurityInfoByKey0(FWPM_ENGINE_HANDLE engineHandle, IntPtr reserved, uint securityInfo, IntPtr sidOwner, IntPtr sidGroup, IntPtr dacl, IntPtr sacl);
"@
$api = Add-Type -MemberDefinition $sig -Name 'fwpuclnt_IPsecKeyManagerSetSecurityInfoByKey0' -Namespace Win32 -PassThru
# $api::IPsecKeyManagerSetSecurityInfoByKey0(engineHandle, reserved, securityInfo, sidOwner, sidGroup, dacl, sacl)#uselib "fwpuclnt.dll"
#func global IPsecKeyManagerSetSecurityInfoByKey0 "IPsecKeyManagerSetSecurityInfoByKey0" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; IPsecKeyManagerSetSecurityInfoByKey0 engineHandle, reserved, securityInfo, varptr(sidOwner), varptr(sidGroup), varptr(dacl), varptr(sacl) ; 戻り値は stat
; engineHandle : FWPM_ENGINE_HANDLE -> "sptr"
; reserved : void* optional -> "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 IPsecKeyManagerSetSecurityInfoByKey0 "IPsecKeyManagerSetSecurityInfoByKey0" int, sptr, int, var, var, var, var ; res = IPsecKeyManagerSetSecurityInfoByKey0(engineHandle, reserved, securityInfo, sidOwner, sidGroup, dacl, sacl) ; engineHandle : FWPM_ENGINE_HANDLE -> "int" ; reserved : void* optional -> "sptr" ; securityInfo : DWORD -> "int" ; sidOwner : SID* optional -> "var" ; sidGroup : SID* optional -> "var" ; dacl : ACL* optional -> "var" ; sacl : ACL* optional -> "var" ; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。 ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "fwpuclnt.dll" #cfunc global IPsecKeyManagerSetSecurityInfoByKey0 "IPsecKeyManagerSetSecurityInfoByKey0" int, sptr, int, sptr, sptr, sptr, sptr ; res = IPsecKeyManagerSetSecurityInfoByKey0(engineHandle, reserved, securityInfo, varptr(sidOwner), varptr(sidGroup), varptr(dacl), varptr(sacl)) ; engineHandle : FWPM_ENGINE_HANDLE -> "int" ; reserved : void* optional -> "sptr" ; securityInfo : DWORD -> "int" ; sidOwner : SID* optional -> "sptr" ; sidGroup : SID* optional -> "sptr" ; dacl : ACL* optional -> "sptr" ; sacl : ACL* optional -> "sptr" ; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD IPsecKeyManagerSetSecurityInfoByKey0(FWPM_ENGINE_HANDLE engineHandle, void* reserved, DWORD securityInfo, SID* sidOwner, SID* sidGroup, ACL* dacl, ACL* sacl) #uselib "fwpuclnt.dll" #cfunc global IPsecKeyManagerSetSecurityInfoByKey0 "IPsecKeyManagerSetSecurityInfoByKey0" int, intptr, int, var, var, var, var ; res = IPsecKeyManagerSetSecurityInfoByKey0(engineHandle, reserved, securityInfo, sidOwner, sidGroup, dacl, sacl) ; engineHandle : FWPM_ENGINE_HANDLE -> "int" ; reserved : void* optional -> "intptr" ; securityInfo : DWORD -> "int" ; sidOwner : SID* optional -> "var" ; sidGroup : SID* optional -> "var" ; dacl : ACL* optional -> "var" ; sacl : ACL* optional -> "var" ; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。 ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD IPsecKeyManagerSetSecurityInfoByKey0(FWPM_ENGINE_HANDLE engineHandle, void* reserved, DWORD securityInfo, SID* sidOwner, SID* sidGroup, ACL* dacl, ACL* sacl) #uselib "fwpuclnt.dll" #cfunc global IPsecKeyManagerSetSecurityInfoByKey0 "IPsecKeyManagerSetSecurityInfoByKey0" int, intptr, int, intptr, intptr, intptr, intptr ; res = IPsecKeyManagerSetSecurityInfoByKey0(engineHandle, reserved, securityInfo, varptr(sidOwner), varptr(sidGroup), varptr(dacl), varptr(sacl)) ; engineHandle : FWPM_ENGINE_HANDLE -> "int" ; reserved : void* optional -> "intptr" ; securityInfo : DWORD -> "int" ; sidOwner : SID* optional -> "intptr" ; sidGroup : SID* optional -> "intptr" ; dacl : ACL* optional -> "intptr" ; sacl : ACL* optional -> "intptr" ; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。 ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
fwpuclnt = windows.NewLazySystemDLL("fwpuclnt.dll")
procIPsecKeyManagerSetSecurityInfoByKey0 = fwpuclnt.NewProc("IPsecKeyManagerSetSecurityInfoByKey0")
)
// engineHandle (FWPM_ENGINE_HANDLE), reserved (void* optional), securityInfo (DWORD), sidOwner (SID* optional), sidGroup (SID* optional), dacl (ACL* optional), sacl (ACL* optional)
r1, _, err := procIPsecKeyManagerSetSecurityInfoByKey0.Call(
uintptr(engineHandle),
uintptr(reserved),
uintptr(securityInfo),
uintptr(sidOwner),
uintptr(sidGroup),
uintptr(dacl),
uintptr(sacl),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction IPsecKeyManagerSetSecurityInfoByKey0(
engineHandle: FWPM_ENGINE_HANDLE; // FWPM_ENGINE_HANDLE
reserved: Pointer; // void* optional
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 'IPsecKeyManagerSetSecurityInfoByKey0';result := DllCall("fwpuclnt\IPsecKeyManagerSetSecurityInfoByKey0"
, "Ptr", engineHandle ; FWPM_ENGINE_HANDLE
, "Ptr", reserved ; void* optional
, "UInt", securityInfo ; DWORD
, "Ptr", sidOwner ; SID* optional
, "Ptr", sidGroup ; SID* optional
, "Ptr", dacl ; ACL* optional
, "Ptr", sacl ; ACL* optional
, "UInt") ; return: DWORD●IPsecKeyManagerSetSecurityInfoByKey0(engineHandle, reserved, securityInfo, sidOwner, sidGroup, dacl, sacl) = DLL("fwpuclnt.dll", "dword IPsecKeyManagerSetSecurityInfoByKey0(void*, void*, dword, void*, void*, void*, void*)")
# 呼び出し: IPsecKeyManagerSetSecurityInfoByKey0(engineHandle, reserved, securityInfo, sidOwner, sidGroup, dacl, sacl)
# engineHandle : FWPM_ENGINE_HANDLE -> "void*"
# reserved : void* optional -> "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)。