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

MCI_SYSINFO_PARMSA

構造体
サイズx64: 28 バイト / x86: 20 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
dwCallbackUINT_PTR8/4+0+0完了通知用のコールバック情報。下位ワードに通知先ウィンドウハンドルを格納する。
lpstrReturnLPSTR8/4+8+4システム情報文字列を受け取るANSIバッファへのポインタ。
dwRetSizeDWORD4+16+8lpstrReturnバッファのサイズ。文字数(バイト)で指定する。
dwNumberDWORD4+20+12対象デバイスの序数。何番目のデバイスかを示す。
wDeviceTypeDWORD4+24+16対象とするMCIデバイスタイプ。問い合わせ範囲を限定する。

各言語での定義

#include <windows.h>

// MCI_SYSINFO_PARMSA  (x64 28 / x86 20 バイト)
#pragma pack(push, 1)
typedef struct MCI_SYSINFO_PARMSA {
    UINT_PTR dwCallback;
    LPSTR lpstrReturn;
    DWORD dwRetSize;
    DWORD dwNumber;
    DWORD wDeviceType;
} MCI_SYSINFO_PARMSA;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct MCI_SYSINFO_PARMSA
{
    public UIntPtr dwCallback;
    public IntPtr lpstrReturn;
    public uint dwRetSize;
    public uint dwNumber;
    public uint wDeviceType;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure MCI_SYSINFO_PARMSA
    Public dwCallback As UIntPtr
    Public lpstrReturn As IntPtr
    Public dwRetSize As UInteger
    Public dwNumber As UInteger
    Public wDeviceType As UInteger
End Structure
import ctypes
from ctypes import wintypes

class MCI_SYSINFO_PARMSA(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("dwCallback", ctypes.c_size_t),
        ("lpstrReturn", ctypes.c_void_p),
        ("dwRetSize", wintypes.DWORD),
        ("dwNumber", wintypes.DWORD),
        ("wDeviceType", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct MCI_SYSINFO_PARMSA {
    pub dwCallback: usize,
    pub lpstrReturn: *mut core::ffi::c_void,
    pub dwRetSize: u32,
    pub dwNumber: u32,
    pub wDeviceType: u32,
}
import "golang.org/x/sys/windows"

type MCI_SYSINFO_PARMSA struct {
	dwCallback uintptr
	lpstrReturn uintptr
	dwRetSize uint32
	dwNumber uint32
	wDeviceType uint32
}
type
  MCI_SYSINFO_PARMSA = packed record
    dwCallback: NativeUInt;
    lpstrReturn: Pointer;
    dwRetSize: DWORD;
    dwNumber: DWORD;
    wDeviceType: DWORD;
  end;
const MCI_SYSINFO_PARMSA = extern struct {
    dwCallback: usize,
    lpstrReturn: ?*anyopaque,
    dwRetSize: u32,
    dwNumber: u32,
    wDeviceType: u32,
};
type
  MCI_SYSINFO_PARMSA {.packed.} = object
    dwCallback: uint
    lpstrReturn: pointer
    dwRetSize: uint32
    dwNumber: uint32
    wDeviceType: uint32
align(1)
struct MCI_SYSINFO_PARMSA
{
    size_t dwCallback;
    void* lpstrReturn;
    uint dwRetSize;
    uint dwNumber;
    uint wDeviceType;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; MCI_SYSINFO_PARMSA サイズ: 20 バイト(x86)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; dwCallback : UINT_PTR (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; lpstrReturn : LPSTR (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwRetSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwNumber : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; wDeviceType : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MCI_SYSINFO_PARMSA サイズ: 28 バイト(x64)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; dwCallback : UINT_PTR (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; lpstrReturn : LPSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; dwRetSize : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwNumber : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; wDeviceType : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MCI_SYSINFO_PARMSA, pack=1
    #field intptr dwCallback
    #field intptr lpstrReturn
    #field int dwRetSize
    #field int dwNumber
    #field int wDeviceType
#endstruct

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