サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
コピー #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;
}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 非対応)。必要に応じ手動でアクセス。