我用的是wdk10+win10+vs2015 ,創建專案的時候 選的是 "Empty WDM Driver", 抄的是"windows驅動開發技術詳解"里的第一章的 "HelloWDM" 代碼.
我拿他的代碼進行編譯,顯示報錯>"Missing directive CatalogFile required for digital signature.",
然后我就在Version下隨便加了句 "CatalogFile = abc.CAT",
然后編譯又出現另外一個錯誤》"22.9.1: hellowdm.sys in [youmark_files_driver] of \hellowdm.inf is missing or cannot be decompressed from source media. Please verify all path values specified in SourceDisksNames, SouceDisksFiles, and CopyFiles sections resolve to the actual location of the file, and are expressed in terms relative to the location of the inf.
\hellowdm.inf does not have NTAMD64 decorated model sections."
我已經跪了,那本書的前400頁算是看的差不多了,但是最后這100多頁關于wdm的 不得不搞這個了,來個大神幫我分分鐘解決吧。。。 最好能直接貼下可以用或者改后的inf檔案。
他的inf檔案如下》
;; The Win2K DDK documentation contains an excellent INF reference.
;--------- Version Section ---------------------------------------------------
[Version]
Signature="$CHICAGO$"
Provider=Zhangfan_Device
DriverVer=11/1/2007,3.0.0.3
; If device fits one of the standard classes, use the name and GUID here,
; otherwise create your own device class and GUID as this example shows.
Class=ZhangfanDevice
ClassGUID={EF2962F0-0D55-4bff-B8AA-2221EE8A79B0}
;--------- SourceDiskNames and SourceDiskFiles Section -----------------------
; These sections identify source disks and files for installation. They are
; shown here as an example, but commented out.
[SourceDisksNames]
1 = "HelloWDM",Disk1,,
[SourceDisksFiles]
HelloWDM.sys = 1,MyDriver_Check,
;--------- ClassInstall/ClassInstall32 Section -------------------------------
; Not necessary if using a standard class
; 9X Style
[ClassInstall]
Addreg=Class_AddReg
; NT Style
[ClassInstall32]
Addreg=Class_AddReg
[Class_AddReg]
HKR,,,,%DeviceClassName%
HKR,,Icon,,"-5"
;--------- DestinationDirs Section -------------------------------------------
[DestinationDirs]
YouMark_Files_Driver = 10,System32\Drivers
;--------- Manufacturer and Models Sections ----------------------------------
[Manufacturer]
%MfgName%=Mfg0
[Mfg0]
; PCI hardware Ids use the form
; PCI\VEN_aaaa&DEV_bbbb&SUBSYS_cccccccc&REV_dd
;??3é??×??oμ?ID
%DeviceDesc%=YouMark_DDI, PCI\VEN_9999&DEV_9999
;---------- DDInstall Sections -----------------------------------------------
; --------- Windows 9X -----------------
; Experimentation has shown that DDInstall root names greater than 19 characters
; cause problems in Windows 98
[YouMark_DDI]
CopyFiles=YouMark_Files_Driver
AddReg=YouMark_9X_AddReg
[YouMark_9X_AddReg]
HKR,,DevLoader,,*ntkern
HKR,,NTMPDriver,,HelloWDM.sys
HKR, "Parameters", "BreakOnEntry", 0x00010001, 0
; --------- Windows NT -----------------
[YouMark_DDI.NT]
CopyFiles=YouMark_Files_Driver
AddReg=YouMark_NT_AddReg
[YouMark_DDI.NT.Services]
Addservice = HelloWDM, 0x00000002, YouMark_AddService
[YouMark_AddService]
DisplayName = %SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %10%\System32\Drivers\HelloWDM.sys
[YouMark_NT_AddReg]
HKLM, "System\CurrentControlSet\Services\HelloWDM\Parameters",\
"BreakOnEntry", 0x00010001, 0
; --------- Files (common) -------------
[YouMark_Files_Driver]
HelloWDM.sys
;--------- Strings Section ---------------------------------------------------
[Strings]
ProviderName="Zhangfan."
MfgName="Zhangfan Soft"
DeviceDesc="Hello World WDM!"
DeviceClassName="Zhangfan_Device"
SvcDesc="Zhangfan"
uj5u.com熱心網友回復:
這個問題解決了嗎?我也遇到這個問題了uj5u.com熱心網友回復:
http://baike.baidu.com/link?url=ploTjvVd7b9Up5yzV_SncmP3_dOfuG4_NcpoUpQhNUq9C7Rr74LHXzbvR0rU2_-oeppO-or8f2d9YKfO4SSukquj5u.com熱心網友回復:
你搞定了嗎, 我剛接觸WDM驅動, 遇到了這個問題, 和你一樣的。 求教 QQ 495939792uj5u.com熱心網友回復:
這個問題今天我終于解決了, 在win10 64位上親測, 你可以加我qq 2437825171吧uj5u.com熱心網友回復:
你利用VS2015建一個簡單的驅動工程,然后參考一下自動生成的inf檔案就好了~uj5u.com熱心網友回復:
我這邊是[SourceDisksFiles]HelloWDM.sys = 1,MyDriver_Check,這個配置緣故,需要生成目錄(一般是Debug或者release目錄下)有個MyDriver_Check目錄改成[SourceDisksFiles]HelloWDM.sys = 1,, 即可
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/64008.html
標籤:硬件/系統
