On Wed Sep 4 23:32:23 2024 +0000, Grigory Vasilyev wrote:
@nsivov I still don't understand why we need to set last error code if we always return TRUE and we will always have a valid value. Look at the code, it doesn't matter whether `NtQuerySystemInformation` returns an error or not. There will always be a default value of `FirmwareTypeUnknown` or whatever `NtQuerySystemInformation` returns. This is done on purpose so that the code will continue to work as before on systems other than Linux.
static inline BOOL set_ntstatus( NTSTATUS status ) { if (status) SetLastError( RtlNtStatusToDosError( status )); return !status; }
If you're going to have a fallback, it should be in NtQuerySystemInformation.