summaryrefslogtreecommitdiff
path: root/Source/Core/Common/WindowsDevice.cpp
diff options
context:
space:
mode:
authorDentomologist <dentomologist@gmail.com>2025-10-13 11:55:12 -0700
committerDentomologist <dentomologist@gmail.com>2025-10-13 11:55:12 -0700
commit4e359cf1c5f42fb394e0035f2aad517f2c89f014 (patch)
tree6a21c3e504783b8f92546a15b2dafffefe62bfb3 /Source/Core/Common/WindowsDevice.cpp
parent1067754d218edab5ece7a1878a987c5d61bdaa65 (diff)
WindowsDevice: Silence missing property log spam
Don't log a warning in GetPropertyHelper when the property isn't present. The function returns an optional, so any callers that want to log a warning when nullopt is returned can do so themselves. This prevents plugged-in devices (an Xbox One controller in my case) from spamming the message "W[COMMON]: CM_Get_DevNode_Property returned: 37" twice per second (that value being CR_NO_SUCH_VALUE).
Diffstat (limited to 'Source/Core/Common/WindowsDevice.cpp')
-rw-r--r--Source/Core/Common/WindowsDevice.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/Common/WindowsDevice.cpp b/Source/Core/Common/WindowsDevice.cpp
index 770aa3861a..405ea5e25b 100644
--- a/Source/Core/Common/WindowsDevice.cpp
+++ b/Source/Core/Common/WindowsDevice.cpp
@@ -47,7 +47,8 @@ std::optional<std::wstring> GetPropertyHelper(auto function, auto dev,
if (const auto result = function(dev, requested_property, &type, nullptr, &buffer_size, 0);
result != CR_SUCCESS && result != CR_BUFFER_SMALL)
{
- WARN_LOG_FMT(COMMON, "CM_Get_DevNode_Property returned: {}", result);
+ if (result != CR_NO_SUCH_VALUE)
+ WARN_LOG_FMT(COMMON, "CM_Get_DevNode_Property returned: {}", result);
return std::nullopt;
}
if (type != expected_type)