Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions lib/src/biometric_storage_win32.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -71,10 +71,9 @@ class Win32BiometricStoragePlugin extends BiometricStorage {
final credPointer = calloc<Pointer<CREDENTIAL>>();
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 ',
Expand Down Expand Up @@ -111,9 +110,9 @@ class Win32BiometricStoragePlugin extends BiometricStorage {
final userNamePointer = TEXT('flutter.biometric_storage');

final credential = calloc<CREDENTIAL>()
..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;
Expand Down