ホーム › System.Ioctl › STORAGE_PROTOCOL_SPECIFIC_DATA
STORAGE_PROTOCOL_SPECIFIC_DATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ProtocolType | STORAGE_PROTOCOL_TYPE | 4 | +0 | +0 | プロトコルの種類です。このメンバーの値は STORAGE_PROTOCOL_TYPE 列挙型で定義されています。 |
| DataType | DWORD | 4 | +4 | +4 | プロトコルデータの種類です。データの種類は STORAGE_PROTOCOL_NVME_DATA_TYPE 列挙型および STORAGE_PROTOCOL_ATA_DATA_TYPE 列挙型で定義されています。 |
| ProtocolDataRequestValue | DWORD | 4 | +8 | +8 | プロトコルデータ要求の値です。 |
| ProtocolDataRequestSubValue | DWORD | 4 | +12 | +12 | プロトコルデータ要求のサブ値です。 |
| ProtocolDataOffset | DWORD | 4 | +16 | +16 | この構造体の先頭から数えたデータバッファーのオフセットです。一般的な値は sizeof(STORAGE_PROTOCOL_SPECIFIC_DATA) です。 |
| ProtocolDataLength | DWORD | 4 | +20 | +20 | プロトコルデータの長さです。 |
| FixedProtocolReturnData | DWORD | 4 | +24 | +24 | 返されたデータです。 |
| ProtocolDataRequestSubValue2 | DWORD | 4 | +28 | +28 | プロトコルデータ要求の追加サブ値2。 |
| ProtocolDataRequestSubValue3 | DWORD | 4 | +32 | +32 | プロトコルデータ要求の追加サブ値3。 |
| ProtocolDataRequestSubValue4 | DWORD | 4 | +36 | +36 | プロトコルデータ要求の追加サブ値4。 |
公式ドキュメント
IOCTL_STORAGE_QUERY_PROPERTY 要求の入力バッファーおよび出力バッファーで提供される、プロトコル固有のデバイスデータを記述します。
解説(Remarks)
IOCTL_STORAGE_QUERY_PROPERTY を使用して STORAGE_PROTOCOL_DATA_DESCRIPTOR 内のプロトコル固有の情報を取得する場合は、STORAGE_PROPERTY_QUERY 構造体を次のように設定します。
- STORAGE_PROPERTY_QUERY 構造体と STORAGE_PROTOCOL_SPECIFIC_DATA 構造体の両方を格納できるバッファーを割り当てます。
- コントローラーに対する要求の場合は PropertyID フィールドに StorageAdapterProtocolSpecificProperty を、デバイスまたは名前空間に対する要求の場合は StorageDeviceProtocolSpecificProperty を設定します。
- QueryType フィールドに PropertyStandardQuery を設定します。
- STORAGE_PROTOCOL_SPECIFIC_DATA 構造体に目的の値を設定します。STORAGE_PROTOCOL_SPECIFIC_DATA の先頭は、STORAGE_PROPERTY_QUERY の AdditionalParameters フィールドです。
- ProtocolType フィールドに ProtocolTypeNVMe を設定します。
-
DataType フィールドに STORAGE_PROTOCOL_NVME_DATA_TYPE で定義されている列挙値を設定します。
- Identify Controller データまたは Identify Namespace データを取得するには NVMeDataTypeIdentify を使用します。
- ログページ (SMART/ヘルスデータを含む) を取得するには NVMeDataTypeLogPage を使用します。
- NVMe ドライブの機能 (フィーチャー) を取得するには NVMeDataTypeFeature を使用します。
- ProtocolType フィールドに ProtocolTypeAta を設定します。
-
DataType フィールドに STORAGE_PROTOCOL_ATA_DATA_TYPE で定義されている列挙値を設定します。
- ATA ドライブを識別するには AtaDataTypeIdentify を使用します。
- ATA ドライブからログページを取得するには AtaDataTypeLogPage を使用します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// STORAGE_PROTOCOL_SPECIFIC_DATA (x64 40 / x86 40 バイト)
typedef struct STORAGE_PROTOCOL_SPECIFIC_DATA {
STORAGE_PROTOCOL_TYPE ProtocolType;
DWORD DataType;
DWORD ProtocolDataRequestValue;
DWORD ProtocolDataRequestSubValue;
DWORD ProtocolDataOffset;
DWORD ProtocolDataLength;
DWORD FixedProtocolReturnData;
DWORD ProtocolDataRequestSubValue2;
DWORD ProtocolDataRequestSubValue3;
DWORD ProtocolDataRequestSubValue4;
} STORAGE_PROTOCOL_SPECIFIC_DATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct STORAGE_PROTOCOL_SPECIFIC_DATA
{
public int ProtocolType;
public uint DataType;
public uint ProtocolDataRequestValue;
public uint ProtocolDataRequestSubValue;
public uint ProtocolDataOffset;
public uint ProtocolDataLength;
public uint FixedProtocolReturnData;
public uint ProtocolDataRequestSubValue2;
public uint ProtocolDataRequestSubValue3;
public uint ProtocolDataRequestSubValue4;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure STORAGE_PROTOCOL_SPECIFIC_DATA
Public ProtocolType As Integer
Public DataType As UInteger
Public ProtocolDataRequestValue As UInteger
Public ProtocolDataRequestSubValue As UInteger
Public ProtocolDataOffset As UInteger
Public ProtocolDataLength As UInteger
Public FixedProtocolReturnData As UInteger
Public ProtocolDataRequestSubValue2 As UInteger
Public ProtocolDataRequestSubValue3 As UInteger
Public ProtocolDataRequestSubValue4 As UInteger
End Structureimport ctypes
from ctypes import wintypes
class STORAGE_PROTOCOL_SPECIFIC_DATA(ctypes.Structure):
_fields_ = [
("ProtocolType", ctypes.c_int),
("DataType", wintypes.DWORD),
("ProtocolDataRequestValue", wintypes.DWORD),
("ProtocolDataRequestSubValue", wintypes.DWORD),
("ProtocolDataOffset", wintypes.DWORD),
("ProtocolDataLength", wintypes.DWORD),
("FixedProtocolReturnData", wintypes.DWORD),
("ProtocolDataRequestSubValue2", wintypes.DWORD),
("ProtocolDataRequestSubValue3", wintypes.DWORD),
("ProtocolDataRequestSubValue4", wintypes.DWORD),
]#[repr(C)]
pub struct STORAGE_PROTOCOL_SPECIFIC_DATA {
pub ProtocolType: i32,
pub DataType: u32,
pub ProtocolDataRequestValue: u32,
pub ProtocolDataRequestSubValue: u32,
pub ProtocolDataOffset: u32,
pub ProtocolDataLength: u32,
pub FixedProtocolReturnData: u32,
pub ProtocolDataRequestSubValue2: u32,
pub ProtocolDataRequestSubValue3: u32,
pub ProtocolDataRequestSubValue4: u32,
}import "golang.org/x/sys/windows"
type STORAGE_PROTOCOL_SPECIFIC_DATA struct {
ProtocolType int32
DataType uint32
ProtocolDataRequestValue uint32
ProtocolDataRequestSubValue uint32
ProtocolDataOffset uint32
ProtocolDataLength uint32
FixedProtocolReturnData uint32
ProtocolDataRequestSubValue2 uint32
ProtocolDataRequestSubValue3 uint32
ProtocolDataRequestSubValue4 uint32
}type
STORAGE_PROTOCOL_SPECIFIC_DATA = record
ProtocolType: Integer;
DataType: DWORD;
ProtocolDataRequestValue: DWORD;
ProtocolDataRequestSubValue: DWORD;
ProtocolDataOffset: DWORD;
ProtocolDataLength: DWORD;
FixedProtocolReturnData: DWORD;
ProtocolDataRequestSubValue2: DWORD;
ProtocolDataRequestSubValue3: DWORD;
ProtocolDataRequestSubValue4: DWORD;
end;const STORAGE_PROTOCOL_SPECIFIC_DATA = extern struct {
ProtocolType: i32,
DataType: u32,
ProtocolDataRequestValue: u32,
ProtocolDataRequestSubValue: u32,
ProtocolDataOffset: u32,
ProtocolDataLength: u32,
FixedProtocolReturnData: u32,
ProtocolDataRequestSubValue2: u32,
ProtocolDataRequestSubValue3: u32,
ProtocolDataRequestSubValue4: u32,
};type
STORAGE_PROTOCOL_SPECIFIC_DATA {.bycopy.} = object
ProtocolType: int32
DataType: uint32
ProtocolDataRequestValue: uint32
ProtocolDataRequestSubValue: uint32
ProtocolDataOffset: uint32
ProtocolDataLength: uint32
FixedProtocolReturnData: uint32
ProtocolDataRequestSubValue2: uint32
ProtocolDataRequestSubValue3: uint32
ProtocolDataRequestSubValue4: uint32struct STORAGE_PROTOCOL_SPECIFIC_DATA
{
int ProtocolType;
uint DataType;
uint ProtocolDataRequestValue;
uint ProtocolDataRequestSubValue;
uint ProtocolDataOffset;
uint ProtocolDataLength;
uint FixedProtocolReturnData;
uint ProtocolDataRequestSubValue2;
uint ProtocolDataRequestSubValue3;
uint ProtocolDataRequestSubValue4;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; STORAGE_PROTOCOL_SPECIFIC_DATA サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; ProtocolType : STORAGE_PROTOCOL_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; DataType : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ProtocolDataRequestValue : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ProtocolDataRequestSubValue : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ProtocolDataOffset : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ProtocolDataLength : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; FixedProtocolReturnData : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ProtocolDataRequestSubValue2 : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ProtocolDataRequestSubValue3 : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ProtocolDataRequestSubValue4 : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global STORAGE_PROTOCOL_SPECIFIC_DATA
#field int ProtocolType
#field int DataType
#field int ProtocolDataRequestValue
#field int ProtocolDataRequestSubValue
#field int ProtocolDataOffset
#field int ProtocolDataLength
#field int FixedProtocolReturnData
#field int ProtocolDataRequestSubValue2
#field int ProtocolDataRequestSubValue3
#field int ProtocolDataRequestSubValue4
#endstruct
stdim st, STORAGE_PROTOCOL_SPECIFIC_DATA ; NSTRUCT 変数を確保
st->ProtocolType = 100
mes "ProtocolType=" + st->ProtocolType