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

FILE_STAT_LX_INFORMATION

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

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

フィールド

フィールドサイズx64x86説明
FileIdLONGLONG8+0+0ファイルを一意に識別するファイルID。
CreationTimeLONGLONG8+8+8ファイル作成日時。
LastAccessTimeLONGLONG8+16+16最終アクセス日時。
LastWriteTimeLONGLONG8+24+24最終書き込み日時。
ChangeTimeLONGLONG8+32+32最終属性変更日時。
AllocationSizeLONGLONG8+40+40ファイルに割り当てられたサイズをバイト単位で示す。
EndOfFileLONGLONG8+48+48ファイル末尾位置(実サイズ)をバイト単位で示す。
FileAttributesDWORD4+56+56ファイル属性フラグ。
ReparseTagDWORD4+60+60再解析ポイントのタグ値。
NumberOfLinksDWORD4+64+64ファイルへのハードリンク数。
EffectiveAccessDWORD4+68+68呼び出し元に許可された実効アクセス権。
LxFlagsDWORD4+72+72Linuxサブシステム(WSL)メタデータの有効性を示すフラグ。
LxUidDWORD4+76+76WSLにおけるファイル所有者のUID。
LxGidDWORD4+80+80WSLにおけるファイル所有グループのGID。
LxModeDWORD4+84+84WSLにおけるファイルのモード(パーミッション)。
LxDeviceIdMajorDWORD4+88+88デバイスファイルのメジャーデバイスID。
LxDeviceIdMinorDWORD4+92+92デバイスファイルのマイナーデバイスID。

各言語での定義

#include <windows.h>

// FILE_STAT_LX_INFORMATION  (x64 96 / x86 96 バイト)
typedef struct FILE_STAT_LX_INFORMATION {
    LONGLONG FileId;
    LONGLONG CreationTime;
    LONGLONG LastAccessTime;
    LONGLONG LastWriteTime;
    LONGLONG ChangeTime;
    LONGLONG AllocationSize;
    LONGLONG EndOfFile;
    DWORD FileAttributes;
    DWORD ReparseTag;
    DWORD NumberOfLinks;
    DWORD EffectiveAccess;
    DWORD LxFlags;
    DWORD LxUid;
    DWORD LxGid;
    DWORD LxMode;
    DWORD LxDeviceIdMajor;
    DWORD LxDeviceIdMinor;
} FILE_STAT_LX_INFORMATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILE_STAT_LX_INFORMATION
{
    public long FileId;
    public long CreationTime;
    public long LastAccessTime;
    public long LastWriteTime;
    public long ChangeTime;
    public long AllocationSize;
    public long EndOfFile;
    public uint FileAttributes;
    public uint ReparseTag;
    public uint NumberOfLinks;
    public uint EffectiveAccess;
    public uint LxFlags;
    public uint LxUid;
    public uint LxGid;
    public uint LxMode;
    public uint LxDeviceIdMajor;
    public uint LxDeviceIdMinor;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILE_STAT_LX_INFORMATION
    Public FileId As Long
    Public CreationTime As Long
    Public LastAccessTime As Long
    Public LastWriteTime As Long
    Public ChangeTime As Long
    Public AllocationSize As Long
    Public EndOfFile As Long
    Public FileAttributes As UInteger
    Public ReparseTag As UInteger
    Public NumberOfLinks As UInteger
    Public EffectiveAccess As UInteger
    Public LxFlags As UInteger
    Public LxUid As UInteger
    Public LxGid As UInteger
    Public LxMode As UInteger
    Public LxDeviceIdMajor As UInteger
    Public LxDeviceIdMinor As UInteger
End Structure
import ctypes
from ctypes import wintypes

class FILE_STAT_LX_INFORMATION(ctypes.Structure):
    _fields_ = [
        ("FileId", ctypes.c_longlong),
        ("CreationTime", ctypes.c_longlong),
        ("LastAccessTime", ctypes.c_longlong),
        ("LastWriteTime", ctypes.c_longlong),
        ("ChangeTime", ctypes.c_longlong),
        ("AllocationSize", ctypes.c_longlong),
        ("EndOfFile", ctypes.c_longlong),
        ("FileAttributes", wintypes.DWORD),
        ("ReparseTag", wintypes.DWORD),
        ("NumberOfLinks", wintypes.DWORD),
        ("EffectiveAccess", wintypes.DWORD),
        ("LxFlags", wintypes.DWORD),
        ("LxUid", wintypes.DWORD),
        ("LxGid", wintypes.DWORD),
        ("LxMode", wintypes.DWORD),
        ("LxDeviceIdMajor", wintypes.DWORD),
        ("LxDeviceIdMinor", wintypes.DWORD),
    ]
#[repr(C)]
pub struct FILE_STAT_LX_INFORMATION {
    pub FileId: i64,
    pub CreationTime: i64,
    pub LastAccessTime: i64,
    pub LastWriteTime: i64,
    pub ChangeTime: i64,
    pub AllocationSize: i64,
    pub EndOfFile: i64,
    pub FileAttributes: u32,
    pub ReparseTag: u32,
    pub NumberOfLinks: u32,
    pub EffectiveAccess: u32,
    pub LxFlags: u32,
    pub LxUid: u32,
    pub LxGid: u32,
    pub LxMode: u32,
    pub LxDeviceIdMajor: u32,
    pub LxDeviceIdMinor: u32,
}
import "golang.org/x/sys/windows"

type FILE_STAT_LX_INFORMATION struct {
	FileId int64
	CreationTime int64
	LastAccessTime int64
	LastWriteTime int64
	ChangeTime int64
	AllocationSize int64
	EndOfFile int64
	FileAttributes uint32
	ReparseTag uint32
	NumberOfLinks uint32
	EffectiveAccess uint32
	LxFlags uint32
	LxUid uint32
	LxGid uint32
	LxMode uint32
	LxDeviceIdMajor uint32
	LxDeviceIdMinor uint32
}
type
  FILE_STAT_LX_INFORMATION = record
    FileId: Int64;
    CreationTime: Int64;
    LastAccessTime: Int64;
    LastWriteTime: Int64;
    ChangeTime: Int64;
    AllocationSize: Int64;
    EndOfFile: Int64;
    FileAttributes: DWORD;
    ReparseTag: DWORD;
    NumberOfLinks: DWORD;
    EffectiveAccess: DWORD;
    LxFlags: DWORD;
    LxUid: DWORD;
    LxGid: DWORD;
    LxMode: DWORD;
    LxDeviceIdMajor: DWORD;
    LxDeviceIdMinor: DWORD;
  end;
const FILE_STAT_LX_INFORMATION = extern struct {
    FileId: i64,
    CreationTime: i64,
    LastAccessTime: i64,
    LastWriteTime: i64,
    ChangeTime: i64,
    AllocationSize: i64,
    EndOfFile: i64,
    FileAttributes: u32,
    ReparseTag: u32,
    NumberOfLinks: u32,
    EffectiveAccess: u32,
    LxFlags: u32,
    LxUid: u32,
    LxGid: u32,
    LxMode: u32,
    LxDeviceIdMajor: u32,
    LxDeviceIdMinor: u32,
};
type
  FILE_STAT_LX_INFORMATION {.bycopy.} = object
    FileId: int64
    CreationTime: int64
    LastAccessTime: int64
    LastWriteTime: int64
    ChangeTime: int64
    AllocationSize: int64
    EndOfFile: int64
    FileAttributes: uint32
    ReparseTag: uint32
    NumberOfLinks: uint32
    EffectiveAccess: uint32
    LxFlags: uint32
    LxUid: uint32
    LxGid: uint32
    LxMode: uint32
    LxDeviceIdMajor: uint32
    LxDeviceIdMinor: uint32
struct FILE_STAT_LX_INFORMATION
{
    long FileId;
    long CreationTime;
    long LastAccessTime;
    long LastWriteTime;
    long ChangeTime;
    long AllocationSize;
    long EndOfFile;
    uint FileAttributes;
    uint ReparseTag;
    uint NumberOfLinks;
    uint EffectiveAccess;
    uint LxFlags;
    uint LxUid;
    uint LxGid;
    uint LxMode;
    uint LxDeviceIdMajor;
    uint LxDeviceIdMinor;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FILE_STAT_LX_INFORMATION サイズ: 96 バイト(x64)
dim st, 24    ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; FileId : LONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; CreationTime : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; LastAccessTime : LONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; LastWriteTime : LONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ChangeTime : LONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; AllocationSize : LONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; EndOfFile : LONGLONG (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; FileAttributes : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; ReparseTag : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; NumberOfLinks : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; EffectiveAccess : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; LxFlags : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; LxUid : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; LxGid : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; LxMode : DWORD (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; LxDeviceIdMajor : DWORD (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; LxDeviceIdMinor : DWORD (+92, 4byte)  st.23 = 値  /  値 = st.23   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FILE_STAT_LX_INFORMATION
    #field int64 FileId
    #field int64 CreationTime
    #field int64 LastAccessTime
    #field int64 LastWriteTime
    #field int64 ChangeTime
    #field int64 AllocationSize
    #field int64 EndOfFile
    #field int FileAttributes
    #field int ReparseTag
    #field int NumberOfLinks
    #field int EffectiveAccess
    #field int LxFlags
    #field int LxUid
    #field int LxGid
    #field int LxMode
    #field int LxDeviceIdMajor
    #field int LxDeviceIdMinor
#endstruct

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