Share via


PIBIO_STORAGE_CLEAR_CONTEXT_FN回呼函式 (winbio_adapter.h)

由 Windows 生物特徵辨識架構呼叫,為新作業準備生物特徵辨識單位的處理管線。 此函式應該從引擎內容排清暫存數據,並將引擎配接器放入定義完善的初始狀態。

語法

PIBIO_STORAGE_CLEAR_CONTEXT_FN PibioStorageClearContextFn;

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

參數

[in, out] Pipeline

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

傳回值

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

傳回碼 Description
E_POINTER
Pipeline 自變數不可為 NULL
WINBIO_E_INVALID_DEVICE_STATE
Pipeline 自變數所指向之WINBIO_PIPELINE結構的 StorageContext 成員為 NULL

備註

應該清除下列記憶體配接器內容專案:

  • 結果集 - 最近一次資料庫查詢作業所產生的記錄集合。
  • 結果集數據指標 - 結果集內目前位置的指標。 這是用來逐一查看結果集,並讓個別記錄可供使用。

範例

下列虛擬程式代碼顯示此函式的一個可能實作。 此範例不會編譯。 您必須調整它以符合您的用途。

/////////////////////////////////////////////////////////////////////////////////////////
//
// StorageAdapterClearContext
//
// Purpose:
//      Prepare the processing pipeline of the biometric unit for a 
//      new operation.
//
// Parameters:
//      Pipeline -  Pointer to a WINBIO_PIPELINE structure associated with 
//                  the biometric unit performing the operation.
//
static HRESULT
WINAPI
StorageAdapterClearContext(
    __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_STORAGE_CONTEXT storageContext = 
           (PWINBIO_STORAGE_CONTEXT)Pipeline->StorageContext;

    // Verify the pipeline state.
    if (storageContext == NULL)
    {
        hr = WINBIO_E_INVALID_DEVICE_STATE;
        goto cleanup;
    }

    // Release data structures attached to the context. The following
    // example code shows how to release structures that will likely 
    // be associated with your adapter context.
    _ResultSetClearContents(&storageContext->ResultSet);
    if (storageContext->RawRecordData != NULL)
    {
        _AdapterRelease(storageContext->RawRecordData);
        storageContext->RawRecordData = NULL;
        storageContext->PayloadBlob = NULL;
    }
    if (storageContext->DecryptedTemplate != NULL)
    {
        SecureZeroMemory(
            storageContext->DecryptedTemplate, 
            storageContext->DecryptedTemplateSize
            );
        _AdapterRelease(storageContext->DecryptedTemplate);
        storageContext->DecryptedTemplate = NULL;
        storageContext->DecryptedTemplateSize = 0;
    }

    // TODO: Release any other allocated data structures attached
    // to the context (not shown).

cleanup:

    return hr;
}

規格需求

需求
最低支援的用戶端 Windows 7 [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2008 R2 [僅限桌面應用程式]
目標平台 Windows
標頭 winbio_adapter.h (包含 Winbio_adapter.h)

另請參閱

外掛程式函式