ホーム › Storage.FileSystem › FILE_INFO_3
FILE_INFO_3
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| fi3_id | DWORD | 4 | +0 | +0 | 開かれているリソース(ファイル/デバイス/パイプ)の識別子。 |
| fi3_permissions | FILE_INFO_FLAGS_PERMISSIONS | 4 | +4 | +4 | リソースに付与されたアクセス権ビットマスク(読取/書込等)。 |
| fi3_num_locks | DWORD | 4 | +8 | +8 | リソースに設定されているロックの数。 |
| fi3_pathname | LPWSTR | 8/4 | +16 | +12 | 開かれているリソースのパス名を指すUnicode文字列。 |
| fi3_username | LPWSTR | 8/4 | +24 | +16 | リソースを開いたユーザーの名前。 |
各言語での定義
#include <windows.h>
// FILE_INFO_3 (x64 32 / x86 20 バイト)
typedef struct FILE_INFO_3 {
DWORD fi3_id;
FILE_INFO_FLAGS_PERMISSIONS fi3_permissions;
DWORD fi3_num_locks;
LPWSTR fi3_pathname;
LPWSTR fi3_username;
} FILE_INFO_3;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILE_INFO_3
{
public uint fi3_id;
public uint fi3_permissions;
public uint fi3_num_locks;
public IntPtr fi3_pathname;
public IntPtr fi3_username;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILE_INFO_3
Public fi3_id As UInteger
Public fi3_permissions As UInteger
Public fi3_num_locks As UInteger
Public fi3_pathname As IntPtr
Public fi3_username As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class FILE_INFO_3(ctypes.Structure):
_fields_ = [
("fi3_id", wintypes.DWORD),
("fi3_permissions", wintypes.DWORD),
("fi3_num_locks", wintypes.DWORD),
("fi3_pathname", ctypes.c_void_p),
("fi3_username", ctypes.c_void_p),
]#[repr(C)]
pub struct FILE_INFO_3 {
pub fi3_id: u32,
pub fi3_permissions: u32,
pub fi3_num_locks: u32,
pub fi3_pathname: *mut core::ffi::c_void,
pub fi3_username: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type FILE_INFO_3 struct {
fi3_id uint32
fi3_permissions uint32
fi3_num_locks uint32
fi3_pathname uintptr
fi3_username uintptr
}type
FILE_INFO_3 = record
fi3_id: DWORD;
fi3_permissions: DWORD;
fi3_num_locks: DWORD;
fi3_pathname: Pointer;
fi3_username: Pointer;
end;const FILE_INFO_3 = extern struct {
fi3_id: u32,
fi3_permissions: u32,
fi3_num_locks: u32,
fi3_pathname: ?*anyopaque,
fi3_username: ?*anyopaque,
};type
FILE_INFO_3 {.bycopy.} = object
fi3_id: uint32
fi3_permissions: uint32
fi3_num_locks: uint32
fi3_pathname: pointer
fi3_username: pointerstruct FILE_INFO_3
{
uint fi3_id;
uint fi3_permissions;
uint fi3_num_locks;
void* fi3_pathname;
void* fi3_username;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; FILE_INFO_3 サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; fi3_id : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fi3_permissions : FILE_INFO_FLAGS_PERMISSIONS (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fi3_num_locks : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fi3_pathname : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; fi3_username : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FILE_INFO_3 サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; fi3_id : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fi3_permissions : FILE_INFO_FLAGS_PERMISSIONS (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fi3_num_locks : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; fi3_pathname : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; fi3_username : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FILE_INFO_3
#field int fi3_id
#field int fi3_permissions
#field int fi3_num_locks
#field intptr fi3_pathname
#field intptr fi3_username
#endstruct
stdim st, FILE_INFO_3 ; NSTRUCT 変数を確保
st->fi3_id = 100
mes "fi3_id=" + st->fi3_id