ホーム › System.ApplicationVerifier › AVRF_BACKTRACE_INFORMATION
AVRF_BACKTRACE_INFORMATION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Depth | DWORD | 4 | +0 | +0 | ReturnAddressesに格納された有効なスタックフレーム数。 |
| Index | DWORD | 4 | +4 | +4 | バックトレース内の現在位置を示すインデックス。 |
| ReturnAddresses | ULONGLONG | 256 | +8 | +8 | 呼び出し履歴の戻りアドレスを格納する配列。 |
各言語での定義
#include <windows.h>
// AVRF_BACKTRACE_INFORMATION (x64 264 / x86 264 バイト)
typedef struct AVRF_BACKTRACE_INFORMATION {
DWORD Depth;
DWORD Index;
ULONGLONG ReturnAddresses[32];
} AVRF_BACKTRACE_INFORMATION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AVRF_BACKTRACE_INFORMATION
{
public uint Depth;
public uint Index;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public ulong[] ReturnAddresses;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AVRF_BACKTRACE_INFORMATION
Public Depth As UInteger
Public Index As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public ReturnAddresses() As ULong
End Structureimport ctypes
from ctypes import wintypes
class AVRF_BACKTRACE_INFORMATION(ctypes.Structure):
_fields_ = [
("Depth", wintypes.DWORD),
("Index", wintypes.DWORD),
("ReturnAddresses", ctypes.c_ulonglong * 32),
]#[repr(C)]
pub struct AVRF_BACKTRACE_INFORMATION {
pub Depth: u32,
pub Index: u32,
pub ReturnAddresses: [u64; 32],
}import "golang.org/x/sys/windows"
type AVRF_BACKTRACE_INFORMATION struct {
Depth uint32
Index uint32
ReturnAddresses [32]uint64
}type
AVRF_BACKTRACE_INFORMATION = record
Depth: DWORD;
Index: DWORD;
ReturnAddresses: array[0..31] of UInt64;
end;const AVRF_BACKTRACE_INFORMATION = extern struct {
Depth: u32,
Index: u32,
ReturnAddresses: [32]u64,
};type
AVRF_BACKTRACE_INFORMATION {.bycopy.} = object
Depth: uint32
Index: uint32
ReturnAddresses: array[32, uint64]struct AVRF_BACKTRACE_INFORMATION
{
uint Depth;
uint Index;
ulong[32] ReturnAddresses;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; AVRF_BACKTRACE_INFORMATION サイズ: 264 バイト(x64)
dim st, 66 ; 4byte整数×66(構造体サイズ 264 / 4 切り上げ)
; Depth : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Index : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ReturnAddresses : ULONGLONG (+8, 256byte) varptr(st)+8 を基点に操作(256byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global AVRF_BACKTRACE_INFORMATION
#field int Depth
#field int Index
#field int64 ReturnAddresses 32
#endstruct
stdim st, AVRF_BACKTRACE_INFORMATION ; NSTRUCT 変数を確保
st->Depth = 100
mes "Depth=" + st->Depth