none
Undefined error in Windows Biometric Framework - WinBioOpenSession RRS feed

  • Question

  • I'm trying to develop a client application to capture fingerprints from a BIO-Key SideTouch sensor. The sensor is recognized by W10 correctly (I enroll my own fingerprints with Windows Hello correctly). 

    In the app, I have the following code to open a WBF Session and capture a raw sample:

    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
    	);
    	if (FAILED(hr))
    	{
    		wprintf_s(L"\n WinBioOpenSession failed. hr = 0x%x\n", hr);
    		if (sample != NULL)
    		{
    			WinBioFree(sample);
    			sample = NULL;
    		}
    
    		if (sessionHandle != NULL)
    		{
    			WinBioCloseSession(sessionHandle);
    			sessionHandle = NULL;
    		}
    		return hr;
    	}
    
    	// Capture a biometric sample.
    	wprintf_s(L"\n Calling WinBioCaptureSample - Swipe sensor...\n");
    	hr = WinBioCaptureSample(
    		sessionHandle,
    		WINBIO_NO_PURPOSE_AVAILABLE,
    		WINBIO_DATA_FLAG_RAW,
    		&unitId,
    		&sample,
    		&sampleSize,
    		&rejectDetail
    	);
    	if (FAILED(hr))
    	{
    		if (hr == WINBIO_E_BAD_CAPTURE)
    		{
    			wprintf_s(L"\n Bad capture; reason: %d\n", rejectDetail);
    		}
    		else
    		{
    			wprintf_s(L"\n WinBioCaptureSample failed. hr = 0x%x\n", hr);
    		}
    		if (sample != NULL)
    			{
    				WinBioFree(sample);
    				sample = NULL;
    			}
    			
    			if (sessionHandle != NULL)
    			{
    				WinBioCloseSession(sessionHandle);
    				sessionHandle = NULL;
    			}
    		return hr;
    	}
    
    	wprintf_s(L"\n Swipe processed - Unit ID: %d\n", unitId);
    	wprintf_s(L"\n Captured %d bytes.\n", sampleSize);
    
    	return hr;
    }

    I'm getting as return value: -2147024891, and the application fails while trying to open the WBF Session. I tried with another fingerprint sensor compatible with WBF with same result. 

    I converted the error code to HEX: 7FF8FFFB, but I didn't find any information about this error code.

    Wednesday, February 15, 2017 1:33 PM

Answers

  • You converted the error code improperly (you didn't make it negative). -2147024891 = 0x80070005, which is ERROR_ACCESS_DENIED

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Wednesday, February 15, 2017 7:52 PM
    Moderator