ホーム › Graphics.DXCore › DXCoreEngineNamePropertyInput
DXCoreEngineNamePropertyInput
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| adapterEngineIndex | DXCoreAdapterEngineIndex | 8 | +0 | +0 | 名前を取得する対象のアダプターとエンジンを指定する構造体。 |
| engineNameLength | DWORD | 4 | +8 | +8 | engineNameバッファの長さ(文字数)。 |
| engineName | LPWSTR | 8/4 | +16 | +12 | エンジン名を受け取るワイド文字列バッファへのポインタ。 |
各言語での定義
#include <windows.h>
// DXCoreAdapterEngineIndex (x64 8 / x86 8 バイト)
typedef struct DXCoreAdapterEngineIndex {
DWORD physicalAdapterIndex;
DWORD engineIndex;
} DXCoreAdapterEngineIndex;
// DXCoreEngineNamePropertyInput (x64 24 / x86 16 バイト)
typedef struct DXCoreEngineNamePropertyInput {
DXCoreAdapterEngineIndex adapterEngineIndex;
DWORD engineNameLength;
LPWSTR engineName;
} DXCoreEngineNamePropertyInput;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXCoreAdapterEngineIndex
{
public uint physicalAdapterIndex;
public uint engineIndex;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DXCoreEngineNamePropertyInput
{
public DXCoreAdapterEngineIndex adapterEngineIndex;
public uint engineNameLength;
public IntPtr engineName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXCoreAdapterEngineIndex
Public physicalAdapterIndex As UInteger
Public engineIndex As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DXCoreEngineNamePropertyInput
Public adapterEngineIndex As DXCoreAdapterEngineIndex
Public engineNameLength As UInteger
Public engineName As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class DXCoreAdapterEngineIndex(ctypes.Structure):
_fields_ = [
("physicalAdapterIndex", wintypes.DWORD),
("engineIndex", wintypes.DWORD),
]
class DXCoreEngineNamePropertyInput(ctypes.Structure):
_fields_ = [
("adapterEngineIndex", DXCoreAdapterEngineIndex),
("engineNameLength", wintypes.DWORD),
("engineName", ctypes.c_void_p),
]#[repr(C)]
pub struct DXCoreAdapterEngineIndex {
pub physicalAdapterIndex: u32,
pub engineIndex: u32,
}
#[repr(C)]
pub struct DXCoreEngineNamePropertyInput {
pub adapterEngineIndex: DXCoreAdapterEngineIndex,
pub engineNameLength: u32,
pub engineName: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type DXCoreAdapterEngineIndex struct {
physicalAdapterIndex uint32
engineIndex uint32
}
type DXCoreEngineNamePropertyInput struct {
adapterEngineIndex DXCoreAdapterEngineIndex
engineNameLength uint32
engineName uintptr
}type
DXCoreAdapterEngineIndex = record
physicalAdapterIndex: DWORD;
engineIndex: DWORD;
end;
DXCoreEngineNamePropertyInput = record
adapterEngineIndex: DXCoreAdapterEngineIndex;
engineNameLength: DWORD;
engineName: Pointer;
end;const DXCoreAdapterEngineIndex = extern struct {
physicalAdapterIndex: u32,
engineIndex: u32,
};
const DXCoreEngineNamePropertyInput = extern struct {
adapterEngineIndex: DXCoreAdapterEngineIndex,
engineNameLength: u32,
engineName: ?*anyopaque,
};type
DXCoreAdapterEngineIndex {.bycopy.} = object
physicalAdapterIndex: uint32
engineIndex: uint32
DXCoreEngineNamePropertyInput {.bycopy.} = object
adapterEngineIndex: DXCoreAdapterEngineIndex
engineNameLength: uint32
engineName: pointerstruct DXCoreAdapterEngineIndex
{
uint physicalAdapterIndex;
uint engineIndex;
}
struct DXCoreEngineNamePropertyInput
{
DXCoreAdapterEngineIndex adapterEngineIndex;
uint engineNameLength;
void* engineName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DXCoreEngineNamePropertyInput サイズ: 16 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; adapterEngineIndex : DXCoreAdapterEngineIndex (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; engineNameLength : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; engineName : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXCoreEngineNamePropertyInput サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; adapterEngineIndex : DXCoreAdapterEngineIndex (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; engineNameLength : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; engineName : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DXCoreAdapterEngineIndex
#field int physicalAdapterIndex
#field int engineIndex
#endstruct
#defstruct global DXCoreEngineNamePropertyInput
#field DXCoreAdapterEngineIndex adapterEngineIndex
#field int engineNameLength
#field intptr engineName
#endstruct
stdim st, DXCoreEngineNamePropertyInput ; NSTRUCT 変数を確保
st->engineNameLength = 100
mes "engineNameLength=" + st->engineNameLength