3

我正在研究我的第一个文件系统微型过滤器。我正在使用 WDK 中的 SwapBuffers 示例项目。我已经成功地编译并将这个项目从物理笔记本电脑部署到虚拟机。但是从 INF 文件安装失败。我查看了目标机器上 C:\DriverTest\Logs 中的日志文件,并在日志文件中找到了这些行。

UserText="WDTF_TARGETS: Query("HardwareIDs='WDTF\NOEXIST'")"
UserText="WDTF_DRIVER_SETUP_SYSTEM: CreateRootEnumeratedDevicesFromPackage()"
UserText="WDTF_DRIVER_SETUP_SYSTEM:
UserText="WDTF_TEST: System has no device the driver package can  be installed onto."

这是INF文件。它未对原始样本进行修改。

;;; SwapBuffers
;;; Copyright (c) 2001, Microsoft Corporation
[Version]
signature   = "$Windows NT$"
Class       = "Encryption"                              ;This is determined by the work this filter driver does
ClassGuid   = {a0a701c0-a511-42ff-aa6c-06dc0395576f}    ;This value is determined by the Class
Provider    = %Msft%
DriverVer   = 06/16/2007,1.0.0.3
CatalogFile = swapbuffers.cat

[DestinationDirs]
DefaultDestDir          = 12
MiniFilter.DriverFiles  = 12            ;%windir%\system32\drivers

;; Default install sections
[DefaultInstall]
OptionDesc          = %ServiceDescription%
CopyFiles           = MiniFilter.DriverFiles

[DefaultInstall.Services]
AddService          = %ServiceName%,,MiniFilter.Service

;; Default uninstall sections
[DefaultUninstall]
DelFiles   = MiniFilter.DriverFiles

[DefaultUninstall.Services]
DelService = SwapBuffers,0x200      ;Ensure service is stopped before deleting

; Services Section
[MiniFilter.Service]
DisplayName      = %ServiceName%
Description      = %ServiceDescription%
ServiceBinary    = %12%\%DriverName%.sys        ;%windir%\system32\drivers\
Dependencies     = "FltMgr"
ServiceType      = 2                            ;SERVICE_FILE_SYSTEM_DRIVER
;StartType        = 0                           ;SERVICE_BOOT_START
StartType        = 3                            ;SERVICE_DEMAND_START
ErrorControl     = 1                            ;SERVICE_ERROR_NORMAL
LoadOrderGroup   = "FSFilter Encryption"
AddReg           = MiniFilter.AddRegistry

; Registry Modifications
[MiniFilter.AddRegistry]
HKR,,"SupportedFeatures",0x00010001,0x3
HKR,"Instances","DefaultInstance",0x00000000,%Instance1.Name%
HKR,"Instances\"%Instance1.Name%,"Altitude",0x00000000,%Instance1.Altitude%
HKR,"Instances\"%Instance1.Name%,"Flags",0x00010001,%Instance1.Flags%

; Copy Files
[MiniFilter.DriverFiles]
%DriverName%.sys

[SourceDisksFiles]
swapbuffers.sys = 1,,

[SourceDisksNames]
1 = %DiskId1%,,,

;; String Section
[Strings]
Msft                    = "Microsoft Corporation"
ServiceDescription      = "Swap Buffers Sample Mini-Filter Driver"
ServiceName             = "SwapBuffers"
DriverName              = "SwapBuffers"
DiskId1                 = "SwapBuffers Device Installation Disk"

;Instances specific information.
Instance1.Name          = "SwapBuffers Instance"
Instance1.Altitude      = "141000"
Instance1.Flags         = 0x0          ; allow automatic attachments

VMware 会话有一个硬盘驱动器,显示为查看 DEVCON 的 SCSI 驱动器。

谁能告诉我我在这里缺少什么?

4

2 回答 2

3

如果您的驱动程序不适用于硬件,请转到

  1. 选择“驱动程序包”
  2. 打开“配置”
  3. 转到“驱动程序安装”->“部署”
  4. 选择“不安装”

如果需要,请使用自定义命令,例如使用所需参数运行“svctrl.exe”。

于 2014-06-15T22:01:41.477 回答
2

inf install 在这些常见情况下可能会失败:

  • 司机没有签名。
  • 该驱动程序是使用测试证书签名的调试驱动程序,但该证书未安装在目标计算机上。在您的输出目录(cer 文件)下生成的测试证书。将其复制到目标机器并双击它。
  • 目标机器需要启用测试签名:
    • 打开管理控制台
    • bcdedit -set TESTSIGNING ON
    • 重启

我发现从批处理文件安装更容易(不要省略“./”):RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 ./MY_DRIVER_NAME.inf

于 2013-11-18T14:27:00.580 回答