title: How to capture fingerprint with Windows Biometric Framework in Firebreath
body: <p>I've been trying to make FireBreath plugin that captures fingerprints with scanner. This code runs fine as just a console application (minus boost threading).</p>
  
  <pre><code>bool GopripFPrintAPI::winCaptureFPrint(const FB::JSObjectPtr&amp; callback)
  {
      boost::thread t(boost::bind(&amp;GopripFPrintAPI::WBFCapture_thread, this, callback));
  
      return true;
  }
  
  int GopripFPrintAPI::WBFCapture_thread(const FB::JSObjectPtr&amp; callback)
  {
  
      unsigned long resultHandle = 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. 
      resultHandle = 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
          &amp;sessionHandle              // [out] Session handle
      );
  
      // Capture a biometric sample.
      wprintf_s(L"\n Calling WinBioCaptureSample - Swipe sensor...\n");
      resultHandle = WinBioCaptureSample(
          sessionHandle,
          WINBIO_NO_PURPOSE_AVAILABLE,
          WINBIO_DATA_FLAG_RAW,
          &amp;unitId,
          &amp;sample,
          &amp;sampleSize,
          &amp;rejectDetail
      );
      ...
  }
  </code></pre>
  
  <p>calling winCaptureFPrint() correctly starts WBFCapture_thread() and stops waiting at WinBioCaptureSample() but using fingerprint scanners does nothing method winBioCaptureSample() doesn't seem to get signal from scanner. I have been thinking that it's probably a focus issue so I have tried</p>
  
  <pre><code>resultHandle = WinBioAcquireFocus()
  </code></pre>
  
  <p>But it always fails. It gives General access denied error E_ACCESSDENIED.
  Is there something in FireBreath focuswise that I don't know or am I doing something else wrong?</p>