다음을 통해 공유


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 값 중 하나를 반환하여 오류를 나타내야 합니다.

반환 코드 설명
E_POINTER
Pipeline 매개 변수는 NULL일 수 없습니다.
E_OUTOFMEMORY
메모리가 부족하여 작업을 완료할 수 없습니다.

설명

EngineAdapterCommitEnrollment는 등록 트랜잭션의 시작을 표시합니다. 이 함수가 성공하면 Windows 생체 인식 프레임워크 는 EngineAdapterUpdateEnrollment 를 호출하여 등록 개체에 하나 이상의 기능 집합을 추가합니다. 그런 다음 프레임워크는 EngineAdapterCommitEnrollment 또는 EngineAdapterDiscardEnrollment 를 호출하여 트랜잭션을 완료합니다.

예제

다음 의사 코드는 이 함수의 가능한 구현 중 하나를 보여 줍니다. 예제는 컴파일되지 않습니다. 목적에 맞게 조정해야 합니다.

//////////////////////////////////////////////////////////////////////////////////////////
//
// 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 포함)

추가 정보

플러그 인 함수