Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/reg/add.c | 8 ++++---- programs/reg/delete.c | 2 +- programs/reg/export.c | 20 ++++++++++---------- programs/reg/import.c | 16 ++++++++-------- programs/reg/query.c | 20 ++++++++++---------- programs/reg/reg.c | 19 ++++--------------- programs/reg/reg.h | 1 - 7 files changed, 37 insertions(+), 49 deletions(-)
diff --git a/programs/reg/add.c b/programs/reg/add.c index 054023df7ab..6d32e86c09a 100644 --- a/programs/reg/add.c +++ b/programs/reg/add.c @@ -64,7 +64,7 @@ static LPBYTE get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator, DW case REG_EXPAND_SZ: { *reg_count = (lstrlenW(data) + 1) * sizeof(WCHAR); - out_data = heap_xalloc(*reg_count); + out_data = heap_alloc(*reg_count); lstrcpyW((LPWSTR)out_data,data); break; } @@ -80,7 +80,7 @@ static LPBYTE get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator, DW break; } *reg_count = sizeof(DWORD); - out_data = heap_xalloc(*reg_count); + out_data = heap_alloc(*reg_count); ((LPDWORD)out_data)[0] = val; break; } @@ -89,7 +89,7 @@ static LPBYTE get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator, DW BYTE hex0, hex1; int i = 0, destByteIndex = 0, datalen = lstrlenW(data); *reg_count = ((datalen + datalen % 2) / 2) * sizeof(BYTE); - out_data = heap_xalloc(*reg_count); + out_data = heap_alloc(*reg_count); if(datalen % 2) { hex1 = hexchar_to_byte(data[i++]); @@ -116,7 +116,7 @@ static LPBYTE get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator, DW case REG_MULTI_SZ: { int i, destindex, len = lstrlenW(data); - WCHAR *buffer = heap_xalloc((len + 2) * sizeof(WCHAR)); + WCHAR *buffer = heap_alloc((len + 2) * sizeof(WCHAR));
for (i = 0, destindex = 0; i < len; i++, destindex++) { diff --git a/programs/reg/delete.c b/programs/reg/delete.c index e0730e5c12f..5aa84eed5b1 100644 --- a/programs/reg/delete.c +++ b/programs/reg/delete.c @@ -65,7 +65,7 @@ int reg_delete(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name, WCHAR *value_name; LONG rc;
- value_name = heap_xalloc(max_value_len * sizeof(WCHAR)); + value_name = heap_alloc(max_value_len * sizeof(WCHAR));
while (1) { diff --git a/programs/reg/export.c b/programs/reg/export.c index 8ce1945a693..10d3ca75eb4 100644 --- a/programs/reg/export.c +++ b/programs/reg/export.c @@ -42,7 +42,7 @@ static WCHAR *escape_string(WCHAR *str, size_t str_len, size_t *line_len) escape_count++; }
- buf = heap_xalloc((str_len + escape_count + 1) * sizeof(WCHAR)); + buf = heap_alloc((str_len + escape_count + 1) * sizeof(WCHAR));
for (i = 0, pos = 0; i < str_len; i++, pos++) { @@ -87,7 +87,7 @@ static size_t export_value_name(HANDLE hFile, WCHAR *name, size_t len) if (name && *name) { WCHAR *str = escape_string(name, len, &line_len); - WCHAR *buf = heap_xalloc((line_len + 4) * sizeof(WCHAR)); + WCHAR *buf = heap_alloc((line_len + 4) * sizeof(WCHAR)); line_len = swprintf(buf, line_len + 4, quoted_fmt, str); write_file(hFile, buf); heap_free(buf); @@ -111,7 +111,7 @@ static void export_string_data(WCHAR **buf, WCHAR *data, size_t size) if (size) len = size / sizeof(WCHAR) - 1; str = escape_string(data, len, &line_len); - *buf = heap_xalloc((line_len + 3) * sizeof(WCHAR)); + *buf = heap_alloc((line_len + 3) * sizeof(WCHAR)); swprintf(*buf, line_len + 3, fmt, str); heap_free(str); } @@ -120,7 +120,7 @@ static void export_dword_data(WCHAR **buf, DWORD *data) { static const WCHAR fmt[] = {'d','w','o','r','d',':','%','0','8','x',0};
- *buf = heap_xalloc(15 * sizeof(WCHAR)); + *buf = heap_alloc(15 * sizeof(WCHAR)); swprintf(*buf, 15, fmt, *data); }
@@ -137,7 +137,7 @@ static size_t export_hex_data_type(HANDLE hFile, DWORD type) } else { - WCHAR *buf = heap_xalloc(15 * sizeof(WCHAR)); + WCHAR *buf = heap_alloc(15 * sizeof(WCHAR)); line_len = swprintf(buf, 15, hexp_fmt, type); write_file(hFile, buf); heap_free(buf); @@ -160,7 +160,7 @@ static void export_hex_data(HANDLE hFile, WCHAR **buf, DWORD type, if (!size) return;
num_commas = size - 1; - *buf = heap_xalloc(size * 3 * sizeof(WCHAR)); + *buf = heap_alloc(size * 3 * sizeof(WCHAR));
for (i = 0, pos = 0; i < size; i++) { @@ -228,7 +228,7 @@ static void export_key_name(HANDLE hFile, WCHAR *name) static const WCHAR fmt[] = {'\r','\n','[','%','s',']','\r','\n',0}; WCHAR *buf;
- buf = heap_xalloc((lstrlenW(name) + 7) * sizeof(WCHAR)); + buf = heap_alloc((lstrlenW(name) + 7) * sizeof(WCHAR)); swprintf(buf, lstrlenW(name) + 7, fmt, name); write_file(hFile, buf); heap_free(buf); @@ -247,8 +247,8 @@ static int export_registry_data(HANDLE hFile, HKEY key, WCHAR *path)
export_key_name(hFile, path);
- value_name = heap_xalloc(max_value_len * sizeof(WCHAR)); - data = heap_xalloc(max_data_bytes); + value_name = heap_alloc(max_value_len * sizeof(WCHAR)); + data = heap_alloc(max_data_bytes);
i = 0; for (;;) @@ -281,7 +281,7 @@ static int export_registry_data(HANDLE hFile, HKEY key, WCHAR *path) heap_free(data); heap_free(value_name);
- subkey_name = heap_xalloc(MAX_SUBKEY_LEN * sizeof(WCHAR)); + subkey_name = heap_alloc(MAX_SUBKEY_LEN * sizeof(WCHAR));
path_len = lstrlenW(path);
diff --git a/programs/reg/import.c b/programs/reg/import.c index 13e54e6a69a..9bcc8b63421 100644 --- a/programs/reg/import.c +++ b/programs/reg/import.c @@ -31,7 +31,7 @@ static WCHAR *GetWideString(const char *strA) WCHAR *strW; int len = MultiByteToWideChar(CP_ACP, 0, strA, -1, NULL, 0);
- strW = heap_xalloc(len * sizeof(WCHAR)); + strW = heap_alloc(len * sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, strA, -1, strW, len); return strW; } @@ -45,7 +45,7 @@ static WCHAR *GetWideStringN(const char *strA, int size, DWORD *len) WCHAR *strW; *len = MultiByteToWideChar(CP_ACP, 0, strA, size, NULL, 0);
- strW = heap_xalloc(*len * sizeof(WCHAR)); + strW = heap_alloc(*len * sizeof(WCHAR)); MultiByteToWideChar(CP_ACP, 0, strA, size, strW, *len); return strW; } @@ -383,7 +383,7 @@ static LONG open_key(struct parser *parser, WCHAR *path)
if (res == ERROR_SUCCESS) { - parser->key_name = heap_xalloc((lstrlenW(path) + 1) * sizeof(WCHAR)); + parser->key_name = heap_alloc((lstrlenW(path) + 1) * sizeof(WCHAR)); lstrcpyW(parser->key_name, path); } else @@ -482,7 +482,7 @@ static WCHAR *header_state(struct parser *parser, WCHAR *pos)
if (!parser->is_unicode) { - header = heap_xalloc((lstrlenW(line) + 3) * sizeof(WCHAR)); + header = heap_alloc((lstrlenW(line) + 3) * sizeof(WCHAR)); header[0] = parser->two_wchars[0]; header[1] = parser->two_wchars[1]; lstrcpyW(header + 2, line); @@ -646,7 +646,7 @@ static WCHAR *quoted_value_name_state(struct parser *parser, WCHAR *pos) goto invalid;
/* copy the value name in case we need to parse multiple lines and the buffer is overwritten */ - parser->value_name = heap_xalloc((lstrlenW(val_name) + 1) * sizeof(WCHAR)); + parser->value_name = heap_alloc((lstrlenW(val_name) + 1) * sizeof(WCHAR)); lstrcpyW(parser->value_name, val_name);
set_state(parser, DATA_START); @@ -757,7 +757,7 @@ static WCHAR *dword_data_state(struct parser *parser, WCHAR *pos) { WCHAR *line = pos;
- parser->data = heap_xalloc(sizeof(DWORD)); + parser->data = heap_alloc(sizeof(DWORD));
if (!convert_hex_to_dword(line, parser->data)) goto invalid; @@ -886,7 +886,7 @@ static WCHAR *get_lineA(FILE *fp) if (!size) { size = REG_VAL_BUF_SIZE; - buf = heap_xalloc(size); + buf = heap_alloc(size); *buf = 0; next = buf; } @@ -941,7 +941,7 @@ static WCHAR *get_lineW(FILE *fp) if (!size) { size = REG_VAL_BUF_SIZE; - buf = heap_xalloc(size * sizeof(WCHAR)); + buf = heap_alloc(size * sizeof(WCHAR)); *buf = 0; next = buf; } diff --git a/programs/reg/query.c b/programs/reg/query.c index b24edb2f0b2..0c1432d4e2d 100644 --- a/programs/reg/query.c +++ b/programs/reg/query.c @@ -41,7 +41,7 @@ static WCHAR *reg_data_to_wchar(DWORD type, const BYTE *src, DWORD size_bytes) { case REG_SZ: case REG_EXPAND_SZ: - buffer = heap_xalloc(size_bytes); + buffer = heap_alloc(size_bytes); lstrcpyW(buffer, (WCHAR *)src); break; case REG_NONE: @@ -50,7 +50,7 @@ static WCHAR *reg_data_to_wchar(DWORD type, const BYTE *src, DWORD size_bytes) WCHAR *ptr; static const WCHAR fmt[] = {'%','0','2','X',0};
- buffer = heap_xalloc((size_bytes * 2 + 1) * sizeof(WCHAR)); + buffer = heap_alloc((size_bytes * 2 + 1) * sizeof(WCHAR)); ptr = buffer; for (i = 0; i < size_bytes; i++) ptr += swprintf(ptr, 3, fmt, src[i]); @@ -63,7 +63,7 @@ static WCHAR *reg_data_to_wchar(DWORD type, const BYTE *src, DWORD size_bytes) const int zero_x_dword = 10; static const WCHAR fmt[] = {'0','x','%','x',0};
- buffer = heap_xalloc((zero_x_dword + 1) * sizeof(WCHAR)); + buffer = heap_alloc((zero_x_dword + 1) * sizeof(WCHAR)); swprintf(buffer, zero_x_dword + 1, fmt, *(DWORD *)src); break; } @@ -76,13 +76,13 @@ static WCHAR *reg_data_to_wchar(DWORD type, const BYTE *src, DWORD size_bytes)
if (size_bytes <= two_wchars) { - buffer = heap_xalloc(sizeof(WCHAR)); + buffer = heap_alloc(sizeof(WCHAR)); *buffer = 0; return buffer; }
tmp_size = size_bytes - two_wchars; /* exclude both null terminators */ - buffer = heap_xalloc(tmp_size * 2 + sizeof(WCHAR)); + buffer = heap_alloc(tmp_size * 2 + sizeof(WCHAR)); len = tmp_size / sizeof(WCHAR);
for (i = 0, destindex = 0; i < len; i++, destindex++) @@ -146,7 +146,7 @@ static int query_value(HKEY key, WCHAR *value_name, WCHAR *path, BOOL recurse) WCHAR *subkey_name, *subkey_path; HKEY subkey;
- data = heap_xalloc(max_data_bytes); + data = heap_alloc(max_data_bytes);
for (;;) { @@ -185,7 +185,7 @@ static int query_value(HKEY key, WCHAR *value_name, WCHAR *path, BOOL recurse) return 0; }
- subkey_name = heap_xalloc(MAX_SUBKEY_LEN * sizeof(WCHAR)); + subkey_name = heap_alloc(MAX_SUBKEY_LEN * sizeof(WCHAR));
path_len = lstrlenW(path);
@@ -227,8 +227,8 @@ static int query_all(HKEY key, WCHAR *path, BOOL recurse)
output_string(fmt, path);
- value_name = heap_xalloc(max_value_len * sizeof(WCHAR)); - data = heap_xalloc(max_data_bytes); + value_name = heap_alloc(max_value_len * sizeof(WCHAR)); + data = heap_alloc(max_data_bytes);
i = 0; for (;;) @@ -263,7 +263,7 @@ static int query_all(HKEY key, WCHAR *path, BOOL recurse) if (i || recurse) output_string(newlineW);
- subkey_name = heap_xalloc(MAX_SUBKEY_LEN * sizeof(WCHAR)); + subkey_name = heap_alloc(MAX_SUBKEY_LEN * sizeof(WCHAR));
path_len = lstrlenW(path);
diff --git a/programs/reg/reg.c b/programs/reg/reg.c index 309d855e996..3c8971d4e2a 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c @@ -69,17 +69,6 @@ const struct reg_type_rels type_rels[] = {REG_MULTI_SZ, type_multi_sz}, };
-void *heap_xalloc(size_t size) -{ - void *buf = heap_alloc(size); - if (!buf) - { - ERR("Out of memory!\n"); - exit(1); - } - return buf; -} - void *heap_xrealloc(void *buf, size_t size) { void *new_buf = heap_realloc(buf, size); @@ -108,7 +97,7 @@ void output_writeconsole(const WCHAR *str, DWORD wlen) * one in that case. */ len = WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, NULL, 0, NULL, NULL); - msgA = heap_xalloc(len); + msgA = heap_alloc(len);
WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, msgA, len, NULL, NULL); WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE); @@ -233,7 +222,7 @@ WCHAR *build_subkey_path(WCHAR *path, DWORD path_len, WCHAR *subkey_name, DWORD WCHAR *subkey_path; static const WCHAR fmt[] = {'%','s','\','%','s',0};
- subkey_path = heap_xalloc((path_len + subkey_len + 2) * sizeof(WCHAR)); + subkey_path = heap_alloc((path_len + subkey_len + 2) * sizeof(WCHAR)); swprintf(subkey_path, path_len + subkey_len + 2, fmt, path, subkey_name);
return subkey_path; @@ -255,13 +244,13 @@ static WCHAR *get_long_key(HKEY root, WCHAR *path)
if (!path) { - long_key = heap_xalloc((len + 1) * sizeof(WCHAR)); + long_key = heap_alloc((len + 1) * sizeof(WCHAR)); lstrcpyW(long_key, root_rels[i].long_name); return long_key; }
len += lstrlenW(path) + 1; /* add one for the backslash */ - long_key = heap_xalloc((len + 1) * sizeof(WCHAR)); + long_key = heap_alloc((len + 1) * sizeof(WCHAR)); swprintf(long_key, len + 1, fmt, root_rels[i].long_name, path); return long_key; } diff --git a/programs/reg/reg.h b/programs/reg/reg.h index 83bcf516297..280c0654109 100644 --- a/programs/reg/reg.h +++ b/programs/reg/reg.h @@ -33,7 +33,6 @@ struct reg_type_rels {
extern const struct reg_type_rels type_rels[8];
-void *heap_xalloc(size_t size); void *heap_xrealloc(void *buf, size_t size); void output_writeconsole(const WCHAR *str, DWORD wlen); void WINAPIV output_message(unsigned int id, ...);
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/reg/delete.c | 2 +- programs/reg/export.c | 4 ++-- programs/reg/import.c | 6 +++--- programs/reg/query.c | 6 +++--- programs/reg/reg.c | 13 ------------- programs/reg/reg.h | 1 - 6 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/programs/reg/delete.c b/programs/reg/delete.c index 5aa84eed5b1..0927705a2e2 100644 --- a/programs/reg/delete.c +++ b/programs/reg/delete.c @@ -85,7 +85,7 @@ int reg_delete(HKEY root, WCHAR *path, WCHAR *key_name, WCHAR *value_name, else if (rc == ERROR_MORE_DATA) { max_value_len *= 2; - value_name = heap_xrealloc(value_name, max_value_len * sizeof(WCHAR)); + value_name = heap_realloc(value_name, max_value_len * sizeof(WCHAR)); } else break; } diff --git a/programs/reg/export.c b/programs/reg/export.c index 10d3ca75eb4..36b866a0d4c 100644 --- a/programs/reg/export.c +++ b/programs/reg/export.c @@ -267,12 +267,12 @@ static int export_registry_data(HANDLE hFile, HKEY key, WCHAR *path) if (data_size > max_data_bytes) { max_data_bytes = data_size; - data = heap_xrealloc(data, max_data_bytes); + data = heap_realloc(data, max_data_bytes); } else { max_value_len *= 2; - value_name = heap_xrealloc(value_name, max_value_len * sizeof(WCHAR)); + value_name = heap_realloc(value_name, max_value_len * sizeof(WCHAR)); } } else break; diff --git a/programs/reg/import.c b/programs/reg/import.c index 9bcc8b63421..22babb189f1 100644 --- a/programs/reg/import.c +++ b/programs/reg/import.c @@ -192,7 +192,7 @@ static BOOL convert_hex_csv_to_hex(struct parser *parser, WCHAR **str)
/* The worst case is 1 digit + 1 comma per byte */ size = ((lstrlenW(*str) + 1) / 2) + parser->data_size; - parser->data = heap_xrealloc(parser->data, size); + parser->data = heap_realloc(parser->data, size);
s = *str; d = (BYTE *)parser->data + parser->data_size; @@ -903,7 +903,7 @@ static WCHAR *get_lineA(FILE *fp) if (size - len < 3) { size *= 2; - buf = heap_xrealloc(buf, size); + buf = heap_realloc(buf, size); } if (!(count = fread(buf + len, 1, size - len - 1, fp))) { @@ -959,7 +959,7 @@ static WCHAR *get_lineW(FILE *fp) if (size - len < 3) { size *= 2; - buf = heap_xrealloc(buf, size * sizeof(WCHAR)); + buf = heap_realloc(buf, size * sizeof(WCHAR)); } if (!(count = fread(buf + len, sizeof(WCHAR), size - len - 1, fp))) { diff --git a/programs/reg/query.c b/programs/reg/query.c index 0c1432d4e2d..26f88968b97 100644 --- a/programs/reg/query.c +++ b/programs/reg/query.c @@ -155,7 +155,7 @@ static int query_value(HKEY key, WCHAR *value_name, WCHAR *path, BOOL recurse) if (rc == ERROR_MORE_DATA) { max_data_bytes = data_size; - data = heap_xrealloc(data, max_data_bytes); + data = heap_realloc(data, max_data_bytes); } else break; } @@ -246,12 +246,12 @@ static int query_all(HKEY key, WCHAR *path, BOOL recurse) if (data_size > max_data_bytes) { max_data_bytes = data_size; - data = heap_xrealloc(data, max_data_bytes); + data = heap_realloc(data, max_data_bytes); } else { max_value_len *= 2; - value_name = heap_xrealloc(value_name, max_value_len * sizeof(WCHAR)); + value_name = heap_realloc(value_name, max_value_len * sizeof(WCHAR)); } } else break; diff --git a/programs/reg/reg.c b/programs/reg/reg.c index 3c8971d4e2a..cb24d9552f5 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c @@ -69,19 +69,6 @@ const struct reg_type_rels type_rels[] = {REG_MULTI_SZ, type_multi_sz}, };
-void *heap_xrealloc(void *buf, size_t size) -{ - void *new_buf = heap_realloc(buf, size); - - if (!new_buf) - { - ERR("Out of memory!\n"); - exit(1); - } - - return new_buf; -} - void output_writeconsole(const WCHAR *str, DWORD wlen) { DWORD count, ret; diff --git a/programs/reg/reg.h b/programs/reg/reg.h index 280c0654109..7137bd7bef6 100644 --- a/programs/reg/reg.h +++ b/programs/reg/reg.h @@ -33,7 +33,6 @@ struct reg_type_rels {
extern const struct reg_type_rels type_rels[8];
-void *heap_xrealloc(void *buf, size_t size); void output_writeconsole(const WCHAR *str, DWORD wlen); void WINAPIV output_message(unsigned int id, ...); void WINAPIV output_string(const WCHAR *fmt, ...);
Signed-off-by: Hugh McMaster hugh.mcmaster@outlook.com --- programs/reg/tests/add.c | 6 ++++++ programs/reg/tests/delete.c | 9 +++++++++ programs/reg/tests/query.c | 3 +++ 3 files changed, 18 insertions(+)
diff --git a/programs/reg/tests/add.c b/programs/reg/tests/add.c index 6d513f14fbd..8b6f234c6d0 100644 --- a/programs/reg/tests/add.c +++ b/programs/reg/tests/add.c @@ -233,6 +233,9 @@ static void test_add(void) run_reg_exe("reg add HKCU\" KEY_BASE " /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r);
+ run_reg_exe("reg add HKCU\" KEY_BASE " /f /f", &r); + todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + open_key(HKEY_CURRENT_USER, KEY_BASE, 0, &hkey);
/* Test empty type */ @@ -291,6 +294,9 @@ static void test_add(void) ok(r == REG_EXIT_SUCCESS, "got exit code %u, expected 0\n", r); verify_reg(hkey, NULL, REG_SZ, "", 1, 0);
+ run_reg_exe("reg add HKCU\" KEY_BASE " /ve /f /ve", &r); + todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + run_reg_exe("reg add HKEY_CURRENT_USER\" KEY_BASE " /ve /d WineTEST /f", &r); ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); verify_reg(hkey, "", REG_SZ, "WineTEST", 9, 0); diff --git a/programs/reg/tests/delete.c b/programs/reg/tests/delete.c index ee2257d42c5..77d95d013c9 100644 --- a/programs/reg/tests/delete.c +++ b/programs/reg/tests/delete.c @@ -47,9 +47,18 @@ static void test_delete(void) run_reg_exe("reg delete HKCU\" KEY_BASE " /v Wine /va", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+ run_reg_exe("reg delete HKCU\" KEY_BASE " /ve /ve", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + run_reg_exe("reg delete HKCU\" KEY_BASE " /ve /va", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
+ run_reg_exe("reg delete HKCU\" KEY_BASE " /va /va", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + run_reg_exe("reg delete HKCU\" KEY_BASE " /v Test /ve /va", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + run_reg_exe("reg delete HKCU\" KEY_BASE " /v Wine /v Test /f", &r); ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
diff --git a/programs/reg/tests/query.c b/programs/reg/tests/query.c index afa655f8d74..26629da3f67 100644 --- a/programs/reg/tests/query.c +++ b/programs/reg/tests/query.c @@ -48,6 +48,9 @@ static void test_query(void) /* Create a test key */ add_key(HKEY_CURRENT_USER, KEY_BASE, &key);
+ run_reg_exe("reg query HKCU\" KEY_BASE " /s /s", &r); + todo_wine ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + run_reg_exe("reg query HKCU\" KEY_BASE " /ve", &r); ok(r == REG_EXIT_SUCCESS || broken(r == REG_EXIT_FAILURE /* WinXP */), "got exit code %d, expected 0\n", r);
For what it's worth, it's possible now to use malloc() in PE modules; you may find that preferable.