http://bugs.winehq.org/show_bug.cgi?id=1517
------- Additional Comments From focht@gmx.net 2007-04-06 10:35 ------- Created an attachment (id=6607) --> (http://bugs.winehq.org/attachment.cgi?id=6607&action=view) Edit control auto scroll endless loop
Hello,
some random pick...
I downloaded the latest version (ARCHPR version 3.01 build 7), wine 0.9.38. The application is protected by ASprotect 2.x but that isn't the showstopper here. After unwrapping the protected executable it seems to boil down to EDIT control issue.
Attached is relevant WINEDEBUG=+seh,+tid,+relay,+win,+msg,+edit snippet
The application locks up while "auto scrolling" - after inserting text into multiline edit control. The target window/control is a plain EDIT control. Offending application code basically goes like this:
--- snip pseudo code --- LRESULT result = 0; do { result = SendMessage(hwnd, EM_SCROLL, SB_PAGEDOWN, 0); } while (HIWORD(result) == TRUE); --- snip pseudo code ---
--- snip dlls/user32/edit.c --- static LRESULT EDIT_EM_Scroll(EDITSTATE *es, INT action) { ... return MAKELONG((INT16)dy, (BOOL16)TRUE);
} --- snip dlls/user32/edit.c ---
Windows returns 0x0 on first call. Wine returns 0x0001fffe which is: (low) dy = 0xFFFE (-2) and (high) TRUE = 0x1
Though the application "auto scroll" code snippet is somewhat buggy too... A cleaner solution would be like this (notice dy taken into account):
--- snip pseudo code --- LRESULT result = 0; do { result = SendMessage(hwnd, EM_SCROLL, SB_PAGEDOWN, 0); } while ((HIWORD(result) == TRUE) && (LOWORD(result) > 0)); --- snip pseudo code ---
But the question remains why negative dy is returned (control resizing issue? font?). I hope I provided enough hints for someone to investigate this user32 issue further. If debugging is really needed, I can provide unwrapped executable upon request to make life easier :-)
Regards