ホーム › Security.Authentication.Identity › LSA_FOREST_TRUST_RECORD
LSA_FOREST_TRUST_RECORD
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Flags | DWORD | 4 | +0 | +0 | フォレスト信頼レコードのフラグ(無効化状態等)。 |
| ForestTrustType | LSA_FOREST_TRUST_RECORD_TYPE | 4 | +4 | +4 | レコード種別(トップレベル名/ドメイン情報等)を示す列挙値。 |
| Time | LONGLONG | 8 | +8 | +8 | レコードの作成/変更日時(100ナノ秒単位)。 |
| ForestTrustData | _ForestTrustData_e__Union | 40/20 | +16 | +16 | 種別に応じた実データを格納する共用体。 |
共用体: _ForestTrustData_e__Union x64 40B / x86 20B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| TopLevelName | LSA_UNICODE_STRING | 16/8 | +0 | +0 |
| DomainInfo | LSA_FOREST_TRUST_DOMAIN_INFO | 40/20 | +0 | +0 |
| Data | LSA_FOREST_TRUST_BINARY_DATA | 16/8 | +0 | +0 |
各言語での定義
#include <windows.h>
// LSA_FOREST_TRUST_RECORD (x64 56 / x86 40 バイト)
typedef struct LSA_FOREST_TRUST_RECORD {
DWORD Flags;
LSA_FOREST_TRUST_RECORD_TYPE ForestTrustType;
LONGLONG Time;
_ForestTrustData_e__Union ForestTrustData;
} LSA_FOREST_TRUST_RECORD;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct LSA_FOREST_TRUST_RECORD
{
public uint Flags;
public int ForestTrustType;
public long Time;
public _ForestTrustData_e__Union ForestTrustData;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure LSA_FOREST_TRUST_RECORD
Public Flags As UInteger
Public ForestTrustType As Integer
Public Time As Long
Public ForestTrustData As _ForestTrustData_e__Union
End Structureimport ctypes
from ctypes import wintypes
class LSA_FOREST_TRUST_RECORD(ctypes.Structure):
_fields_ = [
("Flags", wintypes.DWORD),
("ForestTrustType", ctypes.c_int),
("Time", ctypes.c_longlong),
("ForestTrustData", _ForestTrustData_e__Union),
]#[repr(C)]
pub struct LSA_FOREST_TRUST_RECORD {
pub Flags: u32,
pub ForestTrustType: i32,
pub Time: i64,
pub ForestTrustData: _ForestTrustData_e__Union,
}import "golang.org/x/sys/windows"
type LSA_FOREST_TRUST_RECORD struct {
Flags uint32
ForestTrustType int32
Time int64
ForestTrustData _ForestTrustData_e__Union
}type
LSA_FOREST_TRUST_RECORD = record
Flags: DWORD;
ForestTrustType: Integer;
Time: Int64;
ForestTrustData: _ForestTrustData_e__Union;
end;const LSA_FOREST_TRUST_RECORD = extern struct {
Flags: u32,
ForestTrustType: i32,
Time: i64,
ForestTrustData: _ForestTrustData_e__Union,
};type
LSA_FOREST_TRUST_RECORD {.bycopy.} = object
Flags: uint32
ForestTrustType: int32
Time: int64
ForestTrustData: _ForestTrustData_e__Unionstruct LSA_FOREST_TRUST_RECORD
{
uint Flags;
int ForestTrustType;
long Time;
_ForestTrustData_e__Union ForestTrustData;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; LSA_FOREST_TRUST_RECORD サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Flags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ForestTrustType : LSA_FOREST_TRUST_RECORD_TYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Time : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ForestTrustData : _ForestTrustData_e__Union (+16, 20byte) varptr(st)+16 を基点に操作(20byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LSA_FOREST_TRUST_RECORD サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; Flags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ForestTrustType : LSA_FOREST_TRUST_RECORD_TYPE (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Time : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ForestTrustData : _ForestTrustData_e__Union (+16, 40byte) varptr(st)+16 を基点に操作(40byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LSA_FOREST_TRUST_RECORD
#field int Flags
#field int ForestTrustType
#field int64 Time
#field byte ForestTrustData 40
#endstruct
stdim st, LSA_FOREST_TRUST_RECORD ; NSTRUCT 変数を確保
st->Flags = 100
mes "Flags=" + st->Flags
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。