Commit 02dd27bf authored by Ludovic Rousseau's avatar Ludovic Rousseau

SCardReconnect(): suspend card auto power off

When the card is reconnected the power state must be changed to
POWER_STATE_INUSE so that card auto power off is not triggered.

See associated Unitary Test CheckAutoPowerOff.py

Thanks to Christophe Ferrando for the bug report
parent c3bcdeb7
......@@ -716,6 +716,12 @@ LONG SCardReconnect(SCARDHANDLE hCard, DWORD dwShareMode,
goto exit;
}
}
/* the card is now in use */
(void)pthread_mutex_lock(&rContext->powerState_lock);
rContext->powerState = POWER_STATE_INUSE;
Log1(PCSC_LOG_DEBUG, "powerState: POWER_STATE_INUSE");
(void)pthread_mutex_unlock(&rContext->powerState_lock);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment