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.

1366 lines
38 KiB

  1. #include <iedial.h>
  2. #if !defined(_WININETEX_)
  3. #define _WININETEX_
  4. #if defined(__cplusplus)
  5. extern "C" {
  6. #endif
  7. #define MAX_CACHE_ENTRY_INFO_SIZE 4096
  8. #define INTERNET_FLAG_BGUPDATE 0x00000008
  9. #define INTERNET_FLAG_UNUSED_4 0x00000004
  10. //
  11. // INTERNET_PREFETCH_STATUS -
  12. //
  13. typedef struct {
  14. //
  15. // dwStatus - status of download. See INTERNET_PREFETCH_ flags
  16. //
  17. DWORD dwStatus;
  18. //
  19. // dwSize - size of file downloaded so far
  20. //
  21. DWORD dwSize;
  22. } INTERNET_PREFETCH_STATUS, * LPINTERNET_PREFETCH_STATUS;
  23. //
  24. // INTERNET_PREFETCH_STATUS - dwStatus values
  25. //
  26. #define INTERNET_PREFETCH_PROGRESS 0
  27. #define INTERNET_PREFETCH_COMPLETE 1
  28. #define INTERNET_PREFETCH_ABORTED 2
  29. #define INTERNET_ONLINE_OFFLINE_INFO INTERNET_CONNECTED_INFO
  30. #define LPINTERNET_ONLINE_OFFLINE_INFO LPINTERNET_CONNECTED_INFO
  31. #define dwOfflineState dwConnectedState
  32. #define ISO_FORCE_OFFLINE ISO_FORCE_DISCONNECTED
  33. #ifdef __WINCRYPT_H__
  34. #ifdef ALGIDDEF
  35. //
  36. // INTERNET_SECURITY_INFO - contains information about certificate
  37. // and encryption settings for a connection.
  38. //
  39. #define INTERNET_SECURITY_INFO_DEFINED
  40. typedef struct {
  41. //
  42. // dwSize - Size of INTERNET_SECURITY_INFO structure.
  43. //
  44. DWORD dwSize;
  45. //
  46. // pCertificate - Cert context pointing to leaf of certificate chain.
  47. //
  48. PCCERT_CONTEXT pCertificate;
  49. //
  50. // Start SecPkgContext_ConnectionInfo
  51. // The following members must match those
  52. // of the SecPkgContext_ConnectionInfo
  53. // sspi structure (schnlsp.h)
  54. //
  55. //
  56. // dwProtocol - Protocol that this connection was made with
  57. // (PCT, SSL2, SSL3, etc)
  58. //
  59. DWORD dwProtocol;
  60. //
  61. // aiCipher - Cipher that this connection as made with
  62. //
  63. ALG_ID aiCipher;
  64. //
  65. // dwCipherStrength - Strength (in bits) that this connection
  66. // was made with;
  67. //
  68. DWORD dwCipherStrength;
  69. //
  70. // aiHash - Hash that this connection as made with
  71. //
  72. ALG_ID aiHash;
  73. //
  74. // dwHashStrength - Strength (in bits) that this connection
  75. // was made with;
  76. //
  77. DWORD dwHashStrength;
  78. //
  79. // aiExch - Key Exchange type that this connection as made with
  80. //
  81. ALG_ID aiExch;
  82. //
  83. // dwExchStrength - Strength (in bits) that this connection
  84. // was made with;
  85. //
  86. DWORD dwExchStrength;
  87. } INTERNET_SECURITY_INFO, * LPINTERNET_SECURITY_INFO;
  88. typedef struct {
  89. //
  90. // dwSize - size of INTERNET_SECURITY_CONNECTION_INFO
  91. //
  92. DWORD dwSize;
  93. // fSecure - Is this a secure connection.
  94. BOOL fSecure;
  95. //
  96. // dwProtocol - Protocol that this connection was made with
  97. // (PCT, SSL2, SSL3, etc)
  98. //
  99. DWORD dwProtocol;
  100. //
  101. // aiCipher - Cipher that this connection as made with
  102. //
  103. ALG_ID aiCipher;
  104. //
  105. // dwCipherStrength - Strength (in bits) that this connection
  106. // was made with;
  107. //
  108. DWORD dwCipherStrength;
  109. //
  110. // aiHash - Hash that this connection as made with
  111. //
  112. ALG_ID aiHash;
  113. //
  114. // dwHashStrength - Strength (in bits) that this connection
  115. // was made with;
  116. //
  117. DWORD dwHashStrength;
  118. //
  119. // aiExch - Key Exchange type that this connection as made with
  120. //
  121. ALG_ID aiExch;
  122. //
  123. // dwExchStrength - Strength (in bits) that this connection
  124. // was made with;
  125. //
  126. DWORD dwExchStrength;
  127. } INTERNET_SECURITY_CONNECTION_INFO , * LPINTERNET_SECURITY_CONNECTION_INFO;
  128. INTERNETAPI_(BOOL) InternetAlgIdToStringA(
  129. IN ALG_ID ai,
  130. IN LPSTR lpstr,
  131. IN OUT LPDWORD lpdwBufferLength,
  132. IN DWORD dwReserved
  133. );
  134. INTERNETAPI_(BOOL) InternetAlgIdToStringW(
  135. IN ALG_ID ai,
  136. IN LPWSTR lpstr,
  137. IN OUT LPDWORD lpdwBufferLength,
  138. IN DWORD dwReserved
  139. );
  140. #ifdef UNICODE
  141. #define InternetAlgIdToString InternetAlgIdToStringW
  142. #else
  143. #define InternetAlgIdToString InternetAlgIdToStringA
  144. #endif // !UNICODE
  145. INTERNETAPI_(BOOL) InternetSecurityProtocolToStringA(
  146. IN DWORD dwProtocol,
  147. IN LPSTR lpstr,
  148. IN OUT LPDWORD lpdwBufferLength,
  149. IN DWORD dwReserved
  150. );
  151. INTERNETAPI_(BOOL) InternetSecurityProtocolToStringW(
  152. IN DWORD dwProtocol,
  153. IN LPWSTR lpstr,
  154. IN OUT LPDWORD lpdwBufferLength,
  155. IN DWORD dwReserved
  156. );
  157. #ifdef UNICODE
  158. #define InternetSecurityProtocolToString InternetSecurityProtocolToStringW
  159. #else
  160. #define InternetSecurityProtocolToString InternetSecurityProtocolToStringA
  161. #endif // !UNICODE
  162. #endif // ALGIDDEF
  163. #endif // __WINCRYPT_H__
  164. #ifdef INTERNET_SECURITY_INFO_DEFINED
  165. INTERNETAPI_(DWORD) ShowSecurityInfo(
  166. IN HWND hWndParent,
  167. IN LPINTERNET_SECURITY_INFO pSecurityInfo
  168. );
  169. #endif // INTERNET_SECURITY_INFO_DEFINED
  170. INTERNETAPI_(DWORD) ShowX509EncodedCertificate(
  171. IN HWND hWndParent,
  172. IN LPBYTE lpCert,
  173. IN DWORD cbCert
  174. );
  175. INTERNETAPI_(DWORD) ShowClientAuthCerts(
  176. IN HWND hWndParent
  177. );
  178. INTERNETAPI_(DWORD) ParseX509EncodedCertificateForListBoxEntry(
  179. IN LPBYTE lpCert,
  180. IN DWORD cbCert,
  181. OUT LPSTR lpszListBoxEntry,
  182. IN LPDWORD lpdwListBoxEntry
  183. );
  184. //
  185. // This is a private API for Trident. It displays
  186. // security info based on a URL
  187. //
  188. INTERNETAPI_(BOOL) InternetShowSecurityInfoByURLA(
  189. IN LPSTR lpszURL,
  190. IN HWND hwndParent
  191. );
  192. INTERNETAPI_(BOOL) InternetShowSecurityInfoByURLW(
  193. IN LPWSTR lpszURL,
  194. IN HWND hwndParent
  195. );
  196. #ifdef UNICODE
  197. #define InternetShowSecurityInfoByURL InternetShowSecurityInfoByURLW
  198. #else
  199. #ifdef _WINX32_
  200. #define InternetShowSecurityInfoByURL InternetShowSecurityInfoByURLA
  201. #else
  202. INTERNETAPI_(BOOL) InternetShowSecurityInfoByURL(
  203. IN LPSTR lpszURL,
  204. IN HWND hwndParent
  205. );
  206. #endif // _WINX32_
  207. #endif // !UNICODE
  208. //Fortezza related exports. not public
  209. // The commands that InternetFortezzaCommand supports.
  210. typedef enum {
  211. FORTCMD_LOGON = 1,
  212. FORTCMD_LOGOFF = 2,
  213. FORTCMD_CHG_PERSONALITY = 3,
  214. } FORTCMD;
  215. INTERNETAPI_(BOOL) InternetFortezzaCommand(DWORD dwCommand, HWND hwnd, DWORD_PTR dwReserved);
  216. typedef enum {
  217. FORTSTAT_INSTALLED = 0x00000001,
  218. FORTSTAT_LOGGEDON = 0x00000002,
  219. } FORTSTAT ;
  220. INTERNETAPI_(BOOL) InternetQueryFortezzaStatus(DWORD *pdwStatus, DWORD_PTR dwReserved);
  221. BOOLAPI InternetDebugGetLocalTime(
  222. OUT SYSTEMTIME * pstLocalTime,
  223. OUT DWORD * pdwReserved
  224. );
  225. #define INTERNET_SERVICE_URL 0
  226. //
  227. // InternetConnectUrl() - a macro which allows you to specify an URL instead of
  228. // the component parts to InternetConnect(). If any API which uses the returned
  229. // connect handle specifies a NULL path then the URL-path part of the URL
  230. // specified in InternetConnectUrl() will be used
  231. //
  232. #define InternetConnectUrl(hInternet, lpszUrl, dwFlags, dwContext) \
  233. InternetConnect(hInternet, \
  234. lpszUrl, \
  235. INTERNET_INVALID_PORT_NUMBER, \
  236. NULL, \
  237. NULL, \
  238. INTERNET_SERVICE_URL, \
  239. dwFlags, \
  240. dwContext \
  241. )
  242. INTERNETAPI_(BOOL) InternetWriteFileExA(
  243. IN HINTERNET hFile,
  244. IN LPINTERNET_BUFFERSA lpBuffersIn,
  245. IN DWORD dwFlags,
  246. IN DWORD_PTR dwContext
  247. );
  248. INTERNETAPI_(BOOL) InternetWriteFileExW(
  249. IN HINTERNET hFile,
  250. IN LPINTERNET_BUFFERSW lpBuffersIn,
  251. IN DWORD dwFlags,
  252. IN DWORD_PTR dwContext
  253. );
  254. #ifdef UNICODE
  255. #define InternetWriteFileEx InternetWriteFileExW
  256. #else
  257. #define InternetWriteFileEx InternetWriteFileExA
  258. #endif // !UNICODE
  259. #define INTERNET_OPTION_CONTEXT_VALUE_OLD 10
  260. #define INTERNET_OPTION_NET_SPEED 61
  261. // Pass in pointer to INTERNET_SECURITY_CONNECTION_INFO to be filled in.
  262. #define INTERNET_OPTION_SECURITY_CONNECTION_INFO 66
  263. #define INTERNET_OPTION_DETECT_POST_SEND 71
  264. #define INTERNET_OPTION_DISABLE_NTLM_PREAUTH 72
  265. #define INTERNET_LAST_OPTION_INTERNAL INTERNET_OPTION_PROXY_SETTINGS_CHANGED
  266. #define INTERNET_OPTION_OFFLINE_TIMEOUT INTERNET_OPTION_DISCONNECTED_TIMEOUT
  267. #define INTERNET_OPTION_LINE_STATE INTERNET_OPTION_CONNECTED_STATE
  268. #define AUTH_FLAG_RESET 0x00000000 /* let registry decide */
  269. /* maximum length of privacy-settings in Unicode characters */
  270. #define MaxPrivacySettings 0x4000
  271. // Utility for mapping P3P compact-policy tokens to unique indexes
  272. INTERNETAPI_(int) FindP3PPolicySymbol(const char *pszSymbol);
  273. #define INTERNET_STATE_ONLINE INTERNET_STATE_CONNECTED
  274. #define INTERNET_STATE_OFFLINE INTERNET_STATE_DISCONNECTED
  275. #define INTERNET_STATE_OFFLINE_USER INTERNET_STATE_DISCONNECTED_BY_USER
  276. #define INTERNET_LINE_STATE_MASK (INTERNET_STATE_ONLINE | INTERNET_STATE_OFFLINE)
  277. #define INTERNET_BUSY_STATE_MASK (INTERNET_STATE_IDLE | INTERNET_STATE_BUSY)
  278. //
  279. // the following are used with InternetSetOption(..., INTERNET_OPTION_CALLBACK_FILTER, ...)
  280. // to filter out unrequired callbacks. INTERNET_STATUS_REQUEST_COMPLETE cannot
  281. // be filtered out
  282. //
  283. #define INTERNET_STATUS_FILTER_RESOLVING 0x00000001
  284. #define INTERNET_STATUS_FILTER_RESOLVED 0x00000002
  285. #define INTERNET_STATUS_FILTER_CONNECTING 0x00000004
  286. #define INTERNET_STATUS_FILTER_CONNECTED 0x00000008
  287. #define INTERNET_STATUS_FILTER_SENDING 0x00000010
  288. #define INTERNET_STATUS_FILTER_SENT 0x00000020
  289. #define INTERNET_STATUS_FILTER_RECEIVING 0x00000040
  290. #define INTERNET_STATUS_FILTER_RECEIVED 0x00000080
  291. #define INTERNET_STATUS_FILTER_CLOSING 0x00000100
  292. #define INTERNET_STATUS_FILTER_CLOSED 0x00000200
  293. #define INTERNET_STATUS_FILTER_HANDLE_CREATED 0x00000400
  294. #define INTERNET_STATUS_FILTER_HANDLE_CLOSING 0x00000800
  295. #define INTERNET_STATUS_FILTER_PREFETCH 0x00001000
  296. #define INTERNET_STATUS_FILTER_REDIRECT 0x00002000
  297. #define INTERNET_STATUS_FILTER_STATE_CHANGE 0x00004000
  298. //
  299. // Note that adding any HTTP_QUERY_* codes here must be followed
  300. // by an equivlent line in wininet\http\hashgen\hashgen.cpp
  301. // please see that file for further information regarding
  302. // the addition of new HTTP headers
  303. //
  304. // These are not part of HTTP 1.1 yet. We will propose these to the
  305. // HTTP extensions working group. These are required for the client-caps support
  306. // we are doing in conjuntion with IIS.
  307. typedef struct _INTERNET_COOKIE {
  308. DWORD cbSize;
  309. LPSTR pszName;
  310. LPSTR pszData;
  311. LPSTR pszDomain;
  312. LPSTR pszPath;
  313. FILETIME *pftExpires;
  314. DWORD dwFlags;
  315. LPSTR pszUrl;
  316. LPSTR pszP3PPolicy;
  317. } INTERNET_COOKIE, *PINTERNET_COOKIE;
  318. //
  319. // DAV Detection
  320. //
  321. BOOLAPI HttpCheckDavComplianceA(
  322. IN LPCSTR lpszUrl,
  323. IN LPCSTR lpszComplianceToken,
  324. IN OUT LPBOOL lpfFound,
  325. IN HWND hWnd,
  326. IN LPVOID lpvReserved
  327. );
  328. //
  329. // DAV Detection
  330. //
  331. BOOLAPI HttpCheckDavComplianceW(
  332. IN LPCWSTR lpszUrl,
  333. IN LPCWSTR lpszComplianceToken,
  334. IN OUT LPBOOL lpfFound,
  335. IN HWND hWnd,
  336. IN LPVOID lpvReserved
  337. );
  338. #ifdef UNICODE
  339. #define HttpCheckDavCompliance HttpCheckDavComplianceW
  340. #else
  341. #define HttpCheckDavCompliance HttpCheckDavComplianceA
  342. #endif // !UNICODE
  343. BOOLAPI HttpCheckCachedDavStatusA(
  344. IN LPCSTR lpszUrl,
  345. IN OUT LPDWORD lpdwStatus
  346. );
  347. BOOLAPI HttpCheckCachedDavStatusW(
  348. IN LPCWSTR lpszUrl,
  349. IN OUT LPDWORD lpdwStatus
  350. );
  351. #ifdef UNICODE
  352. #define HttpCheckCachedDavStatus HttpCheckCachedDavStatusW
  353. #else
  354. #define HttpCheckCachedDavStatus HttpCheckCachedDavStatusA
  355. #endif // !UNICODE
  356. BOOLAPI HttpCheckDavCollectionA(
  357. IN LPCSTR lpszUrl,
  358. IN OUT LPBOOL lpfFound,
  359. IN HWND hWnd,
  360. IN LPVOID lpvReserved
  361. );
  362. BOOLAPI HttpCheckDavCollectionW(
  363. IN LPCWSTR lpszUrl,
  364. IN OUT LPBOOL lpfFound,
  365. IN HWND hWnd,
  366. IN LPVOID lpvReserved
  367. );
  368. #ifdef UNICODE
  369. #define HttpCheckDavCollection HttpCheckDavCollectionW
  370. #else
  371. #define HttpCheckDavCollection HttpCheckDavCollectionA
  372. #endif // !UNICODE
  373. // DAV detection defines
  374. #define DAV_LEVEL1_STATUS 0x00000001
  375. #define DAV_COLLECTION_STATUS 0x00004000
  376. #define DAV_DETECTION_REQUIRED 0x00008000
  377. #define ERROR_INTERNET_NO_NEW_CONTAINERS (INTERNET_ERROR_BASE + 51)
  378. #define ERROR_INTERNET_OFFLINE ERROR_INTERNET_DISCONNECTED
  379. //
  380. // internal error codes that are used to communicate specific information inside
  381. // of Wininet but which are meaningless at the interface
  382. //
  383. #define INTERNET_INTERNAL_ERROR_BASE (INTERNET_ERROR_BASE + 900)
  384. #define ERROR_INTERNET_INTERNAL_SOCKET_ERROR (INTERNET_INTERNAL_ERROR_BASE + 1)
  385. #define ERROR_INTERNET_CONNECTION_AVAILABLE (INTERNET_INTERNAL_ERROR_BASE + 2)
  386. #define ERROR_INTERNET_NO_KNOWN_SERVERS (INTERNET_INTERNAL_ERROR_BASE + 3)
  387. #define ERROR_INTERNET_PING_FAILED (INTERNET_INTERNAL_ERROR_BASE + 4)
  388. #define ERROR_INTERNET_NO_PING_SUPPORT (INTERNET_INTERNAL_ERROR_BASE + 5)
  389. #define ERROR_INTERNET_CACHE_SUCCESS (INTERNET_INTERNAL_ERROR_BASE + 6)
  390. #define ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION_EX (INTERNET_INTERNAL_ERROR_BASE + 7)
  391. #define HTTP_1_1_CACHE_ENTRY 0x00000040
  392. #define STATIC_CACHE_ENTRY 0x00000080
  393. #define MUST_REVALIDATE_CACHE_ENTRY 0x00000100
  394. #define COOKIE_ACCEPTED_CACHE_ENTRY 0x00001000
  395. #define COOKIE_LEASHED_CACHE_ENTRY 0x00002000
  396. #define COOKIE_DOWNGRADED_CACHE_ENTRY 0x00004000
  397. #define COOKIE_REJECTED_CACHE_ENTRY 0x00008000
  398. #define PENDING_DELETE_CACHE_ENTRY 0x00400000
  399. #define OTHER_USER_CACHE_ENTRY 0x00800000
  400. #define PRIVACY_IMPACTED_CACHE_ENTRY 0x02000000
  401. #define POST_RESPONSE_CACHE_ENTRY 0x04000000
  402. #define INSTALLED_CACHE_ENTRY 0x10000000
  403. #define POST_CHECK_CACHE_ENTRY 0x20000000
  404. #define IDENTITY_CACHE_ENTRY 0x80000000
  405. // We include some entry types even if app doesn't specifically ask for them.
  406. #define INCLUDE_BY_DEFAULT_CACHE_ENTRY \
  407. ( HTTP_1_1_CACHE_ENTRY \
  408. | STATIC_CACHE_ENTRY \
  409. | MUST_REVALIDATE_CACHE_ENTRY \
  410. | PRIVACY_IMPACTED_CACHE_ENTRY \
  411. | POST_CHECK_CACHE_ENTRY \
  412. | COOKIE_ACCEPTED_CACHE_ENTRY \
  413. | COOKIE_LEASHED_CACHE_ENTRY \
  414. | COOKIE_DOWNGRADED_CACHE_ENTRY \
  415. | COOKIE_REJECTED_CACHE_ENTRY \
  416. )
  417. //
  418. // Well known sticky group ID
  419. //
  420. #define CACHEGROUP_ID_BUILTIN_STICKY 0x1000000000000007
  421. //
  422. // INTERNET_CACHE_CONFIG_PATH_ENTRY
  423. //
  424. typedef struct _INTERNET_CACHE_CONFIG_PATH_ENTRYA {
  425. CHAR CachePath[MAX_PATH];
  426. DWORD dwCacheSize; // in KBytes
  427. } INTERNET_CACHE_CONFIG_PATH_ENTRYA, * LPINTERNET_CACHE_CONFIG_PATH_ENTRYA;
  428. typedef struct _INTERNET_CACHE_CONFIG_PATH_ENTRYW {
  429. WCHAR CachePath[MAX_PATH];
  430. DWORD dwCacheSize; // in KBytes
  431. } INTERNET_CACHE_CONFIG_PATH_ENTRYW, * LPINTERNET_CACHE_CONFIG_PATH_ENTRYW;
  432. #ifdef UNICODE
  433. typedef INTERNET_CACHE_CONFIG_PATH_ENTRYW INTERNET_CACHE_CONFIG_PATH_ENTRY;
  434. typedef LPINTERNET_CACHE_CONFIG_PATH_ENTRYW LPINTERNET_CACHE_CONFIG_PATH_ENTRY;
  435. #else
  436. typedef INTERNET_CACHE_CONFIG_PATH_ENTRYA INTERNET_CACHE_CONFIG_PATH_ENTRY;
  437. typedef LPINTERNET_CACHE_CONFIG_PATH_ENTRYA LPINTERNET_CACHE_CONFIG_PATH_ENTRY;
  438. #endif // UNICODE
  439. //
  440. // INTERNET_CACHE_CONFIG_INFO
  441. //
  442. #if _MSC_VER >= 1200
  443. #pragma warning(push)
  444. #endif
  445. #pragma warning(disable:4201)
  446. typedef struct _INTERNET_CACHE_CONFIG_INFOA {
  447. DWORD dwStructSize;
  448. DWORD dwContainer;
  449. DWORD dwQuota;
  450. DWORD dwReserved4;
  451. BOOL fPerUser;
  452. DWORD dwSyncMode;
  453. DWORD dwNumCachePaths;
  454. union
  455. {
  456. struct
  457. {
  458. CHAR CachePath[MAX_PATH];
  459. DWORD dwCacheSize;
  460. };
  461. INTERNET_CACHE_CONFIG_PATH_ENTRYA CachePaths[ANYSIZE_ARRAY];
  462. };
  463. DWORD dwNormalUsage;
  464. DWORD dwExemptUsage;
  465. } INTERNET_CACHE_CONFIG_INFOA, * LPINTERNET_CACHE_CONFIG_INFOA;
  466. typedef struct _INTERNET_CACHE_CONFIG_INFOW {
  467. DWORD dwStructSize;
  468. DWORD dwContainer;
  469. DWORD dwQuota;
  470. DWORD dwReserved4;
  471. BOOL fPerUser;
  472. DWORD dwSyncMode;
  473. DWORD dwNumCachePaths;
  474. union
  475. {
  476. struct
  477. {
  478. WCHAR CachePath[MAX_PATH];
  479. DWORD dwCacheSize;
  480. };
  481. INTERNET_CACHE_CONFIG_PATH_ENTRYW CachePaths[ANYSIZE_ARRAY];
  482. };
  483. DWORD dwNormalUsage;
  484. DWORD dwExemptUsage;
  485. } INTERNET_CACHE_CONFIG_INFOW, * LPINTERNET_CACHE_CONFIG_INFOW;
  486. #ifdef UNICODE
  487. typedef INTERNET_CACHE_CONFIG_INFOW INTERNET_CACHE_CONFIG_INFO;
  488. typedef LPINTERNET_CACHE_CONFIG_INFOW LPINTERNET_CACHE_CONFIG_INFO;
  489. #else
  490. typedef INTERNET_CACHE_CONFIG_INFOA INTERNET_CACHE_CONFIG_INFO;
  491. typedef LPINTERNET_CACHE_CONFIG_INFOA LPINTERNET_CACHE_CONFIG_INFO;
  492. #endif // UNICODE
  493. #if _MSC_VER >= 1200
  494. #pragma warning(pop)
  495. #else
  496. #pragma warning(disable:4201)
  497. #endif
  498. BOOLAPI IsUrlCacheEntryExpiredA(
  499. IN LPCSTR lpszUrlName,
  500. IN DWORD dwFlags,
  501. IN OUT FILETIME* pftLastModified
  502. );
  503. BOOLAPI IsUrlCacheEntryExpiredW(
  504. IN LPCWSTR lpszUrlName,
  505. IN DWORD dwFlags,
  506. IN OUT FILETIME* pftLastModified
  507. );
  508. #ifdef UNICODE
  509. #define IsUrlCacheEntryExpired IsUrlCacheEntryExpiredW
  510. #else
  511. #define IsUrlCacheEntryExpired IsUrlCacheEntryExpiredA
  512. #endif // !UNICODE
  513. #define INTERNET_CACHE_FLAG_ALLOW_COLLISIONS 0x00000100
  514. #define INTERNET_CACHE_FLAG_INSTALLED_ENTRY 0x00000200
  515. #define INTERNET_CACHE_FLAG_ENTRY_OR_MAPPING 0x00000400
  516. #define INTERNET_CACHE_FLAG_ADD_FILENAME_ONLY 0x00000800
  517. #define INTERNET_CACHE_FLAG_GET_STRUCT_ONLY 0x00001000
  518. #define CACHE_ENTRY_TYPE_FC 0x00001000
  519. #define CACHE_ENTRY_MODIFY_DATA_FC 0x80000000 // this appears unused
  520. // Flags for CreateContainer
  521. #define INTERNET_CACHE_CONTAINER_NOSUBDIRS (0x1)
  522. #define INTERNET_CACHE_CONTAINER_AUTODELETE (0x2)
  523. #define INTERNET_CACHE_CONTAINER_RESERVED1 (0x4)
  524. #define INTERNET_CACHE_CONTAINER_NODESKTOPINIT (0x8)
  525. #define INTERNET_CACHE_CONTAINER_MAP_ENABLED (0x10)
  526. BOOLAPI CreateUrlCacheContainerA(
  527. IN LPCSTR Name,
  528. IN LPCSTR lpCachePrefix,
  529. LPCSTR lpszCachePath,
  530. IN DWORD KBCacheLimit,
  531. IN DWORD dwContainerType,
  532. IN DWORD dwOptions,
  533. IN OUT LPVOID pvBuffer,
  534. IN OUT LPDWORD cbBuffer
  535. );
  536. BOOLAPI CreateUrlCacheContainerW(
  537. IN LPCWSTR Name,
  538. IN LPCWSTR lpCachePrefix,
  539. LPCWSTR lpszCachePath,
  540. IN DWORD KBCacheLimit,
  541. IN DWORD dwContainerType,
  542. IN DWORD dwOptions,
  543. IN OUT LPVOID pvBuffer,
  544. IN OUT LPDWORD cbBuffer
  545. );
  546. #ifdef UNICODE
  547. #define CreateUrlCacheContainer CreateUrlCacheContainerW
  548. #else
  549. #define CreateUrlCacheContainer CreateUrlCacheContainerA
  550. #endif // !UNICODE
  551. BOOLAPI DeleteUrlCacheContainerA(
  552. IN LPCSTR Name,
  553. IN DWORD dwOptions
  554. );
  555. BOOLAPI DeleteUrlCacheContainerW(
  556. IN LPCWSTR Name,
  557. IN DWORD dwOptions
  558. );
  559. #ifdef UNICODE
  560. #define DeleteUrlCacheContainer DeleteUrlCacheContainerW
  561. #else
  562. #define DeleteUrlCacheContainer DeleteUrlCacheContainerA
  563. #endif // !UNICODE
  564. //
  565. // INTERNET_CACHE_ENTRY_INFO -
  566. //
  567. typedef struct _INTERNET_CACHE_CONTAINER_INFOA {
  568. DWORD dwCacheVersion; // version of software
  569. LPSTR lpszName; // embedded pointer to the container name string.
  570. LPSTR lpszCachePrefix; // embedded pointer to the container URL prefix
  571. LPSTR lpszVolumeLabel; // embedded pointer to the container volume label if any.
  572. LPSTR lpszVolumeTitle; // embedded pointer to the container volume title if any.
  573. } INTERNET_CACHE_CONTAINER_INFOA, * LPINTERNET_CACHE_CONTAINER_INFOA;
  574. typedef struct _INTERNET_CACHE_CONTAINER_INFOW {
  575. DWORD dwCacheVersion; // version of software
  576. LPWSTR lpszName; // embedded pointer to the container name string.
  577. LPWSTR lpszCachePrefix; // embedded pointer to the container URL prefix
  578. LPWSTR lpszVolumeLabel; // embedded pointer to the container volume label if any.
  579. LPWSTR lpszVolumeTitle; // embedded pointer to the container volume title if any.
  580. } INTERNET_CACHE_CONTAINER_INFOW, * LPINTERNET_CACHE_CONTAINER_INFOW;
  581. #ifdef UNICODE
  582. typedef INTERNET_CACHE_CONTAINER_INFOW INTERNET_CACHE_CONTAINER_INFO;
  583. typedef LPINTERNET_CACHE_CONTAINER_INFOW LPINTERNET_CACHE_CONTAINER_INFO;
  584. #else
  585. typedef INTERNET_CACHE_CONTAINER_INFOA INTERNET_CACHE_CONTAINER_INFO;
  586. typedef LPINTERNET_CACHE_CONTAINER_INFOA LPINTERNET_CACHE_CONTAINER_INFO;
  587. #endif // UNICODE
  588. // FindFirstContainer options
  589. #define CACHE_FIND_CONTAINER_RETURN_NOCHANGE (0x1)
  590. INTERNETAPI_(HANDLE) FindFirstUrlCacheContainerA(
  591. IN OUT LPDWORD pdwModified,
  592. OUT LPINTERNET_CACHE_CONTAINER_INFOA lpContainerInfo,
  593. IN OUT LPDWORD lpdwContainerInfoBufferSize,
  594. IN DWORD dwOptions
  595. );
  596. INTERNETAPI_(HANDLE) FindFirstUrlCacheContainerW(
  597. IN OUT LPDWORD pdwModified,
  598. OUT LPINTERNET_CACHE_CONTAINER_INFOW lpContainerInfo,
  599. IN OUT LPDWORD lpdwContainerInfoBufferSize,
  600. IN DWORD dwOptions
  601. );
  602. #ifdef UNICODE
  603. #define FindFirstUrlCacheContainer FindFirstUrlCacheContainerW
  604. #else
  605. #define FindFirstUrlCacheContainer FindFirstUrlCacheContainerA
  606. #endif // !UNICODE
  607. BOOLAPI FindNextUrlCacheContainerA(
  608. IN HANDLE hEnumHandle,
  609. OUT LPINTERNET_CACHE_CONTAINER_INFOA lpContainerInfo,
  610. IN OUT LPDWORD lpdwContainerInfoBufferSize
  611. );
  612. BOOLAPI FindNextUrlCacheContainerW(
  613. IN HANDLE hEnumHandle,
  614. OUT LPINTERNET_CACHE_CONTAINER_INFOW lpContainerInfo,
  615. IN OUT LPDWORD lpdwContainerInfoBufferSize
  616. );
  617. #ifdef UNICODE
  618. #define FindNextUrlCacheContainer FindNextUrlCacheContainerW
  619. #else
  620. #define FindNextUrlCacheContainer FindNextUrlCacheContainerA
  621. #endif // !UNICODE
  622. typedef enum {
  623. WININET_SYNC_MODE_NEVER=0,
  624. WININET_SYNC_MODE_ON_EXPIRY, // bogus
  625. WININET_SYNC_MODE_ONCE_PER_SESSION,
  626. WININET_SYNC_MODE_ALWAYS,
  627. WININET_SYNC_MODE_AUTOMATIC,
  628. WININET_SYNC_MODE_DEFAULT = WININET_SYNC_MODE_AUTOMATIC
  629. } WININET_SYNC_MODE;
  630. BOOLAPI FreeUrlCacheSpaceA(
  631. IN LPCSTR lpszCachePath,
  632. IN DWORD dwSize,
  633. IN DWORD dwFilter
  634. );
  635. BOOLAPI FreeUrlCacheSpaceW(
  636. IN LPCWSTR lpszCachePath,
  637. IN DWORD dwSize,
  638. IN DWORD dwFilter
  639. );
  640. #ifdef UNICODE
  641. #define FreeUrlCacheSpace FreeUrlCacheSpaceW
  642. #else
  643. #define FreeUrlCacheSpace FreeUrlCacheSpaceA
  644. #endif // !UNICODE
  645. //
  646. // config APIs.
  647. //
  648. #define CACHE_CONFIG_FORCE_CLEANUP_FC 0x00000020
  649. #define CACHE_CONFIG_DISK_CACHE_PATHS_FC 0x00000040
  650. #define CACHE_CONFIG_SYNC_MODE_FC 0x00000080
  651. #define CACHE_CONFIG_CONTENT_PATHS_FC 0x00000100
  652. #define CACHE_CONFIG_COOKIES_PATHS_FC 0x00000200
  653. #define CACHE_CONFIG_HISTORY_PATHS_FC 0x00000400
  654. #define CACHE_CONFIG_QUOTA_FC 0x00000800
  655. #define CACHE_CONFIG_USER_MODE_FC 0x00001000
  656. #define CACHE_CONFIG_CONTENT_USAGE_FC 0x00002000
  657. #define CACHE_CONFIG_STICKY_CONTENT_USAGE_FC 0x00004000
  658. BOOLAPI GetUrlCacheConfigInfoA(
  659. OUT LPINTERNET_CACHE_CONFIG_INFOA lpCacheConfigInfo,
  660. IN OUT LPDWORD lpdwCacheConfigInfoBufferSize,
  661. IN DWORD dwFieldControl
  662. );
  663. BOOLAPI GetUrlCacheConfigInfoW(
  664. OUT LPINTERNET_CACHE_CONFIG_INFOW lpCacheConfigInfo,
  665. IN OUT LPDWORD lpdwCacheConfigInfoBufferSize,
  666. IN DWORD dwFieldControl
  667. );
  668. #ifdef UNICODE
  669. #define GetUrlCacheConfigInfo GetUrlCacheConfigInfoW
  670. #else
  671. #define GetUrlCacheConfigInfo GetUrlCacheConfigInfoA
  672. #endif // !UNICODE
  673. BOOLAPI SetUrlCacheConfigInfoA(
  674. IN LPINTERNET_CACHE_CONFIG_INFOA lpCacheConfigInfo,
  675. IN DWORD dwFieldControl
  676. );
  677. BOOLAPI SetUrlCacheConfigInfoW(
  678. IN LPINTERNET_CACHE_CONFIG_INFOW lpCacheConfigInfo,
  679. IN DWORD dwFieldControl
  680. );
  681. #ifdef UNICODE
  682. #define SetUrlCacheConfigInfo SetUrlCacheConfigInfoW
  683. #else
  684. #define SetUrlCacheConfigInfo SetUrlCacheConfigInfoA
  685. #endif // !UNICODE
  686. INTERNETAPI_(DWORD) RunOnceUrlCache(
  687. HWND hwnd,
  688. HINSTANCE hinst,
  689. LPSTR lpszCmd,
  690. int nCmdShow);
  691. INTERNETAPI_(DWORD) DeleteIE3Cache(
  692. HWND hwnd,
  693. HINSTANCE hinst,
  694. LPSTR lpszCmd,
  695. int nCmdShow);
  696. BOOLAPI UpdateUrlCacheContentPath(LPSTR szNewPath);
  697. // Cache header data defines.
  698. #define CACHE_HEADER_DATA_CURRENT_SETTINGS_VERSION 0
  699. #define CACHE_HEADER_DATA_CONLIST_CHANGE_COUNT 1
  700. #define CACHE_HEADER_DATA_COOKIE_CHANGE_COUNT 2
  701. #define CACHE_HEADER_DATA_NOTIFICATION_HWND 3
  702. #define CACHE_HEADER_DATA_NOTIFICATION_MESG 4
  703. #define CACHE_HEADER_DATA_ROOTGROUP_OFFSET 5
  704. #define CACHE_HEADER_DATA_GID_LOW 6
  705. #define CACHE_HEADER_DATA_GID_HIGH 7
  706. // beta logging stats
  707. #define CACHE_HEADER_DATA_CACHE_NOT_EXPIRED 8
  708. #define CACHE_HEADER_DATA_CACHE_NOT_MODIFIED 9
  709. #define CACHE_HEADER_DATA_CACHE_MODIFIED 10
  710. #define CACHE_HEADER_DATA_CACHE_RESUMED 11
  711. #define CACHE_HEADER_DATA_CACHE_NOT_RESUMED 12
  712. #define CACHE_HEADER_DATA_CACHE_MISS 13
  713. #define CACHE_HEADER_DATA_DOWNLOAD_PARTIAL 14
  714. #define CACHE_HEADER_DATA_DOWNLOAD_ABORTED 15
  715. #define CACHE_HEADER_DATA_DOWNLOAD_CACHED 16
  716. #define CACHE_HEADER_DATA_DOWNLOAD_NOT_CACHED 17
  717. #define CACHE_HEADER_DATA_DOWNLOAD_NO_FILE 18
  718. #define CACHE_HEADER_DATA_DOWNLOAD_FILE_NEEDED 19
  719. #define CACHE_HEADER_DATA_DOWNLOAD_FILE_NOT_NEEDED 20
  720. // retail data
  721. #define CACHE_HEADER_DATA_NOTIFICATION_FILTER 21
  722. #define CACHE_HEADER_DATA_ROOT_LEAK_OFFSET 22
  723. // more beta logging stats
  724. #define CACHE_HEADER_DATA_SYNCSTATE_IMAGE 23
  725. #define CACHE_HEADER_DATA_SYNCSTATE_VOLATILE 24
  726. #define CACHE_HEADER_DATA_SYNCSTATE_IMAGE_STATIC 25
  727. #define CACHE_HEADER_DATA_SYNCSTATE_STATIC_VOLATILE 26
  728. // retail data
  729. #define CACHE_HEADER_DATA_ROOT_GROUPLIST_OFFSET 27 // offset to group list
  730. #define CACHE_HEADER_DATA_ROOT_FIXUP_OFFSET 28 // offset to fixup list
  731. #define CACHE_HEADER_DATA_ROOT_FIXUP_COUNT 29 // num of fixup items
  732. #define CACHE_HEADER_DATA_ROOT_FIXUP_TRIGGER 30 // threshhold to fix up
  733. #define CACHE_HEADER_DATA_HIGH_VERSION_STRING 31 // highest entry ver
  734. #define CACHE_HEADER_DATA_LAST 31
  735. // options for cache notification filter
  736. #define CACHE_NOTIFY_ADD_URL 0x00000001
  737. #define CACHE_NOTIFY_DELETE_URL 0x00000002
  738. #define CACHE_NOTIFY_UPDATE_URL 0x00000004
  739. #define CACHE_NOTIFY_DELETE_ALL 0x00000008
  740. #define CACHE_NOTIFY_URL_SET_STICKY 0x00000010
  741. #define CACHE_NOTIFY_URL_UNSET_STICKY 0x00000020
  742. #define CACHE_NOTIFY_SET_ONLINE 0x00000100
  743. #define CACHE_NOTIFY_SET_OFFLINE 0x00000200
  744. #define CACHE_NOTIFY_FILTER_CHANGED 0x10000000
  745. BOOLAPI
  746. RegisterUrlCacheNotification(
  747. IN HWND hWnd,
  748. IN UINT uMsg,
  749. IN GROUPID gid,
  750. IN DWORD dwOpsFilter,
  751. IN DWORD dwReserved
  752. );
  753. BOOL
  754. GetUrlCacheHeaderData(IN DWORD nIdx, OUT LPDWORD lpdwData);
  755. BOOL
  756. SetUrlCacheHeaderData(IN DWORD nIdx, IN DWORD dwData);
  757. BOOL
  758. IncrementUrlCacheHeaderData(IN DWORD nIdx, OUT LPDWORD lpdwData);
  759. BOOL
  760. LoadUrlCacheContent();
  761. BOOL
  762. GetUrlCacheContainerInfoA(
  763. IN LPSTR lpszUrlName,
  764. OUT LPINTERNET_CACHE_CONTAINER_INFOA lpContainerInfo,
  765. IN OUT LPDWORD lpdwContainerInfoBufferSize,
  766. IN DWORD dwOptions
  767. );
  768. BOOL
  769. GetUrlCacheContainerInfoW(
  770. IN LPWSTR lpszUrlName,
  771. OUT LPINTERNET_CACHE_CONTAINER_INFOW lpContainerInfo,
  772. IN OUT LPDWORD lpdwContainerInfoBufferSize,
  773. IN DWORD dwOptions
  774. );
  775. #ifdef UNICODE
  776. #define GetUrlCacheContainerInfo GetUrlCacheContainerInfoW
  777. #else
  778. #define GetUrlCacheContainerInfo GetUrlCacheContainerInfoA
  779. #endif // !UNICODE
  780. //
  781. // Autodial APIs
  782. //
  783. INTERNETAPI_(DWORD) InternetDialA(
  784. IN HWND hwndParent,
  785. IN LPSTR lpszConnectoid,
  786. IN DWORD dwFlags,
  787. OUT DWORD_PTR *lpdwConnection,
  788. IN DWORD dwReserved
  789. );
  790. INTERNETAPI_(DWORD) InternetDialW(
  791. IN HWND hwndParent,
  792. IN LPWSTR lpszConnectoid,
  793. IN DWORD dwFlags,
  794. OUT DWORD_PTR *lpdwConnection,
  795. IN DWORD dwReserved
  796. );
  797. #ifdef UNICODE
  798. #define InternetDial InternetDialW
  799. #else
  800. #ifdef _WINX32_
  801. #define InternetDial InternetDialA
  802. #else
  803. INTERNETAPI_(DWORD) InternetDial(
  804. IN HWND hwndParent,
  805. IN LPSTR lpszConnectoid,
  806. IN DWORD dwFlags,
  807. OUT LPDWORD lpdwConnection,
  808. IN DWORD dwReserved
  809. );
  810. #endif // _WINX32_
  811. #endif // !UNICODE
  812. // Flags for InternetDial - must not conflict with InternetAutodial flags
  813. // as they are valid here also.
  814. #define INTERNET_DIAL_FORCE_PROMPT 0x2000
  815. #define INTERNET_DIAL_SHOW_OFFLINE 0x4000
  816. #define INTERNET_DIAL_UNATTENDED 0x8000
  817. INTERNETAPI_(DWORD) InternetHangUp(
  818. IN DWORD_PTR dwConnection,
  819. IN DWORD dwReserved);
  820. #define INTERENT_GOONLINE_REFRESH 0x00000001
  821. #define INTERENT_GOONLINE_MASK 0x00000001
  822. INTERNETAPI_(BOOL) InternetGoOnlineA(
  823. IN LPSTR lpszURL,
  824. IN HWND hwndParent,
  825. IN DWORD dwFlags
  826. );
  827. INTERNETAPI_(BOOL) InternetGoOnlineW(
  828. IN LPWSTR lpszURL,
  829. IN HWND hwndParent,
  830. IN DWORD dwFlags
  831. );
  832. #ifdef UNICODE
  833. #define InternetGoOnline InternetGoOnlineW
  834. #else
  835. #ifdef _WINX32_
  836. #define InternetGoOnline InternetGoOnlineA
  837. #else
  838. INTERNETAPI_(BOOL) InternetGoOnline(
  839. IN LPSTR lpszURL,
  840. IN HWND hwndParent,
  841. IN DWORD dwFlags
  842. );
  843. #endif // _WINX32_
  844. #endif // !UNICODE
  845. INTERNETAPI_(BOOL) InternetAutodial(
  846. IN DWORD dwFlags,
  847. IN HWND hwndParent);
  848. // Flags for InternetAutodial
  849. #define INTERNET_AUTODIAL_FORCE_ONLINE 1
  850. #define INTERNET_AUTODIAL_FORCE_UNATTENDED 2
  851. #define INTERNET_AUTODIAL_FAILIFSECURITYCHECK 4
  852. #define INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT 8
  853. #define INTERNET_AUTODIAL_FLAGS_MASK (INTERNET_AUTODIAL_FORCE_ONLINE | INTERNET_AUTODIAL_FORCE_UNATTENDED | INTERNET_AUTODIAL_FAILIFSECURITYCHECK | INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT)
  854. INTERNETAPI_(BOOL) InternetAutodialHangup(
  855. IN DWORD dwReserved);
  856. INTERNETAPI_(BOOL) InternetGetConnectedState(
  857. OUT LPDWORD lpdwFlags,
  858. IN DWORD dwReserved);
  859. INTERNETAPI_(BOOL) InternetGetConnectedStateExA(
  860. OUT LPDWORD lpdwFlags,
  861. OUT LPSTR lpszConnectionName,
  862. IN DWORD dwNameLen,
  863. IN DWORD dwReserved
  864. );
  865. INTERNETAPI_(BOOL) InternetGetConnectedStateExW(
  866. OUT LPDWORD lpdwFlags,
  867. OUT LPWSTR lpszConnectionName,
  868. IN DWORD dwNameLen,
  869. IN DWORD dwReserved
  870. );
  871. INTERNETAPI
  872. InternetGetDialEngineW(
  873. IN LPWSTR pwzConnectoid,
  874. IN IDialEventSink * pdes,
  875. OUT IDialEngine ** ppde
  876. );
  877. INTERNETAPI
  878. InternetGetDialBrandingW(
  879. IN LPWSTR pwzConnectoid,
  880. OUT IDialBranding ** ppdb
  881. );
  882. INTERNETAPI_(BOOL) InternetInitializeAutoProxyDll(
  883. DWORD dwReserved
  884. );
  885. INTERNETAPI_(BOOL) InternetDeInitializeAutoProxyDll(
  886. IN LPSTR lpszMime,
  887. IN DWORD dwReserved
  888. );
  889. INTERNETAPI_(BOOL) InternetGetProxyInfo(
  890. IN LPCSTR lpszUrl,
  891. IN DWORD dwUrlLength,
  892. IN LPSTR lpszUrlHostName,
  893. IN DWORD dwUrlHostNameLength,
  894. OUT LPSTR * lplpszProxyHostName,
  895. OUT LPDWORD lpdwProxyHostNameLength
  896. ) ;
  897. INTERNETAPI_(BOOL) DetectAutoProxyUrl(
  898. IN OUT LPSTR lpszAutoProxyUrl,
  899. IN DWORD dwAutoProxyUrlLength,
  900. IN DWORD dwDetectFlags
  901. );
  902. INTERNETAPI_(BOOL) CreateMD5SSOHash (
  903. IN PWSTR pszChallengeInfo,
  904. IN PWSTR pwszRealm,
  905. IN PWSTR pwszTarget,
  906. OUT PBYTE pbHexHash
  907. );
  908. #ifdef UNICODE
  909. #define InternetGetConnectedStateEx InternetGetConnectedStateExW
  910. #else
  911. #ifdef _WINX32_
  912. #define InternetGetConnectedStateEx InternetGetConnectedStateExA
  913. #else
  914. INTERNETAPI_(BOOL) InternetGetConnectedStateEx(
  915. OUT LPDWORD lpdwFlags,
  916. IN LPSTR lpszConnectionName,
  917. IN DWORD dwNameLen,
  918. IN DWORD dwReserved
  919. );
  920. #endif // _WINX32_
  921. #endif // !UNICODE
  922. // Flags for InternetGetConnectedState and Ex
  923. #define INTERNET_CONNECTION_MODEM 0x01
  924. #define INTERNET_CONNECTION_LAN 0x02
  925. #define INTERNET_CONNECTION_PROXY 0x04
  926. #define INTERNET_CONNECTION_MODEM_BUSY 0x08 /* no longer used */
  927. #define INTERNET_RAS_INSTALLED 0x10
  928. #define INTERNET_CONNECTION_OFFLINE 0x20
  929. #define INTERNET_CONNECTION_CONFIGURED 0x40
  930. //
  931. // Custom dial handler functions
  932. //
  933. // Custom dial handler prototype
  934. typedef DWORD (CALLBACK * PFN_DIAL_HANDLER) (HWND, LPCSTR, DWORD, LPDWORD);
  935. // Flags for custom dial handler
  936. #define INTERNET_CUSTOMDIAL_CONNECT 0
  937. #define INTERNET_CUSTOMDIAL_UNATTENDED 1
  938. #define INTERNET_CUSTOMDIAL_DISCONNECT 2
  939. #define INTERNET_CUSTOMDIAL_SHOWOFFLINE 4
  940. // Custom dial handler supported functionality flags
  941. #define INTERNET_CUSTOMDIAL_SAFE_FOR_UNATTENDED 1
  942. #define INTERNET_CUSTOMDIAL_WILL_SUPPLY_STATE 2
  943. #define INTERNET_CUSTOMDIAL_CAN_HANGUP 4
  944. INTERNETAPI_(BOOL) InternetSetDialStateA(
  945. IN LPCSTR lpszConnectoid,
  946. IN DWORD dwState,
  947. IN DWORD dwReserved
  948. );
  949. INTERNETAPI_(BOOL) InternetSetDialStateW(
  950. IN LPCWSTR lpszConnectoid,
  951. IN DWORD dwState,
  952. IN DWORD dwReserved
  953. );
  954. #ifdef UNICODE
  955. #define InternetSetDialState InternetSetDialStateW
  956. #else
  957. #ifdef _WINX32_
  958. #define InternetSetDialState InternetSetDialStateA
  959. #else
  960. INTERNETAPI_(BOOL) InternetSetDialState(
  961. IN LPCSTR lpszConnectoid,
  962. IN DWORD dwState,
  963. IN DWORD dwReserved
  964. );
  965. #endif // _WINX32_
  966. #endif // !UNICODE
  967. // States for InternetSetDialState
  968. #define INTERNET_DIALSTATE_DISCONNECTED 1
  969. // Registry entries used by the dialing code
  970. // All of these entries are in:
  971. // HKCU\software\microsoft\windows\current version\internet settings
  972. #define REGSTR_DIAL_AUTOCONNECT "AutoConnect"
  973. // Registry entries for legacy cookies
  974. #define REGSTR_LEASH_LEGACY_COOKIES "LeashLegacyCookies"
  975. // Used by security manager.
  976. INTERNETAPI_(BOOL) IsHostInProxyBypassList(
  977. IN INTERNET_SCHEME tScheme,
  978. IN LPCSTR lpszHost,
  979. IN DWORD cchHost);
  980. // Used by Shell to determine if anyone has loaded wininet yet
  981. // Shell code calls OpenMutex with this name and if no mutex is
  982. // obtained, we know that no copy of wininet has been loaded yet
  983. #define WININET_STARTUP_MUTEX "WininetStartupMutex"
  984. BOOL DoConnectoidsExist(void); // Returns TRUE if any RAS connectoids exist and FALSE otherwise
  985. BOOL GetDiskInfoA(
  986. IN PSTR pszPath,
  987. IN OUT PDWORD pdwClusterSize,
  988. IN OUT PDWORDLONG pdlAvail,
  989. IN OUT PDWORDLONG pdlTotal);
  990. typedef BOOL (*CACHE_OPERATOR)(INTERNET_CACHE_ENTRY_INFO* pcei, PDWORD pcbcei, PVOID pOpData);
  991. BOOL PerformOperationOverUrlCacheA(
  992. IN PCSTR pszUrlSearchPattern,
  993. IN DWORD dwFlags,
  994. IN DWORD dwFilter,
  995. IN GROUPID GroupId,
  996. OUT PVOID pReserved1,
  997. IN OUT PDWORD pdwReserved2,
  998. IN PVOID pReserved3,
  999. IN CACHE_OPERATOR op,
  1000. IN OUT PVOID pOperatorData
  1001. );
  1002. BOOL IsProfilesCapable();
  1003. // in cookimp.cxx and cookexp.cxx
  1004. BOOLAPI ImportCookieFileA( IN LPCSTR szFilename );
  1005. // in cookimp.cxx and cookexp.cxx
  1006. BOOLAPI ImportCookieFileW( IN LPCWSTR szFilename );
  1007. #ifdef UNICODE
  1008. #define ImportCookieFile ImportCookieFileW
  1009. #else
  1010. #define ImportCookieFile ImportCookieFileA
  1011. #endif // !UNICODE
  1012. BOOLAPI ExportCookieFileA( IN LPCSTR szFilename, BOOL fAppend);
  1013. BOOLAPI ExportCookieFileW( IN LPCWSTR szFilename, BOOL fAppend);
  1014. #ifdef UNICODE
  1015. #define ExportCookieFile ExportCookieFileW
  1016. #else
  1017. #define ExportCookieFile ExportCookieFileA
  1018. #endif // !UNICODE
  1019. BOOLAPI IsDomainLegalCookieDomainA( IN LPCSTR pchDomain, IN LPCSTR pchFullDomain); // in "wininet\http\cookie.cxx"
  1020. BOOLAPI IsDomainLegalCookieDomainW( IN LPCWSTR pchDomain, IN LPCWSTR pchFullDomain); // in "wininet\http\cookie.cxx"
  1021. #ifdef UNICODE
  1022. #define IsDomainLegalCookieDomain IsDomainLegalCookieDomainW
  1023. #else
  1024. #define IsDomainLegalCookieDomain IsDomainLegalCookieDomainA
  1025. #endif // !UNICODE
  1026. INTERNETAPI_(BOOL) InternetEnumPerSiteCookieDecisionA(OUT LPSTR pszSiteName, IN OUT unsigned long *pcSiteNameSize, OUT unsigned long *pdwDecision, IN unsigned long dwIndex);
  1027. INTERNETAPI_(BOOL) InternetEnumPerSiteCookieDecisionW(OUT LPWSTR pszSiteName, IN OUT unsigned long *pcSiteNameSize, OUT unsigned long *pdwDecision, IN unsigned long dwIndex);
  1028. #ifdef UNICODE
  1029. #define InternetEnumPerSiteCookieDecision InternetEnumPerSiteCookieDecisionW
  1030. #else
  1031. #define InternetEnumPerSiteCookieDecision InternetEnumPerSiteCookieDecisionA
  1032. #endif // !UNICODE
  1033. //
  1034. // Privacy settings values and APIs
  1035. //
  1036. #define PRIVACY_TEMPLATE_NO_COOKIES 0
  1037. #define PRIVACY_TEMPLATE_HIGH 1
  1038. #define PRIVACY_TEMPLATE_MEDIUM_HIGH 2
  1039. #define PRIVACY_TEMPLATE_MEDIUM 3
  1040. #define PRIVACY_TEMPLATE_MEDIUM_LOW 4
  1041. #define PRIVACY_TEMPLATE_LOW 5
  1042. #define PRIVACY_TEMPLATE_CUSTOM 100
  1043. #define PRIVACY_TEMPLATE_ADVANCED 101
  1044. #define PRIVACY_TEMPLATE_MAX PRIVACY_TEMPLATE_LOW
  1045. #define PRIVACY_TYPE_FIRST_PARTY 0
  1046. #define PRIVACY_TYPE_THIRD_PARTY 1
  1047. INTERNETAPI_(DWORD)
  1048. PrivacySetZonePreferenceW(
  1049. DWORD dwZone,
  1050. DWORD dwType,
  1051. DWORD dwTemplate,
  1052. LPCWSTR pszPreference
  1053. );
  1054. INTERNETAPI_(DWORD)
  1055. PrivacyGetZonePreferenceW(
  1056. DWORD dwZone,
  1057. DWORD dwType,
  1058. LPDWORD pdwTemplate,
  1059. LPWSTR pszBuffer,
  1060. LPDWORD pdwBufferLength
  1061. );
  1062. #define _P3PGLOBAL_H_
  1063. typedef char P3PCHAR;
  1064. typedef char *P3PURL;
  1065. typedef char *P3PVERB;
  1066. typedef const char *P3PCURL;
  1067. typedef BSTR P3PCXSL;
  1068. typedef void *P3PHANDLE;
  1069. #define URL_LIMIT INTERNET_MAX_URL_LENGTH
  1070. struct P3PResource {
  1071. P3PCURL pszLocation;
  1072. P3PVERB pszVerb;
  1073. P3PCURL pszP3PHeaderRef;
  1074. P3PCURL pszLinkTagRef;
  1075. struct P3PResource *pContainer;
  1076. };
  1077. struct P3PSignal {
  1078. /* Window handle for PostMessage and corresponding msg value */
  1079. HWND hwnd;
  1080. unsigned int message;
  1081. /* Event handle to signal */
  1082. HANDLE hEvent;
  1083. /* Application-defined context */
  1084. void *pContext;
  1085. /* OUT: request handle */
  1086. P3PHANDLE hRequest;
  1087. };
  1088. typedef enum {
  1089. P3P_Done = 0x0,
  1090. P3P_Success = 0x0,
  1091. P3P_NoPolicy = 0x2,
  1092. P3P_InProgress = 0x3,
  1093. P3P_Failed = 0x4,
  1094. P3P_NotFound = 0x5,
  1095. P3P_FormatErr = 0x6,
  1096. P3P_Cancelled = 0x7,
  1097. P3P_NotStarted = 0x8,
  1098. P3P_XMLError = 0x9,
  1099. P3P_Expired = 0xA,
  1100. P3P_Error = 0xFF,
  1101. }
  1102. P3PStatus;
  1103. INTERNETAPI_(int) MapResourceToPolicy(struct P3PResource *pResource, P3PURL pszPolicy, unsigned long dwSize, struct P3PSignal *pSignal);
  1104. INTERNETAPI_(int) GetP3PPolicy(P3PCURL pszPolicyURL, HANDLE hDestination, P3PCXSL pszXSLtransform, struct P3PSignal *pSignal);
  1105. INTERNETAPI_(int) FreeP3PObject(P3PHANDLE hObject);
  1106. INTERNETAPI_(int) GetP3PRequestStatus(P3PHANDLE hObject);
  1107. #if defined(__cplusplus)
  1108. }
  1109. #endif
  1110. #endif // !define(_WININETEX_)