Win32 API 日本語リファレンス
ホームMedia.DeviceManager › WMDM_PROP_CONFIG

WMDM_PROP_CONFIG

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

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

フィールド

フィールドサイズx64x86説明
nPreferenceDWORD4+0+0この構成の優先順位を示す。値が小さいほど優先される。
nPropDescDWORD4+4+4pPropDesc配列に含まれるプロパティ記述の数を示す。
pPropDescWMDM_PROP_DESC*8/4+8+8プロパティ記述の配列を指すWMDM_PROP_DESCへのポインター。

各言語での定義

#include <windows.h>

// WMDM_PROP_CONFIG  (x64 16 / x86 12 バイト)
typedef struct WMDM_PROP_CONFIG {
    DWORD nPreference;
    DWORD nPropDesc;
    WMDM_PROP_DESC* pPropDesc;
} WMDM_PROP_CONFIG;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WMDM_PROP_CONFIG
{
    public uint nPreference;
    public uint nPropDesc;
    public IntPtr pPropDesc;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WMDM_PROP_CONFIG
    Public nPreference As UInteger
    Public nPropDesc As UInteger
    Public pPropDesc As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class WMDM_PROP_CONFIG(ctypes.Structure):
    _fields_ = [
        ("nPreference", wintypes.DWORD),
        ("nPropDesc", wintypes.DWORD),
        ("pPropDesc", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct WMDM_PROP_CONFIG {
    pub nPreference: u32,
    pub nPropDesc: u32,
    pub pPropDesc: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type WMDM_PROP_CONFIG struct {
	nPreference uint32
	nPropDesc uint32
	pPropDesc uintptr
}
type
  WMDM_PROP_CONFIG = record
    nPreference: DWORD;
    nPropDesc: DWORD;
    pPropDesc: Pointer;
  end;
const WMDM_PROP_CONFIG = extern struct {
    nPreference: u32,
    nPropDesc: u32,
    pPropDesc: ?*anyopaque,
};
type
  WMDM_PROP_CONFIG {.bycopy.} = object
    nPreference: uint32
    nPropDesc: uint32
    pPropDesc: pointer
struct WMDM_PROP_CONFIG
{
    uint nPreference;
    uint nPropDesc;
    void* pPropDesc;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; WMDM_PROP_CONFIG サイズ: 12 バイト(x86)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; nPreference : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; nPropDesc : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pPropDesc : WMDM_PROP_DESC* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WMDM_PROP_CONFIG サイズ: 16 バイト(x64)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; nPreference : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; nPropDesc : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; pPropDesc : WMDM_PROP_DESC* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WMDM_PROP_CONFIG
    #field int nPreference
    #field int nPropDesc
    #field intptr pPropDesc
#endstruct

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