ホーム › System.SystemServices › FILE_NOTIFY_FULL_INFORMATION
FILE_NOTIFY_FULL_INFORMATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| NextEntryOffset | DWORD | 4 | +0 | +0 | 次エントリへのバイトオフセット。0なら最終エントリ。 |
| Action | DWORD | 4 | +4 | +4 | ファイルへの変更操作種別(追加/削除/変更等)を示す。 |
| CreationTime | LONGLONG | 8 | +8 | +8 | ファイル作成日時(FILETIME相当の100ナノ秒単位)。 |
| LastModificationTime | LONGLONG | 8 | +16 | +16 | 最終データ変更日時。 |
| LastChangeTime | LONGLONG | 8 | +24 | +24 | 最終属性変更日時。 |
| LastAccessTime | LONGLONG | 8 | +32 | +32 | 最終アクセス日時。 |
| AllocatedLength | LONGLONG | 8 | +40 | +40 | ファイルに割り当てられたサイズをバイト単位で示す。 |
| FileSize | LONGLONG | 8 | +48 | +48 | ファイルの実サイズをバイト単位で示す。 |
| FileAttributes | DWORD | 4 | +56 | +56 | ファイル属性フラグ。 |
| Anonymous | _Anonymous_e__Union | 4 | +60 | +60 | ReparsePointTagやEAサイズ等を保持する無名共用体。 |
| FileId | LONGLONG | 8 | +64 | +64 | ファイルを一意に識別するファイルID。 |
| ParentFileId | LONGLONG | 8 | +72 | +72 | 親ディレクトリのファイルID。 |
| FileNameLength | WORD | 2 | +80 | +80 | ファイル名のバイト長を示す。 |
| FileNameFlags | BYTE | 1 | +82 | +82 | ファイル名に関するフラグ。 |
| Reserved | BYTE | 1 | +83 | +83 | 予約バイト。 |
| FileName | WCHAR | 2 | +84 | +84 | 変更されたファイルの名前(WCHAR配列、可変長)。 |
共用体: _Anonymous_e__Union x64 4B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| ReparsePointTag | DWORD | 4 | +0 | +0 |
| EaSize | DWORD | 4 | +0 | +0 |
各言語での定義
#include <windows.h>
// FILE_NOTIFY_FULL_INFORMATION (x64 88 / x86 88 バイト)
typedef struct FILE_NOTIFY_FULL_INFORMATION {
DWORD NextEntryOffset;
DWORD Action;
LONGLONG CreationTime;
LONGLONG LastModificationTime;
LONGLONG LastChangeTime;
LONGLONG LastAccessTime;
LONGLONG AllocatedLength;
LONGLONG FileSize;
DWORD FileAttributes;
_Anonymous_e__Union Anonymous;
LONGLONG FileId;
LONGLONG ParentFileId;
WORD FileNameLength;
BYTE FileNameFlags;
BYTE Reserved;
WCHAR FileName[1];
} FILE_NOTIFY_FULL_INFORMATION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILE_NOTIFY_FULL_INFORMATION
{
public uint NextEntryOffset;
public uint Action;
public long CreationTime;
public long LastModificationTime;
public long LastChangeTime;
public long LastAccessTime;
public long AllocatedLength;
public long FileSize;
public uint FileAttributes;
public _Anonymous_e__Union Anonymous;
public long FileId;
public long ParentFileId;
public ushort FileNameLength;
public byte FileNameFlags;
public byte Reserved;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)] public string FileName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILE_NOTIFY_FULL_INFORMATION
Public NextEntryOffset As UInteger
Public Action As UInteger
Public CreationTime As Long
Public LastModificationTime As Long
Public LastChangeTime As Long
Public LastAccessTime As Long
Public AllocatedLength As Long
Public FileSize As Long
Public FileAttributes As UInteger
Public Anonymous As _Anonymous_e__Union
Public FileId As Long
Public ParentFileId As Long
Public FileNameLength As UShort
Public FileNameFlags As Byte
Public Reserved As Byte
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=1)> Public FileName As String
End Structureimport ctypes
from ctypes import wintypes
class FILE_NOTIFY_FULL_INFORMATION(ctypes.Structure):
_fields_ = [
("NextEntryOffset", wintypes.DWORD),
("Action", wintypes.DWORD),
("CreationTime", ctypes.c_longlong),
("LastModificationTime", ctypes.c_longlong),
("LastChangeTime", ctypes.c_longlong),
("LastAccessTime", ctypes.c_longlong),
("AllocatedLength", ctypes.c_longlong),
("FileSize", ctypes.c_longlong),
("FileAttributes", wintypes.DWORD),
("Anonymous", _Anonymous_e__Union),
("FileId", ctypes.c_longlong),
("ParentFileId", ctypes.c_longlong),
("FileNameLength", ctypes.c_ushort),
("FileNameFlags", ctypes.c_ubyte),
("Reserved", ctypes.c_ubyte),
("FileName", ctypes.c_wchar * 1),
]#[repr(C)]
pub struct FILE_NOTIFY_FULL_INFORMATION {
pub NextEntryOffset: u32,
pub Action: u32,
pub CreationTime: i64,
pub LastModificationTime: i64,
pub LastChangeTime: i64,
pub LastAccessTime: i64,
pub AllocatedLength: i64,
pub FileSize: i64,
pub FileAttributes: u32,
pub Anonymous: _Anonymous_e__Union,
pub FileId: i64,
pub ParentFileId: i64,
pub FileNameLength: u16,
pub FileNameFlags: u8,
pub Reserved: u8,
pub FileName: [u16; 1],
}import "golang.org/x/sys/windows"
type FILE_NOTIFY_FULL_INFORMATION struct {
NextEntryOffset uint32
Action uint32
CreationTime int64
LastModificationTime int64
LastChangeTime int64
LastAccessTime int64
AllocatedLength int64
FileSize int64
FileAttributes uint32
Anonymous _Anonymous_e__Union
FileId int64
ParentFileId int64
FileNameLength uint16
FileNameFlags byte
Reserved byte
FileName [1]uint16
}type
FILE_NOTIFY_FULL_INFORMATION = record
NextEntryOffset: DWORD;
Action: DWORD;
CreationTime: Int64;
LastModificationTime: Int64;
LastChangeTime: Int64;
LastAccessTime: Int64;
AllocatedLength: Int64;
FileSize: Int64;
FileAttributes: DWORD;
Anonymous: _Anonymous_e__Union;
FileId: Int64;
ParentFileId: Int64;
FileNameLength: Word;
FileNameFlags: Byte;
Reserved: Byte;
FileName: array[0..0] of WideChar;
end;const FILE_NOTIFY_FULL_INFORMATION = extern struct {
NextEntryOffset: u32,
Action: u32,
CreationTime: i64,
LastModificationTime: i64,
LastChangeTime: i64,
LastAccessTime: i64,
AllocatedLength: i64,
FileSize: i64,
FileAttributes: u32,
Anonymous: _Anonymous_e__Union,
FileId: i64,
ParentFileId: i64,
FileNameLength: u16,
FileNameFlags: u8,
Reserved: u8,
FileName: [1]u16,
};type
FILE_NOTIFY_FULL_INFORMATION {.bycopy.} = object
NextEntryOffset: uint32
Action: uint32
CreationTime: int64
LastModificationTime: int64
LastChangeTime: int64
LastAccessTime: int64
AllocatedLength: int64
FileSize: int64
FileAttributes: uint32
Anonymous: _Anonymous_e__Union
FileId: int64
ParentFileId: int64
FileNameLength: uint16
FileNameFlags: uint8
Reserved: uint8
FileName: array[1, uint16]struct FILE_NOTIFY_FULL_INFORMATION
{
uint NextEntryOffset;
uint Action;
long CreationTime;
long LastModificationTime;
long LastChangeTime;
long LastAccessTime;
long AllocatedLength;
long FileSize;
uint FileAttributes;
_Anonymous_e__Union Anonymous;
long FileId;
long ParentFileId;
ushort FileNameLength;
ubyte FileNameFlags;
ubyte Reserved;
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_NOTIFY_FULL_INFORMATION サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; NextEntryOffset : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Action : 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,上位
; LastModificationTime : LONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; LastChangeTime : LONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; LastAccessTime : LONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; AllocatedLength : LONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; FileSize : 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 も可)
; Anonymous : _Anonymous_e__Union (+60, 4byte) varptr(st)+60 を基点に操作(4byte:入れ子/配列)
; FileId : LONGLONG (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; ParentFileId : LONGLONG (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; FileNameLength : WORD (+80, 2byte) wpoke st,80,値 / 値 = wpeek(st,80)
; FileNameFlags : BYTE (+82, 1byte) poke st,82,値 / 値 = peek(st,82)
; Reserved : BYTE (+83, 1byte) poke st,83,値 / 値 = peek(st,83)
; FileName : WCHAR (+84, 2byte) varptr(st)+84 を基点に操作(2byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FILE_NOTIFY_FULL_INFORMATION
#field int NextEntryOffset
#field int Action
#field int64 CreationTime
#field int64 LastModificationTime
#field int64 LastChangeTime
#field int64 LastAccessTime
#field int64 AllocatedLength
#field int64 FileSize
#field int FileAttributes
#field byte Anonymous 4
#field int64 FileId
#field int64 ParentFileId
#field short FileNameLength
#field byte FileNameFlags
#field byte Reserved
#field wchar FileName 1
#endstruct
stdim st, FILE_NOTIFY_FULL_INFORMATION ; NSTRUCT 変数を確保
st->NextEntryOffset = 100
mes "NextEntryOffset=" + st->NextEntryOffset
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。