[PATCH 2/3] ntdll: Implement thread description as information class.

Nikolay Sivov nsivov at codeweavers.com
Mon Nov 25 06:48:44 CST 2019


On 11/25/19 3:36 PM, Alexandre Julliard wrote:
> Nikolay Sivov <nsivov at codeweavers.com> writes:
>
>> @@ -1436,6 +1461,14 @@ DECL_HANDLER(get_thread_info)
>>           reply->priority       = thread->priority;
>>           reply->affinity       = thread->affinity;
>>           reply->last           = thread->process->running_threads == 1;
>> +        reply->desc_length    = 0;
>> +
>> +        if (thread->desc && req->mask & SET_THREAD_INFO_DESCRIPTION)
>> +        {
>> +            reply->desc_length = strlenW( thread->desc ) * sizeof(WCHAR);
>> +            if (get_reply_max_size() >= reply->desc_length)
>> +                set_reply_data( thread->desc, min( reply->desc_length, get_reply_max_size() ));
>> +        }
> I don't see why you need to check the mask for the get request.
> Also in general in the server we store the length with the strings, so
> that we don't need to recompute it.
I'm using mask to return this string only when asked for, because 
get_thread_info() is used for several classes.
Or do you mean the fact that it's requested could be inferred in some 
way? Maybe I only need to compare current length to get_reply_max_size(),
as an indication that it was requested.

Regarding string length, it's not consistent apparently, it's used for 
dll names, but not for window text or console title.




More information about the wine-devel mailing list