reg: Import REG_DWORD data via the state machine.

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2017-08-18 09:30:38 +00:00 committed by Alexandre Julliard
parent 038f1c6986
commit f1874c1667
2 changed files with 103 additions and 49 deletions

View File

@ -56,6 +56,7 @@ enum parser_state
DATA_START, /* preparing for data parsing operations */
DATA_TYPE, /* parsing the registry data type */
STRING_DATA, /* parsing REG_SZ data */
DWORD_DATA, /* parsing DWORD data */
SET_VALUE, /* adding a value to the registry */
NB_PARSER_STATES
};
@ -88,6 +89,7 @@ static WCHAR *quoted_value_name_state(struct parser *parser, WCHAR *pos);
static WCHAR *data_start_state(struct parser *parser, WCHAR *pos);
static WCHAR *data_type_state(struct parser *parser, WCHAR *pos);
static WCHAR *string_data_state(struct parser *parser, WCHAR *pos);
static WCHAR *dword_data_state(struct parser *parser, WCHAR *pos);
static WCHAR *set_value_state(struct parser *parser, WCHAR *pos);
static const parser_state_func parser_funcs[NB_PARSER_STATES] =
@ -101,6 +103,7 @@ static const parser_state_func parser_funcs[NB_PARSER_STATES] =
data_start_state, /* DATA_START */
data_type_state, /* DATA_TYPE */
string_data_state, /* STRING_DATA */
dword_data_state, /* DWORD_DATA */
set_value_state, /* SET_VALUE */
};
@ -112,6 +115,37 @@ static inline enum parser_state set_state(struct parser *parser, enum parser_sta
return ret;
}
/******************************************************************************
* Converts a hex representation of a DWORD into a DWORD.
*/
static BOOL convert_hex_to_dword(WCHAR *str, DWORD *dw)
{
WCHAR *p, *end;
int count = 0;
while (*str == ' ' || *str == '\t') str++;
if (!*str) goto error;
p = str;
while (isxdigitW(*p))
{
count++;
p++;
}
if (count > 8) goto error;
end = p;
while (*p == ' ' || *p == '\t') p++;
if (*p && *p != ';') goto error;
*end = 0;
*dw = strtoulW(str, &end, 16);
return TRUE;
error:
return FALSE;
}
/******************************************************************************
* Parses the data type of the registry value being imported and modifies
* the input parameter to skip the string representation of the data type.
@ -271,6 +305,9 @@ static LONG open_key(struct parser *parser, WCHAR *path)
static void free_parser_data(struct parser *parser)
{
if (parser->parse_type == REG_DWORD)
heap_free(parser->data);
parser->data = NULL;
parser->data_size = 0;
}
@ -526,6 +563,8 @@ static WCHAR *data_type_state(struct parser *parser, WCHAR *pos)
set_state(parser, STRING_DATA);
break;
case REG_DWORD:
set_state(parser, DWORD_DATA);
break;
case REG_BINARY: /* all hex data types, including undefined */
default:
set_state(parser, LINE_START);
@ -558,6 +597,27 @@ invalid:
return line;
}
/* handler for parser DWORD_DATA state */
static WCHAR *dword_data_state(struct parser *parser, WCHAR *pos)
{
WCHAR *line = pos;
parser->data = heap_xalloc(sizeof(DWORD));
if (!convert_hex_to_dword(line, parser->data))
goto invalid;
parser->data_size = sizeof(DWORD);
set_state(parser, SET_VALUE);
return line;
invalid:
free_parser_data(parser);
set_state(parser, LINE_START);
return line;
}
/* handler for parser SET_VALUE state */
static WCHAR *set_value_state(struct parser *parser, WCHAR *pos)
{

View File

@ -821,7 +821,7 @@ static void test_import(void)
err = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, KEY_READ, &hkey);
ok(err == ERROR_SUCCESS, "got %d, expected 0\n", err);
todo_wine verify_reg(hkey, "Wine", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "", REG_SZ, test_string, sizeof(test_string), 0);
err = RegCloseKey(hkey);
@ -1040,15 +1040,13 @@ static void test_import(void)
"\"Wine4\"=dword:12345678\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0x782;
todo_wine verify_reg(hkey, "Wine1", REG_DWORD, &dword, sizeof(dword),
TODO_REG_TYPE|TODO_REG_SIZE|TODO_REG_DATA);
verify_reg(hkey, "Wine1", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine2", REG_SZ, "Test Value", 11, 0);
todo_wine verify_reg(hkey, "Wine3", REG_MULTI_SZ, "Line concatenation\0", 20,
TODO_REG_TYPE|TODO_REG_SIZE|TODO_REG_DATA);
verify_reg(hkey, "", REG_SZ, "Test", 5, 0);
dword = 0x12345678;
todo_wine verify_reg(hkey, "Wine4", REG_DWORD, &dword, sizeof(dword),
TODO_REG_TYPE|TODO_REG_SIZE|TODO_REG_DATA);
verify_reg(hkey, "Wine4", REG_DWORD, &dword, sizeof(dword), 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -1066,8 +1064,7 @@ static void test_import(void)
"\"Wine7\"=\"No newline\"", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0x50;
todo_wine verify_reg(hkey, "Wine6", REG_DWORD, &dword, sizeof(dword),
TODO_REG_TYPE|TODO_REG_SIZE|TODO_REG_DATA);
verify_reg(hkey, "Wine6", REG_DWORD, &dword, sizeof(dword), 0);
err = RegQueryValueExA(hkey, "Wine7", NULL, NULL, NULL, NULL);
ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND /* WinXP */),
"got %d, expected 0\n", err);
@ -1095,7 +1092,7 @@ static void test_import(void)
verify_reg(hkey, "Wine11", REG_SZ, "Value 2", 8, 0);
verify_reg_nonexist(hkey, "Wine12");
dword = 0x2040608;
todo_wine verify_reg(hkey, "Wine13", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine13", REG_DWORD, &dword, sizeof(dword), 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -1158,7 +1155,7 @@ static void test_import(void)
verify_reg_nonexist(hkey, "Wine29");
verify_reg_nonexist(hkey, "Wine30");
dword = 0x00000004;
todo_wine verify_reg(hkey, "Wine31", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine31", REG_DWORD, &dword, sizeof(dword), 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -1252,9 +1249,9 @@ static void test_import(void)
"\"Wine32b\"=dword:4444\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0x1;
todo_wine verify_reg(hkey, "Wine32a", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine32a", REG_DWORD, &dword, sizeof(dword), 0);
dword = 0x4444;
todo_wine verify_reg(hkey, "Wine32b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine32b", REG_DWORD, &dword, sizeof(dword), 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -1296,8 +1293,8 @@ static void test_import(void)
"\"Wine36d\"=dword:1234 #5678\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0x1234;
todo_wine verify_reg(hkey, "Wine36a", REG_DWORD, &dword, sizeof(dword), 0);
todo_wine verify_reg(hkey, "Wine36b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine36a", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine36b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg_nonexist(hkey, "Wine36c");
verify_reg_nonexist(hkey, "Wine36d");
@ -1419,7 +1416,7 @@ static void test_import(void)
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg(hkey, "double\"quote", REG_SZ, "valid \"or\" not", 15, 0);
dword = 0x00000008;
todo_wine verify_reg(hkey, "single'quote", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "single'quote", REG_DWORD, &dword, sizeof(dword), 0);
/* Test key name and value name concatenation */
test_import_str("REGEDIT4\n\n"
@ -1747,7 +1744,7 @@ static void test_import(void)
"\"Wine46f\"=hex(0):56,00,61,00,6c,00,75,00,65,00,00,00\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg(hkey, "Wine46a", REG_SZ, "Test Value", 11, 0);
todo_wine verify_reg(hkey, "Wine46b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine46b", REG_DWORD, &dword, sizeof(dword), 0);
todo_wine verify_reg(hkey, "Wine46c", REG_BINARY, hex, 4, 0);
todo_wine verify_reg(hkey, "Wine46d", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
todo_wine verify_reg(hkey, "Wine46e", REG_EXPAND_SZ, "%PATH%", 7, 0);
@ -1763,7 +1760,7 @@ static void test_import(void)
"\"Wine46f\"=- #comment\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
todo_wine verify_reg_nonexist(hkey, "Wine46a");
verify_reg_nonexist(hkey, "Wine46b");
todo_wine verify_reg_nonexist(hkey, "Wine46b");
verify_reg_nonexist(hkey, "Wine46c");
todo_wine verify_reg(hkey, "Wine46d", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
verify_reg_nonexist(hkey, "Wine46e");
@ -1959,15 +1956,15 @@ static void test_import(void)
"\"Wine56j\"=dword:00000008\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg_nonexist(hkey, "Wine56a");
verify_reg_nonexist(hkey, "Wine56b");
todo_wine verify_reg_nonexist(hkey, "Wine56b");
verify_reg_nonexist(hkey, "Wine56c");
verify_reg_nonexist(hkey, "Wine56d");
todo_wine verify_reg_nonexist(hkey, "Wine56d");
verify_reg_nonexist(hkey, "Wine56e");
todo_wine verify_reg(hkey, "Wine56f", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine56f", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg_nonexist(hkey, "Wine56g");
verify_reg_nonexist(hkey, "Wine56h");
todo_wine verify_reg_nonexist(hkey, "Wine56h");
verify_reg_nonexist(hkey, "Wine56i");
todo_wine verify_reg(hkey, "Wine56j", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine56j", REG_DWORD, &dword, sizeof(dword), 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -2500,15 +2497,13 @@ static void test_unicode_import(void)
"\"Wine4\"=dword:12345678\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0x782;
todo_wine verify_reg(hkey, "Wine1", REG_DWORD, &dword, sizeof(dword),
TODO_REG_TYPE|TODO_REG_SIZE|TODO_REG_DATA);
verify_reg(hkey, "Wine1", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine2", REG_SZ, "Test Value", 11, 0);
todo_wine verify_reg(hkey, "Wine3", REG_MULTI_SZ, "Line concatenation\0", 20,
TODO_REG_TYPE|TODO_REG_SIZE|TODO_REG_DATA);
verify_reg(hkey, "", REG_SZ, "Test", 5, 0);
dword = 0x12345678;
todo_wine verify_reg(hkey, "Wine4", REG_DWORD, &dword, sizeof(dword),
TODO_REG_TYPE|TODO_REG_SIZE|TODO_REG_DATA);
verify_reg(hkey, "Wine4", REG_DWORD, &dword, sizeof(dword), 0);
test_import_wstr("\xef\xbb\xbfREGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -2526,8 +2521,7 @@ static void test_unicode_import(void)
"\"Wine7\"=\"No newline\"", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0x50;
todo_wine verify_reg(hkey, "Wine6", REG_DWORD, &dword, sizeof(dword),
TODO_REG_TYPE|TODO_REG_SIZE|TODO_REG_DATA);
verify_reg(hkey, "Wine6", REG_DWORD, &dword, sizeof(dword), 0);
err = RegQueryValueExA(hkey, "Wine7", NULL, NULL, NULL, NULL);
ok(err == ERROR_SUCCESS || broken(err == ERROR_FILE_NOT_FOUND /* WinXP */),
"got %d, expected 0\n", err);
@ -2555,7 +2549,7 @@ static void test_unicode_import(void)
verify_reg(hkey, "Wine11", REG_SZ, "Value 2", 8, 0);
verify_reg_nonexist(hkey, "Wine12");
dword = 0x2040608;
todo_wine verify_reg(hkey, "Wine13", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine13", REG_DWORD, &dword, sizeof(dword), 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -2618,7 +2612,7 @@ static void test_unicode_import(void)
verify_reg_nonexist(hkey, "Wine29");
verify_reg_nonexist(hkey, "Wine30");
dword = 0x00000004;
todo_wine verify_reg(hkey, "Wine31", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine31", REG_DWORD, &dword, sizeof(dword), 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -2626,9 +2620,9 @@ static void test_unicode_import(void)
"\"Wine32b\"=dword:4444\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0x1;
todo_wine verify_reg(hkey, "Wine32a", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine32a", REG_DWORD, &dword, sizeof(dword), 0);
dword = 0x4444;
todo_wine verify_reg(hkey, "Wine32b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine32b", REG_DWORD, &dword, sizeof(dword), 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -2670,8 +2664,8 @@ static void test_unicode_import(void)
"\"Wine36d\"=dword:1234 #5678\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0x1234;
todo_wine verify_reg(hkey, "Wine36a", REG_DWORD, &dword, sizeof(dword), 0);
todo_wine verify_reg(hkey, "Wine36b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine36a", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine36b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg_nonexist(hkey, "Wine36c");
verify_reg_nonexist(hkey, "Wine36d");
@ -2879,7 +2873,7 @@ static void test_unicode_import(void)
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg(hkey, "double\"quote", REG_SZ, "valid \"or\" not", 15, 0);
dword = 0x00000008;
todo_wine verify_reg(hkey, "single'quote", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "single'quote", REG_DWORD, &dword, sizeof(dword), 0);
/* Test key name and value name concatenation */
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
@ -3208,7 +3202,7 @@ static void test_unicode_import(void)
"\"Wine46f\"=hex(0):56,00,61,00,6c,00,75,00,65,00,00,00\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg(hkey, "Wine46a", REG_SZ, "Test Value", 11, 0);
todo_wine verify_reg(hkey, "Wine46b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine46b", REG_DWORD, &dword, sizeof(dword), 0);
todo_wine verify_reg(hkey, "Wine46c", REG_BINARY, hex, 4, 0);
todo_wine verify_reg(hkey, "Wine46d", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
todo_wine verify_reg(hkey, "Wine46e", REG_EXPAND_SZ, "%PATH%", 7, 0);
@ -3224,7 +3218,7 @@ static void test_unicode_import(void)
"\"Wine46f\"=- #comment\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
todo_wine verify_reg_nonexist(hkey, "Wine46a");
verify_reg_nonexist(hkey, "Wine46b");
todo_wine verify_reg_nonexist(hkey, "Wine46b");
verify_reg_nonexist(hkey, "Wine46c");
todo_wine verify_reg(hkey, "Wine46d", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
verify_reg_nonexist(hkey, "Wine46e");
@ -3422,15 +3416,15 @@ static void test_unicode_import(void)
"\"Wine56j\"=dword:00000008\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg_nonexist(hkey, "Wine56a");
verify_reg_nonexist(hkey, "Wine56b");
todo_wine verify_reg_nonexist(hkey, "Wine56b");
verify_reg_nonexist(hkey, "Wine56c");
verify_reg_nonexist(hkey, "Wine56d");
todo_wine verify_reg_nonexist(hkey, "Wine56d");
verify_reg_nonexist(hkey, "Wine56e");
todo_wine verify_reg(hkey, "Wine56f", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine56f", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg_nonexist(hkey, "Wine56g");
verify_reg_nonexist(hkey, "Wine56h");
todo_wine verify_reg_nonexist(hkey, "Wine56h");
verify_reg_nonexist(hkey, "Wine56i");
todo_wine verify_reg(hkey, "Wine56j", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine56j", REG_DWORD, &dword, sizeof(dword), 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -3833,7 +3827,7 @@ static void test_import_with_whitespace(void)
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg(hkey, "Wine4a", REG_SZ, "Tab and four spaces", 20, 0);
dword = 0x112233;
todo_wine verify_reg(hkey, "Wine4b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine4b", REG_DWORD, &dword, sizeof(dword), 0);
todo_wine verify_reg(hkey, "Wine4c", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
test_import_str(" REGEDIT4\n\n"
@ -3880,8 +3874,8 @@ static void test_import_with_whitespace(void)
"\"Wine9b\"=dword:\t\t00000008\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0x00000008;
todo_wine verify_reg(hkey, "Wine9a", REG_DWORD, &dword, sizeof(dword), 0);
todo_wine verify_reg(hkey, "Wine9b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine9a", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine9b", REG_DWORD, &dword, sizeof(dword), 0);
test_import_str("REGEDIT4\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -3893,7 +3887,7 @@ static void test_import_with_whitespace(void)
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\t@\t=\tdword:\t00000008\t\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg(hkey, "", REG_DWORD, &dword, sizeof(DWORD), TODO_REG_TYPE|TODO_REG_SIZE|TODO_REG_DATA);
verify_reg(hkey, "", REG_DWORD, &dword, sizeof(DWORD), 0);
err = RegCloseKey(hkey);
ok(err == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", err);
@ -3980,7 +3974,7 @@ static void test_unicode_import_with_whitespace(void)
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg(hkey, "Wine4a", REG_SZ, "Tab and four spaces", 20, 0);
dword = 0x112233;
todo_wine verify_reg(hkey, "Wine4b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine4b", REG_DWORD, &dword, sizeof(dword), 0);
todo_wine verify_reg(hkey, "Wine4c", REG_MULTI_SZ, "Line concatenation\0", 20, 0);
test_import_wstr("\xef\xbb\xbf Windows Registry Editor Version 5.00\n\n"
@ -4027,8 +4021,8 @@ static void test_unicode_import_with_whitespace(void)
"\"Wine9b\"=dword:\t\t00000008\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
dword = 0x00000008;
todo_wine verify_reg(hkey, "Wine9a", REG_DWORD, &dword, sizeof(dword), 0);
todo_wine verify_reg(hkey, "Wine9b", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine9a", REG_DWORD, &dword, sizeof(dword), 0);
verify_reg(hkey, "Wine9b", REG_DWORD, &dword, sizeof(dword), 0);
test_import_wstr("\xef\xbb\xbfWindows Registry Editor Version 5.00\n\n"
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
@ -4040,7 +4034,7 @@ static void test_unicode_import_with_whitespace(void)
"[HKEY_CURRENT_USER\\" KEY_BASE "]\n"
"\t@\t=\tdword:\t00000008\t\n\n", &r);
todo_wine ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
verify_reg(hkey, "", REG_DWORD, &dword, sizeof(DWORD), TODO_REG_TYPE|TODO_REG_SIZE|TODO_REG_DATA);
verify_reg(hkey, "", REG_DWORD, &dword, sizeof(DWORD), 0);
err = RegCloseKey(hkey);
ok(err == ERROR_SUCCESS, "RegCloseKey failed: got %d, expected 0\n", err);