Win32 API 日本語リファレンス
ホームGraphics.Direct3D11 › D3D11_TRACE_REGISTER

D3D11_TRACE_REGISTER

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

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

フィールド

フィールドサイズx64x86説明
RegTypeD3D11_TRACE_REGISTER_TYPE4+0+0レジスタの種類を示すD3D11_TRACE_REGISTER_TYPE列挙値。
Anonymous_Anonymous_e__Union4+4+4レジスタの番号やインデックスを保持する無名共用体。
OperandIndexBYTE1+8+8命令内におけるオペランドのインデックス。
FlagsBYTE1+9+9レジスタアクセスの属性を示すビットフラグ。

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

フィールドサイズx64x86
Index1DWORD2+0+0
Index2DWORD4+0+0

各言語での定義

#include <windows.h>

// D3D11_TRACE_REGISTER  (x64 12 / x86 12 バイト)
typedef struct D3D11_TRACE_REGISTER {
    D3D11_TRACE_REGISTER_TYPE RegType;
    _Anonymous_e__Union Anonymous;
    BYTE OperandIndex;
    BYTE Flags;
} D3D11_TRACE_REGISTER;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_TRACE_REGISTER
{
    public int RegType;
    public _Anonymous_e__Union Anonymous;
    public byte OperandIndex;
    public byte Flags;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_TRACE_REGISTER
    Public RegType As Integer
    Public Anonymous As _Anonymous_e__Union
    Public OperandIndex As Byte
    Public Flags As Byte
End Structure
import ctypes
from ctypes import wintypes

class D3D11_TRACE_REGISTER(ctypes.Structure):
    _fields_ = [
        ("RegType", ctypes.c_int),
        ("Anonymous", _Anonymous_e__Union),
        ("OperandIndex", ctypes.c_ubyte),
        ("Flags", ctypes.c_ubyte),
    ]
#[repr(C)]
pub struct D3D11_TRACE_REGISTER {
    pub RegType: i32,
    pub Anonymous: _Anonymous_e__Union,
    pub OperandIndex: u8,
    pub Flags: u8,
}
import "golang.org/x/sys/windows"

type D3D11_TRACE_REGISTER struct {
	RegType int32
	Anonymous _Anonymous_e__Union
	OperandIndex byte
	Flags byte
}
type
  D3D11_TRACE_REGISTER = record
    RegType: Integer;
    Anonymous: _Anonymous_e__Union;
    OperandIndex: Byte;
    Flags: Byte;
  end;
const D3D11_TRACE_REGISTER = extern struct {
    RegType: i32,
    Anonymous: _Anonymous_e__Union,
    OperandIndex: u8,
    Flags: u8,
};
type
  D3D11_TRACE_REGISTER {.bycopy.} = object
    RegType: int32
    Anonymous: _Anonymous_e__Union
    OperandIndex: uint8
    Flags: uint8
struct D3D11_TRACE_REGISTER
{
    int RegType;
    _Anonymous_e__Union Anonymous;
    ubyte OperandIndex;
    ubyte Flags;
}

HSP用 定義

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

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

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