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.

80 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. persist.h
  5. Abstract:
  6. Author:
  7. Adriaan Canter (adriaanc) 13-Jan-1998
  8. Revision History:
  9. 13-Jan-1998 adriaanc
  10. Created
  11. 01-Aug-1998 adriaanc
  12. revised for digest.
  13. --*/
  14. #ifndef PERSIST_HXX
  15. #define PERSIST_HXX
  16. #include <pstore.h>
  17. #define INTERNET_SETTINGS_KEY "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"
  18. #define DISABLE_PASSWORD_CACHE_VALUE "DisablePasswordCaching"
  19. #define CRED_PERSIST_NOT_AVAIL 0
  20. #define CRED_PERSIST_AVAIL 1
  21. #define CRED_PERSIST_UNKNOWN 2
  22. #define MAX_FIELD_LENGTH 64
  23. // PWL related defines.
  24. // Password-cache-entry, this should be in PCACHE.
  25. #define PCE_WWW_BASIC 0x13
  26. #define MAX_AUTH_FIELD_LENGTH MAX_FIELD_LENGTH * 2
  27. #define WNETDLL_MODULE "mpr.dll"
  28. #define PSTORE_MODULE "pstorec.dll"
  29. #define WNETGETCACHEDPASS "WNetGetCachedPassword"
  30. #define WNETCACHEPASS "WNetCachePassword"
  31. #define WNETREMOVECACHEDPASS "WNetRemoveCachedPassword"
  32. // MPR.DLL exports used by top level API.
  33. typedef DWORD (APIENTRY *PFWNETGETCACHEDPASSWORD) (LPSTR, WORD, LPSTR, LPWORD, BYTE);
  34. typedef DWORD (APIENTRY *PFWNETCACHEPASSWORD) (LPSTR, WORD, LPSTR, WORD, BYTE, UINT);
  35. typedef DWORD (APIENTRY *PFWNETREMOVECACHEDPASSWORD) (LPSTR, WORD, BYTE);
  36. // ----------------Public function prototypes----------------------
  37. // Determines availability of credential cache.
  38. DWORD InetInitCredentialPersist();
  39. // Persist credentials (username/password).
  40. DWORD InetSetCachedCredentials (LPSTR szCtx,
  41. LPSTR szRealm,
  42. LPSTR szUser,
  43. LPSTR szPass);
  44. // Get persisted credentials (username/password).
  45. DWORD InetGetCachedCredentials (LPSTR szCtx,
  46. LPSTR szRealm,
  47. LPSTR szUser,
  48. LPSTR szPass);
  49. // Remove persisted credentials (username/password).
  50. DWORD InetRemoveCachedCredentials (LPSTR szCtx, LPSTR szRealm);
  51. #endif //PERSIST_HXX