ホーム › System.Diagnostics.Debug.Extensions › WDBGEXTS_THREAD_OS_INFO
WDBGEXTS_THREAD_OS_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ThreadId | DWORD | 4 | +0 | +0 | 対象スレッドのID(入力)。 |
| ExitStatus | DWORD | 4 | +4 | +4 | スレッドの終了コード。 |
| PriorityClass | DWORD | 4 | +8 | +8 | スレッドが属するプロセスの優先度クラス。 |
| Priority | DWORD | 4 | +12 | +12 | スレッドの優先度値。 |
| CreateTime | ULONGLONG | 8 | +16 | +16 | スレッド作成時刻(100ナノ秒単位)。 |
| ExitTime | ULONGLONG | 8 | +24 | +24 | スレッド終了時刻(100ナノ秒単位)。実行中は0。 |
| KernelTime | ULONGLONG | 8 | +32 | +32 | カーネルモードでの累積実行時間(100ナノ秒単位)。 |
| UserTime | ULONGLONG | 8 | +40 | +40 | ユーザーモードでの累積実行時間(100ナノ秒単位)。 |
| StartOffset | ULONGLONG | 8 | +48 | +48 | スレッド開始関数のアドレス。 |
| Affinity | ULONGLONG | 8 | +56 | +56 | スレッドのプロセッサアフィニティマスク。 |
各言語での定義
#include <windows.h>
// WDBGEXTS_THREAD_OS_INFO (x64 64 / x86 64 バイト)
typedef struct WDBGEXTS_THREAD_OS_INFO {
DWORD ThreadId;
DWORD ExitStatus;
DWORD PriorityClass;
DWORD Priority;
ULONGLONG CreateTime;
ULONGLONG ExitTime;
ULONGLONG KernelTime;
ULONGLONG UserTime;
ULONGLONG StartOffset;
ULONGLONG Affinity;
} WDBGEXTS_THREAD_OS_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WDBGEXTS_THREAD_OS_INFO
{
public uint ThreadId;
public uint ExitStatus;
public uint PriorityClass;
public uint Priority;
public ulong CreateTime;
public ulong ExitTime;
public ulong KernelTime;
public ulong UserTime;
public ulong StartOffset;
public ulong Affinity;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WDBGEXTS_THREAD_OS_INFO
Public ThreadId As UInteger
Public ExitStatus As UInteger
Public PriorityClass As UInteger
Public Priority As UInteger
Public CreateTime As ULong
Public ExitTime As ULong
Public KernelTime As ULong
Public UserTime As ULong
Public StartOffset As ULong
Public Affinity As ULong
End Structureimport ctypes
from ctypes import wintypes
class WDBGEXTS_THREAD_OS_INFO(ctypes.Structure):
_fields_ = [
("ThreadId", wintypes.DWORD),
("ExitStatus", wintypes.DWORD),
("PriorityClass", wintypes.DWORD),
("Priority", wintypes.DWORD),
("CreateTime", ctypes.c_ulonglong),
("ExitTime", ctypes.c_ulonglong),
("KernelTime", ctypes.c_ulonglong),
("UserTime", ctypes.c_ulonglong),
("StartOffset", ctypes.c_ulonglong),
("Affinity", ctypes.c_ulonglong),
]#[repr(C)]
pub struct WDBGEXTS_THREAD_OS_INFO {
pub ThreadId: u32,
pub ExitStatus: u32,
pub PriorityClass: u32,
pub Priority: u32,
pub CreateTime: u64,
pub ExitTime: u64,
pub KernelTime: u64,
pub UserTime: u64,
pub StartOffset: u64,
pub Affinity: u64,
}import "golang.org/x/sys/windows"
type WDBGEXTS_THREAD_OS_INFO struct {
ThreadId uint32
ExitStatus uint32
PriorityClass uint32
Priority uint32
CreateTime uint64
ExitTime uint64
KernelTime uint64
UserTime uint64
StartOffset uint64
Affinity uint64
}type
WDBGEXTS_THREAD_OS_INFO = record
ThreadId: DWORD;
ExitStatus: DWORD;
PriorityClass: DWORD;
Priority: DWORD;
CreateTime: UInt64;
ExitTime: UInt64;
KernelTime: UInt64;
UserTime: UInt64;
StartOffset: UInt64;
Affinity: UInt64;
end;const WDBGEXTS_THREAD_OS_INFO = extern struct {
ThreadId: u32,
ExitStatus: u32,
PriorityClass: u32,
Priority: u32,
CreateTime: u64,
ExitTime: u64,
KernelTime: u64,
UserTime: u64,
StartOffset: u64,
Affinity: u64,
};type
WDBGEXTS_THREAD_OS_INFO {.bycopy.} = object
ThreadId: uint32
ExitStatus: uint32
PriorityClass: uint32
Priority: uint32
CreateTime: uint64
ExitTime: uint64
KernelTime: uint64
UserTime: uint64
StartOffset: uint64
Affinity: uint64struct WDBGEXTS_THREAD_OS_INFO
{
uint ThreadId;
uint ExitStatus;
uint PriorityClass;
uint Priority;
ulong CreateTime;
ulong ExitTime;
ulong KernelTime;
ulong UserTime;
ulong StartOffset;
ulong Affinity;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WDBGEXTS_THREAD_OS_INFO サイズ: 64 バイト(x64)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; ThreadId : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ExitStatus : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; PriorityClass : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Priority : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; CreateTime : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ExitTime : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; KernelTime : ULONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; UserTime : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; StartOffset : ULONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; Affinity : ULONGLONG (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WDBGEXTS_THREAD_OS_INFO
#field int ThreadId
#field int ExitStatus
#field int PriorityClass
#field int Priority
#field int64 CreateTime
#field int64 ExitTime
#field int64 KernelTime
#field int64 UserTime
#field int64 StartOffset
#field int64 Affinity
#endstruct
stdim st, WDBGEXTS_THREAD_OS_INFO ; NSTRUCT 変数を確保
st->ThreadId = 100
mes "ThreadId=" + st->ThreadId