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

IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY

構造体
サイズx64: 20 バイト / x86: 20 バイト

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

フィールド

フィールドサイズx64x86説明
BeginAddressDWORD4+0+0関数の開始アドレス(Alpha、32ビット)。
EndAddressDWORD4+4+4関数の終了アドレス。
ExceptionHandlerDWORD4+8+8例外ハンドラのアドレス。
HandlerDataDWORD4+12+12例外ハンドラに渡される補助データのアドレス。
PrologEndAddressDWORD4+16+16プロローグ終了位置のアドレス。

各言語での定義

#include <windows.h>

// IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY  (x64 20 / x86 20 バイト)
typedef struct IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY {
    DWORD BeginAddress;
    DWORD EndAddress;
    DWORD ExceptionHandler;
    DWORD HandlerData;
    DWORD PrologEndAddress;
} IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY;
using System;
using System.Runtime.InteropServices;

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

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

class IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY(ctypes.Structure):
    _fields_ = [
        ("BeginAddress", wintypes.DWORD),
        ("EndAddress", wintypes.DWORD),
        ("ExceptionHandler", wintypes.DWORD),
        ("HandlerData", wintypes.DWORD),
        ("PrologEndAddress", wintypes.DWORD),
    ]
#[repr(C)]
pub struct IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY {
    pub BeginAddress: u32,
    pub EndAddress: u32,
    pub ExceptionHandler: u32,
    pub HandlerData: u32,
    pub PrologEndAddress: u32,
}
import "golang.org/x/sys/windows"

type IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY struct {
	BeginAddress uint32
	EndAddress uint32
	ExceptionHandler uint32
	HandlerData uint32
	PrologEndAddress uint32
}
type
  IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY = record
    BeginAddress: DWORD;
    EndAddress: DWORD;
    ExceptionHandler: DWORD;
    HandlerData: DWORD;
    PrologEndAddress: DWORD;
  end;
const IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY = extern struct {
    BeginAddress: u32,
    EndAddress: u32,
    ExceptionHandler: u32,
    HandlerData: u32,
    PrologEndAddress: u32,
};
type
  IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY {.bycopy.} = object
    BeginAddress: uint32
    EndAddress: uint32
    ExceptionHandler: uint32
    HandlerData: uint32
    PrologEndAddress: uint32
struct IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY
{
    uint BeginAddress;
    uint EndAddress;
    uint ExceptionHandler;
    uint HandlerData;
    uint 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_ALPHA_RUNTIME_FUNCTION_ENTRY サイズ: 20 バイト(x64)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; BeginAddress : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; EndAddress : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ExceptionHandler : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; HandlerData : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; PrologEndAddress : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY
    #field int BeginAddress
    #field int EndAddress
    #field int ExceptionHandler
    #field int HandlerData
    #field int PrologEndAddress
#endstruct

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