Win32 API 日本語リファレンス
ホームSystem.JobObjects › JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2

JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2

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

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

フィールド

フィールドサイズx64x86説明
MaxIopsLONGLONG8+0+0ジョブに許可する最大IOPS。
MaxBandwidthLONGLONG8+8+8ジョブに許可する最大帯域幅(バイト/秒)。
ReservationIopsLONGLONG8+16+16ジョブに予約する最小IOPS。
VolumeNameLPWSTR8/4+24+24レート制御を適用するボリューム名。NULLで全ボリューム対象。
BaseIoSizeDWORD4+32+28IOPS計算の基準となる基本I/Oサイズ(バイト)。
ControlFlagsJOB_OBJECT_IO_RATE_CONTROL_FLAGS4+36+32レート制御の有効化等を指定するJOB_OBJECT_IO_RATE_CONTROL_FLAGS。
VolumeNameLengthWORD2+40+36VolumeNameのバイト単位長さ。
CriticalReservationIopsLONGLONG8+48+40クリティカルな最小予約IOPS。
ReservationBandwidthLONGLONG8+56+48予約する帯域幅(バイト/秒)。
CriticalReservationBandwidthLONGLONG8+64+56クリティカルな予約帯域幅(バイト/秒)。
MaxTimePercentLONGLONG8+72+64最大I/O時間割合(パーセント×100)。
ReservationTimePercentLONGLONG8+80+72予約I/O時間割合(パーセント×100)。
CriticalReservationTimePercentLONGLONG8+88+80クリティカルな予約I/O時間割合(パーセント×100)。

各言語での定義

#include <windows.h>

// JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2  (x64 96 / x86 88 バイト)
typedef struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2 {
    LONGLONG MaxIops;
    LONGLONG MaxBandwidth;
    LONGLONG ReservationIops;
    LPWSTR VolumeName;
    DWORD BaseIoSize;
    JOB_OBJECT_IO_RATE_CONTROL_FLAGS ControlFlags;
    WORD VolumeNameLength;
    LONGLONG CriticalReservationIops;
    LONGLONG ReservationBandwidth;
    LONGLONG CriticalReservationBandwidth;
    LONGLONG MaxTimePercent;
    LONGLONG ReservationTimePercent;
    LONGLONG CriticalReservationTimePercent;
} JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2
{
    public long MaxIops;
    public long MaxBandwidth;
    public long ReservationIops;
    public IntPtr VolumeName;
    public uint BaseIoSize;
    public int ControlFlags;
    public ushort VolumeNameLength;
    public long CriticalReservationIops;
    public long ReservationBandwidth;
    public long CriticalReservationBandwidth;
    public long MaxTimePercent;
    public long ReservationTimePercent;
    public long CriticalReservationTimePercent;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2
    Public MaxIops As Long
    Public MaxBandwidth As Long
    Public ReservationIops As Long
    Public VolumeName As IntPtr
    Public BaseIoSize As UInteger
    Public ControlFlags As Integer
    Public VolumeNameLength As UShort
    Public CriticalReservationIops As Long
    Public ReservationBandwidth As Long
    Public CriticalReservationBandwidth As Long
    Public MaxTimePercent As Long
    Public ReservationTimePercent As Long
    Public CriticalReservationTimePercent As Long
End Structure
import ctypes
from ctypes import wintypes

class JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2(ctypes.Structure):
    _fields_ = [
        ("MaxIops", ctypes.c_longlong),
        ("MaxBandwidth", ctypes.c_longlong),
        ("ReservationIops", ctypes.c_longlong),
        ("VolumeName", ctypes.c_void_p),
        ("BaseIoSize", wintypes.DWORD),
        ("ControlFlags", ctypes.c_int),
        ("VolumeNameLength", ctypes.c_ushort),
        ("CriticalReservationIops", ctypes.c_longlong),
        ("ReservationBandwidth", ctypes.c_longlong),
        ("CriticalReservationBandwidth", ctypes.c_longlong),
        ("MaxTimePercent", ctypes.c_longlong),
        ("ReservationTimePercent", ctypes.c_longlong),
        ("CriticalReservationTimePercent", ctypes.c_longlong),
    ]
#[repr(C)]
pub struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2 {
    pub MaxIops: i64,
    pub MaxBandwidth: i64,
    pub ReservationIops: i64,
    pub VolumeName: *mut core::ffi::c_void,
    pub BaseIoSize: u32,
    pub ControlFlags: i32,
    pub VolumeNameLength: u16,
    pub CriticalReservationIops: i64,
    pub ReservationBandwidth: i64,
    pub CriticalReservationBandwidth: i64,
    pub MaxTimePercent: i64,
    pub ReservationTimePercent: i64,
    pub CriticalReservationTimePercent: i64,
}
import "golang.org/x/sys/windows"

type JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2 struct {
	MaxIops int64
	MaxBandwidth int64
	ReservationIops int64
	VolumeName uintptr
	BaseIoSize uint32
	ControlFlags int32
	VolumeNameLength uint16
	CriticalReservationIops int64
	ReservationBandwidth int64
	CriticalReservationBandwidth int64
	MaxTimePercent int64
	ReservationTimePercent int64
	CriticalReservationTimePercent int64
}
type
  JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2 = record
    MaxIops: Int64;
    MaxBandwidth: Int64;
    ReservationIops: Int64;
    VolumeName: Pointer;
    BaseIoSize: DWORD;
    ControlFlags: Integer;
    VolumeNameLength: Word;
    CriticalReservationIops: Int64;
    ReservationBandwidth: Int64;
    CriticalReservationBandwidth: Int64;
    MaxTimePercent: Int64;
    ReservationTimePercent: Int64;
    CriticalReservationTimePercent: Int64;
  end;
const JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2 = extern struct {
    MaxIops: i64,
    MaxBandwidth: i64,
    ReservationIops: i64,
    VolumeName: ?*anyopaque,
    BaseIoSize: u32,
    ControlFlags: i32,
    VolumeNameLength: u16,
    CriticalReservationIops: i64,
    ReservationBandwidth: i64,
    CriticalReservationBandwidth: i64,
    MaxTimePercent: i64,
    ReservationTimePercent: i64,
    CriticalReservationTimePercent: i64,
};
type
  JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2 {.bycopy.} = object
    MaxIops: int64
    MaxBandwidth: int64
    ReservationIops: int64
    VolumeName: pointer
    BaseIoSize: uint32
    ControlFlags: int32
    VolumeNameLength: uint16
    CriticalReservationIops: int64
    ReservationBandwidth: int64
    CriticalReservationBandwidth: int64
    MaxTimePercent: int64
    ReservationTimePercent: int64
    CriticalReservationTimePercent: int64
struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2
{
    long MaxIops;
    long MaxBandwidth;
    long ReservationIops;
    void* VolumeName;
    uint BaseIoSize;
    int ControlFlags;
    ushort VolumeNameLength;
    long CriticalReservationIops;
    long ReservationBandwidth;
    long CriticalReservationBandwidth;
    long MaxTimePercent;
    long ReservationTimePercent;
    long CriticalReservationTimePercent;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2 サイズ: 88 バイト(x86)
dim st, 22    ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; MaxIops : LONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; MaxBandwidth : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ReservationIops : LONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; VolumeName : LPWSTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; BaseIoSize : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ControlFlags : JOB_OBJECT_IO_RATE_CONTROL_FLAGS (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; VolumeNameLength : WORD (+36, 2byte)  wpoke st,36,値  /  値 = wpeek(st,36)
; CriticalReservationIops : LONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ReservationBandwidth : LONGLONG (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; CriticalReservationBandwidth : LONGLONG (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; MaxTimePercent : LONGLONG (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; ReservationTimePercent : LONGLONG (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; CriticalReservationTimePercent : LONGLONG (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2 サイズ: 96 バイト(x64)
dim st, 24    ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; MaxIops : LONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; MaxBandwidth : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ReservationIops : LONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; VolumeName : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; BaseIoSize : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ControlFlags : JOB_OBJECT_IO_RATE_CONTROL_FLAGS (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; VolumeNameLength : WORD (+40, 2byte)  wpoke st,40,値  /  値 = wpeek(st,40)
; CriticalReservationIops : LONGLONG (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ReservationBandwidth : LONGLONG (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; CriticalReservationBandwidth : LONGLONG (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; MaxTimePercent : LONGLONG (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; ReservationTimePercent : LONGLONG (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; CriticalReservationTimePercent : LONGLONG (+88, 8byte)  qpoke st,88,値 / qpeek(st,88)  ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global JOBOBJECT_IO_RATE_CONTROL_INFORMATION_NATIVE_V2
    #field int64 MaxIops
    #field int64 MaxBandwidth
    #field int64 ReservationIops
    #field intptr VolumeName
    #field int BaseIoSize
    #field int ControlFlags
    #field short VolumeNameLength
    #field int64 CriticalReservationIops
    #field int64 ReservationBandwidth
    #field int64 CriticalReservationBandwidth
    #field int64 MaxTimePercent
    #field int64 ReservationTimePercent
    #field int64 CriticalReservationTimePercent
#endstruct

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