Use NtCreateFile
instead of NtOpenFile
to open a file by ChrisDenton · Pull Request #93206 · rust-lang/rust (original) (raw)
Note to reviewers: NtCreateFile
is declared in winternl.h and is an “internal” function, which NtOpenFile
isn’t.
Here’s what MSDN has to say about internal APIs:
The functions and structures in Winternl.h are internal to the operating system and subject to change from one release of Windows to the next, and possibly even between service packs for each release. To maintain the compatibility of your application, you should use the equivalent public functions instead. Further information is available in the header file, Winternl.h, and the documentation for each function.
I think that's a pretty good reason to consider not merging this.
EDIT: huh, it seems there's NtCreateFile
in ntifs.h
too 😕