ホーム › System.Ioctl › FILE_QUERY_ON_DISK_VOL_INFO_BUFFER
FILE_QUERY_ON_DISK_VOL_INFO_BUFFER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| DirectoryCount | LONGLONG | 8 | +0 | +0 | ボリューム上のディレクトリ数。不明時は-1。 |
| FileCount | LONGLONG | 8 | +8 | +8 | ボリューム上のファイル数。不明時は-1。 |
| FsFormatMajVersion | WORD | 2 | +16 | +16 | ファイルシステムフォーマットのメジャーバージョン。 |
| FsFormatMinVersion | WORD | 2 | +18 | +18 | ファイルシステムフォーマットのマイナーバージョン。 |
| FsFormatName | WCHAR | 24 | +20 | +20 | ファイルシステムフォーマット名のWCHAR配列。 |
| FormatTime | LONGLONG | 8 | +48 | +48 | ボリュームがフォーマットされた日時。 |
| LastUpdateTime | LONGLONG | 8 | +56 | +56 | ボリュームが最後に更新された日時。 |
| CopyrightInfo | WCHAR | 68 | +64 | +64 | 著作権情報を表すWCHAR配列。 |
| AbstractInfo | WCHAR | 68 | +132 | +132 | 概要(アブストラクト)情報を表すWCHAR配列。 |
| FormattingImplementationInfo | WCHAR | 68 | +200 | +200 | フォーマットを実施した実装の情報を表すWCHAR配列。 |
| LastModifyingImplementationInfo | WCHAR | 68 | +268 | +268 | 最後に変更した実装の情報を表すWCHAR配列。 |
各言語での定義
#include <windows.h>
// FILE_QUERY_ON_DISK_VOL_INFO_BUFFER (x64 336 / x86 336 バイト)
typedef struct FILE_QUERY_ON_DISK_VOL_INFO_BUFFER {
LONGLONG DirectoryCount;
LONGLONG FileCount;
WORD FsFormatMajVersion;
WORD FsFormatMinVersion;
WCHAR FsFormatName[12];
LONGLONG FormatTime;
LONGLONG LastUpdateTime;
WCHAR CopyrightInfo[34];
WCHAR AbstractInfo[34];
WCHAR FormattingImplementationInfo[34];
WCHAR LastModifyingImplementationInfo[34];
} FILE_QUERY_ON_DISK_VOL_INFO_BUFFER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILE_QUERY_ON_DISK_VOL_INFO_BUFFER
{
public long DirectoryCount;
public long FileCount;
public ushort FsFormatMajVersion;
public ushort FsFormatMinVersion;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 12)] public string FsFormatName;
public long FormatTime;
public long LastUpdateTime;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 34)] public string CopyrightInfo;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 34)] public string AbstractInfo;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 34)] public string FormattingImplementationInfo;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 34)] public string LastModifyingImplementationInfo;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILE_QUERY_ON_DISK_VOL_INFO_BUFFER
Public DirectoryCount As Long
Public FileCount As Long
Public FsFormatMajVersion As UShort
Public FsFormatMinVersion As UShort
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=12)> Public FsFormatName As String
Public FormatTime As Long
Public LastUpdateTime As Long
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=34)> Public CopyrightInfo As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=34)> Public AbstractInfo As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=34)> Public FormattingImplementationInfo As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=34)> Public LastModifyingImplementationInfo As String
End Structureimport ctypes
from ctypes import wintypes
class FILE_QUERY_ON_DISK_VOL_INFO_BUFFER(ctypes.Structure):
_fields_ = [
("DirectoryCount", ctypes.c_longlong),
("FileCount", ctypes.c_longlong),
("FsFormatMajVersion", ctypes.c_ushort),
("FsFormatMinVersion", ctypes.c_ushort),
("FsFormatName", ctypes.c_wchar * 12),
("FormatTime", ctypes.c_longlong),
("LastUpdateTime", ctypes.c_longlong),
("CopyrightInfo", ctypes.c_wchar * 34),
("AbstractInfo", ctypes.c_wchar * 34),
("FormattingImplementationInfo", ctypes.c_wchar * 34),
("LastModifyingImplementationInfo", ctypes.c_wchar * 34),
]#[repr(C)]
pub struct FILE_QUERY_ON_DISK_VOL_INFO_BUFFER {
pub DirectoryCount: i64,
pub FileCount: i64,
pub FsFormatMajVersion: u16,
pub FsFormatMinVersion: u16,
pub FsFormatName: [u16; 12],
pub FormatTime: i64,
pub LastUpdateTime: i64,
pub CopyrightInfo: [u16; 34],
pub AbstractInfo: [u16; 34],
pub FormattingImplementationInfo: [u16; 34],
pub LastModifyingImplementationInfo: [u16; 34],
}import "golang.org/x/sys/windows"
type FILE_QUERY_ON_DISK_VOL_INFO_BUFFER struct {
DirectoryCount int64
FileCount int64
FsFormatMajVersion uint16
FsFormatMinVersion uint16
FsFormatName [12]uint16
FormatTime int64
LastUpdateTime int64
CopyrightInfo [34]uint16
AbstractInfo [34]uint16
FormattingImplementationInfo [34]uint16
LastModifyingImplementationInfo [34]uint16
}type
FILE_QUERY_ON_DISK_VOL_INFO_BUFFER = record
DirectoryCount: Int64;
FileCount: Int64;
FsFormatMajVersion: Word;
FsFormatMinVersion: Word;
FsFormatName: array[0..11] of WideChar;
FormatTime: Int64;
LastUpdateTime: Int64;
CopyrightInfo: array[0..33] of WideChar;
AbstractInfo: array[0..33] of WideChar;
FormattingImplementationInfo: array[0..33] of WideChar;
LastModifyingImplementationInfo: array[0..33] of WideChar;
end;const FILE_QUERY_ON_DISK_VOL_INFO_BUFFER = extern struct {
DirectoryCount: i64,
FileCount: i64,
FsFormatMajVersion: u16,
FsFormatMinVersion: u16,
FsFormatName: [12]u16,
FormatTime: i64,
LastUpdateTime: i64,
CopyrightInfo: [34]u16,
AbstractInfo: [34]u16,
FormattingImplementationInfo: [34]u16,
LastModifyingImplementationInfo: [34]u16,
};type
FILE_QUERY_ON_DISK_VOL_INFO_BUFFER {.bycopy.} = object
DirectoryCount: int64
FileCount: int64
FsFormatMajVersion: uint16
FsFormatMinVersion: uint16
FsFormatName: array[12, uint16]
FormatTime: int64
LastUpdateTime: int64
CopyrightInfo: array[34, uint16]
AbstractInfo: array[34, uint16]
FormattingImplementationInfo: array[34, uint16]
LastModifyingImplementationInfo: array[34, uint16]struct FILE_QUERY_ON_DISK_VOL_INFO_BUFFER
{
long DirectoryCount;
long FileCount;
ushort FsFormatMajVersion;
ushort FsFormatMinVersion;
wchar[12] FsFormatName;
long FormatTime;
long LastUpdateTime;
wchar[34] CopyrightInfo;
wchar[34] AbstractInfo;
wchar[34] FormattingImplementationInfo;
wchar[34] LastModifyingImplementationInfo;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FILE_QUERY_ON_DISK_VOL_INFO_BUFFER サイズ: 336 バイト(x64)
dim st, 84 ; 4byte整数×84(構造体サイズ 336 / 4 切り上げ)
; DirectoryCount : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; FileCount : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; FsFormatMajVersion : WORD (+16, 2byte) wpoke st,16,値 / 値 = wpeek(st,16)
; FsFormatMinVersion : WORD (+18, 2byte) wpoke st,18,値 / 値 = wpeek(st,18)
; FsFormatName : WCHAR (+20, 24byte) varptr(st)+20 を基点に操作(24byte:入れ子/配列)
; FormatTime : LONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; LastUpdateTime : LONGLONG (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; CopyrightInfo : WCHAR (+64, 68byte) varptr(st)+64 を基点に操作(68byte:入れ子/配列)
; AbstractInfo : WCHAR (+132, 68byte) varptr(st)+132 を基点に操作(68byte:入れ子/配列)
; FormattingImplementationInfo : WCHAR (+200, 68byte) varptr(st)+200 を基点に操作(68byte:入れ子/配列)
; LastModifyingImplementationInfo : WCHAR (+268, 68byte) varptr(st)+268 を基点に操作(68byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FILE_QUERY_ON_DISK_VOL_INFO_BUFFER
#field int64 DirectoryCount
#field int64 FileCount
#field short FsFormatMajVersion
#field short FsFormatMinVersion
#field wchar FsFormatName 12
#field int64 FormatTime
#field int64 LastUpdateTime
#field wchar CopyrightInfo 34
#field wchar AbstractInfo 34
#field wchar FormattingImplementationInfo 34
#field wchar LastModifyingImplementationInfo 34
#endstruct
stdim st, FILE_QUERY_ON_DISK_VOL_INFO_BUFFER ; NSTRUCT 変数を確保
st->DirectoryCount = 100
mes "DirectoryCount=" + st->DirectoryCount