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.

159 lines
4.4 KiB

  1. //
  2. // Local private header file
  3. #ifndef _LOCAL_H_
  4. #define _LOCAL_H_
  5. #include "priv.h"
  6. #define CONST_VTABLE
  7. // Max urlcache entry we will deal with.
  8. //#define MAX_URLCACHE_ENTRY 4096
  9. #define MAX_URLCACHE_ENTRY MAX_CACHE_ENTRY_INFO_SIZE // from wininet.h
  10. // PIDL format for cache folder...
  11. typedef struct
  12. {
  13. USHORT cb;
  14. USHORT usSign;
  15. } BASEPIDL;
  16. typedef UNALIGNED BASEPIDL *LPBASEPIDL;
  17. // If TITLE, etc in LPHEIPIDL is good, vs we have to QueryUrl for it
  18. #define HISTPIDL_VALIDINFO (0x1)
  19. // PIDL format for history leaf folder...
  20. typedef struct
  21. {
  22. USHORT cb;
  23. USHORT usSign;
  24. USHORT usUrl;
  25. USHORT usFlags;
  26. USHORT usTitle;
  27. FILETIME ftModified;
  28. FILETIME ftLastVisited;
  29. DWORD dwNumHits;
  30. __int64 llPriority;
  31. } HEIPIDL;
  32. typedef UNALIGNED HEIPIDL *LPHEIPIDL;
  33. // PIDL format for history non leaf items...
  34. typedef struct
  35. {
  36. USHORT cb;
  37. USHORT usSign;
  38. TCHAR szID[MAX_PATH];
  39. } HIDPIDL;
  40. typedef UNALIGNED HIDPIDL *LPHIDPIDL;
  41. // PIDL format for "views"
  42. typedef struct
  43. {
  44. USHORT cb;
  45. USHORT usSign;
  46. USHORT usViewType;
  47. USHORT usExtra; // reserved for later use.
  48. } VIEWPIDL;
  49. typedef UNALIGNED VIEWPIDL *LPVIEWPIDL;
  50. typedef struct /* : VIEWPIDL*/
  51. {
  52. // histpidl
  53. USHORT cb;
  54. USHORT usSign; /* must be == VIEWPIDL_SEARCH */
  55. // viewpidl
  56. USHORT usViewType;
  57. USHORT usExtra;
  58. // viewpidl_search
  59. FILETIME ftSearchKey;
  60. } SEARCHVIEWPIDL;
  61. typedef UNALIGNED SEARCHVIEWPIDL *LPSEARCHVIEWPIDL;
  62. // VIEWPIDL types
  63. #define VIEWPIDL_ORDER_SITE 1//0x2
  64. #define VIEWPIDL_ORDER_FREQ 2//0x3
  65. #define VIEWPIDL_ORDER_TODAY 3//0x1
  66. #define VIEWPIDL_ORDER_MAX 3 // highest VIEWPIDL
  67. // Search View > VIEWPIDL_ORDER_MAX because its
  68. // not enumerated with the rest of the views
  69. // (esentially its not a "view" to the caller,
  70. // but this is how its implemented under the hood)
  71. #define VIEWPIDL_SEARCH 0x4C44
  72. // FILETIME secticks
  73. #define FILE_SEC_TICKS (10000000)
  74. // SECS PER DAY
  75. #define DAY_SECS (24*60*60)
  76. // Due hack used in shdocvw for recognizing LOCATION pidl, make sure neither byte
  77. // has 4's and 1's bit set (ie 0x50 & value == 0 for both bytes)
  78. #define CEIPIDL_SIGN 0x6360 //cP
  79. #define IDIPIDL_SIGN 0x6369 //ci interval id
  80. #define IDTPIDL_SIGN 0x6364 //cd interval id (TODAY)
  81. #define IDDPIDL_SIGN 0x6365 //ce domain id
  82. #define HEIPIDL_SIGN 0x6368 //ch history leaf pidl
  83. #define VIEWPIDL_SIGN 0x6366 /*mm: this is a "history view" pidl to allow
  84. multiple 'views' on the history */
  85. #define FSWPIDL_SIGN 0x6367
  86. #define VALID_IDSIGN(usSign) ((usSign) == IDIPIDL_SIGN || (usSign) == IDTPIDL_SIGN || (usSign) == IDDPIDL_SIGN)
  87. #define EQUIV_IDSIGN(usSign1,usSign2) ((usSign1)==(usSign2)|| \
  88. ((usSign1)==IDIPIDL_SIGN && (usSign2)==IDTPIDL_SIGN)|| \
  89. ((usSign2)==IDIPIDL_SIGN && (usSign1)==IDTPIDL_SIGN))
  90. #define IS_VALID_VIEWPIDL(pidl) ( (((LPBASEPIDL)pidl)->cb >= sizeof(VIEWPIDL)) && \
  91. (((LPBASEPIDL)pidl)->usSign == (USHORT)VIEWPIDL_SIGN) )
  92. #define IS_EQUAL_VIEWPIDL(pidl1,pidl2) ((IS_VALID_VIEWPIDL(pidl1)) && (IS_VALID_VIEWPIDL(pidl2)) && \
  93. (((LPVIEWPIDL)pidl1)->usViewType == ((LPVIEWPIDL)pidl2)->usViewType) && \
  94. (((LPVIEWPIDL)pidl1)->usExtra == ((LPVIEWPIDL)pidl2)->usExtra))
  95. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  96. #define _ILSkip(pidl, cb) ((LPITEMIDLIST)(((BYTE*)(pidl))+cb))
  97. #define _ILNext(pidl) _ILSkip(pidl, (pidl)->mkid.cb)
  98. #ifdef __cplusplus
  99. extern "C" {
  100. #endif
  101. // Abandon mutex after 2 minutes of waiting
  102. #define FAILSAFE_TIMEOUT (120000)
  103. extern HANDLE g_hMutexHistory;
  104. extern const CHAR c_szOpen[];
  105. extern const CHAR c_szDelcache[];
  106. extern const CHAR c_szProperties[];
  107. extern const CHAR c_szCopy[];
  108. extern const TCHAR c_szHistPrefix[];
  109. #ifdef __cplusplus
  110. };
  111. #endif
  112. typedef enum
  113. {
  114. FOLDER_TYPE_Hist = 1,
  115. FOLDER_TYPE_HistInterval,
  116. FOLDER_TYPE_HistDomain,
  117. FOLDER_TYPE_HistItem
  118. } FOLDER_TYPE;
  119. #define IsLeaf(x) (x == FOLDER_TYPE_HistDomain)
  120. #define IsHistoryFolder(x) (x==FOLDER_TYPE_Hist||x==FOLDER_TYPE_HistInterval||x==FOLDER_TYPE_HistDomain)
  121. //IE64 compatible pointer difference
  122. #define PtrDifference(x,y) ((LPBYTE)(x)-(LPBYTE)(y))
  123. //BOOL DeleteUrlCacheEntry(LPCSTR lpszUrlName);
  124. #include "hsfutils.h" // NOTE: must come at end to get all the definitions
  125. #endif // _LOCAL_H_