共用方式為


PIBIO_ENGINE_CREATE_ENROLLMENT_FN回呼函式 (winbio_adapter.h)

由 Windows 生物特徵辨識架構呼叫,以初始化生物特徵辨識單位管線中的註冊物件。

語法

PIBIO_ENGINE_CREATE_ENROLLMENT_FN PibioEngineCreateEnrollmentFn;

HRESULT PibioEngineCreateEnrollmentFn(
  [in, out] PWINBIO_PIPELINE Pipeline
)
{...}

參數

[in, out] Pipeline

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

傳回值

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

傳回碼 Description
E_POINTER
Pipeline 參數不可為 NULL
E_OUTOFMEMORY
記憶體不足,無法完成此作業。

備註

EngineAdapterCommitEnrollment 會標示註冊交易的開頭。 如果此函式成功,Windows 生物特徵辨識架構會呼叫 EngineAdapterUpdateEnrollment ,將一或多個功能集新增至註冊物件。 架構接著會呼叫 EngineAdapterCommitEnrollmentEngineAdapterDiscardEnrollment 來完成交易。

範例

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

//////////////////////////////////////////////////////////////////////////////////////////
//
// EngineAdapterCreateEnrollment
//
// Purpose:
//      Initialize the enrollment object in the biometric unit pipeline.
//
// Parameters:
//      Pipeline    - Pointer to a WINBIO_PIPELINE structure associated 
//                    with the biometric unit performing the operation
//
static HRESULT
WINAPI
EngineAdapterCreateEnrollment(
    __inout PWINBIO_PIPELINE Pipeline
    )
{
    HRESULT hr = S_OK;

    // Verify that the Pipeline parameter is not NULL.
    if (!ARGUMENT_PRESENT(Pipeline))
    {
        hr = E_POINTER;
        goto cleanup;
    }

    // Retrieve the context from the pipeline.
    PWINBIO_ENGINE_CONTEXT context = 
           (PWINBIO_ENGINE_CONTEXT)Pipeline->EngineContext;

    // Return if an enrollment is already in progress. This example assumes that 
    // your engine adapter context contains an enrollment object.
    if (context->Enrollment.InProgress == TRUE)
    {
        hr = WINBIO_E_INVALID_DEVICE_STATE;
        goto cleanup;
    }

    // Call a custom function (_AdapterCreateEnrollmentTemplate) to create a 
    // new enrollment template and attach it to the engine adapter context.
    hr = _AdapterCreateEnrollmentTemplate( 
            context, 
            &context->Enrollment
            );
    if (FAILED(hr))
    {
        goto cleanup;
    }

    // Initialize any Enrollment data members not initialized by  the 
    // _AdapterCreateEnrollmentTemplate function. This example assumes that
    // your enrollment object contains at a minimum a field that specifies 
    // the number of biometric samples and another that specifies whether a
    // new enrollment is in progress.
    context->Enrollment.SampleCount = 0;
    context->Enrollment.InProgress = TRUE;

cleanup:

    return hr;
}

規格需求

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

另請參閱

外掛程式函式