From 00bf5f55dec6497f5f24aad7a28339ae35993230 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Tue, 20 Jun 2023 01:54:59 +0200 Subject: [PATCH] WiimoteReal/IOWin: Don't try to print error message for non-errors. --- Source/Core/Core/HW/WiimoteReal/IOWin.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp index 2079ed909d..be75a204cf 100644 --- a/Source/Core/Core/HW/WiimoteReal/IOWin.cpp +++ b/Source/Core/Core/HW/WiimoteReal/IOWin.cpp @@ -298,8 +298,17 @@ int IOWritePerWriteFile(HANDLE& dev_handle, OVERLAPPED& hid_overlap_write, // Pending is no error! break; default: - WARN_LOG_FMT(WIIMOTE, "IOWrite[WWM_WRITE_FILE]: Error on WriteFile: {}", - Common::HRWrap(error)); + if (FAILED(error)) + { + WARN_LOG_FMT(WIIMOTE, "IOWrite[WWM_WRITE_FILE]: Error on WriteFile: {}", + Common::HRWrap(error)); + } + else + { + WARN_LOG_FMT(WIIMOTE, + "IOWrite[WWM_WRITE_FILE]: Unexpected error code from WriteFile: 0x{:08x}", + error); + } CancelIo(dev_handle); return 0; }