I attach it here now (bzip2'ed for once because of its size). Before submitting to wine-patches, I need some time to review the code once more for remnants of old way of thinking and to get rid of the IS_xxxx_ITEM macro's ( or rename them to reflect the true intention).
Glancing through the patch, I see what you are trying to do, and some comments (and remember this is just from a glance so far)
1. I'm not sure the MENU_SetItemData for the ownerdraw case is correct as it doesn't actually take a copy of the data, it saves the pointer. I'm pretty sure Windows would take a copy (It does when inserting). In fact the ownerdraw code doesn't set text, just dwitemdata in this routine
2. SetMenuItemInfo_common, In the MIIM_TYPE case for ownerdraw - You would lose the dwtypedata value for ownerdraw with text
3. Unrelated but just spotted, GetMenuItemInfo_common doesn't return dwTypeData for ownerdraw what TYPE is used, can we add a test to confirm that?
You tests from 4004.patch2 are included. I just removed the todo_wine{} which is a probably a good sign.
Yeah, the todo was a condition I didn't really care about at the time, but fixing it is good :-)
Thanks Jason