Commit f5fe9a6c authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

regedit: Allow export_key() to return TRUE.

We don't handle errors in export_registry_data() anyway. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54491
parent b7ae278f
...@@ -500,7 +500,7 @@ static BOOL ExportRegistryFile(HWND hWnd) ...@@ -500,7 +500,7 @@ static BOOL ExportRegistryFile(HWND hWnd)
BOOL result; BOOL result;
result = export_registry_key(ofn.lpstrFile, (LPWSTR)ofn.lCustData, ofn.nFilterIndex); result = export_registry_key(ofn.lpstrFile, (LPWSTR)ofn.lCustData, ofn.nFilterIndex);
if (!result) { if (!result) {
/*printf("Can't open file \"%s\"\n", ofn.lpstrFile);*/ FIXME("Registry export failed.\n");
return FALSE; return FALSE;
} }
} else { } else {
......
...@@ -1328,7 +1328,7 @@ static void export_key_name(FILE *fp, WCHAR *name, BOOL unicode) ...@@ -1328,7 +1328,7 @@ static void export_key_name(FILE *fp, WCHAR *name, BOOL unicode)
#define MAX_SUBKEY_LEN 257 #define MAX_SUBKEY_LEN 257
static int export_registry_data(FILE *fp, HKEY key, WCHAR *path, BOOL unicode) static void export_registry_data(FILE *fp, HKEY key, WCHAR *path, BOOL unicode)
{ {
LONG rc; LONG rc;
DWORD max_value_len = 256, value_len; DWORD max_value_len = 256, value_len;
...@@ -1398,7 +1398,6 @@ static int export_registry_data(FILE *fp, HKEY key, WCHAR *path, BOOL unicode) ...@@ -1398,7 +1398,6 @@ static int export_registry_data(FILE *fp, HKEY key, WCHAR *path, BOOL unicode)
} }
free(subkey_name); free(subkey_name);
return 0;
} }
static FILE *REGPROC_open_export_file(WCHAR *file_name, BOOL unicode) static FILE *REGPROC_open_export_file(WCHAR *file_name, BOOL unicode)
...@@ -1450,7 +1449,6 @@ static BOOL export_key(WCHAR *file_name, WCHAR *path, BOOL unicode) ...@@ -1450,7 +1449,6 @@ static BOOL export_key(WCHAR *file_name, WCHAR *path, BOOL unicode)
HKEY key_class, key; HKEY key_class, key;
WCHAR *subkey; WCHAR *subkey;
FILE *fp; FILE *fp;
BOOL ret;
if (!(key_class = parse_key_name(path, &subkey))) if (!(key_class = parse_key_name(path, &subkey)))
{ {
...@@ -1463,12 +1461,12 @@ static BOOL export_key(WCHAR *file_name, WCHAR *path, BOOL unicode) ...@@ -1463,12 +1461,12 @@ static BOOL export_key(WCHAR *file_name, WCHAR *path, BOOL unicode)
return FALSE; return FALSE;
fp = REGPROC_open_export_file(file_name, unicode); fp = REGPROC_open_export_file(file_name, unicode);
ret = export_registry_data(fp, key, path, unicode); export_registry_data(fp, key, path, unicode);
export_newline(fp, unicode); export_newline(fp, unicode);
fclose(fp); fclose(fp);
RegCloseKey(key); RegCloseKey(key);
return ret; return TRUE;
} }
static BOOL export_all(WCHAR *file_name, WCHAR *path, BOOL unicode) static BOOL export_all(WCHAR *file_name, WCHAR *path, BOOL unicode)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment