[ros-diffs] [ekohl] 47050: [MKHIVE] - Add RegDeleteKeyW stub. - Implement RegDeleteKeyA so that it calls RegDeleteKeyW.
ekohl at svn.reactos.org
ekohl at svn.reactos.org
Tue Apr 27 23:47:54 CEST 2010
Author: ekohl
Date: Tue Apr 27 23:47:54 2010
New Revision: 47050
URL: http://svn.reactos.org/svn/reactos?rev=47050&view=rev
Log:
[MKHIVE]
- Add RegDeleteKeyW stub.
- Implement RegDeleteKeyA so that it calls RegDeleteKeyW.
Modified:
trunk/reactos/tools/mkhive/registry.c
Modified: trunk/reactos/tools/mkhive/registry.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/mkhive/registry.c?rev=47050&r1=47049&r2=47050&view=diff
==============================================================================
--- trunk/reactos/tools/mkhive/registry.c [iso-8859-1] (original)
+++ trunk/reactos/tools/mkhive/registry.c [iso-8859-1] Tue Apr 27 23:47:54 2010
@@ -25,9 +25,9 @@
/*
* TODO:
- * - Implement RegDeleteKey()
+ * - Implement RegDeleteKeyW()
* - Implement RegEnumValue()
- * - Implement RegQueryValueExA()
+ * - Implement RegQueryValueExW()
*/
#include <stdlib.h>
@@ -246,15 +246,38 @@
}
LONG WINAPI
-RegDeleteKeyA(HKEY Key,
- LPCSTR Name)
-{
- if (Name != NULL && strchr(Name, '\\') != NULL)
- return(ERROR_INVALID_PARAMETER);
-
- DPRINT1("FIXME!\n");
-
- return(ERROR_SUCCESS);
+RegDeleteKeyW(
+ IN HKEY hKey,
+ IN LPCWSTR lpSubKey)
+{
+ DPRINT1("FIXME!\n");
+ return ERROR_SUCCESS;
+}
+
+LONG WINAPI
+RegDeleteKeyA(
+ IN HKEY hKey,
+ IN LPCSTR lpSubKey)
+{
+ PWSTR lpSubKeyW = NULL;
+ LONG rc;
+
+ if (lpSubKey != NULL && strchr(lpSubKey, '\\') != NULL)
+ return ERROR_INVALID_PARAMETER;
+
+ if (lpSubKey)
+ {
+ lpSubKeyW = MultiByteToWideChar(lpSubKey);
+ if (!lpSubKeyW)
+ return ERROR_OUTOFMEMORY;
+ }
+
+ rc = RegDeleteKeyW(hKey, lpSubKeyW);
+
+ if (lpSubKey)
+ free(lpSubKeyW);
+
+ return rc;
}
LONG WINAPI
More information about the Ros-diffs
mailing list