[SPAM] Re: USER32: fix EM_SETLIMITTEXT with zeroed args (with tests)

Alex Villacís Lasso a_villacis at palosanto.com
Sun Oct 14 20:22:15 CDT 2007


> On Fr, 2007-10-12 at 19:42 -0500, a_villacis at palosanto.com wrote:
>
> You must use your real name to get a patch accepted.

I am Alex Villacís Lasso. The web mailer interface was supposed to tack on
my full name to the From: field. If it still doesn't, please tell me.

>
>> +    /* Maximum limits set by EM_SETLIMITTEXT vary by OS version */
>> +    osVersion = GetVersion();
>> +    if (osVersion < 0x80000000) {
>> +        /* WinNT, Win2K, WinXP */
>> +        limitSingleLine = 2147483646UL;
>> +        limitMultiLine = 4294967295UL;
>> +    } else {
>> +            /* Win9x, WinME */
>> +        limitSingleLine = 32766;
>> +        limitMultiLine = 65535;
>> +    }
>
> The tests should not depend on the OS-Version.
> Please handle both possible results in the ok()

Changed. However, I don't completely agree on this particular test. The
new form does not check which version should have which limit.

>
> To allow an easy review, you can split your patch:
> one patch for the implementation and a second patch for the test.
>

Agreed.

The softphone application Zoiper (www.zoiper.com) fails to start with current
git. Fixed by attached patch. See technical explanation below:

This application is extensively skinned. The skin definitions are stored as
XML documents in string resources inside the executable file. The interesting
feature is that the skin is not stored as a single string, but as a series
of chunks preceded by a byte with the chunk length. Therefore, the app has to
somehow concatenate the pieces together and pass them to the XML parser
(msxml4.dll).

However, the authors of the application are so lazy that they don't bother to
concatenate the pieces themselves. Instead, the create a new, invisible, edit
control, in which they dump the pieces with EM_REPLACESEL messages. The app
sends an EM_SETLIMITTEXT to the edit control, in order to expand the maximum
buffer to the maximum allowed on WinNT and higher. However, the current
edit control code has a buffer limit of 65536 characters for a multiline
control, which is correct on Win9X, but way too small for WinNT and higher.
Therefore the XML document gets truncated, and the XML parsing fails. The
user-visible result is a message box stating "Cannot load skin", followed by
a never-ending series of popups with "Access violation" messages.

This patch implements the higher limits for EM_SETLIMITTEXT with zeroed
wParam
and lParam, when the reported Windows version is WinNT, Win2k and higher. It
also implements a default maximum limit of 30000 before receiving any
EM_SETLIMITTEXT message. Tests are given for all of this.

Changelog:
* Fix increase of maximum buffer length on EM_SETLIMITTEXT with zeroed args
* Fix default maximum buffer length before EM_SETLIMITTEXT
* Implement OS version-dependent behavior for EM_SETTEXTLIMIT
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wine-user32-EM_SETLIMITTEXT-fix-limit.patch
Type: text/x-patch
Size: 2484 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20071014/cd2f4366/attachment.bin 


More information about the wine-patches mailing list