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

DXCoreEngineQueryInput

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

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

フィールド

フィールドサイズx64x86説明
adapterEngineIndexDXCoreAdapterEngineIndex8+0+0問い合わせ対象のアダプターとエンジンを指定する構造体。
processIdDWORD4+8+8稼働時間を問い合わせる対象プロセスのID。

各言語での定義

#include <windows.h>

// DXCoreAdapterEngineIndex  (x64 8 / x86 8 バイト)
typedef struct DXCoreAdapterEngineIndex {
    DWORD physicalAdapterIndex;
    DWORD engineIndex;
} DXCoreAdapterEngineIndex;

// DXCoreEngineQueryInput  (x64 12 / x86 12 バイト)
typedef struct DXCoreEngineQueryInput {
    DXCoreAdapterEngineIndex adapterEngineIndex;
    DWORD processId;
} DXCoreEngineQueryInput;
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 DXCoreEngineQueryInput
{
    public DXCoreAdapterEngineIndex adapterEngineIndex;
    public uint processId;
}
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 DXCoreEngineQueryInput
    Public adapterEngineIndex As DXCoreAdapterEngineIndex
    Public processId As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DXCoreAdapterEngineIndex(ctypes.Structure):
    _fields_ = [
        ("physicalAdapterIndex", wintypes.DWORD),
        ("engineIndex", wintypes.DWORD),
    ]

class DXCoreEngineQueryInput(ctypes.Structure):
    _fields_ = [
        ("adapterEngineIndex", DXCoreAdapterEngineIndex),
        ("processId", wintypes.DWORD),
    ]
#[repr(C)]
pub struct DXCoreAdapterEngineIndex {
    pub physicalAdapterIndex: u32,
    pub engineIndex: u32,
}

#[repr(C)]
pub struct DXCoreEngineQueryInput {
    pub adapterEngineIndex: DXCoreAdapterEngineIndex,
    pub processId: u32,
}
import "golang.org/x/sys/windows"

type DXCoreAdapterEngineIndex struct {
	physicalAdapterIndex uint32
	engineIndex uint32
}

type DXCoreEngineQueryInput struct {
	adapterEngineIndex DXCoreAdapterEngineIndex
	processId uint32
}
type
  DXCoreAdapterEngineIndex = record
    physicalAdapterIndex: DWORD;
    engineIndex: DWORD;
  end;

  DXCoreEngineQueryInput = record
    adapterEngineIndex: DXCoreAdapterEngineIndex;
    processId: DWORD;
  end;
const DXCoreAdapterEngineIndex = extern struct {
    physicalAdapterIndex: u32,
    engineIndex: u32,
};

const DXCoreEngineQueryInput = extern struct {
    adapterEngineIndex: DXCoreAdapterEngineIndex,
    processId: u32,
};
type
  DXCoreAdapterEngineIndex {.bycopy.} = object
    physicalAdapterIndex: uint32
    engineIndex: uint32

  DXCoreEngineQueryInput {.bycopy.} = object
    adapterEngineIndex: DXCoreAdapterEngineIndex
    processId: uint32
struct DXCoreAdapterEngineIndex
{
    uint physicalAdapterIndex;
    uint engineIndex;
}

struct DXCoreEngineQueryInput
{
    DXCoreAdapterEngineIndex adapterEngineIndex;
    uint processId;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DXCoreEngineQueryInput サイズ: 12 バイト(x64)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; adapterEngineIndex : DXCoreAdapterEngineIndex (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; processId : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ※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 DXCoreEngineQueryInput
    #field DXCoreAdapterEngineIndex adapterEngineIndex
    #field int processId
#endstruct

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