Win32 API 日本語リファレンス
ホームMedia.Audio.Apo › APOInitSystemEffects

APOInitSystemEffects

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

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

フィールド

フィールドサイズx64x86説明
APOInitAPOInitBaseStruct20+0+0基本の初期化情報を保持するAPOInitBaseStruct。
pAPOEndpointPropertiesIPropertyStore*8/4+24+20エンドポイントプロパティストアへのポインター(IPropertyStore)。
pAPOSystemEffectsPropertiesIPropertyStore*8/4+32+24システムエフェクトプロパティストアへのポインター。
pReservedvoid*8/4+40+28予約フィールド。NULLを設定する。
pDeviceCollectionIMMDeviceCollection*8/4+48+32対象デバイスコレクションへのポインター(IMMDeviceCollection)。

各言語での定義

#include <windows.h>

// APOInitBaseStruct  (x64 20 / x86 20 バイト)
typedef struct APOInitBaseStruct {
    DWORD cbSize;
    GUID clsid;
} APOInitBaseStruct;

// APOInitSystemEffects  (x64 56 / x86 36 バイト)
typedef struct APOInitSystemEffects {
    APOInitBaseStruct APOInit;
    IPropertyStore* pAPOEndpointProperties;
    IPropertyStore* pAPOSystemEffectsProperties;
    void* pReserved;
    IMMDeviceCollection* pDeviceCollection;
} APOInitSystemEffects;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct APOInitBaseStruct
{
    public uint cbSize;
    public Guid clsid;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct APOInitSystemEffects
{
    public APOInitBaseStruct APOInit;
    public IntPtr pAPOEndpointProperties;
    public IntPtr pAPOSystemEffectsProperties;
    public IntPtr pReserved;
    public IntPtr pDeviceCollection;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure APOInitBaseStruct
    Public cbSize As UInteger
    Public clsid As Guid
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure APOInitSystemEffects
    Public APOInit As APOInitBaseStruct
    Public pAPOEndpointProperties As IntPtr
    Public pAPOSystemEffectsProperties As IntPtr
    Public pReserved As IntPtr
    Public pDeviceCollection As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class APOInitBaseStruct(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("clsid", GUID),
    ]

class APOInitSystemEffects(ctypes.Structure):
    _fields_ = [
        ("APOInit", APOInitBaseStruct),
        ("pAPOEndpointProperties", ctypes.c_void_p),
        ("pAPOSystemEffectsProperties", ctypes.c_void_p),
        ("pReserved", ctypes.c_void_p),
        ("pDeviceCollection", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct APOInitBaseStruct {
    pub cbSize: u32,
    pub clsid: GUID,
}

#[repr(C)]
pub struct APOInitSystemEffects {
    pub APOInit: APOInitBaseStruct,
    pub pAPOEndpointProperties: *mut core::ffi::c_void,
    pub pAPOSystemEffectsProperties: *mut core::ffi::c_void,
    pub pReserved: *mut core::ffi::c_void,
    pub pDeviceCollection: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type APOInitBaseStruct struct {
	cbSize uint32
	clsid windows.GUID
}

type APOInitSystemEffects struct {
	APOInit APOInitBaseStruct
	pAPOEndpointProperties uintptr
	pAPOSystemEffectsProperties uintptr
	pReserved uintptr
	pDeviceCollection uintptr
}
type
  APOInitBaseStruct = record
    cbSize: DWORD;
    clsid: TGUID;
  end;

  APOInitSystemEffects = record
    APOInit: APOInitBaseStruct;
    pAPOEndpointProperties: Pointer;
    pAPOSystemEffectsProperties: Pointer;
    pReserved: Pointer;
    pDeviceCollection: Pointer;
  end;
const APOInitBaseStruct = extern struct {
    cbSize: u32,
    clsid: GUID,
};

const APOInitSystemEffects = extern struct {
    APOInit: APOInitBaseStruct,
    pAPOEndpointProperties: ?*anyopaque,
    pAPOSystemEffectsProperties: ?*anyopaque,
    pReserved: ?*anyopaque,
    pDeviceCollection: ?*anyopaque,
};
type
  APOInitBaseStruct {.bycopy.} = object
    cbSize: uint32
    clsid: GUID

  APOInitSystemEffects {.bycopy.} = object
    APOInit: APOInitBaseStruct
    pAPOEndpointProperties: pointer
    pAPOSystemEffectsProperties: pointer
    pReserved: pointer
    pDeviceCollection: pointer
struct APOInitBaseStruct
{
    uint cbSize;
    GUID clsid;
}

struct APOInitSystemEffects
{
    APOInitBaseStruct APOInit;
    void* pAPOEndpointProperties;
    void* pAPOSystemEffectsProperties;
    void* pReserved;
    void* pDeviceCollection;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; APOInitSystemEffects サイズ: 36 バイト(x86)
dim st, 9    ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; APOInit : APOInitBaseStruct (+0, 20byte)  varptr(st)+0 を基点に操作(20byte:入れ子/配列)
; pAPOEndpointProperties : IPropertyStore* (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; pAPOSystemEffectsProperties : IPropertyStore* (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; pReserved : void* (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; pDeviceCollection : IMMDeviceCollection* (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; APOInitSystemEffects サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; APOInit : APOInitBaseStruct (+0, 20byte)  varptr(st)+0 を基点に操作(20byte:入れ子/配列)
; pAPOEndpointProperties : IPropertyStore* (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pAPOSystemEffectsProperties : IPropertyStore* (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pReserved : void* (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; pDeviceCollection : IMMDeviceCollection* (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; ※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 APOInitBaseStruct
    #field int cbSize
    #field GUID clsid
#endstruct

#defstruct global APOInitSystemEffects
    #field APOInitBaseStruct APOInit
    #field intptr pAPOEndpointProperties
    #field intptr pAPOSystemEffectsProperties
    #field intptr pReserved
    #field intptr pDeviceCollection
#endstruct

stdim st, APOInitSystemEffects        ; NSTRUCT 変数を確保