ホーム › System.Diagnostics.Debug.Extensions › GET_EXPRESSION_EX
GET_EXPRESSION_EX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Expression | LPSTR | 8/4 | +0 | +0 | 評価する式文字列(入力)。 |
| Remainder | LPSTR | 8/4 | +8 | +4 | 式評価後の未処理残り文字列を指すポインタ(出力)。 |
| Value | ULONGLONG | 8 | +16 | +8 | 式の評価結果の値(出力、64ビット)。 |
各言語での定義
#include <windows.h>
// GET_EXPRESSION_EX (x64 24 / x86 16 バイト)
typedef struct GET_EXPRESSION_EX {
LPSTR Expression;
LPSTR Remainder;
ULONGLONG Value;
} GET_EXPRESSION_EX;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GET_EXPRESSION_EX
{
public IntPtr Expression;
public IntPtr Remainder;
public ulong Value;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GET_EXPRESSION_EX
Public Expression As IntPtr
Public Remainder As IntPtr
Public Value As ULong
End Structureimport ctypes
from ctypes import wintypes
class GET_EXPRESSION_EX(ctypes.Structure):
_fields_ = [
("Expression", ctypes.c_void_p),
("Remainder", ctypes.c_void_p),
("Value", ctypes.c_ulonglong),
]#[repr(C)]
pub struct GET_EXPRESSION_EX {
pub Expression: *mut core::ffi::c_void,
pub Remainder: *mut core::ffi::c_void,
pub Value: u64,
}import "golang.org/x/sys/windows"
type GET_EXPRESSION_EX struct {
Expression uintptr
Remainder uintptr
Value uint64
}type
GET_EXPRESSION_EX = record
Expression: Pointer;
Remainder: Pointer;
Value: UInt64;
end;const GET_EXPRESSION_EX = extern struct {
Expression: ?*anyopaque,
Remainder: ?*anyopaque,
Value: u64,
};type
GET_EXPRESSION_EX {.bycopy.} = object
Expression: pointer
Remainder: pointer
Value: uint64struct GET_EXPRESSION_EX
{
void* Expression;
void* Remainder;
ulong Value;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; GET_EXPRESSION_EX サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; Expression : LPSTR (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Remainder : LPSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Value : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GET_EXPRESSION_EX サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Expression : LPSTR (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Remainder : LPSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Value : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GET_EXPRESSION_EX
#field intptr Expression
#field intptr Remainder
#field int64 Value
#endstruct
stdim st, GET_EXPRESSION_EX ; NSTRUCT 変数を確保
st->Value = 100
mes "Value=" + st->Value