ホーム › System.SystemServices › TAPE_SET_DRIVE_PARAMETERS
TAPE_SET_DRIVE_PARAMETERS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ECC | BOOLEAN | 1 | +0 | +0 | エラー訂正符号(ECC)を有効にするか否か。 |
| Compression | BOOLEAN | 1 | +1 | +1 | ハードウェア圧縮を有効にするか否か。 |
| DataPadding | BOOLEAN | 1 | +2 | +2 | データパディングを有効にするか否か。 |
| ReportSetmarks | BOOLEAN | 1 | +3 | +3 | セットマークの報告を有効にするか否か。 |
| EOTWarningZoneSize | DWORD | 4 | +4 | +4 | テープ終端(EOT)警告ゾーンのサイズ(バイト)。 |
各言語での定義
#include <windows.h>
// TAPE_SET_DRIVE_PARAMETERS (x64 8 / x86 8 バイト)
typedef struct TAPE_SET_DRIVE_PARAMETERS {
BOOLEAN ECC;
BOOLEAN Compression;
BOOLEAN DataPadding;
BOOLEAN ReportSetmarks;
DWORD EOTWarningZoneSize;
} TAPE_SET_DRIVE_PARAMETERS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TAPE_SET_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 EOTWarningZoneSize;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TAPE_SET_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 EOTWarningZoneSize As UInteger
End Structureimport ctypes
from ctypes import wintypes
class TAPE_SET_DRIVE_PARAMETERS(ctypes.Structure):
_fields_ = [
("ECC", ctypes.c_byte),
("Compression", ctypes.c_byte),
("DataPadding", ctypes.c_byte),
("ReportSetmarks", ctypes.c_byte),
("EOTWarningZoneSize", wintypes.DWORD),
]#[repr(C)]
pub struct TAPE_SET_DRIVE_PARAMETERS {
pub ECC: u8,
pub Compression: u8,
pub DataPadding: u8,
pub ReportSetmarks: u8,
pub EOTWarningZoneSize: u32,
}import "golang.org/x/sys/windows"
type TAPE_SET_DRIVE_PARAMETERS struct {
ECC byte
Compression byte
DataPadding byte
ReportSetmarks byte
EOTWarningZoneSize uint32
}type
TAPE_SET_DRIVE_PARAMETERS = record
ECC: ByteBool;
Compression: ByteBool;
DataPadding: ByteBool;
ReportSetmarks: ByteBool;
EOTWarningZoneSize: DWORD;
end;const TAPE_SET_DRIVE_PARAMETERS = extern struct {
ECC: u8,
Compression: u8,
DataPadding: u8,
ReportSetmarks: u8,
EOTWarningZoneSize: u32,
};type
TAPE_SET_DRIVE_PARAMETERS {.bycopy.} = object
ECC: uint8
Compression: uint8
DataPadding: uint8
ReportSetmarks: uint8
EOTWarningZoneSize: uint32struct TAPE_SET_DRIVE_PARAMETERS
{
ubyte ECC;
ubyte Compression;
ubyte DataPadding;
ubyte ReportSetmarks;
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_SET_DRIVE_PARAMETERS サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 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)
; EOTWarningZoneSize : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TAPE_SET_DRIVE_PARAMETERS
#field bool1 ECC
#field bool1 Compression
#field bool1 DataPadding
#field bool1 ReportSetmarks
#field int EOTWarningZoneSize
#endstruct
stdim st, TAPE_SET_DRIVE_PARAMETERS ; NSTRUCT 変数を確保
st->ECC = 100
mes "ECC=" + st->ECC