diff --git a/reactos/dll/win32/advapi32/reg/reg.c b/reactos/dll/win32/advapi32/reg/reg.c index a692fbe0e23..4ce71e5729f 100644 --- a/reactos/dll/win32/advapi32/reg/reg.c +++ b/reactos/dll/win32/advapi32/reg/reg.c @@ -425,11 +425,16 @@ RegCloseKey(HKEY hKey) NTSTATUS Status; /* don't close null handle or a pseudo handle */ - if ((!hKey) || (((ULONG_PTR)hKey & 0xF0000000) == 0x80000000)) + if (!hKey) { return ERROR_INVALID_HANDLE; } + if (((ULONG_PTR)hKey & 0xF0000000) == 0x80000000) + { + return ERROR_SUCCESS; + } + Status = NtClose(hKey); if (!NT_SUCCESS(Status)) {