ホーム › System.Ioctl › DISK_EX_INT13_INFO
DISK_EX_INT13_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ExBufferSize | WORD | 2 | +0 | +0 | 拡張INT13バッファのサイズ。 |
| ExFlags | WORD | 2 | +2 | +2 | 拡張INT13の情報フラグ。 |
| ExCylinders | DWORD | 4 | +4 | +4 | 拡張シリンダ数。 |
| ExHeads | DWORD | 4 | +8 | +8 | 拡張ヘッド数。 |
| ExSectorsPerTrack | DWORD | 4 | +12 | +12 | 1トラックあたりの拡張セクタ数。 |
| ExSectorsPerDrive | ULONGLONG | 8 | +16 | +16 | ドライブ全体の総セクタ数。 |
| ExSectorSize | WORD | 2 | +24 | +24 | セクタサイズ。バイト単位。 |
| ExReserved | WORD | 2 | +26 | +26 | 予約領域。ゼロを設定する。 |
各言語での定義
#include <windows.h>
// DISK_EX_INT13_INFO (x64 32 / x86 32 バイト)
typedef struct DISK_EX_INT13_INFO {
WORD ExBufferSize;
WORD ExFlags;
DWORD ExCylinders;
DWORD ExHeads;
DWORD ExSectorsPerTrack;
ULONGLONG ExSectorsPerDrive;
WORD ExSectorSize;
WORD ExReserved;
} DISK_EX_INT13_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DISK_EX_INT13_INFO
{
public ushort ExBufferSize;
public ushort ExFlags;
public uint ExCylinders;
public uint ExHeads;
public uint ExSectorsPerTrack;
public ulong ExSectorsPerDrive;
public ushort ExSectorSize;
public ushort ExReserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DISK_EX_INT13_INFO
Public ExBufferSize As UShort
Public ExFlags As UShort
Public ExCylinders As UInteger
Public ExHeads As UInteger
Public ExSectorsPerTrack As UInteger
Public ExSectorsPerDrive As ULong
Public ExSectorSize As UShort
Public ExReserved As UShort
End Structureimport ctypes
from ctypes import wintypes
class DISK_EX_INT13_INFO(ctypes.Structure):
_fields_ = [
("ExBufferSize", ctypes.c_ushort),
("ExFlags", ctypes.c_ushort),
("ExCylinders", wintypes.DWORD),
("ExHeads", wintypes.DWORD),
("ExSectorsPerTrack", wintypes.DWORD),
("ExSectorsPerDrive", ctypes.c_ulonglong),
("ExSectorSize", ctypes.c_ushort),
("ExReserved", ctypes.c_ushort),
]#[repr(C)]
pub struct DISK_EX_INT13_INFO {
pub ExBufferSize: u16,
pub ExFlags: u16,
pub ExCylinders: u32,
pub ExHeads: u32,
pub ExSectorsPerTrack: u32,
pub ExSectorsPerDrive: u64,
pub ExSectorSize: u16,
pub ExReserved: u16,
}import "golang.org/x/sys/windows"
type DISK_EX_INT13_INFO struct {
ExBufferSize uint16
ExFlags uint16
ExCylinders uint32
ExHeads uint32
ExSectorsPerTrack uint32
ExSectorsPerDrive uint64
ExSectorSize uint16
ExReserved uint16
}type
DISK_EX_INT13_INFO = record
ExBufferSize: Word;
ExFlags: Word;
ExCylinders: DWORD;
ExHeads: DWORD;
ExSectorsPerTrack: DWORD;
ExSectorsPerDrive: UInt64;
ExSectorSize: Word;
ExReserved: Word;
end;const DISK_EX_INT13_INFO = extern struct {
ExBufferSize: u16,
ExFlags: u16,
ExCylinders: u32,
ExHeads: u32,
ExSectorsPerTrack: u32,
ExSectorsPerDrive: u64,
ExSectorSize: u16,
ExReserved: u16,
};type
DISK_EX_INT13_INFO {.bycopy.} = object
ExBufferSize: uint16
ExFlags: uint16
ExCylinders: uint32
ExHeads: uint32
ExSectorsPerTrack: uint32
ExSectorsPerDrive: uint64
ExSectorSize: uint16
ExReserved: uint16struct DISK_EX_INT13_INFO
{
ushort ExBufferSize;
ushort ExFlags;
uint ExCylinders;
uint ExHeads;
uint ExSectorsPerTrack;
ulong ExSectorsPerDrive;
ushort ExSectorSize;
ushort ExReserved;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DISK_EX_INT13_INFO サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; ExBufferSize : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; ExFlags : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; ExCylinders : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ExHeads : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ExSectorsPerTrack : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ExSectorsPerDrive : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ExSectorSize : WORD (+24, 2byte) wpoke st,24,値 / 値 = wpeek(st,24)
; ExReserved : WORD (+26, 2byte) wpoke st,26,値 / 値 = wpeek(st,26)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DISK_EX_INT13_INFO
#field short ExBufferSize
#field short ExFlags
#field int ExCylinders
#field int ExHeads
#field int ExSectorsPerTrack
#field int64 ExSectorsPerDrive
#field short ExSectorSize
#field short ExReserved
#endstruct
stdim st, DISK_EX_INT13_INFO ; NSTRUCT 変数を確保
st->ExBufferSize = 100
mes "ExBufferSize=" + st->ExBufferSize