从调试启动的INF安装文件系统minifilter

时间:2013-11-04 23:51:28

标签: windows installation driver inf minifilter

我正在开发我的第一个文件系统迷你过滤器。我正在使用WDK中的SwapBuffers示例项目。我已经成功地将这个项目编译并从物理笔记本电脑部署到VM。但是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驱动器。

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

2 个答案:

答案 0 :(得分:3)

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

  1. 选择“驱动程序包”
  2. 打开“配置”
  3. 转到“驱动程序安装” - > “部署”
  4. 选择“不安装”
  5. 如果需要,请使用自定义命令,例如使用所需参数运行“svcctrl.exe”。

答案 1 :(得分:1)

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

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

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