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

POLICY_AUDIT_LOG_INFO

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

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

フィールド

フィールドサイズx64x86説明
AuditLogPercentFullDWORD4+0+0監査ログの使用率(満杯に対する割合)。
MaximumLogSizeDWORD4+4+4監査ログの最大サイズ(キロバイト)。
AuditRetentionPeriodLONGLONG8+8+8監査レコードの保持期間(100ナノ秒単位)。
AuditLogFullShutdownInProgressBOOLEAN1+16+16ログ満杯によるシャットダウンが進行中か否かを示す真偽値。
TimeToShutdownLONGLONG8+24+24シャットダウンまでの残り時間(100ナノ秒単位)。
NextAuditRecordIdDWORD4+32+32次に割り当てられる監査レコードID。

各言語での定義

#include <windows.h>

// POLICY_AUDIT_LOG_INFO  (x64 40 / x86 40 バイト)
typedef struct POLICY_AUDIT_LOG_INFO {
    DWORD AuditLogPercentFull;
    DWORD MaximumLogSize;
    LONGLONG AuditRetentionPeriod;
    BOOLEAN AuditLogFullShutdownInProgress;
    LONGLONG TimeToShutdown;
    DWORD NextAuditRecordId;
} POLICY_AUDIT_LOG_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POLICY_AUDIT_LOG_INFO
{
    public uint AuditLogPercentFull;
    public uint MaximumLogSize;
    public long AuditRetentionPeriod;
    [MarshalAs(UnmanagedType.U1)] public bool AuditLogFullShutdownInProgress;
    public long TimeToShutdown;
    public uint NextAuditRecordId;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POLICY_AUDIT_LOG_INFO
    Public AuditLogPercentFull As UInteger
    Public MaximumLogSize As UInteger
    Public AuditRetentionPeriod As Long
    <MarshalAs(UnmanagedType.U1)> Public AuditLogFullShutdownInProgress As Boolean
    Public TimeToShutdown As Long
    Public NextAuditRecordId As UInteger
End Structure
import ctypes
from ctypes import wintypes

class POLICY_AUDIT_LOG_INFO(ctypes.Structure):
    _fields_ = [
        ("AuditLogPercentFull", wintypes.DWORD),
        ("MaximumLogSize", wintypes.DWORD),
        ("AuditRetentionPeriod", ctypes.c_longlong),
        ("AuditLogFullShutdownInProgress", ctypes.c_byte),
        ("TimeToShutdown", ctypes.c_longlong),
        ("NextAuditRecordId", wintypes.DWORD),
    ]
#[repr(C)]
pub struct POLICY_AUDIT_LOG_INFO {
    pub AuditLogPercentFull: u32,
    pub MaximumLogSize: u32,
    pub AuditRetentionPeriod: i64,
    pub AuditLogFullShutdownInProgress: u8,
    pub TimeToShutdown: i64,
    pub NextAuditRecordId: u32,
}
import "golang.org/x/sys/windows"

type POLICY_AUDIT_LOG_INFO struct {
	AuditLogPercentFull uint32
	MaximumLogSize uint32
	AuditRetentionPeriod int64
	AuditLogFullShutdownInProgress byte
	TimeToShutdown int64
	NextAuditRecordId uint32
}
type
  POLICY_AUDIT_LOG_INFO = record
    AuditLogPercentFull: DWORD;
    MaximumLogSize: DWORD;
    AuditRetentionPeriod: Int64;
    AuditLogFullShutdownInProgress: ByteBool;
    TimeToShutdown: Int64;
    NextAuditRecordId: DWORD;
  end;
const POLICY_AUDIT_LOG_INFO = extern struct {
    AuditLogPercentFull: u32,
    MaximumLogSize: u32,
    AuditRetentionPeriod: i64,
    AuditLogFullShutdownInProgress: u8,
    TimeToShutdown: i64,
    NextAuditRecordId: u32,
};
type
  POLICY_AUDIT_LOG_INFO {.bycopy.} = object
    AuditLogPercentFull: uint32
    MaximumLogSize: uint32
    AuditRetentionPeriod: int64
    AuditLogFullShutdownInProgress: uint8
    TimeToShutdown: int64
    NextAuditRecordId: uint32
struct POLICY_AUDIT_LOG_INFO
{
    uint AuditLogPercentFull;
    uint MaximumLogSize;
    long AuditRetentionPeriod;
    ubyte AuditLogFullShutdownInProgress;
    long TimeToShutdown;
    uint NextAuditRecordId;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; POLICY_AUDIT_LOG_INFO サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; AuditLogPercentFull : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; MaximumLogSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; AuditRetentionPeriod : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; AuditLogFullShutdownInProgress : BOOLEAN (+16, 1byte)  poke st,16,値  /  値 = peek(st,16)
; TimeToShutdown : LONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; NextAuditRecordId : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global POLICY_AUDIT_LOG_INFO
    #field int AuditLogPercentFull
    #field int MaximumLogSize
    #field int64 AuditRetentionPeriod
    #field bool1 AuditLogFullShutdownInProgress
    #field int64 TimeToShutdown
    #field int NextAuditRecordId
#endstruct

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