ホーム › Devices.Fax › FAX_DEVICE_STATUSW
FAX_DEVICE_STATUSW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| SizeOfStruct | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で示すDWORD。 |
| CallerId | LPWSTR | 8/4 | +8 | +4 | 発信者番号を指すワイド文字列。受信時に使用。 |
| Csid | LPWSTR | 8/4 | +16 | +8 | 呼出加入者識別(CSID)を指すワイド文字列。 |
| CurrentPage | DWORD | 4 | +24 | +12 | 処理中の現在ページ番号を示すDWORD。 |
| DeviceId | DWORD | 4 | +28 | +16 | ファクスデバイスを識別するDWORD。 |
| DeviceName | LPWSTR | 8/4 | +32 | +20 | ファクスデバイス名を指すワイド文字列。 |
| DocumentName | LPWSTR | 8/4 | +40 | +24 | 処理中のドキュメント名を指すワイド文字列。 |
| JobType | DWORD | 4 | +48 | +28 | ジョブ種別(送信/受信等)を示すDWORD。 |
| PhoneNumber | LPWSTR | 8/4 | +56 | +32 | 相手先電話番号を指すワイド文字列。 |
| RoutingString | LPWSTR | 8/4 | +64 | +36 | 受信ファクスのルーティング情報を指すワイド文字列。 |
| SenderName | LPWSTR | 8/4 | +72 | +40 | 送信者名を指すワイド文字列。 |
| RecipientName | LPWSTR | 8/4 | +80 | +44 | 受信者名を指すワイド文字列。 |
| Size | DWORD | 4 | +88 | +48 | ドキュメントのサイズをバイト単位で示すDWORD。 |
| StartTime | FILETIME | 8 | +92 | +52 | ジョブの開始時刻を示すFILETIME。 |
| Status | DWORD | 4 | +100 | +60 | デバイスの現在のステータスを示すDWORD。 |
| StatusString | LPWSTR | 8/4 | +104 | +64 | ステータスの説明文字列を指すワイド文字列。 |
| SubmittedTime | FILETIME | 8 | +112 | +68 | ジョブが投入された時刻を示すFILETIME。 |
| TotalPages | DWORD | 4 | +120 | +76 | ドキュメントの総ページ数を示すDWORD。 |
| Tsid | LPWSTR | 8/4 | +128 | +80 | 送信加入者識別(TSID)を指すワイド文字列。 |
| UserName | LPWSTR | 8/4 | +136 | +84 | ジョブを所有するユーザ名を指すワイド文字列。 |
各言語での定義
#include <windows.h>
// FILETIME (x64 8 / x86 8 バイト)
typedef struct FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME;
// FAX_DEVICE_STATUSW (x64 144 / x86 88 バイト)
typedef struct FAX_DEVICE_STATUSW {
DWORD SizeOfStruct;
LPWSTR CallerId;
LPWSTR Csid;
DWORD CurrentPage;
DWORD DeviceId;
LPWSTR DeviceName;
LPWSTR DocumentName;
DWORD JobType;
LPWSTR PhoneNumber;
LPWSTR RoutingString;
LPWSTR SenderName;
LPWSTR RecipientName;
DWORD Size;
FILETIME StartTime;
DWORD Status;
LPWSTR StatusString;
FILETIME SubmittedTime;
DWORD TotalPages;
LPWSTR Tsid;
LPWSTR UserName;
} FAX_DEVICE_STATUSW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FILETIME
{
public uint dwLowDateTime;
public uint dwHighDateTime;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FAX_DEVICE_STATUSW
{
public uint SizeOfStruct;
public IntPtr CallerId;
public IntPtr Csid;
public uint CurrentPage;
public uint DeviceId;
public IntPtr DeviceName;
public IntPtr DocumentName;
public uint JobType;
public IntPtr PhoneNumber;
public IntPtr RoutingString;
public IntPtr SenderName;
public IntPtr RecipientName;
public uint Size;
public FILETIME StartTime;
public uint Status;
public IntPtr StatusString;
public FILETIME SubmittedTime;
public uint TotalPages;
public IntPtr Tsid;
public IntPtr UserName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FILETIME
Public dwLowDateTime As UInteger
Public dwHighDateTime As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FAX_DEVICE_STATUSW
Public SizeOfStruct As UInteger
Public CallerId As IntPtr
Public Csid As IntPtr
Public CurrentPage As UInteger
Public DeviceId As UInteger
Public DeviceName As IntPtr
Public DocumentName As IntPtr
Public JobType As UInteger
Public PhoneNumber As IntPtr
Public RoutingString As IntPtr
Public SenderName As IntPtr
Public RecipientName As IntPtr
Public Size As UInteger
Public StartTime As FILETIME
Public Status As UInteger
Public StatusString As IntPtr
Public SubmittedTime As FILETIME
Public TotalPages As UInteger
Public Tsid As IntPtr
Public UserName As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class FILETIME(ctypes.Structure):
_fields_ = [
("dwLowDateTime", wintypes.DWORD),
("dwHighDateTime", wintypes.DWORD),
]
class FAX_DEVICE_STATUSW(ctypes.Structure):
_fields_ = [
("SizeOfStruct", wintypes.DWORD),
("CallerId", ctypes.c_void_p),
("Csid", ctypes.c_void_p),
("CurrentPage", wintypes.DWORD),
("DeviceId", wintypes.DWORD),
("DeviceName", ctypes.c_void_p),
("DocumentName", ctypes.c_void_p),
("JobType", wintypes.DWORD),
("PhoneNumber", ctypes.c_void_p),
("RoutingString", ctypes.c_void_p),
("SenderName", ctypes.c_void_p),
("RecipientName", ctypes.c_void_p),
("Size", wintypes.DWORD),
("StartTime", FILETIME),
("Status", wintypes.DWORD),
("StatusString", ctypes.c_void_p),
("SubmittedTime", FILETIME),
("TotalPages", wintypes.DWORD),
("Tsid", ctypes.c_void_p),
("UserName", ctypes.c_void_p),
]#[repr(C)]
pub struct FILETIME {
pub dwLowDateTime: u32,
pub dwHighDateTime: u32,
}
#[repr(C)]
pub struct FAX_DEVICE_STATUSW {
pub SizeOfStruct: u32,
pub CallerId: *mut core::ffi::c_void,
pub Csid: *mut core::ffi::c_void,
pub CurrentPage: u32,
pub DeviceId: u32,
pub DeviceName: *mut core::ffi::c_void,
pub DocumentName: *mut core::ffi::c_void,
pub JobType: u32,
pub PhoneNumber: *mut core::ffi::c_void,
pub RoutingString: *mut core::ffi::c_void,
pub SenderName: *mut core::ffi::c_void,
pub RecipientName: *mut core::ffi::c_void,
pub Size: u32,
pub StartTime: FILETIME,
pub Status: u32,
pub StatusString: *mut core::ffi::c_void,
pub SubmittedTime: FILETIME,
pub TotalPages: u32,
pub Tsid: *mut core::ffi::c_void,
pub UserName: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type FILETIME struct {
dwLowDateTime uint32
dwHighDateTime uint32
}
type FAX_DEVICE_STATUSW struct {
SizeOfStruct uint32
CallerId uintptr
Csid uintptr
CurrentPage uint32
DeviceId uint32
DeviceName uintptr
DocumentName uintptr
JobType uint32
PhoneNumber uintptr
RoutingString uintptr
SenderName uintptr
RecipientName uintptr
Size uint32
StartTime FILETIME
Status uint32
StatusString uintptr
SubmittedTime FILETIME
TotalPages uint32
Tsid uintptr
UserName uintptr
}type
FILETIME = record
dwLowDateTime: DWORD;
dwHighDateTime: DWORD;
end;
FAX_DEVICE_STATUSW = record
SizeOfStruct: DWORD;
CallerId: Pointer;
Csid: Pointer;
CurrentPage: DWORD;
DeviceId: DWORD;
DeviceName: Pointer;
DocumentName: Pointer;
JobType: DWORD;
PhoneNumber: Pointer;
RoutingString: Pointer;
SenderName: Pointer;
RecipientName: Pointer;
Size: DWORD;
StartTime: FILETIME;
Status: DWORD;
StatusString: Pointer;
SubmittedTime: FILETIME;
TotalPages: DWORD;
Tsid: Pointer;
UserName: Pointer;
end;const FILETIME = extern struct {
dwLowDateTime: u32,
dwHighDateTime: u32,
};
const FAX_DEVICE_STATUSW = extern struct {
SizeOfStruct: u32,
CallerId: ?*anyopaque,
Csid: ?*anyopaque,
CurrentPage: u32,
DeviceId: u32,
DeviceName: ?*anyopaque,
DocumentName: ?*anyopaque,
JobType: u32,
PhoneNumber: ?*anyopaque,
RoutingString: ?*anyopaque,
SenderName: ?*anyopaque,
RecipientName: ?*anyopaque,
Size: u32,
StartTime: FILETIME,
Status: u32,
StatusString: ?*anyopaque,
SubmittedTime: FILETIME,
TotalPages: u32,
Tsid: ?*anyopaque,
UserName: ?*anyopaque,
};type
FILETIME {.bycopy.} = object
dwLowDateTime: uint32
dwHighDateTime: uint32
FAX_DEVICE_STATUSW {.bycopy.} = object
SizeOfStruct: uint32
CallerId: pointer
Csid: pointer
CurrentPage: uint32
DeviceId: uint32
DeviceName: pointer
DocumentName: pointer
JobType: uint32
PhoneNumber: pointer
RoutingString: pointer
SenderName: pointer
RecipientName: pointer
Size: uint32
StartTime: FILETIME
Status: uint32
StatusString: pointer
SubmittedTime: FILETIME
TotalPages: uint32
Tsid: pointer
UserName: pointerstruct FILETIME
{
uint dwLowDateTime;
uint dwHighDateTime;
}
struct FAX_DEVICE_STATUSW
{
uint SizeOfStruct;
void* CallerId;
void* Csid;
uint CurrentPage;
uint DeviceId;
void* DeviceName;
void* DocumentName;
uint JobType;
void* PhoneNumber;
void* RoutingString;
void* SenderName;
void* RecipientName;
uint Size;
FILETIME StartTime;
uint Status;
void* StatusString;
FILETIME SubmittedTime;
uint TotalPages;
void* Tsid;
void* UserName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; FAX_DEVICE_STATUSW サイズ: 88 バイト(x86)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; SizeOfStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; CallerId : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Csid : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; CurrentPage : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; DeviceId : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; DeviceName : LPWSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; DocumentName : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; JobType : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; PhoneNumber : LPWSTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; RoutingString : LPWSTR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; SenderName : LPWSTR (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; RecipientName : LPWSTR (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; Size : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; StartTime : FILETIME (+52, 8byte) varptr(st)+52 を基点に操作(8byte:入れ子/配列)
; Status : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; StatusString : LPWSTR (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; SubmittedTime : FILETIME (+68, 8byte) varptr(st)+68 を基点に操作(8byte:入れ子/配列)
; TotalPages : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; Tsid : LPWSTR (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; UserName : LPWSTR (+84, 4byte) st.21 = 値 / 値 = st.21 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; FAX_DEVICE_STATUSW サイズ: 144 バイト(x64)
dim st, 36 ; 4byte整数×36(構造体サイズ 144 / 4 切り上げ)
; SizeOfStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; CallerId : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Csid : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; CurrentPage : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; DeviceId : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; DeviceName : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; DocumentName : LPWSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; JobType : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; PhoneNumber : LPWSTR (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; RoutingString : LPWSTR (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; SenderName : LPWSTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; RecipientName : LPWSTR (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; Size : DWORD (+88, 4byte) st.22 = 値 / 値 = st.22 (lpoke/lpeek も可)
; StartTime : FILETIME (+92, 8byte) varptr(st)+92 を基点に操作(8byte:入れ子/配列)
; Status : DWORD (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; StatusString : LPWSTR (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; SubmittedTime : FILETIME (+112, 8byte) varptr(st)+112 を基点に操作(8byte:入れ子/配列)
; TotalPages : DWORD (+120, 4byte) st.30 = 値 / 値 = st.30 (lpoke/lpeek も可)
; Tsid : LPWSTR (+128, 8byte) qpoke st,128,値 / qpeek(st,128) ※IronHSPのみ。3.7/3.8は lpoke st,128,下位 : lpoke st,132,上位
; UserName : LPWSTR (+136, 8byte) qpoke st,136,値 / qpeek(st,136) ※IronHSPのみ。3.7/3.8は lpoke st,136,下位 : lpoke st,140,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global FILETIME
#field int dwLowDateTime
#field int dwHighDateTime
#endstruct
#defstruct global FAX_DEVICE_STATUSW
#field int SizeOfStruct
#field intptr CallerId
#field intptr Csid
#field int CurrentPage
#field int DeviceId
#field intptr DeviceName
#field intptr DocumentName
#field int JobType
#field intptr PhoneNumber
#field intptr RoutingString
#field intptr SenderName
#field intptr RecipientName
#field int Size
#field FILETIME StartTime
#field int Status
#field intptr StatusString
#field FILETIME SubmittedTime
#field int TotalPages
#field intptr Tsid
#field intptr UserName
#endstruct
stdim st, FAX_DEVICE_STATUSW ; NSTRUCT 変数を確保
st->SizeOfStruct = 100
mes "SizeOfStruct=" + st->SizeOfStruct