Win32 API 日本語リファレンス
ホームStorage.VirtualDiskService › VDS_ADVANCEDDISK_PROP

VDS_ADVANCEDDISK_PROP

構造体
サイズx64: 152 バイト / x86: 120 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
pwszIdLPWSTR8/4+0+0ディスクの一意な識別子文字列。
pwszPathnameLPWSTR8/4+8+4ディスクのパス名を表すワイド文字列。
pwszLocationLPWSTR8/4+16+8ディスクの物理的な位置を表すワイド文字列。
pwszFriendlyNameLPWSTR8/4+24+12ユーザー向け表示名を表すワイド文字列。
pswzIdentifierLPWSTR8/4+32+16ディスクのページ83識別子などの識別子文字列。
usIdentifierFormatWORD2+40+20識別子の形式を示すコード(WORD)。
ulNumberDWORD4+44+24OSが割り当てたディスク番号。
pwszSerialNumberLPWSTR8/4+48+28ディスクのシリアル番号を表すワイド文字列。
pwszFirmwareVersionLPWSTR8/4+56+32ファームウェアのバージョンを表すワイド文字列。
pwszManufacturerLPWSTR8/4+64+36製造元名を表すワイド文字列。
pwszModelLPWSTR8/4+72+40ディスクのモデル名を表すワイド文字列。
ullTotalSizeULONGLONG8+80+48ディスクの総容量をバイト単位で示す。
ullAllocatedSizeULONGLONG8+88+56割り当て済み容量をバイト単位で示す。
ulLogicalSectorSizeDWORD4+96+64論理セクターサイズをバイト単位で示す。
ulPhysicalSectorSizeDWORD4+100+68物理セクターサイズをバイト単位で示す。
ulPartitionCountDWORD4+104+72ディスク上のパーティション数。
statusVDS_DISK_STATUS4+108+76ディスクの状態を示すVDS_DISK_STATUS列挙値。
healthVDS_HEALTH4+112+80ディスクの正常性を示すVDS_HEALTH列挙値。
BusTypeVDS_STORAGE_BUS_TYPE4+116+84ディスクが接続されるバスの種類を示すVDS_STORAGE_BUS_TYPE列挙値。
PartitionStyleVDS_PARTITION_STYLE4+120+88パーティション形式(MBR/GPT)を示すVDS_PARTITION_STYLE列挙値。
Anonymous_Anonymous_e__Union16+124+92パーティション形式に応じた署名情報を格納する無名共用体。
ulFlagsDWORD4+140+108ディスクの属性を示すVDS_DISK_FLAGビットフラグ。
dwDeviceTypeDWORD4+144+112デバイスの種類を示すFILE_DEVICE_*値。

共用体: _Anonymous_e__Union x64 16B / x86 16B

フィールドサイズx64x86
dwSignatureDWORD4+0+0
DiskGuidGUID16+0+0

各言語での定義

#include <windows.h>

// VDS_ADVANCEDDISK_PROP  (x64 152 / x86 120 バイト)
typedef struct VDS_ADVANCEDDISK_PROP {
    LPWSTR pwszId;
    LPWSTR pwszPathname;
    LPWSTR pwszLocation;
    LPWSTR pwszFriendlyName;
    LPWSTR pswzIdentifier;
    WORD usIdentifierFormat;
    DWORD ulNumber;
    LPWSTR pwszSerialNumber;
    LPWSTR pwszFirmwareVersion;
    LPWSTR pwszManufacturer;
    LPWSTR pwszModel;
    ULONGLONG ullTotalSize;
    ULONGLONG ullAllocatedSize;
    DWORD ulLogicalSectorSize;
    DWORD ulPhysicalSectorSize;
    DWORD ulPartitionCount;
    VDS_DISK_STATUS status;
    VDS_HEALTH health;
    VDS_STORAGE_BUS_TYPE BusType;
    VDS_PARTITION_STYLE PartitionStyle;
    _Anonymous_e__Union Anonymous;
    DWORD ulFlags;
    DWORD dwDeviceType;
} VDS_ADVANCEDDISK_PROP;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VDS_ADVANCEDDISK_PROP
{
    public IntPtr pwszId;
    public IntPtr pwszPathname;
    public IntPtr pwszLocation;
    public IntPtr pwszFriendlyName;
    public IntPtr pswzIdentifier;
    public ushort usIdentifierFormat;
    public uint ulNumber;
    public IntPtr pwszSerialNumber;
    public IntPtr pwszFirmwareVersion;
    public IntPtr pwszManufacturer;
    public IntPtr pwszModel;
    public ulong ullTotalSize;
    public ulong ullAllocatedSize;
    public uint ulLogicalSectorSize;
    public uint ulPhysicalSectorSize;
    public uint ulPartitionCount;
    public int status;
    public int health;
    public int BusType;
    public int PartitionStyle;
    public _Anonymous_e__Union Anonymous;
    public uint ulFlags;
    public uint dwDeviceType;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VDS_ADVANCEDDISK_PROP
    Public pwszId As IntPtr
    Public pwszPathname As IntPtr
    Public pwszLocation As IntPtr
    Public pwszFriendlyName As IntPtr
    Public pswzIdentifier As IntPtr
    Public usIdentifierFormat As UShort
    Public ulNumber As UInteger
    Public pwszSerialNumber As IntPtr
    Public pwszFirmwareVersion As IntPtr
    Public pwszManufacturer As IntPtr
    Public pwszModel As IntPtr
    Public ullTotalSize As ULong
    Public ullAllocatedSize As ULong
    Public ulLogicalSectorSize As UInteger
    Public ulPhysicalSectorSize As UInteger
    Public ulPartitionCount As UInteger
    Public status As Integer
    Public health As Integer
    Public BusType As Integer
    Public PartitionStyle As Integer
    Public Anonymous As _Anonymous_e__Union
    Public ulFlags As UInteger
    Public dwDeviceType As UInteger
End Structure
import ctypes
from ctypes import wintypes

class VDS_ADVANCEDDISK_PROP(ctypes.Structure):
    _fields_ = [
        ("pwszId", ctypes.c_void_p),
        ("pwszPathname", ctypes.c_void_p),
        ("pwszLocation", ctypes.c_void_p),
        ("pwszFriendlyName", ctypes.c_void_p),
        ("pswzIdentifier", ctypes.c_void_p),
        ("usIdentifierFormat", ctypes.c_ushort),
        ("ulNumber", wintypes.DWORD),
        ("pwszSerialNumber", ctypes.c_void_p),
        ("pwszFirmwareVersion", ctypes.c_void_p),
        ("pwszManufacturer", ctypes.c_void_p),
        ("pwszModel", ctypes.c_void_p),
        ("ullTotalSize", ctypes.c_ulonglong),
        ("ullAllocatedSize", ctypes.c_ulonglong),
        ("ulLogicalSectorSize", wintypes.DWORD),
        ("ulPhysicalSectorSize", wintypes.DWORD),
        ("ulPartitionCount", wintypes.DWORD),
        ("status", ctypes.c_int),
        ("health", ctypes.c_int),
        ("BusType", ctypes.c_int),
        ("PartitionStyle", ctypes.c_int),
        ("Anonymous", _Anonymous_e__Union),
        ("ulFlags", wintypes.DWORD),
        ("dwDeviceType", wintypes.DWORD),
    ]
#[repr(C)]
pub struct VDS_ADVANCEDDISK_PROP {
    pub pwszId: *mut core::ffi::c_void,
    pub pwszPathname: *mut core::ffi::c_void,
    pub pwszLocation: *mut core::ffi::c_void,
    pub pwszFriendlyName: *mut core::ffi::c_void,
    pub pswzIdentifier: *mut core::ffi::c_void,
    pub usIdentifierFormat: u16,
    pub ulNumber: u32,
    pub pwszSerialNumber: *mut core::ffi::c_void,
    pub pwszFirmwareVersion: *mut core::ffi::c_void,
    pub pwszManufacturer: *mut core::ffi::c_void,
    pub pwszModel: *mut core::ffi::c_void,
    pub ullTotalSize: u64,
    pub ullAllocatedSize: u64,
    pub ulLogicalSectorSize: u32,
    pub ulPhysicalSectorSize: u32,
    pub ulPartitionCount: u32,
    pub status: i32,
    pub health: i32,
    pub BusType: i32,
    pub PartitionStyle: i32,
    pub Anonymous: _Anonymous_e__Union,
    pub ulFlags: u32,
    pub dwDeviceType: u32,
}
import "golang.org/x/sys/windows"

type VDS_ADVANCEDDISK_PROP struct {
	pwszId uintptr
	pwszPathname uintptr
	pwszLocation uintptr
	pwszFriendlyName uintptr
	pswzIdentifier uintptr
	usIdentifierFormat uint16
	ulNumber uint32
	pwszSerialNumber uintptr
	pwszFirmwareVersion uintptr
	pwszManufacturer uintptr
	pwszModel uintptr
	ullTotalSize uint64
	ullAllocatedSize uint64
	ulLogicalSectorSize uint32
	ulPhysicalSectorSize uint32
	ulPartitionCount uint32
	status int32
	health int32
	BusType int32
	PartitionStyle int32
	Anonymous _Anonymous_e__Union
	ulFlags uint32
	dwDeviceType uint32
}
type
  VDS_ADVANCEDDISK_PROP = record
    pwszId: Pointer;
    pwszPathname: Pointer;
    pwszLocation: Pointer;
    pwszFriendlyName: Pointer;
    pswzIdentifier: Pointer;
    usIdentifierFormat: Word;
    ulNumber: DWORD;
    pwszSerialNumber: Pointer;
    pwszFirmwareVersion: Pointer;
    pwszManufacturer: Pointer;
    pwszModel: Pointer;
    ullTotalSize: UInt64;
    ullAllocatedSize: UInt64;
    ulLogicalSectorSize: DWORD;
    ulPhysicalSectorSize: DWORD;
    ulPartitionCount: DWORD;
    status: Integer;
    health: Integer;
    BusType: Integer;
    PartitionStyle: Integer;
    Anonymous: _Anonymous_e__Union;
    ulFlags: DWORD;
    dwDeviceType: DWORD;
  end;
const VDS_ADVANCEDDISK_PROP = extern struct {
    pwszId: ?*anyopaque,
    pwszPathname: ?*anyopaque,
    pwszLocation: ?*anyopaque,
    pwszFriendlyName: ?*anyopaque,
    pswzIdentifier: ?*anyopaque,
    usIdentifierFormat: u16,
    ulNumber: u32,
    pwszSerialNumber: ?*anyopaque,
    pwszFirmwareVersion: ?*anyopaque,
    pwszManufacturer: ?*anyopaque,
    pwszModel: ?*anyopaque,
    ullTotalSize: u64,
    ullAllocatedSize: u64,
    ulLogicalSectorSize: u32,
    ulPhysicalSectorSize: u32,
    ulPartitionCount: u32,
    status: i32,
    health: i32,
    BusType: i32,
    PartitionStyle: i32,
    Anonymous: _Anonymous_e__Union,
    ulFlags: u32,
    dwDeviceType: u32,
};
type
  VDS_ADVANCEDDISK_PROP {.bycopy.} = object
    pwszId: pointer
    pwszPathname: pointer
    pwszLocation: pointer
    pwszFriendlyName: pointer
    pswzIdentifier: pointer
    usIdentifierFormat: uint16
    ulNumber: uint32
    pwszSerialNumber: pointer
    pwszFirmwareVersion: pointer
    pwszManufacturer: pointer
    pwszModel: pointer
    ullTotalSize: uint64
    ullAllocatedSize: uint64
    ulLogicalSectorSize: uint32
    ulPhysicalSectorSize: uint32
    ulPartitionCount: uint32
    status: int32
    health: int32
    BusType: int32
    PartitionStyle: int32
    Anonymous: _Anonymous_e__Union
    ulFlags: uint32
    dwDeviceType: uint32
struct VDS_ADVANCEDDISK_PROP
{
    void* pwszId;
    void* pwszPathname;
    void* pwszLocation;
    void* pwszFriendlyName;
    void* pswzIdentifier;
    ushort usIdentifierFormat;
    uint ulNumber;
    void* pwszSerialNumber;
    void* pwszFirmwareVersion;
    void* pwszManufacturer;
    void* pwszModel;
    ulong ullTotalSize;
    ulong ullAllocatedSize;
    uint ulLogicalSectorSize;
    uint ulPhysicalSectorSize;
    uint ulPartitionCount;
    int status;
    int health;
    int BusType;
    int PartitionStyle;
    _Anonymous_e__Union Anonymous;
    uint ulFlags;
    uint dwDeviceType;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; VDS_ADVANCEDDISK_PROP サイズ: 120 バイト(x86)
dim st, 30    ; 4byte整数×30(構造体サイズ 120 / 4 切り上げ)
; pwszId : LPWSTR (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pwszPathname : LPWSTR (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pwszLocation : LPWSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; pwszFriendlyName : LPWSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; pswzIdentifier : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; usIdentifierFormat : WORD (+20, 2byte)  wpoke st,20,値  /  値 = wpeek(st,20)
; ulNumber : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; pwszSerialNumber : LPWSTR (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; pwszFirmwareVersion : LPWSTR (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; pwszManufacturer : LPWSTR (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; pwszModel : LPWSTR (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ullTotalSize : ULONGLONG (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ullAllocatedSize : ULONGLONG (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ulLogicalSectorSize : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; ulPhysicalSectorSize : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ulPartitionCount : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; status : VDS_DISK_STATUS (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; health : VDS_HEALTH (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; BusType : VDS_STORAGE_BUS_TYPE (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; PartitionStyle : VDS_PARTITION_STYLE (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+92, 16byte)  varptr(st)+92 を基点に操作(16byte:入れ子/配列)
; ulFlags : DWORD (+108, 4byte)  st.27 = 値  /  値 = st.27   (lpoke/lpeek も可)
; dwDeviceType : DWORD (+112, 4byte)  st.28 = 値  /  値 = st.28   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VDS_ADVANCEDDISK_PROP サイズ: 152 バイト(x64)
dim st, 38    ; 4byte整数×38(構造体サイズ 152 / 4 切り上げ)
; pwszId : LPWSTR (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; pwszPathname : LPWSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pwszLocation : LPWSTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pwszFriendlyName : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pswzIdentifier : LPWSTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; usIdentifierFormat : WORD (+40, 2byte)  wpoke st,40,値  /  値 = wpeek(st,40)
; ulNumber : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; pwszSerialNumber : LPWSTR (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; pwszFirmwareVersion : LPWSTR (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; pwszManufacturer : LPWSTR (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; pwszModel : LPWSTR (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; ullTotalSize : ULONGLONG (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; ullAllocatedSize : ULONGLONG (+88, 8byte)  qpoke st,88,値 / qpeek(st,88)  ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; ulLogicalSectorSize : DWORD (+96, 4byte)  st.24 = 値  /  値 = st.24   (lpoke/lpeek も可)
; ulPhysicalSectorSize : DWORD (+100, 4byte)  st.25 = 値  /  値 = st.25   (lpoke/lpeek も可)
; ulPartitionCount : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; status : VDS_DISK_STATUS (+108, 4byte)  st.27 = 値  /  値 = st.27   (lpoke/lpeek も可)
; health : VDS_HEALTH (+112, 4byte)  st.28 = 値  /  値 = st.28   (lpoke/lpeek も可)
; BusType : VDS_STORAGE_BUS_TYPE (+116, 4byte)  st.29 = 値  /  値 = st.29   (lpoke/lpeek も可)
; PartitionStyle : VDS_PARTITION_STYLE (+120, 4byte)  st.30 = 値  /  値 = st.30   (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+124, 16byte)  varptr(st)+124 を基点に操作(16byte:入れ子/配列)
; ulFlags : DWORD (+140, 4byte)  st.35 = 値  /  値 = st.35   (lpoke/lpeek も可)
; dwDeviceType : DWORD (+144, 4byte)  st.36 = 値  /  値 = st.36   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VDS_ADVANCEDDISK_PROP
    #field intptr pwszId
    #field intptr pwszPathname
    #field intptr pwszLocation
    #field intptr pwszFriendlyName
    #field intptr pswzIdentifier
    #field short usIdentifierFormat
    #field int ulNumber
    #field intptr pwszSerialNumber
    #field intptr pwszFirmwareVersion
    #field intptr pwszManufacturer
    #field intptr pwszModel
    #field int64 ullTotalSize
    #field int64 ullAllocatedSize
    #field int ulLogicalSectorSize
    #field int ulPhysicalSectorSize
    #field int ulPartitionCount
    #field int status
    #field int health
    #field int BusType
    #field int PartitionStyle
    #field byte Anonymous 16
    #field int ulFlags
    #field int dwDeviceType
#endstruct

stdim st, VDS_ADVANCEDDISK_PROP        ; NSTRUCT 変数を確保
st->usIdentifierFormat = 100
mes "usIdentifierFormat=" + st->usIdentifierFormat
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。