#55

ntdll: accept SetNamedPipeHandleState on a pipe that is a plain unix fd

OpenSirDankwants to merge intofrom

A standard handle can be a unix pipe wrapped as a file object. `GetFileType` reports `FILE_TYPE_PIPE` and `FileModeInformation` answers, but `NtSetInformationFile(FilePipeInformation)` goes to the server's `set_named_pipe_info`, which only knows named-pipe objects, so `SetNamedPipeHandleState` fails with `ERROR_INVALID_HANDLE`. (`GetNamedPipeHandleState` fails with `ERROR_INVALID_FUNCTION` and `FilePipeLocalInformation` with `STATUS_NOT_IMPLEMENTED`; this change leaves those alone.)

libuv calls `SetNamedPipeHandleState` on every pipe it adopts in `uv_pipe_open` and treats the failure as fatal, so Node.js with a piped stdout dies at startup with `Error: open EBADF` in `new Socket`.

The state requested (byte read mode, blocking) is what a unix pipe already is, so when the server rejects the handle but its device type is `FILE_DEVICE_NAMED_PIPE` the request is accepted and ignored. A closed handle or a non-pipe still fails exactly as before.

Verified with a probe on an iPhone 15 Pro: the three calls fail as described before the change, and `node.exe -e "console.log(6*7)"` with stdout on a pipe prints 42 after it.

🤖 Generated with Claude Code