网站首页  词典首页

请输入您要查询的函数:

 

术语 getprinterdata
释义 GetPrinterData
语法:
DWORD GetPrinterData(
__in HANDLE hPrinter,
__in LPTSTR pValueName,
__out LPDWORD pType,
__out LPBYTE pData,
__in DWORD nSize,
__out LPDWORD pcbNeeded
);
GetPrinterData功能
该GetPrinterData函数检索指定的打印机或打印服务器的配置数据。
在Windows 2000及更高版本的Windows,称GetPrinterData等同于调用设置为“PrinterDriverData的pKeyName参数GetPrinterDataEx功能”。
参数
hPrinter [in]
句柄到打印机或打印服务器的功能配置数据检索。使用OpenPrinter或添加打印机函数检索打印机处理。
pValueName [in]
一个指向 null 结尾的字符串指针,标识的数据检索。
打印机,这个字符串是根据打印机的名称注册表值在注册表中的“PrinterDriverData”键。
对于打印服务器,这个字符串是在以下备注一节中列出的预定义字符串之一。
pType [out]
一个变量,它接收的数据类型的指针检索。该函数返回的SetPrinterData或SetPrinterDataEx指定换证的类型时,数据存储。此参数可以为NULL,如果您不需要的信息。
pData [out]
阿一个缓冲区,它接收配置数据的指针。
nSize [in]
大小,指出以字节为缓冲区的pData。
pcbNeeded [out]
一个变量,它接收的字节大小的配置数据,指针。如果缓冲区大小nSize指定太小,函数返回ERROR_MORE_DATA,并pcbNeeded显示所需的缓冲区大小。
返回值
如果函数成功,返回值是ERROR_SUCCESS。如果函数失败,返回值是一个错误值。
备注
GetPrinterData检索打印机由SetPrinterDataEx或SetPrinterData功能设置配置数据。
GetPrinterData可能会触发一个Windows调用GetPrinterDataFromPort。 (请参阅Windows开发工具包,原驱动程序开发工具包,获得更多关于GetPrinterDataFromPort信息。)功能,后者可以写入注册表。如果是这样,可能有副作用,如触发的更新/升级打印机事件ID在客户端20,如果打印机是网络共享。
如果hPrinter是一个句柄到打印服务器,pValueName可以指定以下预定义值之一。
ValueComments
SPLREG_ALLOW_USER_MANAGEFORMSWindows XP SP2或更高
的Windows Server 2003 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的时间间隔,以秒为单位,当端口监视器更新与端口的地位后台处理程序。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinspool.h(头文件:winuser.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode和ANSI namesGetPrinterDataW(Unicode)和GetPrinterDataA(ANSI)的
参见
Printing and Print Spooler Overview
Printing and Print Spooler 函数
GetPrinterDataEx
OpenPrinter
SetPrinter
SetPrinterData
SetPrinterDataEx
PRINTPROCESSOR_CAPS_1
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==GetPrinterData Function
The GetPrinterData function retrieves configuration data for the specified printer or print server.
In Windows 2000 and later versions of Windows, calling GetPrinterData is equivalent to calling the GetPrinterDataEx function with the pKeyName parameter set to "PrinterDriverData".
Syntax
DWORD GetPrinterData(
__in HANDLE hPrinter,
__in LPTSTR 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.
pValueName [in]
A pointer to a null-terminated string that identifies the data to retrieve.
For printers, this string is the name of a registry value under the printer's "PrinterDriverData" key in the registry.
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 retrieved. The function returns the type specified in the SetPrinterData or SetPrinterDataEx call when the data was stored. This parameter can be NULL if you don't need the information.
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
GetPrinterData retrieves printer-configuration data set by the SetPrinterDataEx or SetPrinterData function.
GetPrinterData may trigger a Windows call to GetPrinterDataFromPort. (See the Windows Development Kit, formerly Driver Development Kit, for more information about GetPrinterDataFromPort.) The latter function may write to the registry. If it does, there may be side effects like triggering an update/upgrade printer event ID 20 in the client, if the printer is shared in a network.
If hPrinter is a handle to a print server, pValueName can specify one of the following predefined values.
ValueComments
SPLREG_ALLOW_USER_MANAGEFORMSWindows XP SP2 or later
Windows Server 2003 SP1 or 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 or later
SPLREG_OS_VERSIONEX
SPLREG_PORT_THREAD_PRIORITY_DEFAULT
SPLREG_PORT_THREAD_PRIORITY
SPLREG_PRINT_DRIVER_ISOLATION_GROUPS_SEPARATORWindows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_GROUPSWindows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_TIME_BEFORE_RECYCLEWindows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_MAX_OBJECTS_BEFORE_RECYCLEWindows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_IDLE_TIMEOUT Windows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_EXECUTION_POLICYWindows 7 or later
SPLREG_PRINT_DRIVER_ISOLATION_OVERRIDE_POLICYWindows 7 or 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 or 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.

Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinspool.h (include Windows.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode and ANSI namesGetPrinterDataW (Unicode) and GetPrinterDataA (ANSI)
See Also
Printing and Print Spooler Overview
Printing and Print Spooler Functions
GetPrinterDataEx
OpenPrinter
SetPrinter
SetPrinterData
SetPrinterDataEx
PRINTPROCESSOR_CAPS_1
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd144912(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 11:22:11