[crac] RFR: Adapted some FileDescriptor tests for Win [v3]
Roman Marchenko
rmarchenko at openjdk.org
Mon Jul 24 11:37:13 UTC 2023
On Mon, 24 Jul 2023 09:43:03 GMT, Radim Vansa <rvansa at openjdk.org> wrote:
>> GetFileInformationByHandle doesn't work for sockets. The closest appropriate function would be GetFileType, however it operates with integer file type codes, and has too few codes to distiguish types. Additionally, since I'd like to dump type name into a native description string, I have taken NtQueryObject.
>
> What do you mean by 'not working'? From what I see, you don't really use the function except for identifying that it is really a file/dir. Therefore if it returns an error for a socket, you can immediately fall back to the `Handle %p`. Or does the NtQueryObject actually provide any info about the socket that you read?
I thought it'd be useful to have a name of a handle type while creating a native description string. That's why I used NtQueryObject. However it's just an info string, so I agree that using NtQueryObject is not necessary here.
I will replace it with GetFileType.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/91#discussion_r1272140966
More information about the crac-dev
mailing list