Win32 API 日本語リファレンス
ホームSystem.SystemServices › IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY

IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY

構造体
サイズx64: 40 バイト / x86: 40 バイトパッキング4

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
BeginAddressULONGLONG8+0+0関数の開始アドレス(Alpha64、64ビット)。
EndAddressULONGLONG8+8+8関数の終了アドレス。
ExceptionHandlerULONGLONG8+16+16例外ハンドラのアドレス。
HandlerDataULONGLONG8+24+24例外ハンドラに渡される補助データのアドレス。
PrologEndAddressULONGLONG8+32+32プロローグ終了位置のアドレス。

各言語での定義

#include <windows.h>

// IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY  (x64 40 / x86 40 バイト)
#pragma pack(push, 4)
typedef struct IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY {
    ULONGLONG BeginAddress;
    ULONGLONG EndAddress;
    ULONGLONG ExceptionHandler;
    ULONGLONG HandlerData;
    ULONGLONG PrologEndAddress;
} IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY
{
    public ulong BeginAddress;
    public ulong EndAddress;
    public ulong ExceptionHandler;
    public ulong HandlerData;
    public ulong PrologEndAddress;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY
    Public BeginAddress As ULong
    Public EndAddress As ULong
    Public ExceptionHandler As ULong
    Public HandlerData As ULong
    Public PrologEndAddress As ULong
End Structure
import ctypes
from ctypes import wintypes

class IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY(ctypes.Structure):
    _pack_ = 4
    _fields_ = [
        ("BeginAddress", ctypes.c_ulonglong),
        ("EndAddress", ctypes.c_ulonglong),
        ("ExceptionHandler", ctypes.c_ulonglong),
        ("HandlerData", ctypes.c_ulonglong),
        ("PrologEndAddress", ctypes.c_ulonglong),
    ]
#[repr(C, packed(4))]
pub struct IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY {
    pub BeginAddress: u64,
    pub EndAddress: u64,
    pub ExceptionHandler: u64,
    pub HandlerData: u64,
    pub PrologEndAddress: u64,
}
import "golang.org/x/sys/windows"

type IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY struct {
	BeginAddress uint64
	EndAddress uint64
	ExceptionHandler uint64
	HandlerData uint64
	PrologEndAddress uint64
}
type
  IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY = packed record
    BeginAddress: UInt64;
    EndAddress: UInt64;
    ExceptionHandler: UInt64;
    HandlerData: UInt64;
    PrologEndAddress: UInt64;
  end;
const IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY = extern struct {
    BeginAddress: u64,
    EndAddress: u64,
    ExceptionHandler: u64,
    HandlerData: u64,
    PrologEndAddress: u64,
};
type
  IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY {.packed.} = object
    BeginAddress: uint64
    EndAddress: uint64
    ExceptionHandler: uint64
    HandlerData: uint64
    PrologEndAddress: uint64
align(4)
struct IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY
{
    ulong BeginAddress;
    ulong EndAddress;
    ulong ExceptionHandler;
    ulong HandlerData;
    ulong PrologEndAddress;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; BeginAddress : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; EndAddress : ULONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ExceptionHandler : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; HandlerData : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; PrologEndAddress : ULONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY, pack=4
    #field int64 BeginAddress
    #field int64 EndAddress
    #field int64 ExceptionHandler
    #field int64 HandlerData
    #field int64 PrologEndAddress
#endstruct

stdim st, IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY        ; NSTRUCT 変数を確保
st->BeginAddress = 100
mes "BeginAddress=" + st->BeginAddress