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

D3D10_MESSAGE

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

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

フィールド

フィールドサイズx64x86説明
CategoryD3D10_MESSAGE_CATEGORY4+0+0デバッグメッセージの分類を示す列挙値。
SeverityD3D10_MESSAGE_SEVERITY4+4+4メッセージの重大度(エラー/警告/情報など)を示す列挙値。
IDD3D10_MESSAGE_ID4+8+8メッセージを一意に識別するID列挙値。
pDescriptionBYTE*8/4+16+12メッセージ本文(ASCII文字列)を指すポインタ。
DescriptionByteLengthUINT_PTR8/4+24+16メッセージ本文のバイト長(NULL終端含む)。

各言語での定義

#include <windows.h>

// D3D10_MESSAGE  (x64 32 / x86 20 バイト)
typedef struct D3D10_MESSAGE {
    D3D10_MESSAGE_CATEGORY Category;
    D3D10_MESSAGE_SEVERITY Severity;
    D3D10_MESSAGE_ID ID;
    BYTE* pDescription;
    UINT_PTR DescriptionByteLength;
} D3D10_MESSAGE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D10_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 D3D10_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 D3D10_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 D3D10_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 D3D10_MESSAGE struct {
	Category int32
	Severity int32
	ID int32
	pDescription uintptr
	DescriptionByteLength uintptr
}
type
  D3D10_MESSAGE = record
    Category: Integer;
    Severity: Integer;
    ID: Integer;
    pDescription: Pointer;
    DescriptionByteLength: NativeUInt;
  end;
const D3D10_MESSAGE = extern struct {
    Category: i32,
    Severity: i32,
    ID: i32,
    pDescription: ?*anyopaque,
    DescriptionByteLength: usize,
};
type
  D3D10_MESSAGE {.bycopy.} = object
    Category: int32
    Severity: int32
    ID: int32
    pDescription: pointer
    DescriptionByteLength: uint
struct D3D10_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 レイアウト)
; D3D10_MESSAGE サイズ: 20 バイト(x86)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Category : D3D10_MESSAGE_CATEGORY (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Severity : D3D10_MESSAGE_SEVERITY (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ID : D3D10_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 レイアウト)
; D3D10_MESSAGE サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Category : D3D10_MESSAGE_CATEGORY (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Severity : D3D10_MESSAGE_SEVERITY (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ID : D3D10_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 D3D10_MESSAGE
    #field int Category
    #field int Severity
    #field int ID
    #field intptr pDescription
    #field intptr DescriptionByteLength
#endstruct

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