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.

1322 lines
39 KiB

  1. /*++
  2. Copyright (c) 1994 Microsoft Corporation
  3. Module Name:
  4. cache.hxx
  5. Abstract:
  6. master include file.
  7. Author:
  8. Madan Appiah (madana) 12-Apr-1995
  9. Environment:
  10. User Mode - Win32
  11. Revision History:
  12. --*/
  13. #ifndef _CACHE_HXX_
  14. #define _CACHE_HXX_
  15. // ---- start of wininet.h includes
  16. #if defined(__cplusplus)
  17. extern "C" {
  18. #endif
  19. #if !defined(_WINX32_)
  20. #define URLCACHEAPI DECLSPEC_IMPORT
  21. #else
  22. #define URLCACHEAPI
  23. #endif
  24. //
  25. // cache flags
  26. //
  27. #define INTERNET_FLAG_NO_CACHE_WRITE 0x04000000 // don't write this item to the cache
  28. #define INTERNET_FLAG_DONT_CACHE INTERNET_FLAG_NO_CACHE_WRITE
  29. #define INTERNET_FLAG_MAKE_PERSISTENT 0x02000000 // make this item persistent in cache
  30. #define INTERNET_FLAG_FROM_CACHE 0x01000000 // use offline semantics
  31. #define INTERNET_FLAG_OFFLINE INTERNET_FLAG_FROM_CACHE
  32. //
  33. // more caching flags
  34. //
  35. #define INTERNET_FLAG_RESYNCHRONIZE 0x00000800 // asking wininet to update an item if it is newer
  36. #define INTERNET_FLAG_HYPERLINK 0x00000400 // asking wininet to do hyperlinking semantic which works right for scripts
  37. #define INTERNET_FLAG_NO_UI 0x00000200 // no cookie popup
  38. #define INTERNET_FLAG_PRAGMA_NOCACHE 0x00000100 // asking wininet to add "pragma: no-cache"
  39. #define INTERNET_FLAG_CACHE_ASYNC 0x00000080 // ok to perform lazy cache-write
  40. #define INTERNET_FLAG_FORMS_SUBMIT 0x00000040 // this is a forms submit
  41. #define INTERNET_FLAG_FWD_BACK 0x00000020 // fwd-back button op
  42. #define INTERNET_FLAG_NEED_FILE 0x00000010 // need a file for this request
  43. #define INTERNET_FLAG_MUST_CACHE_REQUEST INTERNET_FLAG_NEED_FILE
  44. //
  45. // URLCACHE APIs
  46. //
  47. //
  48. // datatype definitions.
  49. //
  50. //
  51. // cache entry type flags.
  52. //
  53. #define NORMAL_CACHE_ENTRY 0x00000001
  54. #define STICKY_CACHE_ENTRY 0x00000004
  55. #define EDITED_CACHE_ENTRY 0x00000008
  56. #define TRACK_OFFLINE_CACHE_ENTRY 0x00000010
  57. #define TRACK_ONLINE_CACHE_ENTRY 0x00000020
  58. #define SPARSE_CACHE_ENTRY 0x00010000
  59. #define COOKIE_CACHE_ENTRY 0x00100000
  60. #define URLHISTORY_CACHE_ENTRY 0x00200000
  61. #define URLCACHE_FIND_DEFAULT_FILTER NORMAL_CACHE_ENTRY \
  62. | COOKIE_CACHE_ENTRY \
  63. | URLHISTORY_CACHE_ENTRY \
  64. | TRACK_OFFLINE_CACHE_ENTRY \
  65. | TRACK_ONLINE_CACHE_ENTRY \
  66. | STICKY_CACHE_ENTRY
  67. //
  68. // INTERNET_CACHE_ENTRY_INFO -
  69. //
  70. #if _MSC_VER >= 1200
  71. #pragma warning(push)
  72. #endif
  73. #pragma warning(disable:4201)
  74. typedef struct _INTERNET_CACHE_ENTRY_INFOA {
  75. DWORD dwStructSize; // version of cache system.
  76. LPSTR lpszSourceUrlName; // embedded pointer to the URL name string.
  77. LPSTR lpszLocalFileName; // embedded pointer to the local file name.
  78. DWORD CacheEntryType; // cache type bit mask.
  79. DWORD dwUseCount; // current users count of the cache entry.
  80. DWORD dwHitRate; // num of times the cache entry was retrieved.
  81. DWORD dwSizeLow; // low DWORD of the file size.
  82. DWORD dwSizeHigh; // high DWORD of the file size.
  83. FILETIME LastModifiedTime; // last modified time of the file in GMT format.
  84. FILETIME ExpireTime; // expire time of the file in GMT format
  85. FILETIME LastAccessTime; // last accessed time in GMT format
  86. FILETIME LastSyncTime; // last time the URL was synchronized
  87. // with the source
  88. LPSTR lpHeaderInfo; // embedded pointer to the header info.
  89. DWORD dwHeaderInfoSize; // size of the above header.
  90. LPSTR lpszFileExtension; // File extension used to retrive the urldata as a file.
  91. union { // Exemption delta from last access time.
  92. DWORD dwReserved;
  93. DWORD dwExemptDelta;
  94. }; // Exemption delta from last access
  95. } INTERNET_CACHE_ENTRY_INFOA, * LPINTERNET_CACHE_ENTRY_INFOA;
  96. typedef struct _INTERNET_CACHE_ENTRY_INFOW {
  97. DWORD dwStructSize; // version of cache system.
  98. LPWSTR lpszSourceUrlName; // embedded pointer to the URL name string.
  99. LPWSTR lpszLocalFileName; // embedded pointer to the local file name.
  100. DWORD CacheEntryType; // cache type bit mask.
  101. DWORD dwUseCount; // current users count of the cache entry.
  102. DWORD dwHitRate; // num of times the cache entry was retrieved.
  103. DWORD dwSizeLow; // low DWORD of the file size.
  104. DWORD dwSizeHigh; // high DWORD of the file size.
  105. FILETIME LastModifiedTime; // last modified time of the file in GMT format.
  106. FILETIME ExpireTime; // expire time of the file in GMT format
  107. FILETIME LastAccessTime; // last accessed time in GMT format
  108. FILETIME LastSyncTime; // last time the URL was synchronized
  109. // with the source
  110. LPWSTR lpHeaderInfo; // embedded pointer to the header info.
  111. DWORD dwHeaderInfoSize; // size of the above header.
  112. LPWSTR lpszFileExtension; // File extension used to retrive the urldata as a file.
  113. union { // Exemption delta from last access time.
  114. DWORD dwReserved;
  115. DWORD dwExemptDelta;
  116. }; // Exemption delta from last access
  117. } INTERNET_CACHE_ENTRY_INFOW, * LPINTERNET_CACHE_ENTRY_INFOW;
  118. #ifdef UNICODE
  119. typedef INTERNET_CACHE_ENTRY_INFOW INTERNET_CACHE_ENTRY_INFO;
  120. typedef LPINTERNET_CACHE_ENTRY_INFOW LPINTERNET_CACHE_ENTRY_INFO;
  121. #else
  122. typedef INTERNET_CACHE_ENTRY_INFOA INTERNET_CACHE_ENTRY_INFO;
  123. typedef LPINTERNET_CACHE_ENTRY_INFOA LPINTERNET_CACHE_ENTRY_INFO;
  124. #endif // UNICODE
  125. struct CACHE_ENTRY_INFOEX : INTERNET_CACHE_ENTRY_INFO
  126. {
  127. FILETIME ftDownload;
  128. FILETIME ftPostCheck;
  129. };
  130. #if _MSC_VER >= 1200
  131. #pragma warning(pop)
  132. #else
  133. #pragma warning(default:4201)
  134. #endif
  135. typedef struct _INTERNET_CACHE_TIMESTAMPS {
  136. FILETIME ftExpires;
  137. FILETIME ftLastModified;
  138. } INTERNET_CACHE_TIMESTAMPS, *LPINTERNET_CACHE_TIMESTAMPS;
  139. //
  140. // Cache Group
  141. //
  142. typedef LONGLONG GROUPID;
  143. //
  144. // Cache Group Flags
  145. //
  146. #define CACHEGROUP_ATTRIBUTE_GET_ALL 0xffffffff
  147. #define CACHEGROUP_ATTRIBUTE_BASIC 0x00000001
  148. #define CACHEGROUP_ATTRIBUTE_FLAG 0x00000002
  149. #define CACHEGROUP_ATTRIBUTE_TYPE 0x00000004
  150. #define CACHEGROUP_ATTRIBUTE_QUOTA 0x00000008
  151. #define CACHEGROUP_ATTRIBUTE_GROUPNAME 0x00000010
  152. #define CACHEGROUP_ATTRIBUTE_STORAGE 0x00000020
  153. #define CACHEGROUP_FLAG_NONPURGEABLE 0x00000001
  154. #define CACHEGROUP_FLAG_GIDONLY 0x00000004
  155. #define CACHEGROUP_FLAG_FLUSHURL_ONDELETE 0x00000002
  156. #define CACHEGROUP_SEARCH_ALL 0x00000000
  157. #define CACHEGROUP_SEARCH_BYURL 0x00000001
  158. #define CACHEGROUP_TYPE_INVALID 0x00000001
  159. //
  160. // updatable cache group fields
  161. //
  162. #define CACHEGROUP_READWRITE_MASK \
  163. CACHEGROUP_ATTRIBUTE_TYPE \
  164. | CACHEGROUP_ATTRIBUTE_QUOTA \
  165. | CACHEGROUP_ATTRIBUTE_GROUPNAME \
  166. | CACHEGROUP_ATTRIBUTE_STORAGE
  167. //
  168. // INTERNET_CACHE_GROUP_INFO
  169. //
  170. #define GROUPNAME_MAX_LENGTH 120
  171. #define GROUP_OWNER_STORAGE_SIZE 4
  172. typedef struct _INTERNET_CACHE_GROUP_INFOA {
  173. DWORD dwGroupSize;
  174. DWORD dwGroupFlags;
  175. DWORD dwGroupType;
  176. DWORD dwDiskUsage; // in KB
  177. DWORD dwDiskQuota; // in KB
  178. DWORD dwOwnerStorage[GROUP_OWNER_STORAGE_SIZE];
  179. CHAR szGroupName[GROUPNAME_MAX_LENGTH];
  180. } INTERNET_CACHE_GROUP_INFOA, * LPINTERNET_CACHE_GROUP_INFOA;
  181. typedef struct _INTERNET_CACHE_GROUP_INFOW {
  182. DWORD dwGroupSize;
  183. DWORD dwGroupFlags;
  184. DWORD dwGroupType;
  185. DWORD dwDiskUsage; // in KB
  186. DWORD dwDiskQuota; // in KB
  187. DWORD dwOwnerStorage[GROUP_OWNER_STORAGE_SIZE];
  188. WCHAR szGroupName[GROUPNAME_MAX_LENGTH];
  189. } INTERNET_CACHE_GROUP_INFOW, * LPINTERNET_CACHE_GROUP_INFOW;
  190. #ifdef UNICODE
  191. typedef INTERNET_CACHE_GROUP_INFOW INTERNET_CACHE_GROUP_INFO;
  192. typedef LPINTERNET_CACHE_GROUP_INFOW LPINTERNET_CACHE_GROUP_INFO;
  193. #else
  194. typedef INTERNET_CACHE_GROUP_INFOA INTERNET_CACHE_GROUP_INFO;
  195. typedef LPINTERNET_CACHE_GROUP_INFOA LPINTERNET_CACHE_GROUP_INFO;
  196. #endif // UNICODE
  197. //
  198. // constants for InternetTimeFromSystemTime
  199. //
  200. #define INTERNET_RFC1123_FORMAT 0
  201. #define INTERNET_RFC1123_BUFSIZE 30
  202. // #define InternetCrackUrl WinHttpCrackUrl
  203. //
  204. // Cache APIs
  205. //
  206. BOOLAPI
  207. CreateUrlCacheEntryA(
  208. IN LPCSTR lpszUrlName,
  209. IN DWORD dwExpectedFileSize,
  210. IN LPCSTR lpszFileExtension,
  211. OUT LPSTR lpszFileName,
  212. IN DWORD dwReserved
  213. );
  214. BOOLAPI
  215. CreateUrlCacheEntryW(
  216. IN LPCWSTR lpszUrlName,
  217. IN DWORD dwExpectedFileSize,
  218. IN LPCWSTR lpszFileExtension,
  219. OUT LPWSTR lpszFileName,
  220. IN DWORD dwReserved
  221. );
  222. #ifdef UNICODE
  223. #define CreateUrlCacheEntry CreateUrlCacheEntryW
  224. #else
  225. #define CreateUrlCacheEntry CreateUrlCacheEntryA
  226. #endif // !UNICODE
  227. #ifndef USE_FIXED_COMMIT_URL_CACHE_ENTRY
  228. // Temporary state of affairs until we reconcile our apis.
  229. // Why are we doing this? HeaderInfo _should_ be string data.
  230. // However, one group is passing binary data instead. For the
  231. // unicode api, we've decided to disallow this, but this
  232. // brings up an inconsistency between the u and a apis, which
  233. // is undesirable.
  234. // For Beta 1, we'll go with this behaviour, but in future releases
  235. // we want to make these apis consistent.
  236. BOOLAPI
  237. CommitUrlCacheEntryA(
  238. IN LPCSTR lpszUrlName,
  239. IN LPCSTR lpszLocalFileName,
  240. IN FILETIME ExpireTime,
  241. IN FILETIME LastModifiedTime,
  242. IN DWORD CacheEntryType,
  243. IN LPBYTE lpHeaderInfo,
  244. IN DWORD dwHeaderSize,
  245. IN LPCSTR lpszFileExtension,
  246. IN LPCSTR lpszOriginalUrl
  247. );
  248. BOOLAPI
  249. CommitUrlCacheEntryW(
  250. IN LPCWSTR lpszUrlName,
  251. IN LPCWSTR lpszLocalFileName,
  252. IN FILETIME ExpireTime,
  253. IN FILETIME LastModifiedTime,
  254. IN DWORD CacheEntryType,
  255. IN LPWSTR lpHeaderInfo,
  256. IN DWORD dwHeaderSize,
  257. IN LPCWSTR lpszFileExtension,
  258. IN LPCWSTR lpszOriginalUrl
  259. );
  260. #ifdef UNICODE
  261. #define CommitUrlCacheEntry CommitUrlCacheEntryW
  262. #else
  263. #define CommitUrlCacheEntry CommitUrlCacheEntryA
  264. #endif
  265. #else
  266. CommitUrlCacheEntryA(
  267. IN LPCSTR lpszUrlName,
  268. IN LPCSTR lpszLocalFileName,
  269. IN FILETIME ExpireTime,
  270. IN FILETIME LastModifiedTime,
  271. IN DWORD CacheEntryType,
  272. IN LPCSTR lpHeaderInfo,
  273. IN DWORD dwHeaderSize,
  274. IN LPCSTR lpszFileExtension,
  275. IN LPCSTR lpszOriginalUrl
  276. );
  277. CommitUrlCacheEntryW(
  278. IN LPCWSTR lpszUrlName,
  279. IN LPCWSTR lpszLocalFileName,
  280. IN FILETIME ExpireTime,
  281. IN FILETIME LastModifiedTime,
  282. IN DWORD CacheEntryType,
  283. IN LPCWSTR lpHeaderInfo,
  284. IN DWORD dwHeaderSize,
  285. IN LPCWSTR lpszFileExtension,
  286. IN LPCWSTR lpszOriginalUrl
  287. );
  288. #ifdef UNICODE
  289. #define CommitUrlCacheEntry CommitUrlCacheEntryW
  290. #else
  291. #define CommitUrlCacheEntry CommitUrlCacheEntryA
  292. #endif // !UNICODE
  293. #endif
  294. BOOLAPI
  295. RetrieveUrlCacheEntryFileA(
  296. IN LPCSTR lpszUrlName,
  297. OUT LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  298. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize,
  299. IN DWORD dwReserved
  300. );
  301. BOOLAPI
  302. RetrieveUrlCacheEntryFileW(
  303. IN LPCWSTR lpszUrlName,
  304. OUT LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  305. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize,
  306. IN DWORD dwReserved
  307. );
  308. #ifdef UNICODE
  309. #define RetrieveUrlCacheEntryFile RetrieveUrlCacheEntryFileW
  310. #else
  311. #define RetrieveUrlCacheEntryFile RetrieveUrlCacheEntryFileA
  312. #endif // !UNICODE
  313. BOOLAPI
  314. UnlockUrlCacheEntryFileA(
  315. IN LPCSTR lpszUrlName,
  316. IN DWORD dwReserved
  317. );
  318. BOOLAPI
  319. UnlockUrlCacheEntryFileW(
  320. IN LPCWSTR lpszUrlName,
  321. IN DWORD dwReserved
  322. );
  323. #ifdef UNICODE
  324. #define UnlockUrlCacheEntryFile UnlockUrlCacheEntryFileW
  325. #else
  326. #ifdef _WINX32_
  327. #define UnlockUrlCacheEntryFile UnlockUrlCacheEntryFileA
  328. #else
  329. BOOLAPI
  330. UnlockUrlCacheEntryFile(
  331. IN LPCSTR lpszUrlName,
  332. IN DWORD dwReserved
  333. );
  334. #endif // _WINX32_
  335. #endif // !UNICODE
  336. HANDLE
  337. WINAPI
  338. RetrieveUrlCacheEntryStreamA(
  339. IN LPCSTR lpszUrlName,
  340. OUT LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  341. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize,
  342. IN BOOL fRandomRead,
  343. IN DWORD dwReserved
  344. );
  345. HANDLE
  346. WINAPI
  347. RetrieveUrlCacheEntryStreamW(
  348. IN LPCWSTR lpszUrlName,
  349. OUT LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  350. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize,
  351. IN BOOL fRandomRead,
  352. IN DWORD dwReserved
  353. );
  354. #ifdef UNICODE
  355. #define RetrieveUrlCacheEntryStream RetrieveUrlCacheEntryStreamW
  356. #else
  357. #define RetrieveUrlCacheEntryStream RetrieveUrlCacheEntryStreamA
  358. #endif // !UNICODE
  359. BOOLAPI
  360. ReadUrlCacheEntryStream(
  361. IN HANDLE hUrlCacheStream,
  362. IN DWORD dwLocation,
  363. IN OUT LPVOID lpBuffer,
  364. IN OUT LPDWORD lpdwLen,
  365. IN DWORD Reserved
  366. );
  367. BOOLAPI
  368. UnlockUrlCacheEntryStream(
  369. IN HANDLE hUrlCacheStream,
  370. IN DWORD Reserved
  371. );
  372. BOOLAPI
  373. GetUrlCacheEntryInfoA(
  374. IN LPCSTR lpszUrlName,
  375. OUT LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  376. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize
  377. );
  378. BOOLAPI
  379. GetUrlCacheEntryInfoW(
  380. IN LPCWSTR lpszUrlName,
  381. OUT LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  382. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize
  383. );
  384. #ifdef UNICODE
  385. #define GetUrlCacheEntryInfo GetUrlCacheEntryInfoW
  386. #else
  387. #define GetUrlCacheEntryInfo GetUrlCacheEntryInfoA
  388. #endif // !UNICODE
  389. URLCACHEAPI
  390. HANDLE
  391. WINAPI
  392. FindFirstUrlCacheGroup(
  393. IN DWORD dwFlags,
  394. IN DWORD dwFilter,
  395. IN LPVOID lpSearchCondition,
  396. IN DWORD dwSearchCondition,
  397. OUT GROUPID* lpGroupId,
  398. IN OUT LPVOID lpReserved
  399. );
  400. URLCACHEAPI
  401. BOOL
  402. WINAPI
  403. FindNextUrlCacheGroup(
  404. IN HANDLE hFind,
  405. OUT GROUPID* lpGroupId,
  406. IN OUT LPVOID lpReserved
  407. );
  408. URLCACHEAPI
  409. BOOL
  410. WINAPI
  411. GetUrlCacheGroupAttributeA(
  412. IN GROUPID gid,
  413. IN DWORD dwFlags,
  414. IN DWORD dwAttributes,
  415. OUT LPINTERNET_CACHE_GROUP_INFOA lpGroupInfo,
  416. IN OUT LPDWORD lpdwGroupInfo,
  417. IN OUT LPVOID lpReserved
  418. );
  419. URLCACHEAPI
  420. BOOL
  421. WINAPI
  422. GetUrlCacheGroupAttributeW(
  423. IN GROUPID gid,
  424. IN DWORD dwFlags,
  425. IN DWORD dwAttributes,
  426. OUT LPINTERNET_CACHE_GROUP_INFOW lpGroupInfo,
  427. IN OUT LPDWORD lpdwGroupInfo,
  428. IN OUT LPVOID lpReserved
  429. );
  430. #ifdef UNICODE
  431. #define GetUrlCacheGroupAttribute GetUrlCacheGroupAttributeW
  432. #else
  433. #define GetUrlCacheGroupAttribute GetUrlCacheGroupAttributeA
  434. #endif // !UNICODE
  435. URLCACHEAPI
  436. BOOL
  437. WINAPI
  438. SetUrlCacheGroupAttributeA(
  439. IN GROUPID gid,
  440. IN DWORD dwFlags,
  441. IN DWORD dwAttributes,
  442. IN LPINTERNET_CACHE_GROUP_INFOA lpGroupInfo,
  443. IN OUT LPVOID lpReserved
  444. );
  445. URLCACHEAPI
  446. BOOL
  447. WINAPI
  448. SetUrlCacheGroupAttributeW(
  449. IN GROUPID gid,
  450. IN DWORD dwFlags,
  451. IN DWORD dwAttributes,
  452. IN LPINTERNET_CACHE_GROUP_INFOW lpGroupInfo,
  453. IN OUT LPVOID lpReserved
  454. );
  455. #ifdef UNICODE
  456. #define SetUrlCacheGroupAttribute SetUrlCacheGroupAttributeW
  457. #else
  458. #define SetUrlCacheGroupAttribute SetUrlCacheGroupAttributeA
  459. #endif // !UNICODE
  460. GROUPID
  461. WINAPI
  462. CreateUrlCacheGroup(
  463. IN DWORD dwFlags,
  464. IN LPVOID lpReserved
  465. );
  466. BOOLAPI
  467. DeleteUrlCacheGroup(
  468. IN GROUPID GroupId,
  469. IN DWORD dwFlags,
  470. IN LPVOID lpReserved
  471. );
  472. BOOLAPI
  473. GetUrlCacheEntryInfoExA(
  474. IN LPCSTR lpszUrl,
  475. OUT LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  476. IN OUT LPDWORD lpdwCacheEntryInfoBufSize,
  477. OUT LPSTR lpszReserved, // must pass null
  478. IN OUT LPDWORD lpdwReserved, // must pass null
  479. LPVOID lpReserved, // must pass null
  480. DWORD dwFlags // reserved
  481. );
  482. BOOLAPI
  483. GetUrlCacheEntryInfoExW(
  484. IN LPCWSTR lpszUrl,
  485. OUT LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  486. IN OUT LPDWORD lpdwCacheEntryInfoBufSize,
  487. OUT LPWSTR lpszReserved, // must pass null
  488. IN OUT LPDWORD lpdwReserved, // must pass null
  489. LPVOID lpReserved, // must pass null
  490. DWORD dwFlags // reserved
  491. );
  492. #ifdef UNICODE
  493. #define GetUrlCacheEntryInfoEx GetUrlCacheEntryInfoExW
  494. #else
  495. #define GetUrlCacheEntryInfoEx GetUrlCacheEntryInfoExA
  496. #endif // !UNICODE
  497. #define CACHE_ENTRY_ATTRIBUTE_FC 0x00000004
  498. #define CACHE_ENTRY_HITRATE_FC 0x00000010
  499. #define CACHE_ENTRY_MODTIME_FC 0x00000040
  500. #define CACHE_ENTRY_EXPTIME_FC 0x00000080
  501. #define CACHE_ENTRY_ACCTIME_FC 0x00000100
  502. #define CACHE_ENTRY_SYNCTIME_FC 0x00000200
  503. #define CACHE_ENTRY_HEADERINFO_FC 0x00000400
  504. #define CACHE_ENTRY_EXEMPT_DELTA_FC 0x00000800
  505. BOOLAPI
  506. SetUrlCacheEntryInfoA(
  507. IN LPCSTR lpszUrlName,
  508. IN LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  509. IN DWORD dwFieldControl
  510. );
  511. BOOLAPI
  512. SetUrlCacheEntryInfoW(
  513. IN LPCWSTR lpszUrlName,
  514. IN LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  515. IN DWORD dwFieldControl
  516. );
  517. #ifdef UNICODE
  518. #define SetUrlCacheEntryInfo SetUrlCacheEntryInfoW
  519. #else
  520. #define SetUrlCacheEntryInfo SetUrlCacheEntryInfoA
  521. #endif // !UNICODE
  522. //
  523. // Cache Group Functions
  524. //
  525. GROUPID
  526. WINAPI
  527. CreateUrlCacheGroup(
  528. IN DWORD dwFlags,
  529. IN LPVOID lpReserved // must pass NULL
  530. );
  531. BOOLAPI
  532. DeleteUrlCacheGroup(
  533. IN GROUPID GroupId,
  534. IN DWORD dwFlags, // must pass 0
  535. IN LPVOID lpReserved // must pass NULL
  536. );
  537. // Flags for SetUrlCacheEntryGroup
  538. #define INTERNET_CACHE_GROUP_ADD 0
  539. #define INTERNET_CACHE_GROUP_REMOVE 1
  540. BOOLAPI
  541. SetUrlCacheEntryGroupA(
  542. IN LPCSTR lpszUrlName,
  543. IN DWORD dwFlags,
  544. IN GROUPID GroupId,
  545. IN LPBYTE pbGroupAttributes, // must pass NULL
  546. IN DWORD cbGroupAttributes, // must pass 0
  547. IN LPVOID lpReserved // must pass NULL
  548. );
  549. BOOLAPI
  550. SetUrlCacheEntryGroupW(
  551. IN LPCWSTR lpszUrlName,
  552. IN DWORD dwFlags,
  553. IN GROUPID GroupId,
  554. IN LPBYTE pbGroupAttributes, // must pass NULL
  555. IN DWORD cbGroupAttributes, // must pass 0
  556. IN LPVOID lpReserved // must pass NULL
  557. );
  558. #ifdef UNICODE
  559. #define SetUrlCacheEntryGroup SetUrlCacheEntryGroupW
  560. #else
  561. #ifdef _WINX32_
  562. #define SetUrlCacheEntryGroup SetUrlCacheEntryGroupA
  563. #else
  564. BOOLAPI
  565. SetUrlCacheEntryGroup(
  566. IN LPCSTR lpszUrlName,
  567. IN DWORD dwFlags,
  568. IN GROUPID GroupId,
  569. IN LPBYTE pbGroupAttributes, // must pass NULL
  570. IN DWORD cbGroupAttributes, // must pass 0
  571. IN LPVOID lpReserved // must pass NULL
  572. );
  573. #endif // _WINX32_
  574. #endif // !UNICODE
  575. HANDLE
  576. WINAPI
  577. FindFirstUrlCacheEntryExA(
  578. IN LPCSTR lpszUrlSearchPattern,
  579. IN DWORD dwFlags,
  580. IN DWORD dwFilter,
  581. IN GROUPID GroupId,
  582. OUT LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  583. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize,
  584. OUT LPVOID lpReserved, // must pass NULL
  585. IN OUT LPDWORD pcbReserved2, // must pass NULL
  586. IN LPVOID lpReserved3 // must pass NULL
  587. );
  588. HANDLE
  589. WINAPI
  590. FindFirstUrlCacheEntryExW(
  591. IN LPCWSTR lpszUrlSearchPattern,
  592. IN DWORD dwFlags,
  593. IN DWORD dwFilter,
  594. IN GROUPID GroupId,
  595. OUT LPINTERNET_CACHE_ENTRY_INFOW lpFirstCacheEntryInfo,
  596. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize,
  597. OUT LPVOID lpReserved, // must pass NULL
  598. IN OUT LPDWORD pcbReserved2, // must pass NULL
  599. IN LPVOID lpReserved3 // must pass NULL
  600. );
  601. #ifdef UNICODE
  602. #define FindFirstUrlCacheEntryEx FindFirstUrlCacheEntryExW
  603. #else
  604. #define FindFirstUrlCacheEntryEx FindFirstUrlCacheEntryExA
  605. #endif // !UNICODE
  606. BOOLAPI
  607. FindNextUrlCacheEntryExA(
  608. IN HANDLE hEnumHandle,
  609. OUT LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  610. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize,
  611. OUT LPVOID lpReserved, // must pass NULL
  612. IN OUT LPDWORD pcbReserved2, // must pass NULL
  613. IN LPVOID lpReserved3 // must pass NULL
  614. );
  615. BOOLAPI
  616. FindNextUrlCacheEntryExW(
  617. IN HANDLE hEnumHandle,
  618. OUT LPINTERNET_CACHE_ENTRY_INFOW lpFirstCacheEntryInfo,
  619. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize,
  620. OUT LPVOID lpReserved, // must pass NULL
  621. IN OUT LPDWORD pcbReserved2, // must pass NULL
  622. IN LPVOID lpReserved3 // must pass NULL
  623. );
  624. #ifdef UNICODE
  625. #define FindNextUrlCacheEntryEx FindNextUrlCacheEntryExW
  626. #else
  627. #define FindNextUrlCacheEntryEx FindNextUrlCacheEntryExA
  628. #endif // !UNICODE
  629. HANDLE
  630. WINAPI
  631. FindFirstUrlCacheEntryA(
  632. IN LPCSTR lpszUrlSearchPattern,
  633. OUT LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  634. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize
  635. );
  636. HANDLE
  637. WINAPI
  638. FindFirstUrlCacheEntryW(
  639. IN LPCWSTR lpszUrlSearchPattern,
  640. OUT LPINTERNET_CACHE_ENTRY_INFOW lpFirstCacheEntryInfo,
  641. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize
  642. );
  643. #ifdef UNICODE
  644. #define FindFirstUrlCacheEntry FindFirstUrlCacheEntryW
  645. #else
  646. #define FindFirstUrlCacheEntry FindFirstUrlCacheEntryA
  647. #endif // !UNICODE
  648. BOOLAPI
  649. FindNextUrlCacheEntryA(
  650. IN HANDLE hEnumHandle,
  651. OUT LPINTERNET_CACHE_ENTRY_INFOA lpNextCacheEntryInfo,
  652. IN OUT LPDWORD lpdwNextCacheEntryInfoBufferSize
  653. );
  654. BOOLAPI
  655. FindNextUrlCacheEntryW(
  656. IN HANDLE hEnumHandle,
  657. OUT LPINTERNET_CACHE_ENTRY_INFOW lpNextCacheEntryInfo,
  658. IN OUT LPDWORD lpdwNextCacheEntryInfoBufferSize
  659. );
  660. #ifdef UNICODE
  661. #define FindNextUrlCacheEntry FindNextUrlCacheEntryW
  662. #else
  663. #define FindNextUrlCacheEntry FindNextUrlCacheEntryA
  664. #endif // !UNICODE
  665. BOOLAPI
  666. FindCloseUrlCache(
  667. IN HANDLE hEnumHandle
  668. );
  669. BOOLAPI
  670. DeleteUrlCacheEntryA(
  671. IN LPCSTR lpszUrlName
  672. );
  673. BOOLAPI
  674. DeleteUrlCacheEntryW(
  675. IN LPCWSTR lpszUrlName
  676. );
  677. #ifdef UNICODE
  678. #define DeleteUrlCacheEntry DeleteUrlCacheEntryW
  679. #else
  680. #ifdef _WINX32_
  681. #define DeleteUrlCacheEntry DeleteUrlCacheEntryA
  682. #else
  683. BOOLAPI
  684. DeleteUrlCacheEntry(
  685. IN LPCSTR lpszUrlName
  686. );
  687. #endif // _WINX32_
  688. #endif // !UNICODE
  689. // ---- end of wininet.h
  690. // These variables are shared across the urlcache and the httpcache project, thus the need
  691. // to put it in this main header file
  692. // from wininet\dll\globals.cxx
  693. typedef enum {
  694. WININET_SYNC_MODE_NEVER=0,
  695. WININET_SYNC_MODE_ON_EXPIRY, // bogus
  696. WININET_SYNC_MODE_ONCE_PER_SESSION,
  697. WININET_SYNC_MODE_ALWAYS,
  698. WININET_SYNC_MODE_AUTOMATIC,
  699. WININET_SYNC_MODE_DEFAULT = WININET_SYNC_MODE_AUTOMATIC
  700. } WININET_SYNC_MODE;
  701. // ---- start of wininetp.h
  702. #define MAX_CACHE_ENTRY_INFO_SIZE 4096
  703. #define INTERNET_FLAG_BGUPDATE 0x00000008
  704. #define INTERNET_FLAG_UNUSED_4 0x00000004
  705. // DAV detection defines
  706. #define DAV_LEVEL1_STATUS 0x00000001
  707. #define DAV_COLLECTION_STATUS 0x00004000
  708. #define DAV_DETECTION_REQUIRED 0x00008000
  709. // WinHTTP error cases. Should be added to inetmsg.mc eventually
  710. #define ERROR_WINHTTP_NO_NEW_CONTAINERS (WINHTTP_ERROR_BASE + 51)
  711. // cache flags
  712. #define HTTP_1_1_CACHE_ENTRY 0x00000040
  713. #define STATIC_CACHE_ENTRY 0x00000080
  714. #define MUST_REVALIDATE_CACHE_ENTRY 0x00000100
  715. #define PENDING_DELETE_CACHE_ENTRY 0x00400000
  716. #define OTHER_USER_CACHE_ENTRY 0x00800000
  717. #define PRIVACY_IMPACTED_CACHE_ENTRY 0x02000000
  718. #define POST_RESPONSE_CACHE_ENTRY 0x04000000
  719. #define INSTALLED_CACHE_ENTRY 0x10000000
  720. #define POST_CHECK_CACHE_ENTRY 0x20000000
  721. #define IDENTITY_CACHE_ENTRY 0x80000000
  722. // We include some entry types even if app doesn't specifically ask for them.
  723. #define INCLUDE_BY_DEFAULT_CACHE_ENTRY \
  724. ( HTTP_1_1_CACHE_ENTRY \
  725. | STATIC_CACHE_ENTRY \
  726. | MUST_REVALIDATE_CACHE_ENTRY \
  727. | PRIVACY_IMPACTED_CACHE_ENTRY \
  728. | POST_CHECK_CACHE_ENTRY \
  729. )
  730. //
  731. // Well known sticky group ID
  732. //
  733. #define CACHEGROUP_ID_BUILTIN_STICKY 0x1000000000000007
  734. //
  735. // INTERNET_CACHE_CONFIG_PATH_ENTRY
  736. //
  737. typedef struct _INTERNET_CACHE_CONFIG_PATH_ENTRYA {
  738. CHAR CachePath[MAX_PATH];
  739. DWORD dwCacheSize; // in KBytes
  740. } INTERNET_CACHE_CONFIG_PATH_ENTRYA, * LPINTERNET_CACHE_CONFIG_PATH_ENTRYA;
  741. typedef struct _INTERNET_CACHE_CONFIG_PATH_ENTRYW {
  742. WCHAR CachePath[MAX_PATH];
  743. DWORD dwCacheSize; // in KBytes
  744. } INTERNET_CACHE_CONFIG_PATH_ENTRYW, * LPINTERNET_CACHE_CONFIG_PATH_ENTRYW;
  745. #ifdef UNICODE
  746. typedef INTERNET_CACHE_CONFIG_PATH_ENTRYW INTERNET_CACHE_CONFIG_PATH_ENTRY;
  747. typedef LPINTERNET_CACHE_CONFIG_PATH_ENTRYW LPINTERNET_CACHE_CONFIG_PATH_ENTRY;
  748. #else
  749. typedef INTERNET_CACHE_CONFIG_PATH_ENTRYA INTERNET_CACHE_CONFIG_PATH_ENTRY;
  750. typedef LPINTERNET_CACHE_CONFIG_PATH_ENTRYA LPINTERNET_CACHE_CONFIG_PATH_ENTRY;
  751. #endif // UNICODE
  752. //
  753. // INTERNET_CACHE_CONFIG_INFO
  754. //
  755. #if _MSC_VER >= 1200
  756. #pragma warning(push)
  757. #endif
  758. #pragma warning(disable:4201)
  759. typedef struct _INTERNET_CACHE_CONFIG_INFOA {
  760. DWORD dwStructSize;
  761. DWORD dwContainer;
  762. DWORD dwQuota;
  763. DWORD dwReserved4;
  764. BOOL fPerUser;
  765. DWORD dwSyncMode;
  766. DWORD dwNumCachePaths;
  767. union
  768. {
  769. struct
  770. {
  771. CHAR CachePath[MAX_PATH];
  772. DWORD dwCacheSize;
  773. };
  774. INTERNET_CACHE_CONFIG_PATH_ENTRYA CachePaths[ANYSIZE_ARRAY];
  775. };
  776. DWORD dwNormalUsage;
  777. DWORD dwExemptUsage;
  778. } INTERNET_CACHE_CONFIG_INFOA, * LPINTERNET_CACHE_CONFIG_INFOA;
  779. typedef struct _INTERNET_CACHE_CONFIG_INFOW {
  780. DWORD dwStructSize;
  781. DWORD dwContainer;
  782. DWORD dwQuota;
  783. DWORD dwReserved4;
  784. BOOL fPerUser;
  785. DWORD dwSyncMode;
  786. DWORD dwNumCachePaths;
  787. union
  788. {
  789. struct
  790. {
  791. WCHAR CachePath[MAX_PATH];
  792. DWORD dwCacheSize;
  793. };
  794. INTERNET_CACHE_CONFIG_PATH_ENTRYW CachePaths[ANYSIZE_ARRAY];
  795. };
  796. DWORD dwNormalUsage;
  797. DWORD dwExemptUsage;
  798. } INTERNET_CACHE_CONFIG_INFOW, * LPINTERNET_CACHE_CONFIG_INFOW;
  799. #ifdef UNICODE
  800. typedef INTERNET_CACHE_CONFIG_INFOW INTERNET_CACHE_CONFIG_INFO;
  801. typedef LPINTERNET_CACHE_CONFIG_INFOW LPINTERNET_CACHE_CONFIG_INFO;
  802. #else
  803. typedef INTERNET_CACHE_CONFIG_INFOA INTERNET_CACHE_CONFIG_INFO;
  804. typedef LPINTERNET_CACHE_CONFIG_INFOA LPINTERNET_CACHE_CONFIG_INFO;
  805. #endif // UNICODE
  806. #if _MSC_VER >= 1200
  807. #pragma warning(pop)
  808. #else
  809. #pragma warning(disable:4201)
  810. #endif
  811. BOOLAPI
  812. IsUrlCacheEntryExpiredA(
  813. IN LPCSTR lpszUrlName,
  814. IN DWORD dwFlags,
  815. IN OUT FILETIME* pftLastModified
  816. );
  817. BOOLAPI
  818. IsUrlCacheEntryExpiredW(
  819. IN LPCWSTR lpszUrlName,
  820. IN DWORD dwFlags,
  821. IN OUT FILETIME* pftLastModified
  822. );
  823. #ifdef UNICODE
  824. #define IsUrlCacheEntryExpired IsUrlCacheEntryExpiredW
  825. #else
  826. #define IsUrlCacheEntryExpired IsUrlCacheEntryExpiredA
  827. #endif // !UNICODE
  828. #define INTERNET_CACHE_FLAG_ALLOW_COLLISIONS 0x00000100
  829. #define INTERNET_CACHE_FLAG_INSTALLED_ENTRY 0x00000200
  830. #define INTERNET_CACHE_FLAG_ENTRY_OR_MAPPING 0x00000400
  831. #define INTERNET_CACHE_FLAG_ADD_FILENAME_ONLY 0x00000800
  832. #define INTERNET_CACHE_FLAG_GET_STRUCT_ONLY 0x00001000
  833. #define CACHE_ENTRY_TYPE_FC 0x00001000
  834. #define CACHE_ENTRY_MODIFY_DATA_FC 0x80000000 // this appears unused
  835. // Flags for CreateContainer
  836. #define INTERNET_CACHE_CONTAINER_NOSUBDIRS (0x1)
  837. #define INTERNET_CACHE_CONTAINER_AUTODELETE (0x2)
  838. #define INTERNET_CACHE_CONTAINER_RESERVED1 (0x4)
  839. #define INTERNET_CACHE_CONTAINER_NODESKTOPINIT (0x8)
  840. #define INTERNET_CACHE_CONTAINER_MAP_ENABLED (0x10)
  841. BOOLAPI
  842. CreateUrlCacheContainerA(
  843. IN LPCSTR Name,
  844. IN LPCSTR lpCachePrefix,
  845. LPCSTR lpszCachePath,
  846. IN DWORD KBCacheLimit,
  847. IN DWORD dwContainerType,
  848. IN DWORD dwOptions,
  849. IN OUT LPVOID pvBuffer,
  850. IN OUT LPDWORD cbBuffer
  851. );
  852. BOOLAPI
  853. CreateUrlCacheContainerW(
  854. IN LPCWSTR Name,
  855. IN LPCWSTR lpCachePrefix,
  856. LPCWSTR lpszCachePath,
  857. IN DWORD KBCacheLimit,
  858. IN DWORD dwContainerType,
  859. IN DWORD dwOptions,
  860. IN OUT LPVOID pvBuffer,
  861. IN OUT LPDWORD cbBuffer
  862. );
  863. #ifdef UNICODE
  864. #define CreateUrlCacheContainer CreateUrlCacheContainerW
  865. #else
  866. #define CreateUrlCacheContainer CreateUrlCacheContainerA
  867. #endif // !UNICODE
  868. BOOLAPI
  869. DeleteUrlCacheContainerA(
  870. IN LPCSTR Name,
  871. IN DWORD dwOptions
  872. );
  873. BOOLAPI
  874. DeleteUrlCacheContainerW(
  875. IN LPCWSTR Name,
  876. IN DWORD dwOptions
  877. );
  878. #ifdef UNICODE
  879. #define DeleteUrlCacheContainer DeleteUrlCacheContainerW
  880. #else
  881. #define DeleteUrlCacheContainer DeleteUrlCacheContainerA
  882. #endif // !UNICODE
  883. //
  884. // INTERNET_CACHE_ENTRY_INFO -
  885. //
  886. typedef struct _INTERNET_CACHE_CONTAINER_INFOA {
  887. DWORD dwCacheVersion; // version of software
  888. LPSTR lpszName; // embedded pointer to the container name string.
  889. LPSTR lpszCachePrefix; // embedded pointer to the container URL prefix
  890. LPSTR lpszVolumeLabel; // embedded pointer to the container volume label if any.
  891. LPSTR lpszVolumeTitle; // embedded pointer to the container volume title if any.
  892. } INTERNET_CACHE_CONTAINER_INFOA, * LPINTERNET_CACHE_CONTAINER_INFOA;
  893. typedef struct _INTERNET_CACHE_CONTAINER_INFOW {
  894. DWORD dwCacheVersion; // version of software
  895. LPWSTR lpszName; // embedded pointer to the container name string.
  896. LPWSTR lpszCachePrefix; // embedded pointer to the container URL prefix
  897. LPWSTR lpszVolumeLabel; // embedded pointer to the container volume label if any.
  898. LPWSTR lpszVolumeTitle; // embedded pointer to the container volume title if any.
  899. } INTERNET_CACHE_CONTAINER_INFOW, * LPINTERNET_CACHE_CONTAINER_INFOW;
  900. #ifdef UNICODE
  901. typedef INTERNET_CACHE_CONTAINER_INFOW INTERNET_CACHE_CONTAINER_INFO;
  902. typedef LPINTERNET_CACHE_CONTAINER_INFOW LPINTERNET_CACHE_CONTAINER_INFO;
  903. #else
  904. typedef INTERNET_CACHE_CONTAINER_INFOA INTERNET_CACHE_CONTAINER_INFO;
  905. typedef LPINTERNET_CACHE_CONTAINER_INFOA LPINTERNET_CACHE_CONTAINER_INFO;
  906. #endif // UNICODE
  907. // FindFirstContainer options
  908. #define CACHE_FIND_CONTAINER_RETURN_NOCHANGE (0x1)
  909. HANDLE
  910. WINAPI
  911. FindFirstUrlCacheContainerA(
  912. IN OUT LPDWORD pdwModified,
  913. OUT LPINTERNET_CACHE_CONTAINER_INFOA lpContainerInfo,
  914. IN OUT LPDWORD lpdwContainerInfoBufferSize,
  915. IN DWORD dwOptions
  916. );
  917. HANDLE
  918. WINAPI
  919. FindFirstUrlCacheContainerW(
  920. IN OUT LPDWORD pdwModified,
  921. OUT LPINTERNET_CACHE_CONTAINER_INFOW lpContainerInfo,
  922. IN OUT LPDWORD lpdwContainerInfoBufferSize,
  923. IN DWORD dwOptions
  924. );
  925. #ifdef UNICODE
  926. #define FindFirstUrlCacheContainer FindFirstUrlCacheContainerW
  927. #else
  928. #define FindFirstUrlCacheContainer FindFirstUrlCacheContainerA
  929. #endif // !UNICODE
  930. BOOLAPI
  931. FindNextUrlCacheContainerA(
  932. IN HANDLE hEnumHandle,
  933. OUT LPINTERNET_CACHE_CONTAINER_INFOA lpContainerInfo,
  934. IN OUT LPDWORD lpdwContainerInfoBufferSize
  935. );
  936. BOOLAPI
  937. FindNextUrlCacheContainerW(
  938. IN HANDLE hEnumHandle,
  939. OUT LPINTERNET_CACHE_CONTAINER_INFOW lpContainerInfo,
  940. IN OUT LPDWORD lpdwContainerInfoBufferSize
  941. );
  942. #ifdef UNICODE
  943. #define FindNextUrlCacheContainer FindNextUrlCacheContainerW
  944. #else
  945. #define FindNextUrlCacheContainer FindNextUrlCacheContainerA
  946. #endif // !UNICODE
  947. BOOLAPI
  948. FreeUrlCacheSpaceA(
  949. IN LPCSTR lpszCachePath,
  950. IN DWORD dwSize,
  951. IN DWORD dwFilter
  952. );
  953. BOOLAPI
  954. FreeUrlCacheSpaceW(
  955. IN LPCWSTR lpszCachePath,
  956. IN DWORD dwSize,
  957. IN DWORD dwFilter
  958. );
  959. #ifdef UNICODE
  960. #define FreeUrlCacheSpace FreeUrlCacheSpaceW
  961. #else
  962. #define FreeUrlCacheSpace FreeUrlCacheSpaceA
  963. #endif // !UNICODE
  964. //
  965. // config APIs.
  966. //
  967. #define CACHE_CONFIG_FORCE_CLEANUP_FC 0x00000020
  968. #define CACHE_CONFIG_DISK_CACHE_PATHS_FC 0x00000040
  969. #define CACHE_CONFIG_SYNC_MODE_FC 0x00000080
  970. #define CACHE_CONFIG_CONTENT_PATHS_FC 0x00000100
  971. #define CACHE_CONFIG_COOKIES_PATHS_FC 0x00000200
  972. #define CACHE_CONFIG_HISTORY_PATHS_FC 0x00000400
  973. #define CACHE_CONFIG_QUOTA_FC 0x00000800
  974. #define CACHE_CONFIG_USER_MODE_FC 0x00001000
  975. #define CACHE_CONFIG_CONTENT_USAGE_FC 0x00002000
  976. #define CACHE_CONFIG_STICKY_CONTENT_USAGE_FC 0x00004000
  977. /*
  978. BOOLAPI
  979. GetUrlCacheConfigInfoA(
  980. OUT LPINTERNET_CACHE_CONFIG_INFOA lpCacheConfigInfo,
  981. IN OUT LPDWORD lpdwCacheConfigInfoBufferSize,
  982. IN DWORD dwFieldControl
  983. );
  984. BOOLAPI
  985. GetUrlCacheConfigInfoW(
  986. OUT LPINTERNET_CACHE_CONFIG_INFOW lpCacheConfigInfo,
  987. IN OUT LPDWORD lpdwCacheConfigInfoBufferSize,
  988. IN DWORD dwFieldControl
  989. );
  990. #ifdef UNICODE
  991. #define GetUrlCacheConfigInfo GetUrlCacheConfigInfoW
  992. #else
  993. #define GetUrlCacheConfigInfo GetUrlCacheConfigInfoA
  994. #endif // !UNICODE
  995. BOOLAPI
  996. SetUrlCacheConfigInfoA(
  997. IN LPINTERNET_CACHE_CONFIG_INFOA lpCacheConfigInfo,
  998. IN DWORD dwFieldControl
  999. );
  1000. BOOLAPI
  1001. SetUrlCacheConfigInfoW(
  1002. IN LPINTERNET_CACHE_CONFIG_INFOW lpCacheConfigInfo,
  1003. IN DWORD dwFieldControl
  1004. );
  1005. #ifdef UNICODE
  1006. #define SetUrlCacheConfigInfo SetUrlCacheConfigInfoW
  1007. #else
  1008. #define SetUrlCacheConfigInfo SetUrlCacheConfigInfoA
  1009. #endif // !UNICODE
  1010. */
  1011. DWORD
  1012. WINAPI
  1013. RunOnceUrlCache(
  1014. HWND hwnd,
  1015. HINSTANCE hinst,
  1016. LPSTR lpszCmd,
  1017. int nCmdShow);
  1018. /*
  1019. DWORD
  1020. WINAPI
  1021. DeleteIE3Cache(
  1022. HWND hwnd,
  1023. HINSTANCE hinst,
  1024. LPSTR lpszCmd,
  1025. int nCmdShow);
  1026. */
  1027. BOOLAPI
  1028. UpdateUrlCacheContentPath(LPSTR szNewPath);
  1029. // Cache header data defines.
  1030. #define CACHE_HEADER_DATA_CURRENT_SETTINGS_VERSION 0
  1031. #define CACHE_HEADER_DATA_CONLIST_CHANGE_COUNT 1
  1032. #define CACHE_HEADER_DATA_COOKIE_CHANGE_COUNT 2
  1033. #define CACHE_HEADER_DATA_NOTIFICATION_HWND 3
  1034. #define CACHE_HEADER_DATA_NOTIFICATION_MESG 4
  1035. #define CACHE_HEADER_DATA_ROOTGROUP_OFFSET 5
  1036. #define CACHE_HEADER_DATA_GID_LOW 6
  1037. #define CACHE_HEADER_DATA_GID_HIGH 7
  1038. // beta logging stats
  1039. #define CACHE_HEADER_DATA_CACHE_NOT_EXPIRED 8
  1040. #define CACHE_HEADER_DATA_CACHE_NOT_MODIFIED 9
  1041. #define CACHE_HEADER_DATA_CACHE_MODIFIED 10
  1042. #define CACHE_HEADER_DATA_CACHE_RESUMED 11
  1043. #define CACHE_HEADER_DATA_CACHE_NOT_RESUMED 12
  1044. #define CACHE_HEADER_DATA_CACHE_MISS 13
  1045. #define CACHE_HEADER_DATA_DOWNLOAD_PARTIAL 14
  1046. #define CACHE_HEADER_DATA_DOWNLOAD_ABORTED 15
  1047. #define CACHE_HEADER_DATA_DOWNLOAD_CACHED 16
  1048. #define CACHE_HEADER_DATA_DOWNLOAD_NOT_CACHED 17
  1049. #define CACHE_HEADER_DATA_DOWNLOAD_NO_FILE 18
  1050. #define CACHE_HEADER_DATA_DOWNLOAD_FILE_NEEDED 19
  1051. #define CACHE_HEADER_DATA_DOWNLOAD_FILE_NOT_NEEDED 20
  1052. // retail data
  1053. #define CACHE_HEADER_DATA_NOTIFICATION_FILTER 21
  1054. #define CACHE_HEADER_DATA_ROOT_LEAK_OFFSET 22
  1055. // more beta logging stats
  1056. #define CACHE_HEADER_DATA_SYNCSTATE_IMAGE 23
  1057. #define CACHE_HEADER_DATA_SYNCSTATE_VOLATILE 24
  1058. #define CACHE_HEADER_DATA_SYNCSTATE_IMAGE_STATIC 25
  1059. #define CACHE_HEADER_DATA_SYNCSTATE_STATIC_VOLATILE 26
  1060. // retail data
  1061. #define CACHE_HEADER_DATA_ROOT_GROUPLIST_OFFSET 27 // offset to group list
  1062. #define CACHE_HEADER_DATA_ROOT_FIXUP_OFFSET 28 // offset to fixup list
  1063. #define CACHE_HEADER_DATA_ROOT_FIXUP_COUNT 29 // num of fixup items
  1064. #define CACHE_HEADER_DATA_ROOT_FIXUP_TRIGGER 30 // threshhold to fix up
  1065. #define CACHE_HEADER_DATA_HIGH_VERSION_STRING 31 // highest entry ver
  1066. #define CACHE_HEADER_DATA_LAST 31
  1067. // options for cache notification filter
  1068. #define CACHE_NOTIFY_ADD_URL 0x00000001
  1069. #define CACHE_NOTIFY_DELETE_URL 0x00000002
  1070. #define CACHE_NOTIFY_UPDATE_URL 0x00000004
  1071. #define CACHE_NOTIFY_DELETE_ALL 0x00000008
  1072. #define CACHE_NOTIFY_URL_SET_STICKY 0x00000010
  1073. #define CACHE_NOTIFY_URL_UNSET_STICKY 0x00000020
  1074. #define CACHE_NOTIFY_SET_ONLINE 0x00000100
  1075. #define CACHE_NOTIFY_SET_OFFLINE 0x00000200
  1076. #define CACHE_NOTIFY_FILTER_CHANGED 0x10000000
  1077. BOOL
  1078. RegisterUrlCacheNotification(
  1079. IN HWND hWnd,
  1080. IN UINT uMsg,
  1081. IN GROUPID gid,
  1082. IN DWORD dwOpsFilter,
  1083. IN DWORD dwReserved
  1084. );
  1085. BOOL
  1086. GetUrlCacheHeaderData(IN DWORD nIdx, OUT LPDWORD lpdwData);
  1087. BOOL
  1088. SetUrlCacheHeaderData(IN DWORD nIdx, IN DWORD dwData);
  1089. BOOL
  1090. IncrementUrlCacheHeaderData(IN DWORD nIdx, OUT LPDWORD lpdwData);
  1091. BOOL
  1092. LoadUrlCacheContent();
  1093. BOOL
  1094. GetUrlCacheContainerInfoA(
  1095. IN LPSTR lpszUrlName,
  1096. OUT LPINTERNET_CACHE_CONTAINER_INFOA lpContainerInfo,
  1097. IN OUT LPDWORD lpdwContainerInfoBufferSize,
  1098. IN DWORD dwOptions
  1099. );
  1100. BOOL
  1101. GetUrlCacheContainerInfoW(
  1102. IN LPWSTR lpszUrlName,
  1103. OUT LPINTERNET_CACHE_CONTAINER_INFOW lpContainerInfo,
  1104. IN OUT LPDWORD lpdwContainerInfoBufferSize,
  1105. IN DWORD dwOptions
  1106. );
  1107. #ifdef UNICODE
  1108. #define GetUrlCacheContainerInfo GetUrlCacheContainerInfoW
  1109. #else
  1110. #define GetUrlCacheContainerInfo GetUrlCacheContainerInfoA
  1111. #endif // !UNICODE
  1112. // HACK
  1113. BOOLAPI DLLUrlCacheEntry( IN DWORD Reason );
  1114. #if defined(__cplusplus)
  1115. }
  1116. #endif
  1117. // ---- end of wininetp.h
  1118. #ifndef __CACHE_INCLUDE__
  1119. #define __CACHE_INCLUDE__
  1120. #include <oldnames.h>
  1121. #include <cachedef.h>
  1122. #include <hashutil.hxx>
  1123. #include <debug.h>
  1124. #include <malloc.h>
  1125. #include <crtsubst.h>
  1126. #include <inetchar.h>
  1127. #include <util.hxx>
  1128. #include <reg.hxx>
  1129. #include <urlcache.h>
  1130. #include <filemap.hxx>
  1131. #include <filemgr.hxx>
  1132. #include <contain.hxx>
  1133. #include <conlist.hxx>
  1134. #include <hndlmgr.hxx>
  1135. #include <cookies.hxx>
  1136. #include <conmgr.hxx>
  1137. #include <group.hxx>
  1138. #include <cachglob.h>
  1139. #include <proto.h>
  1140. #include <registry.h>
  1141. #include <platform.h>
  1142. #endif //__CACHE_INCLUDE__
  1143. #endif // _CACHE_HXX_
  1144. #ifndef INTERNET_CACHE_GROUP_NONE
  1145. #define INTERNET_CACHE_GROUP_NONE 2
  1146. #define INTERNET_CACHE_MODIFY_DATA 4
  1147. #endif