ホーム › System.JobObjects › JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| BasicInfo | JOBOBJECT_BASIC_ACCOUNTING_INFORMATION | 48 | +0 | +0 | 基本課金情報を格納する入れ子構造体。 |
| IoInfo | IO_COUNTERS | 48 | +48 | +48 | ジョブのI/Oカウンター情報。 |
各言語での定義
#include <windows.h>
// JOBOBJECT_BASIC_ACCOUNTING_INFORMATION (x64 48 / x86 48 バイト)
typedef struct JOBOBJECT_BASIC_ACCOUNTING_INFORMATION {
LONGLONG TotalUserTime;
LONGLONG TotalKernelTime;
LONGLONG ThisPeriodTotalUserTime;
LONGLONG ThisPeriodTotalKernelTime;
DWORD TotalPageFaultCount;
DWORD TotalProcesses;
DWORD ActiveProcesses;
DWORD TotalTerminatedProcesses;
} JOBOBJECT_BASIC_ACCOUNTING_INFORMATION;
// IO_COUNTERS (x64 48 / x86 48 バイト)
typedef struct IO_COUNTERS {
ULONGLONG ReadOperationCount;
ULONGLONG WriteOperationCount;
ULONGLONG OtherOperationCount;
ULONGLONG ReadTransferCount;
ULONGLONG WriteTransferCount;
ULONGLONG OtherTransferCount;
} IO_COUNTERS;
// JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION (x64 96 / x86 96 バイト)
typedef struct JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION {
JOBOBJECT_BASIC_ACCOUNTING_INFORMATION BasicInfo;
IO_COUNTERS IoInfo;
} JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
{
public long TotalUserTime;
public long TotalKernelTime;
public long ThisPeriodTotalUserTime;
public long ThisPeriodTotalKernelTime;
public uint TotalPageFaultCount;
public uint TotalProcesses;
public uint ActiveProcesses;
public uint TotalTerminatedProcesses;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IO_COUNTERS
{
public ulong ReadOperationCount;
public ulong WriteOperationCount;
public ulong OtherOperationCount;
public ulong ReadTransferCount;
public ulong WriteTransferCount;
public ulong OtherTransferCount;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
{
public JOBOBJECT_BASIC_ACCOUNTING_INFORMATION BasicInfo;
public IO_COUNTERS IoInfo;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
Public TotalUserTime As Long
Public TotalKernelTime As Long
Public ThisPeriodTotalUserTime As Long
Public ThisPeriodTotalKernelTime As Long
Public TotalPageFaultCount As UInteger
Public TotalProcesses As UInteger
Public ActiveProcesses As UInteger
Public TotalTerminatedProcesses As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IO_COUNTERS
Public ReadOperationCount As ULong
Public WriteOperationCount As ULong
Public OtherOperationCount As ULong
Public ReadTransferCount As ULong
Public WriteTransferCount As ULong
Public OtherTransferCount As ULong
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
Public BasicInfo As JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
Public IoInfo As IO_COUNTERS
End Structureimport ctypes
from ctypes import wintypes
class JOBOBJECT_BASIC_ACCOUNTING_INFORMATION(ctypes.Structure):
_fields_ = [
("TotalUserTime", ctypes.c_longlong),
("TotalKernelTime", ctypes.c_longlong),
("ThisPeriodTotalUserTime", ctypes.c_longlong),
("ThisPeriodTotalKernelTime", ctypes.c_longlong),
("TotalPageFaultCount", wintypes.DWORD),
("TotalProcesses", wintypes.DWORD),
("ActiveProcesses", wintypes.DWORD),
("TotalTerminatedProcesses", wintypes.DWORD),
]
class IO_COUNTERS(ctypes.Structure):
_fields_ = [
("ReadOperationCount", ctypes.c_ulonglong),
("WriteOperationCount", ctypes.c_ulonglong),
("OtherOperationCount", ctypes.c_ulonglong),
("ReadTransferCount", ctypes.c_ulonglong),
("WriteTransferCount", ctypes.c_ulonglong),
("OtherTransferCount", ctypes.c_ulonglong),
]
class JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION(ctypes.Structure):
_fields_ = [
("BasicInfo", JOBOBJECT_BASIC_ACCOUNTING_INFORMATION),
("IoInfo", IO_COUNTERS),
]#[repr(C)]
pub struct JOBOBJECT_BASIC_ACCOUNTING_INFORMATION {
pub TotalUserTime: i64,
pub TotalKernelTime: i64,
pub ThisPeriodTotalUserTime: i64,
pub ThisPeriodTotalKernelTime: i64,
pub TotalPageFaultCount: u32,
pub TotalProcesses: u32,
pub ActiveProcesses: u32,
pub TotalTerminatedProcesses: u32,
}
#[repr(C)]
pub struct IO_COUNTERS {
pub ReadOperationCount: u64,
pub WriteOperationCount: u64,
pub OtherOperationCount: u64,
pub ReadTransferCount: u64,
pub WriteTransferCount: u64,
pub OtherTransferCount: u64,
}
#[repr(C)]
pub struct JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION {
pub BasicInfo: JOBOBJECT_BASIC_ACCOUNTING_INFORMATION,
pub IoInfo: IO_COUNTERS,
}import "golang.org/x/sys/windows"
type JOBOBJECT_BASIC_ACCOUNTING_INFORMATION struct {
TotalUserTime int64
TotalKernelTime int64
ThisPeriodTotalUserTime int64
ThisPeriodTotalKernelTime int64
TotalPageFaultCount uint32
TotalProcesses uint32
ActiveProcesses uint32
TotalTerminatedProcesses uint32
}
type IO_COUNTERS struct {
ReadOperationCount uint64
WriteOperationCount uint64
OtherOperationCount uint64
ReadTransferCount uint64
WriteTransferCount uint64
OtherTransferCount uint64
}
type JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION struct {
BasicInfo JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
IoInfo IO_COUNTERS
}type
JOBOBJECT_BASIC_ACCOUNTING_INFORMATION = record
TotalUserTime: Int64;
TotalKernelTime: Int64;
ThisPeriodTotalUserTime: Int64;
ThisPeriodTotalKernelTime: Int64;
TotalPageFaultCount: DWORD;
TotalProcesses: DWORD;
ActiveProcesses: DWORD;
TotalTerminatedProcesses: DWORD;
end;
IO_COUNTERS = record
ReadOperationCount: UInt64;
WriteOperationCount: UInt64;
OtherOperationCount: UInt64;
ReadTransferCount: UInt64;
WriteTransferCount: UInt64;
OtherTransferCount: UInt64;
end;
JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION = record
BasicInfo: JOBOBJECT_BASIC_ACCOUNTING_INFORMATION;
IoInfo: IO_COUNTERS;
end;const JOBOBJECT_BASIC_ACCOUNTING_INFORMATION = extern struct {
TotalUserTime: i64,
TotalKernelTime: i64,
ThisPeriodTotalUserTime: i64,
ThisPeriodTotalKernelTime: i64,
TotalPageFaultCount: u32,
TotalProcesses: u32,
ActiveProcesses: u32,
TotalTerminatedProcesses: u32,
};
const IO_COUNTERS = extern struct {
ReadOperationCount: u64,
WriteOperationCount: u64,
OtherOperationCount: u64,
ReadTransferCount: u64,
WriteTransferCount: u64,
OtherTransferCount: u64,
};
const JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION = extern struct {
BasicInfo: JOBOBJECT_BASIC_ACCOUNTING_INFORMATION,
IoInfo: IO_COUNTERS,
};type
JOBOBJECT_BASIC_ACCOUNTING_INFORMATION {.bycopy.} = object
TotalUserTime: int64
TotalKernelTime: int64
ThisPeriodTotalUserTime: int64
ThisPeriodTotalKernelTime: int64
TotalPageFaultCount: uint32
TotalProcesses: uint32
ActiveProcesses: uint32
TotalTerminatedProcesses: uint32
IO_COUNTERS {.bycopy.} = object
ReadOperationCount: uint64
WriteOperationCount: uint64
OtherOperationCount: uint64
ReadTransferCount: uint64
WriteTransferCount: uint64
OtherTransferCount: uint64
JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION {.bycopy.} = object
BasicInfo: JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
IoInfo: IO_COUNTERSstruct JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
{
long TotalUserTime;
long TotalKernelTime;
long ThisPeriodTotalUserTime;
long ThisPeriodTotalKernelTime;
uint TotalPageFaultCount;
uint TotalProcesses;
uint ActiveProcesses;
uint TotalTerminatedProcesses;
}
struct IO_COUNTERS
{
ulong ReadOperationCount;
ulong WriteOperationCount;
ulong OtherOperationCount;
ulong ReadTransferCount;
ulong WriteTransferCount;
ulong OtherTransferCount;
}
struct JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
{
JOBOBJECT_BASIC_ACCOUNTING_INFORMATION BasicInfo;
IO_COUNTERS IoInfo;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION サイズ: 96 バイト(x64)
dim st, 24 ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; BasicInfo : JOBOBJECT_BASIC_ACCOUNTING_INFORMATION (+0, 48byte) varptr(st)+0 を基点に操作(48byte:入れ子/配列)
; IoInfo : IO_COUNTERS (+48, 48byte) varptr(st)+48 を基点に操作(48byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
#field int64 TotalUserTime
#field int64 TotalKernelTime
#field int64 ThisPeriodTotalUserTime
#field int64 ThisPeriodTotalKernelTime
#field int TotalPageFaultCount
#field int TotalProcesses
#field int ActiveProcesses
#field int TotalTerminatedProcesses
#endstruct
#defstruct global IO_COUNTERS
#field int64 ReadOperationCount
#field int64 WriteOperationCount
#field int64 OtherOperationCount
#field int64 ReadTransferCount
#field int64 WriteTransferCount
#field int64 OtherTransferCount
#endstruct
#defstruct global JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
#field JOBOBJECT_BASIC_ACCOUNTING_INFORMATION BasicInfo
#field IO_COUNTERS IoInfo
#endstruct
stdim st, JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION ; NSTRUCT 変数を確保