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

FwpmEngineGetSecurityInfo0

関数
WFPフィルターエンジンのセキュリティ情報を取得する。
DLLfwpuclnt.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD FwpmEngineGetSecurityInfo0(
    FWPM_ENGINE_HANDLE engineHandle,
    DWORD securityInfo,
    PSID* sidOwner,
    PSID* sidGroup,
    ACL** dacl,
    ACL** sacl,
    PSECURITY_DESCRIPTOR* securityDescriptor
);

パラメーター

名前方向
engineHandleFWPM_ENGINE_HANDLEin
securityInfoDWORDin
sidOwnerPSID*out
sidGroupPSID*out
daclACL**out
saclACL**out
securityDescriptorPSECURITY_DESCRIPTOR*out

戻り値の型: DWORD

各言語での呼び出し定義

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

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

FwpmEngineGetSecurityInfo0 = ctypes.windll.fwpuclnt.FwpmEngineGetSecurityInfo0
FwpmEngineGetSecurityInfo0.restype = wintypes.DWORD
FwpmEngineGetSecurityInfo0.argtypes = [
    FWPM_ENGINE_HANDLE,  # engineHandle : FWPM_ENGINE_HANDLE
    wintypes.DWORD,  # securityInfo : DWORD
    ctypes.c_void_p,  # sidOwner : PSID* out
    ctypes.c_void_p,  # sidGroup : PSID* out
    ctypes.c_void_p,  # dacl : ACL** out
    ctypes.c_void_p,  # sacl : ACL** out
    ctypes.c_void_p,  # securityDescriptor : PSECURITY_DESCRIPTOR* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	fwpuclnt = windows.NewLazySystemDLL("fwpuclnt.dll")
	procFwpmEngineGetSecurityInfo0 = fwpuclnt.NewProc("FwpmEngineGetSecurityInfo0")
)

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