PIBIO_SENSOR_CANCEL_FN callback function (winbio_adapter.h)
Called by the Windows Biometric Framework to cancel all pending sensor operations.
Syntax
PIBIO_SENSOR_CANCEL_FN PibioSensorCancelFn;
HRESULT PibioSensorCancelFn(
[in, out] PWINBIO_PIPELINE Pipeline
)
{...}
Parameters
[in, out] Pipeline
Pointer to the WINBIO_PIPELINE structure associated with the biometric unit performing the operation.
Return value
If the function succeeds, it returns S_OK. If the function fails, it must return one of the following HRESULT values to indicate the error.
Return code | Description |
---|---|
|
The Pipeline argument cannot be NULL. |
|
The SensorHandle member of the WINBIO_PIPELINE structure pointed to by the Pipeline argument is set to INVALID_HANDLE_VALUE. |
Remarks
Your implementation of this function should not wait for pending operations to complete.
If the sensor has no pending operations when this function is called, your implementation must return S_OK without changing the state of the pipeline.
Examples
The following pseudocode shows one possible implementation of this function. The example does not compile. You must adapt it to suit your purpose.
//////////////////////////////////////////////////////////////////////////////////////////
//
// SensorAdapterCancel
//
// Purpose:
// Cancels all pending sensor operations.
//
// Parameters:
// Pipeline - Pointer to a WINBIO_PIPELINE structure associated with
// the biometric unit.
//
static HRESULT
WINAPI
SensorAdapterCancel(
__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;
}
// Validate the current sensor state.
if (Pipeline->SensorHandle == INVALID_HANDLE_VALUE)
{
return WINBIO_E_INVALID_DEVICE_STATE;
}
// Cancel all I/O to the sensor handle.
if (!CancelIoEx(Pipeline->SensorHandle, NULL))
{
hr = _SensorAdapterGetHresultFromWin32(GetLastError());
}
return hr;
}
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
Target Platform | Windows |
Header | winbio_adapter.h (include Winbio_adapter.h) |