[MKHIVE]
authorEric Kohl <eric.kohl@reactos.org>
Tue, 27 Apr 2010 21:47:54 +0000 (21:47 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Tue, 27 Apr 2010 21:47:54 +0000 (21:47 +0000)
- Add RegDeleteKeyW stub.
- Implement RegDeleteKeyA so that it calls RegDeleteKeyW.

svn path=/trunk/; revision=47050

reactos/tools/mkhive/registry.c

index 3bd2c9e..a6d7d4b 100644 (file)
@@ -25,9 +25,9 @@
 
 /*
  * TODO:
 
 /*
  * TODO:
- *     - Implement RegDeleteKey()
+ *     - Implement RegDeleteKeyW()
  *     - Implement RegEnumValue()
  *     - Implement RegEnumValue()
- *     - Implement RegQueryValueExA()
+ *     - Implement RegQueryValueExW()
  */
 
 #include <stdlib.h>
  */
 
 #include <stdlib.h>
@@ -246,15 +246,38 @@ RegCreateKeyA(
 }
 
 LONG WINAPI
 }
 
 LONG WINAPI
-RegDeleteKeyA(HKEY Key,
-            LPCSTR Name)
+RegDeleteKeyW(
+       IN HKEY hKey,
+       IN LPCWSTR lpSubKey)
+{
+       DPRINT1("FIXME!\n");
+       return ERROR_SUCCESS;
+}
+
+LONG WINAPI
+RegDeleteKeyA(
+       IN HKEY hKey,
+       IN LPCSTR lpSubKey)
 {
 {
-  if (Name != NULL && strchr(Name, '\\') != NULL)
-    return(ERROR_INVALID_PARAMETER);
+       PWSTR lpSubKeyW = NULL;
+       LONG rc;
 
 
-  DPRINT1("FIXME!\n");
+       if (lpSubKey != NULL && strchr(lpSubKey, '\\') != NULL)
+               return ERROR_INVALID_PARAMETER;
 
 
-  return(ERROR_SUCCESS);
+       if (lpSubKey)
+       {
+               lpSubKeyW = MultiByteToWideChar(lpSubKey);
+               if (!lpSubKeyW)
+                       return ERROR_OUTOFMEMORY;
+       }
+
+       rc = RegDeleteKeyW(hKey, lpSubKeyW);
+
+       if (lpSubKey)
+               free(lpSubKeyW);
+
+       return rc;
 }
 
 LONG WINAPI
 }
 
 LONG WINAPI