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

DEBUG_REGISTER_DESCRIPTION

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

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

フィールド

フィールドサイズx64x86説明
TypeDWORD4+0+0レジスタ値の型(DEBUG_VALUE_*)を示す。
FlagsDWORD4+4+4レジスタの属性フラグ(サブレジスタ等)。
SubregMasterDWORD4+8+8サブレジスタの親(マスタ)レジスタのインデックス。
SubregLengthDWORD4+12+12サブレジスタのビット長。
SubregMaskULONGLONG8+16+16親レジスタから値を抽出するためのビットマスク。
SubregShiftDWORD4+24+24親レジスタ値に適用するシフト量。
Reserved0DWORD4+28+28予約フィールド。0が設定される。

各言語での定義

#include <windows.h>

// DEBUG_REGISTER_DESCRIPTION  (x64 32 / x86 32 バイト)
typedef struct DEBUG_REGISTER_DESCRIPTION {
    DWORD Type;
    DWORD Flags;
    DWORD SubregMaster;
    DWORD SubregLength;
    ULONGLONG SubregMask;
    DWORD SubregShift;
    DWORD Reserved0;
} DEBUG_REGISTER_DESCRIPTION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEBUG_REGISTER_DESCRIPTION
{
    public uint Type;
    public uint Flags;
    public uint SubregMaster;
    public uint SubregLength;
    public ulong SubregMask;
    public uint SubregShift;
    public uint Reserved0;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEBUG_REGISTER_DESCRIPTION
    Public Type As UInteger
    Public Flags As UInteger
    Public SubregMaster As UInteger
    Public SubregLength As UInteger
    Public SubregMask As ULong
    Public SubregShift As UInteger
    Public Reserved0 As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DEBUG_REGISTER_DESCRIPTION(ctypes.Structure):
    _fields_ = [
        ("Type", wintypes.DWORD),
        ("Flags", wintypes.DWORD),
        ("SubregMaster", wintypes.DWORD),
        ("SubregLength", wintypes.DWORD),
        ("SubregMask", ctypes.c_ulonglong),
        ("SubregShift", wintypes.DWORD),
        ("Reserved0", wintypes.DWORD),
    ]
#[repr(C)]
pub struct DEBUG_REGISTER_DESCRIPTION {
    pub Type: u32,
    pub Flags: u32,
    pub SubregMaster: u32,
    pub SubregLength: u32,
    pub SubregMask: u64,
    pub SubregShift: u32,
    pub Reserved0: u32,
}
import "golang.org/x/sys/windows"

type DEBUG_REGISTER_DESCRIPTION struct {
	Type uint32
	Flags uint32
	SubregMaster uint32
	SubregLength uint32
	SubregMask uint64
	SubregShift uint32
	Reserved0 uint32
}
type
  DEBUG_REGISTER_DESCRIPTION = record
    Type: DWORD;
    Flags: DWORD;
    SubregMaster: DWORD;
    SubregLength: DWORD;
    SubregMask: UInt64;
    SubregShift: DWORD;
    Reserved0: DWORD;
  end;
const DEBUG_REGISTER_DESCRIPTION = extern struct {
    Type: u32,
    Flags: u32,
    SubregMaster: u32,
    SubregLength: u32,
    SubregMask: u64,
    SubregShift: u32,
    Reserved0: u32,
};
type
  DEBUG_REGISTER_DESCRIPTION {.bycopy.} = object
    Type: uint32
    Flags: uint32
    SubregMaster: uint32
    SubregLength: uint32
    SubregMask: uint64
    SubregShift: uint32
    Reserved0: uint32
struct DEBUG_REGISTER_DESCRIPTION
{
    uint Type;
    uint Flags;
    uint SubregMaster;
    uint SubregLength;
    ulong SubregMask;
    uint SubregShift;
    uint Reserved0;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEBUG_REGISTER_DESCRIPTION サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Type : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Flags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; SubregMaster : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; SubregLength : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; SubregMask : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; SubregShift : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Reserved0 : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEBUG_REGISTER_DESCRIPTION
    #field int Type
    #field int Flags
    #field int SubregMaster
    #field int SubregLength
    #field int64 SubregMask
    #field int SubregShift
    #field int Reserved0
#endstruct

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