Is there a Windows version where CreateDialogIndirectParam fails?
It's not supposed to fail in Windows using the template that is passed to it. But it fails in WINE without my patch.
What exactly this code is supposed to test? So far it doesn't test anything related to the font size.
As I said in part 1 on my patch, there is a "special case" for dialog templates where "font height" is 0x7fff.
Normally, the font specification of dialog template (DIALOGEX) would go like this:
WORD wPoint; // point size WORD wWeight; // font weight BYTE bItalic; // 1 if italic, 0 if not BYTE bCharSet; // character set WCHAR szFontName[]; // variable-length
However, should wPoint happen to be 0x7fff, the four next members "don't exist" anymore, and the dialog should use the message box font. Therefore the next thing that is supposed to be there is the first control definition (DWORD-aligned of course).
WINE failed to take this into account, and, since it read a few bytes too much by trying to read the 4 last members even in the 0x7fff case, it was all off into the dialog template, therefore reading all wrong class names/atoms, etc etc for the rest of the dialog, eventually totally failing to create it.
This test goes to show that (with my patch) WINE now does the right thing and skips them when the font size is 0x7fff, creating a dialog with one static control in it.
I also ran that code on Windows, and, as expected, the dialog and its static control gets created correctly and assigned the message box font.