Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
3.1 KiB

  1. // CardEnum.cpp -- CardEnumerator class implementation
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 2001. This computer program includes Confidential, Proprietary
  4. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  5. // use, disclosure, and/or reproduction is prohibited unless authorized
  6. // in writing. All Rights Reserved.
  7. #if defined(_UNICODE)
  8. #if !defined(UNICODE)
  9. #define UNICODE
  10. #endif //!UNICODE
  11. #endif //_UNICODE
  12. #if defined(UNICODE)
  13. #if !defined(_UNICODE)
  14. #define _UNICODE
  15. #endif //!_UNICODE
  16. #endif //UNICODE
  17. #include "StdAfx.h"
  18. #include "CardEnum.h"
  19. using namespace std;
  20. using namespace scu;
  21. /////////////////////////// LOCAL/HELPER /////////////////////////////////
  22. /////////////////////////// PUBLIC /////////////////////////////////
  23. // Types
  24. // C'tors/D'tors
  25. CardEnumerator::CardEnumerator()
  26. : CardFinder(ddmNever),
  27. m_lhcardctx()
  28. {}
  29. CardEnumerator::~CardEnumerator()
  30. {}
  31. // Operators
  32. // Operations
  33. auto_ptr<list<HCardContext> >
  34. CardEnumerator::Cards()
  35. {
  36. DoFind(CSpec()); // any card
  37. return auto_ptr<list<HCardContext> >(new list<HCardContext>(m_lhcardctx));
  38. }
  39. void
  40. CardEnumerator::DoOnError()
  41. {
  42. // don't throw any errors so all cards in all readers are processed.
  43. ClearException();
  44. }
  45. void
  46. CardEnumerator::DoProcessSelection(DWORD dwStatus,
  47. OpenCardNameType &ropencardname,
  48. bool &rfContinue)
  49. {
  50. rfContinue = false;
  51. m_lhcardctx.unique();
  52. }
  53. // Access
  54. // Predicates
  55. // Static Variables
  56. /////////////////////////// PROTECTED /////////////////////////////////
  57. // C'tors/D'tors
  58. // Operators
  59. // Operations
  60. // Access
  61. // Predicates
  62. bool
  63. CardEnumerator::DoIsValid()
  64. {
  65. bool fIsValid = CardFinder::DoIsValid();
  66. if (fIsValid)
  67. m_lhcardctx.push_front(CardFound());
  68. return fIsValid;
  69. }
  70. // Static Variables
  71. /////////////////////////// PRIVATE /////////////////////////////////
  72. // C'tors/D'tors
  73. // Operators
  74. // Operations
  75. // Access
  76. // Predicates
  77. // Static Variables