Win32 API 日本語リファレンス
ホームDevices.Communication › MODEMSETTINGS

MODEMSETTINGS

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

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

フィールド

フィールドサイズx64x86説明
dwActualSizeDWORD4+0+0この構造体の実際のバイト単位サイズを示す。
dwRequiredSizeDWORD4+4+4全データ格納に必要なバイト単位サイズを示す。
dwDevSpecificOffsetDWORD4+8+8デバイス固有データへのオフセットを示す。
dwDevSpecificSizeDWORD4+12+12デバイス固有データのバイト単位サイズを示す。
dwCallSetupFailTimerDWORD4+16+16通話確立失敗までの待機時間を秒単位で示す。
dwInactivityTimeoutDWORD4+20+20無通信切断までの待機時間を秒単位で示す。
dwSpeakerVolumeMODEM_SPEAKER_VOLUME4+24+24設定するスピーカー音量レベルを示す列挙値。
dwSpeakerModeMODEMSETTINGS_SPEAKER_MODE4+28+28設定するスピーカーモードを示すフラグ。
dwPreferredModemOptionsDWORD4+32+32優先するモデムオプションを示すフラグ。
dwNegotiatedModemOptionsDWORD4+36+36実際に交渉成立したモデムオプションを示すフラグ。
dwNegotiatedDCERateDWORD4+40+40交渉成立したDCE(回線)側通信速度をbps単位で示す。
abVariablePortionBYTE1+44+44可変長デバイス固有データ部の先頭。

各言語での定義

#include <windows.h>

// MODEMSETTINGS  (x64 48 / x86 48 バイト)
typedef struct MODEMSETTINGS {
    DWORD dwActualSize;
    DWORD dwRequiredSize;
    DWORD dwDevSpecificOffset;
    DWORD dwDevSpecificSize;
    DWORD dwCallSetupFailTimer;
    DWORD dwInactivityTimeout;
    MODEM_SPEAKER_VOLUME dwSpeakerVolume;
    MODEMSETTINGS_SPEAKER_MODE dwSpeakerMode;
    DWORD dwPreferredModemOptions;
    DWORD dwNegotiatedModemOptions;
    DWORD dwNegotiatedDCERate;
    BYTE abVariablePortion[1];
} MODEMSETTINGS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MODEMSETTINGS
{
    public uint dwActualSize;
    public uint dwRequiredSize;
    public uint dwDevSpecificOffset;
    public uint dwDevSpecificSize;
    public uint dwCallSetupFailTimer;
    public uint dwInactivityTimeout;
    public uint dwSpeakerVolume;
    public uint dwSpeakerMode;
    public uint dwPreferredModemOptions;
    public uint dwNegotiatedModemOptions;
    public uint dwNegotiatedDCERate;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] abVariablePortion;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MODEMSETTINGS
    Public dwActualSize As UInteger
    Public dwRequiredSize As UInteger
    Public dwDevSpecificOffset As UInteger
    Public dwDevSpecificSize As UInteger
    Public dwCallSetupFailTimer As UInteger
    Public dwInactivityTimeout As UInteger
    Public dwSpeakerVolume As UInteger
    Public dwSpeakerMode As UInteger
    Public dwPreferredModemOptions As UInteger
    Public dwNegotiatedModemOptions As UInteger
    Public dwNegotiatedDCERate As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public abVariablePortion() As Byte
End Structure
import ctypes
from ctypes import wintypes

class MODEMSETTINGS(ctypes.Structure):
    _fields_ = [
        ("dwActualSize", wintypes.DWORD),
        ("dwRequiredSize", wintypes.DWORD),
        ("dwDevSpecificOffset", wintypes.DWORD),
        ("dwDevSpecificSize", wintypes.DWORD),
        ("dwCallSetupFailTimer", wintypes.DWORD),
        ("dwInactivityTimeout", wintypes.DWORD),
        ("dwSpeakerVolume", wintypes.DWORD),
        ("dwSpeakerMode", wintypes.DWORD),
        ("dwPreferredModemOptions", wintypes.DWORD),
        ("dwNegotiatedModemOptions", wintypes.DWORD),
        ("dwNegotiatedDCERate", wintypes.DWORD),
        ("abVariablePortion", ctypes.c_ubyte * 1),
    ]
#[repr(C)]
pub struct MODEMSETTINGS {
    pub dwActualSize: u32,
    pub dwRequiredSize: u32,
    pub dwDevSpecificOffset: u32,
    pub dwDevSpecificSize: u32,
    pub dwCallSetupFailTimer: u32,
    pub dwInactivityTimeout: u32,
    pub dwSpeakerVolume: u32,
    pub dwSpeakerMode: u32,
    pub dwPreferredModemOptions: u32,
    pub dwNegotiatedModemOptions: u32,
    pub dwNegotiatedDCERate: u32,
    pub abVariablePortion: [u8; 1],
}
import "golang.org/x/sys/windows"

type MODEMSETTINGS struct {
	dwActualSize uint32
	dwRequiredSize uint32
	dwDevSpecificOffset uint32
	dwDevSpecificSize uint32
	dwCallSetupFailTimer uint32
	dwInactivityTimeout uint32
	dwSpeakerVolume uint32
	dwSpeakerMode uint32
	dwPreferredModemOptions uint32
	dwNegotiatedModemOptions uint32
	dwNegotiatedDCERate uint32
	abVariablePortion [1]byte
}
type
  MODEMSETTINGS = record
    dwActualSize: DWORD;
    dwRequiredSize: DWORD;
    dwDevSpecificOffset: DWORD;
    dwDevSpecificSize: DWORD;
    dwCallSetupFailTimer: DWORD;
    dwInactivityTimeout: DWORD;
    dwSpeakerVolume: DWORD;
    dwSpeakerMode: DWORD;
    dwPreferredModemOptions: DWORD;
    dwNegotiatedModemOptions: DWORD;
    dwNegotiatedDCERate: DWORD;
    abVariablePortion: array[0..0] of Byte;
  end;
const MODEMSETTINGS = extern struct {
    dwActualSize: u32,
    dwRequiredSize: u32,
    dwDevSpecificOffset: u32,
    dwDevSpecificSize: u32,
    dwCallSetupFailTimer: u32,
    dwInactivityTimeout: u32,
    dwSpeakerVolume: u32,
    dwSpeakerMode: u32,
    dwPreferredModemOptions: u32,
    dwNegotiatedModemOptions: u32,
    dwNegotiatedDCERate: u32,
    abVariablePortion: [1]u8,
};
type
  MODEMSETTINGS {.bycopy.} = object
    dwActualSize: uint32
    dwRequiredSize: uint32
    dwDevSpecificOffset: uint32
    dwDevSpecificSize: uint32
    dwCallSetupFailTimer: uint32
    dwInactivityTimeout: uint32
    dwSpeakerVolume: uint32
    dwSpeakerMode: uint32
    dwPreferredModemOptions: uint32
    dwNegotiatedModemOptions: uint32
    dwNegotiatedDCERate: uint32
    abVariablePortion: array[1, uint8]
struct MODEMSETTINGS
{
    uint dwActualSize;
    uint dwRequiredSize;
    uint dwDevSpecificOffset;
    uint dwDevSpecificSize;
    uint dwCallSetupFailTimer;
    uint dwInactivityTimeout;
    uint dwSpeakerVolume;
    uint dwSpeakerMode;
    uint dwPreferredModemOptions;
    uint dwNegotiatedModemOptions;
    uint dwNegotiatedDCERate;
    ubyte[1] abVariablePortion;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MODEMSETTINGS サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwActualSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwRequiredSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwDevSpecificOffset : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwDevSpecificSize : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwCallSetupFailTimer : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwInactivityTimeout : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwSpeakerVolume : MODEM_SPEAKER_VOLUME (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwSpeakerMode : MODEMSETTINGS_SPEAKER_MODE (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dwPreferredModemOptions : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dwNegotiatedModemOptions : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwNegotiatedDCERate : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; abVariablePortion : BYTE (+44, 1byte)  varptr(st)+44 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MODEMSETTINGS
    #field int dwActualSize
    #field int dwRequiredSize
    #field int dwDevSpecificOffset
    #field int dwDevSpecificSize
    #field int dwCallSetupFailTimer
    #field int dwInactivityTimeout
    #field int dwSpeakerVolume
    #field int dwSpeakerMode
    #field int dwPreferredModemOptions
    #field int dwNegotiatedModemOptions
    #field int dwNegotiatedDCERate
    #field byte abVariablePortion 1
#endstruct

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