LINECARDENTRY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwPermanentCardID | DWORD | 4 | +0 | +0 | カードを識別する永続的な識別子です。 |
| dwCardNameSize | DWORD | 4 | +4 | +4 | null 終端文字を含むカード名文字列のサイズ (バイト単位) です。 |
| dwCardNameOffset | DWORD | 4 | +8 | +8 | 構造体の先頭から、カードをユーザーにわかりやすい形で説明する null 終端文字列までのオフセットです。このフィールドのサイズは dwCardNameSize で指定されます。 |
| dwCardNumberDigits | DWORD | 4 | +12 | +12 | 既存のカード番号の桁数です。セキュリティ上の理由から、カード番号自体は返されません (TAPI によってスクランブルされた形式で保存されます)。アプリケーションはこの値を使用して、番号が存在することを示すために「パスワード」モードのテキストコントロールに埋め草のバイトを挿入できます。 |
| dwSameAreaRuleSize | DWORD | 4 | +16 | +16 | null 終端文字を含む同一市外局番用ダイヤル規則のサイズ (バイト単位) です。 |
| dwSameAreaRuleOffset | DWORD | 4 | +20 | +20 | LINETRANSLATECAPS 構造体の先頭から、同じ市外局番内の番号への発信用に定義されたダイヤル規則までのオフセットです。この規則は null 終端文字列です。このフィールドのサイズは dwSameAreaRuleSize で指定されます。 |
| dwLongDistanceRuleSize | DWORD | 4 | +24 | +24 | null 終端文字を含む長距離ダイヤル規則のサイズ (バイト単位) です。 |
| dwLongDistanceRuleOffset | DWORD | 4 | +28 | +28 | 構造体の先頭から、同じ国/地域内の他の地域の番号への発信用に定義されたダイヤル規則までのオフセットです。この規則は null 終端文字列です。このフィールドのサイズは dwLongDistanceRuleSize で指定されます。 |
| dwInternationalRuleSize | DWORD | 4 | +32 | +32 | null 終端文字を含む国際ダイヤル規則のサイズ (バイト単位) です。 |
| dwInternationalRuleOffset | DWORD | 4 | +36 | +36 | 構造体の先頭から、他の国/地域の番号への発信用に定義されたダイヤル規則までのオフセットです。この規則は null 終端文字列です。このフィールドのサイズは dwInternationalRuleSize で指定されます。 |
| dwOptions | DWORD | 4 | +40 | +40 | LINECARDOPTION_ 定数を使用して、このコーリングカードに関連付けられたその他の設定を示します。 |
公式ドキュメント
LINECARDENTRY 構造体は、コーリングカードを記述します。 LINETRANSLATECAPS 構造体は、 LINECARDENTRY 構造体の配列を含むことができます。
解説(Remarks)
古いアプリケーションは、これらの新しいフィールドを認識せずにコンパイルされており、新しいサイズよりも小さい SIZEOF(LINECARDENTRY) を使用します。これは LINETRANSLATECAPS 構造体の可変部分にある配列であるため、古いアプリケーションが以前に想定していた形式で LINECARDENTRY 構造体を受け取ることが不可欠です。そうでなければ、配列を正しくインデックス指定できません。アプリケーションは lineGetTranslateCaps 関数に dwAPIVersion パラメーターを渡します。TAPI はこの状況に対処する際の指針としてこのパラメーターを使用できます。 lineGetTranslateCaps 関数は、アプリケーションに返す LINETRANSLATECAPS 構造体を構築する際に、指定された API バージョンに一致する LINECARDENTRY のフィールドとサイズを使用する必要があります。
この構造体は拡張できません。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// LINECARDENTRY (x64 44 / x86 44 バイト)
#pragma pack(push, 1)
typedef struct LINECARDENTRY {
DWORD dwPermanentCardID;
DWORD dwCardNameSize;
DWORD dwCardNameOffset;
DWORD dwCardNumberDigits;
DWORD dwSameAreaRuleSize;
DWORD dwSameAreaRuleOffset;
DWORD dwLongDistanceRuleSize;
DWORD dwLongDistanceRuleOffset;
DWORD dwInternationalRuleSize;
DWORD dwInternationalRuleOffset;
DWORD dwOptions;
} LINECARDENTRY;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINECARDENTRY
{
public uint dwPermanentCardID;
public uint dwCardNameSize;
public uint dwCardNameOffset;
public uint dwCardNumberDigits;
public uint dwSameAreaRuleSize;
public uint dwSameAreaRuleOffset;
public uint dwLongDistanceRuleSize;
public uint dwLongDistanceRuleOffset;
public uint dwInternationalRuleSize;
public uint dwInternationalRuleOffset;
public uint dwOptions;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINECARDENTRY
Public dwPermanentCardID As UInteger
Public dwCardNameSize As UInteger
Public dwCardNameOffset As UInteger
Public dwCardNumberDigits As UInteger
Public dwSameAreaRuleSize As UInteger
Public dwSameAreaRuleOffset As UInteger
Public dwLongDistanceRuleSize As UInteger
Public dwLongDistanceRuleOffset As UInteger
Public dwInternationalRuleSize As UInteger
Public dwInternationalRuleOffset As UInteger
Public dwOptions As UInteger
End Structureimport ctypes
from ctypes import wintypes
class LINECARDENTRY(ctypes.Structure):
_pack_ = 1
_fields_ = [
("dwPermanentCardID", wintypes.DWORD),
("dwCardNameSize", wintypes.DWORD),
("dwCardNameOffset", wintypes.DWORD),
("dwCardNumberDigits", wintypes.DWORD),
("dwSameAreaRuleSize", wintypes.DWORD),
("dwSameAreaRuleOffset", wintypes.DWORD),
("dwLongDistanceRuleSize", wintypes.DWORD),
("dwLongDistanceRuleOffset", wintypes.DWORD),
("dwInternationalRuleSize", wintypes.DWORD),
("dwInternationalRuleOffset", wintypes.DWORD),
("dwOptions", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct LINECARDENTRY {
pub dwPermanentCardID: u32,
pub dwCardNameSize: u32,
pub dwCardNameOffset: u32,
pub dwCardNumberDigits: u32,
pub dwSameAreaRuleSize: u32,
pub dwSameAreaRuleOffset: u32,
pub dwLongDistanceRuleSize: u32,
pub dwLongDistanceRuleOffset: u32,
pub dwInternationalRuleSize: u32,
pub dwInternationalRuleOffset: u32,
pub dwOptions: u32,
}import "golang.org/x/sys/windows"
type LINECARDENTRY struct {
dwPermanentCardID uint32
dwCardNameSize uint32
dwCardNameOffset uint32
dwCardNumberDigits uint32
dwSameAreaRuleSize uint32
dwSameAreaRuleOffset uint32
dwLongDistanceRuleSize uint32
dwLongDistanceRuleOffset uint32
dwInternationalRuleSize uint32
dwInternationalRuleOffset uint32
dwOptions uint32
}type
LINECARDENTRY = packed record
dwPermanentCardID: DWORD;
dwCardNameSize: DWORD;
dwCardNameOffset: DWORD;
dwCardNumberDigits: DWORD;
dwSameAreaRuleSize: DWORD;
dwSameAreaRuleOffset: DWORD;
dwLongDistanceRuleSize: DWORD;
dwLongDistanceRuleOffset: DWORD;
dwInternationalRuleSize: DWORD;
dwInternationalRuleOffset: DWORD;
dwOptions: DWORD;
end;const LINECARDENTRY = extern struct {
dwPermanentCardID: u32,
dwCardNameSize: u32,
dwCardNameOffset: u32,
dwCardNumberDigits: u32,
dwSameAreaRuleSize: u32,
dwSameAreaRuleOffset: u32,
dwLongDistanceRuleSize: u32,
dwLongDistanceRuleOffset: u32,
dwInternationalRuleSize: u32,
dwInternationalRuleOffset: u32,
dwOptions: u32,
};type
LINECARDENTRY {.packed.} = object
dwPermanentCardID: uint32
dwCardNameSize: uint32
dwCardNameOffset: uint32
dwCardNumberDigits: uint32
dwSameAreaRuleSize: uint32
dwSameAreaRuleOffset: uint32
dwLongDistanceRuleSize: uint32
dwLongDistanceRuleOffset: uint32
dwInternationalRuleSize: uint32
dwInternationalRuleOffset: uint32
dwOptions: uint32align(1)
struct LINECARDENTRY
{
uint dwPermanentCardID;
uint dwCardNameSize;
uint dwCardNameOffset;
uint dwCardNumberDigits;
uint dwSameAreaRuleSize;
uint dwSameAreaRuleOffset;
uint dwLongDistanceRuleSize;
uint dwLongDistanceRuleOffset;
uint dwInternationalRuleSize;
uint dwInternationalRuleOffset;
uint dwOptions;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINECARDENTRY サイズ: 44 バイト(x64)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; dwPermanentCardID : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwCardNameSize : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwCardNameOffset : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwCardNumberDigits : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwSameAreaRuleSize : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwSameAreaRuleOffset : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwLongDistanceRuleSize : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwLongDistanceRuleOffset : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwInternationalRuleSize : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwInternationalRuleOffset : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwOptions : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LINECARDENTRY, pack=1
#field int dwPermanentCardID
#field int dwCardNameSize
#field int dwCardNameOffset
#field int dwCardNumberDigits
#field int dwSameAreaRuleSize
#field int dwSameAreaRuleOffset
#field int dwLongDistanceRuleSize
#field int dwLongDistanceRuleOffset
#field int dwInternationalRuleSize
#field int dwInternationalRuleOffset
#field int dwOptions
#endstruct
stdim st, LINECARDENTRY ; NSTRUCT 変数を確保
st->dwPermanentCardID = 100
mes "dwPermanentCardID=" + st->dwPermanentCardID