Пример #1
0
        public static void DeleteTemplate(
            WinBioSessionHandle sessionHandle,
            int unitId,
            WinBioIdentity identity,
            WinBioBiometricSubType subFactor)
        {
            var handle = GCHandle.Alloc(identity.GetBytes(), GCHandleType.Pinned);

            try
            {
                var code = DeleteTemplate(sessionHandle, unitId, handle.AddrOfPinnedObject(), subFactor);
                WinBioException.ThrowOnError(code, "WinBioDeleteTemplate failed");
            }
            finally
            {
                handle.Free();
            }
        }
Пример #2
0
        public static bool EnrollCommit(WinBioSessionHandle sessionHandle, out WinBioIdentity identity)
        {
            bool isNewTemplate;
            var  bytes  = new byte[WinBioIdentity.Size];
            var  handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);

            try
            {
                var code = EnrollCommit(sessionHandle, handle.AddrOfPinnedObject(), out isNewTemplate);
                WinBioException.ThrowOnError(code, "WinBioEnrollCommit failed");
            }
            finally
            {
                handle.Free();
            }
            identity = new WinBioIdentity(bytes);
            return(isNewTemplate);
        }
Пример #3
0
        public static bool Verify(
            WinBioSessionHandle sessionHandle,
            WinBioIdentity identity,
            WinBioBiometricSubType subFactor,
            out int unitId,
            out WinBioRejectDetail rejectDetail)
        {
            bool match;
            var  handle = GCHandle.Alloc(identity.GetBytes(), GCHandleType.Pinned);

            try
            {
                var code = Verify(sessionHandle, handle.AddrOfPinnedObject(), subFactor, out unitId, out match, out rejectDetail);
                WinBioException.ThrowOnError(code, "WinBioVerify failed");
            }
            finally
            {
                handle.Free();
            }
            return(match);
        }
Пример #4
0
        public static int Identify(
            WinBioSessionHandle sessionHandle,
            out WinBioIdentity identity,
            out WinBioBiometricSubType subFactor,
            out WinBioRejectDetail rejectDetail)
        {
            int unitId;
            var bytes  = new byte[WinBioIdentity.Size];
            var handle = GCHandle.Alloc(bytes, GCHandleType.Pinned);

            try
            {
                var code = Identify(sessionHandle, out unitId, handle.AddrOfPinnedObject(), out subFactor, out rejectDetail);
                WinBioException.ThrowOnError(code, "WinBioIdentify failed");
            }
            finally
            {
                handle.Free();
            }
            identity = new WinBioIdentity(bytes);
            return(unitId);
        }
Пример #5
0
        public static WinBioBiometricSubType[] EnumEnrollments(WinBioSessionHandle sessionHandle, int unitId, WinBioIdentity identity)
        {
            var handle = GCHandle.Alloc(identity.GetBytes(), GCHandleType.Pinned);

            try
            {
                IntPtr subFactorArray;
                int    subFactorCount;
                var    code = EnumEnrollments(sessionHandle, unitId, handle.AddrOfPinnedObject(), out subFactorArray, out subFactorCount);
                WinBioException.ThrowOnError(code, "WinBioEnumEnrollments failed");
                return(MarshalArray <WinBioBiometricSubType>(subFactorArray, subFactorCount));
            }
            finally
            {
                handle.Free();
            }
        }