ホーム › System.ComponentServices › ApplicationProcessRecycleInfo
ApplicationProcessRecycleInfo
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| IsRecyclable | BOOL | 4 | +0 | +0 | プロセスがリサイクル可能かを示すフラグ。 |
| IsRecycled | BOOL | 4 | +4 | +4 | プロセスがリサイクル済みかを示すフラグ。 |
| TimeRecycled | FILETIME | 8 | +8 | +8 | リサイクルが行われた日時(FILETIME)。 |
| TimeToTerminate | FILETIME | 8 | +16 | +16 | プロセスを終了する予定の日時(FILETIME)。 |
| RecycleReasonCode | INT | 4 | +24 | +24 | リサイクルの理由を示すコード。 |
| IsPendingRecycle | BOOL | 4 | +28 | +28 | リサイクルが保留中かを示すフラグ。 |
| HasAutomaticLifetimeRecycling | BOOL | 4 | +32 | +32 | 寿命に基づく自動リサイクルが有効かを示すフラグ。 |
| TimeForAutomaticRecycling | FILETIME | 8 | +36 | +36 | 自動リサイクルが予定されている日時(FILETIME)。 |
| MemoryLimitInKB | DWORD | 4 | +44 | +44 | リサイクルをトリガーするメモリ上限(KB)。 |
| MemoryUsageInKBLastCheck | DWORD | 4 | +48 | +48 | 前回チェック時のメモリ使用量(KB)。 |
| ActivationLimit | DWORD | 4 | +52 | +52 | リサイクルまでの最大アクティブ化回数。 |
| NumActivationsLastReported | DWORD | 4 | +56 | +56 | 前回報告時のアクティブ化回数。 |
| CallLimit | DWORD | 4 | +60 | +60 | リサイクルまでの最大呼び出し回数。 |
| NumCallsLastReported | DWORD | 4 | +64 | +64 | 前回報告時の呼び出し回数。 |
各言語での定義
#include <windows.h>
// FILETIME (x64 8 / x86 8 バイト)
typedef struct FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME;
// ApplicationProcessRecycleInfo (x64 68 / x86 68 バイト)
typedef struct ApplicationProcessRecycleInfo {
BOOL IsRecyclable;
BOOL IsRecycled;
FILETIME TimeRecycled;
FILETIME TimeToTerminate;
INT RecycleReasonCode;
BOOL IsPendingRecycle;
BOOL HasAutomaticLifetimeRecycling;
FILETIME TimeForAutomaticRecycling;
DWORD MemoryLimitInKB;
DWORD MemoryUsageInKBLastCheck;
DWORD ActivationLimit;
DWORD NumActivationsLastReported;
DWORD CallLimit;
DWORD NumCallsLastReported;
} ApplicationProcessRecycleInfo;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILETIME
{
public uint dwLowDateTime;
public uint dwHighDateTime;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ApplicationProcessRecycleInfo
{
[MarshalAs(UnmanagedType.Bool)] public bool IsRecyclable;
[MarshalAs(UnmanagedType.Bool)] public bool IsRecycled;
public FILETIME TimeRecycled;
public FILETIME TimeToTerminate;
public int RecycleReasonCode;
[MarshalAs(UnmanagedType.Bool)] public bool IsPendingRecycle;
[MarshalAs(UnmanagedType.Bool)] public bool HasAutomaticLifetimeRecycling;
public FILETIME TimeForAutomaticRecycling;
public uint MemoryLimitInKB;
public uint MemoryUsageInKBLastCheck;
public uint ActivationLimit;
public uint NumActivationsLastReported;
public uint CallLimit;
public uint NumCallsLastReported;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILETIME
Public dwLowDateTime As UInteger
Public dwHighDateTime As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ApplicationProcessRecycleInfo
<MarshalAs(UnmanagedType.Bool)> Public IsRecyclable As Boolean
<MarshalAs(UnmanagedType.Bool)> Public IsRecycled As Boolean
Public TimeRecycled As FILETIME
Public TimeToTerminate As FILETIME
Public RecycleReasonCode As Integer
<MarshalAs(UnmanagedType.Bool)> Public IsPendingRecycle As Boolean
<MarshalAs(UnmanagedType.Bool)> Public HasAutomaticLifetimeRecycling As Boolean
Public TimeForAutomaticRecycling As FILETIME
Public MemoryLimitInKB As UInteger
Public MemoryUsageInKBLastCheck As UInteger
Public ActivationLimit As UInteger
Public NumActivationsLastReported As UInteger
Public CallLimit As UInteger
Public NumCallsLastReported As UInteger
End Structureimport ctypes
from ctypes import wintypes
class FILETIME(ctypes.Structure):
_fields_ = [
("dwLowDateTime", wintypes.DWORD),
("dwHighDateTime", wintypes.DWORD),
]
class ApplicationProcessRecycleInfo(ctypes.Structure):
_fields_ = [
("IsRecyclable", wintypes.BOOL),
("IsRecycled", wintypes.BOOL),
("TimeRecycled", FILETIME),
("TimeToTerminate", FILETIME),
("RecycleReasonCode", ctypes.c_int),
("IsPendingRecycle", wintypes.BOOL),
("HasAutomaticLifetimeRecycling", wintypes.BOOL),
("TimeForAutomaticRecycling", FILETIME),
("MemoryLimitInKB", wintypes.DWORD),
("MemoryUsageInKBLastCheck", wintypes.DWORD),
("ActivationLimit", wintypes.DWORD),
("NumActivationsLastReported", wintypes.DWORD),
("CallLimit", wintypes.DWORD),
("NumCallsLastReported", wintypes.DWORD),
]#[repr(C)]
pub struct FILETIME {
pub dwLowDateTime: u32,
pub dwHighDateTime: u32,
}
#[repr(C)]
pub struct ApplicationProcessRecycleInfo {
pub IsRecyclable: i32,
pub IsRecycled: i32,
pub TimeRecycled: FILETIME,
pub TimeToTerminate: FILETIME,
pub RecycleReasonCode: i32,
pub IsPendingRecycle: i32,
pub HasAutomaticLifetimeRecycling: i32,
pub TimeForAutomaticRecycling: FILETIME,
pub MemoryLimitInKB: u32,
pub MemoryUsageInKBLastCheck: u32,
pub ActivationLimit: u32,
pub NumActivationsLastReported: u32,
pub CallLimit: u32,
pub NumCallsLastReported: u32,
}import "golang.org/x/sys/windows"
type FILETIME struct {
dwLowDateTime uint32
dwHighDateTime uint32
}
type ApplicationProcessRecycleInfo struct {
IsRecyclable int32
IsRecycled int32
TimeRecycled FILETIME
TimeToTerminate FILETIME
RecycleReasonCode int32
IsPendingRecycle int32
HasAutomaticLifetimeRecycling int32
TimeForAutomaticRecycling FILETIME
MemoryLimitInKB uint32
MemoryUsageInKBLastCheck uint32
ActivationLimit uint32
NumActivationsLastReported uint32
CallLimit uint32
NumCallsLastReported uint32
}type
FILETIME = record
dwLowDateTime: DWORD;
dwHighDateTime: DWORD;
end;
ApplicationProcessRecycleInfo = record
IsRecyclable: BOOL;
IsRecycled: BOOL;
TimeRecycled: FILETIME;
TimeToTerminate: FILETIME;
RecycleReasonCode: Integer;
IsPendingRecycle: BOOL;
HasAutomaticLifetimeRecycling: BOOL;
TimeForAutomaticRecycling: FILETIME;
MemoryLimitInKB: DWORD;
MemoryUsageInKBLastCheck: DWORD;
ActivationLimit: DWORD;
NumActivationsLastReported: DWORD;
CallLimit: DWORD;
NumCallsLastReported: DWORD;
end;const FILETIME = extern struct {
dwLowDateTime: u32,
dwHighDateTime: u32,
};
const ApplicationProcessRecycleInfo = extern struct {
IsRecyclable: i32,
IsRecycled: i32,
TimeRecycled: FILETIME,
TimeToTerminate: FILETIME,
RecycleReasonCode: i32,
IsPendingRecycle: i32,
HasAutomaticLifetimeRecycling: i32,
TimeForAutomaticRecycling: FILETIME,
MemoryLimitInKB: u32,
MemoryUsageInKBLastCheck: u32,
ActivationLimit: u32,
NumActivationsLastReported: u32,
CallLimit: u32,
NumCallsLastReported: u32,
};type
FILETIME {.bycopy.} = object
dwLowDateTime: uint32
dwHighDateTime: uint32
ApplicationProcessRecycleInfo {.bycopy.} = object
IsRecyclable: int32
IsRecycled: int32
TimeRecycled: FILETIME
TimeToTerminate: FILETIME
RecycleReasonCode: int32
IsPendingRecycle: int32
HasAutomaticLifetimeRecycling: int32
TimeForAutomaticRecycling: FILETIME
MemoryLimitInKB: uint32
MemoryUsageInKBLastCheck: uint32
ActivationLimit: uint32
NumActivationsLastReported: uint32
CallLimit: uint32
NumCallsLastReported: uint32struct FILETIME
{
uint dwLowDateTime;
uint dwHighDateTime;
}
struct ApplicationProcessRecycleInfo
{
int IsRecyclable;
int IsRecycled;
FILETIME TimeRecycled;
FILETIME TimeToTerminate;
int RecycleReasonCode;
int IsPendingRecycle;
int HasAutomaticLifetimeRecycling;
FILETIME TimeForAutomaticRecycling;
uint MemoryLimitInKB;
uint MemoryUsageInKBLastCheck;
uint ActivationLimit;
uint NumActivationsLastReported;
uint CallLimit;
uint NumCallsLastReported;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ApplicationProcessRecycleInfo サイズ: 68 バイト(x64)
dim st, 17 ; 4byte整数×17(構造体サイズ 68 / 4 切り上げ)
; IsRecyclable : BOOL (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; IsRecycled : BOOL (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; TimeRecycled : FILETIME (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; TimeToTerminate : FILETIME (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; RecycleReasonCode : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; IsPendingRecycle : BOOL (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; HasAutomaticLifetimeRecycling : BOOL (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; TimeForAutomaticRecycling : FILETIME (+36, 8byte) varptr(st)+36 を基点に操作(8byte:入れ子/配列)
; MemoryLimitInKB : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; MemoryUsageInKBLastCheck : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; ActivationLimit : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; NumActivationsLastReported : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; CallLimit : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; NumCallsLastReported : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global FILETIME
#field int dwLowDateTime
#field int dwHighDateTime
#endstruct
#defstruct global ApplicationProcessRecycleInfo
#field bool IsRecyclable
#field bool IsRecycled
#field FILETIME TimeRecycled
#field FILETIME TimeToTerminate
#field int RecycleReasonCode
#field bool IsPendingRecycle
#field bool HasAutomaticLifetimeRecycling
#field FILETIME TimeForAutomaticRecycling
#field int MemoryLimitInKB
#field int MemoryUsageInKBLastCheck
#field int ActivationLimit
#field int NumActivationsLastReported
#field int CallLimit
#field int NumCallsLastReported
#endstruct
stdim st, ApplicationProcessRecycleInfo ; NSTRUCT 変数を確保
st->IsRecyclable = 100
mes "IsRecyclable=" + st->IsRecyclable