Bagikan melalui


PIBIO_STORAGE_GET_RECORD_COUNT_FN fungsi panggilan balik (winbio_adapter.h)

Dipanggil oleh Windows Biometric Framework atau oleh adaptor mesin untuk mengambil jumlah rekaman templat dalam tataan hasil alur.

Sintaks

PIBIO_STORAGE_GET_RECORD_COUNT_FN PibioStorageGetRecordCountFn;

HRESULT PibioStorageGetRecordCountFn(
  [in, out] PWINBIO_PIPELINE Pipeline,
  [out]     PSIZE_T RecordCount
)
{...}

Parameter

[in, out] Pipeline

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

[out] RecordCount

Penunjuk ke variabel yang menerima jumlah rekaman templat dalam tataan hasil.

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 pointer wajib adalah NULL.
WINBIO_E_DATABASE_NO_RESULTS
Kueri berhasil, tetapi tidak ada rekaman yang cocok yang dapat ditemukan.
WINBIO_E_INVALID_DEVICE_STATE
Anggota StorageContext dari objek alur adalah NULL atau anggota FileHandle tidak valid.

Keterangan

Jumlah rekaman yang saat ini dalam kumpulan hasil ditentukan oleh panggilan terbaru ke fungsi StorageAdapterQueryByContent atau StorageAdapterQueryBySubject .

Contoh

Pseudocode berikut menunjukkan salah satu kemungkinan implementasi fungsi ini. Contoh tidak dikompilasi. Kau harus menyesuaikannya sesuai dengan tujuanmu.

/////////////////////////////////////////////////////////////////////////////////////////
//
// StorageAdapterGetRecordCount
//
// Purpose:
//      Retrieves the number of template records in the pipeline result set.
//
// Parameters:
//      Pipeline    -  Pointer to a WINBIO_PIPELINE structure associated with 
//                     the biometric unit performing the operation.
//      RecordCount -  Pointer to a variable that receives the number of template 
//                     records in the result set.
//
static HRESULT
WINAPI
StorageAdapterGetRecordCount(
    __inout PWINBIO_PIPELINE Pipeline,
    __out PSIZE_T RecordCount
    )
{
    HRESULT hr = S_OK;

    // Verify that pointer arguments are not NULL.
    if (!ARGUMENT_PRESENT(Pipeline) ||
        !ARGUMENT_PRESENT(RecordCount))
    {
        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 || storageContext->FileHandle == INVALID_HANDLE_VALUE)
    {
        hr =  WINBIO_E_INVALID_DEVICE_STATE;
        goto cleanup;
    }

    // Call a custom function (_ResultSetGetCount) to retrieve the number of
    // records that the most recent query left in the result set.
    hr = _ResultSetGetCount( &storageContext->ResultSet, RecordCount);

cleanup:

    return hr;
}

Persyaratan

   
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

StorageAdapterQueryByContent

StorageAdapterQueryBySubject