安装windows打印机驱动程序时出现错误。

时间:2022-09-27 20:00:11

I am trying to install a windows printer driver(OEMUNI) provided as a sample in WDK(Windows Driver Kit). But I keep getting following error from add printer wizard: "Printer driver was not installed. Operation could not be completed (error 0x00000002)". I have tried running the add printer wizard with admin privileges but I still get the same problem.

我正在尝试安装一个windows打印机驱动程序(OEMUNI),作为WDK(windows驱动程序工具包)中的一个示例。但是我一直从添加打印机向导中得到以下错误:“打印机驱动程序没有安装。操作无法完成(错误0x00000002)。我尝试过使用admin特权运行add printer向导,但仍然遇到了相同的问题。

I am using windows 7, 64-bit version. Can somebody help me here ? Also, what would the error code:0x00000002 signify ?

我使用的是windows 7, 64位版本。有人能帮我吗?还有,错误代码:0x00000002意味着什么?

Following is my INF file:-

以下是我的INF文件:-。

; OEMDLL.INF
;
; INF file for OEM DLL Customization samples
;
; Copyright 1999-2003 Microsoft Corporation


[Version]
Signature="$Windows NT$"
Provider=%MS%
LayoutFile=ntprint.inf
ClassGUID={4D36E979-E325-11CE-BFC1-08002BE10318}
Class=Printer
DriverVer=6/07/2001,1.0.0.1

;
; Manufacturer section.
;
; This section lists all of the manufacturers 
; that we will display in the Dialog box
;
[Manufacturer]
"Microsoft"=Microsoft, NTamd64, NTia64

;
; Model sections. 
; 
; Each section here corresponds with an entry listed in the
; [Manufacturer] section, above. The models will be displayed in the order
; that they appear in the INF file.
;

[Microsoft]
"PostScript WaterMark Sample"          = INSTALL_WATERMARK.PS
"Unidrv WaterMark Sample"              = INSTALL_WATERMARK.UNI
"OEM PostScript Customization Sample"  = INSTALL_OEMPS
"OEM Unidrv Customization Sample"      = INSTALL_OEMUNI
"OEM UI Customization Sample (PS)"     = INSTALL_OEMUI.PS
"OEM UI Customization Sample (Unidrv)" = INSTALL_OEMUI.UNI

[Microsoft.NTamd64]
"PostScript WaterMark Sample"          = INSTALL_WATERMARK.PS
"Unidrv WaterMark Sample"              = INSTALL_WATERMARK.UNI
"OEM PostScript Customization Sample"  = INSTALL_OEMPS
"OEM Unidrv Customization Sample"      = INSTALL_OEMUNI
"OEM UI Customization Sample (PS)"     = INSTALL_OEMUI.PS
"OEM UI Customization Sample (Unidrv)" = INSTALL_OEMUI.UNI

[Microsoft.NTia64]
"PostScript WaterMark Sample"          = INSTALL_WATERMARK.PS
"Unidrv WaterMark Sample"              = INSTALL_WATERMARK.UNI
"OEM PostScript Customization Sample"  = INSTALL_OEMPS
"OEM Unidrv Customization Sample"      = INSTALL_OEMUNI
"OEM UI Customization Sample (PS)"     = INSTALL_OEMUI.PS
"OEM UI Customization Sample (Unidrv)" = INSTALL_OEMUI.UNI

;
; Installer Sections
;
; These sections control file installation, and reference all files that
; need to be copied. The section name will be assumed to be the driver
; file, unless there is an explicit DriverFile section listed.
;

[INSTALL_WATERMARK.PS]
CopyFiles=@OEM.PPD
CopyFiles=@WMARKPS.INI
CopyFiles=WMARKPS
DataFile=OEM.PPD
DataSection=PSCRIPT_DATA
Include=NTPRINT.INF
Needs=PSCRIPT.OEM,PSCRIPT_DATA


[INSTALL_WATERMARK.UNI]
CopyFiles=@OEM.GPD
CopyFiles=@WMARKUNI.INI
CopyFiles=WMARKUNI
DataFile=OEM.GPD
DataSection=UNIDRV_DATA
Include=NTPRINT.INF
Needs=UNIDRV.OEM,TTFSUB.OEM,UNIDRV_DATA

[INSTALL_OEMPS]
CopyFiles=@OEM.PPD
CopyFiles=@OEMPS.INI
CopyFiles=OEMPS
DataFile=OEM.PPD
DataSection=PSCRIPT_DATA
Include=NTPRINT.INF
Needs=PSCRIPT.OEM,PSCRIPT_DATA

[INSTALL_OEMUNI]
CopyFiles=@OEM.GPD
CopyFiles=@OEMUNI.INI
CopyFiles=OEMUNI
DataFile=OEM.GPD
DataSection=UNIDRV_DATA
Include=NTPRINT.INF
Needs=UNIDRV.OEM,TTFSUB.OEM,UNIDRV_DATA

[INSTALL_OEMUI.PS]
CopyFiles=@OEM.PPD
CopyFiles=@OEMUI.INI
CopyFiles=OEMUI
DataFile=OEM.PPD
DataSection=PSCRIPT_DATA
Include=NTPRINT.INF
Needs=PSCRIPT.OEM,PSCRIPT_DATA

[INSTALL_OEMUI.UNI]
CopyFiles=@OEM.GPD
CopyFiles=@OEMUI.INI
CopyFiles=OEMUI
DataFile=OEM.GPD
DataSection=UNIDRV_DATA
Include=NTPRINT.INF
Needs=UNIDRV.OEM,TTFSUB.OEM,UNIDRV_DATA



; Copy Sections
;
; Lists of files that are actually copied. These sections are referenced
; from the installer sections, above. Only create a section if it contains
; two or more files (if we only copy a single file, identify it in the
; installer section, using the @filename notation) or if it's a color
; profile (since the DestinationDirs can only handle sections, and not
; individual files).
;

[WMARKPS]
WMARKPS.DLL
WMARKUI.DLL

[WMARKUNI]
WMARKUNI.DLL
WMARKUNIUI.DLL

[OEMPS]
OEMPS.DLL

[OEMUI]
OEMUI.DLL

[OEMUNI]
OEMUNI.DLL


;
; Data Sections
;

; These sections contain data that is shared between devices.
;



;
;  Location of source files not in Layout.inf.
;

[SourceDisksNames]
100 = %OEMSample%

[SourceDisksFiles.x86]
oemps.dll      = 100,OEMPS\x86
oemui.dll      = 100,OEMUI\x86
oemuni.dll     = 100,OEMUNI\x86
wmarkps.dll    = 100,WaterMark\x86
wmarkuni.dll   = 100,WaterMarkUni\x86
wmarkuniui.dll = 100,WaterMarkUni\x86
wmarkui.dll    = 100,WaterMark\x86

[SourceDisksFiles.amd64]
oemps.dll      = 100,OEMPS\amd64
oemui.dll      = 100,OEMUI\amd64
oemuni.dll     = 100,OEMUNI\amd64
wmarkps.dll    = 100,WaterMark\amd64
wmarkuni.dll   = 100,WaterMarkUni\amd64
wmarkuniui.dll = 100,WaterMarkUni\amd64
wmarkui.dll    = 100,WaterMark\amd64

[SourceDisksFiles.ia64]
oemps.dll      = 100,OEMPS\ia64
oemui.dll      = 100,OEMUI\ia64
oemuni.dll     = 100,OEMUNI\ia64
wmarkps.dll    = 100,WaterMark\ia64
wmarkuni.dll   = 100,WaterMarkUni\ia64
wmarkuniui.dll = 100,WaterMarkUni\ia64
wmarkui.dll    = 100,WaterMark\ia64

[SourceDisksFiles]
OEM.PPD       = 100
OEM.GPD       = 100
WMARKPS.INI   = 100
WMARKUNI.INI  = 100
OEMPS.INI     = 100
OEMUNI.INI    = 100
OEMUI.INI     = 100

;
; Call SetupSetDirectoryId with 66000 to set the target directory at runtime
; (depending on which environment drivers are getting installed)
;

[DestinationDirs]
DefaultDestDir=66000

;
; Localizable Strings
;
[Strings]
MS="Microsoft DDK Sample"
OEMSample="OEM DLL Print samples"

3 个解决方案

#1


2  

The error is ERROR_FILE_NOT_FOUND.

ERROR_FILE_NOT_FOUND错误。

  1. did you build the sample first?
  2. 你先造样品了吗?
  3. after you built it, did you put it into the correct folder relative to the .inf file?
  4. 在您构建它之后,您是否将它放到了相对于.inf文件的正确文件夹中?

#2


0  

I also encountere this issue. The reason is: the file oem.gpd includes ttfsub.gpd, which cannot be found in the oemdll directory. But even if we copy ttfsub.gpd from FileRepsoitory to the oemdll directory, the installation will also failure. However, if you install the bitmap example, you will succeed. So the correct way is to do like bitmap driver...

在这个问题上,我也有自己的看法。原因是:文件oem。加仑日包括ttfsub。gpd,在oemdll目录中是找不到的。但即使我们复制ttfsub。gpd从FileRepsoitory到oemdll目录,安装也会失败。但是,如果安装了位图示例,就会成功。正确的方法是像位图驱动…

#3


0  

0x000002 refers to some missing file, that means there is a reference to the file in the inf file but it is not actually present in the driver package. Please check the driver package if all the files mentioned in the inf file are present in the package.

0x000002是指一些丢失的文件,这意味着在inf文件中有一个对文件的引用,但它实际上并没有出现在驱动程序包中。如果inf文件中提到的所有文件都在包中,请检查驱动程序包。

#1


2  

The error is ERROR_FILE_NOT_FOUND.

ERROR_FILE_NOT_FOUND错误。

  1. did you build the sample first?
  2. 你先造样品了吗?
  3. after you built it, did you put it into the correct folder relative to the .inf file?
  4. 在您构建它之后,您是否将它放到了相对于.inf文件的正确文件夹中?

#2


0  

I also encountere this issue. The reason is: the file oem.gpd includes ttfsub.gpd, which cannot be found in the oemdll directory. But even if we copy ttfsub.gpd from FileRepsoitory to the oemdll directory, the installation will also failure. However, if you install the bitmap example, you will succeed. So the correct way is to do like bitmap driver...

在这个问题上,我也有自己的看法。原因是:文件oem。加仑日包括ttfsub。gpd,在oemdll目录中是找不到的。但即使我们复制ttfsub。gpd从FileRepsoitory到oemdll目录,安装也会失败。但是,如果安装了位图示例,就会成功。正确的方法是像位图驱动…

#3


0  

0x000002 refers to some missing file, that means there is a reference to the file in the inf file but it is not actually present in the driver package. Please check the driver package if all the files mentioned in the inf file are present in the package.

0x000002是指一些丢失的文件,这意味着在inf文件中有一个对文件的引用,但它实际上并没有出现在驱动程序包中。如果inf文件中提到的所有文件都在包中,请检查驱动程序包。