https://bugs.winehq.org/show_bug.cgi?id=42602
Bug ID: 42602 Summary: ::CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct) bad sort compared to Windows Product: Wine Version: 2.3 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: martin@hinner.info Distribution: ---
Let's have this MFC code:
class CIconListBox : public CListBox
...
int CIconListBox::CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct) { CIconListBoxItem *Item1; CIconListBoxItem *Item2;
Item1=(CIconListBoxItem *)lpCompareItemStruct->itemData1; Item2=LastItem;
/* CompateItem is called immediately after AddString which does not contain any info for sorting. Pointer to data is set after AddString by calling SetItemDataPtr. This function thus relies on undocumented fact that Item2 is always last added item. Item1 has correct pointer.. */
//Item2=(CIconListBoxItem *)lpCompareItemStruct->itemData2;
//nejdriv rozhodne priorita if (Item1->m_sortprior>Item2->m_sortprior) return -1; if (Item1->m_sortprior<Item2->m_sortprior) return 1;
if (wcscmp(Item1->m_szItemName,Item2->m_szItemName)>0) return 1; else return -1; }
Result in Windows: sorted OK Result in Wine: reverse sorted.
I can provide app for testing. It is http://obdtester.com/downloads (e.g. BimCOM), password for download upon request by individual e-mail.