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.

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