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

Llamado por Windows Biometric Framework para preparar la canalización de procesamiento de la unidad biométrica para una nueva operación. Esta función debe vaciar los datos temporales del contexto del motor y colocar el adaptador del motor en un estado inicial bien definido.

Sintaxis

PIBIO_ENGINE_CLEAR_CONTEXT_FN PibioEngineClearContextFn;

HRESULT PibioEngineClearContextFn(
  [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 argumento Pipeline no puede ser NULL.

Comentarios

Este propósito de esta función es restablecer el contexto al estado en el que estaba inmediatamente después de una llamada a la función EngineAdapterAttach . El contexto es una estructura reutilizable. La función EngineAdapterClearContext reinicializa el contexto, pero no la quita de la canalización.

Entre los ejemplos típicos de los objetos del área de contexto del adaptador del motor que se deben borrar se incluyen los siguientes.

Object Descripción
Conjunto de características Contiene una descripción de una muestra biométrica
Inscripción Realiza un seguimiento del estado actual de una transacción de inscripción.
Plantilla Plantilla biométrica creada por el conjunto de características o el objeto de inscripción.
De comparación Contiene el resultado de una comparación entre la plantilla y el conjunto de características.
Vector de índice Contiene un conjunto de valores de índice asociados a la plantilla.
 

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.

//////////////////////////////////////////////////////////////////////////////////////////
//
// EngineAdapterClearContext
//
// Purpose:
//      Prepares the processing pipeline of the biometric unit for a 
//      new operation.
//
// Parameters:
//      Pipeline -  Pointer to a WINBIO_PIPELINE structure associated with 
//                  the biometric unit.
//
static HRESULT
WINAPI
EngineAdapterClearContext(
    __inout PWINBIO_PIPELINE Pipeline
    )
{
    // 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;

    if (context == NULL)
    {
        goto cleanup;
    }

    // Change the engine adapter state and discard any partially completed
    // operations. Depending on the adapter, this can involve changes to state 
    // variables or actions implemented in hardware. The following example
    // assumes that your engine adapter context contains a ULONG data member 
    // and pointers to a feature set and an enrollment object.

    context->SomeField = 0L;

    if (context->FeatureSet != NULL)
    {
        // Zero the feature set if it contains unencrypted biometric data.
        SecureZeroMemory(
            context->FeatureSet,
            context->FeatureSetSize);

        // Release the feature set.
        _AdapterRelease(context->FeatureSet);
        context->FeatureSet = NULL;
        context->FeatureSetSize = 0;
    }

    if (context->Enrollment.Template != NULL)
    {
        // Zero the template if it contains unencrypted biometric data.
        SecureZeroMemory(
            context->Enrollment.Template,
            context->Enrollment.TemplateSize);

        // Release the template.
        _AdapterRelease(context->Enrollment.Template);
        context->Enrollment.Template = NULL;
        context->Enrollment.TemplateSize = 0;

        // Release other data members attached to the enrollment object.
        context->Enrollment.SampleCount = 0;
        context->Enrollment.InProgress = FALSE;
    }

cleanup:

    return S_OK;
}

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

SensorAdapterClearContext

StorageAdapterClearContext