ホーム › Graphics.Printing › JOB_INFO_4W
JOB_INFO_4W
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| JobId | DWORD | 4 | +0 | +0 | 印刷ジョブを識別する一意のID。 |
| pPrinterName | LPWSTR | 8/4 | +8 | +4 | ジョブを処理するプリンタ名(Unicode)へのポインタ。 |
| pMachineName | LPWSTR | 8/4 | +16 | +8 | ジョブを作成したマシン名(Unicode)へのポインタ。 |
| pUserName | LPWSTR | 8/4 | +24 | +12 | ジョブを送信したユーザー名(Unicode)へのポインタ。 |
| pDocument | LPWSTR | 8/4 | +32 | +16 | 印刷ドキュメント名(Unicode)へのポインタ。 |
| pNotifyName | LPWSTR | 8/4 | +40 | +20 | ジョブ完了通知の宛先ユーザー名(Unicode)へのポインタ。 |
| pDatatype | LPWSTR | 8/4 | +48 | +24 | 印刷データ型(Unicode)へのポインタ。 |
| pPrintProcessor | LPWSTR | 8/4 | +56 | +28 | 使用する印刷プロセッサ名(Unicode)へのポインタ。 |
| pParameters | LPWSTR | 8/4 | +64 | +32 | 印刷プロセッサへ渡すパラメータ(Unicode)へのポインタ。 |
| pDriverName | LPWSTR | 8/4 | +72 | +36 | プリンタドライバ名(Unicode)へのポインタ。 |
| pDevMode | DEVMODEW* | 8/4 | +80 | +40 | このジョブの印刷設定を示すDEVMODEW構造体へのポインタ。 |
| pStatus | LPWSTR | 8/4 | +88 | +44 | ジョブ状態を表す文字列(Unicode)へのポインタ。NULL可。 |
| pSecurityDescriptor | PSECURITY_DESCRIPTOR | 8/4 | +96 | +48 | ジョブのセキュリティ記述子へのポインタ。NULL可。 |
| Status | DWORD | 4 | +104 | +52 | ジョブの状態を示すビットフラグ(JOB_STATUS_*)。 |
| Priority | DWORD | 4 | +108 | +56 | ジョブの優先度(1~99)。 |
| Position | DWORD | 4 | +112 | +60 | キュー内のジョブ位置。 |
| StartTime | DWORD | 4 | +116 | +64 | 印刷可能開始時刻(UTC基準の分単位)。 |
| UntilTime | DWORD | 4 | +120 | +68 | 印刷可能終了時刻(UTC基準の分単位)。 |
| TotalPages | DWORD | 4 | +124 | +72 | ドキュメントの総ページ数。 |
| Size | DWORD | 4 | +128 | +76 | ジョブサイズ(バイト単位)の下位32ビット。 |
| Submitted | SYSTEMTIME | 16 | +132 | +80 | ジョブが投入された日時を示すSYSTEMTIME。 |
| Time | DWORD | 4 | +148 | +96 | ジョブの印刷経過時間(秒単位)。 |
| PagesPrinted | DWORD | 4 | +152 | +100 | 現在までに印刷されたページ数。 |
| SizeHigh | INT | 4 | +156 | +104 | ジョブサイズの上位32ビット。Sizeと組み合わせ64ビットサイズを表す。 |
各言語での定義
#include <windows.h>
// SYSTEMTIME (x64 16 / x86 16 バイト)
typedef struct SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
// JOB_INFO_4W (x64 160 / x86 108 バイト)
typedef struct JOB_INFO_4W {
DWORD JobId;
LPWSTR pPrinterName;
LPWSTR pMachineName;
LPWSTR pUserName;
LPWSTR pDocument;
LPWSTR pNotifyName;
LPWSTR pDatatype;
LPWSTR pPrintProcessor;
LPWSTR pParameters;
LPWSTR pDriverName;
DEVMODEW* pDevMode;
LPWSTR pStatus;
PSECURITY_DESCRIPTOR pSecurityDescriptor;
DWORD Status;
DWORD Priority;
DWORD Position;
DWORD StartTime;
DWORD UntilTime;
DWORD TotalPages;
DWORD Size;
SYSTEMTIME Submitted;
DWORD Time;
DWORD PagesPrinted;
INT SizeHigh;
} JOB_INFO_4W;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYSTEMTIME
{
public ushort wYear;
public ushort wMonth;
public ushort wDayOfWeek;
public ushort wDay;
public ushort wHour;
public ushort wMinute;
public ushort wSecond;
public ushort wMilliseconds;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct JOB_INFO_4W
{
public uint JobId;
public IntPtr pPrinterName;
public IntPtr pMachineName;
public IntPtr pUserName;
public IntPtr pDocument;
public IntPtr pNotifyName;
public IntPtr pDatatype;
public IntPtr pPrintProcessor;
public IntPtr pParameters;
public IntPtr pDriverName;
public IntPtr pDevMode;
public IntPtr pStatus;
public IntPtr pSecurityDescriptor;
public uint Status;
public uint Priority;
public uint Position;
public uint StartTime;
public uint UntilTime;
public uint TotalPages;
public uint Size;
public SYSTEMTIME Submitted;
public uint Time;
public uint PagesPrinted;
public int SizeHigh;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYSTEMTIME
Public wYear As UShort
Public wMonth As UShort
Public wDayOfWeek As UShort
Public wDay As UShort
Public wHour As UShort
Public wMinute As UShort
Public wSecond As UShort
Public wMilliseconds As UShort
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure JOB_INFO_4W
Public JobId As UInteger
Public pPrinterName As IntPtr
Public pMachineName As IntPtr
Public pUserName As IntPtr
Public pDocument As IntPtr
Public pNotifyName As IntPtr
Public pDatatype As IntPtr
Public pPrintProcessor As IntPtr
Public pParameters As IntPtr
Public pDriverName As IntPtr
Public pDevMode As IntPtr
Public pStatus As IntPtr
Public pSecurityDescriptor As IntPtr
Public Status As UInteger
Public Priority As UInteger
Public Position As UInteger
Public StartTime As UInteger
Public UntilTime As UInteger
Public TotalPages As UInteger
Public Size As UInteger
Public Submitted As SYSTEMTIME
Public Time As UInteger
Public PagesPrinted As UInteger
Public SizeHigh As Integer
End Structureimport ctypes
from ctypes import wintypes
class SYSTEMTIME(ctypes.Structure):
_fields_ = [
("wYear", ctypes.c_ushort),
("wMonth", ctypes.c_ushort),
("wDayOfWeek", ctypes.c_ushort),
("wDay", ctypes.c_ushort),
("wHour", ctypes.c_ushort),
("wMinute", ctypes.c_ushort),
("wSecond", ctypes.c_ushort),
("wMilliseconds", ctypes.c_ushort),
]
class JOB_INFO_4W(ctypes.Structure):
_fields_ = [
("JobId", wintypes.DWORD),
("pPrinterName", ctypes.c_void_p),
("pMachineName", ctypes.c_void_p),
("pUserName", ctypes.c_void_p),
("pDocument", ctypes.c_void_p),
("pNotifyName", ctypes.c_void_p),
("pDatatype", ctypes.c_void_p),
("pPrintProcessor", ctypes.c_void_p),
("pParameters", ctypes.c_void_p),
("pDriverName", ctypes.c_void_p),
("pDevMode", ctypes.c_void_p),
("pStatus", ctypes.c_void_p),
("pSecurityDescriptor", ctypes.c_void_p),
("Status", wintypes.DWORD),
("Priority", wintypes.DWORD),
("Position", wintypes.DWORD),
("StartTime", wintypes.DWORD),
("UntilTime", wintypes.DWORD),
("TotalPages", wintypes.DWORD),
("Size", wintypes.DWORD),
("Submitted", SYSTEMTIME),
("Time", wintypes.DWORD),
("PagesPrinted", wintypes.DWORD),
("SizeHigh", ctypes.c_int),
]#[repr(C)]
pub struct SYSTEMTIME {
pub wYear: u16,
pub wMonth: u16,
pub wDayOfWeek: u16,
pub wDay: u16,
pub wHour: u16,
pub wMinute: u16,
pub wSecond: u16,
pub wMilliseconds: u16,
}
#[repr(C)]
pub struct JOB_INFO_4W {
pub JobId: u32,
pub pPrinterName: *mut core::ffi::c_void,
pub pMachineName: *mut core::ffi::c_void,
pub pUserName: *mut core::ffi::c_void,
pub pDocument: *mut core::ffi::c_void,
pub pNotifyName: *mut core::ffi::c_void,
pub pDatatype: *mut core::ffi::c_void,
pub pPrintProcessor: *mut core::ffi::c_void,
pub pParameters: *mut core::ffi::c_void,
pub pDriverName: *mut core::ffi::c_void,
pub pDevMode: *mut core::ffi::c_void,
pub pStatus: *mut core::ffi::c_void,
pub pSecurityDescriptor: *mut core::ffi::c_void,
pub Status: u32,
pub Priority: u32,
pub Position: u32,
pub StartTime: u32,
pub UntilTime: u32,
pub TotalPages: u32,
pub Size: u32,
pub Submitted: SYSTEMTIME,
pub Time: u32,
pub PagesPrinted: u32,
pub SizeHigh: i32,
}import "golang.org/x/sys/windows"
type SYSTEMTIME struct {
wYear uint16
wMonth uint16
wDayOfWeek uint16
wDay uint16
wHour uint16
wMinute uint16
wSecond uint16
wMilliseconds uint16
}
type JOB_INFO_4W struct {
JobId uint32
pPrinterName uintptr
pMachineName uintptr
pUserName uintptr
pDocument uintptr
pNotifyName uintptr
pDatatype uintptr
pPrintProcessor uintptr
pParameters uintptr
pDriverName uintptr
pDevMode uintptr
pStatus uintptr
pSecurityDescriptor uintptr
Status uint32
Priority uint32
Position uint32
StartTime uint32
UntilTime uint32
TotalPages uint32
Size uint32
Submitted SYSTEMTIME
Time uint32
PagesPrinted uint32
SizeHigh int32
}type
SYSTEMTIME = record
wYear: Word;
wMonth: Word;
wDayOfWeek: Word;
wDay: Word;
wHour: Word;
wMinute: Word;
wSecond: Word;
wMilliseconds: Word;
end;
JOB_INFO_4W = record
JobId: DWORD;
pPrinterName: Pointer;
pMachineName: Pointer;
pUserName: Pointer;
pDocument: Pointer;
pNotifyName: Pointer;
pDatatype: Pointer;
pPrintProcessor: Pointer;
pParameters: Pointer;
pDriverName: Pointer;
pDevMode: Pointer;
pStatus: Pointer;
pSecurityDescriptor: Pointer;
Status: DWORD;
Priority: DWORD;
Position: DWORD;
StartTime: DWORD;
UntilTime: DWORD;
TotalPages: DWORD;
Size: DWORD;
Submitted: SYSTEMTIME;
Time: DWORD;
PagesPrinted: DWORD;
SizeHigh: Integer;
end;const SYSTEMTIME = extern struct {
wYear: u16,
wMonth: u16,
wDayOfWeek: u16,
wDay: u16,
wHour: u16,
wMinute: u16,
wSecond: u16,
wMilliseconds: u16,
};
const JOB_INFO_4W = extern struct {
JobId: u32,
pPrinterName: ?*anyopaque,
pMachineName: ?*anyopaque,
pUserName: ?*anyopaque,
pDocument: ?*anyopaque,
pNotifyName: ?*anyopaque,
pDatatype: ?*anyopaque,
pPrintProcessor: ?*anyopaque,
pParameters: ?*anyopaque,
pDriverName: ?*anyopaque,
pDevMode: ?*anyopaque,
pStatus: ?*anyopaque,
pSecurityDescriptor: ?*anyopaque,
Status: u32,
Priority: u32,
Position: u32,
StartTime: u32,
UntilTime: u32,
TotalPages: u32,
Size: u32,
Submitted: SYSTEMTIME,
Time: u32,
PagesPrinted: u32,
SizeHigh: i32,
};type
SYSTEMTIME {.bycopy.} = object
wYear: uint16
wMonth: uint16
wDayOfWeek: uint16
wDay: uint16
wHour: uint16
wMinute: uint16
wSecond: uint16
wMilliseconds: uint16
JOB_INFO_4W {.bycopy.} = object
JobId: uint32
pPrinterName: pointer
pMachineName: pointer
pUserName: pointer
pDocument: pointer
pNotifyName: pointer
pDatatype: pointer
pPrintProcessor: pointer
pParameters: pointer
pDriverName: pointer
pDevMode: pointer
pStatus: pointer
pSecurityDescriptor: pointer
Status: uint32
Priority: uint32
Position: uint32
StartTime: uint32
UntilTime: uint32
TotalPages: uint32
Size: uint32
Submitted: SYSTEMTIME
Time: uint32
PagesPrinted: uint32
SizeHigh: int32struct SYSTEMTIME
{
ushort wYear;
ushort wMonth;
ushort wDayOfWeek;
ushort wDay;
ushort wHour;
ushort wMinute;
ushort wSecond;
ushort wMilliseconds;
}
struct JOB_INFO_4W
{
uint JobId;
void* pPrinterName;
void* pMachineName;
void* pUserName;
void* pDocument;
void* pNotifyName;
void* pDatatype;
void* pPrintProcessor;
void* pParameters;
void* pDriverName;
void* pDevMode;
void* pStatus;
void* pSecurityDescriptor;
uint Status;
uint Priority;
uint Position;
uint StartTime;
uint UntilTime;
uint TotalPages;
uint Size;
SYSTEMTIME Submitted;
uint Time;
uint PagesPrinted;
int SizeHigh;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; JOB_INFO_4W サイズ: 108 バイト(x86)
dim st, 27 ; 4byte整数×27(構造体サイズ 108 / 4 切り上げ)
; JobId : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pPrinterName : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pMachineName : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; pUserName : LPWSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pDocument : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pNotifyName : LPWSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pDatatype : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; pPrintProcessor : LPWSTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; pParameters : LPWSTR (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pDriverName : LPWSTR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; pDevMode : DEVMODEW* (+40, 4byte) varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; pStatus : LPWSTR (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; pSecurityDescriptor : PSECURITY_DESCRIPTOR (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; Status : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; Priority : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; Position : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; StartTime : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; UntilTime : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; TotalPages : DWORD (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; Size : DWORD (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; Submitted : SYSTEMTIME (+80, 16byte) varptr(st)+80 を基点に操作(16byte:入れ子/配列)
; Time : DWORD (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; PagesPrinted : DWORD (+100, 4byte) st.25 = 値 / 値 = st.25 (lpoke/lpeek も可)
; SizeHigh : INT (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JOB_INFO_4W サイズ: 160 バイト(x64)
dim st, 40 ; 4byte整数×40(構造体サイズ 160 / 4 切り上げ)
; JobId : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; pPrinterName : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pMachineName : LPWSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pUserName : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pDocument : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pNotifyName : LPWSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; pDatatype : LPWSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; pPrintProcessor : LPWSTR (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; pParameters : LPWSTR (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; pDriverName : LPWSTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; pDevMode : DEVMODEW* (+80, 8byte) varptr(st)+80 を基点に操作(8byte:入れ子/配列)
; pStatus : LPWSTR (+88, 8byte) qpoke st,88,値 / qpeek(st,88) ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; pSecurityDescriptor : PSECURITY_DESCRIPTOR (+96, 8byte) qpoke st,96,値 / qpeek(st,96) ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; Status : DWORD (+104, 4byte) st.26 = 値 / 値 = st.26 (lpoke/lpeek も可)
; Priority : DWORD (+108, 4byte) st.27 = 値 / 値 = st.27 (lpoke/lpeek も可)
; Position : DWORD (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; StartTime : DWORD (+116, 4byte) st.29 = 値 / 値 = st.29 (lpoke/lpeek も可)
; UntilTime : DWORD (+120, 4byte) st.30 = 値 / 値 = st.30 (lpoke/lpeek も可)
; TotalPages : DWORD (+124, 4byte) st.31 = 値 / 値 = st.31 (lpoke/lpeek も可)
; Size : DWORD (+128, 4byte) st.32 = 値 / 値 = st.32 (lpoke/lpeek も可)
; Submitted : SYSTEMTIME (+132, 16byte) varptr(st)+132 を基点に操作(16byte:入れ子/配列)
; Time : DWORD (+148, 4byte) st.37 = 値 / 値 = st.37 (lpoke/lpeek も可)
; PagesPrinted : DWORD (+152, 4byte) st.38 = 値 / 値 = st.38 (lpoke/lpeek も可)
; SizeHigh : INT (+156, 4byte) st.39 = 値 / 値 = st.39 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global SYSTEMTIME
#field short wYear
#field short wMonth
#field short wDayOfWeek
#field short wDay
#field short wHour
#field short wMinute
#field short wSecond
#field short wMilliseconds
#endstruct
#defstruct global JOB_INFO_4W
#field int JobId
#field intptr pPrinterName
#field intptr pMachineName
#field intptr pUserName
#field intptr pDocument
#field intptr pNotifyName
#field intptr pDatatype
#field intptr pPrintProcessor
#field intptr pParameters
#field intptr pDriverName
#field intptr pDevMode
#field intptr pStatus
#field intptr pSecurityDescriptor
#field int Status
#field int Priority
#field int Position
#field int StartTime
#field int UntilTime
#field int TotalPages
#field int Size
#field SYSTEMTIME Submitted
#field int Time
#field int PagesPrinted
#field int SizeHigh
#endstruct
stdim st, JOB_INFO_4W ; NSTRUCT 変数を確保
st->JobId = 100
mes "JobId=" + st->JobId