共用方式為


PIBIO_ENGINE_EXPORT_ENGINE_DATA_FN回呼函數 (winbio_adapter.h)

由 Windows 生物特徵辨識架構呼叫,以從格式化為標準 WINBIO_BIR 結構的引擎擷取最近處理的功能集或範本複本。

語法

PIBIO_ENGINE_EXPORT_ENGINE_DATA_FN PibioEngineExportEngineDataFn;

HRESULT PibioEngineExportEngineDataFn(
  [in, out] PWINBIO_PIPELINE Pipeline,
  [in]      WINBIO_BIR_DATA_FLAGS Flags,
  [out]     PWINBIO_BIR *SampleBuffer,
  [out]     PSIZE_T SampleSize
)
{...}

參數

[in, out] Pipeline

指向與執行作業的生物特徵辨識單元相關聯的 WINBIO_PIPELINE 結構的指標。

[in] Flags

指定引擎所傳回之 WINBIO_BIR 結構屬性的值。 這可以是下列安全性和處理層級旗標的位元 OR

WINBIO_DATA_FLAG_PRIVACY

資料已加密。

  • WINBIO_DATA_FLAG_INTEGRITY 資料會以數位方式簽署或由訊息驗證碼 (MAC) 保護。

  • WINBIO_DATA_FLAG_SIGNED 如果設定此旗標和 <標記>WINBIO_DATA_FLAG_INTEGRITY</標記> 旗標,則會簽署資料。 如果未設定此旗標,但 <設定了標記>WINBIO_DATA_FLAG_INTEGRITY</標記> 旗標,則會計算MAC。

  • WINBIO_DATA_FLAG_RAW 資料採用擷取時使用的格式。

  • WINBIO_DATA_FLAG_INTERMEDIATE 數據不是原始的,但尚未完全處理。

  • WINBIO_DATA_FLAG_PROCESSED 資料已處理完畢。

[out] SampleBuffer

接收包含功能集或範本之 WINBIO_BIR 結構指標的變數位址。

[out] SampleSize

變數的指標,其中包含 SampleBuffer 參數中傳回之WINBIO_BIR結構大小 (以位元組為單位)。

傳回值

如果函式成功,則會傳回S_OK。 如果函式失敗,它必須傳回下列其中一個 HRESULT 值,以指出錯誤。

傳回碼 Description
E_INVALIDARG
引擎配接器不支援 Flags 參數所指定的旗標組合。
E_OUTOFMEMORY
沒有足夠的記憶體可用來建立 WINBIO_BIR 結構。
E_POINTER
必要指標參數為 NULL。
WINBIO_E_INVALID_DEVICE_STATE
管線不包含 Flags 參數所需的資料類型。
E_NOTIMPL
目前尚未實作此方法。

備註

您必須使用 HeapAlloc 函式,從進程堆積配置要在 SampleBuffer 參數中傳回的緩衝區。 建立緩衝區之後,它會成為 Windows 生物特徵辨識架構的屬性。 因為架構會在完成使用此記憶體時解除配置,所以此函式的實作不得嘗試解除配置緩衝區或儲存它的指標。 藉由不儲存指標,您可以防止引擎配接器的其他部分在此函式傳回之後嘗試使用緩衝區。

範例

下列虛擬程式碼顯示此函式的一種可能實作。 此範例不會編譯。 您必須調整它以適應您的目的。

//////////////////////////////////////////////////////////////////////////////////////////
//
// EngineAdapterExportEngineData
//
// Purpose:
//      Retrieves a copy of the most recently processed feature set or template.
//
// Parameters:
//      Pipeline        - Pointer to a WINBIO_PIPELINE structure associated 
//                        with the biometric unit performing the operation
//      Flags           - Security and processing level flags
//      SampleBuffer    - Contains the feature set or template
//      SampleSize      - Size, in bytes, of the structure returned in the 
//                        SampleBuffer parameter.
//
static HRESULT
WINAPI
EngineAdapterExportEngineData(
    __inout PWINBIO_PIPELINE Pipeline,
    __in WINBIO_BIR_DATA_FLAGS Flags,
    __out PWINBIO_BIR *SampleBuffer,
    __out PSIZE_T SampleSize
    )
{
    HRESULT hr = S_OK;
    PWINBIO_BIR birAddress = NULL;
    SIZE_T birSize = 0;

    // Verify that pointer arguments are not NULL.
    if (!ARGUMENT_PRESENT(Pipeline) ||
        !ARGUMENT_PRESENT(SampleBuffer) ||
        !ARGUMENT_PRESENT(SampleSize))
    {
        hr = E_POINTER;
        goto cleanup;
    }

    // Retrieve the context from the pipeline.
    PWINBIO_ENGINE_CONTEXT context = 
           (PWINBIO_ENGINE_CONTEXT)Pipeline->EngineContext;

    // At least one processing level flag must be set. Your adapter can also
    // place additional restrictions on supported export formats.
    if (Flags & (WINBIO_DATA_FLAG_RAW | 
                 WINBIO_DATA_FLAG_INTERMEDIATE | 
                 WINBIO_DATA_FLAG_PROCESSED) == 0)
    {
        hr = E_INVALIDARG;
        goto cleanup;
    }

    // You must implement the _CreateBirFromAdapterData function to extract
    // data from the engine context and create a new WINBIO_BIR structure. The
    // function passes ownership of the new biometric information record (BIR)
    // to the EngineAdapterExportEngineData routine which then passes the BIR
    // to the caller.
    hr = _CreateBirFromAdapterData( context, Flags, &birAddress, &birSize);
    if (SUCCEEDED(hr))
    {
        *SampleBuffer = birAddress;
        *SampleSize = birSize;
    }

cleanup:

    return hr;
}

需求

Requirement 價值觀
最低支援的用戶端 Windows 7 [僅限傳統型應用程式]
支援的最低伺服器 Windows Server 2008 R2 [僅限傳統型應用程式]
目標平臺 窗戶
Header winbio_adapter.h(包括Winbio_adapter.h)

另請參閱

EngineAdapterAcceptSampleData

插件功能