mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Fix error in hardware key detection code on Windows
This commit is contained in:
committed by
Janek Bevendorff
parent
dc9c9c443f
commit
a3b17f4b68
@@ -56,7 +56,6 @@ void DeviceListenerWin::registerHotplugCallback(bool arrived,
|
||||
regex += QString("PID_%1&").arg(productId, 0, 16).toUpper();
|
||||
}
|
||||
}
|
||||
regex += QString(".*$"); // Qt won't match otherwise
|
||||
m_deviceIdMatch = QRegularExpression(regex);
|
||||
|
||||
DEV_BROADCAST_DEVICEINTERFACE_W notificationFilter{
|
||||
@@ -95,7 +94,7 @@ bool DeviceListenerWin::nativeEventFilter(const QByteArray& eventType, void* mes
|
||||
|| (m_handleRemoval && m->wParam == DBT_DEVICEREMOVECOMPLETE)) {
|
||||
const auto pBrHdr = reinterpret_cast<PDEV_BROADCAST_HDR>(m->lParam);
|
||||
const auto pDevIface = reinterpret_cast<PDEV_BROADCAST_DEVICEINTERFACE_W>(pBrHdr);
|
||||
const auto name = QString::fromWCharArray(pDevIface->dbcc_name, pDevIface->dbcc_size);
|
||||
const auto name = QString::fromWCharArray(pDevIface->dbcc_name);
|
||||
if (m_deviceIdMatch.match(name).hasMatch()) {
|
||||
emit devicePlugged(m->wParam == DBT_DEVICEARRIVAL, nullptr, pDevIface);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user