From 6f1660fd9e64acbc6e0c576c21d305229223d1ef Mon Sep 17 00:00:00 2001 From: peri4 Date: Fri, 13 Feb 2026 18:47:33 +0300 Subject: [PATCH] version 5.5.5 fix PIHIDevice enumeration for Windows --- CMakeLists.txt | 2 +- libs/main/system/pihidevice.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9c68e93..88f677c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ endif() project(PIP) set(PIP_MAJOR 5) set(PIP_MINOR 5) -set(PIP_REVISION 4) +set(PIP_REVISION 5) set(PIP_SUFFIX ) set(PIP_COMPANY SHS) set(PIP_DOMAIN org.SHS) diff --git a/libs/main/system/pihidevice.cpp b/libs/main/system/pihidevice.cpp index 78d3f1ff..e1c67818 100644 --- a/libs/main/system/pihidevice.cpp +++ b/libs/main/system/pihidevice.cpp @@ -122,6 +122,10 @@ bool PIHIDevice::open(const PIHIDeviceInfo & device) { return false; } HidD_GetPreparsedData(PRIVATE->deviceHandle, &PRIVATE->preparsed); + if (!PRIVATE->preparsed) { + close(); + return false; + } return true; #endif } @@ -524,6 +528,7 @@ PIVector PIHIDevice::allDevices(bool try_open) { PHIDP_PREPARSED_DATA preparsed = nullptr; if (HidD_GetPreparsedData(deviceHandle, &preparsed) == FALSE) { piCout << "HidD_GetPreparsedData error:" << errorString(); + CloseHandle(deviceHandle); continue; } // auto pp = PIByteArray(preparsed, 64);