ホーム › Storage.VirtualDiskService › VDS_CREATE_VDISK_PARAMETERS
VDS_CREATE_VDISK_PARAMETERS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| UniqueId | GUID | 16 | +0 | +0 | 作成する仮想ディスクの一意識別子GUID。 |
| MaximumSize | ULONGLONG | 8 | +16 | +16 | 仮想ディスクの最大サイズをバイト単位で示す。 |
| BlockSizeInBytes | DWORD | 4 | +24 | +24 | 仮想ディスクのブロックサイズをバイト単位で示す。0で既定値。 |
| SectorSizeInBytes | DWORD | 4 | +28 | +28 | 仮想ディスクの論理セクターサイズをバイト単位で示す。 |
| pParentPath | LPWSTR | 8/4 | +32 | +32 | 差分ディスクの親ディスクパスを表すワイド文字列。NULL可。 |
| pSourcePath | LPWSTR | 8/4 | +40 | +36 | コピー元となるソースディスクパスを表すワイド文字列。NULL可。 |
各言語での定義
#include <windows.h>
// VDS_CREATE_VDISK_PARAMETERS (x64 48 / x86 40 バイト)
typedef struct VDS_CREATE_VDISK_PARAMETERS {
GUID UniqueId;
ULONGLONG MaximumSize;
DWORD BlockSizeInBytes;
DWORD SectorSizeInBytes;
LPWSTR pParentPath;
LPWSTR pSourcePath;
} VDS_CREATE_VDISK_PARAMETERS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VDS_CREATE_VDISK_PARAMETERS
{
public Guid UniqueId;
public ulong MaximumSize;
public uint BlockSizeInBytes;
public uint SectorSizeInBytes;
public IntPtr pParentPath;
public IntPtr pSourcePath;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VDS_CREATE_VDISK_PARAMETERS
Public UniqueId As Guid
Public MaximumSize As ULong
Public BlockSizeInBytes As UInteger
Public SectorSizeInBytes As UInteger
Public pParentPath As IntPtr
Public pSourcePath As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class VDS_CREATE_VDISK_PARAMETERS(ctypes.Structure):
_fields_ = [
("UniqueId", GUID),
("MaximumSize", ctypes.c_ulonglong),
("BlockSizeInBytes", wintypes.DWORD),
("SectorSizeInBytes", wintypes.DWORD),
("pParentPath", ctypes.c_void_p),
("pSourcePath", ctypes.c_void_p),
]#[repr(C)]
pub struct VDS_CREATE_VDISK_PARAMETERS {
pub UniqueId: GUID,
pub MaximumSize: u64,
pub BlockSizeInBytes: u32,
pub SectorSizeInBytes: u32,
pub pParentPath: *mut core::ffi::c_void,
pub pSourcePath: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type VDS_CREATE_VDISK_PARAMETERS struct {
UniqueId windows.GUID
MaximumSize uint64
BlockSizeInBytes uint32
SectorSizeInBytes uint32
pParentPath uintptr
pSourcePath uintptr
}type
VDS_CREATE_VDISK_PARAMETERS = record
UniqueId: TGUID;
MaximumSize: UInt64;
BlockSizeInBytes: DWORD;
SectorSizeInBytes: DWORD;
pParentPath: Pointer;
pSourcePath: Pointer;
end;const VDS_CREATE_VDISK_PARAMETERS = extern struct {
UniqueId: GUID,
MaximumSize: u64,
BlockSizeInBytes: u32,
SectorSizeInBytes: u32,
pParentPath: ?*anyopaque,
pSourcePath: ?*anyopaque,
};type
VDS_CREATE_VDISK_PARAMETERS {.bycopy.} = object
UniqueId: GUID
MaximumSize: uint64
BlockSizeInBytes: uint32
SectorSizeInBytes: uint32
pParentPath: pointer
pSourcePath: pointerstruct VDS_CREATE_VDISK_PARAMETERS
{
GUID UniqueId;
ulong MaximumSize;
uint BlockSizeInBytes;
uint SectorSizeInBytes;
void* pParentPath;
void* pSourcePath;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; VDS_CREATE_VDISK_PARAMETERS サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; UniqueId : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MaximumSize : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; BlockSizeInBytes : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; SectorSizeInBytes : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; pParentPath : LPWSTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pSourcePath : LPWSTR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VDS_CREATE_VDISK_PARAMETERS サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; UniqueId : GUID (+0, 16byte) varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; MaximumSize : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; BlockSizeInBytes : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; SectorSizeInBytes : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; pParentPath : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pSourcePath : LPWSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※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_CREATE_VDISK_PARAMETERS
#field GUID UniqueId
#field int64 MaximumSize
#field int BlockSizeInBytes
#field int SectorSizeInBytes
#field intptr pParentPath
#field intptr pSourcePath
#endstruct
stdim st, VDS_CREATE_VDISK_PARAMETERS ; NSTRUCT 変数を確保
st->MaximumSize = 100
mes "MaximumSize=" + st->MaximumSize