Signed-off-by: Santino Mazza mazzasantino1206@gmail.com --- dlls/ncrypt/main.c | 2 ++ dlls/ncrypt/tests/ncrypt.c | 3 +++ 2 files changed, 5 insertions(+)
diff --git a/dlls/ncrypt/main.c b/dlls/ncrypt/main.c index dbcb0087445..a4d88124237 100644 --- a/dlls/ncrypt/main.c +++ b/dlls/ncrypt/main.c @@ -162,6 +162,7 @@ SECURITY_STATUS WINAPI NCryptGetProperty(NCRYPT_HANDLE handle, const WCHAR *name const struct object_property *property;
TRACE("(%#Ix, %s, %p, %lu, %p, %#lx)\n", handle, wine_dbgstr_w(name), output, outsize, result, flags); + if (!handle) return NTE_INVALID_HANDLE; if (flags) FIXME("flags %#lx not supported\n", flags);
if (!(property = get_object_property(object, name))) return NTE_INVALID_PARAMETER; @@ -372,6 +373,7 @@ SECURITY_STATUS WINAPI NCryptSetProperty(NCRYPT_HANDLE handle, const WCHAR *name struct object *object = (struct object *)handle;
TRACE("(%#Ix, %s, %p, %lu, %#lx)\n", handle, wine_dbgstr_w(name), input, insize, flags); + if(!handle) return NTE_INVALID_HANDLE; if (flags) FIXME("flags %#lx not supported\n", flags);
return set_object_property(object, name, input, insize); diff --git a/dlls/ncrypt/tests/ncrypt.c b/dlls/ncrypt/tests/ncrypt.c index 891e5b60254..9ffd4bfec50 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, &keylength, size, &size, 0); + ok(ret == NTE_INVALID_HANDLE, "got %#lx\n", ret); + NCryptFreeObject(prov); }