~ubuntu-branches/ubuntu/jaunty/pcsc-lite/jaunty-security

« back to all changes in this revision

Viewing changes to src/eventhandler.c

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Rousseau
  • Date: 2007-05-16 14:40:30 UTC
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20070516144030-6wk53ou910ctb9ds
Tags: upstream-1.4.1
ImportĀ upstreamĀ versionĀ 1.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 * Copyright (C) 2004
7
7
 *  Ludovic Rousseau <ludovic.rousseau@free.fr>
8
8
 *
9
 
 * $Id: eventhandler.c 2377 2007-02-05 13:13:56Z rousseau $
 
9
 * $Id: eventhandler.c 2496 2007-03-28 08:20:59Z rousseau $
10
10
 */
11
11
 
12
12
/**
200
200
                return SCARD_E_NO_MEMORY;
201
201
}
202
202
 
 
203
static void incrementEventCounter(struct pubReaderStatesList *readerState)
 
204
{
 
205
        int counter;
 
206
 
 
207
        counter = (readerState -> readerState >> 16) & 0xFFFF;
 
208
        counter++;
 
209
        readerState -> readerState = (readerState -> readerState & 0xFFFF)
 
210
                + (counter << 16);
 
211
}
 
212
 
203
213
void EHStatusHandlerThread(PREADER_CONTEXT rContext)
204
214
{
205
215
        LONG rv;
364
374
                                rContext->readerState->readerState &= ~SCARD_SPECIFIC;
365
375
                                dwCurrentState = SCARD_ABSENT;
366
376
 
 
377
                                incrementEventCounter(rContext->readerState);
 
378
 
367
379
                                SYS_MMapSynchronize((void *) rContext->readerState, pageSize);
368
380
                        }
369
381
 
414
426
 
415
427
                                dwCurrentState = SCARD_PRESENT;
416
428
 
 
429
                                incrementEventCounter(rContext->readerState);
 
430
 
417
431
                                SYS_MMapSynchronize((void *) rContext->readerState, pageSize);
418
432
 
419
433
                                Log2(PCSC_LOG_INFO, "Card inserted into %s", lpcReader);