ホーム › System.JobObjects › JOBOBJECT_LIMIT_VIOLATION_INFORMATION
JOBOBJECT_LIMIT_VIOLATION_INFORMATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| LimitFlags | JOB_OBJECT_LIMIT | 4 | +0 | +0 | 現在有効な制限を示すJOB_OBJECT_LIMITフラグ。 |
| ViolationLimitFlags | JOB_OBJECT_LIMIT | 4 | +4 | +4 | 違反が発生した制限を示すJOB_OBJECT_LIMITフラグ。 |
| IoReadBytes | ULONGLONG | 8 | +8 | +8 | 現在のI/O読み取りバイト数。 |
| IoReadBytesLimit | ULONGLONG | 8 | +16 | +16 | I/O読み取りバイト数の上限。 |
| IoWriteBytes | ULONGLONG | 8 | +24 | +24 | 現在のI/O書き込みバイト数。 |
| IoWriteBytesLimit | ULONGLONG | 8 | +32 | +32 | I/O書き込みバイト数の上限。 |
| PerJobUserTime | LONGLONG | 8 | +40 | +40 | 現在のジョブ全体ユーザー時間(100ナノ秒単位)。 |
| PerJobUserTimeLimit | LONGLONG | 8 | +48 | +48 | ジョブ全体ユーザー時間の上限(100ナノ秒単位)。 |
| JobMemory | ULONGLONG | 8 | +56 | +56 | 現在のジョブのコミットメモリ量(バイト)。 |
| JobMemoryLimit | ULONGLONG | 8 | +64 | +64 | ジョブのコミットメモリ上限(バイト)。 |
| RateControlTolerance | JOBOBJECT_RATE_CONTROL_TOLERANCE | 4 | +72 | +72 | 現在のCPUレート制御許容度を示す列挙値。 |
| RateControlToleranceLimit | JOBOBJECT_RATE_CONTROL_TOLERANCE | 4 | +76 | +76 | CPUレート制御許容度の上限を示す列挙値。 |
各言語での定義
#include <windows.h>
// JOBOBJECT_LIMIT_VIOLATION_INFORMATION (x64 80 / x86 80 バイト)
typedef struct JOBOBJECT_LIMIT_VIOLATION_INFORMATION {
JOB_OBJECT_LIMIT LimitFlags;
JOB_OBJECT_LIMIT ViolationLimitFlags;
ULONGLONG IoReadBytes;
ULONGLONG IoReadBytesLimit;
ULONGLONG IoWriteBytes;
ULONGLONG IoWriteBytesLimit;
LONGLONG PerJobUserTime;
LONGLONG PerJobUserTimeLimit;
ULONGLONG JobMemory;
ULONGLONG JobMemoryLimit;
JOBOBJECT_RATE_CONTROL_TOLERANCE RateControlTolerance;
JOBOBJECT_RATE_CONTROL_TOLERANCE RateControlToleranceLimit;
} JOBOBJECT_LIMIT_VIOLATION_INFORMATION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JOBOBJECT_LIMIT_VIOLATION_INFORMATION
{
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 ulong JobMemoryLimit;
public int RateControlTolerance;
public int RateControlToleranceLimit;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JOBOBJECT_LIMIT_VIOLATION_INFORMATION
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 JobMemoryLimit As ULong
Public RateControlTolerance As Integer
Public RateControlToleranceLimit As Integer
End Structureimport ctypes
from ctypes import wintypes
class JOBOBJECT_LIMIT_VIOLATION_INFORMATION(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),
("JobMemoryLimit", ctypes.c_ulonglong),
("RateControlTolerance", ctypes.c_int),
("RateControlToleranceLimit", ctypes.c_int),
]#[repr(C)]
pub struct JOBOBJECT_LIMIT_VIOLATION_INFORMATION {
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 JobMemoryLimit: u64,
pub RateControlTolerance: i32,
pub RateControlToleranceLimit: i32,
}import "golang.org/x/sys/windows"
type JOBOBJECT_LIMIT_VIOLATION_INFORMATION struct {
LimitFlags uint32
ViolationLimitFlags uint32
IoReadBytes uint64
IoReadBytesLimit uint64
IoWriteBytes uint64
IoWriteBytesLimit uint64
PerJobUserTime int64
PerJobUserTimeLimit int64
JobMemory uint64
JobMemoryLimit uint64
RateControlTolerance int32
RateControlToleranceLimit int32
}type
JOBOBJECT_LIMIT_VIOLATION_INFORMATION = record
LimitFlags: DWORD;
ViolationLimitFlags: DWORD;
IoReadBytes: UInt64;
IoReadBytesLimit: UInt64;
IoWriteBytes: UInt64;
IoWriteBytesLimit: UInt64;
PerJobUserTime: Int64;
PerJobUserTimeLimit: Int64;
JobMemory: UInt64;
JobMemoryLimit: UInt64;
RateControlTolerance: Integer;
RateControlToleranceLimit: Integer;
end;const JOBOBJECT_LIMIT_VIOLATION_INFORMATION = extern struct {
LimitFlags: u32,
ViolationLimitFlags: u32,
IoReadBytes: u64,
IoReadBytesLimit: u64,
IoWriteBytes: u64,
IoWriteBytesLimit: u64,
PerJobUserTime: i64,
PerJobUserTimeLimit: i64,
JobMemory: u64,
JobMemoryLimit: u64,
RateControlTolerance: i32,
RateControlToleranceLimit: i32,
};type
JOBOBJECT_LIMIT_VIOLATION_INFORMATION {.bycopy.} = object
LimitFlags: uint32
ViolationLimitFlags: uint32
IoReadBytes: uint64
IoReadBytesLimit: uint64
IoWriteBytes: uint64
IoWriteBytesLimit: uint64
PerJobUserTime: int64
PerJobUserTimeLimit: int64
JobMemory: uint64
JobMemoryLimit: uint64
RateControlTolerance: int32
RateControlToleranceLimit: int32struct JOBOBJECT_LIMIT_VIOLATION_INFORMATION
{
uint LimitFlags;
uint ViolationLimitFlags;
ulong IoReadBytes;
ulong IoReadBytesLimit;
ulong IoWriteBytes;
ulong IoWriteBytesLimit;
long PerJobUserTime;
long PerJobUserTimeLimit;
ulong JobMemory;
ulong JobMemoryLimit;
int RateControlTolerance;
int RateControlToleranceLimit;
}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 サイズ: 80 バイト(x64)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 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,上位
; JobMemoryLimit : ULONGLONG (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; RateControlTolerance : JOBOBJECT_RATE_CONTROL_TOLERANCE (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; RateControlToleranceLimit : JOBOBJECT_RATE_CONTROL_TOLERANCE (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global JOBOBJECT_LIMIT_VIOLATION_INFORMATION
#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 int64 JobMemoryLimit
#field int RateControlTolerance
#field int RateControlToleranceLimit
#endstruct
stdim st, JOBOBJECT_LIMIT_VIOLATION_INFORMATION ; NSTRUCT 変数を確保
st->LimitFlags = 100
mes "LimitFlags=" + st->LimitFlags