mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 05:17:28 +00:00
[WINESYNC] reg: Fail if a system key has a trailing backslash but no subkey path.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org> wine commit id 797520db8f7eb708845891da6f08d3030393d6bc by Hugh McMaster <hugh.mcmaster@outlook.com>
This commit is contained in:
parent
f55096783d
commit
f42b63fd64
3 changed files with 18 additions and 8 deletions
|
@ -234,9 +234,6 @@ BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path)
|
||||||
if (!sane_path(key))
|
if (!sane_path(key))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
*path = wcschr(key, '\\');
|
|
||||||
if (*path) (*path)++;
|
|
||||||
|
|
||||||
*root = path_get_rootkey(key);
|
*root = path_get_rootkey(key);
|
||||||
if (!*root)
|
if (!*root)
|
||||||
{
|
{
|
||||||
|
@ -244,6 +241,19 @@ BOOL parse_registry_key(const WCHAR *key, HKEY *root, WCHAR **path)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*path = wcschr(key, '\\');
|
||||||
|
|
||||||
|
if (!*path)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
(*path)++;
|
||||||
|
|
||||||
|
if (!**path)
|
||||||
|
{
|
||||||
|
output_message(STRING_INVALID_SYSTEM_KEY);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -311,12 +311,12 @@ static void test_key_formats(void)
|
||||||
|
|
||||||
/* Test validity of trailing backslash after system key */
|
/* Test validity of trailing backslash after system key */
|
||||||
run_reg_exe("reg add HKCU\\ /v Value1 /t REG_SZ /d foo /f", &r);
|
run_reg_exe("reg add HKCU\\ /v Value1 /t REG_SZ /d foo /f", &r);
|
||||||
todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
|
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
|
||||||
todo_wine verify_reg_nonexist(HKEY_CURRENT_USER, "Value1");
|
verify_reg_nonexist(HKEY_CURRENT_USER, "Value1");
|
||||||
|
|
||||||
run_reg_exe("reg add HKEY_CURRENT_USER\\ /v Value2 /t REG_SZ /d bar /f", &r);
|
run_reg_exe("reg add HKEY_CURRENT_USER\\ /v Value2 /t REG_SZ /d bar /f", &r);
|
||||||
todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
|
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
|
||||||
todo_wine verify_reg_nonexist(HKEY_CURRENT_USER, "Value2");
|
verify_reg_nonexist(HKEY_CURRENT_USER, "Value2");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_add(void)
|
static void test_add(void)
|
||||||
|
|
|
@ -4,4 +4,4 @@ directories:
|
||||||
files:
|
files:
|
||||||
programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
|
programs/reg/resource.h: base/applications/cmdutils/reg/resource.h
|
||||||
tags:
|
tags:
|
||||||
wine: 6d2ab37a44c6d0bd58504cbc3ff20d2828afc841
|
wine: 797520db8f7eb708845891da6f08d3030393d6bc
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue