RtlNtStatusToDosError
RtlNtStatusToDosError is a Windows runtime library function used to translate NTSTATUS codes, which originate from the Windows NT kernel and native APIs, into Win32/DOS error codes that are used by standard Win32 error handling. The function takes an NTSTATUS value as input and returns a Windows error code suitable for use with GetLastError. In practice, this enables native API results to be interpreted by higher-level Win32 code and wrappers.
The function is exported by ntdll.dll and is considered part of the Windows Native API. It provides
Mapping behavior typically covers many common NTSTATUS values with direct Win32 equivalents. For example, not-found or
Usage notes: RtlNtStatusToDosError is an internal helper used by some system components and wrappers to convert