Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/rest/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Windows生物识别框架示例umdf驱动程序:此设备无法启动。(代码10)_C++_Wdk_Umdf_Wbf_Wbdi - Fatal编程技术网

C++ Windows生物识别框架示例umdf驱动程序:此设备无法启动。(代码10)

C++ Windows生物识别框架示例umdf驱动程序:此设备无法启动。(代码10),c++,wdk,umdf,wbf,wbdi,C++,Wdk,Umdf,Wbf,Wbdi,我正在尝试运行windows,我对驱动程序开发很幼稚 我已经更改了inx文件中的硬件id,重建了驱动程序项目,并在我的Windows 10 Pro版本1803上安装了生成的驱动程序 我用的是指纹成像仪1300 E3 驱动程序已成功安装,但出现一个错误: 此设备无法启动。(代码10) 指定的请求不是目标设备的有效操作。 我查看了文件 它显示以下警告: sig: {_VERIFY_FILE_SIGNATURE} 10:13:03.130 s

我正在尝试运行windows,我对驱动程序开发很幼稚

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

我用的是指纹成像仪1300 E3

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

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

我查看了文件

它显示以下警告:

     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.
     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
但是我在本地机器上的可信根证书颁发机构和可信发布机构上安装了TestCertificate

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

我尝试使用wdfverifier.exe进行调试,但进程未启动,因此无法调试:(

我验证了Visual Studio没有对EngineAdapter.dll插件文件进行签名,因此我禁用了驱动程序签名,并按照以下步骤手动进行了签名。但我得到了相同的错误代码10:(

我还想知道错误代码10是否是预期的行为,因为EngineAdapter.dll的代码没有实现

更新:我正在Windows 10 Pro 1709虚拟机VMWare上进行测试,发现其他错误:

此设备工作不正常,因为Windows无法加载此设备所需的驱动程序。(代码31)

同样的警告:

     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.
     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
这里有完整的日志文件

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

如果有人能给我一个小建议让我继续。我现在陷入困境:(


非常感谢。

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

生物特征样本项目不包括如何使用Visual Studio正确签名EngineAdapter.dll的示例,我在其中找到了显示如何在项目属性生成事件->生成后事件上签名EngineAdapter的

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
下面显示了使用WDKwdfverifier.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)和驱动程序源代码的位置(如果您构建项目,则路径可能不同,我正在构建WudfBioUsbSample,并参考EngineAdapter项目):

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

//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方法是错误出现的地方。这些错误由金竹星在年修复

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

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

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

!!!  dvi:                     Device not started: Device has problem: 0x1f (CM_PROB_FAILED_ADD), problem status: 0xc0000001.
EngineAdapter项目方法返回E_NOTIMPL我只是将此更改为返回S_OK而不是所有方法。生物识别单元已成功创建

另外,引擎插件的调试是通过Visual Studio完成的。以下是我遵循的步骤:

使用wdfverifier.exe将WinDbg连接到我的umdf驱动程序的进程,并将断点设置为OnGetAttributes方法(当我启动/重新启动Windows生物识别服务时调用此方法)。此断点将使服务在调用EngineApter插件代码之前等待

x WudfBioUsbSample!CBiometricDevice::OnGetAttributes
bp WudfBioUsbSample!CBiometricDevice::OnGetAttributes
g
重新启动或启动Windows生物识别服务(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、EngineAdApterTach、EngineAdapterDetach上设置断点 a

在WinDbg上运行命令g(Go)

g
在此之后,您可以在VisualStudio上调试插件的代码


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

所有这些都是在我能够安装生物识别驱动程序时启动的,但它显示了一个“黄色感叹号”和一条通用消息“此设备无法启动。(代码10)”

生物特征样本项目不包括如何使用Visual Studio正确签名EngineAdapter.dll的示例,我在其中找到了显示如何在项目属性生成事件->生成后事件上签名EngineAdapter的

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
下面显示了使用WDKwdfverifier.exe中的工具调试umdf驱动程序的示例 我无法将调试器附加到驱动程序进程,因为该进程不存在。但我可以在进程崩溃之前在启动时进行调试

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