Win32 API 日本語リファレンス
ホームSystem.Ioctl › SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO

SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO

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

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

フィールド

フィールドサイズx64x86説明
VersionDWORD4+0+0この構造体のバージョン番号。
SizeDWORD4+4+4この構造体のバイト単位のサイズ。
DeviceCountDWORD4+8+8Devices配列に含まれる専用メモリデバイスの数。
DevicesSCM_BUS_DEDICATED_MEMORY_DEVICE_INFO32+16+16SCM_BUS_DEDICATED_MEMORY_DEVICE_INFOの可変長配列。先頭要素。

各言語での定義

#include <windows.h>

// SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO  (x64 32 / x86 32 バイト)
typedef struct SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO {
    GUID DeviceGuid;
    DWORD DeviceNumber;
    _Flags_e__Struct Flags;
    ULONGLONG DeviceSize;
} SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO;

// SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO  (x64 48 / x86 48 バイト)
typedef struct SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO {
    DWORD Version;
    DWORD Size;
    DWORD DeviceCount;
    SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO Devices[1];
} SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO
{
    public Guid DeviceGuid;
    public uint DeviceNumber;
    public _Flags_e__Struct Flags;
    public ulong DeviceSize;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO
{
    public uint Version;
    public uint Size;
    public uint DeviceCount;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO[] Devices;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO
    Public DeviceGuid As Guid
    Public DeviceNumber As UInteger
    Public Flags As _Flags_e__Struct
    Public DeviceSize As ULong
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO
    Public Version As UInteger
    Public Size As UInteger
    Public DeviceCount As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Devices() As SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO
End Structure
import ctypes
from ctypes import wintypes

class SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO(ctypes.Structure):
    _fields_ = [
        ("DeviceGuid", GUID),
        ("DeviceNumber", wintypes.DWORD),
        ("Flags", _Flags_e__Struct),
        ("DeviceSize", ctypes.c_ulonglong),
    ]

class SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO(ctypes.Structure):
    _fields_ = [
        ("Version", wintypes.DWORD),
        ("Size", wintypes.DWORD),
        ("DeviceCount", wintypes.DWORD),
        ("Devices", SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO * 1),
    ]
#[repr(C)]
pub struct SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO {
    pub DeviceGuid: GUID,
    pub DeviceNumber: u32,
    pub Flags: _Flags_e__Struct,
    pub DeviceSize: u64,
}

#[repr(C)]
pub struct SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO {
    pub Version: u32,
    pub Size: u32,
    pub DeviceCount: u32,
    pub Devices: [SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO; 1],
}
import "golang.org/x/sys/windows"

type SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO struct {
	DeviceGuid windows.GUID
	DeviceNumber uint32
	Flags _Flags_e__Struct
	DeviceSize uint64
}

type SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO struct {
	Version uint32
	Size uint32
	DeviceCount uint32
	Devices [1]SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO
}
type
  SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO = record
    DeviceGuid: TGUID;
    DeviceNumber: DWORD;
    Flags: _Flags_e__Struct;
    DeviceSize: UInt64;
  end;

  SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO = record
    Version: DWORD;
    Size: DWORD;
    DeviceCount: DWORD;
    Devices: array[0..0] of SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO;
  end;
const SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO = extern struct {
    DeviceGuid: GUID,
    DeviceNumber: u32,
    Flags: _Flags_e__Struct,
    DeviceSize: u64,
};

const SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO = extern struct {
    Version: u32,
    Size: u32,
    DeviceCount: u32,
    Devices: [1]SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO,
};
type
  SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO {.bycopy.} = object
    DeviceGuid: GUID
    DeviceNumber: uint32
    Flags: _Flags_e__Struct
    DeviceSize: uint64

  SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO {.bycopy.} = object
    Version: uint32
    Size: uint32
    DeviceCount: uint32
    Devices: array[1, SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO]
struct SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO
{
    GUID DeviceGuid;
    uint DeviceNumber;
    _Flags_e__Struct Flags;
    ulong DeviceSize;
}

struct SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO
{
    uint Version;
    uint Size;
    uint DeviceCount;
    SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO[1] Devices;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; Version : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Size : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; DeviceCount : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Devices : SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO (+16, 32byte)  varptr(st)+16 を基点に操作(32byte:入れ子/配列)
; ※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 SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO
    #field GUID DeviceGuid
    #field int DeviceNumber
    #field _Flags_e__Struct Flags
    #field int64 DeviceSize
#endstruct

#defstruct global SCM_BUS_DEDICATED_MEMORY_DEVICES_INFO
    #field int Version
    #field int Size
    #field int DeviceCount
    #field SCM_BUS_DEDICATED_MEMORY_DEVICE_INFO Devices 1
#endstruct

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