[PATCH v3 1/6] shell32/autocomplete: Fill and display the auto-suggest listbox in a separate function
Nikolay Sivov
nsivov at codeweavers.com
Sat Oct 27 04:46:56 CDT 2018
On 10/25/2018 09:04 PM, Gabriel Ivăncescu wrote:
> + WCHAR *text;
> + UINT size, len = SendMessageW(hwnd, WM_GETTEXTLENGTH, 0, 0);
> +
> + if (flag != autoappend_flag_displayempty && len == 0)
> + {
> + if (ac->options & ACO_AUTOSUGGEST)
> hide_listbox(ac, ac->hwndListBox);
> + return;
> }
> +
> + size = len + 1;
> + if (!(text = heap_alloc(size * sizeof(WCHAR))))
> + return;
> + len = SendMessageW(hwnd, WM_GETTEXT, size, (LPARAM)text);
> + if (len + 1 != size)
> + text = heap_realloc(text, (len + 1) * sizeof(WCHAR));
Was this tested with some inconsistent WM_GETTEXT implementation? Why do
you need to realloc?
More information about the wine-devel
mailing list