Source code of Windows XP (NT5)
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.

103 lines
2.0 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. cache.hxx
  5. Abstract:
  6. This file contains definitions for cache.cxx.
  7. Credential cache object for digest sspi package.
  8. Author:
  9. Adriaan Canter (adriaanc) 01-Aug-1998
  10. --*/
  11. #ifndef CACHE_HXX
  12. #define CACHE_HXX
  13. #define SZ_MUTEXNAME "SSPIDIGESTMUTEX:"
  14. #define SIG_CACH 'HCAC'
  15. #define CRED_CACHE_SESSION_LIST 0
  16. // bugbug - 1 << 20
  17. #define CRED_CACHE_HEAP_SIZE 1048576
  18. #define CRED_CACHE_ENTRY_SIZE 32
  19. // Mutually exclusive find flags BUBGUB - MAKE THESE 1,2,3
  20. #define FIND_CRED_AUTH 0x1
  21. #define FIND_CRED_PREAUTH 0x2
  22. #define FIND_CRED_UI 0x4
  23. //--------------------------------------------------------------------
  24. // Class CCredCache
  25. // Digest credential cache.
  26. //--------------------------------------------------------------------
  27. class CCredCache
  28. {
  29. protected:
  30. DWORD _dwSig;
  31. DWORD _dwStatus;
  32. CMMFile *_pMMFile;
  33. HANDLE _hMutex;
  34. CList *_pSessList;
  35. BOOL Lock();
  36. BOOL Unlock();
  37. LPDWORD GetPtrToObject(DWORD dwObject);
  38. CCred* SearchCredList(CSess *pSess, LPSTR szHost, LPSTR szRealm,
  39. LPSTR szUser, BOOL fHostFilter);
  40. CCredInfo* UpdateInfoList(CCredInfo *pInfo, CCredInfo *pHead);
  41. public:
  42. DWORD Init();
  43. DWORD DeInit();
  44. CCredCache();
  45. ~CCredCache();
  46. DWORD_PTR GetHeapPtr();
  47. static BOOL IsTrustedHost(LPSTR szCtx, LPSTR szHost);
  48. static BOOL SetTrustedHostInfo(LPSTR szCtx, CParams* pParams);
  49. CSess *MapHandleToSession(DWORD_PTR dwSess);
  50. DWORD MapSessionToHandle(CSess *pSess);
  51. CSess* LogOnToCache(LPSTR szAppCtx, LPSTR szUserCtx, BOOL fHTTP);
  52. DWORD LogOffFromCache(CSess* pSess);
  53. CCred* CCredCache::CreateCred(CSess *pSess, CCredInfo *pInfo);
  54. CCredInfo *FindCred(CSess *pSess, LPSTR szHost, LPSTR szRealm,
  55. LPSTR szUser, LPSTR szNonce, LPSTR szCNonce, DWORD dwFlags);
  56. VOID FlushCreds(CSess* pSess, LPSTR szRealm);
  57. DWORD GetStatus();
  58. };
  59. #endif // CACHE_HXX
  60.