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

STORAGE_ZONE_GROUP

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

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

フィールド

フィールドサイズx64x86説明
ZoneCountDWORD4+0+0このグループに含まれるゾーンの数。
ZoneTypeSTORAGE_ZONE_TYPES4+4+4ゾーンの種類を示すSTORAGE_ZONE_TYPES列挙値。順次書き込み等。
ZoneSizeULONGLONG8+8+8各ゾーンのサイズをバイト単位で示す。

各言語での定義

#include <windows.h>

// STORAGE_ZONE_GROUP  (x64 16 / x86 16 バイト)
typedef struct STORAGE_ZONE_GROUP {
    DWORD ZoneCount;
    STORAGE_ZONE_TYPES ZoneType;
    ULONGLONG ZoneSize;
} STORAGE_ZONE_GROUP;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct STORAGE_ZONE_GROUP
{
    public uint ZoneCount;
    public int ZoneType;
    public ulong ZoneSize;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure STORAGE_ZONE_GROUP
    Public ZoneCount As UInteger
    Public ZoneType As Integer
    Public ZoneSize As ULong
End Structure
import ctypes
from ctypes import wintypes

class STORAGE_ZONE_GROUP(ctypes.Structure):
    _fields_ = [
        ("ZoneCount", wintypes.DWORD),
        ("ZoneType", ctypes.c_int),
        ("ZoneSize", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct STORAGE_ZONE_GROUP {
    pub ZoneCount: u32,
    pub ZoneType: i32,
    pub ZoneSize: u64,
}
import "golang.org/x/sys/windows"

type STORAGE_ZONE_GROUP struct {
	ZoneCount uint32
	ZoneType int32
	ZoneSize uint64
}
type
  STORAGE_ZONE_GROUP = record
    ZoneCount: DWORD;
    ZoneType: Integer;
    ZoneSize: UInt64;
  end;
const STORAGE_ZONE_GROUP = extern struct {
    ZoneCount: u32,
    ZoneType: i32,
    ZoneSize: u64,
};
type
  STORAGE_ZONE_GROUP {.bycopy.} = object
    ZoneCount: uint32
    ZoneType: int32
    ZoneSize: uint64
struct STORAGE_ZONE_GROUP
{
    uint ZoneCount;
    int ZoneType;
    ulong ZoneSize;
}

HSP用 定義

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

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

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