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

LINECALLSTATUS

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

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

フィールド

フィールドサイズx64x86説明
dwTotalSizeDWORD4+0+0このデータ構造体に割り当てられた合計サイズ (バイト単位)。
dwNeededSizeDWORD4+4+4返されるすべての情報を格納するために必要な、このデータ構造体のサイズ (バイト単位)。
dwUsedSizeDWORD4+8+8このデータ構造体のうち、有用な情報が含まれている部分のサイズ (バイト単位)。
dwCallStateDWORD4+12+12LINECALLSTATE_ 定数 のいずれかで表される、その通話の現在の通話状態。
dwCallStateModeDWORD4+16+16

dwCallStateMode メンバーの解釈は、通話状態によって異なります。多くの場合、値は 0 になります。次の表は、指定された dwCallState の値に対応する dwCallStateMode の種類を示しています。

dwCallState 説明
LINECALLSTATE_BUSY

LINEBUSYMODE_ 定数

LINECALLSTATE_CONNECTED

LINECONNECTEDMODE_ 定数

LINECALLSTATE_DIALTONE

LINEDIALTONEMODE_ 定数

LINECALLSTATE_DISCONNECTED

LINEDISCONNECTMODE_ 定数

LINECALLSTATE_OFFERING

LINEOFFERINGMODE_ 定数

LINECALLSTATE_SPECIALINFO

LINESPECIALINFO_ 定数

dwCallPrivilegeDWORD4+20+20この通話に対するアプリケーションの権限。このメンバーは LINECALLPRIVILEGE_ 定数 の 1 つ以上を使用します。
dwCallFeaturesDWORD4+24+24デバイス機能におけるその機能の利用可否、現在の通話状態、および呼び出し元アプリケーションの通話所有権を踏まえて、その通話に対して呼び出すことができるテレフォニー API 関数を示すフラグ。0 は、現在の状態にあるその通話に対して該当する機能をアプリケーションが呼び出せないことを示し、1 は呼び出せることを示します。このメンバーは LINECALLFEATURE_ 定数 を使用します。
dwDevSpecificSizeDWORD4+28+28デバイス固有フィールドのサイズ (バイト単位)。
dwDevSpecificOffsetDWORD4+32+32構造体の先頭から、可変サイズのデバイス固有フィールドまでのオフセット。このフィールドのサイズは dwDevSpecificOffset で指定されます。
dwCallFeatures2DWORD4+36+36デバイス機能におけるその機能の利用可否、現在の通話状態、および呼び出し元アプリケーションの通話所有権を踏まえて、その通話に対して呼び出すことができる追加の関数を示します。dwCallFeatures メンバーの拡張です。このメンバーは LINECALLFEATURE2_ 定数 を使用します。
tStateEntryTimeSYSTEMTIME16+40+40現在の通話状態に移行した協定世界時 (UTC)。

公式ドキュメント

LINECALLSTATUS 構造体は、通話の現在の状態を記述します。この構造体に含まれる情報は、アドレスのデバイス機能、呼び出し元アプリケーションによる通話の所有権、および照会対象の通話の現在の状態によって異なります。 lineGetCallStatus 関数および TSPI_lineGetCallStatus 関数は、 LINECALLSTATUS 構造体を返します。

解説(Remarks)

デバイス固有の拡張には、このデータ構造体の DevSpecific (dwDevSpecificSize および dwDevSpecificOffset) の可変サイズ領域を使用してください。

通話の通話状態が変化するたびに、アプリケーションには LINE_CALLSTATE メッセージが送信されます。このメッセージが提供するのは、その通話の新しい通話状態のみです。通話に関するその他の状態情報は、 lineGetCallStatus で取得できます。

dwCallFeatures2 メンバーと tStateEntryTime メンバーは、API バージョン 2.0 以降で回線デバイスを開いたアプリケーションでのみ使用できます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// SYSTEMTIME  (x64 16 / x86 16 バイト)
typedef struct SYSTEMTIME {
    WORD wYear;
    WORD wMonth;
    WORD wDayOfWeek;
    WORD wDay;
    WORD wHour;
    WORD wMinute;
    WORD wSecond;
    WORD wMilliseconds;
} SYSTEMTIME;

// LINECALLSTATUS  (x64 56 / x86 56 バイト)
#pragma pack(push, 1)
typedef struct LINECALLSTATUS {
    DWORD dwTotalSize;
    DWORD dwNeededSize;
    DWORD dwUsedSize;
    DWORD dwCallState;
    DWORD dwCallStateMode;
    DWORD dwCallPrivilege;
    DWORD dwCallFeatures;
    DWORD dwDevSpecificSize;
    DWORD dwDevSpecificOffset;
    DWORD dwCallFeatures2;
    SYSTEMTIME tStateEntryTime;
} LINECALLSTATUS;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYSTEMTIME
{
    public ushort wYear;
    public ushort wMonth;
    public ushort wDayOfWeek;
    public ushort wDay;
    public ushort wHour;
    public ushort wMinute;
    public ushort wSecond;
    public ushort wMilliseconds;
}

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINECALLSTATUS
{
    public uint dwTotalSize;
    public uint dwNeededSize;
    public uint dwUsedSize;
    public uint dwCallState;
    public uint dwCallStateMode;
    public uint dwCallPrivilege;
    public uint dwCallFeatures;
    public uint dwDevSpecificSize;
    public uint dwDevSpecificOffset;
    public uint dwCallFeatures2;
    public SYSTEMTIME tStateEntryTime;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYSTEMTIME
    Public wYear As UShort
    Public wMonth As UShort
    Public wDayOfWeek As UShort
    Public wDay As UShort
    Public wHour As UShort
    Public wMinute As UShort
    Public wSecond As UShort
    Public wMilliseconds As UShort
End Structure

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINECALLSTATUS
    Public dwTotalSize As UInteger
    Public dwNeededSize As UInteger
    Public dwUsedSize As UInteger
    Public dwCallState As UInteger
    Public dwCallStateMode As UInteger
    Public dwCallPrivilege As UInteger
    Public dwCallFeatures As UInteger
    Public dwDevSpecificSize As UInteger
    Public dwDevSpecificOffset As UInteger
    Public dwCallFeatures2 As UInteger
    Public tStateEntryTime As SYSTEMTIME
End Structure
import ctypes
from ctypes import wintypes

class SYSTEMTIME(ctypes.Structure):
    _fields_ = [
        ("wYear", ctypes.c_ushort),
        ("wMonth", ctypes.c_ushort),
        ("wDayOfWeek", ctypes.c_ushort),
        ("wDay", ctypes.c_ushort),
        ("wHour", ctypes.c_ushort),
        ("wMinute", ctypes.c_ushort),
        ("wSecond", ctypes.c_ushort),
        ("wMilliseconds", ctypes.c_ushort),
    ]

class LINECALLSTATUS(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("dwTotalSize", wintypes.DWORD),
        ("dwNeededSize", wintypes.DWORD),
        ("dwUsedSize", wintypes.DWORD),
        ("dwCallState", wintypes.DWORD),
        ("dwCallStateMode", wintypes.DWORD),
        ("dwCallPrivilege", wintypes.DWORD),
        ("dwCallFeatures", wintypes.DWORD),
        ("dwDevSpecificSize", wintypes.DWORD),
        ("dwDevSpecificOffset", wintypes.DWORD),
        ("dwCallFeatures2", wintypes.DWORD),
        ("tStateEntryTime", SYSTEMTIME),
    ]
#[repr(C)]
pub struct SYSTEMTIME {
    pub wYear: u16,
    pub wMonth: u16,
    pub wDayOfWeek: u16,
    pub wDay: u16,
    pub wHour: u16,
    pub wMinute: u16,
    pub wSecond: u16,
    pub wMilliseconds: u16,
}

#[repr(C, packed(1))]
pub struct LINECALLSTATUS {
    pub dwTotalSize: u32,
    pub dwNeededSize: u32,
    pub dwUsedSize: u32,
    pub dwCallState: u32,
    pub dwCallStateMode: u32,
    pub dwCallPrivilege: u32,
    pub dwCallFeatures: u32,
    pub dwDevSpecificSize: u32,
    pub dwDevSpecificOffset: u32,
    pub dwCallFeatures2: u32,
    pub tStateEntryTime: SYSTEMTIME,
}
import "golang.org/x/sys/windows"

type SYSTEMTIME struct {
	wYear uint16
	wMonth uint16
	wDayOfWeek uint16
	wDay uint16
	wHour uint16
	wMinute uint16
	wSecond uint16
	wMilliseconds uint16
}

type LINECALLSTATUS struct {
	dwTotalSize uint32
	dwNeededSize uint32
	dwUsedSize uint32
	dwCallState uint32
	dwCallStateMode uint32
	dwCallPrivilege uint32
	dwCallFeatures uint32
	dwDevSpecificSize uint32
	dwDevSpecificOffset uint32
	dwCallFeatures2 uint32
	tStateEntryTime SYSTEMTIME
}
type
  SYSTEMTIME = record
    wYear: Word;
    wMonth: Word;
    wDayOfWeek: Word;
    wDay: Word;
    wHour: Word;
    wMinute: Word;
    wSecond: Word;
    wMilliseconds: Word;
  end;

  LINECALLSTATUS = packed record
    dwTotalSize: DWORD;
    dwNeededSize: DWORD;
    dwUsedSize: DWORD;
    dwCallState: DWORD;
    dwCallStateMode: DWORD;
    dwCallPrivilege: DWORD;
    dwCallFeatures: DWORD;
    dwDevSpecificSize: DWORD;
    dwDevSpecificOffset: DWORD;
    dwCallFeatures2: DWORD;
    tStateEntryTime: SYSTEMTIME;
  end;
const SYSTEMTIME = extern struct {
    wYear: u16,
    wMonth: u16,
    wDayOfWeek: u16,
    wDay: u16,
    wHour: u16,
    wMinute: u16,
    wSecond: u16,
    wMilliseconds: u16,
};

const LINECALLSTATUS = extern struct {
    dwTotalSize: u32,
    dwNeededSize: u32,
    dwUsedSize: u32,
    dwCallState: u32,
    dwCallStateMode: u32,
    dwCallPrivilege: u32,
    dwCallFeatures: u32,
    dwDevSpecificSize: u32,
    dwDevSpecificOffset: u32,
    dwCallFeatures2: u32,
    tStateEntryTime: SYSTEMTIME,
};
type
  SYSTEMTIME {.bycopy.} = object
    wYear: uint16
    wMonth: uint16
    wDayOfWeek: uint16
    wDay: uint16
    wHour: uint16
    wMinute: uint16
    wSecond: uint16
    wMilliseconds: uint16

  LINECALLSTATUS {.packed.} = object
    dwTotalSize: uint32
    dwNeededSize: uint32
    dwUsedSize: uint32
    dwCallState: uint32
    dwCallStateMode: uint32
    dwCallPrivilege: uint32
    dwCallFeatures: uint32
    dwDevSpecificSize: uint32
    dwDevSpecificOffset: uint32
    dwCallFeatures2: uint32
    tStateEntryTime: SYSTEMTIME
struct SYSTEMTIME
{
    ushort wYear;
    ushort wMonth;
    ushort wDayOfWeek;
    ushort wDay;
    ushort wHour;
    ushort wMinute;
    ushort wSecond;
    ushort wMilliseconds;
}

align(1)
struct LINECALLSTATUS
{
    uint dwTotalSize;
    uint dwNeededSize;
    uint dwUsedSize;
    uint dwCallState;
    uint dwCallStateMode;
    uint dwCallPrivilege;
    uint dwCallFeatures;
    uint dwDevSpecificSize;
    uint dwDevSpecificOffset;
    uint dwCallFeatures2;
    SYSTEMTIME tStateEntryTime;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINECALLSTATUS サイズ: 56 バイト(x64)
dim st, 14    ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; dwTotalSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwNeededSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwUsedSize : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwCallState : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwCallStateMode : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwCallPrivilege : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwCallFeatures : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwDevSpecificSize : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dwDevSpecificOffset : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dwCallFeatures2 : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; tStateEntryTime : SYSTEMTIME (+40, 16byte)  varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SYSTEMTIME
    #field short wYear
    #field short wMonth
    #field short wDayOfWeek
    #field short wDay
    #field short wHour
    #field short wMinute
    #field short wSecond
    #field short wMilliseconds
#endstruct

#defstruct global LINECALLSTATUS, pack=1
    #field int dwTotalSize
    #field int dwNeededSize
    #field int dwUsedSize
    #field int dwCallState
    #field int dwCallStateMode
    #field int dwCallPrivilege
    #field int dwCallFeatures
    #field int dwDevSpecificSize
    #field int dwDevSpecificOffset
    #field int dwCallFeatures2
    #field SYSTEMTIME tStateEntryTime
#endstruct

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