https://bugs.winehq.org/show_bug.cgi?id=40303
Bug ID: 40303 Summary: Control Data passed in DIALOGEX Resource passes pointer with offset sizeof(WORD) Product: Wine Version: 1.9.5 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 Assignee: wine-bugs@winehq.org Reporter: vendor2013@herdsoft.com Distribution: ---
Created attachment 53942 --> https://bugs.winehq.org/attachment.cgi?id=53942 Sourcecode for a test program
When DIALOGEX Resources contain Custom data like in:
DEFPUSHBUTTON "OK", IDOK, 148, 6, 50, 14 { 1, 2, 3, 4, 5 }
The pointer passed in WM_CREATE is two bytes higher than in windows. In Windows (Tested with Vista an Windows 7 64-Bit) it Points to the Number of Words, in Wine it points to the first data byte.
Microsoft Specs for this stuff are here:
https://msdn.microsoft.com/de-de/library/windows/desktop/ms645389%28v=vs.85%...
Attached file dialogtest.zip is sourcecode for a test program with a simple custom control that displays the passed control data.
Bug is in Version 1.6.2 (Debian Jessie) and 1.9.5 (Last Download).
My suggestion for a patch:
--- wine-1.6.2.orig/dlls/user32/dialog.c +++ wine-1.6.2/dlls/user32/dialog.c @@ -234,7 +234,8 @@ static const WORD *DIALOG_GetControl32( TRACE("\n"); TRACE(" END\n" ); } - info->data = p + 1; + info->data = p; p += GET_WORD(p) / sizeof(WORD); } else info->data = NULL;