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

D3D12_VERSION_NUMBER

共用体
サイズx64: 8 バイト / x86: 8 バイト

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

フィールド

フィールドサイズx64x86説明
VersionULONGLONG8+0+0バージョン番号を64ビット整数として表す共用体メンバー。
VersionPartsWORD8+0+0バージョン番号を分割した16ビット部分(WORD)として表す共用体メンバー。

各言語での定義

#include <windows.h>

// D3D12_VERSION_NUMBER  (x64 8 / x86 8 バイト)
typedef struct D3D12_VERSION_NUMBER {
    ULONGLONG Version;
    WORD VersionParts[4];
} D3D12_VERSION_NUMBER;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D3D12_VERSION_NUMBER
{
    public ulong Version;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public ushort[] VersionParts;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D3D12_VERSION_NUMBER
    Public Version As ULong
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public VersionParts() As UShort
End Structure
import ctypes
from ctypes import wintypes

class D3D12_VERSION_NUMBER(ctypes.Structure):
    _fields_ = [
        ("Version", ctypes.c_ulonglong),
        ("VersionParts", ctypes.c_ushort * 4),
    ]
#[repr(C)]
pub struct D3D12_VERSION_NUMBER {
    pub Version: u64,
    pub VersionParts: [u16; 4],
}
import "golang.org/x/sys/windows"

type D3D12_VERSION_NUMBER struct {
	Version uint64
	VersionParts [4]uint16
}
type
  D3D12_VERSION_NUMBER = record
    Version: UInt64;
    VersionParts: array[0..3] of Word;
  end;
const D3D12_VERSION_NUMBER = extern struct {
    Version: u64,
    VersionParts: [4]u16,
};
type
  D3D12_VERSION_NUMBER {.bycopy.} = object
    Version: uint64
    VersionParts: array[4, uint16]
struct D3D12_VERSION_NUMBER
{
    ulong Version;
    ushort[4] VersionParts;
}

HSP用 定義

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

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

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