LINELOCATIONENTRY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwPermanentLocationID | DWORD | 4 | +0 | +0 | 永続的な識別子です。場所を識別します。 |
| dwLocationNameSize | DWORD | 4 | +4 | +4 | null 終端の場所名文字列のサイズ (文字単位)。null 終端文字を含みます。 |
| dwLocationNameOffset | DWORD | 4 | +8 | +8 | サイズが dwLocationNameSize で指定される、このエントリを含む LINETRANSLATECAPS 構造体の先頭から、場所をユーザーにわかりやすい形で説明する null 終端文字列までのオフセットです。 |
| dwCountryCode | DWORD | 4 | +12 | +12 | 場所の国または地域のコードです。 |
| dwCityCodeSize | DWORD | 4 | +16 | +16 | null 終端の市外局番文字列のサイズ (文字単位)。null 終端文字を含みます。 |
| dwCityCodeOffset | DWORD | 4 | +20 | +20 | サイズが dwCityCodeSize で指定される、この構造体の先頭から、場所に関連付けられた市外局番/地域番号を指定する null 終端文字列までのオフセットです。この情報は、国または地域のコードと合わせて、ユーザーが電話番号を入力する際の入力フィールドの既定値としてアプリケーションが利用でき、適切な正規形式の番号の入力を促すことができます。 |
| dwPreferredCardID | DWORD | 4 | +24 | +24 | この場所からダイヤルするときに優先して使用される通話カード (calling card) です。 |
| dwLocalAccessCodeSize | DWORD | 4 | +28 | +28 | 市内アクセスコード文字列のサイズ (バイト単位)。null 終端文字を含みます。 |
| dwLocalAccessCodeOffset | DWORD | 4 | +32 | +32 | サイズが dwLocalAccessCodeSize で指定される、 LINETRANSLATECAPS 構造体の先頭から、市内通話エリア内のアドレスへ発信する前にダイヤルするアクセスコードを格納した null 終端文字列までのオフセットです。 |
| dwLongDistanceAccessCodeSize | DWORD | 4 | +36 | +36 | 長距離アクセスコードのサイズ (バイト単位)。null 終端文字を含みます。 |
| dwLongDistanceAccessCodeOffset | DWORD | 4 | +40 | +40 | サイズが dwLongDistanceAccessCodeSize で指定される、 LINETRANSLATECAPS 構造体の先頭から、市内通話エリア外のアドレスへ発信する前にダイヤルするアクセスコードを格納した null 終端文字列までのオフセットです。 |
| dwTollPrefixListSize | DWORD | 4 | +44 | +44 | トールプレフィックス (toll prefix) のサイズ (バイト単位)。null 終端文字を含みます。 |
| dwTollPrefixListOffset | DWORD | 4 | +48 | +48 | サイズが dwTollPrefixListSize で指定される、 LINETRANSLATECAPS 構造体の先頭から、この場所のトールプレフィックス一覧を格納した null 終端文字列までのオフセットです。この文字列には、数字 "0" から "9" のみで構成されるプレフィックスが含まれ、各プレフィックスは 1 個の "," (カンマ) 文字で区切られます。 |
| dwCountryID | DWORD | 4 | +52 | +52 | この場所に対して選択された国/地域の識別子です。この値は lineGetCountry 関数と共に使用して、国/地域名など、その国/地域に関する追加情報を取得できます (国/地域コードは一意ではないため、dwCountryCode メンバーをこの目的に使用することはできません)。 |
| dwOptions | DWORD | 4 | +56 | +56 | この場所に対して有効なオプションです。値は LINELOCATIONOPTION_ Constants から取得します。 |
| dwCancelCallWaitingSize | DWORD | 4 | +60 | +60 | キャッチホン解除文字列のサイズ (バイト単位) です。 |
| dwCancelCallWaitingOffset | DWORD | 4 | +64 | +64 | サイズが dwCancelCallWaitingSize で指定される、 LINETRANSLATECAPS 構造体の先頭から、 lineTranslateAddress の dwTranslateOptions パラメーターでアプリケーションが LINETRANSLATEOPTION_CANCELCALLWAITING ビットを設定したときに、ダイヤル可能文字列の先頭 (パルス/トーン文字の後ろ) に付加すべきダイヤル桁と修飾文字を格納した null 終端文字列までのオフセットです。プレフィックスが定義されていない場合は、dwCancelCallWaitingSize に 0 または 1 を設定し、dwCancelCallWaitingOffset が空文字列 (単一の NULL バイト) を指すようにしてもかまいません。 |
公式ドキュメント
LINELOCATIONENTRY 構造体は、アドレス変換のコンテキストを提供するために使用される場所 (ロケーション) を記述します。 LINETRANSLATECAPS 構造体には、 LINELOCATIONENTRY 構造体の配列を格納できます。
解説(Remarks)
この構造体は拡張できません。
古いアプリケーションは、これらの新しいフィールドを認識しないままコンパイルされており、新しいサイズよりも小さい SIZEOF LINELOCATIONENTRY を使用します。これは LINETRANSLATECAPS 構造体の可変部分に置かれる配列であるため、古いアプリケーションが従来期待していた形式で LINELOCATIONENTRY 構造体を受け取れることが不可欠です。そうでないと、配列を正しくインデックス処理できません。アプリケーションは lineGetTranslateCaps 関数に dwAPIVersion パラメーターを渡し、TAPI はこの状況に対処する際の指針としてその値を使用できます。 lineGetTranslateCaps 関数は、アプリケーションに返す LINETRANSLATECAPS 構造体を構築する際に、指定された API バージョンに一致する LINELOCATIONENTRY のメンバーとサイズを使用する必要があります。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// LINELOCATIONENTRY (x64 68 / x86 68 バイト)
#pragma pack(push, 1)
typedef struct LINELOCATIONENTRY {
DWORD dwPermanentLocationID;
DWORD dwLocationNameSize;
DWORD dwLocationNameOffset;
DWORD dwCountryCode;
DWORD dwCityCodeSize;
DWORD dwCityCodeOffset;
DWORD dwPreferredCardID;
DWORD dwLocalAccessCodeSize;
DWORD dwLocalAccessCodeOffset;
DWORD dwLongDistanceAccessCodeSize;
DWORD dwLongDistanceAccessCodeOffset;
DWORD dwTollPrefixListSize;
DWORD dwTollPrefixListOffset;
DWORD dwCountryID;
DWORD dwOptions;
DWORD dwCancelCallWaitingSize;
DWORD dwCancelCallWaitingOffset;
} LINELOCATIONENTRY;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINELOCATIONENTRY
{
public uint dwPermanentLocationID;
public uint dwLocationNameSize;
public uint dwLocationNameOffset;
public uint dwCountryCode;
public uint dwCityCodeSize;
public uint dwCityCodeOffset;
public uint dwPreferredCardID;
public uint dwLocalAccessCodeSize;
public uint dwLocalAccessCodeOffset;
public uint dwLongDistanceAccessCodeSize;
public uint dwLongDistanceAccessCodeOffset;
public uint dwTollPrefixListSize;
public uint dwTollPrefixListOffset;
public uint dwCountryID;
public uint dwOptions;
public uint dwCancelCallWaitingSize;
public uint dwCancelCallWaitingOffset;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINELOCATIONENTRY
Public dwPermanentLocationID As UInteger
Public dwLocationNameSize As UInteger
Public dwLocationNameOffset As UInteger
Public dwCountryCode As UInteger
Public dwCityCodeSize As UInteger
Public dwCityCodeOffset As UInteger
Public dwPreferredCardID As UInteger
Public dwLocalAccessCodeSize As UInteger
Public dwLocalAccessCodeOffset As UInteger
Public dwLongDistanceAccessCodeSize As UInteger
Public dwLongDistanceAccessCodeOffset As UInteger
Public dwTollPrefixListSize As UInteger
Public dwTollPrefixListOffset As UInteger
Public dwCountryID As UInteger
Public dwOptions As UInteger
Public dwCancelCallWaitingSize As UInteger
Public dwCancelCallWaitingOffset As UInteger
End Structureimport ctypes
from ctypes import wintypes
class LINELOCATIONENTRY(ctypes.Structure):
_pack_ = 1
_fields_ = [
("dwPermanentLocationID", wintypes.DWORD),
("dwLocationNameSize", wintypes.DWORD),
("dwLocationNameOffset", wintypes.DWORD),
("dwCountryCode", wintypes.DWORD),
("dwCityCodeSize", wintypes.DWORD),
("dwCityCodeOffset", wintypes.DWORD),
("dwPreferredCardID", wintypes.DWORD),
("dwLocalAccessCodeSize", wintypes.DWORD),
("dwLocalAccessCodeOffset", wintypes.DWORD),
("dwLongDistanceAccessCodeSize", wintypes.DWORD),
("dwLongDistanceAccessCodeOffset", wintypes.DWORD),
("dwTollPrefixListSize", wintypes.DWORD),
("dwTollPrefixListOffset", wintypes.DWORD),
("dwCountryID", wintypes.DWORD),
("dwOptions", wintypes.DWORD),
("dwCancelCallWaitingSize", wintypes.DWORD),
("dwCancelCallWaitingOffset", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct LINELOCATIONENTRY {
pub dwPermanentLocationID: u32,
pub dwLocationNameSize: u32,
pub dwLocationNameOffset: u32,
pub dwCountryCode: u32,
pub dwCityCodeSize: u32,
pub dwCityCodeOffset: u32,
pub dwPreferredCardID: u32,
pub dwLocalAccessCodeSize: u32,
pub dwLocalAccessCodeOffset: u32,
pub dwLongDistanceAccessCodeSize: u32,
pub dwLongDistanceAccessCodeOffset: u32,
pub dwTollPrefixListSize: u32,
pub dwTollPrefixListOffset: u32,
pub dwCountryID: u32,
pub dwOptions: u32,
pub dwCancelCallWaitingSize: u32,
pub dwCancelCallWaitingOffset: u32,
}import "golang.org/x/sys/windows"
type LINELOCATIONENTRY struct {
dwPermanentLocationID uint32
dwLocationNameSize uint32
dwLocationNameOffset uint32
dwCountryCode uint32
dwCityCodeSize uint32
dwCityCodeOffset uint32
dwPreferredCardID uint32
dwLocalAccessCodeSize uint32
dwLocalAccessCodeOffset uint32
dwLongDistanceAccessCodeSize uint32
dwLongDistanceAccessCodeOffset uint32
dwTollPrefixListSize uint32
dwTollPrefixListOffset uint32
dwCountryID uint32
dwOptions uint32
dwCancelCallWaitingSize uint32
dwCancelCallWaitingOffset uint32
}type
LINELOCATIONENTRY = packed record
dwPermanentLocationID: DWORD;
dwLocationNameSize: DWORD;
dwLocationNameOffset: DWORD;
dwCountryCode: DWORD;
dwCityCodeSize: DWORD;
dwCityCodeOffset: DWORD;
dwPreferredCardID: DWORD;
dwLocalAccessCodeSize: DWORD;
dwLocalAccessCodeOffset: DWORD;
dwLongDistanceAccessCodeSize: DWORD;
dwLongDistanceAccessCodeOffset: DWORD;
dwTollPrefixListSize: DWORD;
dwTollPrefixListOffset: DWORD;
dwCountryID: DWORD;
dwOptions: DWORD;
dwCancelCallWaitingSize: DWORD;
dwCancelCallWaitingOffset: DWORD;
end;const LINELOCATIONENTRY = extern struct {
dwPermanentLocationID: u32,
dwLocationNameSize: u32,
dwLocationNameOffset: u32,
dwCountryCode: u32,
dwCityCodeSize: u32,
dwCityCodeOffset: u32,
dwPreferredCardID: u32,
dwLocalAccessCodeSize: u32,
dwLocalAccessCodeOffset: u32,
dwLongDistanceAccessCodeSize: u32,
dwLongDistanceAccessCodeOffset: u32,
dwTollPrefixListSize: u32,
dwTollPrefixListOffset: u32,
dwCountryID: u32,
dwOptions: u32,
dwCancelCallWaitingSize: u32,
dwCancelCallWaitingOffset: u32,
};type
LINELOCATIONENTRY {.packed.} = object
dwPermanentLocationID: uint32
dwLocationNameSize: uint32
dwLocationNameOffset: uint32
dwCountryCode: uint32
dwCityCodeSize: uint32
dwCityCodeOffset: uint32
dwPreferredCardID: uint32
dwLocalAccessCodeSize: uint32
dwLocalAccessCodeOffset: uint32
dwLongDistanceAccessCodeSize: uint32
dwLongDistanceAccessCodeOffset: uint32
dwTollPrefixListSize: uint32
dwTollPrefixListOffset: uint32
dwCountryID: uint32
dwOptions: uint32
dwCancelCallWaitingSize: uint32
dwCancelCallWaitingOffset: uint32align(1)
struct LINELOCATIONENTRY
{
uint dwPermanentLocationID;
uint dwLocationNameSize;
uint dwLocationNameOffset;
uint dwCountryCode;
uint dwCityCodeSize;
uint dwCityCodeOffset;
uint dwPreferredCardID;
uint dwLocalAccessCodeSize;
uint dwLocalAccessCodeOffset;
uint dwLongDistanceAccessCodeSize;
uint dwLongDistanceAccessCodeOffset;
uint dwTollPrefixListSize;
uint dwTollPrefixListOffset;
uint dwCountryID;
uint dwOptions;
uint dwCancelCallWaitingSize;
uint dwCancelCallWaitingOffset;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINELOCATIONENTRY サイズ: 68 バイト(x64)
dim st, 17 ; 4byte整数×17(構造体サイズ 68 / 4 切り上げ)
; dwPermanentLocationID : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwLocationNameSize : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwLocationNameOffset : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwCountryCode : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwCityCodeSize : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwCityCodeOffset : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwPreferredCardID : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwLocalAccessCodeSize : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwLocalAccessCodeOffset : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwLongDistanceAccessCodeSize : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; dwLongDistanceAccessCodeOffset : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwTollPrefixListSize : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; dwTollPrefixListOffset : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; dwCountryID : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; dwOptions : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; dwCancelCallWaitingSize : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; dwCancelCallWaitingOffset : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LINELOCATIONENTRY, pack=1
#field int dwPermanentLocationID
#field int dwLocationNameSize
#field int dwLocationNameOffset
#field int dwCountryCode
#field int dwCityCodeSize
#field int dwCityCodeOffset
#field int dwPreferredCardID
#field int dwLocalAccessCodeSize
#field int dwLocalAccessCodeOffset
#field int dwLongDistanceAccessCodeSize
#field int dwLongDistanceAccessCodeOffset
#field int dwTollPrefixListSize
#field int dwTollPrefixListOffset
#field int dwCountryID
#field int dwOptions
#field int dwCancelCallWaitingSize
#field int dwCancelCallWaitingOffset
#endstruct
stdim st, LINELOCATIONENTRY ; NSTRUCT 変数を確保
st->dwPermanentLocationID = 100
mes "dwPermanentLocationID=" + st->dwPermanentLocationID