Windows生物识别框架示例umdf驱动程序:该设备无法启动. (代码10) [英] Windows biometric framework sample umdf driver: This device cannot start. (Code 10)

查看:1679
本文介绍了Windows生物识别框架示例umdf驱动程序:该设备无法启动. (代码10)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行Windows 生物识别驱动程序示例而且我对驱动程序开发很幼稚

我已更改了inx文件中的硬件ID,并重建了驱动程序项目,并将生成的驱动程序安装在Windows 10 Pro 1803版中.

我正在使用指纹Morpho设备1300 E3

驱动程序已成功安装,但出现一个错误:

此设备无法启动. (代码10) 指定的请求不是目标设备的有效操作.

我查看了文件 C:\ Windows \ INF \ setupapi.dev.log

它显示接下来的警告:

     sig:                     {_VERIFY_FILE_SIGNATURE} 10:13:03.130
     sig:                          Key      = wudfbiousbsample.inf
     sig:                          FilePath = C:\WINDOWS\System32\DriverStore\Temp\{ee9ffca3-751f-0b4e-a7ac-dce2543d995e}\wudfbiousbsample.inf
     sig:                          Catalog  = C:\WINDOWS\System32\DriverStore\Temp\{ee9ffca3-751f-0b4e-a7ac-dce2543d995e}\biometrics.cat
!    sig:                          Verifying file against specific (valid) catalog failed.
!    sig:                          Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
!!!  dvi:                     Device not started: Device has problem: 0x0a (CM_PROB_FAILED_START), problem status: 0xc0000450.

但是我在本地计算机上的受信任的根证书颁发机构和受信任的发布者上安装了TestCertificate

我还检查了EventViewer: 应用程序和服务日志> Microsoft \ Windows \ CodeIntegrity 应用程序和服务日志> Microsoft \ Windows \ Biometrics

我尝试使用wdfverifier.exe 正在跟踪msdn中的一些视频,但是该过程尚未启动,所以我无法调试:(

我验证了Visual Studio没有对EngineAdapter.dll插件文件进行签名,因此我禁用了驱动程序签名,并按照 setupapi.dev.log

我想不要加载驱动程序,因为有关证书或错误的警告可能在其他地方.

如果有人可以给我一个小的建议,请继续.我现在被困住了:(

非常感谢.

解决方案

当我能够安装我的生物识别驱动程序时,所有操作都开始了,但是它显示了黄色感叹号"和一条通用消息此设备无法启动.(代码10) )"

生物特征样本项目不包含如何使用我发现的Visual Studio正确签署EngineAdapter.dll的示例

下一个这第一个视频教程显示了使用WDK wdfverifier.exe 中的工具调试umdf驱动程序的示例. 我无法将调试器附加到驱动程序进程中,因为该进程不存在.但是我可以在启动前进行调试,以免进程崩溃.

要使用 wdfverifier.exe 进行调试,我采取了以下步骤:

设置"标签: 选中选项在请求时自动启动用户模式调试器",在输入主机进程将等待"中指定15秒

首选项"标签: 选中使用WinDbg",然后

在设备管理器中禁用/启用我的设备

WinDbg启动,我可以检查驱动程序模块是否装有下一条命令:

lm m *bio*
//the module is not loaded, use g commant to continue
g
//again see if the module was loaded
lm m *bio*
//module shows up, great!

现在我可以设置断点,但是在此之前,我必须向WinDbg指定符号文件(* .pdb)和驱动程序源代码以及下一个命令的位置(如果您构建 package 项目,我正在参考引擎适配器项目来构建 WudfBioUsbSample ):

.symfix
.srcpath+ C:\Users\myuser\Documents\Windows-driver-samples\biometrics\driver    
.sympath+ C:\Users\myuser\Documents\Windows-driver-samples\biometrics\driver\x64\Debug

.reload /f

接下来,我可以设置一个断点:

//x command is used to search if the method exist
x WudfBioUsbSample!CBiometricDriver::*
x WudfBioUsbSample!CBiometricDevice::*
x WudfBioUsbSample!CBiometricDevice::OnGetAttributes
//examples of breakpoints
bp WudfBioUsbSample!CBiometricDriver::OnDeviceAdd
bp WudfBioUsbSample!CBiometricDevice::OnGetAttributes
bp WudfBioUsbSample!CBiometricDevice::CreateUsbIoTargets

显示错误的位置是CreateUsbIoTargets方法. JinZhuXing已在此github问题

中修复了这些错误

修复驱动程序代码并调试方法 CreateUsbIoTargets 运行正常

仍然显示给我黄色感叹号,但是这次错误出在EngineAdapter.dll中.下一个错误显示在EventViewer中:应用程序和服务日志> Microsoft \ Windows \ Biometrics

模块的引擎适配器"初始化例程失败,错误为:0x80004001

EngineAdapter项目方法返回了 E_NOTIMPL ,我只是将其更改为返回了 S_OK 而不是所有方法.生物单位成功建立.

引擎插件的调试是通过Visual Studio完成的.这是我遵循的步骤:

使用wdfverifier.exe将WinDbg附加到我的umdf驱动程序的进程中,并为OnGetAttributes方法设置一个断点(当我启动/重新启动Windows Biometric Service时将调用此方法)此断点将使该服务先等待调用EngineAdapter插件代码.

x WudfBioUsbSample!CBiometricDevice::OnGetAttributes
bp WudfBioUsbSample!CBiometricDevice::OnGetAttributes
g

重新启动或启动Windows Biometric Service(任务管理器->服务"选项卡上的 WbioSrvc )

复制进程ID(PID)

以管理员身份运行Visual Studio,打开WBDIsample项目

使用菜单调试->附加到进程...

输入以下值:

Connection Type: Windows User Mode Debugger
Connection Target: Localhost

Check "Show processes from all users" 

Filter by Process ID 
Select the process and Click Attach button.

WbioQueryEngineInterface,EngineAdapterAttach,EngineAdapterDetach 上设置断点 msgdn上的示例实现

在WinDbg上运行命令g(执行)

g

此后,您可以在Visual Studio上调试插件的代码.

剩下的是为生物识别驱动程序和设备所需的插件实现代码

I am trying to run a windows biometric driver sample and I am naive to driver development

I have changed the hardware id in the inx file and rebuilt the driver project and installed the resulting driver on my Windows 10 Pro version 1803.

I am using a Fingerprint Morpho Device 1300 E3

Driver got installed successfully but there is one error showing up:

This device cannot start. (Code 10) The specified request is not a valid operation for the target device.

I reviewed the file C:\Windows\INF\setupapi.dev.log

It shows the next warnings:

     sig:                     {_VERIFY_FILE_SIGNATURE} 10:13:03.130
     sig:                          Key      = wudfbiousbsample.inf
     sig:                          FilePath = C:\WINDOWS\System32\DriverStore\Temp\{ee9ffca3-751f-0b4e-a7ac-dce2543d995e}\wudfbiousbsample.inf
     sig:                          Catalog  = C:\WINDOWS\System32\DriverStore\Temp\{ee9ffca3-751f-0b4e-a7ac-dce2543d995e}\biometrics.cat
!    sig:                          Verifying file against specific (valid) catalog failed.
!    sig:                          Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
!!!  dvi:                     Device not started: Device has problem: 0x0a (CM_PROB_FAILED_START), problem status: 0xc0000450.

But I installed the TestCertificate on the Trusted Root Certification Authorities and Trusted Publishers on the local machine

I also checked the EventViewer: Application and Services Logs > Microsoft\Windows\CodeIntegrity Application and Services Logs > Microsoft\Windows\Biometrics

I tried to debug with wdfverifier.exe following some videos from msdn but the process is not started so I couldn't debug :(

I verified that Visual Studio is not signing the EngineAdapter.dll plugin file so I disabled driver signing and did it manually following this paper. But I get the same error code 10 :(

I also wondered if error code 10 is this the expected behavior because the code of EngineAdapter.dll is not implemented.

UPDATE: I am testing on a Windows 10 Pro Version 1709 Virtual Machine VMWare and I get other error:

This device is not working properly because Windows cannot load the drivers required for this device. (Code 31)

!!!  dvi:                     Device not started: Device has problem: 0x1f (CM_PROB_FAILED_ADD), problem status: 0xc0000001.

And the same warnings:

     sig:           {_VERIFY_FILE_SIGNATURE} 17:19:01.646
     sig:                Key      = wudfbiousbsample.inf
     sig:                FilePath = C:\Windows\System32\DriverStore\Temp\{85323f79-3f5f-f84c-a52b-639b6ae57db1}\wudfbiousbsample.inf
     sig:                Catalog  = C:\Windows\System32\DriverStore\Temp\{85323f79-3f5f-f84c-a52b-639b6ae57db1}\biometrics.cat
!    sig:                Verifying file against specific (valid) catalog failed.
!    sig:                Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
     sig:           {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 17:19:01.661
     sig:           {_VERIFY_FILE_SIGNATURE} 17:19:01.676
     sig:                Key      = wudfbiousbsample.inf
     sig:                FilePath = C:\Windows\System32\DriverStore\Temp\{85323f79-3f5f-f84c-a52b-639b6ae57db1}\wudfbiousbsample.inf
     sig:                Catalog  = C:\Windows\System32\DriverStore\Temp\{85323f79-3f5f-f84c-a52b-639b6ae57db1}\biometrics.cat
     sig:                Success: File is signed in Authenticode(tm) catalog.
     sig:                Error 0xe0000241: The INF was signed with an Authenticode(tm) catalog from a trusted publisher.
     sig:           {_VERIFY_FILE_SIGNATURE exit(0xe0000241)} 17:19:01.708
     sto:      {DRIVERSTORE IMPORT VALIDATE: exit(0x00000000)} 17:19:01.739

Full log file here setupapi.dev.log

I tought the driver does not load because the warnings about the certificate or the error could be somewhere else.

If someone could give me a small advice to continue. I am stuck now :(

Many Thanks.

解决方案

All started when I was able to install my Biometric Driver but it showed a "Yellow Exclamation Mark" and a generic message "This device cannot start. (Code 10)"

The biometric sample project does not include an example how to sign properly EngineAdapter.dll with Visual Studio I found this resource (page 33-34) where shows How to Sign The EngineAdapter on project properties Build Events -> Post Build Event:

Command Line: signtool sign /v /ac "Path_to_cross_certificate_DigiCert Assured ID Root CA.crt" /tr http://timestamp.digicert.com /td sha256 /fd sha256 /f "path_to_my_certificate_file.pfx" /p mypassword "$(Platform)\$(ConfigurationName)\EngineAdapter.dll"
Use In Build: Yes

Next This first video tutorial shows an example of debugging umdf driver using a tool from the WDK wdfverifier.exe I couldn't attach the debugger to my driver process because the process is not present. But I could debug at startup before the process crashes.

To debug with wdfverifier.exe I took the following steps:

Settings Tab: Check the option "Automatically Launch user-mode debugger when requested", specify 15 seconds in the input "Host Process will wait"

Preferences Tab: Check "Use WinDbg", then

Disable/Enable my device on Device Manager

WinDbg launches and I can check if my driver module was loaded with the next command:

lm m *bio*
//the module is not loaded, use g commant to continue
g
//again see if the module was loaded
lm m *bio*
//module shows up, great!

Now I can set break points but before that I had to specify to WinDbg where are the symbol file (*.pdb) and source code of the driver with the next commands (the paths may be different if you build the package project, I am building the WudfBioUsbSample with a reference to EngineAdapter Project):

.symfix
.srcpath+ C:\Users\myuser\Documents\Windows-driver-samples\biometrics\driver    
.sympath+ C:\Users\myuser\Documents\Windows-driver-samples\biometrics\driver\x64\Debug

.reload /f

Next I could set a break point:

//x command is used to search if the method exist
x WudfBioUsbSample!CBiometricDriver::*
x WudfBioUsbSample!CBiometricDevice::*
x WudfBioUsbSample!CBiometricDevice::OnGetAttributes
//examples of breakpoints
bp WudfBioUsbSample!CBiometricDriver::OnDeviceAdd
bp WudfBioUsbSample!CBiometricDevice::OnGetAttributes
bp WudfBioUsbSample!CBiometricDevice::CreateUsbIoTargets

The method CreateUsbIoTargets is where the errors show up. These errors are fixed by JinZhuXing in this github issue

After fixing the driver code and debugging that the method CreateUsbIoTargets runs Ok

Still showed me The Yellow Exclamation Mark but this time the error was in the EngineAdapter.dll. The next error shows in EventViewer: Application and Services Logs > Microsoft\Windows\Biometrics

The module's "Engine Adapter" initialization routine failed with error: 0x80004001

The EngineAdapter project methods were returning E_NOTIMPL I just changed this to return S_OK instead for all methods. And the biometric unit was successfully created.

Also debugging of the Engine Plugin is done with Visual Studio. Here are the steps I followed:

Use wdfverifier.exe to attach WinDbg to the process of my umdf driver and set a break point to OnGetAttributes method (this method is called when I start/restart the Windows Biometric Service)This breakpoint will make the service to wait before it calls the EngineAdapter Plugin code.

x WudfBioUsbSample!CBiometricDevice::OnGetAttributes
bp WudfBioUsbSample!CBiometricDevice::OnGetAttributes
g

Restart or start Windows Biometric Service (WbioSrvc on Task Manager->Services Tab)

Copy The Process ID (PID)

Run Visual Studio as Administrator, Open WBDIsample project

Use Menu Debug -> Attach to Process...

Enter the following values:

Connection Type: Windows User Mode Debugger
Connection Target: Localhost

Check "Show processes from all users" 

Filter by Process ID 
Select the process and Click Attach button.

Set Breakpoints on WbioQueryEngineInterface, EngineAdapterAttach, EngineAdapterDetach a sample implementation is on msdn

run the command g (Go) on WinDbg

g

After this you can debug the code of the plugin on Visual Studio.

What is left is to implement the code for the Biometric Driver and The necessary plugins for your device

这篇关于Windows生物识别框架示例umdf驱动程序:该设备无法启动. (代码10)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆