我是靠谱客的博主 独特世界,最近开发中收集的这篇文章主要介绍在win7和win10上通过INF文件安装64位WDM驱动,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

安装好wdk7600后,在win7下编译好64位的wdm驱动程序,如张帆的HelloWDM.sys,然后win7重启按F8,进入安全模式下,禁用驱动程序签名强制后,即可用添加过时驱动的方法安装驱动,win10禁用驱动签名后也可以安装成功。下面是这个驱动安装的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",,

[SourceDisksFiles]
HelloWDM.sys = 1,,

;--------- 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,System32Drivers

;--------- Manufacturer and Models Sections ----------------------------------

;32位和64位自适应安装
;Manufacturer节下面的项,厂商的值是model节名
[Manufacturer]
"示例厂商"=Mfg0,NT,NTAMD64

;model节,model节指明Install/DDInstall节的名称、设备的硬件ID和兼容ID,model节名由Manufacturer节指定
[Mfg0]
; PCI hardware Ids use the form
; PCIVEN_aaaa&DEV_bbbb&SUBSYS_cccccccc&REV_dd
;改成你自己的ID
"一个示例设备"=YouMark_DDI, PCIVEN_9999&DEV_9999

[Mfg0.NT]
; PCI hardware Ids use the form
; PCIVEN_aaaa&DEV_bbbb&SUBSYS_cccccccc&REV_dd
;改成你自己的ID
"一个示例设备"=YouMark_DDI, PCIVEN_9999&DEV_9999

[Mfg0.NTAMD64]
; PCI hardware Ids use the form
; PCIVEN_aaaa&DEV_bbbb&SUBSYS_cccccccc&REV_dd
;改成你自己的ID
"一个示例设备"=YouMark_DDI, PCIVEN_9999&DEV_9999


;Install/DDInstall节指明需复制的文件、向注册表中添加的内容等信息,其节名由Models指定
;---------- 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

;仅适用于Windows 2000
[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%System32DriversHelloWDM.sys

[YouMark_NT_AddReg]
HKLM, "SystemCurrentControlSetServicesHelloWDMParameters",
"BreakOnEntry", 0x00010001, 0

; --------- Windows x64 -----------------

[YouMark_DDI.NTAMD64]
CopyFiles=YouMark_Files_Driver
AddReg=YouMark_NTAMD64_AddReg

[YouMark_DDI.NTAMD64.Services]
Addservice = HelloWDM, 0x00000002, YouMark_AddService64

[YouMark_AddService64]
DisplayName = %SvcDesc%
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %10%System32DriversHelloWDM.sys

[YouMark_NTAMD64_AddReg]
HKLM, "SystemCurrentControlSetServicesHelloWDMParameters",
"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"

最后

以上就是独特世界为你收集整理的在win7和win10上通过INF文件安装64位WDM驱动的全部内容,希望文章能够帮你解决在win7和win10上通过INF文件安装64位WDM驱动所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(41)

评论列表共有 0 条评论

立即
投稿
返回
顶部