[ADVAPI32] Do not report failure when closing a predefined registry key.

svn path=/trunk/; revision=72550
This commit is contained in:
Mark Jansen 2016-09-03 16:31:27 +00:00
parent e61bc91d97
commit 865a118a60

View file

@ -425,11 +425,16 @@ RegCloseKey(HKEY hKey)
NTSTATUS Status; NTSTATUS Status;
/* don't close null handle or a pseudo handle */ /* don't close null handle or a pseudo handle */
if ((!hKey) || (((ULONG_PTR)hKey & 0xF0000000) == 0x80000000)) if (!hKey)
{ {
return ERROR_INVALID_HANDLE; return ERROR_INVALID_HANDLE;
} }
if (((ULONG_PTR)hKey & 0xF0000000) == 0x80000000)
{
return ERROR_SUCCESS;
}
Status = NtClose(hKey); Status = NtClose(hKey);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {