[PATCH 0/1] MR7464: cryptnet: Uniform return value that is the same as _wfsopen.
INVALID_HANDLE_VALUE is non-zero, and the caller may fail to handle the error. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7464
From: Haoyang Chen <chenhaoyang(a)kylinos.cn> INVALID_HANDLE_VALUE is non-zero, and the caller may fail to handle the error. --- dlls/cryptnet/cryptnet_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/cryptnet/cryptnet_main.c b/dlls/cryptnet/cryptnet_main.c index 1200416af58..315432aa108 100644 --- a/dlls/cryptnet/cryptnet_main.c +++ b/dlls/cryptnet/cryptnet_main.c @@ -1552,7 +1552,7 @@ static FILE *open_cached_revocation_file(const CERT_CONTEXT *cert, const CERT_RE if (FAILED(hr = SHGetKnownFolderPath(&FOLDERID_LocalAppDataLow, 0, NULL, &appdata_path))) { ERR("Failed to get LocalAppDataLow path, hr %#lx.\n", hr); - return INVALID_HANDLE_VALUE; + return NULL; } len = swprintf(path, ARRAY_SIZE(path), L"%s\\Microsoft\\CryptnetUrlCache\\Content\\", appdata_path); @@ -1561,7 +1561,7 @@ static FILE *open_cached_revocation_file(const CERT_CONTEXT *cert, const CERT_RE if (len + CACHED_CERT_HASH_SIZE * 2 * sizeof(WCHAR) > ARRAY_SIZE(path) - 1) { WARN("Hash length exceeds static buffer; not caching.\n"); - return INVALID_HANDLE_VALUE; + return NULL; } CryptAcquireContextW(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7464
This merge request was approved by Hans Leidekker. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7464
participants (3)
-
Hans Leidekker (@hans) -
Haoyang Chen -
Haoyang Chen (@chenhaoyang)