}
LONG WINAPI
-RegDeleteKeyW(IN HKEY hKey,
- IN LPCWSTR lpSubKey)
+RegDeleteKeyW(
+ IN HKEY hKey,
+ IN LPCWSTR lpSubKey)
{
- if (lpSubKey != NULL && wcschr(lpSubKey, L'\\') != NULL)
- return(ERROR_INVALID_PARAMETER);
-
- DPRINT1("RegDeleteKeyW: FIXME!\n");
-
- return(ERROR_SUCCESS);
+ DPRINT1("FIXME!\n");
+ return ERROR_SUCCESS;
}
LONG WINAPI
-RegDeleteKeyA(IN HKEY hKey,
- IN LPCSTR lpSubKey)
+RegDeleteKeyA(
+ IN HKEY hKey,
+ IN LPCSTR lpSubKey)
{
- PWSTR lpSubKeyW;
+ PWSTR lpSubKeyW = NULL;
LONG rc;
if (lpSubKey != NULL && strchr(lpSubKey, '\\') != NULL)
- return(ERROR_INVALID_PARAMETER);
+ return ERROR_INVALID_PARAMETER;
- lpSubKeyW = MultiByteToWideChar(lpSubKey);
- if (!lpSubKeyW)
- return ERROR_OUTOFMEMORY;
+ if (lpSubKey)
+ {
+ lpSubKeyW = MultiByteToWideChar(lpSubKey);
+ if (!lpSubKeyW)
+ return ERROR_OUTOFMEMORY;
+ }
rc = RegDeleteKeyW(hKey, lpSubKeyW);
- free(lpSubKeyW);
+
+ if (lpSubKey)
+ free(lpSubKeyW);
+
return rc;
}