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.

92 lines
2.4 KiB

  1. // IOP.h -- Main header for IOP
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 2000. 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(IOP_IOP_H)
  8. #define IOP_IOP_H
  9. #include "NoWarning.h"
  10. #include <winscard.h>
  11. #include <shlwapi.h>
  12. #include <scuOsVersion.h>
  13. #include "DllSymDefn.h"
  14. #include "SmartCard.h"
  15. #include "CryptoCard.h"
  16. #include "AccessCard.h"
  17. #include "iopExc.h"
  18. #include "SharedMarker.h"
  19. #include "SecurityAttributes.h"
  20. #ifdef IOPDLL_EXPORTS
  21. STDAPI DllRegisterServer();
  22. STDAPI DllUnregisterServer();
  23. STDAPI DllGetVersion(DLLVERSIONINFO *dvi);
  24. #endif
  25. #if defined(SLB_WINNT_BUILD) || defined(SLB_WIN2K_BUILD)
  26. #define SLBIOP_USE_SECURITY_ATTRIBUTES
  27. #endif
  28. // To support smart card logon, wait for the Microsoft Resource Manager
  29. // to startup. This is not relevant for Windows 9x.
  30. #if SLBSCU_WINNT_ONLY_SERIES
  31. #define SLBIOP_WAIT_FOR_RM_STARTUP
  32. #endif
  33. namespace iop
  34. {
  35. typedef IOPDLL_API enum
  36. {
  37. UNKNOWN_CARD = 0x00, // Assign values to card class specifiers (CCryptoCard,
  38. CRYPTO_CARD = 0x01, // CAccessCard, etc...) between 0x00 and 0xFF, since only
  39. ACCESS_CARD = 0x02, // one byte will be stored in the registry for cardType
  40. } cardType;
  41. class IOPDLL_API CIOP {
  42. public:
  43. CIOP();
  44. ~CIOP();
  45. CSmartCard *
  46. Connect(const char* szReaderName,
  47. bool fExclusiveMode = false);
  48. void ListReaders(char* szReadersList, int& iSizeOfList);
  49. static void ListKnownCards(char* szCardList, int& iSizeOfList);
  50. static void RegisterCard(const char* szCardName, const BYTE* bATR, const BYTE bATRLength,
  51. const BYTE* bATRMask, const BYTE bATRMaskLength, const BYTE* bProperties,
  52. const cardType type);
  53. static void RegisterDefaultCards();
  54. #if defined(SLBIOP_USE_SECURITY_ATTRIBUTES)
  55. static void InitIOPSecurityAttrs(CSecurityAttributes* psa);
  56. #endif
  57. static bool WINAPI WaitForSCManager();
  58. private:
  59. CSmartCard* CreateCard(const BYTE *bATR, const DWORD dwLength, const SCARDHANDLE hCard,
  60. const char* szReaderName, const DWORD dwShareMode);
  61. // handle to resource manager
  62. SCARDCONTEXT m_hContext;
  63. };
  64. }
  65. #endif // !defined(IOP_IOP_H)