Bagikan melalui


PIBIO_STORAGE_CLEAR_CONTEXT_FN fungsi panggilan balik (winbio_adapter.h)

Dipanggil oleh Windows Biometric Framework untuk menyiapkan alur pemrosesan unit biometrik untuk operasi baru. Fungsi ini harus membersihkan data sementara dari konteks mesin dan menempatkan adaptor mesin ke dalam keadaan awal yang terdefinisi dengan baik.

Sintaks

PIBIO_STORAGE_CLEAR_CONTEXT_FN PibioStorageClearContextFn;

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

Parameter

[in, out] Pipeline

Arahkan ke struktur WINBIO_PIPELINE yang terkait dengan unit biometrik yang melakukan operasi.

Mengembalikan nilai

Jika fungsi berhasil, fungsi akan mengembalikan S_OK. Jika fungsi gagal, fungsi harus mengembalikan salah satu nilai HRESULT berikut untuk menunjukkan kesalahan.

Menampilkan kode Deskripsi
E_POINTER
Argumen Alur tidak boleh NULL.
WINBIO_E_INVALID_DEVICE_STATE
Anggota StorageContext dari struktur WINBIO_PIPELINE yang diacu oleh argumen Alur adalah NULL.

Keterangan

Item konteks adaptor penyimpanan berikut harus dibersihkan:

  • Kumpulan hasil - kumpulan rekaman yang dihasilkan oleh operasi kueri database terbaru.
  • Kursor tataan hasil - indikator posisi saat ini dalam tataan hasil. Ini digunakan untuk melakukan iterasi melalui tataan hasil dan membuat catatan individual tersedia.

Contoh

Pseudocode berikut menunjukkan satu kemungkinan implementasi fungsi ini. Contoh tidak dikompilasi. Anda harus menyesuaikannya agar sesuai dengan tujuan Anda.

/////////////////////////////////////////////////////////////////////////////////////////
//
// 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;
}

Persyaratan

Persyaratan Nilai
Klien minimum yang didukung Windows 7 [hanya aplikasi desktop]
Server minimum yang didukung Windows Server 2008 R2 [hanya aplikasi desktop]
Target Platform Windows
Header winbio_adapter.h (termasuk Winbio_adapter.h)

Lihat juga

Fungsi Plug-in