Windows Biometric Framework API 指纹识别

一 相关链接

非常详细的demo code ,可以直接编译   Client Application Functions 

错误代码的定义  Client Error Codes

函数说明   WinBioEnrollBegin function

二  环境

用的是win1064系统,VS2012编译环境

三 注意

1 WinBioOpenSession的第三个参数Flags [in] ,capture 和enroll的设定不同

    HRESULT CaptureSample()  
    {  
        HRESULT hr = S_OK;  
        WINBIO_SESSION_HANDLE sessionHandle = NULL;  
        WINBIO_UNIT_ID unitId = 0;  
        WINBIO_REJECT_DETAIL rejectDetail = 0;  
        PWINBIO_BIR sample = NULL;  
        SIZE_T sampleSize = 0;  
      
        // Connect to the system pool.   
        hr = WinBioOpenSession(   
                WINBIO_TYPE_FINGERPRINT,    // Service provider  
                WINBIO_POOL_SYSTEM,         // Pool type  
                WINBIO_FLAG_RAW,            // Access: Capture raw data  
                NULL,                       // Array of biometric unit IDs  
                0,                          // Count of biometric unit IDs  
                WINBIO_DB_DEFAULT,          // Default database  
                &sessionHandle              // [out] Session handle  
                );  


WINBIO_DATA_FLAG_RAW (Return the sample exactly as it was captured by the sensor.)

我用capturesample前几次可以用的,但多试几次就挂了,WinBioOpenSession拒绝访问

2 LocateSensor( )

这个函数有个bug,硬体问题不会报错。

hr = WinBioLocateSensor( sessionHandle, &unitId);

//hr=0x0

//我们的芯片VDD pin断了,这个函数会马上返回来,不会等待按手指。但是返回值还是0x0。



3 HRESULT EnrollSysPool(  BOOL discardEnrollment,   WINBIO_BIOMETRIC_SUBTYPE subFactor)

同步登记功能 ,subFactor用来指定指纹保存的位置,就是identify时显示的手指,宽字符指针

hr = WinBioEnrollBegin(
            sessionHandle,      // Handle to open biometric session
            subFactor,          // Finger to create template for
            unitId              // Biometric unit ID
            );

winbio_types.h 中定义的:

#define WINBIO_ANSI_381_POS_RH_INDEX_FINGER     ((WINBIO_BIOMETRIC_SUBTYPE)2)

注意:

1)不能多次保存同一个subFactor ,会报错   “ WINBIO_E_DUPLICATE_ENROLLMENT     0x8009801C ” 。

“The specified identity and sub-factor are already enrolled in the database.”

2)同一个手指不能保存两次,即使是不同的subFactor也不行,会报错 “  WINBIO_E_DUPLICATE_TEMPLATE   0x8009802B ”

“The data in a biometric template matches that of another template already in the database.”

登记后不知道怎么清除指纹信息,我是用系统自带的账号设置(设置-》账户-》指纹登录)来清除的,

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值