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

TAPE_GET_DRIVE_PARAMETERS

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

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

フィールド

フィールドサイズx64x86説明
ECCBOOLEAN1+0+0エラー訂正符号(ECC)が有効か否かを示す。
CompressionBOOLEAN1+1+1ハードウェア圧縮が有効か否かを示す。
DataPaddingBOOLEAN1+2+2データパディングが有効か否かを示す。
ReportSetmarksBOOLEAN1+3+3セットマークの報告が有効か否かを示す。
DefaultBlockSizeDWORD4+4+4既定のブロックサイズ(バイト)。
MaximumBlockSizeDWORD4+8+8サポートする最大ブロックサイズ(バイト)。
MinimumBlockSizeDWORD4+12+12サポートする最小ブロックサイズ(バイト)。
MaximumPartitionCountDWORD4+16+16サポートする最大パーティション数。
FeaturesLowDWORD4+20+20ドライブ機能フラグの下位ビット群。
FeaturesHighTAPE_GET_DRIVE_PARAMETERS_FEATURES_HIGH4+24+24ドライブ機能フラグの上位ビット群。
EOTWarningZoneSizeDWORD4+28+28テープ終端(EOT)警告ゾーンのサイズ(バイト)。

各言語での定義

#include <windows.h>

// TAPE_GET_DRIVE_PARAMETERS  (x64 32 / x86 32 バイト)
typedef struct TAPE_GET_DRIVE_PARAMETERS {
    BOOLEAN ECC;
    BOOLEAN Compression;
    BOOLEAN DataPadding;
    BOOLEAN ReportSetmarks;
    DWORD DefaultBlockSize;
    DWORD MaximumBlockSize;
    DWORD MinimumBlockSize;
    DWORD MaximumPartitionCount;
    DWORD FeaturesLow;
    TAPE_GET_DRIVE_PARAMETERS_FEATURES_HIGH FeaturesHigh;
    DWORD EOTWarningZoneSize;
} TAPE_GET_DRIVE_PARAMETERS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TAPE_GET_DRIVE_PARAMETERS
{
    [MarshalAs(UnmanagedType.U1)] public bool ECC;
    [MarshalAs(UnmanagedType.U1)] public bool Compression;
    [MarshalAs(UnmanagedType.U1)] public bool DataPadding;
    [MarshalAs(UnmanagedType.U1)] public bool ReportSetmarks;
    public uint DefaultBlockSize;
    public uint MaximumBlockSize;
    public uint MinimumBlockSize;
    public uint MaximumPartitionCount;
    public uint FeaturesLow;
    public uint FeaturesHigh;
    public uint EOTWarningZoneSize;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TAPE_GET_DRIVE_PARAMETERS
    <MarshalAs(UnmanagedType.U1)> Public ECC As Boolean
    <MarshalAs(UnmanagedType.U1)> Public Compression As Boolean
    <MarshalAs(UnmanagedType.U1)> Public DataPadding As Boolean
    <MarshalAs(UnmanagedType.U1)> Public ReportSetmarks As Boolean
    Public DefaultBlockSize As UInteger
    Public MaximumBlockSize As UInteger
    Public MinimumBlockSize As UInteger
    Public MaximumPartitionCount As UInteger
    Public FeaturesLow As UInteger
    Public FeaturesHigh As UInteger
    Public EOTWarningZoneSize As UInteger
End Structure
import ctypes
from ctypes import wintypes

class TAPE_GET_DRIVE_PARAMETERS(ctypes.Structure):
    _fields_ = [
        ("ECC", ctypes.c_byte),
        ("Compression", ctypes.c_byte),
        ("DataPadding", ctypes.c_byte),
        ("ReportSetmarks", ctypes.c_byte),
        ("DefaultBlockSize", wintypes.DWORD),
        ("MaximumBlockSize", wintypes.DWORD),
        ("MinimumBlockSize", wintypes.DWORD),
        ("MaximumPartitionCount", wintypes.DWORD),
        ("FeaturesLow", wintypes.DWORD),
        ("FeaturesHigh", wintypes.DWORD),
        ("EOTWarningZoneSize", wintypes.DWORD),
    ]
#[repr(C)]
pub struct TAPE_GET_DRIVE_PARAMETERS {
    pub ECC: u8,
    pub Compression: u8,
    pub DataPadding: u8,
    pub ReportSetmarks: u8,
    pub DefaultBlockSize: u32,
    pub MaximumBlockSize: u32,
    pub MinimumBlockSize: u32,
    pub MaximumPartitionCount: u32,
    pub FeaturesLow: u32,
    pub FeaturesHigh: u32,
    pub EOTWarningZoneSize: u32,
}
import "golang.org/x/sys/windows"

type TAPE_GET_DRIVE_PARAMETERS struct {
	ECC byte
	Compression byte
	DataPadding byte
	ReportSetmarks byte
	DefaultBlockSize uint32
	MaximumBlockSize uint32
	MinimumBlockSize uint32
	MaximumPartitionCount uint32
	FeaturesLow uint32
	FeaturesHigh uint32
	EOTWarningZoneSize uint32
}
type
  TAPE_GET_DRIVE_PARAMETERS = record
    ECC: ByteBool;
    Compression: ByteBool;
    DataPadding: ByteBool;
    ReportSetmarks: ByteBool;
    DefaultBlockSize: DWORD;
    MaximumBlockSize: DWORD;
    MinimumBlockSize: DWORD;
    MaximumPartitionCount: DWORD;
    FeaturesLow: DWORD;
    FeaturesHigh: DWORD;
    EOTWarningZoneSize: DWORD;
  end;
const TAPE_GET_DRIVE_PARAMETERS = extern struct {
    ECC: u8,
    Compression: u8,
    DataPadding: u8,
    ReportSetmarks: u8,
    DefaultBlockSize: u32,
    MaximumBlockSize: u32,
    MinimumBlockSize: u32,
    MaximumPartitionCount: u32,
    FeaturesLow: u32,
    FeaturesHigh: u32,
    EOTWarningZoneSize: u32,
};
type
  TAPE_GET_DRIVE_PARAMETERS {.bycopy.} = object
    ECC: uint8
    Compression: uint8
    DataPadding: uint8
    ReportSetmarks: uint8
    DefaultBlockSize: uint32
    MaximumBlockSize: uint32
    MinimumBlockSize: uint32
    MaximumPartitionCount: uint32
    FeaturesLow: uint32
    FeaturesHigh: uint32
    EOTWarningZoneSize: uint32
struct TAPE_GET_DRIVE_PARAMETERS
{
    ubyte ECC;
    ubyte Compression;
    ubyte DataPadding;
    ubyte ReportSetmarks;
    uint DefaultBlockSize;
    uint MaximumBlockSize;
    uint MinimumBlockSize;
    uint MaximumPartitionCount;
    uint FeaturesLow;
    uint FeaturesHigh;
    uint EOTWarningZoneSize;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TAPE_GET_DRIVE_PARAMETERS サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; ECC : BOOLEAN (+0, 1byte)  poke st,0,値  /  値 = peek(st,0)
; Compression : BOOLEAN (+1, 1byte)  poke st,1,値  /  値 = peek(st,1)
; DataPadding : BOOLEAN (+2, 1byte)  poke st,2,値  /  値 = peek(st,2)
; ReportSetmarks : BOOLEAN (+3, 1byte)  poke st,3,値  /  値 = peek(st,3)
; DefaultBlockSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; MaximumBlockSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; MinimumBlockSize : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; MaximumPartitionCount : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; FeaturesLow : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; FeaturesHigh : TAPE_GET_DRIVE_PARAMETERS_FEATURES_HIGH (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; EOTWarningZoneSize : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TAPE_GET_DRIVE_PARAMETERS
    #field bool1 ECC
    #field bool1 Compression
    #field bool1 DataPadding
    #field bool1 ReportSetmarks
    #field int DefaultBlockSize
    #field int MaximumBlockSize
    #field int MinimumBlockSize
    #field int MaximumPartitionCount
    #field int FeaturesLow
    #field int FeaturesHigh
    #field int EOTWarningZoneSize
#endstruct

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