ホーム › Storage.VirtualDiskService › VDS_LUN_PROP
VDS_LUN_PROP
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| id | GUID | 16 | +0 | +0 | LUNを一意に識別するGUID。 |
| ullSize | ULONGLONG | 8 | +16 | +16 | LUNの容量をバイト単位で示す。 |
| pwszFriendlyName | LPWSTR | 8/4 | +24 | +24 | LUNのユーザー向け表示名を表すワイド文字列。 |
| pwszIdentification | LPWSTR | 8/4 | +32 | +28 | LUNの識別文字列(ワイド文字)。 |
| pwszUnmaskingList | LPWSTR | 8/4 | +40 | +32 | LUNのアンマスキング(アクセス許可)対象一覧を表すワイド文字列。 |
| ulFlags | DWORD | 4 | +48 | +36 | LUNの属性を示すVDS_LUN_FLAGビットフラグ。 |
| type | VDS_LUN_TYPE | 4 | +52 | +40 | LUNの種別(RAIDレベル等)を示すVDS_LUN_TYPE列挙値。 |
| status | VDS_LUN_STATUS | 4 | +56 | +44 | LUNの状態を示すVDS_LUN_STATUS列挙値。 |
| health | VDS_HEALTH | 4 | +60 | +48 | LUNの正常性を示すVDS_HEALTH列挙値。 |
| TransitionState | VDS_TRANSITION_STATE | 4 | +64 | +52 | LUNの遷移状態を示すVDS_TRANSITION_STATE列挙値。 |
| sRebuildPriority | SHORT | 2 | +68 | +56 | アレイ再構築の優先度を示す符号付き値。 |
各言語での定義
#include <windows.h>
// VDS_LUN_PROP (x64 72 / x86 64 バイト)
typedef struct VDS_LUN_PROP {
GUID id;
ULONGLONG ullSize;
LPWSTR pwszFriendlyName;
LPWSTR pwszIdentification;
LPWSTR pwszUnmaskingList;
DWORD ulFlags;
VDS_LUN_TYPE type;
VDS_LUN_STATUS status;
VDS_HEALTH health;
VDS_TRANSITION_STATE TransitionState;
SHORT sRebuildPriority;
} VDS_LUN_PROP;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VDS_LUN_PROP
{
public Guid id;
public ulong ullSize;
public IntPtr pwszFriendlyName;
public IntPtr pwszIdentification;
public IntPtr pwszUnmaskingList;
public uint ulFlags;
public int type;
public int status;
public int health;
public int TransitionState;
public short sRebuildPriority;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VDS_LUN_PROP
Public id As Guid
Public ullSize As ULong
Public pwszFriendlyName As IntPtr
Public pwszIdentification As IntPtr
Public pwszUnmaskingList As IntPtr
Public ulFlags As UInteger
Public type As Integer
Public status As Integer
Public health As Integer
Public TransitionState As Integer
Public sRebuildPriority As Short
End Structureimport ctypes
from ctypes import wintypes
class VDS_LUN_PROP(ctypes.Structure):
_fields_ = [
("id", GUID),
("ullSize", ctypes.c_ulonglong),
("pwszFriendlyName", ctypes.c_void_p),
("pwszIdentification", ctypes.c_void_p),
("pwszUnmaskingList", ctypes.c_void_p),
("ulFlags", wintypes.DWORD),
("type", ctypes.c_int),
("status", ctypes.c_int),
("health", ctypes.c_int),
("TransitionState", ctypes.c_int),
("sRebuildPriority", ctypes.c_short),
]#[repr(C)]
pub struct VDS_LUN_PROP {
pub id: GUID,
pub ullSize: u64,
pub pwszFriendlyName: *mut core::ffi::c_void,
pub pwszIdentification: *mut core::ffi::c_void,
pub pwszUnmaskingList: *mut core::ffi::c_void,
pub ulFlags: u32,
pub type: i32,
pub status: i32,
pub health: i32,
pub TransitionState: i32,
pub sRebuildPriority: i16,
}import "golang.org/x/sys/windows"
type VDS_LUN_PROP struct {
id windows.GUID
ullSize uint64
pwszFriendlyName uintptr
pwszIdentification uintptr
pwszUnmaskingList uintptr
ulFlags uint32
type int32
status int32
health int32
TransitionState int32
sRebuildPriority int16
}type
VDS_LUN_PROP = record
id: TGUID;
ullSize: UInt64;
pwszFriendlyName: Pointer;
pwszIdentification: Pointer;
pwszUnmaskingList: Pointer;
ulFlags: DWORD;
type: Integer;
status: Integer;
health: Integer;
TransitionState: Integer;
sRebuildPriority: Smallint;
end;const VDS_LUN_PROP = extern struct {
id: GUID,
ullSize: u64,
pwszFriendlyName: ?*anyopaque,
pwszIdentification: ?*anyopaque,
pwszUnmaskingList: ?*anyopaque,
ulFlags: u32,
type: i32,
status: i32,
health: i32,
TransitionState: i32,
sRebuildPriority: i16,
};type
VDS_LUN_PROP {.bycopy.} = object
id: GUID
ullSize: uint64
pwszFriendlyName: pointer
pwszIdentification: pointer
pwszUnmaskingList: pointer
ulFlags: uint32
type: int32
status: int32
health: int32
TransitionState: int32
sRebuildPriority: int16struct VDS_LUN_PROP
{
GUID id;
ulong ullSize;
void* pwszFriendlyName;
void* pwszIdentification;
void* pwszUnmaskingList;
uint ulFlags;
int type;
int status;
int health;
int TransitionState;
short sRebuildPriority;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; VDS_LUN_PROP サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; id : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; ullSize : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pwszFriendlyName : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; pwszIdentification : LPWSTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; pwszUnmaskingList : LPWSTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ulFlags : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; type : VDS_LUN_TYPE (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; status : VDS_LUN_STATUS (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; health : VDS_HEALTH (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; TransitionState : VDS_TRANSITION_STATE (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; sRebuildPriority : SHORT (+56, 2byte) wpoke st,56,値 / 値 = wpeek(st,56)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VDS_LUN_PROP サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; id : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; ullSize : ULONGLONG (+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,上位
; pwszIdentification : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pwszUnmaskingList : LPWSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ulFlags : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; type : VDS_LUN_TYPE (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; status : VDS_LUN_STATUS (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; health : VDS_HEALTH (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; TransitionState : VDS_TRANSITION_STATE (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; sRebuildPriority : SHORT (+68, 2byte) wpoke st,68,値 / 値 = wpeek(st,68)
; ※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_LUN_PROP
#field GUID id
#field int64 ullSize
#field intptr pwszFriendlyName
#field intptr pwszIdentification
#field intptr pwszUnmaskingList
#field int ulFlags
#field int type
#field int status
#field int health
#field int TransitionState
#field short sRebuildPriority
#endstruct
stdim st, VDS_LUN_PROP ; NSTRUCT 変数を確保
st->ullSize = 100
mes "ullSize=" + st->ullSize