PRINTER_NOTIFY_INFO_DATA structure

The PRINTER_NOTIFY_INFO_DATA structure identifies a job or printer information field and provides the current data for that field.

The FindNextPrinterChangeNotification function returns a PRINTER_NOTIFY_INFO structure, which contains an array of PRINTER_NOTIFY_INFO_DATA structures.

Syntax

typedef struct _PRINTER_NOTIFY_INFO_DATA {
  WORD  Type;
  WORD  Field;
  DWORD Reserved;
  DWORD Id;
  union {
    DWORD  adwData[2];
    struct {
      DWORD  cbBuf;
      LPVOID pBuf;
    } Data;
  } NotifyData;
} PRINTER_NOTIFY_INFO_DATA, *PPRINTER_NOTIFY_INFO_DATA; ;

Members

Type

Indicates the type of information provided. This member can be one of the following values.

Value Meaning
JOB_NOTIFY_TYPE
0x01
Indicates that the Field member specifies a JOB_NOTIFY_FIELD_* constant.
PRINTER_NOTIFY_TYPE
0x00
Indicates that the Field member specifies a PRINTER_NOTIFY_FIELD_* constant.

Field

Indicates the field that changed. For a list of possible values, see the Remarks section.

Reserved

Reserved.

Id

Indicates the job identifier if the Type member specifies JOB_NOTIFY_TYPE. If the Type member specifies PRINTER_NOTIFY_TYPE, this member is undefined.

NotifyData

A union of data information based on the Type and Field members. For a description of the type of data associated with each field, see the Remarks section.

adwData[2]

An array of two DWORD values. For information fields that use only a single DWORD, the data is in adwData [0].

Data

cbBuf

Indicates the size, in bytes, of the buffer pointed to by pBuf.

pBuf

Pointer to a buffer that contains the field's current data.

Remarks

If the Type member specifies PRINTER_NOTIFY_TYPE, the Field member can be one of the following values.

Field Type of data Value
PRINTER_NOTIFY_FIELD_SERVER_NAME Not supported. 0x00
PRINTER_NOTIFY_FIELD_PRINTER_NAME pBuf is a pointer to a null-terminated string containing the name of the printer. 0x01
PRINTER_NOTIFY_FIELD_SHARE_NAME pBuf is a pointer to a null-terminated string that identifies the share point for the printer. 0x02
PRINTER_NOTIFY_FIELD_PORT_NAME pBuf is a pointer to a null-terminated string containing the name of the port that the print jobs will be printed to. If "Printer Pooling" is selected, this is a comma separated list of ports. 0x03
PRINTER_NOTIFY_FIELD_DRIVER_NAME pBuf is a pointer to a null-terminated string containing the name of the printer's driver. 0x04
PRINTER_NOTIFY_FIELD_COMMENT pBuf is a pointer to a null-terminated string containing the new comment string, which is typically a brief description of the printer. 0x05
PRINTER_NOTIFY_FIELD_LOCATION pBuf is a pointer to a null-terminated string containing the new physical location of the printer (for example, "Bldg. 38, Room 1164"). 0x06
PRINTER_NOTIFY_FIELD_DEVMODE pBuf is a pointer to a DEVMODE structure that defines default printer data such as the paper orientation and the resolution. 0x07
PRINTER_NOTIFY_FIELD_SEPFILE pBuf is a pointer to a null-terminated string that specifies the name of the file used to create the separator page. This page is used to separate print jobs sent to the printer. 0x08
PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR pBuf is a pointer to a null-terminated string that specifies the name of the print processor used by the printer. 0x09
PRINTER_NOTIFY_FIELD_PARAMETERS pBuf is a pointer to a null-terminated string that specifies the default print-processor parameters. 0x0A
PRINTER_NOTIFY_FIELD_DATATYPE pBuf is a pointer to a null-terminated string that specifies the data type used to record the print job. 0x0B
PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR pBuf is a pointer to a SECURITY_DESCRIPTOR structure for the printer. The pointer may be NULL if there is no security descriptor. 0x0C
PRINTER_NOTIFY_FIELD_ATTRIBUTES adwData [0] specifies the printer attributes, which can be one of the following values:
PRINTER_ATTRIBUTE_QUEUED
PRINTER_ATTRIBUTE_DIRECT
PRINTER_ATTRIBUTE_DEFAULT
PRINTER_ATTRIBUTE_SHARED
0x0D
PRINTER_NOTIFY_FIELD_PRIORITY adwData [0] specifies a priority value that the spooler uses to route print jobs. 0x0E
PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY adwData [0] specifies the default priority value assigned to each print job. 0x0F
PRINTER_NOTIFY_FIELD_START_TIME adwData [0] specifies the earliest time at which the printer will print a job. (This value is specified in minutes elapsed since 12:00 A.M.) 0x10
PRINTER_NOTIFY_FIELD_UNTIL_TIME adwData [0] specifies the latest time at which the printer will print a job. (This value is specified in minutes elapsed since 12:00 A.M.) 0x11
PRINTER_NOTIFY_FIELD_STATUS adwData [0] specifies the printer status. For a list of possible values, see the PRINTER_INFO_2 structure. 0x12
PRINTER_NOTIFY_FIELD_STATUS_STRING Not supported. 0x13
PRINTER_NOTIFY_FIELD_CJOBS adwData [0] specifies the number of print jobs that have been queued for the printer. 0x14
PRINTER_NOTIFY_FIELD_AVERAGE_PPM adwData [0] specifies the average number of pages per minute that have been printed on the printer. 0x15
PRINTER_NOTIFY_FIELD_TOTAL_PAGES Not supported. 0x16
PRINTER_NOTIFY_FIELD_PAGES_PRINTED Not supported. 0x17
PRINTER_NOTIFY_FIELD_TOTAL_BYTES Not supported. 0x18
PRINTER_NOTIFY_FIELD_BYTES_PRINTED Not supported. 0x19
PRINTER_NOTIFY_FIELD_OBJECT_GUID This is set if the object GUID changes. 0x1A
PRINTER_NOTIFY_FIELD_FRIENDLY_NAME This is set if the printer connection is renamed. 0x1B

If the Type member specifies JOB_NOTIFY_TYPE, the Field member can be one of the following values.

Field Type of data Value
JOB_NOTIFY_FIELD_PRINTER_NAME pBuf is a pointer to a null-terminated string containing the name of the printer for which the job is spooled. 0x00
JOB_NOTIFY_FIELD_MACHINE_NAME pBuf is a pointer to a null-terminated string that specifies the name of the machine that created the print job. 0x01
JOB_NOTIFY_FIELD_PORT_NAME pBuf is a pointer to a null-terminated string that identifies the port(s) used to transmit data to the printer. If a printer is connected to more than one port, the names of the ports are separated by commas (for example, "LPT1:,LPT2:,LPT3:"). 0x02
JOB_NOTIFY_FIELD_USER_NAME pBuf is a pointer to a null-terminated string that specifies the name of the user who sent the print job. 0x03
JOB_NOTIFY_FIELD_NOTIFY_NAME pBuf is a pointer to a null-terminated string that specifies the name of the user who should be notified when the job has been printed or when an error occurs while printing the job. 0x04
JOB_NOTIFY_FIELD_DATATYPE pBuf is a pointer to a null-terminated string that specifies the type of data used to record the print job. 0x05
JOB_NOTIFY_FIELD_PRINT_PROCESSOR pBuf is a pointer to a null-terminated string that specifies the name of the print processor to be used to print the job. 0x06
JOB_NOTIFY_FIELD_PARAMETERS pBuf is a pointer to a null-terminated string that specifies print-processor parameters. 0x07
JOB_NOTIFY_FIELD_DRIVER_NAME pBuf is a pointer to a null-terminated string that specifies the name of the printer driver that should be used to process the print job. 0x08
JOB_NOTIFY_FIELD_DEVMODE pBuf is a pointer to a DEVMODE structure that contains device-initialization and environment data for the printer driver. 0x09
JOB_NOTIFY_FIELD_STATUS adwData [0] specifies the job status. For a list of possible values, see the JOB_INFO_2 structure. 0x0A
JOB_NOTIFY_FIELD_STATUS_STRING pBuf is a pointer to a null-terminated string that specifies the status of the print job. 0x0B
JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR Not supported. 0x0C
JOB_NOTIFY_FIELD_DOCUMENT pBuf is a pointer to a null-terminated string that specifies the name of the print job (for example, "MS-WORD: Review.doc"). 0x0D
JOB_NOTIFY_FIELD_PRIORITY adwData [0] specifies the job priority. 0x0E
JOB_NOTIFY_FIELD_POSITION adwData [0] specifies the job's position in the print queue. 0x0F
JOB_NOTIFY_FIELD_SUBMITTED pBuf is a pointer to a SYSTEMTIME structure that specifies the time when the job was submitted. 0x10
JOB_NOTIFY_FIELD_START_TIME adwData [0] specifies the earliest time that the job can be printed. (This value is specified in minutes elapsed since 12:00 A.M.) 0x11
JOB_NOTIFY_FIELD_UNTIL_TIME adwData [0] specifies the latest time that the job can be printed. (This value is specified in minutes elapsed since 12:00 A.M.) 0x12
JOB_NOTIFY_FIELD_TIME adwData [0] specifies the total time, in seconds, that has elapsed since the job began printing. 0x13
JOB_NOTIFY_FIELD_TOTAL_PAGES adwData [0] specifies the size, in pages, of the job. 0x14
JOB_NOTIFY_FIELD_PAGES_PRINTED adwData [0] specifies the number of pages that have printed. 0x15
JOB_NOTIFY_FIELD_TOTAL_BYTES adwData [0] specifies the size, in bytes, of the job. 0x16
JOB_NOTIFY_FIELD_BYTES_PRINTED adwData [0] specifies the number of bytes that have been printed on this job. For this field, the change notification object is signaled when bytes are sent to the printer. 0x17

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Winspool.h (include Windows.h)

See also

Printing

Print Spooler API Structures

DEVMODE

FindNextPrinterChangeNotification

JOB_INFO_2

PRINTER_INFO_2

PRINTER_NOTIFY_INFO

SECURITY_DESCRIPTOR

SYSTEMTIME