ホーム › Media.Audio › ACMDRVOPENDESCW
ACMDRVOPENDESCW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbStruct | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で示す。 |
| fccType | DWORD | 4 | +4 | +4 | ドライバーの種別を示すFOURCCコード。通常はオーディオを表す。 |
| fccComp | DWORD | 4 | +8 | +8 | 圧縮種別を示すFOURCCコード。将来用に予約される場合がある。 |
| dwVersion | DWORD | 4 | +12 | +12 | ACMドライバーのバージョン番号を示す。 |
| dwFlags | DWORD | 4 | +16 | +16 | ドライバーオープン時のフラグを示す。 |
| dwError | DWORD | 4 | +20 | +20 | ドライバーが返すエラーコードを格納する。 |
| pszSectionName | LPWSTR | 8/4 | +24 | +24 | 設定セクション名(Unicode)へのポインター。NULL可。 |
| pszAliasName | LPWSTR | 8/4 | +32 | +28 | ドライバーエイリアス名(Unicode)へのポインター。NULL可。 |
| dnDevNode | DWORD | 4 | +40 | +32 | 関連するデバイスノード識別子を示す。 |
各言語での定義
#include <windows.h>
// ACMDRVOPENDESCW (x64 44 / x86 36 バイト)
#pragma pack(push, 1)
typedef struct ACMDRVOPENDESCW {
DWORD cbStruct;
DWORD fccType;
DWORD fccComp;
DWORD dwVersion;
DWORD dwFlags;
DWORD dwError;
LPWSTR pszSectionName;
LPWSTR pszAliasName;
DWORD dnDevNode;
} ACMDRVOPENDESCW;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct ACMDRVOPENDESCW
{
public uint cbStruct;
public uint fccType;
public uint fccComp;
public uint dwVersion;
public uint dwFlags;
public uint dwError;
public IntPtr pszSectionName;
public IntPtr pszAliasName;
public uint dnDevNode;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure ACMDRVOPENDESCW
Public cbStruct As UInteger
Public fccType As UInteger
Public fccComp As UInteger
Public dwVersion As UInteger
Public dwFlags As UInteger
Public dwError As UInteger
Public pszSectionName As IntPtr
Public pszAliasName As IntPtr
Public dnDevNode As UInteger
End Structureimport ctypes
from ctypes import wintypes
class ACMDRVOPENDESCW(ctypes.Structure):
_pack_ = 1
_fields_ = [
("cbStruct", wintypes.DWORD),
("fccType", wintypes.DWORD),
("fccComp", wintypes.DWORD),
("dwVersion", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("dwError", wintypes.DWORD),
("pszSectionName", ctypes.c_void_p),
("pszAliasName", ctypes.c_void_p),
("dnDevNode", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct ACMDRVOPENDESCW {
pub cbStruct: u32,
pub fccType: u32,
pub fccComp: u32,
pub dwVersion: u32,
pub dwFlags: u32,
pub dwError: u32,
pub pszSectionName: *mut core::ffi::c_void,
pub pszAliasName: *mut core::ffi::c_void,
pub dnDevNode: u32,
}import "golang.org/x/sys/windows"
type ACMDRVOPENDESCW struct {
cbStruct uint32
fccType uint32
fccComp uint32
dwVersion uint32
dwFlags uint32
dwError uint32
pszSectionName uintptr
pszAliasName uintptr
dnDevNode uint32
}type
ACMDRVOPENDESCW = packed record
cbStruct: DWORD;
fccType: DWORD;
fccComp: DWORD;
dwVersion: DWORD;
dwFlags: DWORD;
dwError: DWORD;
pszSectionName: Pointer;
pszAliasName: Pointer;
dnDevNode: DWORD;
end;const ACMDRVOPENDESCW = extern struct {
cbStruct: u32,
fccType: u32,
fccComp: u32,
dwVersion: u32,
dwFlags: u32,
dwError: u32,
pszSectionName: ?*anyopaque,
pszAliasName: ?*anyopaque,
dnDevNode: u32,
};type
ACMDRVOPENDESCW {.packed.} = object
cbStruct: uint32
fccType: uint32
fccComp: uint32
dwVersion: uint32
dwFlags: uint32
dwError: uint32
pszSectionName: pointer
pszAliasName: pointer
dnDevNode: uint32align(1)
struct ACMDRVOPENDESCW
{
uint cbStruct;
uint fccType;
uint fccComp;
uint dwVersion;
uint dwFlags;
uint dwError;
void* pszSectionName;
void* pszAliasName;
uint dnDevNode;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; ACMDRVOPENDESCW サイズ: 36 バイト(x86)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fccType : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fccComp : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwVersion : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwFlags : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwError : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pszSectionName : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; pszAliasName : LPWSTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dnDevNode : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ACMDRVOPENDESCW サイズ: 44 バイト(x64)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; fccType : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; fccComp : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwVersion : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwFlags : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwError : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pszSectionName : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pszAliasName : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; dnDevNode : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global ACMDRVOPENDESCW, pack=1
#field int cbStruct
#field int fccType
#field int fccComp
#field int dwVersion
#field int dwFlags
#field int dwError
#field intptr pszSectionName
#field intptr pszAliasName
#field int dnDevNode
#endstruct
stdim st, ACMDRVOPENDESCW ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct