' ########################################################################################
' Microsoft Windows
' File: WinBio.inc
' Contents: WinBio public API
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
'#ifndef _WINBIO_H_9B9AD1F6_97B1_4647_923D_583FD7428C4C_
'#define _WINBIO_H_9B9AD1F6_97B1_4647_923D_583FD7428C4C_
#IF NOT %DEF(PBX_WinBio_PBI)
#DEFINE PBX_WinBio_PBI
%EQUATE `WINBIO_INC = 1
'#if (NTDDI_VERSION >= NTDDI_WIN7)
'//
'// Dependencies...
'//
#INCLUDE ONCE "Legacy/Platform/WinBio_Types.inc"
#INCLUDE ONCE "Legacy/Platform/WinBio_Err.inc"
'///////////////////////////////////////////////////////////////////////////////
'//
'// Capability discovery
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioEnumServiceProviders LIB "winbio.dll" ALIAS "WinBioEnumServiceProviders" ( BYVAL Factor AS QUAD , BYREF BspSchemaArray AS WINBIO_BSP_SCHEMA , BYREF BspCount AS QUAD ) AS LONG
DECLARE FUNCTION WinBioEnumBiometricUnits LIB "winbio.dll" ALIAS "WinBioEnumBiometricUnits" ( BYVAL Factor AS QUAD
 , BYREF UnitSchemaArray AS WINBIO_UNIT_SCHEMA
 , BYREF UnitCount AS DWORD
 ) AS LONG
DECLARE FUNCTION WinBioEnumDatabases LIB "winbio.dll" ALIAS "WinBioEnumDatabases" ( BYVAL Factor AS DWORD
 , BYREF StorageSchemaArray AS WINBIO_STORAGE_SCHEMA
 , BYREF StorageCount AS DWORD
 ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// Session management
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioOpenSession LIB "winbio.dll" ALIAS "WinBioOpenSession" ( BYVAL Factor AS QUAD , BYVAL PoolType AS QUAD , BYVAL Flags AS QUAD , BYREF UnitArray AS QUAD , BYVAL UnitCount AS QUAD , BYREF DatabaseId AS GUID , BYREF SessionHandle AS QUAD ) AS LONG
DECLARE FUNCTION WinBioCloseSession LIB "winbio.dll" ALIAS "WinBioCloseSession" ( BYVAL SessionHandle AS QUAD
 ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// High-level biometric operations
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioVerify LIB "winbio.dll" ALIAS "WinBioVerify" ( BYVAL SessionHandle AS QUAD , BYREF Identity AS WINBIO_IDENTITY , BYVAL SubFactor AS BYTE , BYREF UnitId AS QUAD , BYREF Match AS BYTE , BYREF RejectDetail AS QUAD ) AS LONG
'typedef
'(CALLBACK *PWINBIO_VERIFY_CALLBACK)(
' );
'SUB WINBIO_VERIFY_CALLBACK ( ' BYVAL VerifyCallbackContext AS DWORD
' , BYVAL OperationStatus AS LONG
' , BYVAL UnitId AS DWORD
' , BYVAL Match AS BYTE
' , BYVAL RejectDetail AS DWORD
' )
DECLARE FUNCTION WinBioVerifyWithCallback LIB "winbio.dll" ALIAS "WinBioVerifyWithCallback" ( BYVAL SessionHandle AS DWORD
 , BYREF Identity AS WINBIO_IDENTITY
 , BYVAL SubFactor AS BYTE
 , BYVAL VerifyCallback AS DWORD
 , OPTIONAL BYVAL VerifyCallbackContext AS DWORD
 ) AS LONG
DECLARE FUNCTION WinBioIdentify LIB "winbio.dll" ALIAS "WinBioIdentify" ( BYVAL SessionHandle AS DWORD
 , BYVAL UnitId AS DWORD
 , BYREF Identity AS WINBIO_IDENTITY
 , BYREF SubFactor AS BYTE
 , BYREF RejectDetail AS DWORD
 ) AS LONG
'typedef
'(CALLBACK *PWINBIO_IDENTIFY_CALLBACK)(
' );
'SUB WINBIO_IDENTIFY_CALLBACK ( ' BYVAL IdentifyCallbackContext AS DWORD
' , BYVAL OperationStatus AS LONG
' , BYVAL UnitId AS DWORD
' , BYREF Identity AS WINBIO_IDENTITY
' , BYVAL SubFactor AS BYTE
' , BYVAL RejectDetail AS DWORD
' )
DECLARE FUNCTION WinBioIdentifyWithCallback LIB "winbio.dll" ALIAS "WinBioIdentifyWithCallback" ( BYVAL SessionHandle AS DWORD
 , BYVAL IdentifyCallback AS DWORD
 , OPTIONAL BYVAL IdentifyCallbackContext AS DWORD
 ) AS LONG
DECLARE FUNCTION WinBioWait LIB "winbio.dll" ALIAS "WinBioWait" ( BYVAL SessionHandle AS DWORD
 ) AS LONG
DECLARE FUNCTION WinBioCancel LIB "winbio.dll" ALIAS "WinBioCancel" ( BYVAL SessionHandle AS DWORD
 ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// Sensor-location operations
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioLocateSensor LIB "winbio.dll" ALIAS "WinBioLocateSensor" ( BYVAL SessionHandle AS QUAD , BYREF UnitId AS QUAD ) AS LONG
'typedef
'(CALLBACK *PWINBIO_LOCATE_SENSOR_CALLBACK)(
' );
'SUB WINBIO_LOCATE_SENSOR_CALLBACK ( ' BYVAL LocateCallbackContext AS DWORD
' , BYVAL OperationStatus AS LONG
' , BYVAL UnitId AS DWORD
' )
DECLARE FUNCTION WinBioLocateSensorWithCallback LIB "winbio.dll" ALIAS "WinBioLocateSensorWithCallback" ( BYVAL SessionHandle AS DWORD
 , BYVAL LocateCallback AS DWORD
 , OPTIONAL LocateCallbackContext AS DWORD
 ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// Enrollment operations
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioEnrollBegin LIB "winbio.dll" ALIAS "WinBioEnrollBegin" ( BYVAL SessionHandle AS QUAD , BYVAL SubFactor AS BYTE , BYVAL UnitId AS QUAD ) AS LONG
DECLARE FUNCTION WinBioEnrollCapture LIB "winbio.dll" ALIAS "WinBioEnrollCapture" ( BYVAL SessionHandle AS QUAD
 , BYREF RejectDetail AS DWORD
 ) AS LONG
'typedef
'(CALLBACK *PWINBIO_ENROLL_CAPTURE_CALLBACK)(
' );
'SUB WINBIO_ENROLL_CAPTURE_CALLBACK ( ' BYVAL EnrollCallbackContext AS DWORD
' , BYVAL OperationStatus AS LONG
' , BYREF RejectDetail AS DWORD
' )
DECLARE FUNCTION WinBioEnrollCaptureWithCallback LIB "winbio.dll" ALIAS "WinBioEnrollCaptureWithCallback" ( BYVAL SessionHandle AS DWORD
 , BYVAL EnrollCallback AS DWORD
 , OPTIONAL EnrollCallbackContext AS DWORD
 ) AS LONG
DECLARE FUNCTION WinBioEnrollCommit LIB "winbio.dll" ALIAS "WinBioEnrollCommit" ( BYVAL SessionHandle AS DWORD
 , BYREF Identity AS WINBIO_IDENTITY
 , BYREF IsNewTemplate AS BYTE
 ) AS LONG
DECLARE FUNCTION WinBioEnrollDiscard LIB "winbio.dll" ALIAS "WinBioEnrollDiscard" ( BYVAL SessionHandle AS DWORD
 ) AS LONG
DECLARE FUNCTION WinBioEnumEnrollments LIB "winbio.dll" ALIAS "WinBioEnumEnrollments" ( BYVAL SessionHandle AS DWORD
 , BYVAL UnitId AS DWORD
 , BYREF Identity AS WINBIO_IDENTITY
 , BYREF SubFactorArray AS BYTE
 , BYREF SubFactorCount AS DWORD
 ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// Event monitors
'//
'///////////////////////////////////////////////////////////////////////////////
'typedef
'(CALLBACK *PWINBIO_EVENT_CALLBACK)(
' );
'SUB WINBIO_EVENT_CALLBACK ( ' BYVAL EventCallbackContext AS DWORD
' , BYVAL OperationStatus AS LONG
' , BYREF pEvent AS WINBIO_EVENT
' )
DECLARE FUNCTION WinBioRegisterEventMonitor LIB "winbio.dll" ALIAS "WinBioRegisterEventMonitor" ( BYVAL SessionHandle AS DWORD
 , BYVAL EventMask AS DWORD
 , BYVAL EventCallback AS DWORD
 , OPTIONAL EventCallbackContext AS DWORD
 ) AS LONG
DECLARE FUNCTION WinBioUnregisterEventMonitor LIB "winbio.dll" ALIAS "WinBioUnregisterEventMonitor" ( BYVAL SessionHandle AS DWORD
 ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// Raw biometric operations
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioCaptureSample LIB "winbio.dll" ALIAS "WinBioCaptureSample" ( BYVAL SessionHandle AS QUAD , BYVAL Purpose AS BYTE , BYVAL Flags AS QUAD , BYREF UnitId AS QUAD , BYREF Sample AS WINBIO_BIR , BYREF SampleSize AS QUAD , BYREF RejectDetail AS QUAD ) AS LONG
'typedef
'(CALLBACK *PWINBIO_CAPTURE_CALLBACK)(
' );
'SUB WINBIO_CAPTURE_CALLBACK ( ' BYVAL CaptureCallbackContext AS DWORD
' , BYVAL OperationStatus AS LONG
' , BYVAL UnitId AS DWORD
' , BYREF Sample AS WINBIO_BIR
' , BYVAL SampleSize AS DWORD
' , BYVAL RejectDetail AS DWORD
' )
DECLARE FUNCTION WinBioCaptureSampleWithCallback LIB "winbio.dll" ALIAS "WinBioCaptureSampleWithCallback" ( BYVAL SessionHandle AS DWORD
 , BYVAL Purpose AS BYTE
 , BYVAL Flags AS DWORD
 , BYVAL CaptureCallback AS DWORD
 , OPTIONAL CaptureCallbackContext AS DWORD
 ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// Storage management
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioDeleteTemplate LIB "winbio.dll" ALIAS "WinBioDeleteTemplate" ( BYVAL SessionHandle AS QUAD , BYVAL UnitId AS QUAD , BYREF Identity AS WINBIO_IDENTITY , BYVAL SubFactor AS BYTE ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// Extension interface
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioLockUnit LIB "winbio.dll" ALIAS "WinBioLockUnit" ( BYVAL SessionHandle AS QUAD , BYVAL UnitId AS QUAD ) AS LONG
DECLARE FUNCTION WinBioUnlockUnit LIB "winbio.dll" ALIAS "WinBioUnlockUnit" ( BYVAL SessionHandle AS QUAD
 , BYVAL UnitId AS DWORD
 ) AS LONG
DECLARE FUNCTION WinBioControlUnit LIB "winbio.dll" ALIAS "WinBioControlUnit" ( BYVAL SessionHandle AS DWORD
 , BYVAL UnitId AS DWORD
 , BYVAL Component AS DWORD
 , BYVAL ControlCode AS DWORD
 , BYVAL SendBuffer AS BYTE PTR
 , BYVAL SendBufferSize AS DWORD
 , BYVAL ReceiveBuffer AS BYTE PTR
 , BYVAL ReceiveBufferSize AS DWORD
 , BYREF ReceiveDataSize AS DWORD
 , BYREF OperationStatus AS DWORD
 ) AS LONG
DECLARE FUNCTION WinBioControlUnitPrivileged LIB "winbio.dll" ALIAS "WinBioControlUnitPrivileged" ( BYVAL SessionHandle AS DWORD
 , BYVAL UnitId AS DWORD
 , BYVAL Component AS DWORD
 , BYVAL ControlCode AS DWORD
 , BYVAL SendBuffer AS BYTE PTR
 , BYVAL SendBufferSize AS DWORD
 , BYVAL ReceiveBuffer AS BYTE PTR
 , BYVAL ReceiveBufferSize AS DWORD
 , BYREF ReceiveDataSize AS DWORD
 , BYREF OperationStatus AS DWORD
 ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// Get/set property operations
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioGetProperty LIB "winbio.dll" ALIAS "WinBioGetProperty" ( BYVAL SessionHandle AS QUAD , BYVAL PropertyType AS QUAD , BYVAL PropertyId AS QUAD , BYVAL UnitId AS QUAD , BYREF Identity AS WINBIO_IDENTITY , BYVAL SubFactor AS BYTE , BYREF PropertyBuffer AS ANY , BYREF PropertyBufferSize AS QUAD ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// Resource management
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioFree LIB "winbio.dll" ALIAS "WinBioFree" ( BYVAL Address AS QUAD ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// Credential management
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioSetCredential LIB "winbio.dll" ALIAS "WinBioSetCredential" ( BYVAL Type AS QUAD , BYVAL Credential AS BYTE PTR , BYVAL CredentialSize AS QUAD , BYVAL Format AS QUAD ) AS LONG
DECLARE FUNCTION WinBioRemoveCredential LIB "winbio.dll" ALIAS "WinBioRemoveCredential" ( BYREF Identity AS WINBIO_IDENTITY
 , BYVAL Type AS DWORD
 ) AS LONG
DECLARE FUNCTION WinBioRemoveAllCredentials LIB "winbio.dll" ALIAS "WinBioRemoveAllCredentials" ( ) AS LONG
DECLARE FUNCTION WinBioRemoveAllDomainCredentials LIB "winbio.dll" ALIAS "WinBioRemoveAllDomainCredentials" ( ) AS LONG
DECLARE FUNCTION WinBioGetCredentialState LIB "winbio.dll" ALIAS "WinBioGetCredentialState" ( BYREF Identity AS WINBIO_IDENTITY
 , BYVAL Type AS DWORD
 , BYREF CredentialState AS DWORD
 ) AS LONG
DECLARE FUNCTION WinBioLogonIdentifiedUser LIB "winbio.dll" ALIAS "WinBioLogonIdentifiedUser" ( BYVAL SessionHandle AS DWORD
 ) AS LONG
'///////////////////////////////////////////////////////////////////////////////
'//
'// Settings
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE SUB WinBioGetEnabledSetting LIB "winbio.dll" ALIAS "WinBioGetEnabledSetting" ( BYREF Value AS BYTE , BYREF Source AS QUAD )
DECLARE SUB WinBioGetLogonSetting LIB "winbio.dll" ALIAS "WinBioGetLogonSetting" ( BYREF Value AS BYTE , BYREF Source AS QUAD )
DECLARE SUB WinBioGetDomainLogonSetting LIB "winbio.dll" ALIAS "WinBioGetDomainLogonSetting" ( __out BOOLEAN* Value,
 __out PWINBIO_SETTING_SOURCE_TYPE Source
 )
'///////////////////////////////////////////////////////////////////////////////
'//
'// Focus tracking management
'//
'///////////////////////////////////////////////////////////////////////////////
DECLARE FUNCTION WinBioAcquireFocus LIB "winbio.dll" ALIAS "WinBioAcquireFocus" ( ) AS LONG
DECLARE FUNCTION WinBioReleaseFocus LIB "winbio.dll" ALIAS "WinBioReleaseFocus" ( ) AS LONG
'#endif // (NTDDI_VERSION >= NTDDI_WIN7)
#ENDIF
