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.

87 lines
2.8 KiB

  1. //
  2. // Pei-Hwa Lin (peiwhal), Feb 3, 1997
  3. //
  4. #include "msxml.h"
  5. #ifndef TRACKCACHE_H_
  6. #define TRACKCACHE_H_
  7. #define MAX_CONTENT_LENGTH 2048
  8. #define TRK_BOTH 0x00000000
  9. #define TRK_OFFLINE 0x00000001
  10. #define TRK_ONLINE 0x00000002
  11. // default internet cache entry info size
  12. #define MY_CACHE_FILE_ENTRY_SIZE 2048
  13. #define MY_WEBCHECK_POST_REG \
  14. WEBCHECK_REGKEY TEXT("\\Log")
  15. const TCHAR c_szEmptyLog[] = TEXT(" ");
  16. #define c_ccEmptyLog (ARRAYSIZE(c_szEmptyLog) - 1)
  17. LPTSTR ReadTrackingPrefix(void);
  18. HRESULT CreateLogCacheEntry(LPCTSTR lpPfxUrl, FILETIME ftExpire, FILETIME ftModified, DWORD dwPurgeTime);
  19. //////////////////////////////////////////////////////////////////////////
  20. //
  21. // Utility Class
  22. //
  23. //////////////////////////////////////////////////////////////////////////
  24. class CChannelAgent;
  25. class CTrackingCacheClassFactory;
  26. class CUrlTrackingCache
  27. {
  28. protected:
  29. ULONG m_cRef; // OLE ref count
  30. public:
  31. CUrlTrackingCache(ISubscriptionItem* pCDFStartItem,
  32. LPCWSTR pwszURL);
  33. ~CUrlTrackingCache();
  34. HRESULT ProcessTrackingInItem(IXMLElement *pTracking, LPCWSTR pwszUrl, BOOL fForceLog);
  35. HRESULT ProcessTrackingInLog (IXMLElement *pTracking);
  36. LPCWSTR get_PostURL(void) { return _pwszPostUrl; }
  37. protected:
  38. HRESULT RunChildElement(IXMLElement* pElement);
  39. HRESULT ProcessItemInEnum(LPCWSTR pwszTagName, IXMLElement *pItem);
  40. HRESULT ReadAttribute(IXMLElement* pItem, LPCWSTR pwszAttributeName, LPWSTR* pwszAttributeValue);
  41. //HRESULT DoLogEventAttribute(IXMLElement* pItem, LPCWSTR pwszAttributeName);
  42. void Init(LPCWSTR pwszURL);
  43. void DoBaseURL(LPCWSTR pwszURL);
  44. BOOL IsValidURL(LPCTSTR lpszURL);
  45. BOOL ConvertToPrefixedUrl(LPCTSTR lpszUrl, LPTSTR * lplpPrefixedUrl);
  46. LPINTERNET_CACHE_ENTRY_INFO RetrieveUrlCacheEntry(LPCTSTR lpUrl);
  47. HRESULT CreatePrefixedCacheEntry(LPCTSTR lpUrl);
  48. HRESULT AddToTrackingCacheEntry(LPCWSTR pwszUrl);
  49. private:
  50. // channel properties
  51. //data
  52. GROUPID _groupId;
  53. LPWSTR _pwszPostUrl;
  54. LPWSTR _pwszEncodingMethod;
  55. LPWSTR _pwszPurgeTime;
  56. BOOL _bTrackIt;
  57. LPTSTR _pszChannelUrlSite;
  58. LPTSTR _pszPostUrlSite;
  59. LPTSTR _lpPfx;
  60. DWORD _dwPurgeTime; // in Day
  61. DWORD _ConnectionScope;
  62. ISubscriptionItem* _pCDFStartItem;
  63. };
  64. #endif TRACKCACHE_H_