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

JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION

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

サイズ=各フィールドのバイト数(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ナノ秒単位)。
JobMemoryLimitULONGLONG8+24+24通知をトリガーするジョブのコミットメモリ上限(バイト)。
RateControlToleranceJOBOBJECT_RATE_CONTROL_TOLERANCE4+32+32CPUレート制御の許容度を示す列挙値。
RateControlToleranceIntervalJOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL4+36+36レート制御許容度を測定する時間間隔を示す列挙値。
LimitFlagsJOB_OBJECT_LIMIT4+40+40どの通知制限を有効にするかを示すJOB_OBJECT_LIMITフラグ。

各言語での定義

#include <windows.h>

// JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION  (x64 48 / x86 48 バイト)
typedef struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION {
    ULONGLONG IoReadBytesLimit;
    ULONGLONG IoWriteBytesLimit;
    LONGLONG PerJobUserTimeLimit;
    ULONGLONG JobMemoryLimit;
    JOBOBJECT_RATE_CONTROL_TOLERANCE RateControlTolerance;
    JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL RateControlToleranceInterval;
    JOB_OBJECT_LIMIT LimitFlags;
} JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION
{
    public ulong IoReadBytesLimit;
    public ulong IoWriteBytesLimit;
    public long PerJobUserTimeLimit;
    public ulong JobMemoryLimit;
    public int RateControlTolerance;
    public int RateControlToleranceInterval;
    public uint LimitFlags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION
    Public IoReadBytesLimit As ULong
    Public IoWriteBytesLimit As ULong
    Public PerJobUserTimeLimit As Long
    Public JobMemoryLimit As ULong
    Public RateControlTolerance As Integer
    Public RateControlToleranceInterval As Integer
    Public LimitFlags As UInteger
End Structure
import ctypes
from ctypes import wintypes

class JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION(ctypes.Structure):
    _fields_ = [
        ("IoReadBytesLimit", ctypes.c_ulonglong),
        ("IoWriteBytesLimit", ctypes.c_ulonglong),
        ("PerJobUserTimeLimit", ctypes.c_longlong),
        ("JobMemoryLimit", ctypes.c_ulonglong),
        ("RateControlTolerance", ctypes.c_int),
        ("RateControlToleranceInterval", ctypes.c_int),
        ("LimitFlags", wintypes.DWORD),
    ]
#[repr(C)]
pub struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION {
    pub IoReadBytesLimit: u64,
    pub IoWriteBytesLimit: u64,
    pub PerJobUserTimeLimit: i64,
    pub JobMemoryLimit: u64,
    pub RateControlTolerance: i32,
    pub RateControlToleranceInterval: i32,
    pub LimitFlags: u32,
}
import "golang.org/x/sys/windows"

type JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION struct {
	IoReadBytesLimit uint64
	IoWriteBytesLimit uint64
	PerJobUserTimeLimit int64
	JobMemoryLimit uint64
	RateControlTolerance int32
	RateControlToleranceInterval int32
	LimitFlags uint32
}
type
  JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION = record
    IoReadBytesLimit: UInt64;
    IoWriteBytesLimit: UInt64;
    PerJobUserTimeLimit: Int64;
    JobMemoryLimit: UInt64;
    RateControlTolerance: Integer;
    RateControlToleranceInterval: Integer;
    LimitFlags: DWORD;
  end;
const JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION = extern struct {
    IoReadBytesLimit: u64,
    IoWriteBytesLimit: u64,
    PerJobUserTimeLimit: i64,
    JobMemoryLimit: u64,
    RateControlTolerance: i32,
    RateControlToleranceInterval: i32,
    LimitFlags: u32,
};
type
  JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION {.bycopy.} = object
    IoReadBytesLimit: uint64
    IoWriteBytesLimit: uint64
    PerJobUserTimeLimit: int64
    JobMemoryLimit: uint64
    RateControlTolerance: int32
    RateControlToleranceInterval: int32
    LimitFlags: uint32
struct JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION
{
    ulong IoReadBytesLimit;
    ulong IoWriteBytesLimit;
    long PerJobUserTimeLimit;
    ulong JobMemoryLimit;
    int RateControlTolerance;
    int RateControlToleranceInterval;
    uint LimitFlags;
}

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 サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 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,上位
; JobMemoryLimit : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; RateControlTolerance : JOBOBJECT_RATE_CONTROL_TOLERANCE (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; RateControlToleranceInterval : JOBOBJECT_RATE_CONTROL_TOLERANCE_INTERVAL (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; LimitFlags : JOB_OBJECT_LIMIT (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global JOBOBJECT_NOTIFICATION_LIMIT_INFORMATION
    #field int64 IoReadBytesLimit
    #field int64 IoWriteBytesLimit
    #field int64 PerJobUserTimeLimit
    #field int64 JobMemoryLimit
    #field int RateControlTolerance
    #field int RateControlToleranceInterval
    #field int LimitFlags
#endstruct

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