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

SE_ADT_PARAMETER_ARRAY_EX

構造体
サイズx64: 1056 バイト / x86: 668 バイト

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

フィールド

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

各言語での定義

#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_EX  (x64 1056 / x86 668 バイト)
typedef struct SE_ADT_PARAMETER_ARRAY_EX {
    DWORD CategoryId;
    DWORD AuditId;
    DWORD Version;
    DWORD ParameterCount;
    DWORD Length;
    WORD FlatSubCategoryId;
    WORD Type;
    DWORD Flags;
    SE_ADT_PARAMETER_ARRAY_ENTRY Parameters[32];
} SE_ADT_PARAMETER_ARRAY_EX;
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_EX
{
    public uint CategoryId;
    public uint AuditId;
    public uint Version;
    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_EX
    Public CategoryId As UInteger
    Public AuditId As UInteger
    Public Version 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_EX(ctypes.Structure):
    _fields_ = [
        ("CategoryId", wintypes.DWORD),
        ("AuditId", wintypes.DWORD),
        ("Version", 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_EX {
    pub CategoryId: u32,
    pub AuditId: u32,
    pub Version: 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_EX struct {
	CategoryId uint32
	AuditId uint32
	Version 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_EX = record
    CategoryId: DWORD;
    AuditId: DWORD;
    Version: 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_EX = extern struct {
    CategoryId: u32,
    AuditId: u32,
    Version: 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_EX {.bycopy.} = object
    CategoryId: uint32
    AuditId: uint32
    Version: 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_EX
{
    uint CategoryId;
    uint AuditId;
    uint Version;
    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_EX サイズ: 668 バイト(x86)
dim st, 167    ; 4byte整数×167(構造体サイズ 668 / 4 切り上げ)
; CategoryId : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; AuditId : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Version : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ParameterCount : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Length : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; FlatSubCategoryId : WORD (+20, 2byte)  wpoke st,20,値  /  値 = wpeek(st,20)
; Type : WORD (+22, 2byte)  wpoke st,22,値  /  値 = wpeek(st,22)
; Flags : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Parameters : SE_ADT_PARAMETER_ARRAY_ENTRY (+28, 640byte)  varptr(st)+28 を基点に操作(640byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SE_ADT_PARAMETER_ARRAY_EX サイズ: 1056 バイト(x64)
dim st, 264    ; 4byte整数×264(構造体サイズ 1056 / 4 切り上げ)
; CategoryId : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; AuditId : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Version : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ParameterCount : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Length : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; FlatSubCategoryId : WORD (+20, 2byte)  wpoke st,20,値  /  値 = wpeek(st,20)
; Type : WORD (+22, 2byte)  wpoke st,22,値  /  値 = wpeek(st,22)
; Flags : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Parameters : SE_ADT_PARAMETER_ARRAY_ENTRY (+32, 1024byte)  varptr(st)+32 を基点に操作(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_EX
    #field int CategoryId
    #field int AuditId
    #field int Version
    #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_EX        ; NSTRUCT 変数を確保
st->CategoryId = 100
mes "CategoryId=" + st->CategoryId