Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
PRINTER_INFO_2

PRINTER_INFO_2 structure

The PRINTER_INFO_2 structure specifies detailed printer information.

Syntax


typedef struct _PRINTER_INFO_2 {
  LPTSTR               pServerName;
  LPTSTR               pPrinterName;
  LPTSTR               pShareName;
  LPTSTR               pPortName;
  LPTSTR               pDriverName;
  LPTSTR               pComment;
  LPTSTR               pLocation;
  LPDEVMODE            pDevMode;
  LPTSTR               pSepFile;
  LPTSTR               pPrintProcessor;
  LPTSTR               pDatatype;
  LPTSTR               pParameters;
  PSECURITY_DESCRIPTOR pSecurityDescriptor;
  DWORD                Attributes;
  DWORD                Priority;
  DWORD                DefaultPriority;
  DWORD                StartTime;
  DWORD                UntilTime;
  DWORD                Status;
  DWORD                cJobs;
  DWORD                AveragePPM;
} PRINTER_INFO_2, *PPRINTER_INFO_2;

Members

pServerName

A pointer to a null-terminated string identifying the server that controls the printer. If this string is NULL, the printer is controlled locally.

pPrinterName

A pointer to a null-terminated string that specifies the name of the printer.

pShareName

A pointer to a null-terminated string that identifies the share point for the printer. (This string is used only if the PRINTER_ATTRIBUTE_SHARED constant was set for the Attributes member.)

pPortName

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 each port must be separated by commas (for example, "LPT1:,LPT2:,LPT3:").

pDriverName

A pointer to a null-terminated string that specifies the name of the printer driver.

pComment

A pointer to a null-terminated string that provides a brief description of the printer.

pLocation

A pointer to a null-terminated string that specifies the physical location of the printer (for example, "Bldg. 38, Room 1164").

pDevMode

A pointer to a DEVMODE structure that defines default printer data such as the paper orientation and the resolution.

pSepFile

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.

pPrintProcessor

A pointer to a null-terminated string that specifies the name of the print processor used by the printer. You can use the EnumPrintProcessors function to obtain a list of print processors installed on a server.

pDatatype

A pointer to a null-terminated string that specifies the data type used to record the print job. You can use the EnumPrintProcessorDatatypes function to obtain a list of data types supported by a specific print processor.

pParameters

A pointer to a null-terminated string that specifies the default print-processor parameters.

pSecurityDescriptor

A pointer to a SECURITY_DESCRIPTOR structure for the printer. This member may be NULL.

Attributes

The printer attributes. This member can be any reasonable combination of the following values.

ValueMeaning
PRINTER_ATTRIBUTE_DIRECTJob is sent directly to the printer (it is not spooled).
PRINTER_ATTRIBUTE_DO_COMPLETE_FIRSTIf set and printer is set for print-while-spooling, any jobs that have completed spooling are scheduled to print before jobs that have not completed spooling.
PRINTER_ATTRIBUTE_ENABLE_DEVQIf set, DevQueryPrint is called. DevQueryPrint may fail if the document and printer setups do not match. Setting this flag causes mismatched documents to be held in the queue.
PRINTER_ATTRIBUTE_HIDDENReserved.
PRINTER_ATTRIBUTE_KEEPPRINTEDJOBSIf set, jobs are kept after they are printed. If unset, jobs are deleted.
PRINTER_ATTRIBUTE_LOCALPrinter is a local printer.
PRINTER_ATTRIBUTE_NETWORKPrinter is a network printer connection.
PRINTER_ATTRIBUTE_PUBLISHED Indicates whether the printer is published in the directory service.
PRINTER_ATTRIBUTE_QUEUEDIf set, the printer spools and starts printing after the last page is spooled. If not set and PRINTER_ATTRIBUTE_DIRECT is not set, the printer spools and prints while spooling.
PRINTER_ATTRIBUTE_RAW_ONLYIndicates that only raw data type print jobs can be spooled.
PRINTER_ATTRIBUTE_SHAREDPrinter is shared.

 

In Windows XP and later versions of Windows, the following value can also be used.

ValueMeaning
PRINTER_ATTRIBUTE_FAX If set, printer is a fax printer. This can only be set by AddPrinter, but it can be retrieved by EnumPrinters and GetPrinter.

 

In Windows Vista and later versions of Windows, the following values can also be used.

ValueMeaning
PRINTER_ATTRIBUTE_FRIENDLY_NAME A computer has connected to this printer and given it a friendly name.
PRINTER_ATTRIBUTE_MACHINE Printer is a per-machine connection.
PRINTER_ATTRIBUTE_PUSHED_USER The printer was installed by using the Push Printer Connections user policy.
PRINTER_ATTRIBUTE_PUSHED_MACHINE The printer was installed by using the Push Printer Connections computer policy.

 

In Windows Server 2003, the following value can also be used.

ValueMeaning
PRINTER_ATTRIBUTE_TS Indicates the printer is currently connected through a terminal server.

 

Priority

A priority value that the spooler uses to route print jobs.

DefaultPriority

The default priority value assigned to each print job.

StartTime

The earliest time at which the printer will print a job. This value is expressed as minutes elapsed since 12:00 AM GMT (Greenwich Mean Time).

UntilTime

The latest time at which the printer will print a job. This value is expressed as minutes elapsed since 12:00 AM GMT (Greenwich Mean Time).

Status

The printer status. This member can be any reasonable combination of the following values.

ValueMeaning
PRINTER_STATUS_BUSYThe printer is busy.
PRINTER_STATUS_DOOR_OPENThe printer door is open.
PRINTER_STATUS_ERRORThe printer is in an error state.
PRINTER_STATUS_INITIALIZINGThe printer is initializing.
PRINTER_STATUS_IO_ACTIVEThe printer is in an active input/output state
PRINTER_STATUS_MANUAL_FEEDThe printer is in a manual feed state.
PRINTER_STATUS_NO_TONERThe printer is out of toner.
PRINTER_STATUS_NOT_AVAILABLEThe printer is not available for printing.
PRINTER_STATUS_OFFLINEThe printer is offline.
PRINTER_STATUS_OUT_OF_MEMORYThe printer has run out of memory.
PRINTER_STATUS_OUTPUT_BIN_FULLThe printer's output bin is full.
PRINTER_STATUS_PAGE_PUNTThe printer cannot print the current page.
PRINTER_STATUS_PAPER_JAMPaper is jammed in the printer
PRINTER_STATUS_PAPER_OUTThe printer is out of paper.
PRINTER_STATUS_PAPER_PROBLEMThe printer has a paper problem.
PRINTER_STATUS_PAUSEDThe printer is paused.
PRINTER_STATUS_PENDING_DELETIONThe printer is being deleted.
PRINTER_STATUS_POWER_SAVEThe printer is in power save mode.
PRINTER_STATUS_PRINTINGThe printer is printing.
PRINTER_STATUS_PROCESSINGThe printer is processing a print job.
PRINTER_STATUS_SERVER_UNKNOWNThe printer status is unknown.
PRINTER_STATUS_TONER_LOWThe printer is low on toner.
PRINTER_STATUS_USER_INTERVENTIONThe printer has an error that requires the user to do something.
PRINTER_STATUS_WAITINGThe printer is waiting.
PRINTER_STATUS_WARMING_UPThe printer is warming up.

 

cJobs

The number of print jobs that have been queued for the printer.

AveragePPM

The average number of pages per minute that have been printed on the printer.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winspool.h (include Windows.h)

Unicode and ANSI names

_PRINTER_INFO_2W (Unicode) and _PRINTER_INFO_2A (ANSI)

See also

Printing
Print Spooler API Structures
DEVMODE
EnumPrinters
PRINTER_INFO_1
PRINTER_INFO_3
PRINTER_INFO_4
SECURITY_DESCRIPTOR

 

 

Community Additions

ADD
Show:
© 2015 Microsoft