Win32 API 日本語リファレンス
ホームSecurity.Authentication.Identity › SE_ADT_PARAMETER_ARRAY

SE_ADT_PARAMETER_ARRAY

構造体
サイズx64: 1048 バイト / x86: 664 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
CategoryIdDWORD4+0+0監査イベントのカテゴリID。
AuditIdDWORD4+4+4監査イベントの一意なID(メッセージID)。
ParameterCountDWORD4+8+8Parameters配列に含まれるパラメータ数。
LengthDWORD4+12+12この監査レコード全体のバイト長。
FlatSubCategoryIdWORD2+16+16監査サブカテゴリのフラットID。
TypeWORD2+18+18監査レコードの種別。
FlagsDWORD4+20+20監査レコードに関するフラグ。
ParametersSE_ADT_PARAMETER_ARRAY_ENTRY1024/640+24+24監査パラメータエントリの配列(固定長領域)。

各言語での定義

#include <windows.h>

// SE_ADT_PARAMETER_ARRAY_ENTRY  (x64 32 / x86 20 バイト)
typedef struct SE_ADT_PARAMETER_ARRAY_ENTRY {
    SE_ADT_PARAMETER_TYPE Type;
    DWORD Length;
    UINT_PTR Data[2];
    void* Address;
} SE_ADT_PARAMETER_ARRAY_ENTRY;

// SE_ADT_PARAMETER_ARRAY  (x64 1048 / x86 664 バイト)
typedef struct SE_ADT_PARAMETER_ARRAY {
    DWORD CategoryId;
    DWORD AuditId;
    DWORD ParameterCount;
    DWORD Length;
    WORD FlatSubCategoryId;
    WORD Type;
    DWORD Flags;
    SE_ADT_PARAMETER_ARRAY_ENTRY Parameters[32];
} SE_ADT_PARAMETER_ARRAY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SE_ADT_PARAMETER_ARRAY_ENTRY
{
    public int Type;
    public uint Length;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public UIntPtr[] Data;
    public IntPtr Address;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SE_ADT_PARAMETER_ARRAY
{
    public uint CategoryId;
    public uint AuditId;
    public uint ParameterCount;
    public uint Length;
    public ushort FlatSubCategoryId;
    public ushort Type;
    public uint Flags;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public SE_ADT_PARAMETER_ARRAY_ENTRY[] Parameters;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SE_ADT_PARAMETER_ARRAY_ENTRY
    Public Type As Integer
    Public Length As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public Data() As UIntPtr
    Public Address As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SE_ADT_PARAMETER_ARRAY
    Public CategoryId As UInteger
    Public AuditId As UInteger
    Public ParameterCount As UInteger
    Public Length As UInteger
    Public FlatSubCategoryId As UShort
    Public Type As UShort
    Public Flags As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public Parameters() As SE_ADT_PARAMETER_ARRAY_ENTRY
End Structure
import ctypes
from ctypes import wintypes

class SE_ADT_PARAMETER_ARRAY_ENTRY(ctypes.Structure):
    _fields_ = [
        ("Type", ctypes.c_int),
        ("Length", wintypes.DWORD),
        ("Data", ctypes.c_size_t * 2),
        ("Address", ctypes.c_void_p),
    ]

class SE_ADT_PARAMETER_ARRAY(ctypes.Structure):
    _fields_ = [
        ("CategoryId", wintypes.DWORD),
        ("AuditId", wintypes.DWORD),
        ("ParameterCount", wintypes.DWORD),
        ("Length", wintypes.DWORD),
        ("FlatSubCategoryId", ctypes.c_ushort),
        ("Type", ctypes.c_ushort),
        ("Flags", wintypes.DWORD),
        ("Parameters", SE_ADT_PARAMETER_ARRAY_ENTRY * 32),
    ]
#[repr(C)]
pub struct SE_ADT_PARAMETER_ARRAY_ENTRY {
    pub Type: i32,
    pub Length: u32,
    pub Data: [usize; 2],
    pub Address: *mut core::ffi::c_void,
}

#[repr(C)]
pub struct SE_ADT_PARAMETER_ARRAY {
    pub CategoryId: u32,
    pub AuditId: u32,
    pub ParameterCount: u32,
    pub Length: u32,
    pub FlatSubCategoryId: u16,
    pub Type: u16,
    pub Flags: u32,
    pub Parameters: [SE_ADT_PARAMETER_ARRAY_ENTRY; 32],
}
import "golang.org/x/sys/windows"

type SE_ADT_PARAMETER_ARRAY_ENTRY struct {
	Type int32
	Length uint32
	Data [2]uintptr
	Address uintptr
}

type SE_ADT_PARAMETER_ARRAY struct {
	CategoryId uint32
	AuditId uint32
	ParameterCount uint32
	Length uint32
	FlatSubCategoryId uint16
	Type uint16
	Flags uint32
	Parameters [32]SE_ADT_PARAMETER_ARRAY_ENTRY
}
type
  SE_ADT_PARAMETER_ARRAY_ENTRY = record
    Type: Integer;
    Length: DWORD;
    Data: array[0..1] of NativeUInt;
    Address: Pointer;
  end;

  SE_ADT_PARAMETER_ARRAY = record
    CategoryId: DWORD;
    AuditId: DWORD;
    ParameterCount: DWORD;
    Length: DWORD;
    FlatSubCategoryId: Word;
    Type: Word;
    Flags: DWORD;
    Parameters: array[0..31] of SE_ADT_PARAMETER_ARRAY_ENTRY;
  end;
const SE_ADT_PARAMETER_ARRAY_ENTRY = extern struct {
    Type: i32,
    Length: u32,
    Data: [2]usize,
    Address: ?*anyopaque,
};

const SE_ADT_PARAMETER_ARRAY = extern struct {
    CategoryId: u32,
    AuditId: u32,
    ParameterCount: u32,
    Length: u32,
    FlatSubCategoryId: u16,
    Type: u16,
    Flags: u32,
    Parameters: [32]SE_ADT_PARAMETER_ARRAY_ENTRY,
};
type
  SE_ADT_PARAMETER_ARRAY_ENTRY {.bycopy.} = object
    Type: int32
    Length: uint32
    Data: array[2, uint]
    Address: pointer

  SE_ADT_PARAMETER_ARRAY {.bycopy.} = object
    CategoryId: uint32
    AuditId: uint32
    ParameterCount: uint32
    Length: uint32
    FlatSubCategoryId: uint16
    Type: uint16
    Flags: uint32
    Parameters: array[32, SE_ADT_PARAMETER_ARRAY_ENTRY]
struct SE_ADT_PARAMETER_ARRAY_ENTRY
{
    int Type;
    uint Length;
    size_t[2] Data;
    void* Address;
}

struct SE_ADT_PARAMETER_ARRAY
{
    uint CategoryId;
    uint AuditId;
    uint ParameterCount;
    uint Length;
    ushort FlatSubCategoryId;
    ushort Type;
    uint Flags;
    SE_ADT_PARAMETER_ARRAY_ENTRY[32] Parameters;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SE_ADT_PARAMETER_ARRAY サイズ: 664 バイト(x86)
dim st, 166    ; 4byte整数×166(構造体サイズ 664 / 4 切り上げ)
; CategoryId : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; AuditId : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ParameterCount : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Length : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; FlatSubCategoryId : WORD (+16, 2byte)  wpoke st,16,値  /  値 = wpeek(st,16)
; Type : WORD (+18, 2byte)  wpoke st,18,値  /  値 = wpeek(st,18)
; Flags : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Parameters : SE_ADT_PARAMETER_ARRAY_ENTRY (+24, 640byte)  varptr(st)+24 を基点に操作(640byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SE_ADT_PARAMETER_ARRAY サイズ: 1048 バイト(x64)
dim st, 262    ; 4byte整数×262(構造体サイズ 1048 / 4 切り上げ)
; CategoryId : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; AuditId : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ParameterCount : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Length : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; FlatSubCategoryId : WORD (+16, 2byte)  wpoke st,16,値  /  値 = wpeek(st,16)
; Type : WORD (+18, 2byte)  wpoke st,18,値  /  値 = wpeek(st,18)
; Flags : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Parameters : SE_ADT_PARAMETER_ARRAY_ENTRY (+24, 1024byte)  varptr(st)+24 を基点に操作(1024byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SE_ADT_PARAMETER_ARRAY_ENTRY
    #field int Type
    #field int Length
    #field intptr Data 2
    #field intptr Address
#endstruct

#defstruct global SE_ADT_PARAMETER_ARRAY
    #field int CategoryId
    #field int AuditId
    #field int ParameterCount
    #field int Length
    #field short FlatSubCategoryId
    #field short Type
    #field int Flags
    #field SE_ADT_PARAMETER_ARRAY_ENTRY Parameters 32
#endstruct

stdim st, SE_ADT_PARAMETER_ARRAY        ; NSTRUCT 変数を確保
st->CategoryId = 100
mes "CategoryId=" + st->CategoryId