ホーム › System.Environment › VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64
VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ThreadContext | ULONGLONG | 32 | +0 | +0 | 64ビットスレッドコンテキストの値。 |
| EntryPoint | ULONGLONG | 8 | +32 | +32 | スレッドのエントリポイントアドレス(64ビット)。 |
| StackPointer | ULONGLONG | 8 | +40 | +40 | スレッドのスタックポインタ(64ビット)。 |
| ExceptionEntryPoint | ULONGLONG | 8 | +48 | +48 | 例外ハンドラのエントリポイント(64ビット)。 |
| ExceptionStack | ULONGLONG | 8 | +56 | +56 | 例外処理用スタックのアドレス(64ビット)。 |
| ExceptionActive | DWORD | 4 | +64 | +64 | 例外処理が進行中かを示すフラグ。 |
各言語での定義
#include <windows.h>
// VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64 (x64 72 / x86 72 バイト)
typedef struct VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64 {
ULONGLONG ThreadContext[4];
ULONGLONG EntryPoint;
ULONGLONG StackPointer;
ULONGLONG ExceptionEntryPoint;
ULONGLONG ExceptionStack;
DWORD ExceptionActive;
} VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public ulong[] ThreadContext;
public ulong EntryPoint;
public ulong StackPointer;
public ulong ExceptionEntryPoint;
public ulong ExceptionStack;
public uint ExceptionActive;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public ThreadContext() As ULong
Public EntryPoint As ULong
Public StackPointer As ULong
Public ExceptionEntryPoint As ULong
Public ExceptionStack As ULong
Public ExceptionActive As UInteger
End Structureimport ctypes
from ctypes import wintypes
class VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64(ctypes.Structure):
_fields_ = [
("ThreadContext", ctypes.c_ulonglong * 4),
("EntryPoint", ctypes.c_ulonglong),
("StackPointer", ctypes.c_ulonglong),
("ExceptionEntryPoint", ctypes.c_ulonglong),
("ExceptionStack", ctypes.c_ulonglong),
("ExceptionActive", wintypes.DWORD),
]#[repr(C)]
pub struct VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64 {
pub ThreadContext: [u64; 4],
pub EntryPoint: u64,
pub StackPointer: u64,
pub ExceptionEntryPoint: u64,
pub ExceptionStack: u64,
pub ExceptionActive: u32,
}import "golang.org/x/sys/windows"
type VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64 struct {
ThreadContext [4]uint64
EntryPoint uint64
StackPointer uint64
ExceptionEntryPoint uint64
ExceptionStack uint64
ExceptionActive uint32
}type
VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64 = record
ThreadContext: array[0..3] of UInt64;
EntryPoint: UInt64;
StackPointer: UInt64;
ExceptionEntryPoint: UInt64;
ExceptionStack: UInt64;
ExceptionActive: DWORD;
end;const VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64 = extern struct {
ThreadContext: [4]u64,
EntryPoint: u64,
StackPointer: u64,
ExceptionEntryPoint: u64,
ExceptionStack: u64,
ExceptionActive: u32,
};type
VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64 {.bycopy.} = object
ThreadContext: array[4, uint64]
EntryPoint: uint64
StackPointer: uint64
ExceptionEntryPoint: uint64
ExceptionStack: uint64
ExceptionActive: uint32struct VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64
{
ulong[4] ThreadContext;
ulong EntryPoint;
ulong StackPointer;
ulong ExceptionEntryPoint;
ulong ExceptionStack;
uint ExceptionActive;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64 サイズ: 72 バイト(x64)
dim st, 18 ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; ThreadContext : ULONGLONG (+0, 32byte) varptr(st)+0 を基点に操作(32byte:入れ子/配列)
; EntryPoint : ULONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; StackPointer : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ExceptionEntryPoint : ULONGLONG (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ExceptionStack : ULONGLONG (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ExceptionActive : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64
#field int64 ThreadContext 4
#field int64 EntryPoint
#field int64 StackPointer
#field int64 ExceptionEntryPoint
#field int64 ExceptionStack
#field int ExceptionActive
#endstruct
stdim st, VBS_BASIC_ENCLAVE_THREAD_DESCRIPTOR64 ; NSTRUCT 変数を確保
st->EntryPoint = 100
mes "EntryPoint=" + st->EntryPoint