v8: Revert to the previous approach of separate ops for named pipe directory, from March 2022[^1], with a few tweaks to highlight similarities between `\Device\NamedPipe` and `\Device\NamedPipe`.
Unlike the mailing list patch[^1], the two object types still share the same fd ops (as per @zfigura's suggestion: https://gitlab.winehq.org/wine/wine/-/merge_requests/498?diff_id=86003#note_...). This requires an explicit check (`device->obj.ops == &named_pipe_dir_ops`) from `named_pipe_device_ioctl` on the fd user object's ops, which is what I meant by "the 'boolean flag' pattern getting moved to the fd object, not eliminated."
1. The explicit check (`device->obj.ops == &named_pipe_dir_ops`) resides in `named_pipe_device_ioctl`. This is because `FSCTL_PIPE_WAIT` works only on `\Device\NamedPipe`. 2. `\Device\NamedPipe` supports `NtQueryDirectoryFile()`[^2] on native but not yet on Wine. To implement this, I believe we should switch to `FD_TYPE_DIR` for `\Device\NamedPipe` as well as implement (hypothetical) "list directory" operation, both of which will require the explicit check as well.
Both of the concerns above can be resolved if we duplicate the fd ops as well, which I'm happy to implement.
Nevertheless, if this looks OK, let's go with this.
[^1]: [[PATCH v4 resend 2/2] server: Allow creating named pipes using \Device\NamedPipe\ as RootDirectory.](https://marc.info/?l=wine-devel&m=164813696830725&w=2) Jinoh Kang. March 25 2022. [^2]: Sysinternals `pipelist.exe` is known to use this to list existing named pipes on a system.