ホーム › System.SystemServices › IMAGE_DEBUG_MISC
IMAGE_DEBUG_MISC
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| DataType | DWORD | 4 | +0 | +0 | その他デバッグ情報の種別(IMAGE_DEBUG_MISC_EXENAME等)。 |
| Length | DWORD | 4 | +4 | +4 | 本レコード全体のサイズをバイト単位で示す。 |
| Unicode | BOOLEAN | 1 | +8 | +8 | Dataフィールドの文字列がUnicodeか否かを示す真偽値。 |
| Reserved | BYTE | 3 | +9 | +9 | 予約バイト配列。 |
| Data | BYTE | 1 | +12 | +12 | 実際のデバッグデータ(可変長)。 |
各言語での定義
#include <windows.h>
// IMAGE_DEBUG_MISC (x64 16 / x86 16 バイト)
typedef struct IMAGE_DEBUG_MISC {
DWORD DataType;
DWORD Length;
BOOLEAN Unicode;
BYTE Reserved[3];
BYTE Data[1];
} IMAGE_DEBUG_MISC;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IMAGE_DEBUG_MISC
{
public uint DataType;
public uint Length;
[MarshalAs(UnmanagedType.U1)] public bool Unicode;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] Reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] Data;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IMAGE_DEBUG_MISC
Public DataType As UInteger
Public Length As UInteger
<MarshalAs(UnmanagedType.U1)> Public Unicode As Boolean
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public Reserved() As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Data() As Byte
End Structureimport ctypes
from ctypes import wintypes
class IMAGE_DEBUG_MISC(ctypes.Structure):
_fields_ = [
("DataType", wintypes.DWORD),
("Length", wintypes.DWORD),
("Unicode", ctypes.c_byte),
("Reserved", ctypes.c_ubyte * 3),
("Data", ctypes.c_ubyte * 1),
]#[repr(C)]
pub struct IMAGE_DEBUG_MISC {
pub DataType: u32,
pub Length: u32,
pub Unicode: u8,
pub Reserved: [u8; 3],
pub Data: [u8; 1],
}import "golang.org/x/sys/windows"
type IMAGE_DEBUG_MISC struct {
DataType uint32
Length uint32
Unicode byte
Reserved [3]byte
Data [1]byte
}type
IMAGE_DEBUG_MISC = record
DataType: DWORD;
Length: DWORD;
Unicode: ByteBool;
Reserved: array[0..2] of Byte;
Data: array[0..0] of Byte;
end;const IMAGE_DEBUG_MISC = extern struct {
DataType: u32,
Length: u32,
Unicode: u8,
Reserved: [3]u8,
Data: [1]u8,
};type
IMAGE_DEBUG_MISC {.bycopy.} = object
DataType: uint32
Length: uint32
Unicode: uint8
Reserved: array[3, uint8]
Data: array[1, uint8]struct IMAGE_DEBUG_MISC
{
uint DataType;
uint Length;
ubyte Unicode;
ubyte[3] Reserved;
ubyte[1] Data;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; IMAGE_DEBUG_MISC サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; DataType : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Length : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Unicode : BOOLEAN (+8, 1byte) poke st,8,値 / 値 = peek(st,8)
; Reserved : BYTE (+9, 3byte) varptr(st)+9 を基点に操作(3byte:入れ子/配列)
; Data : BYTE (+12, 1byte) varptr(st)+12 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global IMAGE_DEBUG_MISC
#field int DataType
#field int Length
#field bool1 Unicode
#field byte Reserved 3
#field byte Data 1
#endstruct
stdim st, IMAGE_DEBUG_MISC ; NSTRUCT 変数を確保
st->DataType = 100
mes "DataType=" + st->DataType