From: Santino Mazza mazzasantino1206@gmail.com
Signed-off-by: Santino Mazza mazzasantino1206@gmail.com Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/ncrypt/main.c | 3 +++ dlls/ncrypt/tests/ncrypt.c | 3 +++ 2 files changed, 6 insertions(+)
diff --git a/dlls/ncrypt/main.c b/dlls/ncrypt/main.c index f8ae2d7a796..68d9d884618 100644 --- a/dlls/ncrypt/main.c +++ b/dlls/ncrypt/main.c @@ -164,7 +164,9 @@ SECURITY_STATUS WINAPI NCryptGetProperty(NCRYPT_HANDLE handle, const WCHAR *name TRACE("(%#Ix, %s, %p, %lu, %p, %#lx)\n", handle, wine_dbgstr_w(name), output, outsize, result, flags); if (flags) FIXME("flags %#lx not supported\n", flags);
+ if (!object) return NTE_INVALID_HANDLE; if (!(property = get_object_property(object, name))) return NTE_INVALID_PARAMETER; + *result = property->value_size; if (!output) return ERROR_SUCCESS; if (outsize < property->value_size) return NTE_BUFFER_TOO_SMALL; @@ -376,6 +378,7 @@ SECURITY_STATUS WINAPI NCryptSetProperty(NCRYPT_HANDLE handle, const WCHAR *name TRACE("(%#Ix, %s, %p, %lu, %#lx)\n", handle, wine_dbgstr_w(name), input, insize, flags); if (flags) FIXME("flags %#lx not supported\n", flags);
+ if (!object) return NTE_INVALID_HANDLE; return set_object_property(object, name, input, insize); }
diff --git a/dlls/ncrypt/tests/ncrypt.c b/dlls/ncrypt/tests/ncrypt.c index 891e5b60254..7ca20b2bfa6 100644 --- a/dlls/ncrypt/tests/ncrypt.c +++ b/dlls/ncrypt/tests/ncrypt.c @@ -199,6 +199,9 @@ static void test_get_property(void) ok(ret == ERROR_SUCCESS, "got %#lx\n", ret); ok(keylength == 1024, "got %lu\n", keylength);
+ ret = NCryptGetProperty(0, NCRYPT_LENGTH_PROPERTY, (BYTE *)&keylength, size, &size, 0); + ok(ret == NTE_INVALID_HANDLE, "got %#lx\n", ret); + NCryptFreeObject(prov); }