fungsi panggilan balik PIBIO_SENSOR_PUSH_DATA_TO_ENGINE_FN (winbio_adapter.h)
Dipanggil oleh Windows Biometric Framework untuk membuat konten buffer sampel saat ini tersedia untuk adaptor mesin.
Sintaks
PIBIO_SENSOR_PUSH_DATA_TO_ENGINE_FN PibioSensorPushDataToEngineFn;
HRESULT PibioSensorPushDataToEngineFn(
[in, out] PWINBIO_PIPELINE Pipeline,
[in] WINBIO_BIR_PURPOSE Purpose,
[in] WINBIO_BIR_DATA_FLAGS Flags,
[out] PWINBIO_REJECT_DETAIL RejectDetail
)
{...}
Parameter
[in, out] Pipeline
Arahkan ke struktur WINBIO_PIPELINE yang terkait dengan unit biometrik yang melakukan operasi.
[in] Purpose
Nilai yang menentukan properti struktur WINBIO_BIR yang akan diteruskan ke mesin. Ini bisa menjadi bitwise ATAU dari bendera tingkat keamanan dan pemrosesan berikut:
- WINBIO_PURPOSE_VERIFY
- WINBIO_PURPOSE_IDENTIFY
- WINBIO_PURPOSE_ENROLL
- WINBIO_PURPOSE_ENROLL_FOR_VERIFICATION
- WINBIO_PURPOSE_ENROLL_FOR_IDENTIFICATION
[in] Flags
Nilai yang menentukan format sampel. Ini bisa menjadi bitwise ATAU dari bendera tingkat keamanan dan pemrosesan berikut:
- WINBIO_DATA_FLAG_PRIVACY
Sampel harus dienkripsi.
- WINBIO_DATA_FLAG_INTEGRITY
Sampel harus ditandatangani secara digital atau dilindungi oleh kode autentikasi pesan (MAC).
- WINBIO_DATA_FLAG_SIGNED
Jika bendera ini dan bendera WINBIO_DATA_FLAG_INTEGRITY diatur, sampel harus ditandatangani. Jika bendera ini tidak diatur tetapi bendera WINBIO_DATA_FLAG_INTEGRITY diatur, MAC harus dihitung.
- WINBIO_DATA_FLAG_RAW
Sampel harus ditempatkan di objek WINBIO_BIR dalam format tempat sampel diambil.
[out] RejectDetail
Penunjuk ke nilai WINBIO_REJECT_DETAIL yang berisi informasi tentang kegagalan sebelumnya untuk mengambil sampel biometrik dan oleh karena itu alasan bahwa buffer sampel kosong. Jika pengambilan sebelumnya berhasil, parameter ini diatur ke nol. Nilai berikut didefinisikan untuk pengambilan sidik jari:
- WINBIO_FP_TOO_HIGH
- WINBIO_FP_TOO_LOW
- WINBIO_FP_TOO_LEFT
- WINBIO_FP_TOO_RIGHT
- WINBIO_FP_TOO_FAST
- WINBIO_FP_TOO_SLOW
- WINBIO_FP_POOR_QUALITY
- WINBIO_FP_TOO_SKEWED
- WINBIO_FP_TOO_SHORT
- WINBIO_FP_MERGE_FAILURE
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 |
---|---|
|
Argumen pointer wajib adalah NULL. |
|
Data sampel tidak cocok untuk digunakan. Jika Anda mengembalikan kode kesalahan ini, Anda juga harus menentukan nilai dalam parameter RejectDetail untuk menunjukkan sifat masalah. |
|
Anggota SensorContext dari struktur WINBIO_PIPELINE yang diacu oleh argumen Alur adalah NULL. |
|
Tidak ada data pengambilan. |
Keterangan
Implementasi Anda dari fungsi ini harus mengonversi data mentah yang terkandung dalam buffer sampel menjadi struktur WINBIO_BIR standar dan mendorong struktur ini ke mesin dengan menggunakan fungsi EngineAdapterAcceptSampleData . Cara yang benar untuk melakukan ini adalah dengan memanggil fungsi pembantu WbioEngineAcceptSampleData yang ditentukan dalam file header Winbio_adapter.h.
Jika fungsi EngineAdapterAcceptSampleData mengembalikan WINBIO_E_BAD_CAPTURE, implementasi SensorAdapterPushDataToEngine Anda harus mengembalikan nilai RejectDetail yang disebarkan oleh adaptor mesin.
Adaptor sensor mempertahankan kepemilikan buffer sampel yang diteruskan ke EngineAdapterAcceptSampleData. Adaptor sensor bertanggung jawab untuk merilis buffer ini di beberapa titik setelah EngineAdapterAcceptSampleData kembali.
Contoh
Pseudocode berikut menunjukkan satu kemungkinan implementasi fungsi ini. Contoh tidak dikompilasi. Anda harus menyesuaikannya agar sesuai dengan tujuan Anda.
//////////////////////////////////////////////////////////////////////////////////////////
//
// SensorAdapterPushDataToEngine
//
// Purpose:
// Makes the current contents of the sample buffer available to the
// engine adapter.
//
// Parameters:
// Pipeline - Pointer to a WINBIO_PIPELINE structure associated with
// the biometric unit.
// Purpose - Specifies the properties of the WINBIO_BIR structure
// that will be passed to the engine.
// Flags - A value that specifies the format of the sample.
// RejectDetail - Pointer to a WINBIO_REJECT_DETAIL value that receives
// additional information about the reason the sample
// buffer is empty.
//
static HRESULT
WINAPI
SensorAdapterPushDataToEngine(
__inout PWINBIO_PIPELINE Pipeline,
__in WINBIO_BIR_PURPOSE Purpose,
__in WINBIO_BIR_DATA_FLAGS Flags,
__out PWINBIO_REJECT_DETAIL RejectDetail
)
{
HRESULT hr = S_OK;
// Verify that pointer arguments are not NULL.
if (!ARGUMENT_PRESENT(Pipeline) ||
!ARGUMENT_PRESENT(RejectDetail))
{
hr = E_POINTER;
goto cleanup;
}
// Retrieve the context from the pipeline.
PWINBIO_SENSOR_CONTEXT sensorContext =
(PWINBIO_SENSOR_CONTEXT)Pipeline->SensorContext;
// Verify the state of the pipeline.
if (sensorContext == NULL)
{
hr = WINBIO_E_INVALID_DEVICE_STATE;
goto cleanup;
}
if (sensorContext->CaptureBuffer != NULL &&
sensorContext->CaptureBufferSize >= sizeof (WINBIO_CAPTURE_DATA) &&
sensorContext->CaptureBuffer->CaptureData.Size != 0 &&
sensorContext->CaptureBuffer->SensorStatus == WINBIO_SENSOR_ACCEPT)
{
// There is valid capture data in the Pipeline. Call the
// WbioEngineAcceptSampleData function to notify the engine adapter, but
// retain ownership of the buffer in the sensor adapter.
// WbioEngineAcceptSampleData is a wrapper function declared in the
// Winbio_adapter.h header file.
hr = WbioEngineAcceptSampleData(
Pipeline,
(PWINBIO_BIR)sensorContext->CaptureBuffer->CaptureData.Data,
sensorContext->CaptureBuffer->CaptureData.Size,
Purpose,
RejectDetail
);
}
else if (sensorContext->CaptureBuffer != NULL &&
sensorContext->CaptureBufferSize >= sizeof (WINBIO_CAPTURE_DATA) &&
sensorContext->CaptureBuffer->WinBioHresult == WINBIO_E_BAD_CAPTURE)
{
// The most recent capture was not acceptable. Do not attempt to push
// the sample to the engine. Instead, simply return the reject detail
// information generated by the previous capture.
hr = sensorContext->CaptureBuffer->WinBioHresult;
*RejectDetail = sensorContext->CaptureBuffer->RejectDetail;
}
else
{
hr = WINBIO_E_NO_CAPTURE_DATA;
}
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
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk