On 15.03.2019 22:42, Bruno Haible wrote: > Gisle Vanem asked: >>> I prefer to avoid the ntdll.dll API when possible. >> >> Okay, what's wrong with that? > > 1) It's a violation of abstraction. > > 2) The code you pointed to uses the function NtQueryObject. However, the > Microsoft documentation > > <https://docs.microsoft.com/en-us/windows/desktop/api/winternl/nf-winternl-ntqueryobject> > states "This function may be changed or removed from Windows without > further notice." > > 3) Probably code will run better on ReactOS or WINE if they don't use the > lower layers. > Advanced functionality sometimes requires the use of kernel API in cases where Microsoft decided not to expose some NT kernel functions to applications in Win32 API. These situations happen from time to time when dealing with portability.
You can lessen the impact by configure-time-testing the kernel APIs to ensure that they are available and behave as expected. In some sense this is kind of like using very Linux-specific functions. If the functions vanish, you'll notice. Also ReactOS and WINE won't use that code, if they have no functions and thus fail the configure-tests. Either way, some things cannot be implemented in a clear and/or performant way without these.
signature.asc
Description: OpenPGP digital signature