PIBIO_SENSOR_CLEAR_CONTEXT_FN Rückruffunktion (winbio_adapter.h)
Wird vom Windows Biometrischen Framework aufgerufen, um die Verarbeitungspipeline der biometrischen Einheit für einen neuen Vorgang vorzubereiten. Diese Funktion sollte temporäre Daten aus dem Sensorkontext spülen und den Sensoradapter in einen gut definierten Anfangszustand platzieren.
Syntax
PIBIO_SENSOR_CLEAR_CONTEXT_FN PibioSensorClearContextFn;
HRESULT PibioSensorClearContextFn(
[in, out] PWINBIO_PIPELINE Pipeline
)
{...}
Parameter
[in, out] Pipeline
Zeigen Sie auf die WINBIO_PIPELINE Struktur, die der biometrischen Einheit zugeordnet ist, die den Vorgang ausführt.
Rückgabewert
Wenn die Funktion erfolgreich ist, gibt sie S_OK zurück. Wenn die Funktion fehlschlägt, muss eine der folgenden HRESULT-Werte zurückgegeben werden, um den Fehler anzugeben.
Rückgabecode | Beschreibung |
---|---|
|
Das Pipelineargument kann nicht NULL sein. |
Bemerkungen
Ihre Implementierung der Funktion SensorAdapterClearContext sollte den Beispielpuffer löschen.
Beispiele
Der folgende Pseudocode zeigt eine mögliche Implementierung dieser Funktion. Das Beispiel kompiliert nicht. Sie müssen es an Ihren Zweck anpassen.
//////////////////////////////////////////////////////////////////////////////////////////
//
// SensorAdapterClearContext
//
// Purpose:
// Prepare the processing pipeline for a new operation. This function
// should flush temporary data from the sensor context and place the
// sensor adapter into a well-defined initial state.
//
// Parameters:
// Pipeline - Pointer to a WINBIO_PIPELINE structure associated with
// the biometric unit.
//
static HRESULT
WINAPI
SensorAdapterClearContext(
__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_SENSOR_CONTEXT sensorContext =
(PWINBIO_SENSOR_CONTEXT)Pipeline->SensorContext;
// Validate the current state of the sensor.
if (sensorContext == NULL)
{
return WINBIO_E_INVALID_DEVICE_STATE;
}
// Change the sensor 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 sensor adapter context contains a ULONG data member
// and pointers to a capture buffer and an attributes buffer.
sensorContext->SomeField = 0L;
if (sensorContext->CaptureBuffer != NULL)
{
// Zero the capture buffer.
SecureZeroMemory(
sensorContext->CaptureBuffer,
sensorContext->CaptureBufferSize);
// Release the capture buffer.
_AdapterRelease(sensorContext->CaptureBuffer);
sensorContext->CaptureBuffer = NULL;
sensorContext->CaptureBufferSize = 0;
}
if (sensorContext->AttributesBuffer != NULL)
{
// Zero the attributes buffer.
SecureZeroMemory(
sensorContext->AttributesBuffer,
sensorContext->AttributesBufferSize);
// Release the attributes buffer.
_AdapterRelease(sensorContext->AttributesBuffer);
sensorContext->AttributesBuffer = NULL;
sensorContext->AttributesBufferSize = 0;
}
// TODO: Perform any other work required to clear the sensor context.
return S_OK;
}
Anforderungen
Unterstützte Mindestversion (Client) | Windows 7 [nur Desktop-Apps] |
Unterstützte Mindestversion (Server) | Windows Server 2008 R2 [nur Desktop-Apps] |
Zielplattform | Windows |
Kopfzeile | winbio_adapter.h (enthalten Winbio_adapter.h) |