version 5.5.5

fix PIHIDevice enumeration for Windows
This commit is contained in:
2026-02-13 18:47:33 +03:00
parent f50a3abc8e
commit 6f1660fd9e
2 changed files with 6 additions and 1 deletions

View File

@@ -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)

View File

@@ -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<PIHIDeviceInfo> 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);