Win32 API 日本語リファレンス
ホームSystem.Ioctl › FILE_LAYOUT_INFO_ENTRY

FILE_LAYOUT_INFO_ENTRY

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

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

フィールド

フィールドサイズx64x86説明
BasicInformation_BasicInformation_e__Struct40+0+0ファイルの基本情報(タイムスタンプ・属性)を保持する内部構造体。
OwnerIdDWORD4+40+40ファイルの所有者ID。
SecurityIdDWORD4+44+44ファイルに関連付けられたセキュリティID。
UsnLONGLONG8+48+48ファイルの最新USN(更新シーケンス番号)。
StorageReserveIdSTORAGE_RESERVE_ID4+56+56ファイルに関連付けられたストレージ予約IDを示す列挙値。

構造体: _BasicInformation_e__Struct x64 40B / x86 40B

フィールドサイズx64x86
CreationTimeLONGLONG8+0+0
LastAccessTimeLONGLONG8+8+8
LastWriteTimeLONGLONG8+16+16
ChangeTimeLONGLONG8+24+24
FileAttributesDWORD4+32+32

各言語での定義

#include <windows.h>

// FILE_LAYOUT_INFO_ENTRY  (x64 64 / x86 64 バイト)
typedef struct FILE_LAYOUT_INFO_ENTRY {
    _BasicInformation_e__Struct BasicInformation;
    DWORD OwnerId;
    DWORD SecurityId;
    LONGLONG Usn;
    STORAGE_RESERVE_ID StorageReserveId;
} FILE_LAYOUT_INFO_ENTRY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILE_LAYOUT_INFO_ENTRY
{
    public _BasicInformation_e__Struct BasicInformation;
    public uint OwnerId;
    public uint SecurityId;
    public long Usn;
    public int StorageReserveId;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILE_LAYOUT_INFO_ENTRY
    Public BasicInformation As _BasicInformation_e__Struct
    Public OwnerId As UInteger
    Public SecurityId As UInteger
    Public Usn As Long
    Public StorageReserveId As Integer
End Structure
import ctypes
from ctypes import wintypes

class FILE_LAYOUT_INFO_ENTRY(ctypes.Structure):
    _fields_ = [
        ("BasicInformation", _BasicInformation_e__Struct),
        ("OwnerId", wintypes.DWORD),
        ("SecurityId", wintypes.DWORD),
        ("Usn", ctypes.c_longlong),
        ("StorageReserveId", ctypes.c_int),
    ]
#[repr(C)]
pub struct FILE_LAYOUT_INFO_ENTRY {
    pub BasicInformation: _BasicInformation_e__Struct,
    pub OwnerId: u32,
    pub SecurityId: u32,
    pub Usn: i64,
    pub StorageReserveId: i32,
}
import "golang.org/x/sys/windows"

type FILE_LAYOUT_INFO_ENTRY struct {
	BasicInformation _BasicInformation_e__Struct
	OwnerId uint32
	SecurityId uint32
	Usn int64
	StorageReserveId int32
}
type
  FILE_LAYOUT_INFO_ENTRY = record
    BasicInformation: _BasicInformation_e__Struct;
    OwnerId: DWORD;
    SecurityId: DWORD;
    Usn: Int64;
    StorageReserveId: Integer;
  end;
const FILE_LAYOUT_INFO_ENTRY = extern struct {
    BasicInformation: _BasicInformation_e__Struct,
    OwnerId: u32,
    SecurityId: u32,
    Usn: i64,
    StorageReserveId: i32,
};
type
  FILE_LAYOUT_INFO_ENTRY {.bycopy.} = object
    BasicInformation: _BasicInformation_e__Struct
    OwnerId: uint32
    SecurityId: uint32
    Usn: int64
    StorageReserveId: int32
struct FILE_LAYOUT_INFO_ENTRY
{
    _BasicInformation_e__Struct BasicInformation;
    uint OwnerId;
    uint SecurityId;
    long Usn;
    int StorageReserveId;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FILE_LAYOUT_INFO_ENTRY サイズ: 64 バイト(x64)
dim st, 16    ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; BasicInformation : _BasicInformation_e__Struct (+0, 40byte)  varptr(st)+0 を基点に操作(40byte:入れ子/配列)
; OwnerId : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; SecurityId : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; Usn : LONGLONG (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; StorageReserveId : STORAGE_RESERVE_ID (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FILE_LAYOUT_INFO_ENTRY
    #field _BasicInformation_e__Struct BasicInformation
    #field int OwnerId
    #field int SecurityId
    #field int64 Usn
    #field int StorageReserveId
#endstruct

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