Hi, yes, Im using the function with a 0 timeout. Thats a valid thing in Windows API. Windows monitors card status all the time and when you call SCardGetStatusChange with 0 timeout it returns events that happened. Otherwise, it return SCARD_TIMEOUT. Thats not the same behavior as linux.
In Linux, if I understood your code correctly, you have the deamon monitoring cards all the time and pcsc calls just use shared memory to retrieve information from deamon. My suggestion is to make a similar solution like windows did. Make pcsc deamon keep a counter of events in higher bits of dwEventState and whenever an event happens, increase this counter. In this situation, when client removes insert card between calls, the change will be detected. Even though the SCARD_STATE_PRESENT was set before and after the call. Im not sure if I was clear enough, if not just ask =) Thanks
I think I found the problem. You are using SCardGetStatusChange() to find changes between two consecutive calls to SCardGetStatusChange(). But this function is used to detect changes _during_ its execution, not between two calls. You do: SCardGetStatusChange(timeout=0s) sleep(2 seconds) SCardGetStatusChange(timeout=0s) sleep(2 seconds) SCardGetStatusChange(timeout=0s) sleep(2 seconds)
_______________________________________________ Muscle mailing list [email protected] http://lists.drizzle.com/mailman/listinfo/muscle
