ホーム › Storage.FileSystem › FILE_ID_EXTD_DIR_INFO
FILE_ID_EXTD_DIR_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NextEntryOffset | DWORD | 4 | +0 | +0 | 次のエントリへのバイトオフセット。0なら最終エントリ。 |
| FileIndex | DWORD | 4 | +4 | +4 | ディレクトリ内のファイルインデックス。 |
| CreationTime | LONGLONG | 8 | +8 | +8 | ファイルの作成時刻(1601年起点の100ns単位)。 |
| LastAccessTime | LONGLONG | 8 | +16 | +16 | ファイルの最終アクセス時刻。 |
| LastWriteTime | LONGLONG | 8 | +24 | +24 | ファイルの最終書き込み時刻。 |
| ChangeTime | LONGLONG | 8 | +32 | +32 | ファイルメタデータの最終変更時刻。 |
| EndOfFile | LONGLONG | 8 | +40 | +40 | ファイル末尾位置すなわち実サイズ(バイト)。 |
| AllocationSize | LONGLONG | 8 | +48 | +48 | ファイルに割り当てられたサイズ(バイト)。 |
| FileAttributes | DWORD | 4 | +56 | +56 | ファイル属性ビットマスク(FILE_ATTRIBUTE_*)。 |
| FileNameLength | DWORD | 4 | +60 | +60 | FileNameのバイト長。 |
| EaSize | DWORD | 4 | +64 | +64 | 拡張属性(EA)のバイトサイズ。 |
| ReparsePointTag | DWORD | 4 | +68 | +68 | リパースポイントのタグ値。非該当時は0。 |
| FileId | FILE_ID_128 | 16 | +72 | +72 | 128ビットのファイル識別子。 |
| FileName | WCHAR | 2 | +88 | +88 | ファイル名(可変長WCHAR配列)。 |
各言語での定義
#include <windows.h>
// FILE_ID_128 (x64 16 / x86 16 バイト)
typedef struct FILE_ID_128 {
BYTE Identifier[16];
} FILE_ID_128;
// FILE_ID_EXTD_DIR_INFO (x64 96 / x86 96 バイト)
typedef struct FILE_ID_EXTD_DIR_INFO {
DWORD NextEntryOffset;
DWORD FileIndex;
LONGLONG CreationTime;
LONGLONG LastAccessTime;
LONGLONG LastWriteTime;
LONGLONG ChangeTime;
LONGLONG EndOfFile;
LONGLONG AllocationSize;
DWORD FileAttributes;
DWORD FileNameLength;
DWORD EaSize;
DWORD ReparsePointTag;
FILE_ID_128 FileId;
WCHAR FileName[1];
} FILE_ID_EXTD_DIR_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILE_ID_128
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public byte[] Identifier;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILE_ID_EXTD_DIR_INFO
{
public uint NextEntryOffset;
public uint FileIndex;
public long CreationTime;
public long LastAccessTime;
public long LastWriteTime;
public long ChangeTime;
public long EndOfFile;
public long AllocationSize;
public uint FileAttributes;
public uint FileNameLength;
public uint EaSize;
public uint ReparsePointTag;
public FILE_ID_128 FileId;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)] public string FileName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILE_ID_128
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)> Public Identifier() As Byte
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILE_ID_EXTD_DIR_INFO
Public NextEntryOffset As UInteger
Public FileIndex As UInteger
Public CreationTime As Long
Public LastAccessTime As Long
Public LastWriteTime As Long
Public ChangeTime As Long
Public EndOfFile As Long
Public AllocationSize As Long
Public FileAttributes As UInteger
Public FileNameLength As UInteger
Public EaSize As UInteger
Public ReparsePointTag As UInteger
Public FileId As FILE_ID_128
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=1)> Public FileName As String
End Structureimport ctypes
from ctypes import wintypes
class FILE_ID_128(ctypes.Structure):
_fields_ = [
("Identifier", ctypes.c_ubyte * 16),
]
class FILE_ID_EXTD_DIR_INFO(ctypes.Structure):
_fields_ = [
("NextEntryOffset", wintypes.DWORD),
("FileIndex", wintypes.DWORD),
("CreationTime", ctypes.c_longlong),
("LastAccessTime", ctypes.c_longlong),
("LastWriteTime", ctypes.c_longlong),
("ChangeTime", ctypes.c_longlong),
("EndOfFile", ctypes.c_longlong),
("AllocationSize", ctypes.c_longlong),
("FileAttributes", wintypes.DWORD),
("FileNameLength", wintypes.DWORD),
("EaSize", wintypes.DWORD),
("ReparsePointTag", wintypes.DWORD),
("FileId", FILE_ID_128),
("FileName", ctypes.c_wchar * 1),
]#[repr(C)]
pub struct FILE_ID_128 {
pub Identifier: [u8; 16],
}
#[repr(C)]
pub struct FILE_ID_EXTD_DIR_INFO {
pub NextEntryOffset: u32,
pub FileIndex: u32,
pub CreationTime: i64,
pub LastAccessTime: i64,
pub LastWriteTime: i64,
pub ChangeTime: i64,
pub EndOfFile: i64,
pub AllocationSize: i64,
pub FileAttributes: u32,
pub FileNameLength: u32,
pub EaSize: u32,
pub ReparsePointTag: u32,
pub FileId: FILE_ID_128,
pub FileName: [u16; 1],
}import "golang.org/x/sys/windows"
type FILE_ID_128 struct {
Identifier [16]byte
}
type FILE_ID_EXTD_DIR_INFO struct {
NextEntryOffset uint32
FileIndex uint32
CreationTime int64
LastAccessTime int64
LastWriteTime int64
ChangeTime int64
EndOfFile int64
AllocationSize int64
FileAttributes uint32
FileNameLength uint32
EaSize uint32
ReparsePointTag uint32
FileId FILE_ID_128
FileName [1]uint16
}type
FILE_ID_128 = record
Identifier: array[0..15] of Byte;
end;
FILE_ID_EXTD_DIR_INFO = record
NextEntryOffset: DWORD;
FileIndex: DWORD;
CreationTime: Int64;
LastAccessTime: Int64;
LastWriteTime: Int64;
ChangeTime: Int64;
EndOfFile: Int64;
AllocationSize: Int64;
FileAttributes: DWORD;
FileNameLength: DWORD;
EaSize: DWORD;
ReparsePointTag: DWORD;
FileId: FILE_ID_128;
FileName: array[0..0] of WideChar;
end;const FILE_ID_128 = extern struct {
Identifier: [16]u8,
};
const FILE_ID_EXTD_DIR_INFO = extern struct {
NextEntryOffset: u32,
FileIndex: u32,
CreationTime: i64,
LastAccessTime: i64,
LastWriteTime: i64,
ChangeTime: i64,
EndOfFile: i64,
AllocationSize: i64,
FileAttributes: u32,
FileNameLength: u32,
EaSize: u32,
ReparsePointTag: u32,
FileId: FILE_ID_128,
FileName: [1]u16,
};type
FILE_ID_128 {.bycopy.} = object
Identifier: array[16, uint8]
FILE_ID_EXTD_DIR_INFO {.bycopy.} = object
NextEntryOffset: uint32
FileIndex: uint32
CreationTime: int64
LastAccessTime: int64
LastWriteTime: int64
ChangeTime: int64
EndOfFile: int64
AllocationSize: int64
FileAttributes: uint32
FileNameLength: uint32
EaSize: uint32
ReparsePointTag: uint32
FileId: FILE_ID_128
FileName: array[1, uint16]struct FILE_ID_128
{
ubyte[16] Identifier;
}
struct FILE_ID_EXTD_DIR_INFO
{
uint NextEntryOffset;
uint FileIndex;
long CreationTime;
long LastAccessTime;
long LastWriteTime;
long ChangeTime;
long EndOfFile;
long AllocationSize;
uint FileAttributes;
uint FileNameLength;
uint EaSize;
uint ReparsePointTag;
FILE_ID_128 FileId;
wchar[1] FileName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FILE_ID_EXTD_DIR_INFO サイズ: 96 バイト(x64)
dim st, 24 ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; NextEntryOffset : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; FileIndex : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; 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,上位
; EndOfFile : LONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; AllocationSize : 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 も可)
; FileNameLength : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; EaSize : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; ReparsePointTag : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; FileId : FILE_ID_128 (+72, 16byte) varptr(st)+72 を基点に操作(16byte:入れ子/配列)
; FileName : WCHAR (+88, 2byte) varptr(st)+88 を基点に操作(2byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global FILE_ID_128
#field byte Identifier 16
#endstruct
#defstruct global FILE_ID_EXTD_DIR_INFO
#field int NextEntryOffset
#field int FileIndex
#field int64 CreationTime
#field int64 LastAccessTime
#field int64 LastWriteTime
#field int64 ChangeTime
#field int64 EndOfFile
#field int64 AllocationSize
#field int FileAttributes
#field int FileNameLength
#field int EaSize
#field int ReparsePointTag
#field FILE_ID_128 FileId
#field wchar FileName 1
#endstruct
stdim st, FILE_ID_EXTD_DIR_INFO ; NSTRUCT 変数を確保
st->NextEntryOffset = 100
mes "NextEntryOffset=" + st->NextEntryOffset