Author: jgardou
Date: Tue Sep 30 20:00:35 2014
New Revision: 64419
URL:
http://svn.reactos.org/svn/reactos?rev=64419&view=rev
Log:
[ADVAPI32]
- Reimplement RegDeleteKeyA as a wrapper around RegDeleteKeyW
CORE-8582
Modified:
trunk/reactos/dll/win32/advapi32/reg/reg.c
Modified: trunk/reactos/dll/win32/advapi32/reg/reg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/reg/reg…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/reg/reg.c [iso-8859-1] Tue Sep 30 20:00:35 2014
@@ -1182,55 +1182,16 @@
RegDeleteKeyA(HKEY hKey,
LPCSTR lpSubKey)
{
- OBJECT_ATTRIBUTES ObjectAttributes;
+ LONG ErrorCode;
UNICODE_STRING SubKeyName;
- HANDLE ParentKey;
- HANDLE TargetKey;
- NTSTATUS Status;
-
- /* Make sure we got a subkey */
- if (!lpSubKey)
- {
- /* Fail */
- return ERROR_INVALID_PARAMETER;
- }
-
- Status = MapDefaultKey(&ParentKey,
- hKey);
- if (!NT_SUCCESS(Status))
- {
- return RtlNtStatusToDosError(Status);
- }
-
- RtlCreateUnicodeStringFromAsciiz(&SubKeyName,
- (LPSTR)lpSubKey);
- InitializeObjectAttributes(&ObjectAttributes,
- &SubKeyName,
- OBJ_CASE_INSENSITIVE,
- ParentKey,
- NULL);
-
- Status = NtOpenKey(&TargetKey,
- DELETE,
- &ObjectAttributes);
+
+ RtlCreateUnicodeStringFromAsciiz(&SubKeyName, (LPSTR)lpSubKey);
+
+ ErrorCode = RegDeleteKeyW(hKey, SubKeyName.Buffer);
+
RtlFreeUnicodeString(&SubKeyName);
- if (!NT_SUCCESS(Status))
- {
- goto Cleanup;
- }
-
- Status = NtDeleteKey(TargetKey);
- NtClose (TargetKey);
-
-Cleanup:
- ClosePredefKey(ParentKey);
-
- if (!NT_SUCCESS(Status))
- {
- return RtlNtStatusToDosError(Status);
- }
-
- return ERROR_SUCCESS;
+
+ return ErrorCode;
}