VDS_DISK_PROP
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| id | GUID | 16 | +0 | +0 | ディスクオブジェクトの GUID です。 |
| status | VDS_DISK_STATUS | 4 | +16 | +16 | VDS_DISK_STATUS で列挙される、 物理ディスクの可用性です。 VDS サービスがディスクへのハンドルを開けない場合、このメンバーには VDS_DS_UNKNOWN が設定されます。 メモ 含まれるパックの状態が VDS_PS_OFFLINE であっても、このメンバーが VDS_DS_ONLINE になることがあります。
|
| ReserveMode | VDS_LUN_RESERVE_MODE | 4 | +20 | +20 | このメンバーは将来の使用のために予約済みです。 |
| health | VDS_HEALTH | 4 | +24 | +24 | ディスクの正常性状態を指定する VDS_HEALTH 列挙型の値です。このメンバーに指定できる値は次のとおりです。 VDS_H_UNKNOWN (0)VDS_H_HEALTHY (1)VDS_H_FAILING (4)VDS_H_FAILED (8) |
| dwDeviceType | DWORD | 4 | +28 | +28 | Winioctl.h で定義されているデバイスの種類です。次のような種類が含まれます。 |
| dwMediaType | DWORD | 4 | +32 | +32 | STORAGE_MEDIA_TYPE で列挙されるメディアの種類です。 ベーシックディスクとダイナミックディスクは FixedMedia 列挙子に対応します。詳細については、 STORAGE_MEDIA_TYPE を参照してください。 |
| ullSize | ULONGLONG | 8 | +40 | +40 | ディスクのサイズ (バイト単位) です。ディスクの最大ボリュームサイズを調べるには、 IVdsDisk3::QueryFreeExtents を呼び出し、すべての 空きエクステントのサイズを合計します。 |
| ulBytesPerSector | DWORD | 4 | +48 | +48 | 各セクターのバイト数です。 |
| ulSectorsPerTrack | DWORD | 4 | +52 | +52 | 各トラックのセクター数です。 |
| ulTracksPerCylinder | DWORD | 4 | +56 | +56 | 各シリンダーのトラック数です。 |
| ulFlags | DWORD | 4 | +60 | +60 | さまざまなディスク属性を指定する VDS_DISK_FLAG 列挙型の値のビットマスクです。 |
| BusType | VDS_STORAGE_BUS_TYPE | 4 | +64 | +64 | VDS_STORAGE_BUS_TYPE で列挙される 入出力バスの種類です。 |
| PartitionStyle | VDS_PARTITION_STYLE | 4 | +68 | +68 | パーティションの種類を指定する VDS_PARTITION_STYLE 列挙型の値です。このメンバーは共用体の 判別子です。 |
| Anonymous | _Anonymous_e__Union | 16 | +72 | +72 | パーティション形式に応じた署名情報を格納する無名共用体。 |
| pwszDiskAddress | LPWSTR | 8/4 | +88 | +88 | SCSI 形式のディスクのアドレスで、 PortNNNPathNNNTargetNNNLunNNN という形式です。NNN は 1 桁以上の数字です。 SCSI ディスク、IDE ディスク、およびファイバーチャネルディスクは、このようなアドレスを持つことができます。USB および 1394 ディスクはアドレスの形式が異なるため、 格納されません。 このメンバーは省略可能であり、値が利用できない場合は NULL になることがあります。NULL でない場合、その長さは必須の NULL 終端文字を含めて 22 WCHAR 以上 64 WCHAR 以下でなければなりません。IVdsDisk::GetProperties を呼び出して VDS_DISK_PROP 構造体を受け取るアプリケーションは、このメンバーが NULL かどうかを確認する必要があります。 |
| pwszName | LPWSTR | 8/4 | +96 | +92 | CreateFile 関数を使用して作成されたオブジェクトへの
ハンドルを開くために使用される名前です。例: \\?\PhysicalDrive2 |
| pwszFriendlyName | LPWSTR | 8/4 | +104 | +96 | プラグ アンド プレイ マネージャーによって返される名前です。この名前はプラグ アンド プレイ マネージャーによって Windows レジストリに 保持されます。例: "SEAGATE ST34573N SCSI Disk Device"。 |
| pwszAdaptorName | LPWSTR | 8/4 | +112 | +100 | このディスクが接続されているアダプターの名前です。プラグ アンド プレイ マネージャーがこの名前を返します。名前は Windows レジストリに保持されます。例: "Adaptec AHA-2940U2W - Ultra2 SCSI"。 |
| pwszDevicePath | LPWSTR | 8/4 | +120 | +104 | プラグ アンド プレイ マネージャーによって返される文字列です。プラグ アンド プレイ マネージャーは、コンピューター上のデバイスを 一意に識別するためにデバイスパスを使用します。詳細については、 SP_DEVICE_INTERFACE_DETAIL_DATA_W を参照してください。 |
共用体: _Anonymous_e__Union x64 16B / x86 16B
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwSignature | DWORD | 4 | +0 | +0 | PartitionStyle が VDS_PST_MBR (1) の場合に使用されます。MBR パーティションの シグネチャです。この値が一意であることは保証されません。 |
| DiskGuid | GUID | 16 | +0 | +0 | PartitionStyle が VDS_PST_GPT (2) の場合に使用されます。 ディスクの GUID です。さらに、各 GPT パーティションはそれぞれ固有の GUID を持ちます (VDS_PARTITION_INFO_GPT を参照してください)。 |
公式ドキュメント
[Windows 8 および Windows Server 2012 以降、Virtual Disk Service COM インターフェイスは Windows Storage Management API に置き換えられています。]
ディスクオブジェクトのプロパティを 定義します。
解説(Remarks)
IVdsDisk::GetProperties メソッドは、 ディスクオブジェクトのプロパティを報告するために、この構造体の値を返します。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// VDS_DISK_PROP (x64 128 / x86 112 バイト)
typedef struct VDS_DISK_PROP {
GUID id;
VDS_DISK_STATUS status;
VDS_LUN_RESERVE_MODE ReserveMode;
VDS_HEALTH health;
DWORD dwDeviceType;
DWORD dwMediaType;
ULONGLONG ullSize;
DWORD ulBytesPerSector;
DWORD ulSectorsPerTrack;
DWORD ulTracksPerCylinder;
DWORD ulFlags;
VDS_STORAGE_BUS_TYPE BusType;
VDS_PARTITION_STYLE PartitionStyle;
_Anonymous_e__Union Anonymous;
LPWSTR pwszDiskAddress;
LPWSTR pwszName;
LPWSTR pwszFriendlyName;
LPWSTR pwszAdaptorName;
LPWSTR pwszDevicePath;
} VDS_DISK_PROP;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VDS_DISK_PROP
{
public Guid id;
public int status;
public int ReserveMode;
public int health;
public uint dwDeviceType;
public uint dwMediaType;
public ulong ullSize;
public uint ulBytesPerSector;
public uint ulSectorsPerTrack;
public uint ulTracksPerCylinder;
public uint ulFlags;
public int BusType;
public int PartitionStyle;
public _Anonymous_e__Union Anonymous;
public IntPtr pwszDiskAddress;
public IntPtr pwszName;
public IntPtr pwszFriendlyName;
public IntPtr pwszAdaptorName;
public IntPtr pwszDevicePath;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VDS_DISK_PROP
Public id As Guid
Public status As Integer
Public ReserveMode As Integer
Public health As Integer
Public dwDeviceType As UInteger
Public dwMediaType As UInteger
Public ullSize As ULong
Public ulBytesPerSector As UInteger
Public ulSectorsPerTrack As UInteger
Public ulTracksPerCylinder As UInteger
Public ulFlags As UInteger
Public BusType As Integer
Public PartitionStyle As Integer
Public Anonymous As _Anonymous_e__Union
Public pwszDiskAddress As IntPtr
Public pwszName As IntPtr
Public pwszFriendlyName As IntPtr
Public pwszAdaptorName As IntPtr
Public pwszDevicePath As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class VDS_DISK_PROP(ctypes.Structure):
_fields_ = [
("id", GUID),
("status", ctypes.c_int),
("ReserveMode", ctypes.c_int),
("health", ctypes.c_int),
("dwDeviceType", wintypes.DWORD),
("dwMediaType", wintypes.DWORD),
("ullSize", ctypes.c_ulonglong),
("ulBytesPerSector", wintypes.DWORD),
("ulSectorsPerTrack", wintypes.DWORD),
("ulTracksPerCylinder", wintypes.DWORD),
("ulFlags", wintypes.DWORD),
("BusType", ctypes.c_int),
("PartitionStyle", ctypes.c_int),
("Anonymous", _Anonymous_e__Union),
("pwszDiskAddress", ctypes.c_void_p),
("pwszName", ctypes.c_void_p),
("pwszFriendlyName", ctypes.c_void_p),
("pwszAdaptorName", ctypes.c_void_p),
("pwszDevicePath", ctypes.c_void_p),
]#[repr(C)]
pub struct VDS_DISK_PROP {
pub id: GUID,
pub status: i32,
pub ReserveMode: i32,
pub health: i32,
pub dwDeviceType: u32,
pub dwMediaType: u32,
pub ullSize: u64,
pub ulBytesPerSector: u32,
pub ulSectorsPerTrack: u32,
pub ulTracksPerCylinder: u32,
pub ulFlags: u32,
pub BusType: i32,
pub PartitionStyle: i32,
pub Anonymous: _Anonymous_e__Union,
pub pwszDiskAddress: *mut core::ffi::c_void,
pub pwszName: *mut core::ffi::c_void,
pub pwszFriendlyName: *mut core::ffi::c_void,
pub pwszAdaptorName: *mut core::ffi::c_void,
pub pwszDevicePath: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type VDS_DISK_PROP struct {
id windows.GUID
status int32
ReserveMode int32
health int32
dwDeviceType uint32
dwMediaType uint32
ullSize uint64
ulBytesPerSector uint32
ulSectorsPerTrack uint32
ulTracksPerCylinder uint32
ulFlags uint32
BusType int32
PartitionStyle int32
Anonymous _Anonymous_e__Union
pwszDiskAddress uintptr
pwszName uintptr
pwszFriendlyName uintptr
pwszAdaptorName uintptr
pwszDevicePath uintptr
}type
VDS_DISK_PROP = record
id: TGUID;
status: Integer;
ReserveMode: Integer;
health: Integer;
dwDeviceType: DWORD;
dwMediaType: DWORD;
ullSize: UInt64;
ulBytesPerSector: DWORD;
ulSectorsPerTrack: DWORD;
ulTracksPerCylinder: DWORD;
ulFlags: DWORD;
BusType: Integer;
PartitionStyle: Integer;
Anonymous: _Anonymous_e__Union;
pwszDiskAddress: Pointer;
pwszName: Pointer;
pwszFriendlyName: Pointer;
pwszAdaptorName: Pointer;
pwszDevicePath: Pointer;
end;const VDS_DISK_PROP = extern struct {
id: GUID,
status: i32,
ReserveMode: i32,
health: i32,
dwDeviceType: u32,
dwMediaType: u32,
ullSize: u64,
ulBytesPerSector: u32,
ulSectorsPerTrack: u32,
ulTracksPerCylinder: u32,
ulFlags: u32,
BusType: i32,
PartitionStyle: i32,
Anonymous: _Anonymous_e__Union,
pwszDiskAddress: ?*anyopaque,
pwszName: ?*anyopaque,
pwszFriendlyName: ?*anyopaque,
pwszAdaptorName: ?*anyopaque,
pwszDevicePath: ?*anyopaque,
};type
VDS_DISK_PROP {.bycopy.} = object
id: GUID
status: int32
ReserveMode: int32
health: int32
dwDeviceType: uint32
dwMediaType: uint32
ullSize: uint64
ulBytesPerSector: uint32
ulSectorsPerTrack: uint32
ulTracksPerCylinder: uint32
ulFlags: uint32
BusType: int32
PartitionStyle: int32
Anonymous: _Anonymous_e__Union
pwszDiskAddress: pointer
pwszName: pointer
pwszFriendlyName: pointer
pwszAdaptorName: pointer
pwszDevicePath: pointerstruct VDS_DISK_PROP
{
GUID id;
int status;
int ReserveMode;
int health;
uint dwDeviceType;
uint dwMediaType;
ulong ullSize;
uint ulBytesPerSector;
uint ulSectorsPerTrack;
uint ulTracksPerCylinder;
uint ulFlags;
int BusType;
int PartitionStyle;
_Anonymous_e__Union Anonymous;
void* pwszDiskAddress;
void* pwszName;
void* pwszFriendlyName;
void* pwszAdaptorName;
void* pwszDevicePath;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; VDS_DISK_PROP サイズ: 112 バイト(x86)
dim st, 28 ; 4byte整数×28(構造体サイズ 112 / 4 切り上げ)
; id : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; status : VDS_DISK_STATUS (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ReserveMode : VDS_LUN_RESERVE_MODE (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; health : VDS_HEALTH (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwDeviceType : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwMediaType : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ullSize : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ulBytesPerSector : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; ulSectorsPerTrack : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ulTracksPerCylinder : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ulFlags : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; BusType : VDS_STORAGE_BUS_TYPE (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; PartitionStyle : VDS_PARTITION_STYLE (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+72, 16byte) varptr(st)+72 を基点に操作(16byte:入れ子/配列)
; pwszDiskAddress : LPWSTR (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; pwszName : LPWSTR (+92, 4byte) st.23 = 値 / 値 = st.23 (lpoke/lpeek も可)
; pwszFriendlyName : LPWSTR (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; pwszAdaptorName : LPWSTR (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; pwszDevicePath : LPWSTR (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VDS_DISK_PROP サイズ: 128 バイト(x64)
dim st, 32 ; 4byte整数×32(構造体サイズ 128 / 4 切り上げ)
; id : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; status : VDS_DISK_STATUS (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ReserveMode : VDS_LUN_RESERVE_MODE (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; health : VDS_HEALTH (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwDeviceType : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwMediaType : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ullSize : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ulBytesPerSector : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; ulSectorsPerTrack : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ulTracksPerCylinder : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; ulFlags : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; BusType : VDS_STORAGE_BUS_TYPE (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; PartitionStyle : VDS_PARTITION_STYLE (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+72, 16byte) varptr(st)+72 を基点に操作(16byte:入れ子/配列)
; pwszDiskAddress : LPWSTR (+88, 8byte) qpoke st,88,値 / qpeek(st,88) ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; pwszName : LPWSTR (+96, 8byte) qpoke st,96,値 / qpeek(st,96) ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; pwszFriendlyName : LPWSTR (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; pwszAdaptorName : LPWSTR (+112, 8byte) qpoke st,112,値 / qpeek(st,112) ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; pwszDevicePath : LPWSTR (+120, 8byte) qpoke st,120,値 / qpeek(st,120) ※IronHSPのみ。3.7/3.8は lpoke st,120,下位 : lpoke st,124,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global VDS_DISK_PROP
#field GUID id
#field int status
#field int ReserveMode
#field int health
#field int dwDeviceType
#field int dwMediaType
#field int64 ullSize
#field int ulBytesPerSector
#field int ulSectorsPerTrack
#field int ulTracksPerCylinder
#field int ulFlags
#field int BusType
#field int PartitionStyle
#field byte Anonymous 16
#field intptr pwszDiskAddress
#field intptr pwszName
#field intptr pwszFriendlyName
#field intptr pwszAdaptorName
#field intptr pwszDevicePath
#endstruct
stdim st, VDS_DISK_PROP ; NSTRUCT 変数を確保
st->status = 100
mes "status=" + st->status
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。