ホーム › System.VirtualDosMachines › TEMP_BP_NOTE
TEMP_BP_NOTE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Seg | WORD | 2 | +0 | +0 | 一時ブレークポイントを設定するセグメント値。 |
| Offset | DWORD | 4 | +4 | +4 | ブレークポイントのセグメント内オフセット。 |
| bPM | BOOL | 4 | +8 | +8 | 保護モード(Protected Mode)アドレスか否かを示すBOOL。 |
各言語での定義
#include <windows.h>
// TEMP_BP_NOTE (x64 12 / x86 12 バイト)
typedef struct TEMP_BP_NOTE {
WORD Seg;
DWORD Offset;
BOOL bPM;
} TEMP_BP_NOTE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TEMP_BP_NOTE
{
public ushort Seg;
public uint Offset;
[MarshalAs(UnmanagedType.Bool)] public bool bPM;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TEMP_BP_NOTE
Public Seg As UShort
Public Offset As UInteger
<MarshalAs(UnmanagedType.Bool)> Public bPM As Boolean
End Structureimport ctypes
from ctypes import wintypes
class TEMP_BP_NOTE(ctypes.Structure):
_fields_ = [
("Seg", ctypes.c_ushort),
("Offset", wintypes.DWORD),
("bPM", wintypes.BOOL),
]#[repr(C)]
pub struct TEMP_BP_NOTE {
pub Seg: u16,
pub Offset: u32,
pub bPM: i32,
}import "golang.org/x/sys/windows"
type TEMP_BP_NOTE struct {
Seg uint16
Offset uint32
bPM int32
}type
TEMP_BP_NOTE = record
Seg: Word;
Offset: DWORD;
bPM: BOOL;
end;const TEMP_BP_NOTE = extern struct {
Seg: u16,
Offset: u32,
bPM: i32,
};type
TEMP_BP_NOTE {.bycopy.} = object
Seg: uint16
Offset: uint32
bPM: int32struct TEMP_BP_NOTE
{
ushort Seg;
uint Offset;
int bPM;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TEMP_BP_NOTE サイズ: 12 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; Seg : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; Offset : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; bPM : BOOL (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TEMP_BP_NOTE
#field short Seg
#field int Offset
#field bool bPM
#endstruct
stdim st, TEMP_BP_NOTE ; NSTRUCT 変数を確保
st->Seg = 100
mes "Seg=" + st->Seg