ホーム › Storage.IscsiDisc › HYBRID_REQUEST_BLOCK
HYBRID_REQUEST_BLOCK
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | DWORD | 4 | +0 | +0 | この構造体のバージョン番号。 |
| Size | DWORD | 4 | +4 | +4 | この構造体のバイトサイズ。 |
| Function | DWORD | 4 | +8 | +8 | 実行するハイブリッドディスク機能コード。 |
| Flags | DWORD | 4 | +12 | +12 | 要求の動作フラグ。 |
| DataBufferOffset | DWORD | 4 | +16 | +16 | 構造体先頭からデータバッファまでのバイトオフセット。 |
| DataBufferLength | DWORD | 4 | +20 | +20 | データバッファのバイト長。 |
各言語での定義
#include <windows.h>
// HYBRID_REQUEST_BLOCK (x64 24 / x86 24 バイト)
typedef struct HYBRID_REQUEST_BLOCK {
DWORD Version;
DWORD Size;
DWORD Function;
DWORD Flags;
DWORD DataBufferOffset;
DWORD DataBufferLength;
} HYBRID_REQUEST_BLOCK;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HYBRID_REQUEST_BLOCK
{
public uint Version;
public uint Size;
public uint Function;
public uint Flags;
public uint DataBufferOffset;
public uint DataBufferLength;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HYBRID_REQUEST_BLOCK
Public Version As UInteger
Public Size As UInteger
Public Function As UInteger
Public Flags As UInteger
Public DataBufferOffset As UInteger
Public DataBufferLength As UInteger
End Structureimport ctypes
from ctypes import wintypes
class HYBRID_REQUEST_BLOCK(ctypes.Structure):
_fields_ = [
("Version", wintypes.DWORD),
("Size", wintypes.DWORD),
("Function", wintypes.DWORD),
("Flags", wintypes.DWORD),
("DataBufferOffset", wintypes.DWORD),
("DataBufferLength", wintypes.DWORD),
]#[repr(C)]
pub struct HYBRID_REQUEST_BLOCK {
pub Version: u32,
pub Size: u32,
pub Function: u32,
pub Flags: u32,
pub DataBufferOffset: u32,
pub DataBufferLength: u32,
}import "golang.org/x/sys/windows"
type HYBRID_REQUEST_BLOCK struct {
Version uint32
Size uint32
Function uint32
Flags uint32
DataBufferOffset uint32
DataBufferLength uint32
}type
HYBRID_REQUEST_BLOCK = record
Version: DWORD;
Size: DWORD;
Function: DWORD;
Flags: DWORD;
DataBufferOffset: DWORD;
DataBufferLength: DWORD;
end;const HYBRID_REQUEST_BLOCK = extern struct {
Version: u32,
Size: u32,
Function: u32,
Flags: u32,
DataBufferOffset: u32,
DataBufferLength: u32,
};type
HYBRID_REQUEST_BLOCK {.bycopy.} = object
Version: uint32
Size: uint32
Function: uint32
Flags: uint32
DataBufferOffset: uint32
DataBufferLength: uint32struct HYBRID_REQUEST_BLOCK
{
uint Version;
uint Size;
uint Function;
uint Flags;
uint DataBufferOffset;
uint DataBufferLength;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HYBRID_REQUEST_BLOCK サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Size : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Function : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Flags : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; DataBufferOffset : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; DataBufferLength : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global HYBRID_REQUEST_BLOCK
#field int Version
#field int Size
#field int Function
#field int Flags
#field int DataBufferOffset
#field int DataBufferLength
#endstruct
stdim st, HYBRID_REQUEST_BLOCK ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version