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

JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2

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

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

フィールド

フィールドサイズx64x86説明
LimitFlagsJOB_OBJECT_LIMIT4+0+0現在有効な制限を示すJOB_OBJECT_LIMITフラグ。
ViolationLimitFlagsJOB_OBJECT_LIMIT4+4+4違反が発生した制限を示すJOB_OBJECT_LIMITフラグ。
IoReadBytesULONGLONG8+8+8現在のI/O読み取りバイト数。
IoReadBytesLimitULONGLONG8+16+16I/O読み取りバイト数の上限。
IoWriteBytesULONGLONG8+24+24現在のI/O書き込みバイト数。
IoWriteBytesLimitULONGLONG8+32+32I/O書き込みバイト数の上限。
PerJobUserTimeLONGLONG8+40+40現在のジョブ全体ユーザー時間(100ナノ秒単位)。
PerJobUserTimeLimitLONGLONG8+48+48ジョブ全体ユーザー時間の上限(100ナノ秒単位)。
JobMemoryULONGLONG8+56+56現在のジョブのコミットメモリ量(バイト)。
Anonymous1_Anonymous1_e__Union8+64+64JobHighMemoryLimit等を保持する無名共用体。
Anonymous2_Anonymous2_e__Union4+72+72現在のCPUレート制御許容度を保持する無名共用体。
Anonymous3_Anonymous3_e__Union4+76+76CPUレート制御許容度上限を保持する無名共用体。
JobLowMemoryLimitULONGLONG8+80+80メモリ低下通知の下限メモリ量(バイト)。
IoRateControlToleranceJOBOBJECT_RATE_CONTROL_TOLERANCE4+88+88現在のI/Oレート制御許容度を示す列挙値。
IoRateControlToleranceLimitJOBOBJECT_RATE_CONTROL_TOLERANCE4+92+92I/Oレート制御許容度の上限を示す列挙値。
NetRateControlToleranceJOBOBJECT_RATE_CONTROL_TOLERANCE4+96+96現在のネットワークレート制御許容度を示す列挙値。
NetRateControlToleranceLimitJOBOBJECT_RATE_CONTROL_TOLERANCE4+100+100ネットワークレート制御許容度の上限を示す列挙値。

共用体: _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
RateControlToleranceLimitJOBOBJECT_RATE_CONTROL_TOLERANCE4+0+0
CpuRateControlToleranceLimitJOBOBJECT_RATE_CONTROL_TOLERANCE4+0+0

各言語での定義

#include <windows.h>

// JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2  (x64 104 / x86 104 バイト)
typedef struct JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2 {
    JOB_OBJECT_LIMIT LimitFlags;
    JOB_OBJECT_LIMIT ViolationLimitFlags;
    ULONGLONG IoReadBytes;
    ULONGLONG IoReadBytesLimit;
    ULONGLONG IoWriteBytes;
    ULONGLONG IoWriteBytesLimit;
    LONGLONG PerJobUserTime;
    LONGLONG PerJobUserTimeLimit;
    ULONGLONG JobMemory;
    _Anonymous1_e__Union Anonymous1;
    _Anonymous2_e__Union Anonymous2;
    _Anonymous3_e__Union Anonymous3;
    ULONGLONG JobLowMemoryLimit;
    JOBOBJECT_RATE_CONTROL_TOLERANCE IoRateControlTolerance;
    JOBOBJECT_RATE_CONTROL_TOLERANCE IoRateControlToleranceLimit;
    JOBOBJECT_RATE_CONTROL_TOLERANCE NetRateControlTolerance;
    JOBOBJECT_RATE_CONTROL_TOLERANCE NetRateControlToleranceLimit;
} JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2
{
    public uint LimitFlags;
    public uint ViolationLimitFlags;
    public ulong IoReadBytes;
    public ulong IoReadBytesLimit;
    public ulong IoWriteBytes;
    public ulong IoWriteBytesLimit;
    public long PerJobUserTime;
    public long PerJobUserTimeLimit;
    public ulong JobMemory;
    public _Anonymous1_e__Union Anonymous1;
    public _Anonymous2_e__Union Anonymous2;
    public _Anonymous3_e__Union Anonymous3;
    public ulong JobLowMemoryLimit;
    public int IoRateControlTolerance;
    public int IoRateControlToleranceLimit;
    public int NetRateControlTolerance;
    public int NetRateControlToleranceLimit;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JOBOBJECT_LIMIT_VIOLATION_INFORMATION_2
    Public LimitFlags As UInteger
    Public ViolationLimitFlags As UInteger
    Public IoReadBytes As ULong
    Public IoReadBytesLimit As ULong
    Public IoWriteBytes As ULong
    Public IoWriteBytesLimit As ULong
    Public PerJobUserTime As Long
    Public PerJobUserTimeLimit As Long
    Public JobMemory As ULong
    Public Anonymous1 As _Anonymous1_e__Union
    Public Anonymous2 As _Anonymous2_e__Union
    Public Anonymous3 As _Anonymous3_e__Union
    Public JobLowMemoryLimit As ULong
    Public IoRateControlTolerance As Integer
    Public IoRateControlToleranceLimit As Integer
    Public NetRateControlTolerance As Integer
    Public NetRateControlToleranceLimit As Integer
End Structure
import ctypes
from ctypes import wintypes

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

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

HSP用 定義

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

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

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