Win32 API 日本語リファレンス
ホームSystem.Ioctl › STORAGE_LB_PROVISIONING_MAP_RESOURCES

STORAGE_LB_PROVISIONING_MAP_RESOURCES

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

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

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0この構造体のサイズをバイト単位で示す。
VersionDWORD4+4+4構造体のバージョン番号。
_bitfield1BYTE1+8+8利用可能マッピングリソースの有効性等を表すビットフィールド。
Reserved1BYTE3+9+9将来の拡張のために予約されたバイト領域。
_bitfield2BYTE1+12+12使用中マッピングリソースの有効性等を表すビットフィールド。
Reserved3BYTE3+13+13将来の拡張のために予約されたバイト領域。
AvailableMappingResourcesULONGLONG8+16+16利用可能なマッピングリソース量をバイト単位で示す。
UsedMappingResourcesULONGLONG8+24+24使用済みのマッピングリソース量をバイト単位で示す。

各言語での定義

#include <windows.h>

// STORAGE_LB_PROVISIONING_MAP_RESOURCES  (x64 32 / x86 32 バイト)
typedef struct STORAGE_LB_PROVISIONING_MAP_RESOURCES {
    DWORD Size;
    DWORD Version;
    BYTE _bitfield1;
    BYTE Reserved1[3];
    BYTE _bitfield2;
    BYTE Reserved3[3];
    ULONGLONG AvailableMappingResources;
    ULONGLONG UsedMappingResources;
} STORAGE_LB_PROVISIONING_MAP_RESOURCES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct STORAGE_LB_PROVISIONING_MAP_RESOURCES
{
    public uint Size;
    public uint Version;
    public byte _bitfield1;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] Reserved1;
    public byte _bitfield2;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] Reserved3;
    public ulong AvailableMappingResources;
    public ulong UsedMappingResources;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure STORAGE_LB_PROVISIONING_MAP_RESOURCES
    Public Size As UInteger
    Public Version As UInteger
    Public _bitfield1 As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public Reserved1() As Byte
    Public _bitfield2 As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public Reserved3() As Byte
    Public AvailableMappingResources As ULong
    Public UsedMappingResources As ULong
End Structure
import ctypes
from ctypes import wintypes

class STORAGE_LB_PROVISIONING_MAP_RESOURCES(ctypes.Structure):
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("Version", wintypes.DWORD),
        ("_bitfield1", ctypes.c_ubyte),
        ("Reserved1", ctypes.c_ubyte * 3),
        ("_bitfield2", ctypes.c_ubyte),
        ("Reserved3", ctypes.c_ubyte * 3),
        ("AvailableMappingResources", ctypes.c_ulonglong),
        ("UsedMappingResources", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct STORAGE_LB_PROVISIONING_MAP_RESOURCES {
    pub Size: u32,
    pub Version: u32,
    pub _bitfield1: u8,
    pub Reserved1: [u8; 3],
    pub _bitfield2: u8,
    pub Reserved3: [u8; 3],
    pub AvailableMappingResources: u64,
    pub UsedMappingResources: u64,
}
import "golang.org/x/sys/windows"

type STORAGE_LB_PROVISIONING_MAP_RESOURCES struct {
	Size uint32
	Version uint32
	_bitfield1 byte
	Reserved1 [3]byte
	_bitfield2 byte
	Reserved3 [3]byte
	AvailableMappingResources uint64
	UsedMappingResources uint64
}
type
  STORAGE_LB_PROVISIONING_MAP_RESOURCES = record
    Size: DWORD;
    Version: DWORD;
    _bitfield1: Byte;
    Reserved1: array[0..2] of Byte;
    _bitfield2: Byte;
    Reserved3: array[0..2] of Byte;
    AvailableMappingResources: UInt64;
    UsedMappingResources: UInt64;
  end;
const STORAGE_LB_PROVISIONING_MAP_RESOURCES = extern struct {
    Size: u32,
    Version: u32,
    _bitfield1: u8,
    Reserved1: [3]u8,
    _bitfield2: u8,
    Reserved3: [3]u8,
    AvailableMappingResources: u64,
    UsedMappingResources: u64,
};
type
  STORAGE_LB_PROVISIONING_MAP_RESOURCES {.bycopy.} = object
    Size: uint32
    Version: uint32
    _bitfield1: uint8
    Reserved1: array[3, uint8]
    _bitfield2: uint8
    Reserved3: array[3, uint8]
    AvailableMappingResources: uint64
    UsedMappingResources: uint64
struct STORAGE_LB_PROVISIONING_MAP_RESOURCES
{
    uint Size;
    uint Version;
    ubyte _bitfield1;
    ubyte[3] Reserved1;
    ubyte _bitfield2;
    ubyte[3] Reserved3;
    ulong AvailableMappingResources;
    ulong UsedMappingResources;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; STORAGE_LB_PROVISIONING_MAP_RESOURCES サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; _bitfield1 : BYTE (+8, 1byte)  poke st,8,値  /  値 = peek(st,8)
; Reserved1 : BYTE (+9, 3byte)  varptr(st)+9 を基点に操作(3byte:入れ子/配列)
; _bitfield2 : BYTE (+12, 1byte)  poke st,12,値  /  値 = peek(st,12)
; Reserved3 : BYTE (+13, 3byte)  varptr(st)+13 を基点に操作(3byte:入れ子/配列)
; AvailableMappingResources : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; UsedMappingResources : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global STORAGE_LB_PROVISIONING_MAP_RESOURCES
    #field int Size
    #field int Version
    #field byte _bitfield1
    #field byte Reserved1 3
    #field byte _bitfield2
    #field byte Reserved3 3
    #field int64 AvailableMappingResources
    #field int64 UsedMappingResources
#endstruct

stdim st, STORAGE_LB_PROVISIONING_MAP_RESOURCES        ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size