Hugh McMaster <hugh.mcmaster(a)outlook.com> wrote:
> -static INT vmessagebox(HWND hwnd, INT buttons, INT titleId, INT resId, va_list ap)
> +static void load_string(unsigned int msg_id, WCHAR *buf, unsigned int count)
> {
> static const WCHAR errorW[] = {'E','r','r','o','r',0};
> - static const WCHAR unknownW[] = {'U','n','k','n','o','w','n',' ','e','r','r','o','r',' ','s','t','r','i','n','g','!',0};
>
> + if (!buf) return;
> +
> + if (!LoadStringW(hInst, msg_id, buf, count))
> + {
> + WINE_FIXME("LoadString failed with %u\n", GetLastError());
> + lstrcpyW(buf, errorW);
> + }
> +}
Probably using a flavour of lstrcpy that checks the target buffer length
would be more appropriate. Although simply returning an empty buffer and
an error indicator to the caller could be slightly better. Under which
conditions LoadString may fail here?
--
Dmitry.