From 87a21f5f5e13b3a967cfc6d2febdb84979be8636 Mon Sep 17 00:00:00 2001 From: Quantum Date: Mon, 9 Aug 2021 02:46:06 -0400 Subject: [PATCH] [host] windows: use DEBUG_WINERROR for CallNtPowerInformation We need to use the function RtlNtStatusToDosError to convert NTSTATUS to Windows error codes. --- common/src/platform/windows/ntdll.def | 1 + host/platform/Windows/src/platform.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/src/platform/windows/ntdll.def b/common/src/platform/windows/ntdll.def index 310184d0..4ae879d1 100644 --- a/common/src/platform/windows/ntdll.def +++ b/common/src/platform/windows/ntdll.def @@ -5,3 +5,4 @@ LIBRARY "ntdll.dll" EXPORTS NtDelayExecution NtSetTimerResolution +RtlNtStatusToDosError diff --git a/host/platform/Windows/src/platform.c b/host/platform/Windows/src/platform.c index eb071f99..45edffe7 100644 --- a/host/platform/Windows/src/platform.c +++ b/host/platform/Windows/src/platform.c @@ -30,6 +30,7 @@ #include #include #include +#include #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;