WinUSB驱动程序安装,错误0x00000003

时间:2012-02-09 08:56:28

标签: .net driver winusb

以下.inf文件改编自Microsoft WinUSB Installation Guide

硬件密钥USBPRINT \ DatamaxM4308-MarkII013B,供应商和PID应该是正确的(从官方驱动程序.inf文件复制)

尝试在Vista 32bit上安装驱动程序时,我得到“操作无法完成(错误0x00000003)” Windows事件查看器不会记录我安装驱动程序的任何尝试。

C:\ Windows \ inf \ setupapi.dev.log记录以下内容:

Opened PNF: 'C:\Windows\INF\winusb.inf' ([strings.0409] <src=drvstore>)

cmi:      File::CopyFileUsingSymbolicLink(C:\Windows\system32\DriverStore\Temp\{42263e41-28c1-4fbc-a15e-36e516ea8ab1}\Package\winusb.sys, \\?\C:\Windows\system32\DriverStore\FileRepository\datamax.inf_4d12d90f\winusb.s
cmi:      CopyFile from C:\Windows\system32\DriverStore\Temp\{42263e41-28c1-4fbc-a15e-36e516ea8ab1}\Package\winusb.sys to \\?\C:\Windows\system32\DriverStore\FileRepository\datamax.inf_4d12d90f\winusb.sys failed 2
cmi:      CopyFile(source=C:\Windows\system32\DriverStore\Temp\{42263e41-28c1-4fbc-a15e-36e516ea8ab1}\Package\winusb.sys, destination=\\?\C:\Windows\system32\DriverStore\FileRepository\datamax.inf_4d12d90f\winusb.sys, 

我做错了什么?我需要将winusb.sys复制到驱动程序文件夹结构吗?我以为这是通过使用CoInstaller自动完成的?

文件夹结构如下:

-DriverFolder
            |
            Datamax.inf
            Datamax.cat
            + amd64
                  |
                  WdfCoInstaller01009.dll
                  winusbcoinstaller2.dll
            + i386
                  |
                  WdfCoInstaller01009.dll
                  winusbcoinstaller2.dll

Datamax.Inf:

[Version]
Signature = "$Windows NT$"
Class = Printer
ClassGuid={4D36E979-E325-11CE-BFC1-08002BE10318}
Provider = %ProviderName%
CatalogFile=Datamax.cat
DriverVer=02/08/2012,1.0.0.1

; ================== Class section ==================

[ClassInstall32]
Addreg=MyDeviceClassReg

[MyDeviceClassReg]
HKR,,,0,%ClassName%
HKR,,Icon,,-1

; ========== Manufacturer/Models sections ===========

[Manufacturer]
%ProviderName% = MyDevice_WinUSB,NTx86,NTamd64

[MyDevice_WinUSB.NTx86]
%USB\MyDevice.DeviceDesc% =USBPRINT\DatamaxM4308-MarkII013B, USB\VID_0B0B&PID_106E

[MyDevice_WinUSB.NTamd64]
%USB\MyDevice.DeviceDesc% =USBPRINT\DatamaxM4308-MarkII013B, USB\VID_0B0B&PID_106E

; =================== Installation ===================

;[1]
[USBPRINT\DatamaxM4308-MarkII013B]
Include=winusb.inf
Needs=WINUSB.NT

;[2]
[USBPRINT\DatamaxM4308-MarkII013B.Services]
Include=winusb.inf
Needs=WINUSB.NT.Services

;[3]
[USBPRINT\DatamaxM4308-MarkII013B.Wdf]
KmdfService=WINUSB, WinUSB_Install

[WinUSB_Install]
KmdfLibraryVersion=1.9

;[4]
[USBPRINT\DatamaxM4308-MarkII013B.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,"{FDA075ED-3109-4B76-8D70-CD4E65F3817C}"

;[5]
[USBPRINT\DatamaxM4308-MarkII013B.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles

[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"

[CoInstallers_CopyFiles]
WinUSBCoInstaller2.dll
WdfCoInstaller01009.dll

[DestinationDirs]
CoInstallers_CopyFiles=11

; ================= Source Media Section =====================
;[7]

[SourceDisksNames]
1 = %DISK_NAME%,,,\i386
2 = %DISK_NAME%,,,\amd64

[SourceDisksFiles.x86]
WinUSBCoInstaller2.dll=1
WdfCoInstaller01009.dll=1

[SourceDisksFiles.amd64]
WinUSBCoInstaller2.dll=2
WdfCoInstaller01009.dll=2

; =================== Strings ===================

[Strings]
ProviderName="MyWinUsbTest"
USB\MyDevice.DeviceDesc="Test using WinUSB only"
WinUSB_SvcDesc="WinUSB Test"
DISK_NAME="My Install Disk"
ClassName="Printer"

1 个答案:

答案 0 :(得分:2)

根据我的经验,0x00000003表示存在拒绝访问的异常。如果在Vista或更高版本上,该过程需要以管理员身份运行。