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.

64 lines
1.7 KiB

  1. #ifndef __SCARD__GLOBAL__CACHE
  2. #define __SCARD__GLOBAL__CACHE
  3. #include <windows.h>
  4. //
  5. // This header defines a general data cache to be used for Smart Card
  6. // data.
  7. //
  8. //
  9. // Function: SCardCacheLookupItem
  10. //
  11. // Purpose: Query the data cache for a specific item, identified by the
  12. // rgdbCacheKey array in the SCARD_CACHE_LOOKUP_ITEM_INFO structure, below.
  13. //
  14. // If the item is found cached, a copy is made using the caller's
  15. // PFN_CACHE_ITEM_ALLOC type allocator and ERROR_SUCCESS is returned.
  16. // The caller is responsible for freeing the dbItem.pbData member.
  17. //
  18. // If the item is not found cached, ERROR_NOT_FOUND is returned.
  19. //
  20. typedef LPVOID (WINAPI *PFN_CACHE_ITEM_ALLOC)(
  21. IN SIZE_T Size);
  22. #define SCARD_CACHE_LOOKUP_ITEM_INFO_CURRENT_VERSION 1
  23. typedef struct _SCARD_CACHE_LOOKUP_ITEM_INFO
  24. {
  25. IN DWORD dwVersion;
  26. IN PFN_CACHE_ITEM_ALLOC pfnAlloc;
  27. IN DATA_BLOB *mpdbCacheKey;
  28. IN DWORD cCacheKey;
  29. OUT DATA_BLOB dbItem;
  30. } SCARD_CACHE_LOOKUP_ITEM_INFO, *PSCARD_CACHE_LOOKUP_ITEM_INFO;
  31. typedef DWORD (WINAPI *PFN_SCARD_CACHE_LOOKUP_ITEM) (
  32. IN PSCARD_CACHE_LOOKUP_ITEM_INFO pInfo);
  33. DWORD SCardCacheLookupItem(
  34. IN PSCARD_CACHE_LOOKUP_ITEM_INFO pInfo);
  35. //
  36. // Function: SCardCacheAddItem
  37. //
  38. // Purpose: Add data to the cache. The item to be added is identified
  39. // by the rgdbCacheKey parameter. A flat copy of the pdbItem->pbData
  40. // parameter will be made for storage in the cache.
  41. //
  42. typedef DWORD (WINAPI *PFN_SCARD_CACHE_ADD_ITEM) (
  43. IN DATA_BLOB *rgdbCacheKey,
  44. IN DWORD cCacheKey,
  45. IN DATA_BLOB *pdbItem);
  46. DWORD SCardCacheAddItem(
  47. IN DATA_BLOB *rgdbCacheKey,
  48. IN DWORD cCacheKey,
  49. IN DATA_BLOB *pdbItem);
  50. #endif