ホーム › Graphics.DirectDraw › DDDEVICEIDENTIFIER2
DDDEVICEIDENTIFIER2
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| szDriver | CHAR | 512 | +0 | +0 | ディスプレイドライバ名を格納するANSI文字列(配列)。 |
| szDescription | CHAR | 512 | +512 | +512 | デバイスの説明文字列を格納するANSI文字列(配列)。 |
| liDriverVersion | LONGLONG | 8 | +1024 | +1024 | ドライバのバージョンを64ビット値で示す。 |
| dwVendorId | DWORD | 4 | +1032 | +1032 | ハードウェアベンダーID(PCIベンダID)を示す。 |
| dwDeviceId | DWORD | 4 | +1036 | +1036 | デバイスID(PCIデバイスID)を示す。 |
| dwSubSysId | DWORD | 4 | +1040 | +1040 | サブシステムIDを示す。 |
| dwRevision | DWORD | 4 | +1044 | +1044 | チップのリビジョン番号を示す。 |
| guidDeviceIdentifier | GUID | 16 | +1048 | +1048 | ドライバ/チップ組み合わせを一意に識別するGUID。 |
| dwWHQLLevel | DWORD | 4 | +1064 | +1064 | WHQL認証レベル。0は未認証を意味する。 |
各言語での定義
#include <windows.h>
// DDDEVICEIDENTIFIER2 (x64 1072 / x86 1072 バイト)
typedef struct DDDEVICEIDENTIFIER2 {
CHAR szDriver[512];
CHAR szDescription[512];
LONGLONG liDriverVersion;
DWORD dwVendorId;
DWORD dwDeviceId;
DWORD dwSubSysId;
DWORD dwRevision;
GUID guidDeviceIdentifier;
DWORD dwWHQLLevel;
} DDDEVICEIDENTIFIER2;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDDEVICEIDENTIFIER2
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] public sbyte[] szDriver;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] public sbyte[] szDescription;
public long liDriverVersion;
public uint dwVendorId;
public uint dwDeviceId;
public uint dwSubSysId;
public uint dwRevision;
public Guid guidDeviceIdentifier;
public uint dwWHQLLevel;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDDEVICEIDENTIFIER2
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=512)> Public szDriver() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=512)> Public szDescription() As SByte
Public liDriverVersion As Long
Public dwVendorId As UInteger
Public dwDeviceId As UInteger
Public dwSubSysId As UInteger
Public dwRevision As UInteger
Public guidDeviceIdentifier As Guid
Public dwWHQLLevel As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DDDEVICEIDENTIFIER2(ctypes.Structure):
_fields_ = [
("szDriver", ctypes.c_byte * 512),
("szDescription", ctypes.c_byte * 512),
("liDriverVersion", ctypes.c_longlong),
("dwVendorId", wintypes.DWORD),
("dwDeviceId", wintypes.DWORD),
("dwSubSysId", wintypes.DWORD),
("dwRevision", wintypes.DWORD),
("guidDeviceIdentifier", GUID),
("dwWHQLLevel", wintypes.DWORD),
]#[repr(C)]
pub struct DDDEVICEIDENTIFIER2 {
pub szDriver: [i8; 512],
pub szDescription: [i8; 512],
pub liDriverVersion: i64,
pub dwVendorId: u32,
pub dwDeviceId: u32,
pub dwSubSysId: u32,
pub dwRevision: u32,
pub guidDeviceIdentifier: GUID,
pub dwWHQLLevel: u32,
}import "golang.org/x/sys/windows"
type DDDEVICEIDENTIFIER2 struct {
szDriver [512]int8
szDescription [512]int8
liDriverVersion int64
dwVendorId uint32
dwDeviceId uint32
dwSubSysId uint32
dwRevision uint32
guidDeviceIdentifier windows.GUID
dwWHQLLevel uint32
}type
DDDEVICEIDENTIFIER2 = record
szDriver: array[0..511] of Shortint;
szDescription: array[0..511] of Shortint;
liDriverVersion: Int64;
dwVendorId: DWORD;
dwDeviceId: DWORD;
dwSubSysId: DWORD;
dwRevision: DWORD;
guidDeviceIdentifier: TGUID;
dwWHQLLevel: DWORD;
end;const DDDEVICEIDENTIFIER2 = extern struct {
szDriver: [512]i8,
szDescription: [512]i8,
liDriverVersion: i64,
dwVendorId: u32,
dwDeviceId: u32,
dwSubSysId: u32,
dwRevision: u32,
guidDeviceIdentifier: GUID,
dwWHQLLevel: u32,
};type
DDDEVICEIDENTIFIER2 {.bycopy.} = object
szDriver: array[512, int8]
szDescription: array[512, int8]
liDriverVersion: int64
dwVendorId: uint32
dwDeviceId: uint32
dwSubSysId: uint32
dwRevision: uint32
guidDeviceIdentifier: GUID
dwWHQLLevel: uint32struct DDDEVICEIDENTIFIER2
{
byte[512] szDriver;
byte[512] szDescription;
long liDriverVersion;
uint dwVendorId;
uint dwDeviceId;
uint dwSubSysId;
uint dwRevision;
GUID guidDeviceIdentifier;
uint dwWHQLLevel;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDDEVICEIDENTIFIER2 サイズ: 1072 バイト(x64)
dim st, 268 ; 4byte整数×268(構造体サイズ 1072 / 4 切り上げ)
; szDriver : CHAR (+0, 512byte) varptr(st)+0 を基点に操作(512byte:入れ子/配列)
; szDescription : CHAR (+512, 512byte) varptr(st)+512 を基点に操作(512byte:入れ子/配列)
; liDriverVersion : LONGLONG (+1024, 8byte) qpoke st,1024,値 / qpeek(st,1024) ※IronHSPのみ。3.7/3.8は lpoke st,1024,下位 : lpoke st,1028,上位
; dwVendorId : DWORD (+1032, 4byte) st.258 = 値 / 値 = st.258 (lpoke/lpeek も可)
; dwDeviceId : DWORD (+1036, 4byte) st.259 = 値 / 値 = st.259 (lpoke/lpeek も可)
; dwSubSysId : DWORD (+1040, 4byte) st.260 = 値 / 値 = st.260 (lpoke/lpeek も可)
; dwRevision : DWORD (+1044, 4byte) st.261 = 値 / 値 = st.261 (lpoke/lpeek も可)
; guidDeviceIdentifier : GUID (+1048, 16byte) varptr(st)+1048 を基点に操作(16byte:入れ子/配列)
; dwWHQLLevel : DWORD (+1064, 4byte) st.266 = 値 / 値 = st.266 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global DDDEVICEIDENTIFIER2
#field byte szDriver 512
#field byte szDescription 512
#field int64 liDriverVersion
#field int dwVendorId
#field int dwDeviceId
#field int dwSubSysId
#field int dwRevision
#field GUID guidDeviceIdentifier
#field int dwWHQLLevel
#endstruct
stdim st, DDDEVICEIDENTIFIER2 ; NSTRUCT 変数を確保
st->liDriverVersion = 100
mes "liDriverVersion=" + st->liDriverVersion