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

NVCACHE_REQUEST_BLOCK

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

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

フィールド

フィールドサイズx64x86説明
NRBSizeDWORD4+0+0この要求ブロックのバイトサイズ。
FunctionWORD2+4+4実行するNVキャッシュ機能コード。
NRBFlagsDWORD4+8+8要求の動作フラグ。
NRBStatusDWORD4+12+12要求完了後のステータス。
CountDWORD4+16+16操作対象のセクター数等のカウント。
LBAULONGLONG8+24+24操作の起点となる論理ブロックアドレス。
DataBufSizeDWORD4+32+32データバッファのバイトサイズ。
NVCacheStatusDWORD4+36+36NVキャッシュの状態値。
NVCacheSubStatusDWORD4+40+40NVキャッシュの詳細サブステータス値。

各言語での定義

#include <windows.h>

// NVCACHE_REQUEST_BLOCK  (x64 48 / x86 48 バイト)
typedef struct NVCACHE_REQUEST_BLOCK {
    DWORD NRBSize;
    WORD Function;
    DWORD NRBFlags;
    DWORD NRBStatus;
    DWORD Count;
    ULONGLONG LBA;
    DWORD DataBufSize;
    DWORD NVCacheStatus;
    DWORD NVCacheSubStatus;
} NVCACHE_REQUEST_BLOCK;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NVCACHE_REQUEST_BLOCK
{
    public uint NRBSize;
    public ushort Function;
    public uint NRBFlags;
    public uint NRBStatus;
    public uint Count;
    public ulong LBA;
    public uint DataBufSize;
    public uint NVCacheStatus;
    public uint NVCacheSubStatus;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NVCACHE_REQUEST_BLOCK
    Public NRBSize As UInteger
    Public Function As UShort
    Public NRBFlags As UInteger
    Public NRBStatus As UInteger
    Public Count As UInteger
    Public LBA As ULong
    Public DataBufSize As UInteger
    Public NVCacheStatus As UInteger
    Public NVCacheSubStatus As UInteger
End Structure
import ctypes
from ctypes import wintypes

class NVCACHE_REQUEST_BLOCK(ctypes.Structure):
    _fields_ = [
        ("NRBSize", wintypes.DWORD),
        ("Function", ctypes.c_ushort),
        ("NRBFlags", wintypes.DWORD),
        ("NRBStatus", wintypes.DWORD),
        ("Count", wintypes.DWORD),
        ("LBA", ctypes.c_ulonglong),
        ("DataBufSize", wintypes.DWORD),
        ("NVCacheStatus", wintypes.DWORD),
        ("NVCacheSubStatus", wintypes.DWORD),
    ]
#[repr(C)]
pub struct NVCACHE_REQUEST_BLOCK {
    pub NRBSize: u32,
    pub Function: u16,
    pub NRBFlags: u32,
    pub NRBStatus: u32,
    pub Count: u32,
    pub LBA: u64,
    pub DataBufSize: u32,
    pub NVCacheStatus: u32,
    pub NVCacheSubStatus: u32,
}
import "golang.org/x/sys/windows"

type NVCACHE_REQUEST_BLOCK struct {
	NRBSize uint32
	Function uint16
	NRBFlags uint32
	NRBStatus uint32
	Count uint32
	LBA uint64
	DataBufSize uint32
	NVCacheStatus uint32
	NVCacheSubStatus uint32
}
type
  NVCACHE_REQUEST_BLOCK = record
    NRBSize: DWORD;
    Function: Word;
    NRBFlags: DWORD;
    NRBStatus: DWORD;
    Count: DWORD;
    LBA: UInt64;
    DataBufSize: DWORD;
    NVCacheStatus: DWORD;
    NVCacheSubStatus: DWORD;
  end;
const NVCACHE_REQUEST_BLOCK = extern struct {
    NRBSize: u32,
    Function: u16,
    NRBFlags: u32,
    NRBStatus: u32,
    Count: u32,
    LBA: u64,
    DataBufSize: u32,
    NVCacheStatus: u32,
    NVCacheSubStatus: u32,
};
type
  NVCACHE_REQUEST_BLOCK {.bycopy.} = object
    NRBSize: uint32
    Function: uint16
    NRBFlags: uint32
    NRBStatus: uint32
    Count: uint32
    LBA: uint64
    DataBufSize: uint32
    NVCacheStatus: uint32
    NVCacheSubStatus: uint32
struct NVCACHE_REQUEST_BLOCK
{
    uint NRBSize;
    ushort Function;
    uint NRBFlags;
    uint NRBStatus;
    uint Count;
    ulong LBA;
    uint DataBufSize;
    uint NVCacheStatus;
    uint NVCacheSubStatus;
}

HSP用 定義

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

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

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