[PATCH v2 1/6] kernelbase/console, programs/conhost: support CONSOLE_READCONSOLE_CONTROL in ReadConsoleW
Jacek Caban
jacek at codeweavers.com
Mon Feb 28 09:54:29 CST 2022
On 2/27/22 15:02, Eric Pouech wrote:
> Le 25/02/2022 à 20:10, Jacek Caban a écrit :
>> Hi Eric,
>>
>> The series looks mostly good for me.
>>
>> On 2/23/22 18:05, Eric Pouech wrote:
>>> + if (initial_len && edit_line_grow( console, initial_len + 1 ))
>>> + {
>>> + unsigned offset = edit_line_string_width( initial,
>>> initial_len );
>>> + if (offset > ctx->home_x)
>>> + {
>>> + int deltay;
>>> + offset -= ctx->home_x;
>>> + deltay = offset / console->active->width;
>>> + ctx->home_y = (deltay >= ctx->home_y) ? ctx->home_y -
>>> deltay : 0;
>>
>>
>> Isn't the logic reverted here?
> yes
>>
>>
>>> + ctx->home_x = console->active->width - 1 - (offset %
>>> console->active->width);
>>
>>
>> I wonder if we should use use 0 for home_x in case of deltay >= home_y.
>
> actually, this was more to protect the rest of the code which isn't
> prepared for negative coordinates
>
> IIRC I tested this UC and native supports this
>
> changing the code for handling such case is not immediate, but I
> thought that the ratio real value vs effort was near 0 and not worth
> for now going for it
>
> so we could either add a FIXME (and leave the 0) or add a FIXME and
> return an error
I commented mostly based on the line above (which seems more important).
If it's closer to what we will eventually want (if we support negative
home_y someday), that's fine with me, as long as we don't crash.
Thanks,
Jacek
More information about the wine-devel
mailing list