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

FAX_SEND

構造体
サイズx64: 72 バイト / x86: 44 バイト

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

フィールド

フィールドサイズx64x86説明
SizeOfStructDWORD4+0+0この構造体のサイズをバイト単位で示すDWORD。
FileNameLPWSTR8/4+8+4送信する一時TIFFファイルのパスを指すワイド文字列。
CallerNameLPWSTR8/4+16+8発信者(送信者)名を指すワイド文字列。
CallerNumberLPWSTR8/4+24+12発信者の電話番号を指すワイド文字列。
ReceiverNameLPWSTR8/4+32+16受信者名を指すワイド文字列。
ReceiverNumberLPWSTR8/4+40+20受信者のファクス番号を指すワイド文字列。
BrandingBOOL4+48+24送信ファクスにブランディングを付与するかを示すBOOL。
CallHandleDWORD4+52+28既存の通話ハンドルを示すDWORD。手動送信時に使用。
ReservedDWORD12+56+32予約フィールド配列。将来の拡張用で通常は0。

各言語での定義

#include <windows.h>

// FAX_SEND  (x64 72 / x86 44 バイト)
typedef struct FAX_SEND {
    DWORD SizeOfStruct;
    LPWSTR FileName;
    LPWSTR CallerName;
    LPWSTR CallerNumber;
    LPWSTR ReceiverName;
    LPWSTR ReceiverNumber;
    BOOL Branding;
    DWORD CallHandle;
    DWORD Reserved[3];
} FAX_SEND;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FAX_SEND
{
    public uint SizeOfStruct;
    public IntPtr FileName;
    public IntPtr CallerName;
    public IntPtr CallerNumber;
    public IntPtr ReceiverName;
    public IntPtr ReceiverNumber;
    [MarshalAs(UnmanagedType.Bool)] public bool Branding;
    public uint CallHandle;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public uint[] Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FAX_SEND
    Public SizeOfStruct As UInteger
    Public FileName As IntPtr
    Public CallerName As IntPtr
    Public CallerNumber As IntPtr
    Public ReceiverName As IntPtr
    Public ReceiverNumber As IntPtr
    <MarshalAs(UnmanagedType.Bool)> Public Branding As Boolean
    Public CallHandle As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public Reserved() As UInteger
End Structure
import ctypes
from ctypes import wintypes

class FAX_SEND(ctypes.Structure):
    _fields_ = [
        ("SizeOfStruct", wintypes.DWORD),
        ("FileName", ctypes.c_void_p),
        ("CallerName", ctypes.c_void_p),
        ("CallerNumber", ctypes.c_void_p),
        ("ReceiverName", ctypes.c_void_p),
        ("ReceiverNumber", ctypes.c_void_p),
        ("Branding", wintypes.BOOL),
        ("CallHandle", wintypes.DWORD),
        ("Reserved", wintypes.DWORD * 3),
    ]
#[repr(C)]
pub struct FAX_SEND {
    pub SizeOfStruct: u32,
    pub FileName: *mut core::ffi::c_void,
    pub CallerName: *mut core::ffi::c_void,
    pub CallerNumber: *mut core::ffi::c_void,
    pub ReceiverName: *mut core::ffi::c_void,
    pub ReceiverNumber: *mut core::ffi::c_void,
    pub Branding: i32,
    pub CallHandle: u32,
    pub Reserved: [u32; 3],
}
import "golang.org/x/sys/windows"

type FAX_SEND struct {
	SizeOfStruct uint32
	FileName uintptr
	CallerName uintptr
	CallerNumber uintptr
	ReceiverName uintptr
	ReceiverNumber uintptr
	Branding int32
	CallHandle uint32
	Reserved [3]uint32
}
type
  FAX_SEND = record
    SizeOfStruct: DWORD;
    FileName: Pointer;
    CallerName: Pointer;
    CallerNumber: Pointer;
    ReceiverName: Pointer;
    ReceiverNumber: Pointer;
    Branding: BOOL;
    CallHandle: DWORD;
    Reserved: array[0..2] of DWORD;
  end;
const FAX_SEND = extern struct {
    SizeOfStruct: u32,
    FileName: ?*anyopaque,
    CallerName: ?*anyopaque,
    CallerNumber: ?*anyopaque,
    ReceiverName: ?*anyopaque,
    ReceiverNumber: ?*anyopaque,
    Branding: i32,
    CallHandle: u32,
    Reserved: [3]u32,
};
type
  FAX_SEND {.bycopy.} = object
    SizeOfStruct: uint32
    FileName: pointer
    CallerName: pointer
    CallerNumber: pointer
    ReceiverName: pointer
    ReceiverNumber: pointer
    Branding: int32
    CallHandle: uint32
    Reserved: array[3, uint32]
struct FAX_SEND
{
    uint SizeOfStruct;
    void* FileName;
    void* CallerName;
    void* CallerNumber;
    void* ReceiverName;
    void* ReceiverNumber;
    int Branding;
    uint CallHandle;
    uint[3] Reserved;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; FAX_SEND サイズ: 44 バイト(x86)
dim st, 11    ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; SizeOfStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; FileName : LPWSTR (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; CallerName : LPWSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; CallerNumber : LPWSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ReceiverName : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ReceiverNumber : LPWSTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Branding : BOOL (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; CallHandle : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; Reserved : DWORD (+32, 12byte)  varptr(st)+32 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FAX_SEND サイズ: 72 バイト(x64)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; SizeOfStruct : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; FileName : LPWSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; CallerName : LPWSTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; CallerNumber : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ReceiverName : LPWSTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ReceiverNumber : LPWSTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; Branding : BOOL (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; CallHandle : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; Reserved : DWORD (+56, 12byte)  varptr(st)+56 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FAX_SEND
    #field int SizeOfStruct
    #field intptr FileName
    #field intptr CallerName
    #field intptr CallerNumber
    #field intptr ReceiverName
    #field intptr ReceiverNumber
    #field bool Branding
    #field int CallHandle
    #field int Reserved 3
#endstruct

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