PIBIO_ENGINE_CREATE_ENROLLMENT_FN función de devolución de llamada (winbio_adapter.h)

Llamado por Windows Biometric Framework para inicializar el objeto de inscripción en la canalización de unidades biométricas.

Sintaxis

PIBIO_ENGINE_CREATE_ENROLLMENT_FN PibioEngineCreateEnrollmentFn;

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

Parámetros

[in, out] Pipeline

Puntero a una estructura de WINBIO_PIPELINE asociada a la unidad biométrica que realiza la operación.

Valor devuelto

Si la función se ejecuta correctamente, devuelve S_OK. Si se produce un error en la función, debe devolver uno de los siguientes valores HRESULT para indicar el error.

Código devuelto Descripción
E_POINTER
El parámetro Pipeline no puede ser NULL.
E_OUTOFMEMORY
no hay suficiente memoria para completar la operación.

Comentarios

EngineAdapterCommitEnrollment marca el principio de una transacción de inscripción. Si esta función se ejecuta correctamente, El marco biométrico de Windows llama a EngineAdapterUpdateEnrollment para agregar uno o varios conjuntos de características al objeto de inscripción. A continuación, El marco llama a EngineAdapterCommitEnrollment o EngineAdapterDiscardEnrollment para completar la transacción.

Ejemplos

El siguiente pseudocódigo muestra una posible implementación de esta función. El ejemplo no se compila. Debes adaptarlo para que se adapte a tu propósito.

//////////////////////////////////////////////////////////////////////////////////////////
//
// 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;
}

Requisitos

Requisito Value
Cliente mínimo compatible Windows 7 [solo aplicaciones de escritorio]
Servidor mínimo compatible Windows Server 2008 R2 [solo aplicaciones de escritorio]
Plataforma de destino Windows
Encabezado winbio_adapter.h (incluya Winbio_adapter.h)

Consulte también

Funciones de complemento