Win32 API 日本語リファレンス
ホームGraphics.Printing › JOB_INFO_2W

JOB_INFO_2W

構造体
サイズx64: 160 バイト / x86: 104 バイト

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

フィールド

フィールドサイズx64x86説明
JobIdDWORD4+0+0印刷ジョブを識別する一意のID。
pPrinterNameLPWSTR8/4+8+4ジョブを処理するプリンタ名(Unicode)へのポインタ。
pMachineNameLPWSTR8/4+16+8ジョブを作成したマシン名(Unicode)へのポインタ。
pUserNameLPWSTR8/4+24+12ジョブを送信したユーザー名(Unicode)へのポインタ。
pDocumentLPWSTR8/4+32+16印刷ドキュメント名(Unicode)へのポインタ。
pNotifyNameLPWSTR8/4+40+20ジョブ完了通知の宛先ユーザー名(Unicode)へのポインタ。
pDatatypeLPWSTR8/4+48+24印刷データ型(Unicode)へのポインタ。
pPrintProcessorLPWSTR8/4+56+28使用する印刷プロセッサ名(Unicode)へのポインタ。
pParametersLPWSTR8/4+64+32印刷プロセッサへ渡すパラメータ(Unicode)へのポインタ。
pDriverNameLPWSTR8/4+72+36プリンタドライバ名(Unicode)へのポインタ。
pDevModeDEVMODEW*8/4+80+40このジョブの印刷設定を示すDEVMODEW構造体へのポインタ。
pStatusLPWSTR8/4+88+44ジョブ状態を表す文字列(Unicode)へのポインタ。NULL可。
pSecurityDescriptorPSECURITY_DESCRIPTOR8/4+96+48ジョブのセキュリティ記述子へのポインタ。NULL可。
StatusDWORD4+104+52ジョブの状態を示すビットフラグ(JOB_STATUS_*)。
PriorityDWORD4+108+56ジョブの優先度(1~99)。
PositionDWORD4+112+60キュー内のジョブ位置。
StartTimeDWORD4+116+64印刷可能開始時刻(UTC基準の分単位)。
UntilTimeDWORD4+120+68印刷可能終了時刻(UTC基準の分単位)。
TotalPagesDWORD4+124+72ドキュメントの総ページ数。
SizeDWORD4+128+76ジョブのサイズ(バイト単位)。
SubmittedSYSTEMTIME16+132+80ジョブが投入された日時を示すSYSTEMTIME。
TimeDWORD4+148+96ジョブの印刷経過時間(秒単位)。
PagesPrintedDWORD4+152+100現在までに印刷されたページ数。

各言語での定義

#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_2W  (x64 160 / x86 104 バイト)
typedef struct JOB_INFO_2W {
    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;
} JOB_INFO_2W;
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_2W
{
    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;
}
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_2W
    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
End Structure
import 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_2W(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),
    ]
#[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_2W {
    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,
}
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_2W 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
}
type
  SYSTEMTIME = record
    wYear: Word;
    wMonth: Word;
    wDayOfWeek: Word;
    wDay: Word;
    wHour: Word;
    wMinute: Word;
    wSecond: Word;
    wMilliseconds: Word;
  end;

  JOB_INFO_2W = 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;
  end;
const SYSTEMTIME = extern struct {
    wYear: u16,
    wMonth: u16,
    wDayOfWeek: u16,
    wDay: u16,
    wHour: u16,
    wMinute: u16,
    wSecond: u16,
    wMilliseconds: u16,
};

const JOB_INFO_2W = 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,
};
type
  SYSTEMTIME {.bycopy.} = object
    wYear: uint16
    wMonth: uint16
    wDayOfWeek: uint16
    wDay: uint16
    wHour: uint16
    wMinute: uint16
    wSecond: uint16
    wMilliseconds: uint16

  JOB_INFO_2W {.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
struct SYSTEMTIME
{
    ushort wYear;
    ushort wMonth;
    ushort wDayOfWeek;
    ushort wDay;
    ushort wHour;
    ushort wMinute;
    ushort wSecond;
    ushort wMilliseconds;
}

struct JOB_INFO_2W
{
    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;
}

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_2W サイズ: 104 バイト(x86)
dim st, 26    ; 4byte整数×26(構造体サイズ 104 / 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 も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; JOB_INFO_2W サイズ: 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 も可)
; ※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_2W
    #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
#endstruct

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