Commit 32f89093 authored by Alexander Nicolaysen Sørnes's avatar Alexander Nicolaysen Sørnes Committed by Alexandre Julliard

regedit: Convert parts of export handling to unicode.

parent 87a871ef
......@@ -372,11 +372,7 @@ static BOOL ExportRegistryFile(HWND hWnd, BOOL export_branch)
ofn.lpTemplateName = MAKEINTRESOURCEW(IDD_EXPORT_TEMPLATE);
if (GetSaveFileNameW(&ofn)) {
BOOL result;
CHAR* fileA = GetMultiByteString(ofn.lpstrFile);
CHAR* sectionA = GetMultiByteString((LPWSTR)ofn.lCustData);
result = export_registry_key(fileA, sectionA);
HeapFree(GetProcessHeap(), 0, fileA);
HeapFree(GetProcessHeap(), 0, sectionA);
result = export_registry_key(ofn.lpstrFile, (LPWSTR)ofn.lCustData);
if (!result) {
/*printf("Can't open file \"%s\"\n", ofn.lpstrFile);*/
return FALSE;
......
......@@ -196,6 +196,7 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
}
case ACTION_EXPORT: {
CHAR filename[MAX_PATH];
WCHAR* filenameW;
filename[0] = '\0';
get_file_name(&s, filename);
......@@ -205,14 +206,19 @@ static BOOL PerformRegAction(REGEDIT_ACTION action, LPSTR s)
exit(1);
}
filenameW = GetWideString(filename);
if (s[0]) {
CHAR reg_key_name[KEY_MAX_LEN];
WCHAR* reg_key_nameW;
get_file_name(&s, reg_key_name);
export_registry_key(filename, reg_key_name);
reg_key_nameW = GetWideString(reg_key_name);
export_registry_key(filenameW, reg_key_nameW);
HeapFree(GetProcessHeap(), 0, reg_key_nameW);
} else {
export_registry_key(filename, NULL);
export_registry_key(filenameW, NULL);
}
HeapFree(GetProcessHeap(), 0, filenameW);
break;
}
default:
......
......@@ -21,7 +21,7 @@
const CHAR *getAppName(void);
BOOL export_registry_key(CHAR *file_name, CHAR *reg_key_name);
BOOL export_registry_key(WCHAR *file_name, WCHAR *reg_key_name);
BOOL import_registry_file(FILE *in);
void delete_registry_key(WCHAR *reg_key_name);
WCHAR* GetWideString(const char* strA);
......
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