Zhiyi Zhang (@zhiyi) commented about dlls/comctl32/tests/listview.c:
+ SendMessageA(hwndListView, LVM_SETITEMTEXTA, i, (LPARAM) &lvi); + } + + SendMessageA(hwndListView, LVM_SORTITEMSEX, (WPARAM) hwndListView, (LPARAM) test_CallBackCompareEx); + + memset(&lvi, 0, sizeof(lvi)); + for (int i = 1; i < 100; i++) + { + ListView_GetItemTextA(hwndListView, i-1, 0, buffer, sizeof(buffer)); + prev_value = atoi(buffer); + + ListView_GetItemTextA(hwndListView, i, 0, buffer, sizeof(buffer)); + + if (atoi(buffer) < prev_value) + { + prev_value = 1; Using a different variable, for example, "sorted", would make it more intuitive.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/6160#note_77410