regedit: Read registry lines through a single function
Alexandre Julliard
julliard at winehq.org
Mon May 1 13:39:31 CDT 2017
Hugh McMaster <hugh.mcmaster at outlook.com> writes:
> +static WCHAR *get_line(struct reg_info *reg_info)
> +{
> + WCHAR *line;
> +
> + if (!reg_info->is_unicode)
> + {
> + char *lineA = get_lineA(reg_info->file);
> + line = GetWideString(lineA);
> + }
> + else
> + {
> + line = get_lineW(reg_info->file);
> + }
> +
> + return line;
> +}
That's fairly ugly. If you want to use common code, you should probably
pass a function pointer for getting lines. Also you'd have to do it in a
way that doesn't require freeing the buffer.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list