网站首页  词典首页

请输入您要查询的函数:

 

术语 addprinterdriverex
释义 AddPrinterDriverEx
语法:
BOOL AddPrinterDriverEx(
__in LPTSTR pName,
__in DWORD Level,
__inout LPBYTE pDriverInfo,
__in DWORD dwFileCopyFlags
);
AddPrinterDriverEx功能
该AddPrinterDriverEx函数安装一个本地或远程打印机驱动程序和链接配置,数据和驱动程序文件。除了具有AddPrinterDriver的能力,它也有严格的选择,允许升级,严格的降级,在较新的文件复制只,和所有文件复制(不论文件时间戳)。
参数
pName [in]
一个指向 null 结尾的字符串指针,指定使用该驱动程序应安装服务器的名称。如果该参数为NULL,则函数安装在本地计算机上的驱动程序。
Level [in]
结构的版本的pDriverInfo点。该值可以是2,3,4,6,或8。
pDriverInfo [ in , out ]
一个结构包含的打印机驱动程序信息的指针。它可以是下列之一。
对LevelDRIVER_INFO_价值*结构
2DRIVER_INFO_2
3DRIVER_INFO_3
4DRIVER_INFO_4
6DRIVER_INFO_6
8DRIVER_INFO_8
如果结构pEnvironment成员指向pDriverInfo为NULL,则函数使用的调用方目前的环境/客户,而不是目标环境/服务器。
dwFileCopyFlags [in]
用于复制驱动程序文件的选项。此参数可以是下列值之一。
ValueMeaning
APD_COPY_ALL_FILESAdd打印机驱动程序和复制的所有打印机驱动程序目录中的文件。该文件时间戳被忽略此选项。
APD_COPY_FROM_DIRECTORYAdd打印机驱动程序使用完全合格的文件在DRIVER_INFO_6结构指定的名称。这个标志或运算与其他结合复制标志之一。如果设置此标志,AddPrinterDriverEx将失败,如果文件不存在指定他们存在的DRIVER_INFO_6结构。这些文件并不需要被复制到系统的打印机驱动程序的目录。见备注。
Windows 2000中:这个标志是不支持。
APD_COPY_NEW_FILESAdd打印机驱动程序和复制文件在打印机驱动程序目录,比任何目前正在使用新的相应的文件。此标志模拟了AddPrinterDriver行为。
APD_STRICT_DOWNGRADEAdd打印机驱动程序只有在所有文件中的打印机驱动程序目录中老年人比目前正在使用的任何相应的文件。
APD_STRICT_UPGRADEAdd打印机驱动程序只有在所有文件中的打印机驱动程序的目录是比目前正在使用的任何相应的文件。
返回值
如果函数成功,返回值是一个非零值。
如果函数失败,返回值是零。
如果打印机驱动程序已知问题与操作系统的工作,AddPrinterDriverEx将失败,下面的错误代码之一:
错误CodeMeaning
ERROR_PRINTER_DRIVER_BLOCKEDThe驱动程序不工作的操作系统。
ERROR_PRINTER_DRIVER_WARNEDThe司机是不可靠的操作系统。但是,如果APD_INSTALL_WARNED_DRIVER指定的驱动程序安装,并给出任何警告。
有关详细信息,请参见备注。
备注
调用者必须有相关权限。
在调用AddPrinterDriverEx功能,所有文件所必需的驱动程序必须复制到系统的打印机驱动程序的目录。要检索此目录的名称,调用GetPrinterDriverDirectory功能。
要确定哪些打印机驱动程序正在安装,调用EnumPrinterDrivers功能。
如果打印机驱动程序已成功添加的函数调用DrvDriverEvent(DRIVER_EVENT_INITIALIZE,级别,DRIVER_INFO_ *,lparam的)功能,让驱动程序执行过程中的打印机驱动程序的安装所需的任何初始化。欲了解更多有关DrvDriverEvent信息,请参阅Microsoft Windows驱动程序开发工具包(DDK)
该驱动程序不应该使用在向DrvDriverEvent调用界面调用。做用户界面有关的工作,安装应该使用的打印机的。inf文件VendorSetup入境或为即插即用设备,安装程序可以使用的设备,具体的合作安装。欲了解更多有关VendorSetup信息,请参阅DDK中。
即是在DRIVER_INFO_6结构的引用必须是本地的机器从中调用文件。文件名可以是一样长的UNC名称UNC名称是本地计算机。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinspool.h(头文件:winuser.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode和ANSI namesAddPrinterDriverExW(Unicode)和AddPrinterDriverExA(ANSI)的
参见
Printing and Print Spooler Overview
Printing and Print Spooler 函数
AddPrinterDriver
DRIVER_INFO_2
DRIVER_INFO_3
DRIVER_INFO_4
DRIVER_INFO_6
DeletePrinterDriverEx
EnumPrinterDrivers
GetPrinterDriverDirectory
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年7月11日
==英文原文==AddPrinterDriverEx Function
The AddPrinterDriverEx function installs a local or remote printer driver and links the configuration, data, and driver files. Besides having the capabilities of AddPrinterDriver , it also has options that permit strict upgrade, strict downgrade, copying of newer files only, and copying of all files (regardless of file time stamps).
Syntax
BOOL AddPrinterDriverEx(
__in LPTSTR pName,
__in DWORD Level,
__inout LPBYTE pDriverInfo,
__in DWORD dwFileCopyFlags
);
Parameters
pName [in]
A pointer to a null-terminated string that specifies the name of the server on which the driver should be installed. If this parameter is NULL, the function installs the driver on the local computer.
Level [in]
The version of the structure to which pDriverInfo points. This value can be 2, 3, 4, 6, or 8.
pDriverInfo [in, out]
A pointer to a structure containing printer driver information. It can be one of the following.
Value of LevelDRIVER_INFO_* Structure
2DRIVER_INFO_2
3DRIVER_INFO_3
4DRIVER_INFO_4
6DRIVER_INFO_6
8DRIVER_INFO_8

If the pEnvironment member of the structure pointed to by pDriverInfo is NULL, the function uses the current environment of the caller/client, not the environment of the destination/server.
dwFileCopyFlags [in]
The options for copying the driver files. This parameter can be one of the following values.
ValueMeaning
APD_COPY_ALL_FILESAdd the printer driver and copy all the files in the printer-driver directory. The file time stamps are ignored with this option.
APD_COPY_FROM_DIRECTORYAdd the printer driver using the fully qualified file names specified in the DRIVER_INFO_6 structure. This flag is ORed in conjunction with one of the other copy flags. If this flag is set, AddPrinterDriverEx will fail if the files do not exist where they are specified to exist by the DRIVER_INFO_6 structure. The files do not need to be copied to the system's printer-driver directory. See the Remarks.
Windows 2000: This flag is not supported.
APD_COPY_NEW_FILESAdd the printer driver and copy the files in the printer-driver directory that are newer than any corresponding files that are currently in use. This flag emulates the behavior of AddPrinterDriver.
APD_STRICT_DOWNGRADEAdd the printer driver only if all the files in the printer-driver directory are older than any corresponding files currently in use.
APD_STRICT_UPGRADEAdd the printer driver only if all the files in the printer-driver directory are newer than any corresponding files currently in use.

Return Value
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero.
If the printer driver is known to have problems working with the operating system, AddPrinterDriverEx will fail with one of the following error codes:
Error CodeMeaning
ERROR_PRINTER_DRIVER_BLOCKEDThe driver does not work on the operating system.
ERROR_PRINTER_DRIVER_WARNEDThe driver is unreliable on the operating system. However, if APD_INSTALL_WARNED_DRIVER is specified, the driver is installed and no warning is given.

For more information, see the Remarks.
Remarks
The caller must have the SeLoadDriverPrivilege .
Before calling the AddPrinterDriverEx function, all files required by the driver must be copied to the system's printer-driver directory. To retrieve the name of this directory, call the GetPrinterDriverDirectory function.
To determine which printer drivers are currently installed, call the EnumPrinterDrivers function.
If the printer driver has been successfully added, the function calls the DrvDriverEvent (DRIVER_EVENT_INITIALIZE, Level, DRIVER_INFO_*, lparam ) function to allow the driver to perform any initializations required during the installation of a printer driver. For more information about DrvDriverEvent, see the Microsoft Windows Driver Development Kit (DDK)
The driver should not use a UI call during the call to DrvDriverEvent. To do UI-related jobs, the installer should either use the VendorSetup entry in the printer's .inf file or, for Plug and Play devices, the installer can use a device-specific co-installer. For more information about VendorSetup, see the DDK.
The files that are referenced in the DRIVER_INFO_6 structure must be local to the machine from which the call is made. A file name can be a UNC name as long as the UNC name is the local machine.
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinspool.h (include Windows.h)
LibraryWinspool.lib
DLLSpoolss.dll
Unicode and ANSI namesAddPrinterDriverExW (Unicode) and AddPrinterDriverExA (ANSI)
See Also
Printing and Print Spooler Overview
Printing and Print Spooler Functions
AddPrinterDriver
DRIVER_INFO_2
DRIVER_INFO_3
DRIVER_INFO_4
DRIVER_INFO_6
DeletePrinterDriverEx
EnumPrinterDrivers
GetPrinterDriverDirectory
Send comments about this topic to Microsoft
Build date: 7/11/2009
==原始网址==http://msdn.microsoft.com/en-us/library/dd183347(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:27:15