PIBIO_ENGINE_QUERY_SAMPLE_HINT_FN回呼函式 (winbio_adapter.h)

由 Windows 生物特徵辨識架構呼叫,以擷取引擎配接器建構註冊範本所需的正確樣本數目。

語法

PIBIO_ENGINE_QUERY_SAMPLE_HINT_FN PibioEngineQuerySampleHintFn;

HRESULT PibioEngineQuerySampleHintFn(
  [in, out] PWINBIO_PIPELINE Pipeline,
  [out]     PSIZE_T SampleHint
)
{...}

參數

[in, out] Pipeline

與執行作業之生物特徵辨識單位相關聯的 WINBIO_PIPELINE 結構的指標。

[out] SampleHint

接收所需樣本數目的變數指標。

傳回值

如果函式成功,則會傳回S_OK。 如果函式失敗,它必須傳回下列其中一個 HRESULT 值,以指出錯誤。

傳回碼 Description
E_POINTER
強制指標參數為 NULL
WINBIO_E_UNSUPPORTED_PROPERTY
引擎配接器不支援這個屬性。

備註

如果引擎配接器在不同情況下需要不同的樣本數目,您應該傳回最大數目。 例如,如果指紋引擎需要比指指更多的撥動,則傳回索引手指所需的數位。

SampleHint 參數傳回的值會指定所需的正確樣本數目。 由於擷取不正確,註冊期間所需的實際樣本數目可能會大於指定的數目。

範例

下列虛擬程式代碼顯示此函式的一個可能實作。 此範例不會編譯。 您必須調整它以符合您的用途。

//////////////////////////////////////////////////////////////////////////////////////////
//
// EngineAdapterQuerySampleHint
//
// Purpose: 
//      Retrieves the number of correct samples required by the engine adapter 
//      to construct an enrollment template.
//
// Parameters:
//      Pipeline    - Pointer to a WINBIO_PIPELINE structure associated 
//                    with the biometric unit performing the operation. 
//      SampleHint  - Pointer to a variable that receives the number of 
//                    required samples.
//
static HRESULT
WINAPI
EngineAdapterQuerySampleHint(
    __inout PWINBIO_PIPELINE Pipeline,
    __out PSIZE_T SampleHint
    )
{
    // Verify that pointer arguments are not NULL.
    if (!ARGUMENT_PRESENT(Pipeline) ||
        !ARGUMENT_PRESENT(SampleHint))
    {
        hr = E_POINTER;
        goto cleanup;
    }

    // The sample hint specified here is a constant but can also be a 
    // function of the hardware model or the device settings depending
    // on your adapter.
    // If your adapter does not support this feature, return
    // WINBIO_E_UNSUPPORTED_PROPERTY.
    *SampleHint = SAMPLES_REQUIRED_FOR_ENROLLMENT;

cleanup:

    return hr;
}

規格需求

需求
最低支援的用戶端 Windows 7 [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2008 R2 [僅限桌面應用程式]
目標平台 Windows
標頭 winbio_adapter.h (包含 Winbio_adapter.h)

另請參閱

EngineAdapterAcceptSampleData

外掛程式函式