Koro wrote:
This is the second try for my testcase that shows a discrepancy between Wine and Windows' handling of dialog templates in the specific case where the font size member is set to 0x7fff.
- static unsigned char dlgTemplate[] =
- {
/* Dialog header */
0x01,0x00, /* Version */
0xff,0xff, /* Extended template marker */
0x00,0x00,0x00,0x00, /* Context Help ID */
0x00,0x00,0x00,0x00, /* Extended style */
0xc0,0x00,0xc8,0x80, /* Style (WS_SYSMENU|WS_CAPTION|WS_POPUP|DS_SETFONT|DS_MODALFRAME) */
Why don't you add this to the resource file?
- hDlg = CreateDialogIndirectParamW(g_hinst, (LPCDLGTEMPLATE)dlgTemplate, NULL, messageBoxFontDlgWinProc, 0);
- if (!hDlg)
- {
todo_wine win_skip("dialog wasn't created\n");
This is wrong. It shouldn't be todo_wine. If you properly put template into resources you can use CreateDialogIndirectParamA
Vitaliy.
Why don't you add this to the resource file?
Because this dialog template does not declare the weight, italic, charset and fontname members, due to the font size being 0x7fff and therefore interpreted "specially". AFAIK, wrc probably wouldn't be able to generate such a template, the MS RC compiler sure can't.
Therefore the need to specify the exact raw binary data, which is quite the point of this testcase anyway, to prove Wine handles it wrong.
This is wrong. It shouldn't be todo_wine. If you properly put template into resources you can use CreateDialogIndirectParamA
There is a reason I use CreateDialogIndirectParamW. The dialog template, when passed to CreateDialogIndirectParamA on Windows 98 or ME, just crashes deep into USER.EXE.
So I use the W-call here for a very specific reason, to get it to fail on Win9x, since W-calls aren't implemented thereĀ. So the only cases when this might return NULL are:
- Running on Win9x (unimplemented) - Running on Wine (Wine does not properly parse the template because of the 0x7fff, tries to read weight, italic, charset and fontname and is totally wrongly offset for the rest of the template, causing it to fail creation of the control, therefore aborting dialog creation and returning NULL)
So, in order to cover these two cases, I use todo_wine win_skip. win_skip by itself registers as a skip on Windows, an error on Wine, but the todo_wine changes it to a mere todo. (My patch to fix it will come after this one has been accepted.)
Hope this clears that up. - Koro