[user32: 2/2] Testcase for font size = 0x7fff

Dmitry Timoshkov dmitry at codeweavers.com
Sat Oct 11 04:30:31 CDT 2008


"Koro" <webmaster at korosoft.net> wrote:

> +static INT_PTR CALLBACK messageBoxFontDlgWinProc (HWND hDlg, UINT uiMsg, WPARAM wParam,
> +        LPARAM lParam)
> +{
> +    return (uiMsg == WM_INITDIALOG);
> +}
> +
> +static void test_MessageBoxFontTest(void)
> +{
> +    /* Define a dialog that sets 0x7fff as font, and define one control. If the
> +     * dialog is created correctly, it means the 0x7fff was skipped correctly. */
> +
> +    static unsigned char test[] =
> +    {
> +        /* 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) */
> +        0x01,0x00,              /* Control count */
> +        0x00,0x00,              /* X */
> +        0x00,0x00,              /* Y */
> +        0x80,0x00,              /* Width */
> +        0x80,0x00,              /* Height */
> +        0x00,0x00,              /* Menu name */
> +        0x00,0x00,              /* Class name */
> +        'T',0x00,'e',0x00,      /* Caption (unicode) */
> +        's',0x00,'t',0x00,
> +        0x00,0x00,
> +        0xff,0x7f,              /* Font height (0x7fff = message box font) */
> +
> +        /* Control #1 */
> +        0x00,0x00,              /* Align to DWORD (header is 42 bytes) */
> +        0x00,0x00,0x00,0x00,    /* Context Help ID */
> +        0x00,0x00,0x00,0x00,    /* Extended style */
> +        0x00,0x00,0x00,0x50,    /* Style (WS_CHILD|WS_VISIBLE) */
> +        0x00,0x00,              /* X */
> +        0x00,0x00,              /* Y */
> +        0x80,0x00,              /* Width */
> +        0x80,0x00,              /* Height */
> +        0xff,0xff,0xff,0xff,    /* Control ID */
> +        0xff,0xff,0x82,0x00,    /* Class (Static) */
> +        'W',0x00,'I',0x00,      /* Caption (unicode) */
> +        'N',0x00,'E',0x00,
> +        ' ',0x00,'d',0x00,
> +        'i',0x00,'a',0x00,
> +        'l',0x00,'o',0x00,
> +        'g',0x00,' ',0x00,
> +        't',0x00,'e',0x00,
> +        's',0x00,'t',0x00,
> +        '.',0x00,0x00,0x00,
> +        0x00,0x00,              /* Size of extended data */
> +
> +        0x00,0x00               /* Align to DWORD */
> +    };
> +
> +    /* Now check if it can be created */
> +    HWND hdlg = CreateDialogIndirectParam(g_hinst, (LPCDLGTEMPLATE)test, NULL, messageBoxFontDlgWinProc, 0);
> +
> +    broken(hdlg == NULL);

Is there a Windows version where CreateDialogIndirectParam fails?

> +    if (hdlg)
> +        ok(IsWindow(hdlg), "dialog with message box font was successfully created");

What exactly this code is supposed to test? So far it doesn't test
anything related to the font size.

-- 
Dmitry.



More information about the wine-devel mailing list