大网数据广告活动
打印与设备

PRINTER_INFO_7 structure (Winspool.h)

· 52CE 我爱测

The PRINTER_INFO_7 structure specifies directory services printer information.

The PRINTER_INFO_7 structure specifies directory services printer information. Use this structure with the SetPrinter function to publish a printer's data in the directory service (DS), or to update or remove a printer's published data from the DS. Use this structure with the GetPrinter function to determine whether a printer is published in the DS.

Syntax

typedef struct _PRINTER_INFO_7 {
  LPTSTR pszObjectGUID;
  DWORD  dwAction;
} PRINTER_INFO_7, *PPRINTER_INFO_7;

Members

pszObjectGUID

A pointer to a null-terminated string containing the GUID of the directory service print queue object associated with a published printer. Use the GetPrinter function to retrieve this GUID.

Before calling SetPrinter, set pszObjectGUID to NULL.

dwAction

Indicates the action for the SetPrinter function to perform. For the GetPrinter function, this member indicates whether the specified printer is published. This member can be a combination of the following values.

Value Meaning
DSPRINT_PENDING 0x80000000 GetPrinter: Indicates that the system is attempting to complete a publish or unpublish operation started by a SetPrinter call. SetPrinter: This value is not valid.
DSPRINT_PUBLISH 0x00000001 SetPrinter: Publishes the printer's data in the DS. GetPrinter: Indicates the printer is published.
DSPRINT_REPUBLISH 0x00000008 SetPrinter: The DS data for the printer is unpublished and then published again, refreshing all properties in the published printer. Re-publishing also changes the GUID of the published printer. GetPrinter: Never returns this value.
DSPRINT_UNPUBLISH 0x00000004 SetPrinter: Removes the printer's published data from the DS. GetPrinter: Indicates the printer is not published.
DSPRINT_UPDATE 0x00000002 SetPrinter: Updates the printer's published data in the DS. GetPrinter: Never returns this value.

Remarks

The PRINTER_INFO_7 structure is used in a SetPrinter call to publish printer information to the directory service. The published data includes all values and data for the specified printer found under the SPLDS_SPOOLER_KEY, SPLDS_DRIVER_KEY, or SPLDS_USER_KEY keys created by SetPrinterDataEx.

For SetPrinter, pszObjectGUID should be set to NULL. For GetPrinter, pszObjectGUID returns the GUID of the directory services print queue object associated with a published printer. You can use this GUID with Active Directory Services Interface (ADSI) methods to retrieve published data for the printer. However, the recommended method for retrieving published data is to call the GetPrinterDataEx function.

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)
Unicode and ANSI names _PRINTER_INFO_7W (Unicode) and _PRINTER_INFO_7A (ANSI)

See also

Printing

Print Spooler API Structures

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。