From f34a907c7abfee58303bd726baab0d4d5fcec486 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Mon, 13 Sep 2004 11:41:26 +0000 Subject: [PATCH 1/1] - Fix a typo in RegGetKeySecurity(). - Set missing error values. svn path=/trunk/; revision=10838 --- reactos/lib/advapi32/reg/reg.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/reactos/lib/advapi32/reg/reg.c b/reactos/lib/advapi32/reg/reg.c index d216e0a9124..67122140883 100644 --- a/reactos/lib/advapi32/reg/reg.c +++ b/reactos/lib/advapi32/reg/reg.c @@ -1,4 +1,4 @@ -/* $Id: reg.c,v 1.55 2004/09/13 08:51:40 ekohl Exp $ +/* $Id: reg.c,v 1.56 2004/09/13 11:41:26 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -1521,6 +1521,7 @@ RegGetKeySecurity(HKEY hKey, if (hKey == HKEY_PERFORMANCE_DATA) { + SetLastError(ERROR_INVALID_HANDLE); return ERROR_INVALID_HANDLE; } @@ -1528,18 +1529,20 @@ RegGetKeySecurity(HKEY hKey, hKey); if (!NT_SUCCESS(Status)) { + DPRINT("MapDefaultKey() failed (Status %lx)\n", Status); ErrorCode = RtlNtStatusToDosError(Status); SetLastError(ErrorCode); return ErrorCode; } - Status = NtQuerySecurityObject(hKey, + Status = NtQuerySecurityObject(KeyHandle, SecurityInformation, pSecurityDescriptor, *lpcbSecurityDescriptor, lpcbSecurityDescriptor); if (!NT_SUCCESS(Status)) { + DPRINT("NtQuerySecurityObject() failed (Status %lx)\n", Status); ErrorCode = RtlNtStatusToDosError(Status); SetLastError(ErrorCode); return ErrorCode; @@ -1599,6 +1602,7 @@ RegLoadKeyW (HKEY hKey, if (hKey == HKEY_PERFORMANCE_DATA) { + SetLastError(ERROR_INVALID_HANDLE); return ERROR_INVALID_HANDLE; } @@ -2991,6 +2995,7 @@ RegSetKeySecurity (HKEY hKey, if (hKey == HKEY_PERFORMANCE_DATA) { + SetLastError(ERROR_INVALID_HANDLE); return ERROR_INVALID_HANDLE; } @@ -3329,7 +3334,10 @@ RegUnLoadKeyW (HKEY hKey, NTSTATUS Status; if (hKey == HKEY_PERFORMANCE_DATA) - return ERROR_INVALID_HANDLE; + { + SetLastError(ERROR_INVALID_HANDLE); + return ERROR_INVALID_HANDLE; + } Status = MapDefaultKey (&KeyHandle, hKey); if (!NT_SUCCESS(Status)) -- 2.17.1