/*
* TODO:
- * - Implement RegDeleteKey()
+ * - Implement RegDeleteKeyW()
* - Implement RegEnumValue()
- * - Implement RegQueryValueExA()
+ * - Implement RegQueryValueExW()
*/
#include <stdlib.h>
}
LONG WINAPI
-RegDeleteKeyA(HKEY Key,
- LPCSTR Name)
+RegDeleteKeyW(IN HKEY hKey,
+ IN LPCWSTR lpSubKey)
{
- if (Name != NULL && strchr(Name, '\\') != NULL)
- return(ERROR_INVALID_PARAMETER);
+ if (lpSubKey != NULL && wcschr(lpSubKey, L'\\') != NULL)
+ return(ERROR_INVALID_PARAMETER);
- DPRINT1("FIXME!\n");
+ DPRINT1("RegDeleteKeyW: FIXME!\n");
- return(ERROR_SUCCESS);
+ return(ERROR_SUCCESS);
+}
+
+LONG WINAPI
+RegDeleteKeyA(IN HKEY hKey,
+ IN LPCSTR lpSubKey)
+{
+ PWSTR lpSubKeyW;
+ LONG rc;
+
+ if (lpSubKey != NULL && strchr(lpSubKey, '\\') != NULL)
+ return(ERROR_INVALID_PARAMETER);
+
+ lpSubKeyW = MultiByteToWideChar(lpSubKey);
+ if (!lpSubKeyW)
+ return ERROR_OUTOFMEMORY;
+
+ rc = RegDeleteKeyW(hKey, lpSubKeyW);
+ free(lpSubKeyW);
+ return rc;
}
LONG WINAPI