读书人

wdf驱动开下发现代码39

发布时间: 2013-04-05 10:24:33 作者: rapoo

wdf驱动开发出现代码39
本帖最后由 cw7600 于 2013-03-14 17:20:15 编辑 我在做WDF驱动开发的时候,安装驱动的时候出现
无法加载这个硬件的设备驱动程序。驱动程序可能已损坏或不见了。 (代码 39)

INF文件我是按照例子更改的

;Module Name:
; PCISample.INF
;
;Abstract:
; INF file for installing the Windows Driver Frameworks PCISample Driver
;
;Installation Notes:
; Using Devcon: Type "devcon install PCISample.inf root\PCISample" to install
;
;--*/

[Version]
Signature="$WINDOWS NT$"
Class=WDFBOOK
ClassGuid={EF1941A7-645B-4668-B05B-287D30169435}
Provider=%ProviderName%
DriverVer=06/07/2012,6.1.7600.16385

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

[ClassInstall32]
Addreg=SampleClassReg

[SampleClassReg]
HKR,,,0,%DeviceClassName%
HKR,,Icon,,-18

;*****************************************
; PCISample Install Section
;*****************************************

[Manufacturer]
%MfgName%=Standard,NTx86

; Following section is meant for Windows 2000 as it
; cannot parse decorated model sections
[Standard]
;
; Hw Id is root\PCISample
;
%PCISample.DeviceDesc%=PCISample_Device, PCI\VEN_5858&DEV_0002&SUBSYS_00000000&REV_01

; Decorated model section take precedence over undecorated
; ones on XP and later.
[Standard.NTx86]
%PCISample.DeviceDesc%=PCISample_Device, PCI\VEN_5858&DEV_0002&SUBSYS_00000000&REV_01

[DestinationDirs]
PCISample_Files_Driver = 12

[PCISample_Device.NT]
CopyFiles=PCISample_Files_Driver

[PCISample_Files_Driver]
PCISample.sys

;-------------- Service installation
[PCISample_Device.NT.Services]
AddService = PCISample,0x00000002, PCISample_AddService

; -------------- PCISample driver install sections
[PCISample_AddService]
DisplayName = %PCISample.SVCDESC%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\PCISample.sys

;
;--- WDF Coinstaller installation ----
;

[DestinationDirs]
CoInstaller_CopyFiles = 11

[PCISample_Device.NT.CoInstallers]
CopyFiles=CoInstaller_CopyFiles
AddReg=CoInstaller_AddReg

[CoInstaller_CopyFiles]
wdfcoinstaller01007.dll

[CoInstaller_AddReg]
HKR,,CoInstallers32,0x00010000, "wdfcoinstaller01007.dll,WdfCoInstaller"

[PCISample_Device.NT.Wdf]
KmdfService = PCISample, PCISample_wdfsect

[PCISample_wdfsect]
KmdfLibraryVersion = 1.7


[Strings]
ProviderName="Windows最新WDF设备驱动程序开发"
MfgName="武安河"
DeviceClassName="WDF范例"
PCISample.DeviceDesc = "PCISample"
PCISample.SVCDESC = "WDF PCISample Service"



各位高手觉得有什么问题,除了PCI设备ID之外,系统我也是刚做过的非常干净的。
[解决办法]
需要添加驱动文件和动态链接库文件路径。
驱动路径为:
[Sourcedisksnames]
1=%disk_description%,,,
[sourcedisksfiles]
pcisample.sys=1
--------------------------------
[sourcedisksfiles]
wdfcoinstaller01007.dll=1

读书人网 >驱动开发

热点推荐