From 3259c81e10541e606b1e3e165174074dbe087d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= Date: Sun, 25 Oct 2009 15:40:43 +0100 Subject: [PATCH] ntdll: Implement KeyNameInformation. --- dlls/ntdll/reg.c | 9 +++++++++ include/winternl.h | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c index f9db5a68176..7d24a9b6b41 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -217,6 +217,7 @@ static NTSTATUS enumerate_key( HANDLE handle, int index, KEY_INFORMATION_CLASS i case KeyBasicInformation: data_ptr = ((KEY_BASIC_INFORMATION *)info)->Name; break; case KeyFullInformation: data_ptr = ((KEY_FULL_INFORMATION *)info)->Class; break; case KeyNodeInformation: data_ptr = ((KEY_NODE_INFORMATION *)info)->Name; break; + case KeyNameInformation: data_ptr = ((KEY_NAME_INFORMATION *)info)->Name; break; default: FIXME( "Information class %d not implemented\n", info_class ); return STATUS_INVALID_PARAMETER; @@ -280,6 +281,14 @@ static NTSTATUS enumerate_key( HANDLE handle, int index, KEY_INFORMATION_CLASS i memcpy( info, &keyinfo, min( length, fixed_size ) ); } break; + case KeyNameInformation: + { + KEY_NAME_INFORMATION keyinfo; + fixed_size = (char *)keyinfo.Name - (char *)&keyinfo; + keyinfo.NameLength = reply->namelen; + memcpy( info, &keyinfo, min( length, fixed_size ) ); + } + break; } *result_len = fixed_size + reply->total; if (length < *result_len) ret = STATUS_BUFFER_OVERFLOW; diff --git a/include/winternl.h b/include/winternl.h index a78e9e5eba6..633239f17e3 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -614,7 +614,8 @@ typedef enum _FSINFOCLASS { typedef enum _KEY_INFORMATION_CLASS { KeyBasicInformation, KeyNodeInformation, - KeyFullInformation + KeyFullInformation, + KeyNameInformation } KEY_INFORMATION_CLASS; typedef enum _KEY_VALUE_INFORMATION_CLASS { @@ -1068,6 +1069,11 @@ typedef struct _KEY_FULL_INFORMATION WCHAR Class[1]; } KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION; +typedef struct _KEY_NAME_INFORMATION { + ULONG NameLength; + WCHAR Name[1]; +} KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION; + typedef struct _KEY_VALUE_ENTRY { PUNICODE_STRING ValueName;