Santino Mazza : ncrypt: NCryptGetProperty should always fill result size.

Alexandre Julliard julliard at winehq.org
Thu Feb 17 15:33:59 CST 2022


Module: wine
Branch: master
Commit: 88e027b523e704c56b3434148fb27018bca922bb
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=88e027b523e704c56b3434148fb27018bca922bb

Author: Santino Mazza <mazzasantino1206 at gmail.com>
Date:   Thu Feb 17 11:06:31 2022 +0100

ncrypt: NCryptGetProperty should always fill result size.

Signed-off-by: Santino Mazza <mazzasantino1206 at gmail.com>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ncrypt/main.c         | 7 ++-----
 dlls/ncrypt/tests/ncrypt.c | 2 --
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/dlls/ncrypt/main.c b/dlls/ncrypt/main.c
index 82ce7a0b4dc..2c2a0dc6f56 100644
--- a/dlls/ncrypt/main.c
+++ b/dlls/ncrypt/main.c
@@ -165,11 +165,8 @@ SECURITY_STATUS WINAPI NCryptGetProperty(NCRYPT_HANDLE handle, const WCHAR *name
     if (flags) FIXME("flags %#lx not supported\n", flags);
 
     if (!(property = get_object_property(object, name))) return NTE_INVALID_PARAMETER;
-    if (!output)
-    {
-        *result = property->value_size;
-        return ERROR_SUCCESS;
-    }
+    *result = property->value_size;
+    if (!output) return ERROR_SUCCESS;
     if (outsize < property->value_size) return NTE_BUFFER_TOO_SMALL;
 
     memcpy(output, property->value, property->value_size);
diff --git a/dlls/ncrypt/tests/ncrypt.c b/dlls/ncrypt/tests/ncrypt.c
index 070b0c3f13e..891e5b60254 100644
--- a/dlls/ncrypt/tests/ncrypt.c
+++ b/dlls/ncrypt/tests/ncrypt.c
@@ -186,9 +186,7 @@ static void test_get_property(void)
     value[0] = 0;
     ret = NCryptGetProperty(key, NCRYPT_ALGORITHM_GROUP_PROPERTY, (BYTE *)value, sizeof(value), &size, 0);
     ok(ret == ERROR_SUCCESS, "got %#lx\n", ret);
-    todo_wine {
     ok(size == 8, "got %lu\n", size);
-    }
     ok(!lstrcmpW(value, L"RSA"), "The string doesn't match with 'RSA'\n");
 
     size = 0;




More information about the wine-cvs mailing list