[Bug 36514] King's Quest: Mask of Eternity requires MCIWndCreate to create a child window when parent is specified

wine-bugs at winehq.org wine-bugs at winehq.org
Fri Dec 11 14:09:05 CST 2015


https://bugs.winehq.org/show_bug.cgi?id=36514

--- Comment #7 from Nico Bendlin <nico at nicode.net> ---
The proposed patch in Comment #5 breaks the compatibility with Windows
(invisible MCI window):

;
; old (MCIWNDF_NOPLAYBAR)
;
; 8B 84 24 B8 00 00 00   mov     eax, [esp+000000B8h]
; 8B 4C 24 10            mov     ecx, [esp+10h]
; 8B 54 24 1C            mov     edx, [esp+1Ch]
; 50                     push    eax ; szFile
; 6A 02                  push    02h ; dwStyle
; 51                     push    ecx ; hInstance
; 52                     push    edx ; hwndParent
; E8 __ __ __ __         call    MCIWndCreateA
;
8B 84 24 B8 00 00 00 8B 4C 24 10 8B 54 24 1C 50 6A 02 51 52 E8
;
; new (WS_VISIBLE | WS_CHILD | WS_BORDER | MCIWNDF_NOPLAYBAR)
;
; FF B4 24 B8 00 00 00    push    dword ptr [esp+000000B8h] ; szFile
; 68 02 00 80 50          push    50800002h                 ; dwStyle
; FF 74 24 18             push    dword ptr [esp+18h]       ; hInstance
; FF 74 24 28             push    dword ptr [esp+28h]       ; hwndParent
; E8 __ __ __ __          call    MCIWndCreateA
;
FF B4 24 B8 00 00 00 68 02 00 80 50 FF 74 24 18 FF 74 24 28 E8


The original implementation of the API does not add WS_VISIBLE if any WS_* is
specified:

HWND VFWAPIV MCIWndCreate(HWND hwndParent, HINSTANCE hInstance, DWORD dwStyle,
LPCTSTR szFile)
{
    int Y = 0;
    int X = 0;
    HMENU hMenu = NULL;
    if (!MCIWndRegisterClass())
        return (NULL);
    if (NULL == hInstance)
        hInstance = GetModuleHandle(NULL);
    if (!HIWORD(dwStyle)) {  /* only MCIWNDF_Xxx, no WS_Xxx */
        if (hwndParent)
            dwStyle |= WS_VISIBLE | WS_CHILD | WS_BORDER;
        else
            dwStyle |= WS_VISIBLE | WS_OVERLAPPEDWINDOW;
    }
    dwStyle |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
    if ((NULL == hwndParent) && !(WS_POPUP & dwStyle)) {
        X = CW_USEDEFAULT;
        if (WS_VISIBLE & dwStyle)
            Y = 5;
    }
    if (WS_CHILD & dwStyle)
        hMenu = (HMENU)66;  /* child-window identifier */
    return (CreateWindowEx(0, MCIWND_WINDOW_CLASS, TEXT(""), dwStyle,
        X, Y, 300, 0, hwndParent, hMenu, hInstance, szFile));
}

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list