[host] windows: use DEBUG_WINERROR for CallNtPowerInformation

We need to use the function RtlNtStatusToDosError to convert NTSTATUS to
Windows error codes.
This commit is contained in:
Quantum 2021-08-09 02:46:06 -04:00 committed by Geoffrey McRae
parent 9246e00163
commit 87a21f5f5e
2 changed files with 4 additions and 1 deletions

View file

@ -5,3 +5,4 @@ LIBRARY "ntdll.dll"
EXPORTS
NtDelayExecution
NtSetTimerResolution
RtlNtStatusToDosError

View file

@ -30,6 +30,7 @@
#include <ntstatus.h>
#include <wtsapi32.h>
#include <userenv.h>
#include <winternl.h>
#include "interface/platform.h"
#include "common/debug.h"
@ -566,7 +567,8 @@ bool os_blockScreensaver()
if (status == STATUS_SUCCESS)
lastResult = executionState & ES_DISPLAY_REQUIRED;
else
DEBUG_ERROR("Failed to call CallNtPowerInformation(SystemExecutionState): %ld", status);
DEBUG_WINERROR("Failed to call CallNtPowerInformation(SystemExecutionState)",
RtlNtStatusToDosError(status));
lastCheck = now;
}
return lastResult;