• 在win7和win10上通过INF文件安装64位WDM驱动


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

    1. ;; The Win2K DDK documentation contains an excellent INF reference.
    2. ;--------- Version Section ---------------------------------------------------
    3. [Version]
    4. Signature="$CHICAGO$"
    5. Provider=Zhangfan_Device
    6. DriverVer=11/1/2007,3.0.0.3
    7. ; If device fits one of the standard classes, use the name and GUID here,
    8. ; otherwise create your own device class and GUID as this example shows.
    9. Class=ZhangfanDevice
    10. ClassGUID={EF2962F0-0D55-4bff-B8AA-2221EE8A79B0}
    11. ;--------- SourceDiskNames and SourceDiskFiles Section -----------------------
    12. ; These sections identify source disks and files for installation. They are
    13. ; shown here as an example, but commented out.
    14. [SourceDisksNames]
    15. 1 = "HelloWDM",,
    16. [SourceDisksFiles]
    17. HelloWDM.sys = 1,,
    18. ;--------- ClassInstall/ClassInstall32 Section -------------------------------
    19. ; Not necessary if using a standard class
    20. ; 9X Style
    21. [ClassInstall]
    22. Addreg=Class_AddReg
    23. ; NT Style
    24. [ClassInstall32]
    25. Addreg=Class_AddReg
    26. [Class_AddReg]
    27. HKR,,,,%DeviceClassName%
    28. HKR,,Icon,,"-5"
    29. ;--------- DestinationDirs Section -------------------------------------------
    30. [DestinationDirs]
    31. YouMark_Files_Driver = 10,System32\Drivers
    32. ;--------- Manufacturer and Models Sections ----------------------------------
    33. ;32位和64位自适应安装
    34. ;Manufacturer节下面的项,厂商的值是model节名
    35. [Manufacturer]
    36. "示例厂商"=Mfg0,NT,NTAMD64
    37. ;model节,model节指明Install/DDInstall节的名称、设备的硬件ID和兼容ID,model节名由Manufacturer节指定
    38. [Mfg0]
    39. ; PCI hardware Ids use the form
    40. ; PCI\VEN_aaaa&DEV_bbbb&SUBSYS_cccccccc&REV_dd
    41. ;改成你自己的ID
    42. "一个示例设备"=YouMark_DDI, PCI\VEN_9999&DEV_9999
    43. [Mfg0.NT]
    44. ; PCI hardware Ids use the form
    45. ; PCI\VEN_aaaa&DEV_bbbb&SUBSYS_cccccccc&REV_dd
    46. ;改成你自己的ID
    47. "一个示例设备"=YouMark_DDI, PCI\VEN_9999&DEV_9999
    48. [Mfg0.NTAMD64]
    49. ; PCI hardware Ids use the form
    50. ; PCI\VEN_aaaa&DEV_bbbb&SUBSYS_cccccccc&REV_dd
    51. ;改成你自己的ID
    52. "一个示例设备"=YouMark_DDI, PCI\VEN_9999&DEV_9999
    53. ;Install/DDInstall节指明需复制的文件、向注册表中添加的内容等信息,其节名由Models指定
    54. ;---------- DDInstall Sections -----------------------------------------------
    55. ; --------- Windows 9X -----------------
    56. ; Experimentation has shown that DDInstall root names greater than 19 characters
    57. ; cause problems in Windows 98
    58. [YouMark_DDI]
    59. CopyFiles=YouMark_Files_Driver
    60. AddReg=YouMark_9X_AddReg
    61. [YouMark_9X_AddReg]
    62. HKR,,DevLoader,,*ntkern
    63. HKR,,NTMPDriver,,HelloWDM.sys
    64. HKR, "Parameters", "BreakOnEntry", 0x00010001, 0
    65. ; --------- Windows NT -----------------
    66. [YouMark_DDI.NT]
    67. CopyFiles=YouMark_Files_Driver
    68. AddReg=YouMark_NT_AddReg
    69. ;仅适用于Windows 2000
    70. [YouMark_DDI.NT.Services]
    71. Addservice = HelloWDM, 0x00000002, YouMark_AddService
    72. [YouMark_AddService]
    73. DisplayName = %SvcDesc%
    74. ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    75. StartType = 3 ; SERVICE_DEMAND_START
    76. ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    77. ServiceBinary = %10%\System32\Drivers\HelloWDM.sys
    78. [YouMark_NT_AddReg]
    79. HKLM, "System\CurrentControlSet\Services\HelloWDM\Parameters",\
    80. "BreakOnEntry", 0x00010001, 0
    81. ; --------- Windows x64 -----------------
    82. [YouMark_DDI.NTAMD64]
    83. CopyFiles=YouMark_Files_Driver
    84. AddReg=YouMark_NTAMD64_AddReg
    85. [YouMark_DDI.NTAMD64.Services]
    86. Addservice = HelloWDM, 0x00000002, YouMark_AddService64
    87. [YouMark_AddService64]
    88. DisplayName = %SvcDesc%
    89. ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    90. StartType = 3 ; SERVICE_DEMAND_START
    91. ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    92. ServiceBinary = %10%\System32\Drivers\HelloWDM.sys
    93. [YouMark_NTAMD64_AddReg]
    94. HKLM, "System\CurrentControlSet\Services\HelloWDM\Parameters",\
    95. "BreakOnEntry", 0x00010001, 0
    96. ; --------- Files (common) -------------
    97. [YouMark_Files_Driver]
    98. HelloWDM.sys
    99. ;--------- Strings Section ---------------------------------------------------
    100. [Strings]
    101. ProviderName="Zhangfan."
    102. MfgName="Zhangfan Soft"
    103. DeviceDesc="Hello World WDM!"
    104. DeviceClassName="Zhangfan_Device"
    105. SvcDesc="Zhangfan"

  • 相关阅读:
    Linux ALSA驱动之PCM创建流程源码分析
    手机玻璃盖板为什么需要透光率检测
    仿真实现lio_sam建图和ndt_matching定位
    VBA基础知识点总结
    基于AT89C51流水花样灯proteus仿真设计
    生成数字图像基本过程
    【Spring】Spring bean定义及其作用域
    基于SQL企业信使运营平台
    【云原生】DevOps(五):集成Harbor
    做3D建模月薪平均多少?
  • 原文地址:https://blog.csdn.net/csdn_gddf102384398/article/details/126240269