From 1f0f545ef9ce5bb083751b3bf91a33f4dfd96c99 Mon Sep 17 00:00:00 2001 From: Calvin Cheng Date: Tue, 20 May 2025 11:56:41 +0800 Subject: [PATCH] Update win32's constants --- lib/src/biometric_storage_win32.dart | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/src/biometric_storage_win32.dart b/lib/src/biometric_storage_win32.dart index 27754c1..7a6e891 100644 --- a/lib/src/biometric_storage_win32.dart +++ b/lib/src/biometric_storage_win32.dart @@ -46,10 +46,10 @@ class Win32BiometricStoragePlugin extends BiometricStorage { ) async { final namePointer = TEXT(name); try { - final result = CredDelete(namePointer, CRED_TYPE.CRED_TYPE_GENERIC, 0); + final result = CredDelete(namePointer, CRED_TYPE_GENERIC, 0); if (result != TRUE) { final errorCode = GetLastError(); - if (errorCode == WIN32_ERROR.ERROR_NOT_FOUND) { + if (errorCode == ERROR_NOT_FOUND) { _logger.fine('Unable to find credential of name $name'); } else { _logger.warning('Error ($result): $errorCode'); @@ -71,10 +71,9 @@ class Win32BiometricStoragePlugin extends BiometricStorage { final credPointer = calloc>(); final namePointer = TEXT(name); try { - if (CredRead(namePointer, CRED_TYPE.CRED_TYPE_GENERIC, 0, credPointer) != - TRUE) { + if (CredRead(namePointer, CRED_TYPE_GENERIC, 0, credPointer) != TRUE) { final errorCode = GetLastError(); - if (errorCode == WIN32_ERROR.ERROR_NOT_FOUND) { + if (errorCode == ERROR_NOT_FOUND) { _logger.fine('Unable to find credential of name $name'); } else { _logger.warning('Error: $errorCode ', @@ -111,9 +110,9 @@ class Win32BiometricStoragePlugin extends BiometricStorage { final userNamePointer = TEXT('flutter.biometric_storage'); final credential = calloc() - ..ref.Type = CRED_TYPE.CRED_TYPE_GENERIC + ..ref.Type = CRED_TYPE_GENERIC ..ref.TargetName = namePointer - ..ref.Persist = CRED_PERSIST.CRED_PERSIST_LOCAL_MACHINE + ..ref.Persist = CRED_PERSIST_LOCAL_MACHINE ..ref.UserName = userNamePointer ..ref.CredentialBlob = blob ..ref.CredentialBlobSize = examplePassword.length;