[Bug 27774] VMMap main user interface stuck after process selection dialog (EndDialog doesn't re-enable owners of non-modal dialogs)

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Jan 26 08:16:59 CST 2014


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

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |focht at gmx.net
          Component|-unknown                    |user32
            Summary|VMMap: cannot activate      |VMMap main user interface
                   |window                      |stuck after process
                   |                            |selection dialog (EndDialog
                   |                            |doesn't re-enable owners of
                   |                            |non-modal dialogs)

--- Comment #1 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

confirming, still present.

The app creates a nested, non-modal dialog "Select or Launch Process" during
main window creation to select the process to inspect.
After the dialog is dismissed it gets stuck in the inner message loop for the
non-modal dialog.

Dialog creation:

--- snip ---
...
Wine-dbg>bt

Backtrace:
=>0 0x7ebc9bbe DIALOG_CreateIndirect(hInst=0x400000, dlgTemplate=0x463520,
owner=0x10056, dlgProc=0x41ce38, param=0, unicode=0x1, modal=0)
[/home/focht/projects/wine/wine-git/dlls/user32/dialog.c:486] in user32
(0x0033ea88)

  1 0x7ebcabe6 CreateDialogIndirectParamW+0x4c(hInst=<couldn't compute
location>, dlgTemplate=<couldn't compute location>, owner=<couldn't compute
location>, dlgProc=<couldn't compute location>, param=<couldn't compute
location>) [/home/focht/projects/wine/wine-git/dlls/user32/dialog.c:781] in
user32 (0x0033eab8)

  2 0x7ebcaae3 CreateDialogParamW+0x95(hInst=<couldn't compute location>,
name=<couldn't compute location>, owner=<couldn't compute location>,
dlgProc=<couldn't compute location>, param=<couldn't compute location>)
[/home/focht/projects/wine/wine-git/dlls/user32/dialog.c:752] in user32
(0x0033eb18)

  3 0x0042349f in vmmap (+0x2349e) (0x0033eb68)
  4 0x00424320 in vmmap (+0x2431f) (0x0033eea8)
...
  7 0x7ec4d46f CallWindowProcW+0x69(func=0x4236ed, hwnd=0x10056, msg=0x111,
wParam=0x9c88, lParam=0)
[/home/focht/projects/wine/wine-git/dlls/user32/winproc.c:981] in user32
(0x0033ef5c)

  8 0x00418568 in vmmap (+0x18567) (0x0033ef98)
...
  14 0x7ec0d236 SendMessageW+0x60(hwnd=0x10056, msg=0x111, wparam=0x9c88,
lparam=0) [/home/focht/projects/wine/wine-git/dlls/user32/message.c:3409] in
user32 (0x0033f16c)
  15 0x00424d2b in vmmap (+0x24d2a) (0x0033f4b8)
...
  21 0x7ec0d236 SendMessageW+0x60(hwnd=0x10056, msg=0x110, wparam=0x10060,
lparam=0) [/home/focht/projects/wine/wine-git/dlls/user32/message.c:3409] in
user32 (0x0033f688)

  22 0x7ebca873 DIALOG_CreateIndirect+0xcb4(hInst=0x400000,
dlgTemplate=0x45ff5c, owner=(nil), dlgProc=0x4236ed, param=0, unicode=0x1,
modal=0) [/home/focht/projects/wine/wine-git/dlls/user32/dialog.c:701] in
user32 (0x0033f9c8)
...
  25 0x7ebcaae3 CreateDialogParamW+0x95(hInst=<couldn't compute location>,
name=<couldn't compute location>, owner=<couldn't compute location>,
dlgProc=<couldn't compute location>, param=<couldn't compute location>)
[/home/focht/projects/wine/wine-git/dlls/user32/dialog.c:752] in user32
(0x0033fa88)

  26 0x00425799 in vmmap (+0x25798) (0x0033fd90)
  27 0x00430897 in vmmap (+0x30896) (0x0033fe20)
  28 0x7b863f04 call_process_entry+0xb() in kernel32 (0x0033fe38)
...
--- snip ---

Trace log:

--- snip ---
$ WINEDEBUG=+tid,+seh,+relay,+msg,+win wine ./vmmap.exe >>log.txt 2>&1
...
0024:Call
user32.CreateDialogParamW(00400000,004527d0,00000000,004236ed,00000000)
ret=00425799 
...
0024:trace:win:WIN_CreateWindowEx L"VMMap - Sysinternals: www.sysinternals.com"
L"VmMapClass" ex=00010300 style=84cf085c 672,217 576x627 parent=(nil)
menu=0x1006a inst=0x400000 params=(nil)
0024:trace:win:dump_window_styles style: WS_POPUP WS_CLIPSIBLINGS WS_CAPTION
WS_SYSMENU WS_THICKFRAME WS_MINIMIZEBOX WS_MAXIMIZEBOX 0000085c
0024:trace:win:dump_window_styles exstyle: WS_EX_WINDOWEDGE WS_EX_CLIENTEDGE
WS_EX_CONTROLPARENT 
...
0024:Call
user32.CreateDialogParamW(00400000,004523d0,00010078,0041ce38,00000000)
ret=0042349f 
...
0024:trace:win:WIN_CreateWindowEx L"" #8002 ex=00010000 style=4000045c 75,81
422x281 parent=0x100e8 menu=(nil) inst=0x400000 params=(nil) 
...
0024:trace:win:dump_window_styles style: WS_CHILD 0000045c
...
0024:trace:win:dump_window_styles exstyle: WS_EX_CONTROLPARENT 
...
0024:trace:win:WIN_CreateWindowEx L"Select or Launch Process" #8002 ex=00010000
style=80cc005c 674,238 481x493 parent=0x10078 menu=(nil) inst=0x400000
params=(nil) 
...
0024:trace:win:dump_window_styles style: WS_POPUP WS_CAPTION WS_SYSMENU
WS_THICKFRAME 0000005c 
...
0024:trace:win:dump_window_styles exstyle: WS_EX_CONTROLPARENT
...
0024:Ret  user32.CreateDialogParamW() retval=000100de ret=0042349f
--- snip ---

The app disables input on main window (owner) immediately after dialog
creation:

--- snip ---
0024:Call user32.EnableWindow(00010078,00000000) ret=004234c8
...
0024:Ret  user32.EnableWindow() retval=00000000 ret=004234c8
--- snip ---

and runs a typical message loop:

--- snip ---
0024:Call user32.GetMessageW(0032ea94,00000000,00000000,00000000) ret=004234df
0024:trace:msg:peek_message got type 6 msg f (WM_PAINT) hwnd 0x10078 wp 0 lp 0
0024:Ret  user32.GetMessageW() retval=00000001 ret=004234df
0024:Call user32.TranslateAcceleratorW(000100de,00010120,0032ea94) ret=004234f3
0024:Ret  user32.TranslateAcceleratorW() retval=00000000 ret=004234f3
0024:Call user32.IsDialogMessageW(000100de,0032ea94) ret=00423504
0024:Ret  user32.IsDialogMessageW() retval=00000000 ret=00423504
0024:Call user32.TranslateMessage(0032ea94) ret=00423512
0024:Ret  user32.TranslateMessage() retval=00000000 ret=00423512
0024:Call user32.DispatchMessageW(0032ea94) ret=0042351c 
0024:Ret  user32.DispatchMessageW() retval=00000000 ret=0042351c
0024:Call user32.IsWindowEnabled(00010078) ret=0042351f
0024:Ret  user32.IsWindowEnabled() retval=00000000 ret=0042351f 
--- snip ---

The only exit paths from this message loop are either GetMessage() returning
zero (WM_QUIT) or IsWindowEnabled( mainwnd) returning non-zero.

The app calls EndDialog() when the process selection is done ('ok' button
clicked):

--- snip ---
...
0024:Call user32.EndDialog(000100de,00000000) ret=0041cfac 
...
0024:trace:msg:PostMessageW hwnd 0x100de msg 0 (WM_NULL) wp 0 lp 0
0024:Ret  user32.EndDialog() retval=00000001 ret=0041cfac 
...
--- snip ---

The problem is that Wine doesn't re-enable input in EndDialog() on owner (main
window), for non-modal dialogs hence the inner message loop is never left.

Source:
http://source.winehq.org/git/wine.git/blob/1e5328c77c861e163081b5e084b648bc6f6a72e8:/dlls/user32/dialog.c#l918

--- snip ---
918 BOOL WINAPI EndDialog( HWND hwnd, INT_PTR retval )
919 {
920     BOOL wasEnabled = TRUE;
921     DIALOGINFO * dlgInfo;
922     HWND owner;
923
924     TRACE("%p %ld\n", hwnd, retval );
925
926     if (!(dlgInfo = DIALOG_get_info( hwnd, FALSE )))
927     {
928         ERR("got invalid window handle (%p); buggy app !?\n", hwnd);
929         return FALSE;
930     }
931     dlgInfo->idResult = retval;
932     dlgInfo->flags |= DF_END;
933     wasEnabled = (dlgInfo->flags & DF_OWNERENABLED);
934
935     owner = GetWindow( hwnd, GW_OWNER );
936     if (wasEnabled && owner)
937         DIALOG_EnableOwner( owner );
938
939     /* Windows sets the focus to the dialog itself in EndDialog */
...
961     /* unblock dialog loop */
962     PostMessageA(hwnd, WM_NULL, 0, 0);
963     return TRUE;
964 }
--- snip ---

I tested a small fix (re-enabling owners for non-modal case) and the main gui
became fully functional.

$ sha1sum VMMap.zip 
0266275308a6daccabdf5cc8689d7faf8b7be8bd  VMMap.zip

$ du -sh VMMap.zip 
552K    VMMap.zip

$ wine --version
wine-1.7.11-159-gee33839

Regards

-- 
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