As @kubkon observed, NtOpenFile provides a more efficient and likely more reliable way to implement openat-like behavior on Windows. As an example, Rust is now using it this way in its remove_dir_all implementation.
Microsoft officially documents NtOpenFile as an Internal API which may change between releases or even service packs of Windows, however this particular function, NtOpenFile, has apparently been stable for a long time, and since Rust itself is now depending on it, it would seem to be sufficiently stable for cap-std to use as well.
As @kubkon observed,
NtOpenFileprovides a more efficient and likely more reliable way to implementopenat-like behavior on Windows. As an example, Rust is now using it this way in itsremove_dir_allimplementation.Microsoft officially documents
NtOpenFileas an Internal API which may change between releases or even service packs of Windows, however this particular function,NtOpenFile, has apparently been stable for a long time, and since Rust itself is now depending on it, it would seem to be sufficiently stable for cap-std to use as well.