MODEMSETTINGS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| dwActualSize | DWORD | 4 | +0 | +0 | アプリケーションに実際に返されたデータのサイズ (バイト単位)。アプリケーションが構造体の可変長部分に十分な領域を確保しなかった場合、このメンバーは dwRequiredSize メンバーよりも小さくなることがあります。 | ||||||||||
| dwRequiredSize | DWORD | 4 | +4 | +4 | 可変長部分を含む MODEMDEVCAPS 構造体全体に必要なバイト数です。 | ||||||||||
| dwDevSpecificOffset | DWORD | 4 | +8 | +8 | 構造体のうちプロバイダー定義部分のオフセットです。構造体の先頭からのバイト単位の相対位置で表されます。 | ||||||||||
| dwDevSpecificSize | DWORD | 4 | +12 | +12 | 構造体のうちプロバイダー定義部分のサイズ (バイト単位)。 | ||||||||||
| dwCallSetupFailTimer | DWORD | 4 | +16 | +16 | ダイヤルの完了後、モデム間の接続が確立されたことを示す通知をモデムが待機する最大秒数です。この時間内に接続が確立されない場合、呼び出しは失敗したものと見なされます。このメンバーは Hayes® 互換モデムのレジスター S7 に相当します。 | ||||||||||
| dwInactivityTimeout | DWORD | 4 | +20 | +20 | 接続の確立後に許容される、無通信状態の最大秒数です。この時間の間にデータの送信も受信も行われない場合、呼び出しは自動的に終了します。このタイムアウトは、アプリケーションが予期せず停止した場合やユーザーが離席した場合に、長距離通話料金やオンラインサービス料金が過大になるのを避けるために使用されます。 | ||||||||||
| dwSpeakerVolume | MODEM_SPEAKER_VOLUME | 4 | +24 | +24 | モニタースピーカーがオンのときの音量レベルです。このメンバーには次の値のいずれかを指定できます。
モデムがサポートするスピーカー音量は MODEMDEVCAPS 構造体で指定されます。実際の音量はハードウェアに依存します。 | ||||||||||
| dwSpeakerMode | MODEMSETTINGS_SPEAKER_MODE | 4 | +28 | +28 | スピーカーのモードです。このメンバーには次の値のいずれかを指定できます。
| ||||||||||
| dwPreferredModemOptions | DWORD | 4 | +32 | +32 | アプリケーションが要求するモデムオプションです。モデムオプションは呼び出しのセットアップ時にローカルモデムとリモートモデムの間でネゴシエートされます。このメンバーは、ローカルモデムの初期のネゴシエーション条件を指定します。 ローカルモデムがサポートするモデムオプションは、 MODEMDEVCAPS 構造体の dwModemOptions メンバーで指定されます。モデムオプションの一覧については、 MODEMDEVCAPS 構造体の説明を参照してください。 | ||||||||||
| dwNegotiatedModemOptions | DWORD | 4 | +36 | +36 | 実際に有効になっているモデムオプションです。このメンバーは、接続が確立され、ローカルモデムとリモートモデムがモデムオプションをネゴシエートした後に設定されます。 ローカルモデムがサポートするモデムオプションは、 MODEMDEVCAPS 構造体の dwModemOptions メンバーで指定されます。モデムオプションの一覧については、 MODEMDEVCAPS 構造体の説明を参照してください。 | ||||||||||
| dwNegotiatedDCERate | DWORD | 4 | +40 | +40 | 有効になっている DCE レートです。このメンバーは、接続が確立され、ローカルモデムとリモートモデムが変調方式をネゴシエートした後に設定されます。 | ||||||||||
| abVariablePortion | BYTE | 1 | +44 | +44 | 省略可能な、プロバイダー定義の情報です。 |
公式ドキュメント
モデムの構成に関する情報を格納します。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#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 Structureimport 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