Win32 API 日本語リファレンス
ホームStorage.IscsiDisc › IO_SCSI_CAPABILITIES

IO_SCSI_CAPABILITIES

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

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

フィールド

フィールドサイズx64x86説明
LengthDWORD4+0+0この構造体のバイト長。
MaximumTransferLengthDWORD4+4+41回の転送で扱える最大バイト数。
MaximumPhysicalPagesDWORD4+8+81回の転送で扱える最大物理ページ数。
SupportedAsynchronousEventsDWORD4+12+12サポートされる非同期イベントのビットマスク。
AlignmentMaskDWORD4+16+16バッファに要求されるアラインメントマスク。
TaggedQueuingBOOLEAN1+20+20タグ付きキューイングをサポートすればTRUE。
AdapterScansDownBOOLEAN1+21+21アダプタがターゲットを降順スキャンすればTRUE。
AdapterUsesPioBOOLEAN1+22+22アダプタがPIO(プログラムドI/O)を使用すればTRUE。

各言語での定義

#include <windows.h>

// IO_SCSI_CAPABILITIES  (x64 24 / x86 24 バイト)
typedef struct IO_SCSI_CAPABILITIES {
    DWORD Length;
    DWORD MaximumTransferLength;
    DWORD MaximumPhysicalPages;
    DWORD SupportedAsynchronousEvents;
    DWORD AlignmentMask;
    BOOLEAN TaggedQueuing;
    BOOLEAN AdapterScansDown;
    BOOLEAN AdapterUsesPio;
} IO_SCSI_CAPABILITIES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IO_SCSI_CAPABILITIES
{
    public uint Length;
    public uint MaximumTransferLength;
    public uint MaximumPhysicalPages;
    public uint SupportedAsynchronousEvents;
    public uint AlignmentMask;
    [MarshalAs(UnmanagedType.U1)] public bool TaggedQueuing;
    [MarshalAs(UnmanagedType.U1)] public bool AdapterScansDown;
    [MarshalAs(UnmanagedType.U1)] public bool AdapterUsesPio;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IO_SCSI_CAPABILITIES
    Public Length As UInteger
    Public MaximumTransferLength As UInteger
    Public MaximumPhysicalPages As UInteger
    Public SupportedAsynchronousEvents As UInteger
    Public AlignmentMask As UInteger
    <MarshalAs(UnmanagedType.U1)> Public TaggedQueuing As Boolean
    <MarshalAs(UnmanagedType.U1)> Public AdapterScansDown As Boolean
    <MarshalAs(UnmanagedType.U1)> Public AdapterUsesPio As Boolean
End Structure
import ctypes
from ctypes import wintypes

class IO_SCSI_CAPABILITIES(ctypes.Structure):
    _fields_ = [
        ("Length", wintypes.DWORD),
        ("MaximumTransferLength", wintypes.DWORD),
        ("MaximumPhysicalPages", wintypes.DWORD),
        ("SupportedAsynchronousEvents", wintypes.DWORD),
        ("AlignmentMask", wintypes.DWORD),
        ("TaggedQueuing", ctypes.c_byte),
        ("AdapterScansDown", ctypes.c_byte),
        ("AdapterUsesPio", ctypes.c_byte),
    ]
#[repr(C)]
pub struct IO_SCSI_CAPABILITIES {
    pub Length: u32,
    pub MaximumTransferLength: u32,
    pub MaximumPhysicalPages: u32,
    pub SupportedAsynchronousEvents: u32,
    pub AlignmentMask: u32,
    pub TaggedQueuing: u8,
    pub AdapterScansDown: u8,
    pub AdapterUsesPio: u8,
}
import "golang.org/x/sys/windows"

type IO_SCSI_CAPABILITIES struct {
	Length uint32
	MaximumTransferLength uint32
	MaximumPhysicalPages uint32
	SupportedAsynchronousEvents uint32
	AlignmentMask uint32
	TaggedQueuing byte
	AdapterScansDown byte
	AdapterUsesPio byte
}
type
  IO_SCSI_CAPABILITIES = record
    Length: DWORD;
    MaximumTransferLength: DWORD;
    MaximumPhysicalPages: DWORD;
    SupportedAsynchronousEvents: DWORD;
    AlignmentMask: DWORD;
    TaggedQueuing: ByteBool;
    AdapterScansDown: ByteBool;
    AdapterUsesPio: ByteBool;
  end;
const IO_SCSI_CAPABILITIES = extern struct {
    Length: u32,
    MaximumTransferLength: u32,
    MaximumPhysicalPages: u32,
    SupportedAsynchronousEvents: u32,
    AlignmentMask: u32,
    TaggedQueuing: u8,
    AdapterScansDown: u8,
    AdapterUsesPio: u8,
};
type
  IO_SCSI_CAPABILITIES {.bycopy.} = object
    Length: uint32
    MaximumTransferLength: uint32
    MaximumPhysicalPages: uint32
    SupportedAsynchronousEvents: uint32
    AlignmentMask: uint32
    TaggedQueuing: uint8
    AdapterScansDown: uint8
    AdapterUsesPio: uint8
struct IO_SCSI_CAPABILITIES
{
    uint Length;
    uint MaximumTransferLength;
    uint MaximumPhysicalPages;
    uint SupportedAsynchronousEvents;
    uint AlignmentMask;
    ubyte TaggedQueuing;
    ubyte AdapterScansDown;
    ubyte AdapterUsesPio;
}

HSP用 定義

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

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

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