Windows Biometric Framework API 指纹识别

来源:互联网 发布:上古卷轴5捏脸数据 编辑:程序博客网 时间:2024/06/05 11:39
一 相关链接

非常详细的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.”

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

原创粉丝点击