3

私は最初のファイル システムのミニフィルターに取り組んでいます。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 ドライブとして表示される単一のハード ドライブがあります。

ここで何が欠けているのか誰か教えてもらえますか?

4

2 に答える 2

3

ドライバーがハードウェア用でない場合は、

  1. 「ドライバーパッケージ」を選択
  2. 「構成」を開く
  3. 「ドライバーのインストール」->「展開」に移動します
  4. 「インストールしない」を選択

必要に応じて、カスタム コマンドを使用して、"svcctrl.exe" を必要なパラメーターで実行します。

于 2014-06-15T22:01:41.477 に答える
2

inf のインストールは、次の一般的なケースで失敗する可能性があります。

  • ドライバーは署名されていません。
  • ドライバーはテスト証明書で署名されたデバッグ ドライバーですが、証明書がターゲット コンピューターにインストールされていません。出力ディレクトリ (cer ファイル) の下に生成されたテスト証明書。それをターゲット マシンにコピーし、ダブルクリックします。
  • ターゲット マシンでは、テスト署名を有効にする必要があります。
    • 管理コンソールを開く
    • bcdedit -set TESTSIGNING ON
    • リブート

バッチ ファイルからインストールする方が簡単だと思います (「./」を省略しないでください): RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection DefaultInstall 132 ./MY_DRIVER_NAME.inf

于 2013-11-18T14:27:00.580 に答える