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

STORAGE_ZONE_DESCRIPTOR

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

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

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0この構造体のサイズをバイト単位で示す。
ZoneTypeSTORAGE_ZONE_TYPES4+4+4ゾーンの種類を示すSTORAGE_ZONE_TYPES列挙値。
ZoneConditionSTORAGE_ZONE_CONDITION4+8+8ゾーンの現在状態を示すSTORAGE_ZONE_CONDITION列挙値。空/オープン/フル等。
ResetWritePointerRecommendBOOLEAN1+12+12書き込みポインタのリセットが推奨されるかを示す真偽値。
Reserved0BYTE3+13+13将来の拡張のために予約されたバイト配列。
ZoneSizeULONGLONG8+16+16ゾーンのサイズをバイト単位で示す。
WritePointerOffsetULONGLONG8+24+24ゾーン内の書き込みポインタ位置をバイト単位で示す。

各言語での定義

#include <windows.h>

// STORAGE_ZONE_DESCRIPTOR  (x64 32 / x86 32 バイト)
typedef struct STORAGE_ZONE_DESCRIPTOR {
    DWORD Size;
    STORAGE_ZONE_TYPES ZoneType;
    STORAGE_ZONE_CONDITION ZoneCondition;
    BOOLEAN ResetWritePointerRecommend;
    BYTE Reserved0[3];
    ULONGLONG ZoneSize;
    ULONGLONG WritePointerOffset;
} STORAGE_ZONE_DESCRIPTOR;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct STORAGE_ZONE_DESCRIPTOR
{
    public uint Size;
    public int ZoneType;
    public int ZoneCondition;
    [MarshalAs(UnmanagedType.U1)] public bool ResetWritePointerRecommend;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] Reserved0;
    public ulong ZoneSize;
    public ulong WritePointerOffset;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure STORAGE_ZONE_DESCRIPTOR
    Public Size As UInteger
    Public ZoneType As Integer
    Public ZoneCondition As Integer
    <MarshalAs(UnmanagedType.U1)> Public ResetWritePointerRecommend As Boolean
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public Reserved0() As Byte
    Public ZoneSize As ULong
    Public WritePointerOffset As ULong
End Structure
import ctypes
from ctypes import wintypes

class STORAGE_ZONE_DESCRIPTOR(ctypes.Structure):
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("ZoneType", ctypes.c_int),
        ("ZoneCondition", ctypes.c_int),
        ("ResetWritePointerRecommend", ctypes.c_byte),
        ("Reserved0", ctypes.c_ubyte * 3),
        ("ZoneSize", ctypes.c_ulonglong),
        ("WritePointerOffset", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct STORAGE_ZONE_DESCRIPTOR {
    pub Size: u32,
    pub ZoneType: i32,
    pub ZoneCondition: i32,
    pub ResetWritePointerRecommend: u8,
    pub Reserved0: [u8; 3],
    pub ZoneSize: u64,
    pub WritePointerOffset: u64,
}
import "golang.org/x/sys/windows"

type STORAGE_ZONE_DESCRIPTOR struct {
	Size uint32
	ZoneType int32
	ZoneCondition int32
	ResetWritePointerRecommend byte
	Reserved0 [3]byte
	ZoneSize uint64
	WritePointerOffset uint64
}
type
  STORAGE_ZONE_DESCRIPTOR = record
    Size: DWORD;
    ZoneType: Integer;
    ZoneCondition: Integer;
    ResetWritePointerRecommend: ByteBool;
    Reserved0: array[0..2] of Byte;
    ZoneSize: UInt64;
    WritePointerOffset: UInt64;
  end;
const STORAGE_ZONE_DESCRIPTOR = extern struct {
    Size: u32,
    ZoneType: i32,
    ZoneCondition: i32,
    ResetWritePointerRecommend: u8,
    Reserved0: [3]u8,
    ZoneSize: u64,
    WritePointerOffset: u64,
};
type
  STORAGE_ZONE_DESCRIPTOR {.bycopy.} = object
    Size: uint32
    ZoneType: int32
    ZoneCondition: int32
    ResetWritePointerRecommend: uint8
    Reserved0: array[3, uint8]
    ZoneSize: uint64
    WritePointerOffset: uint64
struct STORAGE_ZONE_DESCRIPTOR
{
    uint Size;
    int ZoneType;
    int ZoneCondition;
    ubyte ResetWritePointerRecommend;
    ubyte[3] Reserved0;
    ulong ZoneSize;
    ulong WritePointerOffset;
}

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_DESCRIPTOR サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ZoneType : STORAGE_ZONE_TYPES (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ZoneCondition : STORAGE_ZONE_CONDITION (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ResetWritePointerRecommend : BOOLEAN (+12, 1byte)  poke st,12,値  /  値 = peek(st,12)
; Reserved0 : BYTE (+13, 3byte)  varptr(st)+13 を基点に操作(3byte:入れ子/配列)
; ZoneSize : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; WritePointerOffset : 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_ZONE_DESCRIPTOR
    #field int Size
    #field int ZoneType
    #field int ZoneCondition
    #field bool1 ResetWritePointerRecommend
    #field byte Reserved0 3
    #field int64 ZoneSize
    #field int64 WritePointerOffset
#endstruct

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