ホーム › Networking.WinSock › ATM_CALLING_PARTY_NUMBER_IE
ATM_CALLING_PARTY_NUMBER_IE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ATM_Number | ATM_ADDRESS | 28 | +0 | +0 | 発呼者のATMアドレスを保持するATM_ADDRESS構造体。 |
| Presentation_Indication | BYTE | 1 | +28 | +28 | 発呼者番号の通知可否を示すインジケータ。 |
| Screening_Indicator | BYTE | 1 | +29 | +29 | 発呼者番号の検証状態を示すスクリーニングインジケータ。 |
各言語での定義
#include <windows.h>
// ATM_ADDRESS (x64 28 / x86 28 バイト)
typedef struct ATM_ADDRESS {
DWORD AddressType;
DWORD NumofDigits;
BYTE Addr[20];
} ATM_ADDRESS;
// ATM_CALLING_PARTY_NUMBER_IE (x64 32 / x86 32 バイト)
typedef struct ATM_CALLING_PARTY_NUMBER_IE {
ATM_ADDRESS ATM_Number;
BYTE Presentation_Indication;
BYTE Screening_Indicator;
} ATM_CALLING_PARTY_NUMBER_IE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ATM_ADDRESS
{
public uint AddressType;
public uint NumofDigits;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] public byte[] Addr;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ATM_CALLING_PARTY_NUMBER_IE
{
public ATM_ADDRESS ATM_Number;
public byte Presentation_Indication;
public byte Screening_Indicator;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ATM_ADDRESS
Public AddressType As UInteger
Public NumofDigits As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=20)> Public Addr() As Byte
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ATM_CALLING_PARTY_NUMBER_IE
Public ATM_Number As ATM_ADDRESS
Public Presentation_Indication As Byte
Public Screening_Indicator As Byte
End Structureimport ctypes
from ctypes import wintypes
class ATM_ADDRESS(ctypes.Structure):
_fields_ = [
("AddressType", wintypes.DWORD),
("NumofDigits", wintypes.DWORD),
("Addr", ctypes.c_ubyte * 20),
]
class ATM_CALLING_PARTY_NUMBER_IE(ctypes.Structure):
_fields_ = [
("ATM_Number", ATM_ADDRESS),
("Presentation_Indication", ctypes.c_ubyte),
("Screening_Indicator", ctypes.c_ubyte),
]#[repr(C)]
pub struct ATM_ADDRESS {
pub AddressType: u32,
pub NumofDigits: u32,
pub Addr: [u8; 20],
}
#[repr(C)]
pub struct ATM_CALLING_PARTY_NUMBER_IE {
pub ATM_Number: ATM_ADDRESS,
pub Presentation_Indication: u8,
pub Screening_Indicator: u8,
}import "golang.org/x/sys/windows"
type ATM_ADDRESS struct {
AddressType uint32
NumofDigits uint32
Addr [20]byte
}
type ATM_CALLING_PARTY_NUMBER_IE struct {
ATM_Number ATM_ADDRESS
Presentation_Indication byte
Screening_Indicator byte
}type
ATM_ADDRESS = record
AddressType: DWORD;
NumofDigits: DWORD;
Addr: array[0..19] of Byte;
end;
ATM_CALLING_PARTY_NUMBER_IE = record
ATM_Number: ATM_ADDRESS;
Presentation_Indication: Byte;
Screening_Indicator: Byte;
end;const ATM_ADDRESS = extern struct {
AddressType: u32,
NumofDigits: u32,
Addr: [20]u8,
};
const ATM_CALLING_PARTY_NUMBER_IE = extern struct {
ATM_Number: ATM_ADDRESS,
Presentation_Indication: u8,
Screening_Indicator: u8,
};type
ATM_ADDRESS {.bycopy.} = object
AddressType: uint32
NumofDigits: uint32
Addr: array[20, uint8]
ATM_CALLING_PARTY_NUMBER_IE {.bycopy.} = object
ATM_Number: ATM_ADDRESS
Presentation_Indication: uint8
Screening_Indicator: uint8struct ATM_ADDRESS
{
uint AddressType;
uint NumofDigits;
ubyte[20] Addr;
}
struct ATM_CALLING_PARTY_NUMBER_IE
{
ATM_ADDRESS ATM_Number;
ubyte Presentation_Indication;
ubyte Screening_Indicator;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ATM_CALLING_PARTY_NUMBER_IE サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; ATM_Number : ATM_ADDRESS (+0, 28byte) varptr(st)+0 を基点に操作(28byte:入れ子/配列)
; Presentation_Indication : BYTE (+28, 1byte) poke st,28,値 / 値 = peek(st,28)
; Screening_Indicator : BYTE (+29, 1byte) poke st,29,値 / 値 = peek(st,29)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global ATM_ADDRESS
#field int AddressType
#field int NumofDigits
#field byte Addr 20
#endstruct
#defstruct global ATM_CALLING_PARTY_NUMBER_IE
#field ATM_ADDRESS ATM_Number
#field byte Presentation_Indication
#field byte Screening_Indicator
#endstruct
stdim st, ATM_CALLING_PARTY_NUMBER_IE ; NSTRUCT 変数を確保
st->Presentation_Indication = 100
mes "Presentation_Indication=" + st->Presentation_Indication