Win32 API 日本語リファレンス
ホームSystem.Diagnostics.Debug.Extensions › DEBUG_VALUE

DEBUG_VALUE

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

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

フィールド

フィールドサイズx64x86説明
Anonymous_Anonymous_e__Union24+0+0整数/浮動小数点/ベクタなど各種型の値を保持する無名共用体。
TailOfRawBytesDWORD4+24+24RawBytes末尾の未使用バイト数を示す。
TypeDWORD4+28+28格納されている値の型(DEBUG_VALUE_*)を示す。

共用体: _Anonymous_e__Union x64 24B / x86 24B

フィールドサイズx64x86説明
I8BYTE1+0+0
I16WORD2+0+0
I32DWORD4+0+0
Anonymous_Anonymous_e__Struct8/4+0+0整数/浮動小数点/ベクタなど各種型の値を保持する無名共用体。
F32FLOAT4+0+0
F64DOUBLE8+0+0
F80BytesBYTE10+0+0
F82BytesBYTE11+0+0
F128BytesBYTE16+0+0
VI8BYTE16+0+0
VI16WORD16+0+0
VI32DWORD16+0+0
VI64ULONGLONG16+0+0
VF32FLOAT16+0+0
VF64DOUBLE16+0+0
I64Parts32_I64Parts32_e__Struct8/4+0+0
F128Parts64_F128Parts64_e__Struct8/4+0+0
RawBytesBYTE24+0+0

各言語での定義

#include <windows.h>

// DEBUG_VALUE  (x64 32 / x86 32 バイト)
typedef struct DEBUG_VALUE {
    _Anonymous_e__Union Anonymous;
    DWORD TailOfRawBytes;
    DWORD Type;
} DEBUG_VALUE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_VALUE
{
    public _Anonymous_e__Union Anonymous;
    public uint TailOfRawBytes;
    public uint Type;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_VALUE
    Public Anonymous As _Anonymous_e__Union
    Public TailOfRawBytes As UInteger
    Public Type As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DEBUG_VALUE(ctypes.Structure):
    _fields_ = [
        ("Anonymous", _Anonymous_e__Union),
        ("TailOfRawBytes", wintypes.DWORD),
        ("Type", wintypes.DWORD),
    ]
#[repr(C)]
pub struct DEBUG_VALUE {
    pub Anonymous: _Anonymous_e__Union,
    pub TailOfRawBytes: u32,
    pub Type: u32,
}
import "golang.org/x/sys/windows"

type DEBUG_VALUE struct {
	Anonymous _Anonymous_e__Union
	TailOfRawBytes uint32
	Type uint32
}
type
  DEBUG_VALUE = record
    Anonymous: _Anonymous_e__Union;
    TailOfRawBytes: DWORD;
    Type: DWORD;
  end;
const DEBUG_VALUE = extern struct {
    Anonymous: _Anonymous_e__Union,
    TailOfRawBytes: u32,
    Type: u32,
};
type
  DEBUG_VALUE {.bycopy.} = object
    Anonymous: _Anonymous_e__Union
    TailOfRawBytes: uint32
    Type: uint32
struct DEBUG_VALUE
{
    _Anonymous_e__Union Anonymous;
    uint TailOfRawBytes;
    uint Type;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEBUG_VALUE サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Anonymous : _Anonymous_e__Union (+0, 24byte)  varptr(st)+0 を基点に操作(24byte:入れ子/配列)
; TailOfRawBytes : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Type : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEBUG_VALUE
    #field byte Anonymous 24
    #field int TailOfRawBytes
    #field int Type
#endstruct

stdim st, DEBUG_VALUE        ; NSTRUCT 変数を確保
st->TailOfRawBytes = 100
mes "TailOfRawBytes=" + st->TailOfRawBytes
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。