-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add public Nt/Rtl header (winternl) #282
Conversation
Important advanced APIs here such as NtCreateFile, NtQuery*, and NT string APIs.
Could you clarify where these APIs are intended to be used and how? Many of the |
I also think that these are ones that possibly shouldn't be exposed due to: https://docs.microsoft.com/en-us/windows/win32/devnotes/calling-internal-apis. That is |
The likelihood of them changing is about zero. They've not changed since they were introduced (which in many cases is 30 years ago). The .NET Framework itself uses some of these, notably They are all there because there is no way to accomplish some of the things they provide through the Win32 surface area. Either at all, or as efficiently. As to more expensive, they aren't any more expensive than other Win32 APIs. The "Using Nt and Zw Versions of the Native System Services Routines" talks a bit more about this. Anything that is documented in |
That doesn't look to be the case in the headers or source. They are explicitly documented as
Could you provide some more details and an example of what you mean here? I don't see any non-deprecated functions that take in an existing file handle and you can What about the |
It looks like it basically just uses this for directory enumeration which would likely be better handled by |
For the ones here, yes. They (like any IO api) have to go to kernel so there is no advantage to having a user mode equivalent. The
The
It is significantly faster for a number of reasons.
I spent months redoing the code here to avoid all of this overhead. :) (Lots and lots of perf testing and walking through the Windows sources.)
If there are CRT equivalents it's fair to exclude them. I don't think there are any for these. I'll also point out that all of the
While it is primarily documented from the kernel mode usage perspective (there is, after all, no Win32 in kernel), there is no reason you can't use the actual NT APIs from user. If you need functionality that isn't projected into Win32 you have no choice, and in some cases you save a ton of overhead (all of the Win32 APIs call I'm not suggesting that everything be done directly through |
FWIW I've been putting up PRs for headers I'm actually using in my WInterop project. |
Sorry for the delay. I had set this to auto-merge but forgot to actually approve it so the merge could happen. |
Important advanced APIs here such as NtCreateFile, NtQuery*, and NT string APIs.