[PATCH 05/16] ncrypt: Implement NCryptIsKeyHandle
abdaandroid at gmail.com
abdaandroid at gmail.com
Sun Oct 11 10:45:24 CDT 2020
From: Ariel Darshan <abdaandroid at gmail.com>
Signed-off-by: Ariel Darshan <abdaandroid at gmail.com>
---
dlls/ncrypt/main.c | 10 ++++++++++
dlls/ncrypt/ncrypt.spec | 2 +-
include/ncrypt.h | 1 +
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/ncrypt/main.c b/dlls/ncrypt/main.c
index 27313438279..003add36502 100644
--- a/dlls/ncrypt/main.c
+++ b/dlls/ncrypt/main.c
@@ -288,6 +288,16 @@ SECURITY_STATUS WINAPI NCryptIsAlgSupported(NCRYPT_PROV_HANDLE provider, const W
return NTE_NOT_SUPPORTED;
}
+BOOL WINAPI NCryptIsKeyHandle(NCRYPT_HANDLE object)
+{
+ struct ncrypt_base_object *obj;
+
+ TRACE("(0x%lx)\n", object);
+
+ obj = handle2baseObject(object);
+ return obj->sType == NCRYPT_OBJ_TYPE_KEY;
+}
+
SECURITY_STATUS WINAPI NCryptOpenKey(NCRYPT_PROV_HANDLE provider, NCRYPT_KEY_HANDLE *key,
const WCHAR *name, DWORD keyspec, DWORD flags)
{
diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec
index 2e6765c91ff..b13354e4bef 100644
--- a/dlls/ncrypt/ncrypt.spec
+++ b/dlls/ncrypt/ncrypt.spec
@@ -78,7 +78,7 @@
@ stub NCryptGetProtectionDescriptorInfo
@ stdcall NCryptImportKey(long long wstr ptr ptr ptr long long)
@ stub NCryptIsAlgSupported(long wstr long)
-@ stub NCryptIsKeyHandle
+@ stdcall NCryptIsKeyHandle(long)
@ stub NCryptKeyDerivation
@ stub NCryptNotifyChangeKey
@ stdcall NCryptOpenKey(long ptr wstr long long)
diff --git a/include/ncrypt.h b/include/ncrypt.h
index 9110c1ef6a4..b78fa3aeae7 100644
--- a/include/ncrypt.h
+++ b/include/ncrypt.h
@@ -81,6 +81,7 @@ SECURITY_STATUS WINAPI NCryptEnumStorageProviders(DWORD *, NCryptProviderName **
SECURITY_STATUS WINAPI NCryptFinalizeKey(NCRYPT_KEY_HANDLE, DWORD);
SECURITY_STATUS WINAPI NCryptFreeBuffer(PVOID);
SECURITY_STATUS WINAPI NCryptFreeObject(NCRYPT_HANDLE);
+BOOL WINAPI NCryptIsKeyHandle(NCRYPT_HANDLE);
SECURITY_STATUS WINAPI NCryptOpenKey(NCRYPT_PROV_HANDLE, NCRYPT_KEY_HANDLE *, const WCHAR *, DWORD, DWORD);
SECURITY_STATUS WINAPI NCryptOpenStorageProvider(NCRYPT_PROV_HANDLE *, const WCHAR *, DWORD);
--
2.28.0
More information about the wine-devel
mailing list