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+12現在の呼状態(発信中/接続済等)を示す値。
dwCallStateModeDWORD4+16+16呼状態に付随する詳細モードを示す値。
dwCallPrivilegeDWORD4+20+20この呼に対するアプリの権限(所有/監視)を示す値。
dwCallFeaturesDWORD4+24+24現在この呼で実行可能な操作を示すフラグ。
dwDevSpecificSizeDWORD4+28+28デバイス固有情報のサイズをバイトで表す。
dwDevSpecificOffsetDWORD4+32+32デバイス固有情報までのオフセットをバイトで表す。
dwCallFeatures2DWORD4+36+36実行可能な追加の呼操作を示すフラグ。
tStateEntryTimeSYSTEMTIME16+40+40現在の呼状態に入った日時を表すSYSTEMTIME(UTC)。

各言語での定義

#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