diff --git a/reactos/tools/mkhive/registry.c b/reactos/tools/mkhive/registry.c index 3bd2c9efe60..a6d7d4b248f 100644 --- a/reactos/tools/mkhive/registry.c +++ b/reactos/tools/mkhive/registry.c @@ -25,9 +25,9 @@ /* * TODO: - * - Implement RegDeleteKey() + * - Implement RegDeleteKeyW() * - Implement RegEnumValue() - * - Implement RegQueryValueExA() + * - Implement RegQueryValueExW() */ #include @@ -246,15 +246,38 @@ RegCreateKeyA( } LONG WINAPI -RegDeleteKeyA(HKEY Key, - LPCSTR Name) +RegDeleteKeyW( + IN HKEY hKey, + IN LPCWSTR lpSubKey) { - if (Name != NULL && strchr(Name, '\\') != NULL) - return(ERROR_INVALID_PARAMETER); + DPRINT1("FIXME!\n"); + return ERROR_SUCCESS; +} - DPRINT1("FIXME!\n"); +LONG WINAPI +RegDeleteKeyA( + IN HKEY hKey, + IN LPCSTR lpSubKey) +{ + PWSTR lpSubKeyW = NULL; + LONG rc; - return(ERROR_SUCCESS); + 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