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

D3D11_MESSAGE

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

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

フィールド

フィールドサイズx64x86説明
CategoryD3D11_MESSAGE_CATEGORY4+0+0メッセージのカテゴリーです。D3D11_MESSAGE_CATEGORY を参照してください。
SeverityD3D11_MESSAGE_SEVERITY4+4+4メッセージの重大度です。D3D11_MESSAGE_SEVERITY を参照してください。
IDD3D11_MESSAGE_ID4+8+8メッセージの ID です。D3D11_MESSAGE_ID を参照してください。
pDescriptionBYTE*8/4+16+12メッセージ文字列です。
DescriptionByteLengthUINT_PTR8/4+24+16pDescription の長さ (バイト単位) です。

公式ドキュメント

情報キュー内のデバッグメッセージです。

解説(Remarks)

この構造体は、情報キュー機能の一部として ID3D11InfoQueue::GetMessage から返されます (ID3D11InfoQueue インターフェイス を参照してください)。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// D3D11_MESSAGE  (x64 32 / x86 20 バイト)
typedef struct D3D11_MESSAGE {
    D3D11_MESSAGE_CATEGORY Category;
    D3D11_MESSAGE_SEVERITY Severity;
    D3D11_MESSAGE_ID ID;
    BYTE* pDescription;
    UINT_PTR DescriptionByteLength;
} D3D11_MESSAGE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D11_MESSAGE
{
    public int Category;
    public int Severity;
    public int ID;
    public IntPtr pDescription;
    public UIntPtr DescriptionByteLength;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D11_MESSAGE
    Public Category As Integer
    Public Severity As Integer
    Public ID As Integer
    Public pDescription As IntPtr
    Public DescriptionByteLength As UIntPtr
End Structure
import ctypes
from ctypes import wintypes

class D3D11_MESSAGE(ctypes.Structure):
    _fields_ = [
        ("Category", ctypes.c_int),
        ("Severity", ctypes.c_int),
        ("ID", ctypes.c_int),
        ("pDescription", ctypes.c_void_p),
        ("DescriptionByteLength", ctypes.c_size_t),
    ]
#[repr(C)]
pub struct D3D11_MESSAGE {
    pub Category: i32,
    pub Severity: i32,
    pub ID: i32,
    pub pDescription: *mut core::ffi::c_void,
    pub DescriptionByteLength: usize,
}
import "golang.org/x/sys/windows"

type D3D11_MESSAGE struct {
	Category int32
	Severity int32
	ID int32
	pDescription uintptr
	DescriptionByteLength uintptr
}
type
  D3D11_MESSAGE = record
    Category: Integer;
    Severity: Integer;
    ID: Integer;
    pDescription: Pointer;
    DescriptionByteLength: NativeUInt;
  end;
const D3D11_MESSAGE = extern struct {
    Category: i32,
    Severity: i32,
    ID: i32,
    pDescription: ?*anyopaque,
    DescriptionByteLength: usize,
};
type
  D3D11_MESSAGE {.bycopy.} = object
    Category: int32
    Severity: int32
    ID: int32
    pDescription: pointer
    DescriptionByteLength: uint
struct D3D11_MESSAGE
{
    int Category;
    int Severity;
    int ID;
    void* pDescription;
    size_t DescriptionByteLength;
}

HSP用 定義

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

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

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