riched20: do not return incorrect values from ME_CharFromPoint[Cursor]

Alexandre Julliard julliard at
Mon Oct 24 13:03:01 CDT 2011

Thomas Faber <thfabba at> writes:

> Windows's version of GetTextExtentExPointW, which is called in that function,
> returns a value of 1 in this case (Wine's does not, which would appear to be
> a bug), leading to the "i<len" assertion failure if there is no text in the
> control.
> The patch fixes riched20 to correctly handle either behavior by
> adding a fast path for cx <= 0 (the function obviously needs to return 0 in
> the cx == 0 case too, so it can skip the calculation).

You should not be adding workarounds for Wine bugs, the bugs need to be
fixed instead.

Alexandre Julliard
julliard at

More information about the wine-devel mailing list