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

BOOT_AREA_INFO

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

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

フィールド

フィールドサイズx64x86説明
BootSectorCountDWORD4+0+0ブートセクタのコピー数。通常1または2である。
BootSectors_Anonymous_e__Struct16+8+8各ブートセクタのオフセット情報を保持する内部構造体配列。

構造体: _Anonymous_e__Struct x64 8B / x86 8B

フィールドサイズx64x86
OffsetLONGLONG8+0+0

各言語での定義

#include <windows.h>

// BOOT_AREA_INFO  (x64 24 / x86 24 バイト)
typedef struct BOOT_AREA_INFO {
    DWORD BootSectorCount;
    _Anonymous_e__Struct BootSectors[2];
} BOOT_AREA_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct BOOT_AREA_INFO
{
    public uint BootSectorCount;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public _Anonymous_e__Struct[] BootSectors;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure BOOT_AREA_INFO
    Public BootSectorCount As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public BootSectors() As _Anonymous_e__Struct
End Structure
import ctypes
from ctypes import wintypes

class BOOT_AREA_INFO(ctypes.Structure):
    _fields_ = [
        ("BootSectorCount", wintypes.DWORD),
        ("BootSectors", _Anonymous_e__Struct * 2),
    ]
#[repr(C)]
pub struct BOOT_AREA_INFO {
    pub BootSectorCount: u32,
    pub BootSectors: [_Anonymous_e__Struct; 2],
}
import "golang.org/x/sys/windows"

type BOOT_AREA_INFO struct {
	BootSectorCount uint32
	BootSectors [2]_Anonymous_e__Struct
}
type
  BOOT_AREA_INFO = record
    BootSectorCount: DWORD;
    BootSectors: array[0..1] of _Anonymous_e__Struct;
  end;
const BOOT_AREA_INFO = extern struct {
    BootSectorCount: u32,
    BootSectors: [2]_Anonymous_e__Struct,
};
type
  BOOT_AREA_INFO {.bycopy.} = object
    BootSectorCount: uint32
    BootSectors: array[2, _Anonymous_e__Struct]
struct BOOT_AREA_INFO
{
    uint BootSectorCount;
    _Anonymous_e__Struct[2] BootSectors;
}

HSP用 定義

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

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

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