Skip to content

Commit 9d428b5

Browse files
committed
OnReleaseHardware: Close EC driver handle
Previously the following HLK tests would fail and also uninstalling the device from device manager would trigger a debugger break. Already succesfully tested DF - PNP DIF Remove Device Test (Reliability) DF - PNP Rebalance Fail Restart Device Test (Reliability) Still retesting DF - Reinstall with IO Before and After (Reliability) DF - Sleep and PNP (disable and enable) with IO Before and After (Reliability) Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 0c75548 commit 9d428b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

FrameworkSensors/Device.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ OnReleaseHardware(
403403
pDevice->m_Lock = NULL;
404404
}
405405

406+
// Close handle to EC driver
407+
if (pDevice->m_CrosEcHandle && pDevice->m_CrosEcHandle != INVALID_HANDLE_VALUE) {
408+
CloseHandle(pDevice->m_CrosEcHandle);
409+
pDevice->m_CrosEcHandle = INVALID_HANDLE_VALUE;
410+
}
411+
406412
// Delete sensor instance
407413
if (NULL != pDevice->m_SensorInstance)
408414
{

0 commit comments

Comments
 (0)