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.

41 lines
1.4 KiB

  1. #include <wininetp.h>
  2. /*
  3. * Object for persisting cookie-decisions made by the user at prompt
  4. * Current implementation uses the registry for storage.
  5. */
  6. class CCookiePromptHistory {
  7. public:
  8. CCookiePromptHistory(const char *pchRegistryPath, bool fUseHKLM=false);
  9. ~CCookiePromptHistory();
  10. BOOL lookupDecision(const char *pchHostName,
  11. const char *pchPolicyID,
  12. unsigned long *pdwDecision);
  13. BOOL saveDecision(const char *pchHostName,
  14. const char *pchPolicyID,
  15. unsigned long dwDecision);
  16. BOOL clearDecision(const char *pchHostName,
  17. const char *pchPolicyID);
  18. BOOL clearAll();
  19. /* Enumerate decisions in the prompt history.
  20. Only supports enumerating the default decision (eg policyID=empty) */
  21. unsigned long enumerateDecisions(char *pchSiteName,
  22. unsigned long *pcbName,
  23. unsigned long *pdwDecision,
  24. unsigned long dwIndex);
  25. private:
  26. HKEY OpenRootKey();
  27. BOOL CloseRootKey(HKEY hkeyRoot);
  28. HKEY lookupSiteKey(HKEY hkHistoryRoot, const char *pchName, bool fCreate=false);
  29. BOOL _fUseHKLM;
  30. char _szRootKeyName[MAX_PATH];
  31. HKEY _hkHistoryRoot;
  32. };