ホーム › Storage.FileSystem › DISK_SPACE_INFORMATION
DISK_SPACE_INFORMATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ActualTotalAllocationUnits | ULONGLONG | 8 | +0 | +0 | ActualTotalAllocationUnits は、クォータ設定を考慮しないボリュームの総サイズです。 |
| ActualAvailableAllocationUnits | ULONGLONG | 8 | +8 | +8 | ActualTotalAllocationUnits は、クォータ設定を考慮しないボリュームの使用可能領域です。 |
| ActualPoolUnavailableAllocationUnits | ULONGLONG | 8 | +16 | +16 | ActualPoolUnavailableAllocationUnits は、プールの空き領域が不足しているために使用できないボリュームの領域です。 |
| CallerTotalAllocationUnits | ULONGLONG | 8 | +24 | +24 | CallerTotalAllocationUnits は、クォータ設定によって制限されたボリュームの総サイズです。 |
| CallerAvailableAllocationUnits | ULONGLONG | 8 | +32 | +32 | CallerAvailableAllocationUnits は、クォータ設定によって制限されたボリュームの使用可能領域です。 |
| CallerPoolUnavailableAllocationUnits | ULONGLONG | 8 | +40 | +40 | CallerAvailableAllocationUnits は、プールの空き領域が不足しているために使用できないボリュームの領域です。 |
| UsedAllocationUnits | ULONGLONG | 8 | +48 | +48 | ボリュームの使用済み領域です。 |
| TotalReservedAllocationUnits | ULONGLONG | 8 | +56 | +56 | 予約済み領域の合計です。 |
| VolumeStorageReserveAllocationUnits | ULONGLONG | 8 | +64 | +64 | ボリュームごとのストレージ予約に使用される特殊な予約領域です。これは TotalReservedAllocationUnits に含まれます。 |
| AvailableCommittedAllocationUnits | ULONGLONG | 8 | +72 | +72 | ストレージプールによってコミットされているものの、ファイルシステムによってまだ割り当てられていない領域です。 |
| PoolAvailableAllocationUnits | ULONGLONG | 8 | +80 | +80 | 対応するストレージプール内の使用可能領域です。ボリュームが記憶域スペースのボリュームでない場合、PoolAvailableAllocationUnits には 0 が設定されます。 |
| SectorsPerAllocationUnit | DWORD | 4 | +88 | +88 | ボリュームの割り当て単位あたりのセクター数です。 |
| BytesPerSector | DWORD | 4 | +92 | +92 | ボリュームのセクターあたりのバイト数です。 |
公式ドキュメント
DISK_SPACE_INFORMATION 構造体は、特定のボリュームのディスク領域に関する情報を格納します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// DISK_SPACE_INFORMATION (x64 96 / x86 96 バイト)
typedef struct DISK_SPACE_INFORMATION {
ULONGLONG ActualTotalAllocationUnits;
ULONGLONG ActualAvailableAllocationUnits;
ULONGLONG ActualPoolUnavailableAllocationUnits;
ULONGLONG CallerTotalAllocationUnits;
ULONGLONG CallerAvailableAllocationUnits;
ULONGLONG CallerPoolUnavailableAllocationUnits;
ULONGLONG UsedAllocationUnits;
ULONGLONG TotalReservedAllocationUnits;
ULONGLONG VolumeStorageReserveAllocationUnits;
ULONGLONG AvailableCommittedAllocationUnits;
ULONGLONG PoolAvailableAllocationUnits;
DWORD SectorsPerAllocationUnit;
DWORD BytesPerSector;
} DISK_SPACE_INFORMATION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DISK_SPACE_INFORMATION
{
public ulong ActualTotalAllocationUnits;
public ulong ActualAvailableAllocationUnits;
public ulong ActualPoolUnavailableAllocationUnits;
public ulong CallerTotalAllocationUnits;
public ulong CallerAvailableAllocationUnits;
public ulong CallerPoolUnavailableAllocationUnits;
public ulong UsedAllocationUnits;
public ulong TotalReservedAllocationUnits;
public ulong VolumeStorageReserveAllocationUnits;
public ulong AvailableCommittedAllocationUnits;
public ulong PoolAvailableAllocationUnits;
public uint SectorsPerAllocationUnit;
public uint BytesPerSector;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DISK_SPACE_INFORMATION
Public ActualTotalAllocationUnits As ULong
Public ActualAvailableAllocationUnits As ULong
Public ActualPoolUnavailableAllocationUnits As ULong
Public CallerTotalAllocationUnits As ULong
Public CallerAvailableAllocationUnits As ULong
Public CallerPoolUnavailableAllocationUnits As ULong
Public UsedAllocationUnits As ULong
Public TotalReservedAllocationUnits As ULong
Public VolumeStorageReserveAllocationUnits As ULong
Public AvailableCommittedAllocationUnits As ULong
Public PoolAvailableAllocationUnits As ULong
Public SectorsPerAllocationUnit As UInteger
Public BytesPerSector As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DISK_SPACE_INFORMATION(ctypes.Structure):
_fields_ = [
("ActualTotalAllocationUnits", ctypes.c_ulonglong),
("ActualAvailableAllocationUnits", ctypes.c_ulonglong),
("ActualPoolUnavailableAllocationUnits", ctypes.c_ulonglong),
("CallerTotalAllocationUnits", ctypes.c_ulonglong),
("CallerAvailableAllocationUnits", ctypes.c_ulonglong),
("CallerPoolUnavailableAllocationUnits", ctypes.c_ulonglong),
("UsedAllocationUnits", ctypes.c_ulonglong),
("TotalReservedAllocationUnits", ctypes.c_ulonglong),
("VolumeStorageReserveAllocationUnits", ctypes.c_ulonglong),
("AvailableCommittedAllocationUnits", ctypes.c_ulonglong),
("PoolAvailableAllocationUnits", ctypes.c_ulonglong),
("SectorsPerAllocationUnit", wintypes.DWORD),
("BytesPerSector", wintypes.DWORD),
]#[repr(C)]
pub struct DISK_SPACE_INFORMATION {
pub ActualTotalAllocationUnits: u64,
pub ActualAvailableAllocationUnits: u64,
pub ActualPoolUnavailableAllocationUnits: u64,
pub CallerTotalAllocationUnits: u64,
pub CallerAvailableAllocationUnits: u64,
pub CallerPoolUnavailableAllocationUnits: u64,
pub UsedAllocationUnits: u64,
pub TotalReservedAllocationUnits: u64,
pub VolumeStorageReserveAllocationUnits: u64,
pub AvailableCommittedAllocationUnits: u64,
pub PoolAvailableAllocationUnits: u64,
pub SectorsPerAllocationUnit: u32,
pub BytesPerSector: u32,
}import "golang.org/x/sys/windows"
type DISK_SPACE_INFORMATION struct {
ActualTotalAllocationUnits uint64
ActualAvailableAllocationUnits uint64
ActualPoolUnavailableAllocationUnits uint64
CallerTotalAllocationUnits uint64
CallerAvailableAllocationUnits uint64
CallerPoolUnavailableAllocationUnits uint64
UsedAllocationUnits uint64
TotalReservedAllocationUnits uint64
VolumeStorageReserveAllocationUnits uint64
AvailableCommittedAllocationUnits uint64
PoolAvailableAllocationUnits uint64
SectorsPerAllocationUnit uint32
BytesPerSector uint32
}type
DISK_SPACE_INFORMATION = record
ActualTotalAllocationUnits: UInt64;
ActualAvailableAllocationUnits: UInt64;
ActualPoolUnavailableAllocationUnits: UInt64;
CallerTotalAllocationUnits: UInt64;
CallerAvailableAllocationUnits: UInt64;
CallerPoolUnavailableAllocationUnits: UInt64;
UsedAllocationUnits: UInt64;
TotalReservedAllocationUnits: UInt64;
VolumeStorageReserveAllocationUnits: UInt64;
AvailableCommittedAllocationUnits: UInt64;
PoolAvailableAllocationUnits: UInt64;
SectorsPerAllocationUnit: DWORD;
BytesPerSector: DWORD;
end;const DISK_SPACE_INFORMATION = extern struct {
ActualTotalAllocationUnits: u64,
ActualAvailableAllocationUnits: u64,
ActualPoolUnavailableAllocationUnits: u64,
CallerTotalAllocationUnits: u64,
CallerAvailableAllocationUnits: u64,
CallerPoolUnavailableAllocationUnits: u64,
UsedAllocationUnits: u64,
TotalReservedAllocationUnits: u64,
VolumeStorageReserveAllocationUnits: u64,
AvailableCommittedAllocationUnits: u64,
PoolAvailableAllocationUnits: u64,
SectorsPerAllocationUnit: u32,
BytesPerSector: u32,
};type
DISK_SPACE_INFORMATION {.bycopy.} = object
ActualTotalAllocationUnits: uint64
ActualAvailableAllocationUnits: uint64
ActualPoolUnavailableAllocationUnits: uint64
CallerTotalAllocationUnits: uint64
CallerAvailableAllocationUnits: uint64
CallerPoolUnavailableAllocationUnits: uint64
UsedAllocationUnits: uint64
TotalReservedAllocationUnits: uint64
VolumeStorageReserveAllocationUnits: uint64
AvailableCommittedAllocationUnits: uint64
PoolAvailableAllocationUnits: uint64
SectorsPerAllocationUnit: uint32
BytesPerSector: uint32struct DISK_SPACE_INFORMATION
{
ulong ActualTotalAllocationUnits;
ulong ActualAvailableAllocationUnits;
ulong ActualPoolUnavailableAllocationUnits;
ulong CallerTotalAllocationUnits;
ulong CallerAvailableAllocationUnits;
ulong CallerPoolUnavailableAllocationUnits;
ulong UsedAllocationUnits;
ulong TotalReservedAllocationUnits;
ulong VolumeStorageReserveAllocationUnits;
ulong AvailableCommittedAllocationUnits;
ulong PoolAvailableAllocationUnits;
uint SectorsPerAllocationUnit;
uint BytesPerSector;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DISK_SPACE_INFORMATION サイズ: 96 バイト(x64)
dim st, 24 ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; ActualTotalAllocationUnits : ULONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; ActualAvailableAllocationUnits : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ActualPoolUnavailableAllocationUnits : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; CallerTotalAllocationUnits : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; CallerAvailableAllocationUnits : ULONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; CallerPoolUnavailableAllocationUnits : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; UsedAllocationUnits : ULONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; TotalReservedAllocationUnits : ULONGLONG (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; VolumeStorageReserveAllocationUnits : ULONGLONG (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; AvailableCommittedAllocationUnits : ULONGLONG (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; PoolAvailableAllocationUnits : ULONGLONG (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; SectorsPerAllocationUnit : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; BytesPerSector : DWORD (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DISK_SPACE_INFORMATION
#field int64 ActualTotalAllocationUnits
#field int64 ActualAvailableAllocationUnits
#field int64 ActualPoolUnavailableAllocationUnits
#field int64 CallerTotalAllocationUnits
#field int64 CallerAvailableAllocationUnits
#field int64 CallerPoolUnavailableAllocationUnits
#field int64 UsedAllocationUnits
#field int64 TotalReservedAllocationUnits
#field int64 VolumeStorageReserveAllocationUnits
#field int64 AvailableCommittedAllocationUnits
#field int64 PoolAvailableAllocationUnits
#field int SectorsPerAllocationUnit
#field int BytesPerSector
#endstruct
stdim st, DISK_SPACE_INFORMATION ; NSTRUCT 変数を確保
st->ActualTotalAllocationUnits = 100
mes "ActualTotalAllocationUnits=" + st->ActualTotalAllocationUnits