ホーム › System.Diagnostics.Debug › IMAGEHLP_SYMBOL_SRC
IMAGEHLP_SYMBOL_SRC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| sizeofstruct | DWORD | 4 | +0 | +0 | この構造体のバイトサイズを示す。 |
| type | DWORD | 4 | +4 | +4 | シンボルソースの種別を示す。 |
| file | CHAR | 260 | +8 | +8 | ソースファイル名を示す ANSI 文字配列。 |
各言語での定義
#include <windows.h>
// IMAGEHLP_SYMBOL_SRC (x64 268 / x86 268 バイト)
typedef struct IMAGEHLP_SYMBOL_SRC {
DWORD sizeofstruct;
DWORD type;
CHAR file[260];
} IMAGEHLP_SYMBOL_SRC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IMAGEHLP_SYMBOL_SRC
{
public uint sizeofstruct;
public uint type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] public sbyte[] file;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IMAGEHLP_SYMBOL_SRC
Public sizeofstruct As UInteger
Public type As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=260)> Public file() As SByte
End Structureimport ctypes
from ctypes import wintypes
class IMAGEHLP_SYMBOL_SRC(ctypes.Structure):
_fields_ = [
("sizeofstruct", wintypes.DWORD),
("type", wintypes.DWORD),
("file", ctypes.c_byte * 260),
]#[repr(C)]
pub struct IMAGEHLP_SYMBOL_SRC {
pub sizeofstruct: u32,
pub type: u32,
pub file: [i8; 260],
}import "golang.org/x/sys/windows"
type IMAGEHLP_SYMBOL_SRC struct {
sizeofstruct uint32
type uint32
file [260]int8
}type
IMAGEHLP_SYMBOL_SRC = record
sizeofstruct: DWORD;
type: DWORD;
file: array[0..259] of Shortint;
end;const IMAGEHLP_SYMBOL_SRC = extern struct {
sizeofstruct: u32,
type: u32,
file: [260]i8,
};type
IMAGEHLP_SYMBOL_SRC {.bycopy.} = object
sizeofstruct: uint32
type: uint32
file: array[260, int8]struct IMAGEHLP_SYMBOL_SRC
{
uint sizeofstruct;
uint type;
byte[260] file;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IMAGEHLP_SYMBOL_SRC サイズ: 268 バイト(x64)
dim st, 67 ; 4byte整数×67(構造体サイズ 268 / 4 切り上げ)
; sizeofstruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; type : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; file : CHAR (+8, 260byte) varptr(st)+8 を基点に操作(260byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IMAGEHLP_SYMBOL_SRC
#field int sizeofstruct
#field int type
#field byte file 260
#endstruct
stdim st, IMAGEHLP_SYMBOL_SRC ; NSTRUCT 変数を確保
st->sizeofstruct = 100
mes "sizeofstruct=" + st->sizeofstruct