网站首页  词典首页

请输入您要查询的函数:

 

术语 getprinterdataex
释义 GetPrinterDataEx
语法:
DWORD GetPrinterDataEx(
__in HANDLE hPrinter,
__in LPCTSTR pKeyName,
__in LPCTSTR pValueName,
__out LPDWORD pType,
__out LPBYTE pData,
__in DWORD nSize,
__out LPDWORD pcbNeeded
);
GetPrinterDataEx功能
该GetPrinterDataEx函数检索指定的打印机或打印服务器的配置数据。 GetPrinterDataEx可以检索功能的SetPrinterData存储的值。此外,GetPrinterDataEx可以检索下的SetPrinterDataEx函数指定键存储的值。
参数
hPrinter [in]
句柄到打印机或打印服务器的功能配置数据检索。使用OpenPrinter或添加打印机函数检索打印机处理。
pKeyName [in]
一个指向 null 结尾的字符串指针,包含指定键的值进行检索。使用反斜杠(\\)作为分隔符指定的路径有一个或多个子项。
如果hPrinter是一个句柄到打印机和pKeyName是NULL或空字符串,GetPrinterDataEx返回ERROR_INVALID_PARAMETER。
如果hPrinter是一个句柄到打印服务器,pKeyName被忽略。
pValueName [in]
一个指向 null 结尾的字符串指针,标识的数据检索。
对于打印机,此字符串指定下pKeyName关键的值的名称。
对于打印服务器,这个字符串是在以下备注一节中列出的预定义字符串之一。
pType [out]
一个变量,它接收的数据存储的值类型的指针。该函数返回的SetPrinterDataEx调用中指定的类型时,数据存储。此参数可以为NULL,如果您不需要的信息。 GetPrinterDataEx传递pType作为一个RegQueryValueEx函数调用lpdwType参数。
pData [out]
阿一个缓冲区,它接收配置数据的指针。
nSize [in]
大小,指出以字节为缓冲区的pData。
pcbNeeded [out]
一个变量,它接收的字节大小的配置数据,指针。如果缓冲区大小nSize指定太小,函数返回ERROR_MORE_DATA,并pcbNeeded显示所需的缓冲区大小。
返回值
如果函数成功,返回值是ERROR_SUCCESS。
如果函数失败,返回值是一个错误值。
备注
GetPrinterDataEx检索打印机的SetPrinterDataEx和SetPrinterData功能设置配置数据。
如果hPrinter是一个句柄到打印服务器,pValueName可以指定以下预定义值之一。
ValueComments
SPLREG_ALLOW_USER_MANAGEFORMSWindows XP的带有Service Pack 2(SP2)和更高版本
的Windows Server 2003带有Service Pack 1(SP1)和更高版本
SPLREG_ARCHITECTURE
SPLREG_BEEP_ENABLED
SPLREG_DEFAULT_SPOOL_DIRECTORY
SPLREG_DNS_MACHINE_NAME
SPLREG_DS_PRESENTOn成功返回,pData包含0x0001如果机器上的DS域,否则为0的。
SPLREG_DS_PRESENT_FOR_USEROn成功返回,pData包含0x0001如果用户到一个DS域,否则为0记录。
SPLREG_EVENT_LOG
SPLREG_MAJOR_VERSION
SPLREG_MINOR_VERSION
SPLREG_NET_POPUP
SPLREG_NET_POPUP_TO_COMPUTEROn成功返回,pData包含1如果工作通知应发送到客户端计算机,或者0,如果工作通知应发送给用户。
SPLREG_OS_VERSIONWindows XP和更高
SPLREG_OS_VERSIONEX
SPLREG_PORT_THREAD_PRIORITY_DEFAULT
SPLREG_PORT_THREAD_PRIORITY
SPLREG_PRINT_DRIVER_ISOLATION_GROUPS_SEPARATORWindows 7及更高版本
SPLREG_PRINT_DRIVER_ISOLATION_GROUPSWindows 7及更高版本
SPLREG_PRINT_DRIVER_ISOLATION_TIME_BEFORE_RECYCLEWindows 7及更高版本
SPLREG_PRINT_DRIVER_ISOLATION_MAX_OBJECTS_BEFORE_RECYCLEWindows 7及更高版本
SPLREG_PRINT_DRIVER_ISOLATION_IDLE_TIMEOUT Windows 7和更高版本
SPLREG_PRINT_DRIVER_ISOLATION_EXECUTION_POLICYWindows 7及更高版本
SPLREG_PRINT_DRIVER_ISOLATION_OVERRIDE_POLICYWindows 7及更高版本
SPLREG_REMOTE_FAXOn成功返回,pData包含0x0001如果传真服务支持远程客户端,否则为0。
SPLREG_RETRY_POPUPOn成功返回,pData包含1如果服务器设置为重试所有工作,或0弹出窗口,如果服务器不重试所有职位弹出窗口。
SPLREG_SCHEDULER_THREAD_PRIORITY
SPLREG_SCHEDULER_THREAD_PRIORITY_DEFAULT
SPLREG_WEBSHAREMGMTWindows Server 2003和更高版本。
SPLREG_W3SVCINSTALLED
对pValueName下面的值指示池印刷的行为发生错误时。
ValueComments
SPLREG_RESTART_JOB_ON_POOL_ERRORThe的pData值表示时间,以秒,当工作在另一个端口重新启动后就会出现错误。此设置用于SPLREG_RESTART_JOB_ON_POOL_ENABLED。
SPLREG_RESTART_JOB_ON_POOL_ENABLEDA在pData非零值表明SPLREG_RESTART_JOB_ON_POOL_ERROR启用。
在SPLREG_RESTART_JOB_ON_POOL_ERROR指定的时间是最短的时间。实际的时间可以更长,这取决于以下端口监视器设置,这是发现在HKLM \\系统\\ CurrentControlSet \\控制\\打印\\监视器\\ MonitorName \\端口。
端口监视器settingMeaning
StatusUpdateEnabledIf一个非零值,使端口监视器更新与端口的地位后台处理程序。
StatusUpdateIntervalSpecifies的时间间隔,以秒为单位,当端口监视器更新与端口的地位后台处理程序。
调用设置为“PrinterDriverData的pKeyName参数GetPrinterDataEx”等同于调用GetPrinterData功能。
如果pKeyName是预定义的目录服务(DS)的关键因素之一(见SetPrinter)和pValueName包含一个逗号(','),则pValueName逗号之前的部分是作为值名称和pValueName部分的使用权在逗号用作副属性的OID。所谓的OID的一个子项创建一个新的价值值的名称组成和OID正在进入关键的OID。 SetPrinterDataEx还增加了副项下的值名称和数据。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinspool.h(头文件:winuser.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode和ANSI namesGetPrinterDataExW(Unicode)和GetPrinterDataExA(ANSI)的
参见
Printing and Print Spooler Overview
Printing and Print Spooler 函数
OpenPrinter
SetPrinterDataEx
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetPrinterDataEx Function
The GetPrinterDataEx function retrieves configuration data for the specified printer or print server. GetPrinterDataEx can retrieve values stored by the SetPrinterData function. In addition, GetPrinterDataEx can retrieve values stored under a specified key by the SetPrinterDataEx function.
Syntax
DWORD GetPrinterDataEx(
__in HANDLE hPrinter,
__in LPCTSTR pKeyName,
__in LPCTSTR pValueName,
__out LPDWORD pType,
__out LPBYTE pData,
__in DWORD nSize,
__out LPDWORD pcbNeeded
);
Parameters
hPrinter [in]
A handle to the printer or print server for which the function retrieves configuration data. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.
pKeyName [in]
A pointer to a null-terminated string that specifies the key containing the value to be retrieved. Use the backslash ( \\ ) character as a delimiter to specify a path that has one or more subkeys.
If hPrinter is a handle to a printer and pKeyName is NULL or an empty string, GetPrinterDataEx returns ERROR_INVALID_PARAMETER.
If hPrinter is a handle to a print server, pKeyName is ignored.
pValueName [in]
A pointer to a null-terminated string that identifies the data to retrieve.
For printers, this string specifies the name of a value under the pKeyName key.
For print servers, this string is one of the predefined strings listed in the following Remarks section.
pType [out]
A pointer to a variable that receives the type of data stored in the value. The function returns the type specified in the SetPrinterDataEx call when the data was stored. This parameter can be NULL if you don't need the information. GetPrinterDataEx passes pType on as the lpdwType parameter of a RegQueryValueEx function call.
pData [out]
A pointer to a buffer that receives the configuration data.
nSize [in]
The size, in bytes, of the buffer pointed to by pData.
pcbNeeded [out]
A pointer to a variable that receives the size, in bytes, of the configuration data. If the buffer size specified by nSize is too small, the function returns ERROR_MORE_DATA, and pcbNeeded indicates the required buffer size.
Return Value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is an error value.
Remarks
GetPrinterDataEx retrieves printer-configuration data set by the SetPrinterDataEx and SetPrinterData functions.
If hPrinter is a handle to a print server, pValueName can specify one of the following predefined values.
ValueComments
SPLREG_ALLOW_USER_MANAGEFORMSWindows XP with Service Pack 2 (SP2) and later
Windows Server 2003 with Service Pack 1 (SP1) and later
SPLREG_ARCHITECTURE
SPLREG_BEEP_ENABLED
SPLREG_DEFAULT_SPOOL_DIRECTORY
SPLREG_DNS_MACHINE_NAME
SPLREG_DS_PRESENTOn successful return, pData contains 0x0001 if the machine is on a DS domain, 0 otherwise.
SPLREG_DS_PRESENT_FOR_USEROn successful return, pData contains 0x0001 if the user is logged onto a DS domain, 0 otherwise.
SPLREG_EVENT_LOG
SPLREG_MAJOR_VERSION
SPLREG_MINOR_VERSION
SPLREG_NET_POPUP
SPLREG_NET_POPUP_TO_COMPUTEROn successful return, pData contains 1 if job notifications should be sent to the client computer, or 0 if job notifications are to be sent to the user.
SPLREG_OS_VERSIONWindows XP and later
SPLREG_OS_VERSIONEX
SPLREG_PORT_THREAD_PRIORITY_DEFAULT
SPLREG_PORT_THREAD_PRIORITY
SPLREG_PRINT_DRIVER_ISOLATION_GROUPS_SEPARATORWindows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_GROUPSWindows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_TIME_BEFORE_RECYCLEWindows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_MAX_OBJECTS_BEFORE_RECYCLEWindows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_IDLE_TIMEOUT Windows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_EXECUTION_POLICYWindows 7 and later
SPLREG_PRINT_DRIVER_ISOLATION_OVERRIDE_POLICYWindows 7 and later
SPLREG_REMOTE_FAXOn successful return, pData contains 0x0001 if the FAX service supports remote clients, 0 otherwise.
SPLREG_RETRY_POPUPOn successful return, pData contains 1 if server is set to retry PopUps for all jobs, or 0 if server does not retry PopUps for all jobs.
SPLREG_SCHEDULER_THREAD_PRIORITY
SPLREG_SCHEDULER_THREAD_PRIORITY_DEFAULT
SPLREG_WEBSHAREMGMTWindows Server 2003 and later.
SPLREG_W3SVCINSTALLED

The following values of pValueName indicate the pool printing behavior when an error occurs.
ValueComments
SPLREG_RESTART_JOB_ON_POOL_ERRORThe value of pData indicates the time, in seconds, when a job is restarted on another port after an error occurs. This setting is used with SPLREG_RESTART_JOB_ON_POOL_ENABLED.
SPLREG_RESTART_JOB_ON_POOL_ENABLEDA nonzero value in pData indicates that SPLREG_RESTART_JOB_ON_POOL_ERROR is enabled.

The time specified in SPLREG_RESTART_JOB_ON_POOL_ERROR is a minimum time. The actual time can be longer, depending on the following port monitor settings, which are found under HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print\\Monitors\\MonitorName\\Ports.
Port monitor settingMeaning
StatusUpdateEnabledIf a nonzero value, enables the port monitor to update the spooler with the port status.
StatusUpdateIntervalSpecifies the interval, in seconds, when the port monitor updates the spooler with the port status.

Calling GetPrinterDataEx with the pKeyName parameter set to "PrinterDriverData" is equivalent to calling the GetPrinterData function.
If pKeyName is one of the predefined Directory Service (DS) keys (see SetPrinter ) and pValueName contains a comma (','), then the portion of pValueName before the comma is used as the value name and the portion of pValueName to the right of the comma is used as the DS Property OID. A subkey called OID is created and a new value consisting of the value name and OID is entered under the OID key. SetPrinterDataEx also adds the value name and data under the DS key.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinspool.h (include Windows.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode and ANSI namesGetPrinterDataExW (Unicode) and GetPrinterDataExA (ANSI)
See Also
Printing and Print Spooler Overview
Printing and Print Spooler Functions
OpenPrinter
SetPrinterDataEx
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144913(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:24:05