27 Oct
2018
27 Oct
'18
4:46 a.m.
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?