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

NVMEOF_AUTH_RECEIVE_RESPONSE

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

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

フィールド

フィールドサイズx64x86説明
Reserved0ULONGLONG8+0+0将来の拡張用に予約された64ビットフィールドである。
SQHDWORD2+8+8送信キューヘッドポインタ(SQ Head Pointer)を表す16ビット値である。
Reserved1WORD2+10+10将来の拡張用に予約された16ビットフィールドである。
CIDWORD2+12+12対応するコマンドの識別子(Command Identifier)を表す16ビット値である。
STSWORD2+14+14完了状態を示すステータスフィールド(Status)を表す16ビット値である。

各言語での定義

#include <windows.h>

// NVMEOF_AUTH_RECEIVE_RESPONSE  (x64 16 / x86 16 バイト)
typedef struct NVMEOF_AUTH_RECEIVE_RESPONSE {
    ULONGLONG Reserved0;
    WORD SQHD;
    WORD Reserved1;
    WORD CID;
    WORD STS;
} NVMEOF_AUTH_RECEIVE_RESPONSE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NVMEOF_AUTH_RECEIVE_RESPONSE
{
    public ulong Reserved0;
    public ushort SQHD;
    public ushort Reserved1;
    public ushort CID;
    public ushort STS;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NVMEOF_AUTH_RECEIVE_RESPONSE
    Public Reserved0 As ULong
    Public SQHD As UShort
    Public Reserved1 As UShort
    Public CID As UShort
    Public STS As UShort
End Structure
import ctypes
from ctypes import wintypes

class NVMEOF_AUTH_RECEIVE_RESPONSE(ctypes.Structure):
    _fields_ = [
        ("Reserved0", ctypes.c_ulonglong),
        ("SQHD", ctypes.c_ushort),
        ("Reserved1", ctypes.c_ushort),
        ("CID", ctypes.c_ushort),
        ("STS", ctypes.c_ushort),
    ]
#[repr(C)]
pub struct NVMEOF_AUTH_RECEIVE_RESPONSE {
    pub Reserved0: u64,
    pub SQHD: u16,
    pub Reserved1: u16,
    pub CID: u16,
    pub STS: u16,
}
import "golang.org/x/sys/windows"

type NVMEOF_AUTH_RECEIVE_RESPONSE struct {
	Reserved0 uint64
	SQHD uint16
	Reserved1 uint16
	CID uint16
	STS uint16
}
type
  NVMEOF_AUTH_RECEIVE_RESPONSE = record
    Reserved0: UInt64;
    SQHD: Word;
    Reserved1: Word;
    CID: Word;
    STS: Word;
  end;
const NVMEOF_AUTH_RECEIVE_RESPONSE = extern struct {
    Reserved0: u64,
    SQHD: u16,
    Reserved1: u16,
    CID: u16,
    STS: u16,
};
type
  NVMEOF_AUTH_RECEIVE_RESPONSE {.bycopy.} = object
    Reserved0: uint64
    SQHD: uint16
    Reserved1: uint16
    CID: uint16
    STS: uint16
struct NVMEOF_AUTH_RECEIVE_RESPONSE
{
    ulong Reserved0;
    ushort SQHD;
    ushort Reserved1;
    ushort CID;
    ushort STS;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NVMEOF_AUTH_RECEIVE_RESPONSE サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; Reserved0 : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; SQHD : WORD (+8, 2byte)  wpoke st,8,値  /  値 = wpeek(st,8)
; Reserved1 : WORD (+10, 2byte)  wpoke st,10,値  /  値 = wpeek(st,10)
; CID : WORD (+12, 2byte)  wpoke st,12,値  /  値 = wpeek(st,12)
; STS : WORD (+14, 2byte)  wpoke st,14,値  /  値 = wpeek(st,14)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NVMEOF_AUTH_RECEIVE_RESPONSE
    #field int64 Reserved0
    #field short SQHD
    #field short Reserved1
    #field short CID
    #field short STS
#endstruct

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