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

JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2

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

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

フィールド

フィールドサイズx64x86説明
IoReadBytesLimitULONGLONG8+0+0通知をトリガーするI/O読み取りバイト数の上限。
IoWriteBytesLimitULONGLONG8+8+8通知をトリガーするI/O書き込みバイト数の上限。
PerJobUserTimeLimitLONGLONG8+16+16通知をトリガーするジョブ全体ユーザー時間の上限(100ナノ秒単位)。
Anonymous1_Anonymous1_e__Union8+24+24JobHighMemoryLimit等を保持する無名共用体。
Anonymous2_Anonymous2_e__Union4+32+32CPUレート制御許容度を保持する無名共用体。
Anonymous3_Anonymous3_e__Union4+36+36CPUレート制御許容度間隔を保持する無名共用体。
LimitFlagsJOB_OBJECT_LIMIT4+40+40どの通知制限を有効にするかを示すJOB_OBJECT_LIMITフラグ。
IoRateControlToleranceJOBOBJECT_RATE_CONTROL_TOLERANCE4+44+44I/Oレート制御の許容度を示す列挙値。
JobLowMemoryLimitULONGLONG8+48+48メモリ低下通知をトリガーする下限メモリ量(バイト)。
IoRateControlToleranceIntervalJOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL4+56+56I/Oレート制御許容度を測定する時間間隔を示す列挙値。
NetRateControlToleranceJOBOBJECT_RATE_CONTROL_TOLERANCE4+60+60ネットワークレート制御の許容度を示す列挙値。
NetRateControlToleranceIntervalJOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL4+64+64ネットワークレート制御許容度を測定する時間間隔を示す列挙値。

共用体: _Anonymous1_e__Union x64 8B / x86 8B

フィールドサイズx64x86
JobHighMemoryLimitULONGLONG8+0+0
JobMemoryLimitULONGLONG8+0+0

共用体: _Anonymous2_e__Union x64 4B / x86 4B

フィールドサイズx64x86
RateControlToleranceJOBOBJECT_RATE_CONTROL_TOLERANCE4+0+0
CpuRateControlToleranceJOBOBJECT_RATE_CONTROL_TOLERANCE4+0+0

共用体: _Anonymous3_e__Union x64 4B / x86 4B

フィールドサイズx64x86
RateControlToleranceIntervalJOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL4+0+0
CpuRateControlToleranceIntervalJOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL4+0+0

各言語での定義

#include <windows.h>

// JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2  (x64 72 / x86 72 バイト)
typedef struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2 {
    ULONGLONG IoReadBytesLimit;
    ULONGLONG IoWriteBytesLimit;
    LONGLONG PerJobUserTimeLimit;
    _Anonymous1_e__Union Anonymous1;
    _Anonymous2_e__Union Anonymous2;
    _Anonymous3_e__Union Anonymous3;
    JOB_OBJECT_LIMIT LimitFlags;
    JOBOBJECT_RATE_CONTROL_TOLERANCE IoRateControlTolerance;
    ULONGLONG JobLowMemoryLimit;
    JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL IoRateControlToleranceInterval;
    JOBOBJECT_RATE_CONTROL_TOLERANCE NetRateControlTolerance;
    JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL NetRateControlToleranceInterval;
} JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2
{
    public ulong IoReadBytesLimit;
    public ulong IoWriteBytesLimit;
    public long PerJobUserTimeLimit;
    public _Anonymous1_e__Union Anonymous1;
    public _Anonymous2_e__Union Anonymous2;
    public _Anonymous3_e__Union Anonymous3;
    public uint LimitFlags;
    public int IoRateControlTolerance;
    public ulong JobLowMemoryLimit;
    public int IoRateControlToleranceInterval;
    public int NetRateControlTolerance;
    public int NetRateControlToleranceInterval;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2
    Public IoReadBytesLimit As ULong
    Public IoWriteBytesLimit As ULong
    Public PerJobUserTimeLimit As Long
    Public Anonymous1 As _Anonymous1_e__Union
    Public Anonymous2 As _Anonymous2_e__Union
    Public Anonymous3 As _Anonymous3_e__Union
    Public LimitFlags As UInteger
    Public IoRateControlTolerance As Integer
    Public JobLowMemoryLimit As ULong
    Public IoRateControlToleranceInterval As Integer
    Public NetRateControlTolerance As Integer
    Public NetRateControlToleranceInterval As Integer
End Structure
import ctypes
from ctypes import wintypes

class JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2(ctypes.Structure):
    _fields_ = [
        ("IoReadBytesLimit", ctypes.c_ulonglong),
        ("IoWriteBytesLimit", ctypes.c_ulonglong),
        ("PerJobUserTimeLimit", ctypes.c_longlong),
        ("Anonymous1", _Anonymous1_e__Union),
        ("Anonymous2", _Anonymous2_e__Union),
        ("Anonymous3", _Anonymous3_e__Union),
        ("LimitFlags", wintypes.DWORD),
        ("IoRateControlTolerance", ctypes.c_int),
        ("JobLowMemoryLimit", ctypes.c_ulonglong),
        ("IoRateControlToleranceInterval", ctypes.c_int),
        ("NetRateControlTolerance", ctypes.c_int),
        ("NetRateControlToleranceInterval", ctypes.c_int),
    ]
#[repr(C)]
pub struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2 {
    pub IoReadBytesLimit: u64,
    pub IoWriteBytesLimit: u64,
    pub PerJobUserTimeLimit: i64,
    pub Anonymous1: _Anonymous1_e__Union,
    pub Anonymous2: _Anonymous2_e__Union,
    pub Anonymous3: _Anonymous3_e__Union,
    pub LimitFlags: u32,
    pub IoRateControlTolerance: i32,
    pub JobLowMemoryLimit: u64,
    pub IoRateControlToleranceInterval: i32,
    pub NetRateControlTolerance: i32,
    pub NetRateControlToleranceInterval: i32,
}
import "golang.org/x/sys/windows"

type JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2 struct {
	IoReadBytesLimit uint64
	IoWriteBytesLimit uint64
	PerJobUserTimeLimit int64
	Anonymous1 _Anonymous1_e__Union
	Anonymous2 _Anonymous2_e__Union
	Anonymous3 _Anonymous3_e__Union
	LimitFlags uint32
	IoRateControlTolerance int32
	JobLowMemoryLimit uint64
	IoRateControlToleranceInterval int32
	NetRateControlTolerance int32
	NetRateControlToleranceInterval int32
}
type
  JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2 = record
    IoReadBytesLimit: UInt64;
    IoWriteBytesLimit: UInt64;
    PerJobUserTimeLimit: Int64;
    Anonymous1: _Anonymous1_e__Union;
    Anonymous2: _Anonymous2_e__Union;
    Anonymous3: _Anonymous3_e__Union;
    LimitFlags: DWORD;
    IoRateControlTolerance: Integer;
    JobLowMemoryLimit: UInt64;
    IoRateControlToleranceInterval: Integer;
    NetRateControlTolerance: Integer;
    NetRateControlToleranceInterval: Integer;
  end;
const JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2 = extern struct {
    IoReadBytesLimit: u64,
    IoWriteBytesLimit: u64,
    PerJobUserTimeLimit: i64,
    Anonymous1: _Anonymous1_e__Union,
    Anonymous2: _Anonymous2_e__Union,
    Anonymous3: _Anonymous3_e__Union,
    LimitFlags: u32,
    IoRateControlTolerance: i32,
    JobLowMemoryLimit: u64,
    IoRateControlToleranceInterval: i32,
    NetRateControlTolerance: i32,
    NetRateControlToleranceInterval: i32,
};
type
  JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2 {.bycopy.} = object
    IoReadBytesLimit: uint64
    IoWriteBytesLimit: uint64
    PerJobUserTimeLimit: int64
    Anonymous1: _Anonymous1_e__Union
    Anonymous2: _Anonymous2_e__Union
    Anonymous3: _Anonymous3_e__Union
    LimitFlags: uint32
    IoRateControlTolerance: int32
    JobLowMemoryLimit: uint64
    IoRateControlToleranceInterval: int32
    NetRateControlTolerance: int32
    NetRateControlToleranceInterval: int32
struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2
{
    ulong IoReadBytesLimit;
    ulong IoWriteBytesLimit;
    long PerJobUserTimeLimit;
    _Anonymous1_e__Union Anonymous1;
    _Anonymous2_e__Union Anonymous2;
    _Anonymous3_e__Union Anonymous3;
    uint LimitFlags;
    int IoRateControlTolerance;
    ulong JobLowMemoryLimit;
    int IoRateControlToleranceInterval;
    int NetRateControlTolerance;
    int NetRateControlToleranceInterval;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2 サイズ: 72 バイト(x64)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; IoReadBytesLimit : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; IoWriteBytesLimit : ULONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; PerJobUserTimeLimit : LONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Anonymous1 : _Anonymous1_e__Union (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; Anonymous2 : _Anonymous2_e__Union (+32, 4byte)  varptr(st)+32 を基点に操作(4byte:入れ子/配列)
; Anonymous3 : _Anonymous3_e__Union (+36, 4byte)  varptr(st)+36 を基点に操作(4byte:入れ子/配列)
; LimitFlags : JOB_OBJECT_LIMIT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; IoRateControlTolerance : JOBOBJECT_RATE_CONTROL_TOLERANCE (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; JobLowMemoryLimit : ULONGLONG (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; IoRateControlToleranceInterval : JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; NetRateControlTolerance : JOBOBJECT_RATE_CONTROL_TOLERANCE (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; NetRateControlToleranceInterval : JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2
    #field int64 IoReadBytesLimit
    #field int64 IoWriteBytesLimit
    #field int64 PerJobUserTimeLimit
    #field byte Anonymous1 8
    #field byte Anonymous2 4
    #field byte Anonymous3 4
    #field int LimitFlags
    #field int IoRateControlTolerance
    #field int64 JobLowMemoryLimit
    #field int IoRateControlToleranceInterval
    #field int NetRateControlTolerance
    #field int NetRateControlToleranceInterval
#endstruct

stdim st, JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION_2        ; NSTRUCT 変数を確保
st->IoReadBytesLimit = 100
mes "IoReadBytesLimit=" + st->IoReadBytesLimit
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。