[misc] improve readability of error code handling

* Also don't pass a read size value in WriteFileWithRetry() if we don't use it.
This commit is contained in:
Pete Batard 2024-04-01 02:16:41 +01:00
parent 52ca79816f
commit 8a5a5a318a
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
25 changed files with 257 additions and 252 deletions

View file

@ -1,7 +1,7 @@
/*
* Rufus: The Reliable USB Formatting Utility
* PKI functions (code signing, etc.)
* Copyright © 2015-2023 Pete Batard <pete@akeo.ie>
* Copyright © 2015-2024 Pete Batard <pete@akeo.ie>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -652,7 +652,7 @@ LONG ValidateSignature(HWND hDlg, const char* path)
trust_file.pcwszFilePath = utf8_to_wchar(path);
if (trust_file.pcwszFilePath == NULL) {
uprintf("PKI: Unable to convert '%s' to UTF16", path);
return ERROR_SEVERITY_ERROR | FAC(FACILITY_CERT) | ERROR_NOT_ENOUGH_MEMORY;
return RUFUS_ERROR(ERROR_NOT_ENOUGH_MEMORY);
}
trust_data.cbStruct = sizeof(trust_data);