ホーム › Storage.VirtualDiskService › VDS_DISK_EXTENT
VDS_DISK_EXTENT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| diskId | GUID | 16 | +0 | +0 | エクステントが存在するディスクを識別するGUID。 |
| type | VDS_DISK_EXTENT_TYPE | 4 | +16 | +16 | エクステントの種別を示すVDS_DISK_EXTENT_TYPE列挙値。 |
| ullOffset | ULONGLONG | 8 | +24 | +24 | ディスク先頭からのエクステント開始位置をバイト単位で示す。 |
| ullSize | ULONGLONG | 8 | +32 | +32 | エクステントのサイズをバイト単位で示す。 |
| volumeId | GUID | 16 | +40 | +40 | エクステントが属するボリュームを識別するGUID。 |
| plexId | GUID | 16 | +56 | +56 | エクステントが属するプレックスを識別するGUID。 |
| memberIdx | DWORD | 4 | +72 | +72 | プレックス内のメンバーインデックス。 |
各言語での定義
#include <windows.h>
// VDS_DISK_EXTENT (x64 80 / x86 80 バイト)
typedef struct VDS_DISK_EXTENT {
GUID diskId;
VDS_DISK_EXTENT_TYPE type;
ULONGLONG ullOffset;
ULONGLONG ullSize;
GUID volumeId;
GUID plexId;
DWORD memberIdx;
} VDS_DISK_EXTENT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VDS_DISK_EXTENT
{
public Guid diskId;
public int type;
public ulong ullOffset;
public ulong ullSize;
public Guid volumeId;
public Guid plexId;
public uint memberIdx;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VDS_DISK_EXTENT
Public diskId As Guid
Public type As Integer
Public ullOffset As ULong
Public ullSize As ULong
Public volumeId As Guid
Public plexId As Guid
Public memberIdx As UInteger
End Structureimport ctypes
from ctypes import wintypes
class VDS_DISK_EXTENT(ctypes.Structure):
_fields_ = [
("diskId", GUID),
("type", ctypes.c_int),
("ullOffset", ctypes.c_ulonglong),
("ullSize", ctypes.c_ulonglong),
("volumeId", GUID),
("plexId", GUID),
("memberIdx", wintypes.DWORD),
]#[repr(C)]
pub struct VDS_DISK_EXTENT {
pub diskId: GUID,
pub type: i32,
pub ullOffset: u64,
pub ullSize: u64,
pub volumeId: GUID,
pub plexId: GUID,
pub memberIdx: u32,
}import "golang.org/x/sys/windows"
type VDS_DISK_EXTENT struct {
diskId windows.GUID
type int32
ullOffset uint64
ullSize uint64
volumeId windows.GUID
plexId windows.GUID
memberIdx uint32
}type
VDS_DISK_EXTENT = record
diskId: TGUID;
type: Integer;
ullOffset: UInt64;
ullSize: UInt64;
volumeId: TGUID;
plexId: TGUID;
memberIdx: DWORD;
end;const VDS_DISK_EXTENT = extern struct {
diskId: GUID,
type: i32,
ullOffset: u64,
ullSize: u64,
volumeId: GUID,
plexId: GUID,
memberIdx: u32,
};type
VDS_DISK_EXTENT {.bycopy.} = object
diskId: GUID
type: int32
ullOffset: uint64
ullSize: uint64
volumeId: GUID
plexId: GUID
memberIdx: uint32struct VDS_DISK_EXTENT
{
GUID diskId;
int type;
ulong ullOffset;
ulong ullSize;
GUID volumeId;
GUID plexId;
uint memberIdx;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VDS_DISK_EXTENT サイズ: 80 バイト(x64)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; diskId : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; type : VDS_DISK_EXTENT_TYPE (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ullOffset : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ullSize : ULONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; volumeId : GUID (+40, 16byte) varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; plexId : GUID (+56, 16byte) varptr(st)+56 を基点に操作(16byte:入れ子/配列)
; memberIdx : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; ※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_EXTENT
#field GUID diskId
#field int type
#field int64 ullOffset
#field int64 ullSize
#field GUID volumeId
#field GUID plexId
#field int memberIdx
#endstruct
stdim st, VDS_DISK_EXTENT ; NSTRUCT 変数を確保
st->type = 100
mes "type=" + st->type