ホーム › Devices.Fax › FAX_DEV_STATUS
FAX_DEV_STATUS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| SizeOfStruct | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で示すDWORD。 |
| StatusId | DWORD | 4 | +4 | +4 | デバイスの現在のステータスを示すDWORD。 |
| StringId | DWORD | 4 | +8 | +8 | ステータス文字列のリソースIDを示すDWORD。 |
| PageCount | DWORD | 4 | +12 | +12 | 処理済みページ数を示すDWORD。 |
| CSI | LPWSTR | 8/4 | +16 | +16 | 呼出加入者識別(CSID)を指すワイド文字列。 |
| CallerId | LPWSTR | 8/4 | +24 | +20 | 発信者番号を指すワイド文字列。 |
| RoutingInfo | LPWSTR | 8/4 | +32 | +24 | 受信ファクスのルーティング情報を指すワイド文字列。 |
| ErrorCode | DWORD | 4 | +40 | +28 | エラー発生時のエラーコードを示すDWORD。 |
| Reserved | DWORD | 12 | +44 | +32 | 予約フィールド配列。将来の拡張用で通常は0。 |
各言語での定義
#include <windows.h>
// FAX_DEV_STATUS (x64 56 / x86 44 バイト)
typedef struct FAX_DEV_STATUS {
DWORD SizeOfStruct;
DWORD StatusId;
DWORD StringId;
DWORD PageCount;
LPWSTR CSI;
LPWSTR CallerId;
LPWSTR RoutingInfo;
DWORD ErrorCode;
DWORD Reserved[3];
} FAX_DEV_STATUS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct FAX_DEV_STATUS
{
public uint SizeOfStruct;
public uint StatusId;
public uint StringId;
public uint PageCount;
public IntPtr CSI;
public IntPtr CallerId;
public IntPtr RoutingInfo;
public uint ErrorCode;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public uint[] Reserved;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure FAX_DEV_STATUS
Public SizeOfStruct As UInteger
Public StatusId As UInteger
Public StringId As UInteger
Public PageCount As UInteger
Public CSI As IntPtr
Public CallerId As IntPtr
Public RoutingInfo As IntPtr
Public ErrorCode As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public Reserved() As UInteger
End Structureimport ctypes
from ctypes import wintypes
class FAX_DEV_STATUS(ctypes.Structure):
_fields_ = [
("SizeOfStruct", wintypes.DWORD),
("StatusId", wintypes.DWORD),
("StringId", wintypes.DWORD),
("PageCount", wintypes.DWORD),
("CSI", ctypes.c_void_p),
("CallerId", ctypes.c_void_p),
("RoutingInfo", ctypes.c_void_p),
("ErrorCode", wintypes.DWORD),
("Reserved", wintypes.DWORD * 3),
]#[repr(C)]
pub struct FAX_DEV_STATUS {
pub SizeOfStruct: u32,
pub StatusId: u32,
pub StringId: u32,
pub PageCount: u32,
pub CSI: *mut core::ffi::c_void,
pub CallerId: *mut core::ffi::c_void,
pub RoutingInfo: *mut core::ffi::c_void,
pub ErrorCode: u32,
pub Reserved: [u32; 3],
}import "golang.org/x/sys/windows"
type FAX_DEV_STATUS struct {
SizeOfStruct uint32
StatusId uint32
StringId uint32
PageCount uint32
CSI uintptr
CallerId uintptr
RoutingInfo uintptr
ErrorCode uint32
Reserved [3]uint32
}type
FAX_DEV_STATUS = record
SizeOfStruct: DWORD;
StatusId: DWORD;
StringId: DWORD;
PageCount: DWORD;
CSI: Pointer;
CallerId: Pointer;
RoutingInfo: Pointer;
ErrorCode: DWORD;
Reserved: array[0..2] of DWORD;
end;const FAX_DEV_STATUS = extern struct {
SizeOfStruct: u32,
StatusId: u32,
StringId: u32,
PageCount: u32,
CSI: ?*anyopaque,
CallerId: ?*anyopaque,
RoutingInfo: ?*anyopaque,
ErrorCode: u32,
Reserved: [3]u32,
};type
FAX_DEV_STATUS {.bycopy.} = object
SizeOfStruct: uint32
StatusId: uint32
StringId: uint32
PageCount: uint32
CSI: pointer
CallerId: pointer
RoutingInfo: pointer
ErrorCode: uint32
Reserved: array[3, uint32]struct FAX_DEV_STATUS
{
uint SizeOfStruct;
uint StatusId;
uint StringId;
uint PageCount;
void* CSI;
void* CallerId;
void* RoutingInfo;
uint ErrorCode;
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_DEV_STATUS サイズ: 44 バイト(x86)
dim st, 11 ; 4byte整数×11(構造体サイズ 44 / 4 切り上げ)
; SizeOfStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; StatusId : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; StringId : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; PageCount : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; CSI : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; CallerId : LPWSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; RoutingInfo : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ErrorCode : 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_DEV_STATUS サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; SizeOfStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; StatusId : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; StringId : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; PageCount : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; CSI : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; CallerId : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; RoutingInfo : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ErrorCode : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; Reserved : DWORD (+44, 12byte) varptr(st)+44 を基点に操作(12byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global FAX_DEV_STATUS
#field int SizeOfStruct
#field int StatusId
#field int StringId
#field int PageCount
#field intptr CSI
#field intptr CallerId
#field intptr RoutingInfo
#field int ErrorCode
#field int Reserved 3
#endstruct
stdim st, FAX_DEV_STATUS ; NSTRUCT 変数を確保
st->SizeOfStruct = 100
mes "SizeOfStruct=" + st->SizeOfStruct