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

LINEFORWARD

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

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

フィールド

フィールドサイズx64x86説明
dwForwardModeDWORD4+0+0転送の種別(無条件/話中/無応答等)を示す値。
dwCallerAddressSizeDWORD4+4+4転送対象の発信者アドレス文字列のサイズをバイトで表す。
dwCallerAddressOffsetDWORD4+8+8発信者アドレス文字列までのオフセット。
dwDestCountryCodeDWORD4+12+12転送先の国番号を表す。
dwDestAddressSizeDWORD4+16+16転送先アドレス文字列のサイズをバイトで表す。
dwDestAddressOffsetDWORD4+20+20転送先アドレス文字列までのオフセット。

各言語での定義

#include <windows.h>

// LINEFORWARD  (x64 24 / x86 24 バイト)
#pragma pack(push, 1)
typedef struct LINEFORWARD {
    DWORD dwForwardMode;
    DWORD dwCallerAddressSize;
    DWORD dwCallerAddressOffset;
    DWORD dwDestCountryCode;
    DWORD dwDestAddressSize;
    DWORD dwDestAddressOffset;
} LINEFORWARD;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINEFORWARD
{
    public uint dwForwardMode;
    public uint dwCallerAddressSize;
    public uint dwCallerAddressOffset;
    public uint dwDestCountryCode;
    public uint dwDestAddressSize;
    public uint dwDestAddressOffset;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINEFORWARD
    Public dwForwardMode As UInteger
    Public dwCallerAddressSize As UInteger
    Public dwCallerAddressOffset As UInteger
    Public dwDestCountryCode As UInteger
    Public dwDestAddressSize As UInteger
    Public dwDestAddressOffset As UInteger
End Structure
import ctypes
from ctypes import wintypes

class LINEFORWARD(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("dwForwardMode", wintypes.DWORD),
        ("dwCallerAddressSize", wintypes.DWORD),
        ("dwCallerAddressOffset", wintypes.DWORD),
        ("dwDestCountryCode", wintypes.DWORD),
        ("dwDestAddressSize", wintypes.DWORD),
        ("dwDestAddressOffset", wintypes.DWORD),
    ]
#[repr(C, packed(1))]
pub struct LINEFORWARD {
    pub dwForwardMode: u32,
    pub dwCallerAddressSize: u32,
    pub dwCallerAddressOffset: u32,
    pub dwDestCountryCode: u32,
    pub dwDestAddressSize: u32,
    pub dwDestAddressOffset: u32,
}
import "golang.org/x/sys/windows"

type LINEFORWARD struct {
	dwForwardMode uint32
	dwCallerAddressSize uint32
	dwCallerAddressOffset uint32
	dwDestCountryCode uint32
	dwDestAddressSize uint32
	dwDestAddressOffset uint32
}
type
  LINEFORWARD = packed record
    dwForwardMode: DWORD;
    dwCallerAddressSize: DWORD;
    dwCallerAddressOffset: DWORD;
    dwDestCountryCode: DWORD;
    dwDestAddressSize: DWORD;
    dwDestAddressOffset: DWORD;
  end;
const LINEFORWARD = extern struct {
    dwForwardMode: u32,
    dwCallerAddressSize: u32,
    dwCallerAddressOffset: u32,
    dwDestCountryCode: u32,
    dwDestAddressSize: u32,
    dwDestAddressOffset: u32,
};
type
  LINEFORWARD {.packed.} = object
    dwForwardMode: uint32
    dwCallerAddressSize: uint32
    dwCallerAddressOffset: uint32
    dwDestCountryCode: uint32
    dwDestAddressSize: uint32
    dwDestAddressOffset: uint32
align(1)
struct LINEFORWARD
{
    uint dwForwardMode;
    uint dwCallerAddressSize;
    uint dwCallerAddressOffset;
    uint dwDestCountryCode;
    uint dwDestAddressSize;
    uint dwDestAddressOffset;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINEFORWARD サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwForwardMode : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwCallerAddressSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwCallerAddressOffset : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwDestCountryCode : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwDestAddressSize : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; dwDestAddressOffset : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LINEFORWARD, pack=1
    #field int dwForwardMode
    #field int dwCallerAddressSize
    #field int dwCallerAddressOffset
    #field int dwDestCountryCode
    #field int dwDestAddressSize
    #field int dwDestAddressOffset
#endstruct

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