RFR: 8232846: ProcessHandle.Info command with non-English shows question marks
Roger.Riggs at oracle.com
Thu Mar 26 15:35:30 UTC 2020
Reading further down the reference to the section:
"Enable Long Paths in Windows 10, Version 1607, and Later"
might suggest the code be more resilient to long paths.
The stack allocated buffer (1024) is fine, but I'd suggest adding code
to retry in the case
of INSUFFICIENT BUFFER with a malloc'd buffer to make it more robust
since the enabling
of long paths is environment and application specific.
On 3/26/20 10:40 AM, Toshio 5 Nakamura wrote:
> Hi Thomas, Suenaga-san, Roger,
> Thank you for reviewing and comments.
> I checked behaviors by a small program and debugger.
> If QueryFullProcessImageNameW failed by not enough buffer,
> the API didn't change the buffer.
> It just set ERROR_INSUFFICIENT_BUFFER(0x7a) to LastError.
> The buffer size becomes 1024 characters (2048 bytes) by this patch.
> Should it use bigger size with malloc? 32,767 characters can be limit .
> I feel 1024 is reasonable value for command's location.
> Best regards,
> Toshio Nakamura
>> If the call fails, the command field in the info will not be set (and
>> therefore null).
>> I agree that a length of 512 (characters) is probably too small.
>> On 3/26/20 6:37 AM, Yasumasa Suenaga wrote:
>>> Hi Nakamura-san,
>>> Your change almost looks good, but I have one question.
>>> Length of exeName (1024) is enough?
>>> According to Microsoft Doc , exeName might not be null-terminated
>>> if it failed.
>>> I concern buffer overrun might occur when QueryFullProcessImageNameW
>>> On 2020/03/26 17:58, Toshio 5 Nakamura wrote:
>>>> Hi All,
>>>> Could you review this change? Additionally, I'd like to ask a sponsor
>>>> it, since I'm not a committer.
>>>> Under Windows environments, ProcessHandle.Info.command shows question
>>>> if the command has non-English characters. I'd like to change the
>>>> underlying API to Unicode version.
>>>> Tier1 tests passed.
>>>> Best regards,
>>>> Toshio Nakamura
More information about the core-libs-dev