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.

58 lines
1.5 KiB

  1. #if !defined(__SCUISUPP_INCLUDED__)
  2. #define __SCUISUPP_INCLUDED__
  3. #if _MSC_VER >= 1000
  4. #pragma once
  5. #endif // _MSC_VER >= 1000
  6. #include <wincrypt.h>
  7. // use these strings for RegisterWindowMessage
  8. #define SCARDUI_READER_ARRIVAL "SCardUIReaderArrival"
  9. #define SCARDUI_READER_REMOVAL "SCardUIReaderRemoval"
  10. #define SCARDUI_SMART_CARD_INSERTION "SCardUISmartCardInsertion"
  11. #define SCARDUI_SMART_CARD_REMOVAL "SCardUISmartCardRemoval"
  12. #define SCARDUI_SMART_CARD_STATUS "SCardUISmartCardStatus"
  13. #define SCARDUI_SMART_CARD_CERT_AVAIL "SCardUISmartCardCertAvail"
  14. typedef LPVOID HSCARDUI;
  15. typedef struct _CERT_ENUM
  16. {
  17. // status of the reader / card
  18. // typical values:
  19. // SCARD_S_SUCCESS
  20. // SCARD_E_UNKNOWN_CARD - unregistered / unknown card
  21. // SCARD_W_UNRESPONSIVE_CARD - card upside down
  22. // NTE_KEYSET_NOT_DEF - known card with no certificate
  23. // SCARD_W_REMOVED_CARD - card removed shortly after insertion
  24. DWORD dwStatus;
  25. // name of the reader that contains the card
  26. LPTSTR pszReaderName;
  27. // name of the card (NULL if card is unknown)
  28. LPTSTR pszCardName;
  29. // certificate context
  30. // (NULL if card is unknown or can't be read)
  31. PCERT_CONTEXT pCertContext;
  32. } CERT_ENUM, *PCERT_ENUM;
  33. // initialize smart card ui
  34. HSCARDUI
  35. WINAPI
  36. SCardUIInit(
  37. HWND hWindow // handle of parent window
  38. );
  39. // clean up
  40. DWORD
  41. WINAPI
  42. SCardUIExit(
  43. HSCARDUI hSCardUI // handle that was returned by SCardUIInit
  44. );
  45. #endif