More work on WinBio lib. Still buggy.

pull/250/head
dahall 2021-07-21 17:16:20 -06:00
parent b57ebd928e
commit 310abdae6f
6 changed files with 459 additions and 71 deletions

View File

@ -3,10 +3,9 @@ PInvoke API (methods, structures and constants) imported from Windows WinBio.dll
- Includes methods from winbio.dll
- Current NuGet release: [![Nuget](https://img.shields.io/nuget/v/Vanara.PInvoke.WinBio?logo=nuget&style=flat-square)![Nuget](https://img.shields.io/nuget/dt/Vanara.PInvoke.WinBio?label=%20&style=flat-square)](https://www.nuget.org/packages/Vanara.PInvoke.WinBio)
### Methods - 71% API coverage (52 of 73 functions)
### Methods - 100% API coverage (52 of 52 functions)
Native Method | Header | Managed Method
--- | --- | ---
[_BioLogonIdentifiedUser](https://www.google.com/search?num=5&q=_BioLogonIdentifiedUser+site%3Adocs.microsoft.com) | |
[WinBioAcquireFocus](https://www.google.com/search?num=5&q=WinBioAcquireFocus+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioAcquireFocus](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioAcquireFocus)
[WinBioAsyncEnumBiometricUnits](https://www.google.com/search?num=5&q=WinBioAsyncEnumBiometricUnits+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioAsyncEnumBiometricUnits](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioAsyncEnumBiometricUnits)
[WinBioAsyncEnumDatabases](https://www.google.com/search?num=5&q=WinBioAsyncEnumDatabases+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioAsyncEnumDatabases](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioAsyncEnumDatabases)
@ -22,14 +21,11 @@ Native Method | Header | Managed Method
[WinBioControlUnit](https://www.google.com/search?num=5&q=WinBioControlUnit+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioControlUnit](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioControlUnit)
[WinBioControlUnitPrivileged](https://www.google.com/search?num=5&q=WinBioControlUnitPrivileged+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioControlUnitPrivileged](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioControlUnitPrivileged)
[WinBioDeleteTemplate](https://www.google.com/search?num=5&q=WinBioDeleteTemplate+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioDeleteTemplate](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioDeleteTemplate)
[WinBioDiscardTicket](https://www.google.com/search?num=5&q=WinBioDiscardTicket+site%3Adocs.microsoft.com) | |
[WinBioEnrollAuthorize](https://www.google.com/search?num=5&q=WinBioEnrollAuthorize+site%3Adocs.microsoft.com) | |
[WinBioEnrollBegin](https://www.google.com/search?num=5&q=WinBioEnrollBegin+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioEnrollBegin](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioEnrollBegin)
[WinBioEnrollCapture](https://www.google.com/search?num=5&q=WinBioEnrollCapture+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioEnrollCapture](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioEnrollCapture)
[WinBioEnrollCaptureWithCallback](https://www.google.com/search?num=5&q=WinBioEnrollCaptureWithCallback+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioEnrollCaptureWithCallback](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioEnrollCaptureWithCallback)
[WinBioEnrollCommit](https://www.google.com/search?num=5&q=WinBioEnrollCommit+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioEnrollCommit](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioEnrollCommit)
[WinBioEnrollDiscard](https://www.google.com/search?num=5&q=WinBioEnrollDiscard+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioEnrollDiscard](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioEnrollDiscard)
[WinBioEnrollRevoke](https://www.google.com/search?num=5&q=WinBioEnrollRevoke+site%3Adocs.microsoft.com) | |
[WinBioEnrollSelect](https://www.google.com/search?num=5&q=WinBioEnrollSelect+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioEnrollSelect](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioEnrollSelect)
[WinBioEnumBiometricUnits](https://www.google.com/search?num=5&q=WinBioEnumBiometricUnits+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioEnumBiometricUnits](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioEnumBiometricUnits)
[WinBioEnumDatabases](https://www.google.com/search?num=5&q=WinBioEnumDatabases+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioEnumDatabases](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioEnumDatabases)
@ -37,46 +33,29 @@ Native Method | Header | Managed Method
[WinBioEnumServiceProviders](https://www.google.com/search?num=5&q=WinBioEnumServiceProviders+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioEnumServiceProviders](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioEnumServiceProviders)
[WinBioFree](https://www.google.com/search?num=5&q=WinBioFree+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioFree](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioFree)
[WinBioGetCredentialState](https://www.google.com/search?num=5&q=WinBioGetCredentialState+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioGetCredentialState](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioGetCredentialState)
[WinBioGetCredentialWithTicket](https://www.google.com/search?num=5&q=WinBioGetCredentialWithTicket+site%3Adocs.microsoft.com) | |
[WinBioGetDomainLogonSetting](https://www.google.com/search?num=5&q=WinBioGetDomainLogonSetting+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioGetDomainLogonSetting](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioGetDomainLogonSetting)
[WinBioGetEnabledSetting](https://www.google.com/search?num=5&q=WinBioGetEnabledSetting+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioGetEnabledSetting](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioGetEnabledSetting)
[WinBioGetEnrolledFactors](https://www.google.com/search?num=5&q=WinBioGetEnrolledFactors+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioGetEnrolledFactors](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioGetEnrolledFactors)
[WinBioGetGestureMetadata](https://www.google.com/search?num=5&q=WinBioGetGestureMetadata+site%3Adocs.microsoft.com) | |
[WinBioGetLogonSetting](https://www.google.com/search?num=5&q=WinBioGetLogonSetting+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioGetLogonSetting](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioGetLogonSetting)
[WinBioGetPolicyProtectionSupport](https://www.google.com/search?num=5&q=WinBioGetPolicyProtectionSupport+site%3Adocs.microsoft.com) | |
[WinBioGetProperty](https://www.google.com/search?num=5&q=WinBioGetProperty+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioGetProperty](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioGetProperty)
[WinBioGetProtectionPolicy](https://www.google.com/search?num=5&q=WinBioGetProtectionPolicy+site%3Adocs.microsoft.com) | |
[WinBioIdentify](https://www.google.com/search?num=5&q=WinBioIdentify+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioIdentify](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioIdentify)
[WinBioIdentifyAndReleaseTicket](https://www.google.com/search?num=5&q=WinBioIdentifyAndReleaseTicket+site%3Adocs.microsoft.com) | |
[WinBioIdentifyWithCallback](https://www.google.com/search?num=5&q=WinBioIdentifyWithCallback+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioIdentifyWithCallback](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioIdentifyWithCallback)
[WinBioLocateSensor](https://www.google.com/search?num=5&q=WinBioLocateSensor+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioLocateSensor](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioLocateSensor)
[WinBioLocateSensorWithCallback](https://www.google.com/search?num=5&q=WinBioLocateSensorWithCallback+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioLocateSensorWithCallback](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioLocateSensorWithCallback)
[WinBioLockUnit](https://www.google.com/search?num=5&q=WinBioLockUnit+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioLockUnit](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioLockUnit)
[WinBioLogonIdentifiedUser](https://www.google.com/search?num=5&q=WinBioLogonIdentifiedUser+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioLogonIdentifiedUser](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioLogonIdentifiedUser)
[WinBioMonitorPresence](https://www.google.com/search?num=5&q=WinBioMonitorPresence+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioMonitorPresence](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioMonitorPresence)
[WinBioNgcAuthorizeEnrollment](https://www.google.com/search?num=5&q=WinBioNgcAuthorizeEnrollment+site%3Adocs.microsoft.com) | |
[WinBioNgcCloseAuthorizationSession](https://www.google.com/search?num=5&q=WinBioNgcCloseAuthorizationSession+site%3Adocs.microsoft.com) | |
[WinBioNgcGetAuthorizationWithTicket](https://www.google.com/search?num=5&q=WinBioNgcGetAuthorizationWithTicket+site%3Adocs.microsoft.com) | |
[WinBioNgcOpenAuthorizationSession](https://www.google.com/search?num=5&q=WinBioNgcOpenAuthorizationSession+site%3Adocs.microsoft.com) | |
[WinBioNotifyPasswordChange](https://www.google.com/search?num=5&q=WinBioNotifyPasswordChange+site%3Adocs.microsoft.com) | |
[WinBioOpenSession](https://www.google.com/search?num=5&q=WinBioOpenSession+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioOpenSession](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioOpenSession)
[WinBioProtectData](https://www.google.com/search?num=5&q=WinBioProtectData+site%3Adocs.microsoft.com) | |
[WinBioProtectDataWithPolicy](https://www.google.com/search?num=5&q=WinBioProtectDataWithPolicy+site%3Adocs.microsoft.com) | |
[WinBioRegisterEventMonitor](https://www.google.com/search?num=5&q=WinBioRegisterEventMonitor+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioRegisterEventMonitor](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioRegisterEventMonitor)
[WinBioRegisterServiceMonitor](https://www.google.com/search?num=5&q=WinBioRegisterServiceMonitor+site%3Adocs.microsoft.com) | |
[WinBioReleaseFocus](https://www.google.com/search?num=5&q=WinBioReleaseFocus+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioReleaseFocus](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioReleaseFocus)
[WinBioRemoveAllCredentials](https://www.google.com/search?num=5&q=WinBioRemoveAllCredentials+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioRemoveAllCredentials](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioRemoveAllCredentials)
[WinBioRemoveAllDomainCredentials](https://www.google.com/search?num=5&q=WinBioRemoveAllDomainCredentials+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioRemoveAllDomainCredentials](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioRemoveAllDomainCredentials)
[WinBioRemoveCredential](https://www.google.com/search?num=5&q=WinBioRemoveCredential+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioRemoveCredential](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioRemoveCredential)
[WinBioSetCredential](https://www.google.com/search?num=5&q=WinBioSetCredential+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioSetCredential](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioSetCredential)
[WinBioSetMSACredential](https://www.google.com/search?num=5&q=WinBioSetMSACredential+site%3Adocs.microsoft.com) | |
[WinBioSetProperty](https://www.google.com/search?num=5&q=WinBioSetProperty+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioSetProperty](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioSetProperty)
[WinBioUnlockUnit](https://www.google.com/search?num=5&q=WinBioUnlockUnit+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioUnlockUnit](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioUnlockUnit)
[WinBioUnprotectData](https://www.google.com/search?num=5&q=WinBioUnprotectData+site%3Adocs.microsoft.com) | |
[WinBioUnregisterEventMonitor](https://www.google.com/search?num=5&q=WinBioUnregisterEventMonitor+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioUnregisterEventMonitor](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioUnregisterEventMonitor)
[WinBioUnregisterServiceMonitor](https://www.google.com/search?num=5&q=WinBioUnregisterServiceMonitor+site%3Adocs.microsoft.com) | |
[WinBioVerify](https://www.google.com/search?num=5&q=WinBioVerify+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioVerify](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioVerify)
[WinBioVerifyAndReleaseTicket](https://www.google.com/search?num=5&q=WinBioVerifyAndReleaseTicket+site%3Adocs.microsoft.com) | |
[WinBioVerifyWithCallback](https://www.google.com/search?num=5&q=WinBioVerifyWithCallback+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioVerifyWithCallback](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioVerifyWithCallback)
[WinBioWait](https://www.google.com/search?num=5&q=WinBioWait+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WinBioWait](https://github.com/dahall/Vanara/search?l=C%23&q=WinBioWait)
### Structures
@ -156,11 +135,13 @@ Native Structure | Header | Managed Structure
[WINBIO_EXTENDED_SENSOR_INFO](https://www.google.com/search?num=5&q=WINBIO_EXTENDED_SENSOR_INFO+site%3Adocs.microsoft.com) | | [Vanara.PInvoke.WinBio.WINBIO_EXTENDED_SENSOR_INFO](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_EXTENDED_SENSOR_INFO)
[WINBIO_EXTENDED_STORAGE_INFO](https://www.google.com/search?num=5&q=WINBIO_EXTENDED_STORAGE_INFO+site%3Adocs.microsoft.com) | | [Vanara.PInvoke.WinBio.WINBIO_EXTENDED_STORAGE_INFO](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_EXTENDED_STORAGE_INFO)
[WINBIO_EXTENDED_UNIT_STATUS](https://www.google.com/search?num=5&q=WINBIO_EXTENDED_UNIT_STATUS+site%3Adocs.microsoft.com) | winbio_types.h | [Vanara.PInvoke.WinBio.WINBIO_EXTENDED_UNIT_STATUS](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_EXTENDED_UNIT_STATUS)
[WINBIO_FRAMEWORK_HANDLE](https://www.google.com/search?num=5&q=WINBIO_FRAMEWORK_HANDLE+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WINBIO_FRAMEWORK_HANDLE](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_FRAMEWORK_HANDLE)
[WINBIO_IDENTITY](https://www.google.com/search?num=5&q=WINBIO_IDENTITY+site%3Adocs.microsoft.com) | winbio_types.h | [Vanara.PInvoke.WinBio.WINBIO_IDENTITY](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_IDENTITY)
[WINBIO_PRESENCE](https://www.google.com/search?num=5&q=WINBIO_PRESENCE+site%3Adocs.microsoft.com) | winbio_types.h | [Vanara.PInvoke.WinBio.WINBIO_PRESENCE](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_PRESENCE)
[WINBIO_PRESENCE_PROPERTIES](https://www.google.com/search?num=5&q=WINBIO_PRESENCE_PROPERTIES+site%3Adocs.microsoft.com) | winbio_types.h | [Vanara.PInvoke.WinBio.WINBIO_PRESENCE_PROPERTIES](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_PRESENCE_PROPERTIES)
[WINBIO_PROTECTION_POLICY](https://www.google.com/search?num=5&q=WINBIO_PROTECTION_POLICY+site%3Adocs.microsoft.com) | winbio_types.h | [Vanara.PInvoke.WinBio.WINBIO_PROTECTION_POLICY](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_PROTECTION_POLICY)
[WINBIO_REGISTERED_FORMAT](https://www.google.com/search?num=5&q=WINBIO_REGISTERED_FORMAT+site%3Adocs.microsoft.com) | winbio_types.h | [Vanara.PInvoke.WinBio.WINBIO_REGISTERED_FORMAT](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_REGISTERED_FORMAT)
[WINBIO_SESSION_HANDLE](https://www.google.com/search?num=5&q=WINBIO_SESSION_HANDLE+site%3Adocs.microsoft.com) | winbio.h | [Vanara.PInvoke.WinBio.WINBIO_SESSION_HANDLE](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_SESSION_HANDLE)
[WINBIO_STORAGE_SCHEMA](https://www.google.com/search?num=5&q=WINBIO_STORAGE_SCHEMA+site%3Adocs.microsoft.com) | winbio_types.h | [Vanara.PInvoke.WinBio.WINBIO_STORAGE_SCHEMA](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_STORAGE_SCHEMA)
[WINBIO_UNIT_SCHEMA](https://www.google.com/search?num=5&q=WINBIO_UNIT_SCHEMA+site%3Adocs.microsoft.com) | winbio_types.h | [Vanara.PInvoke.WinBio.WINBIO_UNIT_SCHEMA](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_UNIT_SCHEMA)
[WINBIO_VERSION](https://www.google.com/search?num=5&q=WINBIO_VERSION+site%3Adocs.microsoft.com) | winbio_types.h | [Vanara.PInvoke.WinBio.WINBIO_VERSION](https://github.com/dahall/Vanara/search?l=C%23&q=WINBIO_VERSION)

View File

@ -14,10 +14,10 @@
<PackageReleaseNotes>Currently implements:
Functions
WinBioAcquireFocus WinBioAsyncEnumBiometricUnits WinBioAsyncEnumDatabases WinBioAsyncEnumServiceProviders WinBioAsyncMonitorFrameworkChanges WinBioAsyncOpenFramework WinBioAsyncOpenSession WinBioCancel WinBioCaptureSample WinBioCaptureSampleWithCallback WinBioCloseFramework WinBioCloseSession WinBioControlUnit WinBioControlUnitPrivileged WinBioDeleteTemplate WinBioDiscardTicket WinBioEnrollAuthorize WinBioEnrollBegin WinBioEnrollCapture WinBioEnrollCaptureWithCallback WinBioEnrollCommit WinBioEnrollDiscard WinBioEnrollRevoke WinBioEnrollSelect WinBioEnumBiometricUnits WinBioEnumDatabases WinBioEnumEnrollments WinBioEnumServiceProviders WinBioFree WinBioGetCredentialState WinBioGetCredentialWithTicket WinBioGetDomainLogonSetting WinBioGetEnabledSetting WinBioGetEnrolledFactors WinBioGetGestureMetadata WinBioGetLogonSetting WinBioGetPolicyProtectionSupport WinBioGetProperty WinBioGetProtectionPolicy WinBioIdentify WinBioIdentifyAndReleaseTicket WinBioIdentifyWithCallback WinBioLocateSensor WinBioLocateSensorWithCallback WinBioLockUnit WinBioLogonIdentifiedUser WinBioMonitorPresence WinBioNgcAuthorizeEnrollment WinBioNgcCloseAuthorizationSession WinBioNgcGetAuthorizationWithTicket WinBioNgcOpenAuthorizationSession WinBioNotifyPasswordChange WinBioOpenSession WinBioProtectData WinBioProtectDataWithPolicy WinBioRegisterEventMonitor WinBioRegisterServiceMonitor WinBioReleaseFocus WinBioRemoveAllCredentials WinBioRemoveAllDomainCredentials WinBioRemoveCredential WinBioSetCredential WinBioSetMSACredential WinBioSetProperty WinBioUnlockUnit WinBioUnprotectData WinBioUnregisterEventMonitor WinBioUnregisterServiceMonitor WinBioVerify WinBioVerifyAndReleaseTicket WinBioVerifyWithCallback WinBioWait _BioLogonIdentifiedUser
WinBioAcquireFocus WinBioAsyncEnumBiometricUnits WinBioAsyncEnumDatabases WinBioAsyncEnumServiceProviders WinBioAsyncMonitorFrameworkChanges WinBioAsyncOpenFramework WinBioAsyncOpenSession WinBioCancel WinBioCaptureSample WinBioCaptureSampleWithCallback WinBioCloseFramework WinBioCloseSession WinBioControlUnit WinBioControlUnitPrivileged WinBioDeleteTemplate WinBioEnrollBegin WinBioEnrollCapture WinBioEnrollCaptureWithCallback WinBioEnrollCommit WinBioEnrollDiscard WinBioEnrollSelect WinBioEnumBiometricUnits WinBioEnumDatabases WinBioEnumEnrollments WinBioEnumServiceProviders WinBioFree WinBioGetCredentialState WinBioGetDomainLogonSetting WinBioGetEnabledSetting WinBioGetEnrolledFactors WinBioGetLogonSetting WinBioGetProperty WinBioIdentify WinBioIdentifyWithCallback WinBioLocateSensor WinBioLocateSensorWithCallback WinBioLockUnit WinBioLogonIdentifiedUser WinBioMonitorPresence WinBioOpenSession WinBioRegisterEventMonitor WinBioReleaseFocus WinBioRemoveAllCredentials WinBioRemoveAllDomainCredentials WinBioRemoveCredential WinBioSetCredential WinBioSetProperty WinBioUnlockUnit WinBioUnregisterEventMonitor WinBioVerify WinBioVerifyWithCallback WinBioWait
Structures
ACCOUNTSID AUTHORIZATION CAPTURESAMPLE CONTROLUNIT DELETETEMPLATE ENROLLBEGIN ENROLLCAPTURE ENROLLCOMMIT ENROLLMENTREQUIREMENTS ENROLLMENTREQUIREMENTS ENROLLMENTREQUIREMENTS ENROLLMENTREQUIREMENTS ENROLLSELECT ENUMBIOMETRICUNITS ENUMDATABASES ENUMENROLLMENTS ENUMSERVICEPROVIDERS ERROR FACIALFEATURES FACIALFEATURES FACIALFEATURES FACIALFEATURES FACIALFEATURES FINGERPRINT FINGERPRINT FINGERPRINT FINGERPRINT GETEVENT GETPROPERTY GETPROTECTIONPOLICY HARDWAREINFO IDENTIFY IDENTIFYANDRELEASETICKET IRIS IRIS IRIS IRIS IRIS MONITORPRESENCE NOTIFYUNITSTATUSCHANGE OPAQUEENGINEDATA OPAQUEENGINEDATA PARAMETERS PARAMETERS POINT3D SETPROPERTY SPECIFIC SPECIFIC SPECIFIC SPECIFIC UNCLAIMED UNCLAIMEDIDENTIFY VALIDITYPERIOD VALUE VERIFY VERIFYANDRELEASETICKET VOICE VOICE VOICE VOICE WINBIO_ANTI_SPOOF_POLICY WINBIO_ASYNC_RESULT WINBIO_BDB_ANSI_381_HEADER WINBIO_BDB_ANSI_381_RECORD WINBIO_BIR WINBIO_BIR_DATA WINBIO_BIR_HEADER WINBIO_BSP_SCHEMA WINBIO_EVENT WINBIO_EXTENDED_ENGINE_INFO WINBIO_EXTENDED_ENROLLMENT_STATUS WINBIO_EXTENDED_SENSOR_INFO WINBIO_EXTENDED_STORAGE_INFO WINBIO_EXTENDED_UNIT_STATUS WINBIO_IDENTITY WINBIO_PRESENCE WINBIO_PRESENCE_PROPERTIES WINBIO_PROTECTION_POLICY WINBIO_REGISTERED_FORMAT WINBIO_STORAGE_SCHEMA WINBIO_UNIT_SCHEMA WINBIO_VERSION
ACCOUNTSID AUTHORIZATION CAPTURESAMPLE CONTROLUNIT DELETETEMPLATE ENROLLBEGIN ENROLLCAPTURE ENROLLCOMMIT ENROLLMENTREQUIREMENTS ENROLLMENTREQUIREMENTS ENROLLMENTREQUIREMENTS ENROLLMENTREQUIREMENTS ENROLLSELECT ENUMBIOMETRICUNITS ENUMDATABASES ENUMENROLLMENTS ENUMSERVICEPROVIDERS ERROR FACIALFEATURES FACIALFEATURES FACIALFEATURES FACIALFEATURES FACIALFEATURES FINGERPRINT FINGERPRINT FINGERPRINT FINGERPRINT GETEVENT GETPROPERTY GETPROTECTIONPOLICY HARDWAREINFO IDENTIFY IDENTIFYANDRELEASETICKET IRIS IRIS IRIS IRIS IRIS MONITORPRESENCE NOTIFYUNITSTATUSCHANGE OPAQUEENGINEDATA OPAQUEENGINEDATA PARAMETERS PARAMETERS POINT3D SETPROPERTY SPECIFIC SPECIFIC SPECIFIC SPECIFIC UNCLAIMED UNCLAIMEDIDENTIFY VALIDITYPERIOD VALUE VERIFY VERIFYANDRELEASETICKET VOICE VOICE VOICE VOICE WINBIO_ANTI_SPOOF_POLICY WINBIO_ASYNC_RESULT WINBIO_BDB_ANSI_381_HEADER WINBIO_BDB_ANSI_381_RECORD WINBIO_BIR WINBIO_BIR_DATA WINBIO_BIR_HEADER WINBIO_BSP_SCHEMA WINBIO_EVENT WINBIO_EXTENDED_ENGINE_INFO WINBIO_EXTENDED_ENROLLMENT_STATUS WINBIO_EXTENDED_SENSOR_INFO WINBIO_EXTENDED_STORAGE_INFO WINBIO_EXTENDED_UNIT_STATUS WINBIO_FRAMEWORK_HANDLE WINBIO_IDENTITY WINBIO_PRESENCE WINBIO_PRESENCE_PROPERTIES WINBIO_PROTECTION_POLICY WINBIO_REGISTERED_FORMAT WINBIO_SESSION_HANDLE WINBIO_STORAGE_SCHEMA WINBIO_UNIT_SCHEMA WINBIO_VERSION
</PackageReleaseNotes>
</PropertyGroup>

View File

@ -1,10 +1,9 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using Vanara.Extensions;
using Vanara.InteropServices;
using WINBIO_FRAMEWORK_HANDLE = System.UInt32;
using WINBIO_SESSION_HANDLE = System.UInt32;
using WINBIO_UNIT_ID = System.UInt32;
namespace Vanara.PInvoke
@ -50,9 +49,9 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/winbio/nc-winbio-pwinbio_async_completion_callback
// PWINBIO_ASYNC_COMPLETION_CALLBACK PwinbioAsyncCompletionCallback; void PwinbioAsyncCompletionCallback( PWINBIO_ASYNC_RESULT
// AsyncResult ) {...}
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
[PInvokeData("winbio.h", MSDNShortId = "NC:winbio.PWINBIO_ASYNC_COMPLETION_CALLBACK")]
public delegate void PWINBIO_ASYNC_COMPLETION_CALLBACK(in WINBIO_ASYNC_RESULT AsyncResult);
public delegate void PWINBIO_ASYNC_COMPLETION_CALLBACK(/*in WINBIO_ASYNC_RESULT*/ [In] IntPtr AsyncResult);
/// <summary>
/// <para>
@ -462,8 +461,6 @@ namespace Vanara.PInvoke
WINBIO_ASYNC_NOTIFY_CALLBACK, // Caller receives a new-style callback
/// <summary>The framework sends completion notices to the client application window message queue.</summary>
WINBIO_ASYNC_NOTIFY_MESSAGE, // Caller receives a window message
/// <summary>The maximum enumeration value. This constant is not directly used by the WinBioAsyncOpenFramework and WinBioAsyncOpenSession.</summary>
WINBIO_ASYNC_NOTIFY_MAXIMUM_VALUE
}
/// <summary>Acquires window focus.</summary>
@ -1004,10 +1001,10 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/win32/api/winbio/nf-winbio-winbioasyncopenframework HRESULT WinBioAsyncOpenFramework(
// WINBIO_ASYNC_NOTIFICATION_METHOD NotificationMethod, HWND TargetWindow, UINT MessageCode, PWINBIO_ASYNC_COMPLETION_CALLBACK
// CallbackRoutine, PVOID UserData, BOOL AsynchronousOpen, WINBIO_FRAMEWORK_HANDLE *FrameworkHandle );
[DllImport(Lib_Winbio, SetLastError = false, ExactSpelling = true)]
[DllImport(Lib_Winbio, SetLastError = false, ExactSpelling = true, CallingConvention = CallingConvention.Winapi)]
[PInvokeData("winbio.h", MSDNShortId = "NF:winbio.WinBioAsyncOpenFramework")]
public static extern HRESULT WinBioAsyncOpenFramework(WINBIO_ASYNC_NOTIFICATION_METHOD NotificationMethod, [In, Optional] HWND TargetWindow, [In, Optional] uint MessageCode,
[In, Optional] PWINBIO_ASYNC_COMPLETION_CALLBACK CallbackRoutine, [In, Optional] IntPtr UserData,
/*[In, Optional, MarshalAs(UnmanagedType.FunctionPtr)] PWINBIO_ASYNC_COMPLETION_CALLBACK*/ [In, Optional] IntPtr CallbackRoutine, [In, Optional] IntPtr UserData,
[MarshalAs(UnmanagedType.Bool)] bool AsynchronousOpen, out WINBIO_FRAMEWORK_HANDLE FrameworkHandle);
/// <summary>
@ -1353,7 +1350,7 @@ namespace Vanara.PInvoke
[DllImport(Lib_Winbio, SetLastError = false, ExactSpelling = true)]
[PInvokeData("winbio.h", MSDNShortId = "NF:winbio.WinBioAsyncOpenSession")]
public static extern HRESULT WinBioAsyncOpenSession(WINBIO_BIOMETRIC_TYPE Factor, WINBIO_POOL_TYPE PoolType, WINBIO_SESSION_FLAGS Flags,
[In, MarshalAs(UnmanagedType.LPArray)] uint[] UnitArray, [Optional] SizeT UnitCount, in Guid DatabaseId,
[In, Optional, MarshalAs(UnmanagedType.LPArray)] uint[] UnitArray, [Optional] SizeT UnitCount, in Guid DatabaseId,
WINBIO_ASYNC_NOTIFICATION_METHOD NotificationMethod, [In, Optional] HWND TargetWindow,
[In, Optional] uint MessageCode, [In, Optional] PWINBIO_ASYNC_COMPLETION_CALLBACK CallbackRoutine,
[In, Optional] IntPtr UserData, [MarshalAs(UnmanagedType.Bool)] bool AsynchronousOpen,
@ -1702,7 +1699,7 @@ namespace Vanara.PInvoke
[DllImport(Lib_Winbio, SetLastError = false, ExactSpelling = true)]
[PInvokeData("winbio.h", MSDNShortId = "NF:winbio.WinBioAsyncOpenSession")]
public static extern HRESULT WinBioAsyncOpenSession(WINBIO_BIOMETRIC_TYPE Factor, WINBIO_POOL_TYPE PoolType, WINBIO_SESSION_FLAGS Flags,
[In, MarshalAs(UnmanagedType.LPArray)] uint[] UnitArray, [Optional] SizeT UnitCount, [In, Optional] InteropServices.GuidPtr DatabaseId,
[In, Optional, MarshalAs(UnmanagedType.LPArray)] uint[] UnitArray, [Optional] SizeT UnitCount, [In, Optional] GuidPtr DatabaseId,
WINBIO_ASYNC_NOTIFICATION_METHOD NotificationMethod, [In, Optional] HWND TargetWindow,
[In, Optional] uint MessageCode, [In, Optional] PWINBIO_ASYNC_COMPLETION_CALLBACK CallbackRoutine,
[In, Optional] IntPtr UserData, [MarshalAs(UnmanagedType.Bool)] bool AsynchronousOpen,
@ -4358,12 +4355,15 @@ namespace Vanara.PInvoke
/// Gets information about the biometric enrollments that the specified user has on the computer. Biometric enrollments include
/// enrollments for facial recognition, fingerprint scanning, iris scanning, and so on.
/// </summary>
/// <param name="AccountOwner">A WINBIO_IDENTITY structure for the user whose biometric enrollments you want to get. For example:</param>
/// <param name="WINBIO_IDENTITY identity = {};&#xA;identity.Type = WINBIO_ID_TYPE_SID;&#xA;&#xA;// Move an account SID into identity.Value.AccountSid.Data.&#xA;// For example, CopySid(...)">
/// To see the enrollments for every user on the computer, specify the <c>WINBIO_ID_TYPE_WILDCARD</c> identity type for the
/// WINBIO_IDENTITY structure that you specify for the AccountOwner parameter. For example:
/// </param>
/// <param name="WINBIO_IDENTITY identity = {};&#xA;identity.Type = WINBIO_ID_TYPE_WILDCARD;&#xA;"/>
/// <param name="AccountOwner"><para>A WINBIO_IDENTITY structure for the user whose biometric enrollments you want to get. For example:</para>
/// <para><code>WINBIO_IDENTITY identity = {};
/// identity.Type = WINBIO_ID_TYPE_SID;
/// // Move an account SID into identity.Value.AccountSid.Data.
/// // For example, CopySid(...)</code></para>
/// <para>To see the enrollments for every user on the computer, specify the <c>WINBIO_ID_TYPE_WILDCARD</c> identity type for the
/// WINBIO_IDENTITY structure that you specify for the AccountOwner parameter. For example:</para>
/// <para><code>WINBIO_IDENTITY identity = {};
/// identity.Type = WINBIO_ID_TYPE_WILDCARD;</code></para></param>
/// <param name="EnrolledFactors">
/// <para>
/// A set of WINBIO_BIOMETRIC_TYPE flags that indicate the biometric enrollments that the specified user has on the computer. A
@ -4414,7 +4414,12 @@ namespace Vanara.PInvoke
/// </para>
/// <para>Examples</para>
/// <para>
/// <code>WINBIO_BIOMETRIC_TYPE enrolledFactors = WINBIO_NO_TYPE_AVAILABLE; WINBIO_IDENTITY identity = {}; identity.Type = WINBIO_ID_TYPE_SID; // Move an account SID into identity.Value.AccountSid.Data. // e.g., CopySid(...) HRESULT hr = WinBioGetEnrolledFactors(&amp;identity, &amp;enrolledFactors);</code>
/// <code>WINBIO_BIOMETRIC_TYPE enrolledFactors = WINBIO_NO_TYPE_AVAILABLE;
/// WINBIO_IDENTITY identity = {};
/// identity.Type = WINBIO_ID_TYPE_SID;
/// // Move an account SID into identity.Value.AccountSid.Data.
/// // e.g., CopySid(...)
/// HRESULT hr = WinBioGetEnrolledFactors(&amp;identity, &amp;enrolledFactors);</code>
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/winbio/nf-winbio-winbiogetenrolledfactors HRESULT WinBioGetEnrolledFactors(
@ -7292,7 +7297,10 @@ namespace Vanara.PInvoke
public SizeT SubFactorCount;
/// <summary>Pointer to an array of sub-factors. For more information, see Remarks.</summary>
public IntPtr SubFactorArray;
public IntPtr _SubFactorArray;
/// <summary>Pointer to an array of sub-factors. For more information, see Remarks.</summary>
public WINBIO_BIOMETRIC_SUBTYPE[] SubFactorArray => _SubFactorArray.ToArray<WINBIO_BIOMETRIC_SUBTYPE>(SubFactorCount);
}
/// <summary>Contains the results of an asynchronous call to WinBioCaptureSample.</summary>
@ -7470,7 +7478,12 @@ namespace Vanara.PInvoke
/// <summary>
/// Pointer to an array of WINBIO_BSP_SCHEMA structures that contain information about each of the available service providers.
/// </summary>
public IntPtr BspSchemaArray;
public IntPtr _BspSchemaArray;
/// <summary>
/// An array of WINBIO_BSP_SCHEMA structures that contain information about each of the available service providers.
/// </summary>
public WINBIO_BSP_SCHEMA[] BspSchemaArray => _BspSchemaArray.ToArray<WINBIO_BSP_SCHEMA>(BspCount);
}
/// <summary>Contains the results of an asynchronous call to WinBioEnumBiometricUnits or WinBioAsyncEnumBiometricUnits.</summary>
@ -7485,7 +7498,10 @@ namespace Vanara.PInvoke
public SizeT UnitCount;
/// <summary>An array of WINBIO_UNIT_SCHEMA structures that contain information about each enumerated biometric unit.</summary>
public IntPtr UnitSchemaArray;
public IntPtr _UnitSchemaArray;
/// <summary>An array of WINBIO_UNIT_SCHEMA structures that contain information about each enumerated biometric unit.</summary>
public WINBIO_UNIT_SCHEMA[] UnitSchemaArray => _UnitSchemaArray.ToArray<WINBIO_UNIT_SCHEMA>(UnitCount);
}
/// <summary>Contains the results of an asynchronous call to WinBioEnumDatabases or WinBioAsyncEnumDatabases.</summary>
@ -7500,7 +7516,10 @@ namespace Vanara.PInvoke
public SizeT StorageCount;
/// <summary>Array of WINBIO_STORAGE_SCHEMA structures that contain information about each database.</summary>
public IntPtr StorageSchemaArray;
public IntPtr _StorageSchemaArray;
/// <summary>Array of WINBIO_STORAGE_SCHEMA structures that contain information about each database.</summary>
public WINBIO_STORAGE_SCHEMA[] StorageSchemaArray => _StorageSchemaArray.ToArray<WINBIO_STORAGE_SCHEMA>(StorageCount);
}
/// <summary>Reserved. This member is supported starting in Windows 10.</summary>
@ -7578,7 +7597,10 @@ namespace Vanara.PInvoke
public SizeT PresenceCount;
/// <summary>Address of the array of WINBIO_PRESENCE structures, one for each individual monitored.</summary>
public IntPtr PresenceArray;
public IntPtr _PresenceArray;
/// <summary>Address of the array of WINBIO_PRESENCE structures, one for each individual monitored.</summary>
public WINBIO_PRESENCE[] PresenceArray => _PresenceArray.ToArray<WINBIO_PRESENCE>(PresenceCount);
}
/// <summary/>
@ -7609,8 +7631,37 @@ namespace Vanara.PInvoke
}
}
}
/// <summary>An unsigned long integer that contains the handle for an open framework session.</summary>
[PInvokeData("winbio.h")]
[DebuggerDisplay("{value}")]
[StructLayout(LayoutKind.Sequential, Size = 4)]
public struct WINBIO_FRAMEWORK_HANDLE
{
private readonly uint value;
/// <summary>Performs an implicit conversion from <see cref="WINBIO_FRAMEWORK_HANDLE"/> to <see cref="System.UInt32"/>.</summary>
/// <param name="handle">The handle.</param>
/// <returns>The resulting <see cref="System.UInt32"/> instance from the conversion.</returns>
public static implicit operator uint(WINBIO_FRAMEWORK_HANDLE handle) => handle.value;
}
/// <summary>An unsigned long integer that contains the handle for an open biometric session.</summary>
[PInvokeData("winbio.h")]
[DebuggerDisplay("{value}")]
[StructLayout(LayoutKind.Sequential, Size = 4)]
public struct WINBIO_SESSION_HANDLE
{
private readonly uint value;
/// <summary>Performs an implicit conversion from <see cref="WINBIO_SESSION_HANDLE"/> to <see cref="System.UInt32"/>.</summary>
/// <param name="handle">The handle.</param>
/// <returns>The resulting <see cref="System.UInt32"/> instance from the conversion.</returns>
public static implicit operator uint(WINBIO_SESSION_HANDLE handle) => handle.value;
}
/// <summary>A safe handle for memory allocated by WinBio methods and freed using <see cref="WinBioFree"/>.</summary>
/// <seealso cref="Vanara.PInvoke.SafeHANDLE"/>
/// <seealso cref="SafeHANDLE"/>
public class SafeWinBioMemory : SafeHANDLE
{
private SafeWinBioMemory() : base(IntPtr.Zero, true) { }
@ -7639,7 +7690,7 @@ namespace Vanara.PInvoke
/// <summary>A structure handler based on unmanaged memory allocated by AllocCoTaskMem.</summary>
/// <typeparam name="TStruct">The type of the structure.</typeparam>
/// <seealso cref="Vanara.InteropServices.SafeMemStruct{TStruct, TMem}"/>
/// <seealso cref="SafeMemStruct{TStruct, TMem}"/>
public class SafeWinBioStruct<TStruct> : SafeMemStruct<TStruct, WinBioMemoryMethods> where TStruct : struct
{
/// <summary>Represents the <see langword="null"/> equivalent of this class instances.</summary>
@ -7660,20 +7711,20 @@ namespace Vanara.PInvoke
/// <param name="allocatedBytes">The number of bytes allocated to <paramref name="ptr"/>.</param>
[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
public SafeWinBioStruct(IntPtr ptr, bool ownsHandle = true, SizeT allocatedBytes = default) : base(ptr, ownsHandle, allocatedBytes) { }
/// <summary>Performs an implicit conversion from <see cref="System.Nullable{TStruct}"/> to <see cref="SafeCoTaskMemStruct{TStruct}"/>.</summary>
/// <summary>Performs an implicit conversion from <see cref="Nullable{TStruct}"/> to <see cref="SafeCoTaskMemStruct{TStruct}"/>.</summary>
/// <param name="s">The value of the <typeparamref name="TStruct"/> instance or <see langword="null"/>.</param>
/// <returns>The resulting <see cref="SafeWinBioStruct{TStruct}"/> instance from the conversion.</returns>
public static implicit operator SafeWinBioStruct<TStruct>(TStruct? s) => s.HasValue ? new SafeWinBioStruct<TStruct>(s.Value) : new SafeWinBioStruct<TStruct>(IntPtr.Zero);
}
/// <summary>Internal use only.</summary>
/// <seealso cref="Vanara.InteropServices.MemoryMethodsBase"/>
/// <seealso cref="MemoryMethodsBase"/>
public sealed class WinBioMemoryMethods : MemoryMethodsBase
{
/// <summary>Gets a handle to a memory allocation of the specified size.</summary>
/// <param name="size">The size, in bytes, of memory to allocate.</param>
/// <returns>A memory handle.</returns>
/// <exception cref="System.NotImplementedException"></exception>
/// <exception cref="NotImplementedException"></exception>
public override IntPtr AllocMem(int size) => throw new NotImplementedException();
/// <summary>Frees the memory associated with a handle.</summary>
/// <param name="hMem">A memory handle.</param>

View File

@ -3549,6 +3549,9 @@ namespace Vanara.PInvoke
/// <summary>A <c>DWORD</c> that contains the minor version number.</summary>
public uint MinorVersion;
/// <inheritdoc/>
public override string ToString() => $"{MajorVersion}.{MinorVersion}";
}
}
}

View File

@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>UnitTest.PInvoke.WinBio</AssemblyName>
<!--<OutputType>Exe</OutputType>-->
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\PInvoke\User32\Vanara.PInvoke.User32.csproj" />
<ProjectReference Include="..\..\..\PInvoke\WinBio\Vanara.PInvoke.WinBio.csproj" />
</ItemGroup>
</Project>

View File

@ -4,42 +4,328 @@ using System;
using System.Drawing;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
using Vanara.Extensions;
using Vanara.InteropServices;
using static Vanara.PInvoke.WinBio;
using TestContext = System.Console;
namespace Vanara.PInvoke.Tests
{
[TestFixture]
[Apartment(System.Threading.ApartmentState.MTA)]
public class WinBioTests
{
const uint compMsg = 0x8EEF;
//[MTAThread]
//public static void Main()
//{
// bool setup = false;
// WinBioTests test = new();
// try
// {
// test._Setup();
// test.WinBioAsyncEnumBiometricUnitsCallbackTest();
// setup = true;
// }
// catch (Exception ex)
// {
// TestContext.WriteLine(ex.ToString());
// }
// finally
// {
// if (setup)
// test._TearDown();
// }
//}
WINBIO_SESSION_HANDLE sessionHandle;
[OneTimeSetUp]
public void _Setup()
{
WinBioOpenSession(WINBIO_BIOMETRIC_TYPE.WINBIO_TYPE_FINGERPRINT, // Service provider
WINBIO_POOL_TYPE.WINBIO_POOL_SYSTEM, // Pool type
WINBIO_SESSION_FLAGS.WINBIO_FLAG_RAW | WINBIO_SESSION_FLAGS.WINBIO_FLAG_DEFAULT, // Access: Capture raw data
default, // Array of biometric unit IDs
0, // Count of biometric unit IDs
default, // Default database
out sessionHandle).ThrowIfFailed(); // [out] Session handle
}
[OneTimeTearDown]
public void _TearDown()
{
WinBioCloseSession(sessionHandle);
}
[Test]
public void StructTest() => TestHelper.GetNestedStructSizes(typeof(Vanara.PInvoke.WinBio)).WriteValues();
//[Test]
public void WinBioAsyncEnumBiometricUnitsCallbackTest()
{
ManualResetEvent evt = new(false);
var cbPtr = new PWINBIO_ASYNC_COMPLETION_CALLBACK(Callback);
Assert.That(WinBioAsyncOpenFramework(WINBIO_ASYNC_NOTIFICATION_METHOD.WINBIO_ASYNC_NOTIFY_CALLBACK, default, default,
Marshal.GetFunctionPointerForDelegate(cbPtr), default, false, out var hFramework), ResultIs.Successful);
try
{
Assert.That(WinBioAsyncEnumBiometricUnits(hFramework, WINBIO_BIOMETRIC_TYPE.WINBIO_TYPE_FINGERPRINT), ResultIs.Successful);
evt.WaitOne(5000);
}
finally
{
WinBioCloseFramework(hFramework);
}
void Callback(IntPtr pRes)
{
try
{
WINBIO_ASYNC_RESULT war = pRes.ToStructure<WINBIO_ASYNC_RESULT>();
if (war.Operation == WINBIO_OPERATION_TYPE.WINBIO_OPERATION_ENUM_BIOMETRIC_UNITS)
{
foreach (var s in war.Parameters.EnumBiometricUnits.UnitSchemaArray)
TestContext.WriteLine($"{s.UnitId} : {s.Model} : {s.Description}");
evt.Set();
}
if (war.Operation == WINBIO_OPERATION_TYPE.WINBIO_OPERATION_CLOSE_FRAMEWORK)
WinBioFree(pRes);
}
catch { }
}
}
[Test]
public void WinBioAsyncEnumBiometricUnitsTest()
{
ManualResetEvent evt = new(false);
using var wnd = new MsgWnd(Callback);
Assert.That(WinBioAsyncOpenFramework(WINBIO_ASYNC_NOTIFICATION_METHOD.WINBIO_ASYNC_NOTIFY_MESSAGE, wnd.MessageWindowHandle, compMsg, default, default, false, out var hFramework), ResultIs.Successful);
try
{
Assert.That(WinBioAsyncEnumBiometricUnits(hFramework, WINBIO_BIOMETRIC_TYPE.WINBIO_TYPE_FINGERPRINT), ResultIs.Successful);
Assert.IsTrue(evt.WaitOne(5000));
}
finally
{
WinBioCloseFramework(hFramework);
}
IntPtr Callback(HWND hwnd, uint msg, IntPtr wParam, IntPtr lParam)
{
try
{
WINBIO_ASYNC_RESULT war = lParam.ToStructure<WINBIO_ASYNC_RESULT>();
switch (war.Operation)
{
case WINBIO_OPERATION_TYPE.WINBIO_OPERATION_ENUM_BIOMETRIC_UNITS:
foreach (var s in war.Parameters.EnumBiometricUnits.UnitSchemaArray)
TestContext.WriteLine($"{s.UnitId} : {s.Model} : {s.Description}");
evt.Set();
break;
case WINBIO_OPERATION_TYPE.WINBIO_OPERATION_CLOSE_FRAMEWORK:
WinBioFree(lParam);
break;
}
}
catch { }
return default;
}
}
[Test]
public void WinBioAsyncEnumDatabasesTest()
{
ManualResetEvent evt = new(false);
using var wnd = new MsgWnd(Callback);
Assert.That(WinBioAsyncOpenFramework(WINBIO_ASYNC_NOTIFICATION_METHOD.WINBIO_ASYNC_NOTIFY_MESSAGE, wnd.MessageWindowHandle, compMsg, default, default, false, out var hFramework), ResultIs.Successful);
try
{
Assert.That(WinBioAsyncEnumDatabases(hFramework, WINBIO_BIOMETRIC_TYPE.WINBIO_TYPE_FINGERPRINT), ResultIs.Successful);
Assert.IsTrue(evt.WaitOne(5000));
}
finally
{
WinBioCloseFramework(hFramework);
}
IntPtr Callback(HWND hwnd, uint msg, IntPtr wParam, IntPtr lParam)
{
try
{
WINBIO_ASYNC_RESULT war = lParam.ToStructure<WINBIO_ASYNC_RESULT>();
switch (war.Operation)
{
case WINBIO_OPERATION_TYPE.WINBIO_OPERATION_ENUM_DATABASES:
foreach (var s in war.Parameters.EnumDatabases.StorageSchemaArray)
TestContext.WriteLine($"{s.FilePath} : {s.Attributes}");
evt.Set();
break;
case WINBIO_OPERATION_TYPE.WINBIO_OPERATION_CLOSE_FRAMEWORK:
WinBioFree(lParam);
break;
}
}
catch { }
return default;
}
}
[Test]
public void WinBioAsyncEnumServiceProvidersTest()
{
ManualResetEvent evt = new(false);
using var wnd = new MsgWnd(Callback);
Assert.That(WinBioAsyncOpenFramework(WINBIO_ASYNC_NOTIFICATION_METHOD.WINBIO_ASYNC_NOTIFY_MESSAGE, wnd.MessageWindowHandle, compMsg, default, default, false, out var hFramework), ResultIs.Successful);
try
{
Assert.That(WinBioAsyncEnumServiceProviders(hFramework, WINBIO_BIOMETRIC_TYPE.WINBIO_TYPE_FINGERPRINT), ResultIs.Successful);
Assert.IsTrue(evt.WaitOne(5000));
}
finally
{
WinBioCloseFramework(hFramework);
}
IntPtr Callback(HWND hwnd, uint msg, IntPtr wParam, IntPtr lParam)
{
try
{
WINBIO_ASYNC_RESULT war = lParam.ToStructure<WINBIO_ASYNC_RESULT>();
switch (war.Operation)
{
case WINBIO_OPERATION_TYPE.WINBIO_OPERATION_ENUM_SERVICE_PROVIDERS:
foreach (var s in war.Parameters.EnumServiceProviders.BspSchemaArray)
TestContext.WriteLine($"{s.Vendor} : {s.Version} : {s.Description}");
evt.Set();
break;
case WINBIO_OPERATION_TYPE.WINBIO_OPERATION_CLOSE_FRAMEWORK:
WinBioFree(lParam);
break;
}
}
catch { }
return default;
}
}
//[Test]
public void WinBioAsyncMonitorFrameworkChangesTest()
{
ManualResetEvent evt = new(false);
using var wnd = new MsgWnd(Callback);
Assert.That(WinBioAsyncOpenFramework(WINBIO_ASYNC_NOTIFICATION_METHOD.WINBIO_ASYNC_NOTIFY_MESSAGE, wnd.MessageWindowHandle, compMsg, default, default, false, out var hFramework), ResultIs.Successful);
try
{
Assert.That(WinBioAsyncMonitorFrameworkChanges(hFramework, WINBIO_FRAMEWORK_CHANGE_TYPE.WINBIO_FRAMEWORK_CHANGE_UNIT), ResultIs.Successful);
Assert.IsTrue(evt.WaitOne(5000));
}
finally
{
WinBioCloseFramework(hFramework);
}
IntPtr Callback(HWND hwnd, uint msg, IntPtr wParam, IntPtr lParam)
{
try
{
WINBIO_ASYNC_RESULT war = lParam.ToStructure<WINBIO_ASYNC_RESULT>();
switch (war.Operation)
{
case WINBIO_OPERATION_TYPE.WINBIO_OPERATION_UNIT_ARRIVAL:
TestContext.WriteLine($"Arrived");
evt.Set();
break;
case WINBIO_OPERATION_TYPE.WINBIO_OPERATION_UNIT_REMOVAL:
TestContext.WriteLine($"Removed");
evt.Set();
break;
case WINBIO_OPERATION_TYPE.WINBIO_OPERATION_CLOSE_FRAMEWORK:
WinBioFree(lParam);
break;
}
}
catch { }
return default;
}
}
//[Test]
public void WinBioAsyncOpenFrameworkCallbackTest()
{
var cbPtr = new PWINBIO_ASYNC_COMPLETION_CALLBACK(Callback);
Assert.That(WinBioAsyncOpenFramework(WINBIO_ASYNC_NOTIFICATION_METHOD.WINBIO_ASYNC_NOTIFY_CALLBACK, default, default,
Marshal.GetFunctionPointerForDelegate(cbPtr), default, true, out var hFramework), ResultIs.Successful);
Assert.That((uint)hFramework, Is.Zero);
static void Callback(IntPtr AsyncResult)
{
}
}
[Test]
public void WinBioAsyncOpenFrameworkHwnd2Test()
{
using var wnd = new MsgWnd();
Assert.That(WinBioAsyncOpenFramework(WINBIO_ASYNC_NOTIFICATION_METHOD.WINBIO_ASYNC_NOTIFY_MESSAGE, wnd.MessageWindowHandle, compMsg, default, default, false, out var hFramework), ResultIs.Successful);
try
{
Assert.That((uint)hFramework, Is.Not.Zero);
}
finally
{
WinBioCloseFramework(hFramework);
}
}
[Test]
public void WinBioAsyncOpenFrameworkHwndTest()
{
using var wnd = new MsgWnd();
Assert.That(WinBioAsyncOpenFramework(WINBIO_ASYNC_NOTIFICATION_METHOD.WINBIO_ASYNC_NOTIFY_MESSAGE, wnd.MessageWindowHandle, compMsg, default, default, true, out var hFramework), ResultIs.Successful);
Assert.That((uint)hFramework, Is.Zero);
}
//[Test]
public void WinBioAsyncOpenSessionTest()
{
Assert.That(WinBioAsyncOpenSession(WINBIO_BIOMETRIC_TYPE.WINBIO_TYPE_FINGERPRINT,
WINBIO_POOL_TYPE.WINBIO_POOL_SYSTEM,
WINBIO_SESSION_FLAGS.WINBIO_FLAG_RAW,
NotificationMethod: WINBIO_ASYNC_NOTIFICATION_METHOD.WINBIO_ASYNC_NOTIFY_CALLBACK,
DatabaseId: WINBIO_DB_DEFAULT, CallbackRoutine: Callback, AsynchronousOpen: true,
SessionHandle: out var hSess), ResultIs.Successful);
try
{
}
finally
{
WinBioCloseSession(hSess);
}
static void Callback(IntPtr AsyncResult)
{
using var str = new SafeWinBioStruct<WINBIO_ASYNC_RESULT>(AsyncResult, true);
str.Value.WriteValues();
}
}
//[Test]
public void WinBioCaptureSampleTest()
{
// Connect to the system pool.
var hr = WinBioOpenSession(WINBIO_BIOMETRIC_TYPE.WINBIO_TYPE_FINGERPRINT, // Service provider
WINBIO_POOL_TYPE.WINBIO_POOL_SYSTEM, // Pool type
WINBIO_SESSION_FLAGS.WINBIO_FLAG_RAW, // Access: Capture raw data
default, // Array of biometric unit IDs
0, // Count of biometric unit IDs
WINBIO_DB_DEFAULT, // Default database
out var sessionHandle); // [out] Session handle
Assert.That(hr, ResultIs.Successful);
// Capture a biometric sample.
hr = WinBioCaptureSample(sessionHandle,
var hr = WinBioCaptureSample(sessionHandle,
WINBIO_BIR_PURPOSE.WINBIO_NO_PURPOSE_AVAILABLE,
WINBIO_BIR_DATA_FLAGS.WINBIO_DATA_FLAG_RAW,
out var unitId,
@ -67,18 +353,45 @@ namespace Vanara.PInvoke.Tests
//bmp.Save(tmp.FullName);
}
[Test]
public void WinBioEnumBiometricUnitsTest()
{
Assert.That(WinBioEnumBiometricUnits(WINBIO_BIOMETRIC_TYPE.WINBIO_TYPE_FINGERPRINT, out var schemas), ResultIs.Successful);
schemas.WriteValues();
}
[Test]
public void WinBioEnumDatabasesTest()
{
Assert.That(WinBioEnumDatabases(WINBIO_BIOMETRIC_TYPE.WINBIO_TYPE_FINGERPRINT, out var schemas), ResultIs.Successful);
schemas.WriteValues();
}
[Test]
public void WinBioEnumEnrollmentsTest()
{
Assert.That(WinBioIdentify(sessionHandle, out var unitId, out var id, out _, out _), ResultIs.Successful);
Assert.That(WinBioEnumEnrollments(sessionHandle, unitId, id, out var subs), ResultIs.Successful);
subs.WriteValues();
}
[Test]
public void WinBioEnumServiceProvidersTest()
{
Assert.That(WinBioEnumServiceProviders(WINBIO_BIOMETRIC_TYPE.WINBIO_TYPE_FINGERPRINT, out var schemas), ResultIs.Successful);
schemas.WriteValues();
}
[Test]
public void WinBioGetLogonSettingTest()
{
WinBioGetLogonSetting(out var val, out var src);
TestContext.Write($"{val}:{src}");
}
[Test]
public void WinBioGetPropertyTest()
{
var hr = WinBioOpenSession(WINBIO_BIOMETRIC_TYPE.WINBIO_TYPE_FINGERPRINT, // Service provider
WINBIO_POOL_TYPE.WINBIO_POOL_SYSTEM, // Pool type
WINBIO_SESSION_FLAGS.WINBIO_FLAG_RAW, // Access: Capture raw data
default, // Array of biometric unit IDs
0, // Count of biometric unit IDs
WINBIO_DB_DEFAULT, // Default database
out var sessionHandle); // [out] Session handle
Assert.That(hr, ResultIs.Successful);
Assert.That(WinBioLocateSensor(sessionHandle, out var unitId), ResultIs.Successful);
Assert.That(WinBioGetProperty(sessionHandle, WINBIO_PROPERTY_TYPE.WINBIO_PROPERTY_TYPE_UNIT, WINBIO_PROPERTY_ID.WINBIO_PROPERTY_EXTENDED_SENSOR_INFO,
@ -86,5 +399,43 @@ namespace Vanara.PInvoke.Tests
Assert.That((long)propSize, Is.GreaterThan(0L));
}
[Test]
public void WinBioIdentifyTest()
{
Assert.That(WinBioIdentify(sessionHandle, out var unitId, out var id, out var sub, out var det), ResultIs.Successful);
TestContext.Write($"Session={sessionHandle}, UnitId={unitId}, Id={id.Type}, Sub={sub}, RejDet={det}");
}
[Test]
public void WinBioIdentifyWithCallbackTest()
{
Assert.That(WinBioIdentifyWithCallback(sessionHandle, Callback), ResultIs.Successful);
void Callback(IntPtr IdentifyCallbackContext, HRESULT OperationStatus, uint UnitId, in WINBIO_IDENTITY Identity, WINBIO_BIOMETRIC_SUBTYPE SubFactor, WINBIO_REJECT_DETAIL RejectDetail)
{
Assert.That(UnitId, Is.Not.Zero);
TestContext.WriteLine($"{UnitId} : {SubFactor} : {RejectDetail}");
Identity.WriteValues();
}
}
private class MsgWnd : SystemEventHandler
{
private readonly User32.WindowProc callback;
public MsgWnd(User32.WindowProc callback = null) => this.callback = callback;
protected override bool MessageFilter(HWND hwnd, uint msg, IntPtr wParam, IntPtr lParam, out IntPtr lReturn)
{
if (msg == compMsg)
{
lReturn = callback?.Invoke(hwnd, msg, wParam, lParam) ?? default;
return true;
}
lReturn = default;
return false;
}
}
}
}