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.

2623 lines
74 KiB

  1. /*++
  2. Copyright (c) 1995-1996 Microsoft Corporation
  3. Module Name:
  4. wininet.h
  5. Abstract:
  6. Contains manifests, macros, types and prototypes for Microsoft Windows
  7. Internet Extensions
  8. --*/
  9. #if !defined(_WININET_)
  10. #define _WININET_
  11. /*
  12. * Set up Structure Packing to be 4 bytes
  13. * for all wininet structures
  14. */
  15. #pragma pack(push, wininet, 4)
  16. #if defined(__cplusplus)
  17. extern "C" {
  18. #endif
  19. #if !defined(_WINX32_)
  20. #define INTERNETAPI DECLSPEC_IMPORT
  21. #else
  22. #define INTERNETAPI
  23. #endif
  24. //
  25. // internet types
  26. //
  27. typedef LPVOID HINTERNET;
  28. typedef HINTERNET * LPHINTERNET;
  29. typedef WORD INTERNET_PORT;
  30. typedef INTERNET_PORT * LPINTERNET_PORT;
  31. //
  32. // Internet APIs
  33. //
  34. //
  35. // manifests
  36. //
  37. #define INTERNET_INVALID_PORT_NUMBER 0 // use the protocol-specific default
  38. #define INTERNET_DEFAULT_FTP_PORT 21 // default for FTP servers
  39. #define INTERNET_DEFAULT_GOPHER_PORT 70 // " " gopher "
  40. #define INTERNET_DEFAULT_HTTP_PORT 80 // " " HTTP "
  41. #define INTERNET_DEFAULT_HTTPS_PORT 443 // " " HTTPS "
  42. #define INTERNET_DEFAULT_SOCKS_PORT 1080 // default for SOCKS firewall servers.
  43. #define MAX_CACHE_ENTRY_INFO_SIZE 4096
  44. //
  45. // maximum field lengths (arbitrary)
  46. //
  47. #define INTERNET_MAX_HOST_NAME_LENGTH 256
  48. #define INTERNET_MAX_USER_NAME_LENGTH 128
  49. #define INTERNET_MAX_PASSWORD_LENGTH 128
  50. #define INTERNET_MAX_PORT_NUMBER_LENGTH 5 // INTERNET_PORT is unsigned short
  51. #define INTERNET_MAX_PORT_NUMBER_VALUE 65535 // maximum unsigned short value
  52. #define INTERNET_MAX_PATH_LENGTH 2048
  53. #define INTERNET_MAX_PROTOCOL_NAME "gopher" // longest protocol name
  54. #define INTERNET_MAX_URL_LENGTH ((sizeof(INTERNET_MAX_PROTOCOL_NAME) - 1) \
  55. + sizeof("://") \
  56. + INTERNET_MAX_PATH_LENGTH)
  57. //
  58. // values returned by InternetQueryOption() with INTERNET_OPTION_KEEP_CONNECTION:
  59. //
  60. #define INTERNET_KEEP_ALIVE_UNKNOWN ((DWORD)-1)
  61. #define INTERNET_KEEP_ALIVE_ENABLED 1
  62. #define INTERNET_KEEP_ALIVE_DISABLED 0
  63. //
  64. // flags returned by InternetQueryOption() with INTERNET_OPTION_REQUEST_FLAGS
  65. //
  66. #define INTERNET_REQFLAG_FROM_CACHE 0x00000001
  67. #define INTERNET_REQFLAG_ASYNC 0x00000002
  68. //
  69. // flags common to open functions (not InternetOpen()):
  70. //
  71. #define INTERNET_FLAG_RELOAD 0x80000000 // retrieve the original item
  72. //
  73. // flags for InternetOpenUrl():
  74. //
  75. #define INTERNET_FLAG_RAW_DATA 0x40000000 // receive the item as raw data
  76. #define INTERNET_FLAG_EXISTING_CONNECT 0x20000000 // do not create new connection object
  77. //
  78. // flags for InternetOpen():
  79. //
  80. #define INTERNET_FLAG_ASYNC 0x10000000 // this request is asynchronous (where supported)
  81. //
  82. // protocol-specific flags:
  83. //
  84. #define INTERNET_FLAG_PASSIVE 0x08000000 // used for FTP connections
  85. //
  86. // additional cache flags
  87. //
  88. #define INTERNET_FLAG_NO_CACHE_WRITE 0x04000000 // don't write this item to the cache
  89. #define INTERNET_FLAG_DONT_CACHE INTERNET_FLAG_NO_CACHE_WRITE
  90. #define INTERNET_FLAG_MAKE_PERSISTENT 0x02000000 // make this item persistent in cache
  91. #define INTERNET_FLAG_OFFLINE 0x01000000 // use offline semantics
  92. //
  93. // additional flags
  94. //
  95. #define INTERNET_FLAG_SECURE 0x00800000 // use PCT/SSL if applicable (HTTP)
  96. #define INTERNET_FLAG_KEEP_CONNECTION 0x00400000 // use keep-alive semantics
  97. #define INTERNET_FLAG_NO_AUTO_REDIRECT 0x00200000 // don't handle redirections automatically
  98. #define INTERNET_FLAG_READ_PREFETCH 0x00100000 // do background read prefetch
  99. #define INTERNET_FLAG_NO_COOKIES 0x00080000 // no automatic cookie handling
  100. #define INTERNET_FLAG_NO_AUTH 0x00040000 // no automatic authentication handling
  101. //
  102. // Security Ignore Flags, Allow HttpOpenRequest to overide
  103. // Secure Channel (SSL/PCT) failures of the following types.
  104. //
  105. #define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP 0x00008000 // ex: https:// to http://
  106. #define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS 0x00004000 // ex: http:// to https://
  107. #define INTERNET_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000 // expired X509 Cert.
  108. #define INTERNET_FLAG_IGNORE_CERT_CN_INVALID 0x00001000 // bad common name in X509 Cert.
  109. //more caching flags
  110. #define INTERNET_FLAG_MUST_CACHE_REQUEST 0x00000010 // fails if unable to cache request
  111. #define INTERNET_FLAG_RESYNCHRONIZE 0x00000800 // asking wininet to update an item if it is newer
  112. #define INTERNET_FLAG_HYPERLINK 0x00000400 // asking wininet to
  113. //do hyperlinking semantic which works right for scripts
  114. #define INTERNET_FLAG_NO_UI 0x00000200
  115. //
  116. // flags for FTP
  117. //
  118. #define INTERNET_FLAG_TRANSFER_ASCII FTP_TRANSFER_TYPE_ASCII
  119. #define INTERNET_FLAG_TRANSFER_BINARY FTP_TRANSFER_TYPE_BINARY
  120. //
  121. // flags field masks
  122. //
  123. #define SECURITY_INTERNET_MASK (INTERNET_FLAG_IGNORE_CERT_CN_INVALID | \
  124. INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | \
  125. INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS | \
  126. INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP )
  127. #define SECURITY_SET_MASK SECURITY_INTERNET_MASK
  128. #define INTERNET_FLAGS_MASK (INTERNET_FLAG_RELOAD \
  129. | INTERNET_FLAG_RAW_DATA \
  130. | INTERNET_FLAG_EXISTING_CONNECT \
  131. | INTERNET_FLAG_ASYNC \
  132. | INTERNET_FLAG_PASSIVE \
  133. | INTERNET_FLAG_NO_CACHE_WRITE \
  134. | INTERNET_FLAG_MAKE_PERSISTENT \
  135. | INTERNET_FLAG_OFFLINE \
  136. | INTERNET_FLAG_SECURE \
  137. | INTERNET_FLAG_KEEP_CONNECTION \
  138. | INTERNET_FLAG_NO_AUTO_REDIRECT \
  139. | INTERNET_FLAG_READ_PREFETCH \
  140. | INTERNET_FLAG_NO_COOKIES \
  141. | INTERNET_FLAG_NO_AUTH \
  142. | SECURITY_INTERNET_MASK \
  143. | INTERNET_FLAG_TRANSFER_ASCII \
  144. | INTERNET_FLAG_TRANSFER_BINARY \
  145. | INTERNET_FLAG_RESYNCHRONIZE \
  146. | INTERNET_FLAG_MUST_CACHE_REQUEST \
  147. | INTERNET_FLAG_HYPERLINK \
  148. | INTERNET_FLAG_NO_UI \
  149. )
  150. #define INTERNET_OPTIONS_MASK (~INTERNET_FLAGS_MASK)
  151. //
  152. // INTERNET_NO_CALLBACK - if this value is presented as the dwContext parameter
  153. // then no call-backs will be made for that API
  154. //
  155. #define INTERNET_NO_CALLBACK 0
  156. //
  157. // structures/types
  158. //
  159. //
  160. // INTERNET_SCHEME - enumerated URL scheme type
  161. //
  162. typedef enum {
  163. INTERNET_SCHEME_PARTIAL = -2,
  164. INTERNET_SCHEME_UNKNOWN = -1,
  165. INTERNET_SCHEME_DEFAULT = 0,
  166. INTERNET_SCHEME_FTP,
  167. INTERNET_SCHEME_GOPHER,
  168. INTERNET_SCHEME_HTTP,
  169. INTERNET_SCHEME_HTTPS,
  170. INTERNET_SCHEME_FILE,
  171. INTERNET_SCHEME_NEWS,
  172. INTERNET_SCHEME_MAILTO,
  173. INTERNET_SCHEME_SOCKS,
  174. INTERNET_SCHEME_FIRST = INTERNET_SCHEME_FTP,
  175. INTERNET_SCHEME_LAST = INTERNET_SCHEME_SOCKS
  176. } INTERNET_SCHEME, * LPINTERNET_SCHEME;
  177. //
  178. // INTERNET_ASYNC_RESULT - this structure is returned to the application via
  179. // the callback with INTERNET_STATUS_REQUEST_COMPLETE. It is not sufficient to
  180. // just return the result of the async operation. If the API failed then the
  181. // app cannot call GetLastError() because the thread context will be incorrect.
  182. // Both the value returned by the async API and any resultant error code are
  183. // made available. The app need not check dwError if dwResult indicates that
  184. // the API succeeded (in this case dwError will be ERROR_SUCCESS)
  185. //
  186. typedef struct {
  187. //
  188. // dwResult - the HINTERNET, DWORD or BOOL return code from an async API
  189. //
  190. DWORD dwResult;
  191. //
  192. // dwError - the error code if the API failed
  193. //
  194. DWORD dwError;
  195. } INTERNET_ASYNC_RESULT, * LPINTERNET_ASYNC_RESULT;
  196. //
  197. // INTERNET_PREFETCH_STATUS -
  198. //
  199. typedef struct {
  200. //
  201. // dwStatus - status of download. See INTERNET_PREFETCH_ flags
  202. //
  203. DWORD dwStatus;
  204. //
  205. // dwSize - size of file downloaded so far
  206. //
  207. DWORD dwSize;
  208. } INTERNET_PREFETCH_STATUS, * LPINTERNET_PREFETCH_STATUS;
  209. //
  210. // INTERNET_PREFETCH_STATUS - dwStatus values
  211. //
  212. #define INTERNET_PREFETCH_PROGRESS 0
  213. #define INTERNET_PREFETCH_COMPLETE 1
  214. #define INTERNET_PREFETCH_ABORTED 2
  215. //
  216. // INTERNET_PROXY_INFO - structure supplied with INTERNET_OPTION_PROXY to get/
  217. // set proxy information on a InternetOpen() handle
  218. //
  219. typedef struct {
  220. //
  221. // dwAccessType - INTERNET_OPEN_TYPE_DIRECT, INTERNET_OPEN_TYPE_PROXY, or
  222. // INTERNET_OPEN_TYPE_PRECONFIG (set only)
  223. //
  224. DWORD dwAccessType;
  225. //
  226. // lpszProxy - proxy server list
  227. //
  228. LPCTSTR lpszProxy;
  229. //
  230. // lpszProxyBypass - proxy bypass list
  231. //
  232. LPCTSTR lpszProxyBypass;
  233. } INTERNET_PROXY_INFO, * LPINTERNET_PROXY_INFO;
  234. //
  235. // INTERNET_VERSION_INFO - version information returned via
  236. // InternetQueryOption(..., INTERNET_OPTION_VERSION, ...)
  237. //
  238. typedef struct {
  239. DWORD dwMajorVersion;
  240. DWORD dwMinorVersion;
  241. } INTERNET_VERSION_INFO, * LPINTERNET_VERSION_INFO;
  242. //
  243. // URL_COMPONENTS - the constituent parts of an URL. Used in InternetCrackUrl()
  244. // and InternetCreateUrl()
  245. //
  246. // For InternetCrackUrl(), if a pointer field and its corresponding length field
  247. // are both 0 then that component is not returned; If the pointer field is NULL
  248. // but the length field is not zero, then both the pointer and length fields are
  249. // returned; if both pointer and corresponding length fields are non-zero then
  250. // the pointer field points to a buffer where the component is copied. The
  251. // component may be un-escaped, depending on dwFlags
  252. //
  253. // For InternetCreateUrl(), the pointer fields should be NULL if the component
  254. // is not required. If the corresponding length field is zero then the pointer
  255. // field is the address of a zero-terminated string. If the length field is not
  256. // zero then it is the string length of the corresponding pointer field
  257. //
  258. typedef struct {
  259. DWORD dwStructSize; // size of this structure. Used in version check
  260. LPSTR lpszScheme; // pointer to scheme name
  261. DWORD dwSchemeLength; // length of scheme name
  262. INTERNET_SCHEME nScheme; // enumerated scheme type (if known)
  263. LPSTR lpszHostName; // pointer to host name
  264. DWORD dwHostNameLength; // length of host name
  265. INTERNET_PORT nPort; // converted port number
  266. LPSTR lpszUserName; // pointer to user name
  267. DWORD dwUserNameLength; // length of user name
  268. LPSTR lpszPassword; // pointer to password
  269. DWORD dwPasswordLength; // length of password
  270. LPSTR lpszUrlPath; // pointer to URL-path
  271. DWORD dwUrlPathLength; // length of URL-path
  272. LPSTR lpszExtraInfo; // pointer to extra information (e.g. ?foo or #foo)
  273. DWORD dwExtraInfoLength; // length of extra information
  274. } URL_COMPONENTSA, * LPURL_COMPONENTSA;
  275. typedef struct {
  276. DWORD dwStructSize; // size of this structure. Used in version check
  277. LPWSTR lpszScheme; // pointer to scheme name
  278. DWORD dwSchemeLength; // length of scheme name
  279. INTERNET_SCHEME nScheme; // enumerated scheme type (if known)
  280. LPWSTR lpszHostName; // pointer to host name
  281. DWORD dwHostNameLength; // length of host name
  282. INTERNET_PORT nPort; // converted port number
  283. LPWSTR lpszUserName; // pointer to user name
  284. DWORD dwUserNameLength; // length of user name
  285. LPWSTR lpszPassword; // pointer to password
  286. DWORD dwPasswordLength; // length of password
  287. LPWSTR lpszUrlPath; // pointer to URL-path
  288. DWORD dwUrlPathLength; // length of URL-path
  289. LPWSTR lpszExtraInfo; // pointer to extra information (e.g. ?foo or #foo)
  290. DWORD dwExtraInfoLength; // length of extra information
  291. } URL_COMPONENTSW, * LPURL_COMPONENTSW;
  292. #ifdef UNICODE
  293. typedef URL_COMPONENTSW URL_COMPONENTS;
  294. typedef LPURL_COMPONENTSW LPURL_COMPONENTS;
  295. #else
  296. typedef URL_COMPONENTSA URL_COMPONENTS;
  297. typedef LPURL_COMPONENTSA LPURL_COMPONENTS;
  298. #endif // UNICODE
  299. //
  300. // INTERNET_CERTIFICATE_INFO lpBuffer - contains the certificate returned from
  301. // the server
  302. //
  303. typedef struct {
  304. //
  305. // ftExpiry - date the certificate expires.
  306. //
  307. FILETIME ftExpiry;
  308. //
  309. // ftStart - date the certificate becomes valid.
  310. //
  311. FILETIME ftStart;
  312. //
  313. // lpszSubjectInfo - the name of organization, site, and server
  314. // the cert. was issued for.
  315. //
  316. LPTSTR lpszSubjectInfo;
  317. //
  318. // lpszIssuerInfo - the name of organization, site, and server
  319. // the cert was issues by.
  320. //
  321. LPTSTR lpszIssuerInfo;
  322. //
  323. // lpszProtocolName - the name of the protocol used to provide the secure
  324. // connection.
  325. //
  326. LPTSTR lpszProtocolName;
  327. //
  328. // lpszSignatureAlgName - the name of the algorithm used for signing
  329. // the certificate.
  330. //
  331. LPTSTR lpszSignatureAlgName;
  332. //
  333. // lpszEncryptionAlgName - the name of the algorithm used for
  334. // doing encryption over the secure channel (SSL/PCT) connection.
  335. //
  336. LPTSTR lpszEncryptionAlgName;
  337. //
  338. // dwKeySize - size of the key.
  339. //
  340. DWORD dwKeySize;
  341. } INTERNET_CERTIFICATE_INFO, * LPINTERNET_CERTIFICATE_INFO;
  342. //
  343. // prototypes
  344. //
  345. INTERNETAPI
  346. BOOL
  347. WINAPI
  348. InternetTimeFromSystemTime(
  349. IN CONST SYSTEMTIME *pst, // input GMT time
  350. IN DWORD dwRFC, // RFC format
  351. OUT LPSTR lpszTime, // output string buffer
  352. IN DWORD cbTime // output buffer size
  353. );
  354. //
  355. // constants for InternetTimeFromSystemTime
  356. //
  357. #define INTERNET_RFC1123_FORMAT 0
  358. #define INTERNET_RFC1123_BUFSIZE 30
  359. INTERNETAPI
  360. BOOL
  361. WINAPI
  362. InternetTimeToSystemTime(
  363. IN LPCSTR lpszTime, // NULL terminated string
  364. OUT SYSTEMTIME *pst, // output in GMT time
  365. IN DWORD dwReserved
  366. );
  367. INTERNETAPI
  368. BOOL
  369. WINAPI
  370. InternetDebugGetLocalTime(
  371. OUT SYSTEMTIME * pstLocalTime,
  372. OUT DWORD * pdwReserved
  373. );
  374. INTERNETAPI
  375. BOOL
  376. WINAPI
  377. InternetCrackUrlA(
  378. IN LPCSTR lpszUrl,
  379. IN DWORD dwUrlLength,
  380. IN DWORD dwFlags,
  381. IN OUT LPURL_COMPONENTSA lpUrlComponents
  382. );
  383. INTERNETAPI
  384. BOOL
  385. WINAPI
  386. InternetCrackUrlW(
  387. IN LPCWSTR lpszUrl,
  388. IN DWORD dwUrlLength,
  389. IN DWORD dwFlags,
  390. IN OUT LPURL_COMPONENTSW lpUrlComponents
  391. );
  392. #ifdef UNICODE
  393. #define InternetCrackUrl InternetCrackUrlW
  394. #else
  395. #define InternetCrackUrl InternetCrackUrlA
  396. #endif // !UNICODE
  397. INTERNETAPI
  398. BOOL
  399. WINAPI
  400. InternetCreateUrlA(
  401. IN LPURL_COMPONENTSA lpUrlComponents,
  402. IN DWORD dwFlags,
  403. OUT LPSTR lpszUrl,
  404. IN OUT LPDWORD lpdwUrlLength
  405. );
  406. INTERNETAPI
  407. BOOL
  408. WINAPI
  409. InternetCreateUrlW(
  410. IN LPURL_COMPONENTSW lpUrlComponents,
  411. IN DWORD dwFlags,
  412. OUT LPWSTR lpszUrl,
  413. IN OUT LPDWORD lpdwUrlLength
  414. );
  415. #ifdef UNICODE
  416. #define InternetCreateUrl InternetCreateUrlW
  417. #else
  418. #define InternetCreateUrl InternetCreateUrlA
  419. #endif // !UNICODE
  420. INTERNETAPI
  421. BOOL
  422. WINAPI
  423. InternetCanonicalizeUrlA(
  424. IN LPCSTR lpszUrl,
  425. OUT LPSTR lpszBuffer,
  426. IN OUT LPDWORD lpdwBufferLength,
  427. IN DWORD dwFlags
  428. );
  429. INTERNETAPI
  430. BOOL
  431. WINAPI
  432. InternetCanonicalizeUrlW(
  433. IN LPCWSTR lpszUrl,
  434. OUT LPWSTR lpszBuffer,
  435. IN OUT LPDWORD lpdwBufferLength,
  436. IN DWORD dwFlags
  437. );
  438. #ifdef UNICODE
  439. #define InternetCanonicalizeUrl InternetCanonicalizeUrlW
  440. #else
  441. #define InternetCanonicalizeUrl InternetCanonicalizeUrlA
  442. #endif // !UNICODE
  443. INTERNETAPI
  444. BOOL
  445. WINAPI
  446. InternetCombineUrlA(
  447. IN LPCSTR lpszBaseUrl,
  448. IN LPCSTR lpszRelativeUrl,
  449. OUT LPSTR lpszBuffer,
  450. IN OUT LPDWORD lpdwBufferLength,
  451. IN DWORD dwFlags
  452. );
  453. INTERNETAPI
  454. BOOL
  455. WINAPI
  456. InternetCombineUrlW(
  457. IN LPCWSTR lpszBaseUrl,
  458. IN LPCWSTR lpszRelativeUrl,
  459. OUT LPWSTR lpszBuffer,
  460. IN OUT LPDWORD lpdwBufferLength,
  461. IN DWORD dwFlags
  462. );
  463. #ifdef UNICODE
  464. #define InternetCombineUrl InternetCombineUrlW
  465. #else
  466. #define InternetCombineUrl InternetCombineUrlA
  467. #endif // !UNICODE
  468. //
  469. // flags for InternetCrackUrl() and InternetCreateUrl()
  470. //
  471. #define ICU_ESCAPE 0x80000000 // (un)escape URL characters
  472. #define ICU_USERNAME 0x40000000 // use internal username & password
  473. //
  474. // flags for InternetCanonicalizeUrl() and InternetCombineUrl()
  475. //
  476. #define ICU_NO_ENCODE 0x20000000 // Don't convert unsafe characters to escape sequence
  477. #define ICU_DECODE 0x10000000 // Convert %XX escape sequences to characters
  478. #define ICU_NO_META 0x08000000 // Don't convert .. etc. meta path sequences
  479. #define ICU_ENCODE_SPACES_ONLY 0x04000000 // Encode spaces only
  480. #define ICU_BROWSER_MODE 0x02000000 // Special encode/decode rules for browser
  481. INTERNETAPI
  482. HINTERNET
  483. WINAPI
  484. InternetOpenA(
  485. IN LPCSTR lpszAgent,
  486. IN DWORD dwAccessType,
  487. IN LPCSTR lpszProxy OPTIONAL,
  488. IN LPCSTR lpszProxyBypass OPTIONAL,
  489. IN DWORD dwFlags
  490. );
  491. INTERNETAPI
  492. HINTERNET
  493. WINAPI
  494. InternetOpenW(
  495. IN LPCWSTR lpszAgent,
  496. IN DWORD dwAccessType,
  497. IN LPCWSTR lpszProxy OPTIONAL,
  498. IN LPCWSTR lpszProxyBypass OPTIONAL,
  499. IN DWORD dwFlags
  500. );
  501. #ifdef UNICODE
  502. #define InternetOpen InternetOpenW
  503. #else
  504. #define InternetOpen InternetOpenA
  505. #endif // !UNICODE
  506. //
  507. // access types for InternetOpen()
  508. //
  509. #define INTERNET_OPEN_TYPE_PRECONFIG 0 // use registry configuration
  510. #define INTERNET_OPEN_TYPE_DIRECT 1 // direct to net
  511. #define INTERNET_OPEN_TYPE_PROXY 3 // via named proxy
  512. #define PRE_CONFIG_INTERNET_ACCESS INTERNET_OPEN_TYPE_PRECONFIG
  513. #define LOCAL_INTERNET_ACCESS INTERNET_OPEN_TYPE_DIRECT
  514. #define GATEWAY_INTERNET_ACCESS 2 // Internet via gateway
  515. #define CERN_PROXY_INTERNET_ACCESS INTERNET_OPEN_TYPE_PROXY
  516. INTERNETAPI
  517. BOOL
  518. WINAPI
  519. InternetCloseHandle(
  520. IN HINTERNET hInternet
  521. );
  522. INTERNETAPI
  523. HINTERNET
  524. WINAPI
  525. InternetConnectA(
  526. IN HINTERNET hInternet,
  527. IN LPCSTR lpszServerName,
  528. IN INTERNET_PORT nServerPort,
  529. IN LPCSTR lpszUserName OPTIONAL,
  530. IN LPCSTR lpszPassword OPTIONAL,
  531. IN DWORD dwService,
  532. IN DWORD dwFlags,
  533. IN DWORD dwContext
  534. );
  535. INTERNETAPI
  536. HINTERNET
  537. WINAPI
  538. InternetConnectW(
  539. IN HINTERNET hInternet,
  540. IN LPCWSTR lpszServerName,
  541. IN INTERNET_PORT nServerPort,
  542. IN LPCWSTR lpszUserName OPTIONAL,
  543. IN LPCWSTR lpszPassword OPTIONAL,
  544. IN DWORD dwService,
  545. IN DWORD dwFlags,
  546. IN DWORD dwContext
  547. );
  548. #ifdef UNICODE
  549. #define InternetConnect InternetConnectW
  550. #else
  551. #define InternetConnect InternetConnectA
  552. #endif // !UNICODE
  553. //
  554. // service types for InternetConnect()
  555. //
  556. #define INTERNET_SERVICE_FTP 1
  557. #define INTERNET_SERVICE_GOPHER 2
  558. #define INTERNET_SERVICE_HTTP 3
  559. INTERNETAPI
  560. HINTERNET
  561. WINAPI
  562. InternetOpenUrlA(
  563. IN HINTERNET hInternet,
  564. IN LPCSTR lpszUrl,
  565. IN LPCSTR lpszHeaders OPTIONAL,
  566. IN DWORD dwHeadersLength,
  567. IN DWORD dwFlags,
  568. IN DWORD dwContext
  569. );
  570. INTERNETAPI
  571. HINTERNET
  572. WINAPI
  573. InternetOpenUrlW(
  574. IN HINTERNET hInternet,
  575. IN LPCWSTR lpszUrl,
  576. IN LPCWSTR lpszHeaders OPTIONAL,
  577. IN DWORD dwHeadersLength,
  578. IN DWORD dwFlags,
  579. IN DWORD dwContext
  580. );
  581. #ifdef UNICODE
  582. #define InternetOpenUrl InternetOpenUrlW
  583. #else
  584. #define InternetOpenUrl InternetOpenUrlA
  585. #endif // !UNICODE
  586. INTERNETAPI
  587. BOOL
  588. WINAPI
  589. InternetReadFile(
  590. IN HINTERNET hFile,
  591. IN LPVOID lpBuffer,
  592. IN DWORD dwNumberOfBytesToRead,
  593. OUT LPDWORD lpdwNumberOfBytesRead
  594. );
  595. INTERNETAPI
  596. DWORD
  597. WINAPI
  598. InternetSetFilePointer(
  599. IN HINTERNET hFile,
  600. IN LONG lDistanceToMove,
  601. IN PVOID pReserved,
  602. IN DWORD dwMoveMethod,
  603. IN DWORD dwContext
  604. );
  605. INTERNETAPI
  606. BOOL
  607. WINAPI
  608. InternetWriteFile(
  609. IN HINTERNET hFile,
  610. IN LPCVOID lpBuffer,
  611. IN DWORD dwNumberOfBytesToWrite,
  612. OUT LPDWORD lpdwNumberOfBytesWritten
  613. );
  614. INTERNETAPI
  615. BOOL
  616. WINAPI
  617. InternetQueryDataAvailable(
  618. IN HINTERNET hFile,
  619. OUT LPDWORD lpdwNumberOfBytesAvailable,
  620. IN DWORD dwFlags,
  621. IN DWORD dwContext
  622. );
  623. INTERNETAPI
  624. BOOL
  625. WINAPI
  626. InternetFindNextFileA(
  627. IN HINTERNET hFind,
  628. OUT LPVOID lpvFindData
  629. );
  630. INTERNETAPI
  631. BOOL
  632. WINAPI
  633. InternetFindNextFileW(
  634. IN HINTERNET hFind,
  635. OUT LPVOID lpvFindData
  636. );
  637. #ifdef UNICODE
  638. #define InternetFindNextFile InternetFindNextFileW
  639. #else
  640. #define InternetFindNextFile InternetFindNextFileA
  641. #endif // !UNICODE
  642. INTERNETAPI
  643. BOOL
  644. WINAPI
  645. InternetQueryOptionA(
  646. IN HINTERNET hInternet OPTIONAL,
  647. IN DWORD dwOption,
  648. OUT LPVOID lpBuffer OPTIONAL,
  649. IN OUT LPDWORD lpdwBufferLength
  650. );
  651. INTERNETAPI
  652. BOOL
  653. WINAPI
  654. InternetQueryOptionW(
  655. IN HINTERNET hInternet OPTIONAL,
  656. IN DWORD dwOption,
  657. OUT LPVOID lpBuffer OPTIONAL,
  658. IN OUT LPDWORD lpdwBufferLength
  659. );
  660. #ifdef UNICODE
  661. #define InternetQueryOption InternetQueryOptionW
  662. #else
  663. #define InternetQueryOption InternetQueryOptionA
  664. #endif // !UNICODE
  665. INTERNETAPI
  666. BOOL
  667. WINAPI
  668. InternetSetOptionA(
  669. IN HINTERNET hInternet OPTIONAL,
  670. IN DWORD dwOption,
  671. IN LPVOID lpBuffer,
  672. IN DWORD dwBufferLength
  673. );
  674. INTERNETAPI
  675. BOOL
  676. WINAPI
  677. InternetSetOptionW(
  678. IN HINTERNET hInternet OPTIONAL,
  679. IN DWORD dwOption,
  680. IN LPVOID lpBuffer,
  681. IN DWORD dwBufferLength
  682. );
  683. #ifdef UNICODE
  684. #define InternetSetOption InternetSetOptionW
  685. #else
  686. #define InternetSetOption InternetSetOptionA
  687. #endif // !UNICODE
  688. INTERNETAPI
  689. BOOL
  690. WINAPI
  691. InternetSetOptionExA(
  692. IN HINTERNET hInternet OPTIONAL,
  693. IN DWORD dwOption,
  694. IN LPVOID lpBuffer,
  695. IN DWORD dwBufferLength,
  696. IN DWORD dwFlags
  697. );
  698. INTERNETAPI
  699. BOOL
  700. WINAPI
  701. InternetSetOptionExW(
  702. IN HINTERNET hInternet OPTIONAL,
  703. IN DWORD dwOption,
  704. IN LPVOID lpBuffer,
  705. IN DWORD dwBufferLength,
  706. IN DWORD dwFlags
  707. );
  708. #ifdef UNICODE
  709. #define InternetSetOptionEx InternetSetOptionExW
  710. #else
  711. #define InternetSetOptionEx InternetSetOptionExA
  712. #endif // !UNICODE
  713. //
  714. // flags for InternetSetOptionEx()
  715. //
  716. #define ISO_GLOBAL 0x00000001 // modify option globally
  717. #define ISO_REGISTRY 0x00000002 // write option to registry (where applicable)
  718. #define ISO_VALID_FLAGS (ISO_GLOBAL | ISO_REGISTRY)
  719. //
  720. // options manifests for Internet{Query|Set}Option
  721. //
  722. #define INTERNET_OPTION_CALLBACK 1
  723. #define INTERNET_OPTION_CONNECT_TIMEOUT 2
  724. #define INTERNET_OPTION_CONNECT_RETRIES 3
  725. #define INTERNET_OPTION_CONNECT_BACKOFF 4
  726. #define INTERNET_OPTION_SEND_TIMEOUT 5
  727. #define INTERNET_OPTION_CONTROL_SEND_TIMEOUT INTERNET_OPTION_SEND_TIMEOUT
  728. #define INTERNET_OPTION_RECEIVE_TIMEOUT 6
  729. #define INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT INTERNET_OPTION_RECEIVE_TIMEOUT
  730. #define INTERNET_OPTION_DATA_SEND_TIMEOUT 7
  731. #define INTERNET_OPTION_DATA_RECEIVE_TIMEOUT 8
  732. #define INTERNET_OPTION_HANDLE_TYPE 9
  733. #define INTERNET_OPTION_CONTEXT_VALUE 10
  734. #define INTERNET_OPTION_LISTEN_TIMEOUT 11
  735. #define INTERNET_OPTION_READ_BUFFER_SIZE 12
  736. #define INTERNET_OPTION_WRITE_BUFFER_SIZE 13
  737. #define INTERNET_OPTION_ASYNC_ID 15
  738. #define INTERNET_OPTION_ASYNC_PRIORITY 16
  739. #define INTERNET_OPTION_PARENT_HANDLE 21
  740. #define INTERNET_OPTION_KEEP_CONNECTION 22
  741. #define INTERNET_OPTION_REQUEST_FLAGS 23
  742. #define INTERNET_OPTION_EXTENDED_ERROR 24
  743. #define INTERNET_OPTION_OFFLINE_MODE 26
  744. #define INTERNET_OPTION_CACHE_STREAM_HANDLE 27
  745. #define INTERNET_OPTION_USERNAME 28
  746. #define INTERNET_OPTION_PASSWORD 29
  747. #define INTERNET_OPTION_ASYNC 30
  748. #define INTERNET_OPTION_SECURITY_FLAGS 31
  749. #define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT 32
  750. #define INTERNET_OPTION_DATAFILE_NAME 33
  751. #define INTERNET_OPTION_URL 34
  752. #define INTERNET_OPTION_SECURITY_CERTIFICATE 35
  753. #define INTERNET_OPTION_SECURITY_KEY_BITNESS 36
  754. #define INTERNET_OPTION_REFRESH 37
  755. #define INTERNET_OPTION_PROXY 38
  756. #define INTERNET_OPTION_SETTINGS_CHANGED 39
  757. #define INTERNET_OPTION_VERSION 40
  758. #define INTERNET_OPTION_USER_AGENT 41
  759. #define INTERNET_FIRST_OPTION INTERNET_OPTION_CALLBACK
  760. #define INTERNET_LAST_OPTION INTERNET_OPTION_USER_AGENT
  761. //
  762. // values for INTERNET_OPTION_PRIORITY
  763. //
  764. #define INTERNET_PRIORITY_FOREGROUND 1000
  765. //
  766. // handle types
  767. //
  768. #define INTERNET_HANDLE_TYPE_INTERNET 1
  769. #define INTERNET_HANDLE_TYPE_CONNECT_FTP 2
  770. #define INTERNET_HANDLE_TYPE_CONNECT_GOPHER 3
  771. #define INTERNET_HANDLE_TYPE_CONNECT_HTTP 4
  772. #define INTERNET_HANDLE_TYPE_FTP_FIND 5
  773. #define INTERNET_HANDLE_TYPE_FTP_FIND_HTML 6
  774. #define INTERNET_HANDLE_TYPE_FTP_FILE 7
  775. #define INTERNET_HANDLE_TYPE_FTP_FILE_HTML 8
  776. #define INTERNET_HANDLE_TYPE_GOPHER_FIND 9
  777. #define INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML 10
  778. #define INTERNET_HANDLE_TYPE_GOPHER_FILE 11
  779. #define INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML 12
  780. #define INTERNET_HANDLE_TYPE_HTTP_REQUEST 13
  781. //
  782. // values for INTERNET_OPTION_SECURITY_FLAGS
  783. //
  784. #define SECURITY_FLAG_SECURE 0x00000001 // can query only
  785. #define SECURITY_FLAG_SSL 0x00000002
  786. #define SECURITY_FLAG_SSL3 0x00000004
  787. #define SECURITY_FLAG_PCT 0x00000008
  788. #define SECURITY_FLAG_PCT4 0x00000010
  789. #define SECURITY_FLAG_IETFSSL4 0x00000020
  790. #define SECURITY_FLAG_40BIT 0x10000000
  791. #define SECURITY_FLAG_128BIT 0x20000000
  792. #define SECURITY_FLAG_56BIT 0x40000000
  793. #define SECURITY_FLAG_UNKNOWNBIT 0x80000000
  794. #define SECURITY_FLAG_NORMALBITNESS SECURITY_FLAG_40BIT
  795. #define SECURITY_FLAG_IGNORE_CERT_CN_INVALID INTERNET_FLAG_IGNORE_CERT_CN_INVALID
  796. #define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID INTERNET_FLAG_IGNORE_CERT_DATE_INVALID
  797. #define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
  798. #define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP
  799. INTERNETAPI
  800. BOOL
  801. WINAPI
  802. InternetGetLastResponseInfoA(
  803. OUT LPDWORD lpdwError,
  804. OUT LPSTR lpszBuffer OPTIONAL,
  805. IN OUT LPDWORD lpdwBufferLength
  806. );
  807. INTERNETAPI
  808. BOOL
  809. WINAPI
  810. InternetGetLastResponseInfoW(
  811. OUT LPDWORD lpdwError,
  812. OUT LPWSTR lpszBuffer OPTIONAL,
  813. IN OUT LPDWORD lpdwBufferLength
  814. );
  815. #ifdef UNICODE
  816. #define InternetGetLastResponseInfo InternetGetLastResponseInfoW
  817. #else
  818. #define InternetGetLastResponseInfo InternetGetLastResponseInfoA
  819. #endif // !UNICODE
  820. //
  821. // callback function for InternetSetStatusCallback
  822. //
  823. typedef
  824. VOID
  825. (CALLBACK * INTERNET_STATUS_CALLBACK)(
  826. IN HINTERNET hInternet,
  827. IN DWORD dwContext,
  828. IN DWORD dwInternetStatus,
  829. IN LPVOID lpvStatusInformation OPTIONAL,
  830. IN DWORD dwStatusInformationLength
  831. );
  832. typedef INTERNET_STATUS_CALLBACK * LPINTERNET_STATUS_CALLBACK;
  833. INTERNETAPI
  834. INTERNET_STATUS_CALLBACK
  835. WINAPI
  836. InternetSetStatusCallback(
  837. IN HINTERNET hInternet,
  838. IN INTERNET_STATUS_CALLBACK lpfnInternetCallback
  839. );
  840. //
  841. // status manifests for Internet status callback
  842. //
  843. #define INTERNET_STATUS_RESOLVING_NAME 10
  844. #define INTERNET_STATUS_NAME_RESOLVED 11
  845. #define INTERNET_STATUS_CONNECTING_TO_SERVER 20
  846. #define INTERNET_STATUS_CONNECTED_TO_SERVER 21
  847. #define INTERNET_STATUS_SENDING_REQUEST 30
  848. #define INTERNET_STATUS_REQUEST_SENT 31
  849. #define INTERNET_STATUS_RECEIVING_RESPONSE 40
  850. #define INTERNET_STATUS_RESPONSE_RECEIVED 41
  851. #define INTERNET_STATUS_CTL_RESPONSE_RECEIVED 42
  852. #define INTERNET_STATUS_PREFETCH 43
  853. #define INTERNET_STATUS_CLOSING_CONNECTION 50
  854. #define INTERNET_STATUS_CONNECTION_CLOSED 51
  855. #define INTERNET_STATUS_HANDLE_CREATED 60
  856. #define INTERNET_STATUS_HANDLE_CLOSING 70
  857. #define INTERNET_STATUS_REQUEST_COMPLETE 100
  858. #define INTERNET_STATUS_REDIRECT 110
  859. //
  860. // if the following value is returned by InternetSetStatusCallback, then
  861. // probably an invalid (non-code) address was supplied for the callback
  862. //
  863. #define INTERNET_INVALID_STATUS_CALLBACK ((INTERNET_STATUS_CALLBACK)(-1L))
  864. //
  865. // FTP
  866. //
  867. //
  868. // manifests
  869. //
  870. #define FTP_TRANSFER_TYPE_UNKNOWN 0x00000000
  871. #define FTP_TRANSFER_TYPE_ASCII 0x00000001
  872. #define FTP_TRANSFER_TYPE_BINARY 0x00000002
  873. #define FTP_TRANSFER_TYPE_MASK (FTP_TRANSFER_TYPE_ASCII | FTP_TRANSFER_TYPE_BINARY)
  874. //
  875. // prototypes
  876. //
  877. INTERNETAPI
  878. HINTERNET
  879. WINAPI
  880. FtpFindFirstFileA(
  881. IN HINTERNET hConnect,
  882. IN LPCSTR lpszSearchFile OPTIONAL,
  883. OUT LPWIN32_FIND_DATA lpFindFileData OPTIONAL,
  884. IN DWORD dwFlags,
  885. IN DWORD dwContext
  886. );
  887. INTERNETAPI
  888. HINTERNET
  889. WINAPI
  890. FtpFindFirstFileW(
  891. IN HINTERNET hConnect,
  892. IN LPCWSTR lpszSearchFile OPTIONAL,
  893. OUT LPWIN32_FIND_DATA lpFindFileData OPTIONAL,
  894. IN DWORD dwFlags,
  895. IN DWORD dwContext
  896. );
  897. #ifdef UNICODE
  898. #define FtpFindFirstFile FtpFindFirstFileW
  899. #else
  900. #define FtpFindFirstFile FtpFindFirstFileA
  901. #endif // !UNICODE
  902. INTERNETAPI
  903. BOOL
  904. WINAPI
  905. FtpGetFileA(
  906. IN HINTERNET hConnect,
  907. IN LPCSTR lpszRemoteFile,
  908. IN LPCSTR lpszNewFile,
  909. IN BOOL fFailIfExists,
  910. IN DWORD dwFlagsAndAttributes,
  911. IN DWORD dwFlags,
  912. IN DWORD dwContext
  913. );
  914. INTERNETAPI
  915. BOOL
  916. WINAPI
  917. FtpGetFileW(
  918. IN HINTERNET hConnect,
  919. IN LPCWSTR lpszRemoteFile,
  920. IN LPCWSTR lpszNewFile,
  921. IN BOOL fFailIfExists,
  922. IN DWORD dwFlagsAndAttributes,
  923. IN DWORD dwFlags,
  924. IN DWORD dwContext
  925. );
  926. #ifdef UNICODE
  927. #define FtpGetFile FtpGetFileW
  928. #else
  929. #define FtpGetFile FtpGetFileA
  930. #endif // !UNICODE
  931. INTERNETAPI
  932. BOOL
  933. WINAPI
  934. FtpPutFileA(
  935. IN HINTERNET hConnect,
  936. IN LPCSTR lpszLocalFile,
  937. IN LPCSTR lpszNewRemoteFile,
  938. IN DWORD dwFlags,
  939. IN DWORD dwContext
  940. );
  941. INTERNETAPI
  942. BOOL
  943. WINAPI
  944. FtpPutFileW(
  945. IN HINTERNET hConnect,
  946. IN LPCWSTR lpszLocalFile,
  947. IN LPCWSTR lpszNewRemoteFile,
  948. IN DWORD dwFlags,
  949. IN DWORD dwContext
  950. );
  951. #ifdef UNICODE
  952. #define FtpPutFile FtpPutFileW
  953. #else
  954. #define FtpPutFile FtpPutFileA
  955. #endif // !UNICODE
  956. INTERNETAPI
  957. BOOL
  958. WINAPI
  959. FtpDeleteFileA(
  960. IN HINTERNET hConnect,
  961. IN LPCSTR lpszFileName
  962. );
  963. INTERNETAPI
  964. BOOL
  965. WINAPI
  966. FtpDeleteFileW(
  967. IN HINTERNET hConnect,
  968. IN LPCWSTR lpszFileName
  969. );
  970. #ifdef UNICODE
  971. #define FtpDeleteFile FtpDeleteFileW
  972. #else
  973. #define FtpDeleteFile FtpDeleteFileA
  974. #endif // !UNICODE
  975. INTERNETAPI
  976. BOOL
  977. WINAPI
  978. FtpRenameFileA(
  979. IN HINTERNET hConnect,
  980. IN LPCSTR lpszExisting,
  981. IN LPCSTR lpszNew
  982. );
  983. INTERNETAPI
  984. BOOL
  985. WINAPI
  986. FtpRenameFileW(
  987. IN HINTERNET hConnect,
  988. IN LPCWSTR lpszExisting,
  989. IN LPCWSTR lpszNew
  990. );
  991. #ifdef UNICODE
  992. #define FtpRenameFile FtpRenameFileW
  993. #else
  994. #define FtpRenameFile FtpRenameFileA
  995. #endif // !UNICODE
  996. INTERNETAPI
  997. HINTERNET
  998. WINAPI
  999. FtpOpenFileA(
  1000. IN HINTERNET hConnect,
  1001. IN LPCSTR lpszFileName,
  1002. IN DWORD dwAccess,
  1003. IN DWORD dwFlags,
  1004. IN DWORD dwContext
  1005. );
  1006. INTERNETAPI
  1007. HINTERNET
  1008. WINAPI
  1009. FtpOpenFileW(
  1010. IN HINTERNET hConnect,
  1011. IN LPCWSTR lpszFileName,
  1012. IN DWORD dwAccess,
  1013. IN DWORD dwFlags,
  1014. IN DWORD dwContext
  1015. );
  1016. #ifdef UNICODE
  1017. #define FtpOpenFile FtpOpenFileW
  1018. #else
  1019. #define FtpOpenFile FtpOpenFileA
  1020. #endif // !UNICODE
  1021. INTERNETAPI
  1022. BOOL
  1023. WINAPI
  1024. FtpCreateDirectoryA(
  1025. IN HINTERNET hConnect,
  1026. IN LPCSTR lpszDirectory
  1027. );
  1028. INTERNETAPI
  1029. BOOL
  1030. WINAPI
  1031. FtpCreateDirectoryW(
  1032. IN HINTERNET hConnect,
  1033. IN LPCWSTR lpszDirectory
  1034. );
  1035. #ifdef UNICODE
  1036. #define FtpCreateDirectory FtpCreateDirectoryW
  1037. #else
  1038. #define FtpCreateDirectory FtpCreateDirectoryA
  1039. #endif // !UNICODE
  1040. INTERNETAPI
  1041. BOOL
  1042. WINAPI
  1043. FtpRemoveDirectoryA(
  1044. IN HINTERNET hConnect,
  1045. IN LPCSTR lpszDirectory
  1046. );
  1047. INTERNETAPI
  1048. BOOL
  1049. WINAPI
  1050. FtpRemoveDirectoryW(
  1051. IN HINTERNET hConnect,
  1052. IN LPCWSTR lpszDirectory
  1053. );
  1054. #ifdef UNICODE
  1055. #define FtpRemoveDirectory FtpRemoveDirectoryW
  1056. #else
  1057. #define FtpRemoveDirectory FtpRemoveDirectoryA
  1058. #endif // !UNICODE
  1059. INTERNETAPI
  1060. BOOL
  1061. WINAPI
  1062. FtpSetCurrentDirectoryA(
  1063. IN HINTERNET hConnect,
  1064. IN LPCSTR lpszDirectory
  1065. );
  1066. INTERNETAPI
  1067. BOOL
  1068. WINAPI
  1069. FtpSetCurrentDirectoryW(
  1070. IN HINTERNET hConnect,
  1071. IN LPCWSTR lpszDirectory
  1072. );
  1073. #ifdef UNICODE
  1074. #define FtpSetCurrentDirectory FtpSetCurrentDirectoryW
  1075. #else
  1076. #define FtpSetCurrentDirectory FtpSetCurrentDirectoryA
  1077. #endif // !UNICODE
  1078. INTERNETAPI
  1079. BOOL
  1080. WINAPI
  1081. FtpGetCurrentDirectoryA(
  1082. IN HINTERNET hConnect,
  1083. OUT LPSTR lpszCurrentDirectory,
  1084. IN OUT LPDWORD lpdwCurrentDirectory
  1085. );
  1086. INTERNETAPI
  1087. BOOL
  1088. WINAPI
  1089. FtpGetCurrentDirectoryW(
  1090. IN HINTERNET hConnect,
  1091. OUT LPWSTR lpszCurrentDirectory,
  1092. IN OUT LPDWORD lpdwCurrentDirectory
  1093. );
  1094. #ifdef UNICODE
  1095. #define FtpGetCurrentDirectory FtpGetCurrentDirectoryW
  1096. #else
  1097. #define FtpGetCurrentDirectory FtpGetCurrentDirectoryA
  1098. #endif // !UNICODE
  1099. INTERNETAPI
  1100. BOOL
  1101. WINAPI
  1102. FtpCommandA(
  1103. IN HINTERNET hConnect,
  1104. IN BOOL fExpectResponse,
  1105. IN DWORD dwFlags,
  1106. IN LPCSTR lpszCommand,
  1107. IN DWORD dwContext
  1108. );
  1109. INTERNETAPI
  1110. BOOL
  1111. WINAPI
  1112. FtpCommandW(
  1113. IN HINTERNET hConnect,
  1114. IN BOOL fExpectResponse,
  1115. IN DWORD dwFlags,
  1116. IN LPCWSTR lpszCommand,
  1117. IN DWORD dwContext
  1118. );
  1119. #ifdef UNICODE
  1120. #define FtpCommand FtpCommandW
  1121. #else
  1122. #define FtpCommand FtpCommandA
  1123. #endif // !UNICODE
  1124. //
  1125. // Gopher
  1126. //
  1127. //
  1128. // manifests
  1129. //
  1130. //
  1131. // string field lengths (in characters, not bytes)
  1132. //
  1133. #define MAX_GOPHER_DISPLAY_TEXT 128
  1134. #define MAX_GOPHER_SELECTOR_TEXT 256
  1135. #define MAX_GOPHER_HOST_NAME INTERNET_MAX_HOST_NAME_LENGTH
  1136. #define MAX_GOPHER_LOCATOR_LENGTH (1 \
  1137. + MAX_GOPHER_DISPLAY_TEXT \
  1138. + 1 \
  1139. + MAX_GOPHER_SELECTOR_TEXT \
  1140. + 1 \
  1141. + MAX_GOPHER_HOST_NAME \
  1142. + 1 \
  1143. + INTERNET_MAX_PORT_NUMBER_LENGTH \
  1144. + 1 \
  1145. + 1 \
  1146. + 2 \
  1147. )
  1148. //
  1149. // structures/types
  1150. //
  1151. //
  1152. // GOPHER_FIND_DATA - returns the results of a GopherFindFirstFile()/
  1153. // InternetFindNextFile() request
  1154. //
  1155. typedef struct {
  1156. CHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1];
  1157. DWORD GopherType; // GOPHER_TYPE_, if known
  1158. DWORD SizeLow;
  1159. DWORD SizeHigh;
  1160. FILETIME LastModificationTime;
  1161. CHAR Locator[MAX_GOPHER_LOCATOR_LENGTH + 1];
  1162. } GOPHER_FIND_DATAA, * LPGOPHER_FIND_DATAA;
  1163. typedef struct {
  1164. WCHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1];
  1165. DWORD GopherType; // GOPHER_TYPE_, if known
  1166. DWORD SizeLow;
  1167. DWORD SizeHigh;
  1168. FILETIME LastModificationTime;
  1169. WCHAR Locator[MAX_GOPHER_LOCATOR_LENGTH + 1];
  1170. } GOPHER_FIND_DATAW, * LPGOPHER_FIND_DATAW;
  1171. #ifdef UNICODE
  1172. typedef GOPHER_FIND_DATAW GOPHER_FIND_DATA;
  1173. typedef LPGOPHER_FIND_DATAW LPGOPHER_FIND_DATA;
  1174. #else
  1175. typedef GOPHER_FIND_DATAA GOPHER_FIND_DATA;
  1176. typedef LPGOPHER_FIND_DATAA LPGOPHER_FIND_DATA;
  1177. #endif // UNICODE
  1178. //
  1179. // manifests for GopherType
  1180. //
  1181. #define GOPHER_TYPE_TEXT_FILE 0x00000001
  1182. #define GOPHER_TYPE_DIRECTORY 0x00000002
  1183. #define GOPHER_TYPE_CSO 0x00000004
  1184. #define GOPHER_TYPE_ERROR 0x00000008
  1185. #define GOPHER_TYPE_MAC_BINHEX 0x00000010
  1186. #define GOPHER_TYPE_DOS_ARCHIVE 0x00000020
  1187. #define GOPHER_TYPE_UNIX_UUENCODED 0x00000040
  1188. #define GOPHER_TYPE_INDEX_SERVER 0x00000080
  1189. #define GOPHER_TYPE_TELNET 0x00000100
  1190. #define GOPHER_TYPE_BINARY 0x00000200
  1191. #define GOPHER_TYPE_REDUNDANT 0x00000400
  1192. #define GOPHER_TYPE_TN3270 0x00000800
  1193. #define GOPHER_TYPE_GIF 0x00001000
  1194. #define GOPHER_TYPE_IMAGE 0x00002000
  1195. #define GOPHER_TYPE_BITMAP 0x00004000
  1196. #define GOPHER_TYPE_MOVIE 0x00008000
  1197. #define GOPHER_TYPE_SOUND 0x00010000
  1198. #define GOPHER_TYPE_HTML 0x00020000
  1199. #define GOPHER_TYPE_PDF 0x00040000
  1200. #define GOPHER_TYPE_CALENDAR 0x00080000
  1201. #define GOPHER_TYPE_INLINE 0x00100000
  1202. #define GOPHER_TYPE_UNKNOWN 0x20000000
  1203. #define GOPHER_TYPE_ASK 0x40000000
  1204. #define GOPHER_TYPE_GOPHER_PLUS 0x80000000
  1205. //
  1206. // gopher type macros
  1207. //
  1208. #define IS_GOPHER_FILE(type) (BOOL)(((type) & GOPHER_TYPE_FILE_MASK) ? TRUE : FALSE)
  1209. #define IS_GOPHER_DIRECTORY(type) (BOOL)(((type) & GOPHER_TYPE_DIRECTORY) ? TRUE : FALSE)
  1210. #define IS_GOPHER_PHONE_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_CSO) ? TRUE : FALSE)
  1211. #define IS_GOPHER_ERROR(type) (BOOL)(((type) & GOPHER_TYPE_ERROR) ? TRUE : FALSE)
  1212. #define IS_GOPHER_INDEX_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_INDEX_SERVER) ? TRUE : FALSE)
  1213. #define IS_GOPHER_TELNET_SESSION(type) (BOOL)(((type) & GOPHER_TYPE_TELNET) ? TRUE : FALSE)
  1214. #define IS_GOPHER_BACKUP_SERVER(type) (BOOL)(((type) & GOPHER_TYPE_REDUNDANT) ? TRUE : FALSE)
  1215. #define IS_GOPHER_TN3270_SESSION(type) (BOOL)(((type) & GOPHER_TYPE_TN3270) ? TRUE : FALSE)
  1216. #define IS_GOPHER_ASK(type) (BOOL)(((type) & GOPHER_TYPE_ASK) ? TRUE : FALSE)
  1217. #define IS_GOPHER_PLUS(type) (BOOL)(((type) & GOPHER_TYPE_GOPHER_PLUS) ? TRUE : FALSE)
  1218. #define IS_GOPHER_TYPE_KNOWN(type) (BOOL)(((type) & GOPHER_TYPE_UNKNOWN) ? FALSE : TRUE)
  1219. //
  1220. // GOPHER_TYPE_FILE_MASK - use this to determine if a locator identifies a
  1221. // (known) file type
  1222. //
  1223. #define GOPHER_TYPE_FILE_MASK (GOPHER_TYPE_TEXT_FILE \
  1224. | GOPHER_TYPE_MAC_BINHEX \
  1225. | GOPHER_TYPE_DOS_ARCHIVE \
  1226. | GOPHER_TYPE_UNIX_UUENCODED \
  1227. | GOPHER_TYPE_BINARY \
  1228. | GOPHER_TYPE_GIF \
  1229. | GOPHER_TYPE_IMAGE \
  1230. | GOPHER_TYPE_BITMAP \
  1231. | GOPHER_TYPE_MOVIE \
  1232. | GOPHER_TYPE_SOUND \
  1233. | GOPHER_TYPE_HTML \
  1234. | GOPHER_TYPE_PDF \
  1235. | GOPHER_TYPE_CALENDAR \
  1236. | GOPHER_TYPE_INLINE \
  1237. )
  1238. //
  1239. // structured gopher attributes (as defined in gopher+ protocol document)
  1240. //
  1241. typedef struct {
  1242. LPCTSTR Comment;
  1243. LPCTSTR EmailAddress;
  1244. } GOPHER_ADMIN_ATTRIBUTE_TYPE, * LPGOPHER_ADMIN_ATTRIBUTE_TYPE;
  1245. typedef struct {
  1246. FILETIME DateAndTime;
  1247. } GOPHER_MOD_DATE_ATTRIBUTE_TYPE, * LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE;
  1248. typedef struct {
  1249. DWORD Ttl;
  1250. } GOPHER_TTL_ATTRIBUTE_TYPE, * LPGOPHER_TTL_ATTRIBUTE_TYPE;
  1251. typedef struct {
  1252. INT Score;
  1253. } GOPHER_SCORE_ATTRIBUTE_TYPE, * LPGOPHER_SCORE_ATTRIBUTE_TYPE;
  1254. typedef struct {
  1255. INT LowerBound;
  1256. INT UpperBound;
  1257. } GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE, * LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE;
  1258. typedef struct {
  1259. LPCTSTR Site;
  1260. } GOPHER_SITE_ATTRIBUTE_TYPE, * LPGOPHER_SITE_ATTRIBUTE_TYPE;
  1261. typedef struct {
  1262. LPCTSTR Organization;
  1263. } GOPHER_ORGANIZATION_ATTRIBUTE_TYPE, * LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPE;
  1264. typedef struct {
  1265. LPCTSTR Location;
  1266. } GOPHER_LOCATION_ATTRIBUTE_TYPE, * LPGOPHER_LOCATION_ATTRIBUTE_TYPE;
  1267. typedef struct {
  1268. INT DegreesNorth;
  1269. INT MinutesNorth;
  1270. INT SecondsNorth;
  1271. INT DegreesEast;
  1272. INT MinutesEast;
  1273. INT SecondsEast;
  1274. } GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE, * LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE;
  1275. typedef struct {
  1276. INT Zone;
  1277. } GOPHER_TIMEZONE_ATTRIBUTE_TYPE, * LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE;
  1278. typedef struct {
  1279. LPCTSTR Provider;
  1280. } GOPHER_PROVIDER_ATTRIBUTE_TYPE, * LPGOPHER_PROVIDER_ATTRIBUTE_TYPE;
  1281. typedef struct {
  1282. LPCTSTR Version;
  1283. } GOPHER_VERSION_ATTRIBUTE_TYPE, * LPGOPHER_VERSION_ATTRIBUTE_TYPE;
  1284. typedef struct {
  1285. LPCTSTR ShortAbstract;
  1286. LPCTSTR AbstractFile;
  1287. } GOPHER_ABSTRACT_ATTRIBUTE_TYPE, * LPGOPHER_ABSTRACT_ATTRIBUTE_TYPE;
  1288. typedef struct {
  1289. LPCTSTR ContentType;
  1290. LPCTSTR Language;
  1291. DWORD Size;
  1292. } GOPHER_VIEW_ATTRIBUTE_TYPE, * LPGOPHER_VIEW_ATTRIBUTE_TYPE;
  1293. typedef struct {
  1294. BOOL TreeWalk;
  1295. } GOPHER_VERONICA_ATTRIBUTE_TYPE, * LPGOPHER_VERONICA_ATTRIBUTE_TYPE;
  1296. typedef struct {
  1297. LPCTSTR QuestionType;
  1298. LPCTSTR QuestionText;
  1299. } GOPHER_ASK_ATTRIBUTE_TYPE, * LPGOPHER_ASK_ATTRIBUTE_TYPE;
  1300. //
  1301. // GOPHER_UNKNOWN_ATTRIBUTE_TYPE - this is returned if we retrieve an attribute
  1302. // that is not specified in the current gopher/gopher+ documentation. It is up
  1303. // to the application to parse the information
  1304. //
  1305. typedef struct {
  1306. LPCTSTR Text;
  1307. } GOPHER_UNKNOWN_ATTRIBUTE_TYPE, * LPGOPHER_UNKNOWN_ATTRIBUTE_TYPE;
  1308. //
  1309. // GOPHER_ATTRIBUTE_TYPE - returned in the user's buffer when an enumerated
  1310. // GopherGetAttribute call is made
  1311. //
  1312. typedef struct {
  1313. DWORD CategoryId; // e.g. GOPHER_CATEGORY_ID_ADMIN
  1314. DWORD AttributeId; // e.g. GOPHER_ATTRIBUTE_ID_ADMIN
  1315. union {
  1316. GOPHER_ADMIN_ATTRIBUTE_TYPE Admin;
  1317. GOPHER_MOD_DATE_ATTRIBUTE_TYPE ModDate;
  1318. GOPHER_TTL_ATTRIBUTE_TYPE Ttl;
  1319. GOPHER_SCORE_ATTRIBUTE_TYPE Score;
  1320. GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE ScoreRange;
  1321. GOPHER_SITE_ATTRIBUTE_TYPE Site;
  1322. GOPHER_ORGANIZATION_ATTRIBUTE_TYPE Organization;
  1323. GOPHER_LOCATION_ATTRIBUTE_TYPE Location;
  1324. GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE GeographicalLocation;
  1325. GOPHER_TIMEZONE_ATTRIBUTE_TYPE TimeZone;
  1326. GOPHER_PROVIDER_ATTRIBUTE_TYPE Provider;
  1327. GOPHER_VERSION_ATTRIBUTE_TYPE Version;
  1328. GOPHER_ABSTRACT_ATTRIBUTE_TYPE Abstract;
  1329. GOPHER_VIEW_ATTRIBUTE_TYPE View;
  1330. GOPHER_VERONICA_ATTRIBUTE_TYPE Veronica;
  1331. GOPHER_ASK_ATTRIBUTE_TYPE Ask;
  1332. GOPHER_UNKNOWN_ATTRIBUTE_TYPE Unknown;
  1333. } AttributeType;
  1334. } GOPHER_ATTRIBUTE_TYPE, * LPGOPHER_ATTRIBUTE_TYPE;
  1335. #define MAX_GOPHER_CATEGORY_NAME 128 // arbitrary
  1336. #define MAX_GOPHER_ATTRIBUTE_NAME 128 // "
  1337. #define MIN_GOPHER_ATTRIBUTE_LENGTH 256 // "
  1338. //
  1339. // known gopher attribute categories. See below for ordinals
  1340. //
  1341. #define GOPHER_INFO_CATEGORY TEXT("+INFO")
  1342. #define GOPHER_ADMIN_CATEGORY TEXT("+ADMIN")
  1343. #define GOPHER_VIEWS_CATEGORY TEXT("+VIEWS")
  1344. #define GOPHER_ABSTRACT_CATEGORY TEXT("+ABSTRACT")
  1345. #define GOPHER_VERONICA_CATEGORY TEXT("+VERONICA")
  1346. //
  1347. // known gopher attributes. These are the attribute names as defined in the
  1348. // gopher+ protocol document
  1349. //
  1350. #define GOPHER_ADMIN_ATTRIBUTE TEXT("Admin")
  1351. #define GOPHER_MOD_DATE_ATTRIBUTE TEXT("Mod-Date")
  1352. #define GOPHER_TTL_ATTRIBUTE TEXT("TTL")
  1353. #define GOPHER_SCORE_ATTRIBUTE TEXT("Score")
  1354. #define GOPHER_RANGE_ATTRIBUTE TEXT("Score-range")
  1355. #define GOPHER_SITE_ATTRIBUTE TEXT("Site")
  1356. #define GOPHER_ORG_ATTRIBUTE TEXT("Org")
  1357. #define GOPHER_LOCATION_ATTRIBUTE TEXT("Loc")
  1358. #define GOPHER_GEOG_ATTRIBUTE TEXT("Geog")
  1359. #define GOPHER_TIMEZONE_ATTRIBUTE TEXT("TZ")
  1360. #define GOPHER_PROVIDER_ATTRIBUTE TEXT("Provider")
  1361. #define GOPHER_VERSION_ATTRIBUTE TEXT("Version")
  1362. #define GOPHER_ABSTRACT_ATTRIBUTE TEXT("Abstract")
  1363. #define GOPHER_VIEW_ATTRIBUTE TEXT("View")
  1364. #define GOPHER_TREEWALK_ATTRIBUTE TEXT("treewalk")
  1365. //
  1366. // identifiers for attribute strings
  1367. //
  1368. #define GOPHER_ATTRIBUTE_ID_BASE 0xabcccc00
  1369. #define GOPHER_CATEGORY_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 1)
  1370. #define GOPHER_CATEGORY_ID_INFO (GOPHER_ATTRIBUTE_ID_BASE + 2)
  1371. #define GOPHER_CATEGORY_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 3)
  1372. #define GOPHER_CATEGORY_ID_VIEWS (GOPHER_ATTRIBUTE_ID_BASE + 4)
  1373. #define GOPHER_CATEGORY_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 5)
  1374. #define GOPHER_CATEGORY_ID_VERONICA (GOPHER_ATTRIBUTE_ID_BASE + 6)
  1375. #define GOPHER_CATEGORY_ID_ASK (GOPHER_ATTRIBUTE_ID_BASE + 7)
  1376. #define GOPHER_CATEGORY_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 8)
  1377. #define GOPHER_ATTRIBUTE_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 9)
  1378. #define GOPHER_ATTRIBUTE_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 10)
  1379. #define GOPHER_ATTRIBUTE_ID_MOD_DATE (GOPHER_ATTRIBUTE_ID_BASE + 11)
  1380. #define GOPHER_ATTRIBUTE_ID_TTL (GOPHER_ATTRIBUTE_ID_BASE + 12)
  1381. #define GOPHER_ATTRIBUTE_ID_SCORE (GOPHER_ATTRIBUTE_ID_BASE + 13)
  1382. #define GOPHER_ATTRIBUTE_ID_RANGE (GOPHER_ATTRIBUTE_ID_BASE + 14)
  1383. #define GOPHER_ATTRIBUTE_ID_SITE (GOPHER_ATTRIBUTE_ID_BASE + 15)
  1384. #define GOPHER_ATTRIBUTE_ID_ORG (GOPHER_ATTRIBUTE_ID_BASE + 16)
  1385. #define GOPHER_ATTRIBUTE_ID_LOCATION (GOPHER_ATTRIBUTE_ID_BASE + 17)
  1386. #define GOPHER_ATTRIBUTE_ID_GEOG (GOPHER_ATTRIBUTE_ID_BASE + 18)
  1387. #define GOPHER_ATTRIBUTE_ID_TIMEZONE (GOPHER_ATTRIBUTE_ID_BASE + 19)
  1388. #define GOPHER_ATTRIBUTE_ID_PROVIDER (GOPHER_ATTRIBUTE_ID_BASE + 20)
  1389. #define GOPHER_ATTRIBUTE_ID_VERSION (GOPHER_ATTRIBUTE_ID_BASE + 21)
  1390. #define GOPHER_ATTRIBUTE_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 22)
  1391. #define GOPHER_ATTRIBUTE_ID_VIEW (GOPHER_ATTRIBUTE_ID_BASE + 23)
  1392. #define GOPHER_ATTRIBUTE_ID_TREEWALK (GOPHER_ATTRIBUTE_ID_BASE + 24)
  1393. #define GOPHER_ATTRIBUTE_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 25)
  1394. //
  1395. // prototypes
  1396. //
  1397. INTERNETAPI
  1398. BOOL
  1399. WINAPI
  1400. GopherCreateLocatorA(
  1401. IN LPCSTR lpszHost,
  1402. IN INTERNET_PORT nServerPort,
  1403. IN LPCSTR lpszDisplayString OPTIONAL,
  1404. IN LPCSTR lpszSelectorString OPTIONAL,
  1405. IN DWORD dwGopherType,
  1406. OUT LPSTR lpszLocator OPTIONAL,
  1407. IN OUT LPDWORD lpdwBufferLength
  1408. );
  1409. INTERNETAPI
  1410. BOOL
  1411. WINAPI
  1412. GopherCreateLocatorW(
  1413. IN LPCWSTR lpszHost,
  1414. IN INTERNET_PORT nServerPort,
  1415. IN LPCWSTR lpszDisplayString OPTIONAL,
  1416. IN LPCWSTR lpszSelectorString OPTIONAL,
  1417. IN DWORD dwGopherType,
  1418. OUT LPWSTR lpszLocator OPTIONAL,
  1419. IN OUT LPDWORD lpdwBufferLength
  1420. );
  1421. #ifdef UNICODE
  1422. #define GopherCreateLocator GopherCreateLocatorW
  1423. #else
  1424. #define GopherCreateLocator GopherCreateLocatorA
  1425. #endif // !UNICODE
  1426. INTERNETAPI
  1427. BOOL
  1428. WINAPI
  1429. GopherGetLocatorTypeA(
  1430. IN LPCSTR lpszLocator,
  1431. OUT LPDWORD lpdwGopherType
  1432. );
  1433. INTERNETAPI
  1434. BOOL
  1435. WINAPI
  1436. GopherGetLocatorTypeW(
  1437. IN LPCWSTR lpszLocator,
  1438. OUT LPDWORD lpdwGopherType
  1439. );
  1440. #ifdef UNICODE
  1441. #define GopherGetLocatorType GopherGetLocatorTypeW
  1442. #else
  1443. #define GopherGetLocatorType GopherGetLocatorTypeA
  1444. #endif // !UNICODE
  1445. INTERNETAPI
  1446. HINTERNET
  1447. WINAPI
  1448. GopherFindFirstFileA(
  1449. IN HINTERNET hConnect,
  1450. IN LPCSTR lpszLocator OPTIONAL,
  1451. IN LPCSTR lpszSearchString OPTIONAL,
  1452. OUT LPGOPHER_FIND_DATAA lpFindData OPTIONAL,
  1453. IN DWORD dwFlags,
  1454. IN DWORD dwContext
  1455. );
  1456. INTERNETAPI
  1457. HINTERNET
  1458. WINAPI
  1459. GopherFindFirstFileW(
  1460. IN HINTERNET hConnect,
  1461. IN LPCWSTR lpszLocator OPTIONAL,
  1462. IN LPCWSTR lpszSearchString OPTIONAL,
  1463. OUT LPGOPHER_FIND_DATAW lpFindData OPTIONAL,
  1464. IN DWORD dwFlags,
  1465. IN DWORD dwContext
  1466. );
  1467. #ifdef UNICODE
  1468. #define GopherFindFirstFile GopherFindFirstFileW
  1469. #else
  1470. #define GopherFindFirstFile GopherFindFirstFileA
  1471. #endif // !UNICODE
  1472. INTERNETAPI
  1473. HINTERNET
  1474. WINAPI
  1475. GopherOpenFileA(
  1476. IN HINTERNET hConnect,
  1477. IN LPCSTR lpszLocator,
  1478. IN LPCSTR lpszView OPTIONAL,
  1479. IN DWORD dwFlags,
  1480. IN DWORD dwContext
  1481. );
  1482. INTERNETAPI
  1483. HINTERNET
  1484. WINAPI
  1485. GopherOpenFileW(
  1486. IN HINTERNET hConnect,
  1487. IN LPCWSTR lpszLocator,
  1488. IN LPCWSTR lpszView OPTIONAL,
  1489. IN DWORD dwFlags,
  1490. IN DWORD dwContext
  1491. );
  1492. #ifdef UNICODE
  1493. #define GopherOpenFile GopherOpenFileW
  1494. #else
  1495. #define GopherOpenFile GopherOpenFileA
  1496. #endif // !UNICODE
  1497. typedef
  1498. BOOL
  1499. (CALLBACK * GOPHER_ATTRIBUTE_ENUMERATOR)(
  1500. LPGOPHER_ATTRIBUTE_TYPE lpAttributeInfo,
  1501. DWORD dwError
  1502. );
  1503. INTERNETAPI
  1504. BOOL
  1505. WINAPI
  1506. GopherGetAttributeA(
  1507. IN HINTERNET hConnect,
  1508. IN LPCSTR lpszLocator,
  1509. IN LPCSTR lpszAttributeName OPTIONAL,
  1510. OUT LPBYTE lpBuffer,
  1511. IN DWORD dwBufferLength,
  1512. OUT LPDWORD lpdwCharactersReturned,
  1513. IN GOPHER_ATTRIBUTE_ENUMERATOR lpfnEnumerator OPTIONAL,
  1514. IN DWORD dwContext
  1515. );
  1516. INTERNETAPI
  1517. BOOL
  1518. WINAPI
  1519. GopherGetAttributeW(
  1520. IN HINTERNET hConnect,
  1521. IN LPCWSTR lpszLocator,
  1522. IN LPCWSTR lpszAttributeName OPTIONAL,
  1523. OUT LPBYTE lpBuffer,
  1524. IN DWORD dwBufferLength,
  1525. OUT LPDWORD lpdwCharactersReturned,
  1526. IN GOPHER_ATTRIBUTE_ENUMERATOR lpfnEnumerator OPTIONAL,
  1527. IN DWORD dwContext
  1528. );
  1529. #ifdef UNICODE
  1530. #define GopherGetAttribute GopherGetAttributeW
  1531. #else
  1532. #define GopherGetAttribute GopherGetAttributeA
  1533. #endif // !UNICODE
  1534. //
  1535. // HTTP
  1536. //
  1537. //
  1538. // manifests
  1539. //
  1540. //
  1541. // the default major/minor HTTP version numbers
  1542. //
  1543. #define HTTP_MAJOR_VERSION 1
  1544. #define HTTP_MINOR_VERSION 0
  1545. #define HTTP_VERSION TEXT("HTTP/1.0")
  1546. //
  1547. // HttpQueryInfo info levels. Generally, there is one info level
  1548. // for each potential RFC822/HTTP/MIME header that an HTTP server
  1549. // may send as part of a request response.
  1550. //
  1551. // The HTTP_QUERY_RAW_HEADERS info level is provided for clients
  1552. // that choose to perform their own header parsing.
  1553. //
  1554. #define HTTP_QUERY_MIME_VERSION 0
  1555. #define HTTP_QUERY_CONTENT_TYPE 1
  1556. #define HTTP_QUERY_CONTENT_TRANSFER_ENCODING 2
  1557. #define HTTP_QUERY_CONTENT_ID 3
  1558. #define HTTP_QUERY_CONTENT_DESCRIPTION 4
  1559. #define HTTP_QUERY_CONTENT_LENGTH 5
  1560. #define HTTP_QUERY_CONTENT_LANGUAGE 6
  1561. #define HTTP_QUERY_ALLOW 7
  1562. #define HTTP_QUERY_PUBLIC 8
  1563. #define HTTP_QUERY_DATE 9
  1564. #define HTTP_QUERY_EXPIRES 10
  1565. #define HTTP_QUERY_LAST_MODIFIED 11
  1566. #define HTTP_QUERY_MESSAGE_ID 12
  1567. #define HTTP_QUERY_URI 13
  1568. #define HTTP_QUERY_DERIVED_FROM 14
  1569. #define HTTP_QUERY_COST 15
  1570. #define HTTP_QUERY_LINK 16
  1571. #define HTTP_QUERY_PRAGMA 17
  1572. #define HTTP_QUERY_VERSION 18 // special: part of status line
  1573. #define HTTP_QUERY_STATUS_CODE 19 // special: part of status line
  1574. #define HTTP_QUERY_STATUS_TEXT 20 // special: part of status line
  1575. #define HTTP_QUERY_RAW_HEADERS 21 // special: all headers as ASCIIZ
  1576. #define HTTP_QUERY_RAW_HEADERS_CRLF 22 // special: all headers
  1577. #define HTTP_QUERY_CONNECTION 23
  1578. #define HTTP_QUERY_ACCEPT 24
  1579. #define HTTP_QUERY_ACCEPT_CHARSET 25
  1580. #define HTTP_QUERY_ACCEPT_ENCODING 26
  1581. #define HTTP_QUERY_ACCEPT_LANGUAGE 27
  1582. #define HTTP_QUERY_AUTHORIZATION 28
  1583. #define HTTP_QUERY_CONTENT_ENCODING 29
  1584. #define HTTP_QUERY_FORWARDED 30
  1585. #define HTTP_QUERY_FROM 31
  1586. #define HTTP_QUERY_IF_MODIFIED_SINCE 32
  1587. #define HTTP_QUERY_LOCATION 33
  1588. #define HTTP_QUERY_ORIG_URI 34
  1589. #define HTTP_QUERY_REFERER 35
  1590. #define HTTP_QUERY_RETRY_AFTER 36
  1591. #define HTTP_QUERY_SERVER 37
  1592. #define HTTP_QUERY_TITLE 38
  1593. #define HTTP_QUERY_USER_AGENT 39
  1594. #define HTTP_QUERY_WWW_AUTHENTICATE 40
  1595. #define HTTP_QUERY_PROXY_AUTHENTICATE 41
  1596. #define HTTP_QUERY_ACCEPT_RANGES 42
  1597. #define HTTP_QUERY_SET_COOKIE 43
  1598. #define HTTP_QUERY_COOKIE 44
  1599. #define HTTP_QUERY_REQUEST_METHOD 45 // special: GET/POST etc.
  1600. #define HTTP_QUERY_MAX 45
  1601. //
  1602. // HTTP_QUERY_CUSTOM - if this special value is supplied as the dwInfoLevel
  1603. // parameter of HttpQueryInfo() then the lpBuffer parameter contains the name
  1604. // of the header we are to query
  1605. //
  1606. #define HTTP_QUERY_CUSTOM 65535
  1607. //
  1608. // HTTP_QUERY_FLAG_REQUEST_HEADERS - if this bit is set in the dwInfoLevel
  1609. // parameter of HttpQueryInfo() then the request headers will be queried for the
  1610. // request information
  1611. //
  1612. #define HTTP_QUERY_FLAG_REQUEST_HEADERS 0x80000000
  1613. //
  1614. // HTTP_QUERY_FLAG_SYSTEMTIME - if this bit is set in the dwInfoLevel parameter
  1615. // of HttpQueryInfo() AND the header being queried contains date information,
  1616. // e.g. the "Expires:" header then lpBuffer will contain a SYSTEMTIME structure
  1617. // containing the date and time information converted from the header string
  1618. //
  1619. #define HTTP_QUERY_FLAG_SYSTEMTIME 0x40000000
  1620. //
  1621. // HTTP_QUERY_FLAG_NUMBER - if this bit is set in the dwInfoLevel parameter of
  1622. // HttpQueryInfo(), then the value of the header will be converted to a number
  1623. // before being returned to the caller, if applicable
  1624. //
  1625. #define HTTP_QUERY_FLAG_NUMBER 0x20000000
  1626. //
  1627. // HTTP_QUERY_FLAG_COALESCE - combine the values from several headers of the
  1628. // same name into the output buffer
  1629. //
  1630. #define HTTP_QUERY_FLAG_COALESCE 0x10000000
  1631. #define HTTP_QUERY_MODIFIER_FLAGS_MASK (HTTP_QUERY_FLAG_REQUEST_HEADERS \
  1632. | HTTP_QUERY_FLAG_SYSTEMTIME \
  1633. | HTTP_QUERY_FLAG_NUMBER \
  1634. | HTTP_QUERY_FLAG_COALESCE \
  1635. )
  1636. #define HTTP_QUERY_HEADER_MASK (~HTTP_QUERY_MODIFIER_FLAGS_MASK)
  1637. //
  1638. // HTTP Response Status Codes:
  1639. //
  1640. #define HTTP_STATUS_OK 200 // request completed
  1641. #define HTTP_STATUS_CREATED 201 // object created, reason = new URI
  1642. #define HTTP_STATUS_ACCEPTED 202 // async completion (TBS)
  1643. #define HTTP_STATUS_PARTIAL 203 // partial completion
  1644. #define HTTP_STATUS_NO_CONTENT 204 // no info to return
  1645. #define HTTP_STATUS_AMBIGUOUS 300 // server couldn't decide what to return
  1646. #define HTTP_STATUS_MOVED 301 // object permanently moved
  1647. #define HTTP_STATUS_REDIRECT 302 // object temporarily moved
  1648. #define HTTP_STATUS_REDIRECT_METHOD 303 // redirection w/ new access method
  1649. #define HTTP_STATUS_NOT_MODIFIED 304 // if-modified-since was not modified
  1650. #define HTTP_STATUS_BAD_REQUEST 400 // invalid syntax
  1651. #define HTTP_STATUS_DENIED 401 // access denied
  1652. #define HTTP_STATUS_PAYMENT_REQ 402 // payment required
  1653. #define HTTP_STATUS_FORBIDDEN 403 // request forbidden
  1654. #define HTTP_STATUS_NOT_FOUND 404 // object not found
  1655. #define HTTP_STATUS_BAD_METHOD 405 // method is not allowed
  1656. #define HTTP_STATUS_NONE_ACCEPTABLE 406 // no response acceptable to client found
  1657. #define HTTP_STATUS_PROXY_AUTH_REQ 407 // proxy authentication required
  1658. #define HTTP_STATUS_REQUEST_TIMEOUT 408 // server timed out waiting for request
  1659. #define HTTP_STATUS_CONFLICT 409 // user should resubmit with more info
  1660. #define HTTP_STATUS_GONE 410 // the resource is no longer available
  1661. #define HTTP_STATUS_AUTH_REFUSED 411 // couldn't authorize client
  1662. #define HTTP_STATUS_SERVER_ERROR 500 // internal server error
  1663. #define HTTP_STATUS_NOT_SUPPORTED 501 // required not supported
  1664. #define HTTP_STATUS_BAD_GATEWAY 502 // error response received from gateway
  1665. #define HTTP_STATUS_SERVICE_UNAVAIL 503 // temporarily overloaded
  1666. #define HTTP_STATUS_GATEWAY_TIMEOUT 504 // timed out waiting for gateway
  1667. //
  1668. // prototypes
  1669. //
  1670. INTERNETAPI
  1671. HINTERNET
  1672. WINAPI
  1673. HttpOpenRequestA(
  1674. IN HINTERNET hConnect,
  1675. IN LPCSTR lpszVerb,
  1676. IN LPCSTR lpszObjectName,
  1677. IN LPCSTR lpszVersion,
  1678. IN LPCSTR lpszReferrer OPTIONAL,
  1679. IN LPCSTR FAR * lplpszAcceptTypes OPTIONAL,
  1680. IN DWORD dwFlags,
  1681. IN DWORD dwContext
  1682. );
  1683. INTERNETAPI
  1684. HINTERNET
  1685. WINAPI
  1686. HttpOpenRequestW(
  1687. IN HINTERNET hConnect,
  1688. IN LPCWSTR lpszVerb,
  1689. IN LPCWSTR lpszObjectName,
  1690. IN LPCWSTR lpszVersion,
  1691. IN LPCWSTR lpszReferrer OPTIONAL,
  1692. IN LPCWSTR FAR * lplpszAcceptTypes OPTIONAL,
  1693. IN DWORD dwFlags,
  1694. IN DWORD dwContext
  1695. );
  1696. #ifdef UNICODE
  1697. #define HttpOpenRequest HttpOpenRequestW
  1698. #else
  1699. #define HttpOpenRequest HttpOpenRequestA
  1700. #endif // !UNICODE
  1701. INTERNETAPI
  1702. BOOL
  1703. WINAPI
  1704. HttpAddRequestHeadersA(
  1705. IN HINTERNET hRequest,
  1706. IN LPCSTR lpszHeaders,
  1707. IN DWORD dwHeadersLength,
  1708. IN DWORD dwModifiers
  1709. );
  1710. INTERNETAPI
  1711. BOOL
  1712. WINAPI
  1713. HttpAddRequestHeadersW(
  1714. IN HINTERNET hRequest,
  1715. IN LPCWSTR lpszHeaders,
  1716. IN DWORD dwHeadersLength,
  1717. IN DWORD dwModifiers
  1718. );
  1719. #ifdef UNICODE
  1720. #define HttpAddRequestHeaders HttpAddRequestHeadersW
  1721. #else
  1722. #define HttpAddRequestHeaders HttpAddRequestHeadersA
  1723. #endif // !UNICODE
  1724. //
  1725. // values for dwModifiers parameter of HttpAddRequestHeaders()
  1726. //
  1727. #define HTTP_ADDREQ_INDEX_MASK 0x0000FFFF
  1728. #define HTTP_ADDREQ_FLAGS_MASK 0xFFFF0000
  1729. //
  1730. // HTTP_ADDREQ_FLAG_ADD_IF_NEW - the header will only be added if it doesn't
  1731. // already exist
  1732. //
  1733. #define HTTP_ADDREQ_FLAG_ADD_IF_NEW 0x10000000
  1734. //
  1735. // HTTP_ADDREQ_FLAG_ADD - if HTTP_ADDREQ_FLAG_REPLACE is set but the header is
  1736. // not found then if this flag is set, the header is added anyway, so long as
  1737. // there is a valid header-value
  1738. //
  1739. #define HTTP_ADDREQ_FLAG_ADD 0x20000000
  1740. //
  1741. // HTTP_ADDREQ_FLAG_COALESCE - coalesce headers with same name. e.g.
  1742. // "Accept: text/*" and "Accept: audio/*" with this flag results in a single
  1743. // header: "Accept: text/*, audio/*"
  1744. //
  1745. //
  1746. // HTTP_ADDREQ_FLAG_COALESCE - coalesce headers with same name. e.g.
  1747. // "Accept: text/*" and "Accept: audio/*" with this flag results in a single
  1748. // header: "Accept: text/*, audio/*"
  1749. //
  1750. #define HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA 0x40000000
  1751. #define HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON 0x01000000
  1752. #define HTTP_ADDREQ_FLAG_COALESCE HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
  1753. //
  1754. // HTTP_ADDREQ_FLAG_REPLACE - replaces the specified header. Only one header can
  1755. // be supplied in the buffer. If the header to be replaced is not the first
  1756. // in a list of headers with the same name, then the relative index should be
  1757. // supplied in the low 8 bits of the dwModifiers parameter. If the header-value
  1758. // part is missing, then the header is removed
  1759. //
  1760. #define HTTP_ADDREQ_FLAG_REPLACE 0x80000000
  1761. INTERNETAPI
  1762. BOOL
  1763. WINAPI
  1764. HttpSendRequestA(
  1765. IN HINTERNET hRequest,
  1766. IN LPCSTR lpszHeaders OPTIONAL,
  1767. IN DWORD dwHeadersLength,
  1768. IN LPVOID lpOptional OPTIONAL,
  1769. IN DWORD dwOptionalLength
  1770. );
  1771. INTERNETAPI
  1772. BOOL
  1773. WINAPI
  1774. HttpSendRequestW(
  1775. IN HINTERNET hRequest,
  1776. IN LPCWSTR lpszHeaders OPTIONAL,
  1777. IN DWORD dwHeadersLength,
  1778. IN LPVOID lpOptional OPTIONAL,
  1779. IN DWORD dwOptionalLength
  1780. );
  1781. #ifdef UNICODE
  1782. #define HttpSendRequest HttpSendRequestW
  1783. #else
  1784. #define HttpSendRequest HttpSendRequestA
  1785. #endif // !UNICODE
  1786. INTERNETAPI
  1787. BOOL
  1788. WINAPI
  1789. HttpQueryInfoA(
  1790. IN HINTERNET hRequest,
  1791. IN DWORD dwInfoLevel,
  1792. IN OUT LPVOID lpBuffer OPTIONAL,
  1793. IN OUT LPDWORD lpdwBufferLength,
  1794. IN OUT LPDWORD lpdwIndex OPTIONAL
  1795. );
  1796. INTERNETAPI
  1797. BOOL
  1798. WINAPI
  1799. HttpQueryInfoW(
  1800. IN HINTERNET hRequest,
  1801. IN DWORD dwInfoLevel,
  1802. IN OUT LPVOID lpBuffer OPTIONAL,
  1803. IN OUT LPDWORD lpdwBufferLength,
  1804. IN OUT LPDWORD lpdwIndex OPTIONAL
  1805. );
  1806. #ifdef UNICODE
  1807. #define HttpQueryInfo HttpQueryInfoW
  1808. #else
  1809. #define HttpQueryInfo HttpQueryInfoA
  1810. #endif // !UNICODE
  1811. //
  1812. // Cookie APIs
  1813. //
  1814. INTERNETAPI
  1815. BOOL
  1816. WINAPI
  1817. InternetSetCookieA(
  1818. IN LPCSTR lpszUrl,
  1819. IN LPCSTR lpszCookieName,
  1820. IN LPCSTR lpszCookieData
  1821. );
  1822. INTERNETAPI
  1823. BOOL
  1824. WINAPI
  1825. InternetSetCookieW(
  1826. IN LPCSTR lpszUrl,
  1827. IN LPCWSTR lpszCookieName,
  1828. IN LPCWSTR lpszCookieData
  1829. );
  1830. #ifdef UNICODE
  1831. #define InternetSetCookie InternetSetCookieW
  1832. #else
  1833. #define InternetSetCookie InternetSetCookieA
  1834. #endif // !UNICODE
  1835. INTERNETAPI
  1836. BOOL
  1837. WINAPI
  1838. InternetGetCookieA(
  1839. IN LPCSTR lpszUrl,
  1840. IN LPCSTR lpszCookieName,
  1841. OUT LPSTR lpCookieData,
  1842. IN OUT LPDWORD lpdwSize
  1843. );
  1844. INTERNETAPI
  1845. BOOL
  1846. WINAPI
  1847. InternetGetCookieW(
  1848. IN LPCSTR lpszUrl,
  1849. IN LPCWSTR lpszCookieName,
  1850. OUT LPWSTR lpCookieData,
  1851. IN OUT LPDWORD lpdwSize
  1852. );
  1853. #ifdef UNICODE
  1854. #define InternetGetCookie InternetGetCookieW
  1855. #else
  1856. #define InternetGetCookie InternetGetCookieA
  1857. #endif // !UNICODE
  1858. //
  1859. // offline browsing
  1860. //
  1861. INTERNETAPI
  1862. DWORD
  1863. WINAPI
  1864. InternetAttemptConnect(
  1865. DWORD dwReserved
  1866. );
  1867. //
  1868. // Internet UI
  1869. //
  1870. //
  1871. // InternetErrorDlg - Provides UI for certain Errors.
  1872. //
  1873. #define FLAGS_ERROR_UI_FILTER_FOR_ERRORS 0x01
  1874. #define FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS 0x02
  1875. #define FLAGS_ERROR_UI_FLAGS_GENERATE_DATA 0x04
  1876. #define FLAGS_ERROR_UI_FLAGS_NO_UI 0x08
  1877. INTERNETAPI
  1878. DWORD
  1879. WINAPI
  1880. InternetErrorDlg(
  1881. IN HWND hWnd,
  1882. IN OUT HINTERNET hRequest,
  1883. IN DWORD dwError,
  1884. IN DWORD dwFlags,
  1885. IN OUT LPVOID * lppvData
  1886. );
  1887. INTERNETAPI
  1888. DWORD
  1889. WINAPI
  1890. InternetConfirmZoneCrossing(
  1891. IN HWND hWnd,
  1892. IN LPSTR szUrlPrev,
  1893. IN LPSTR szUrlNew,
  1894. IN BOOL bPost
  1895. );
  1896. //#if !defined(_WINERROR_)
  1897. //
  1898. // Internet API error returns
  1899. //
  1900. #define INTERNET_ERROR_BASE 12000
  1901. #define ERROR_INTERNET_OUT_OF_HANDLES (INTERNET_ERROR_BASE + 1)
  1902. #define ERROR_INTERNET_TIMEOUT (INTERNET_ERROR_BASE + 2)
  1903. #define ERROR_INTERNET_EXTENDED_ERROR (INTERNET_ERROR_BASE + 3)
  1904. #define ERROR_INTERNET_INTERNAL_ERROR (INTERNET_ERROR_BASE + 4)
  1905. #define ERROR_INTERNET_INVALID_URL (INTERNET_ERROR_BASE + 5)
  1906. #define ERROR_INTERNET_UNRECOGNIZED_SCHEME (INTERNET_ERROR_BASE + 6)
  1907. #define ERROR_INTERNET_NAME_NOT_RESOLVED (INTERNET_ERROR_BASE + 7)
  1908. #define ERROR_INTERNET_PROTOCOL_NOT_FOUND (INTERNET_ERROR_BASE + 8)
  1909. #define ERROR_INTERNET_INVALID_OPTION (INTERNET_ERROR_BASE + 9)
  1910. #define ERROR_INTERNET_BAD_OPTION_LENGTH (INTERNET_ERROR_BASE + 10)
  1911. #define ERROR_INTERNET_OPTION_NOT_SETTABLE (INTERNET_ERROR_BASE + 11)
  1912. #define ERROR_INTERNET_SHUTDOWN (INTERNET_ERROR_BASE + 12)
  1913. #define ERROR_INTERNET_INCORRECT_USER_NAME (INTERNET_ERROR_BASE + 13)
  1914. #define ERROR_INTERNET_INCORRECT_PASSWORD (INTERNET_ERROR_BASE + 14)
  1915. #define ERROR_INTERNET_LOGIN_FAILURE (INTERNET_ERROR_BASE + 15)
  1916. #define ERROR_INTERNET_INVALID_OPERATION (INTERNET_ERROR_BASE + 16)
  1917. #define ERROR_INTERNET_OPERATION_CANCELLED (INTERNET_ERROR_BASE + 17)
  1918. #define ERROR_INTERNET_INCORRECT_HANDLE_TYPE (INTERNET_ERROR_BASE + 18)
  1919. #define ERROR_INTERNET_INCORRECT_HANDLE_STATE (INTERNET_ERROR_BASE + 19)
  1920. #define ERROR_INTERNET_NOT_PROXY_REQUEST (INTERNET_ERROR_BASE + 20)
  1921. #define ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND (INTERNET_ERROR_BASE + 21)
  1922. #define ERROR_INTERNET_BAD_REGISTRY_PARAMETER (INTERNET_ERROR_BASE + 22)
  1923. #define ERROR_INTERNET_NO_DIRECT_ACCESS (INTERNET_ERROR_BASE + 23)
  1924. #define ERROR_INTERNET_NO_CONTEXT (INTERNET_ERROR_BASE + 24)
  1925. #define ERROR_INTERNET_NO_CALLBACK (INTERNET_ERROR_BASE + 25)
  1926. #define ERROR_INTERNET_REQUEST_PENDING (INTERNET_ERROR_BASE + 26)
  1927. #define ERROR_INTERNET_INCORRECT_FORMAT (INTERNET_ERROR_BASE + 27)
  1928. #define ERROR_INTERNET_ITEM_NOT_FOUND (INTERNET_ERROR_BASE + 28)
  1929. #define ERROR_INTERNET_CANNOT_CONNECT (INTERNET_ERROR_BASE + 29)
  1930. #define ERROR_INTERNET_CONNECTION_ABORTED (INTERNET_ERROR_BASE + 30)
  1931. #define ERROR_INTERNET_CONNECTION_RESET (INTERNET_ERROR_BASE + 31)
  1932. #define ERROR_INTERNET_FORCE_RETRY (INTERNET_ERROR_BASE + 32)
  1933. #define ERROR_INTERNET_INVALID_PROXY_REQUEST (INTERNET_ERROR_BASE + 33)
  1934. #define ERROR_INTERNET_NEED_UI (INTERNET_ERROR_BASE + 34)
  1935. #define ERROR_INTERNET_HANDLE_EXISTS (INTERNET_ERROR_BASE + 36)
  1936. #define ERROR_INTERNET_SEC_CERT_DATE_INVALID (INTERNET_ERROR_BASE + 37)
  1937. #define ERROR_INTERNET_SEC_CERT_CN_INVALID (INTERNET_ERROR_BASE + 38)
  1938. #define ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR (INTERNET_ERROR_BASE + 39)
  1939. #define ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR (INTERNET_ERROR_BASE + 40)
  1940. #define ERROR_INTERNET_MIXED_SECURITY (INTERNET_ERROR_BASE + 41)
  1941. #define ERROR_INTERNET_CHG_POST_IS_NON_SECURE (INTERNET_ERROR_BASE + 42)
  1942. #define ERROR_INTERNET_POST_IS_NON_SECURE (INTERNET_ERROR_BASE + 43)
  1943. #define ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED (INTERNET_ERROR_BASE + 44)
  1944. #define ERROR_INTERNET_INVALID_CA (INTERNET_ERROR_BASE + 45)
  1945. #define ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP (INTERNET_ERROR_BASE + 46)
  1946. #define ERROR_INTERNET_ASYNC_THREAD_FAILED (INTERNET_ERROR_BASE + 47)
  1947. #define ERROR_INTERNET_REDIRECT_SCHEME_CHANGE (INTERNET_ERROR_BASE + 48)
  1948. //
  1949. // FTP API errors
  1950. //
  1951. #define ERROR_FTP_TRANSFER_IN_PROGRESS (INTERNET_ERROR_BASE + 110)
  1952. #define ERROR_FTP_DROPPED (INTERNET_ERROR_BASE + 111)
  1953. //
  1954. // gopher API errors
  1955. //
  1956. #define ERROR_GOPHER_PROTOCOL_ERROR (INTERNET_ERROR_BASE + 130)
  1957. #define ERROR_GOPHER_NOT_FILE (INTERNET_ERROR_BASE + 131)
  1958. #define ERROR_GOPHER_DATA_ERROR (INTERNET_ERROR_BASE + 132)
  1959. #define ERROR_GOPHER_END_OF_DATA (INTERNET_ERROR_BASE + 133)
  1960. #define ERROR_GOPHER_INVALID_LOCATOR (INTERNET_ERROR_BASE + 134)
  1961. #define ERROR_GOPHER_INCORRECT_LOCATOR_TYPE (INTERNET_ERROR_BASE + 135)
  1962. #define ERROR_GOPHER_NOT_GOPHER_PLUS (INTERNET_ERROR_BASE + 136)
  1963. #define ERROR_GOPHER_ATTRIBUTE_NOT_FOUND (INTERNET_ERROR_BASE + 137)
  1964. #define ERROR_GOPHER_UNKNOWN_LOCATOR (INTERNET_ERROR_BASE + 138)
  1965. //
  1966. // HTTP API errors
  1967. //
  1968. #define ERROR_HTTP_HEADER_NOT_FOUND (INTERNET_ERROR_BASE + 150)
  1969. #define ERROR_HTTP_DOWNLEVEL_SERVER (INTERNET_ERROR_BASE + 151)
  1970. #define ERROR_HTTP_INVALID_SERVER_RESPONSE (INTERNET_ERROR_BASE + 152)
  1971. #define ERROR_HTTP_INVALID_HEADER (INTERNET_ERROR_BASE + 153)
  1972. #define ERROR_HTTP_INVALID_QUERY_REQUEST (INTERNET_ERROR_BASE + 154)
  1973. #define ERROR_HTTP_HEADER_ALREADY_EXISTS (INTERNET_ERROR_BASE + 155)
  1974. #define ERROR_HTTP_REDIRECT_FAILED (INTERNET_ERROR_BASE + 156)
  1975. #define ERROR_HTTP_NOT_REDIRECTED (INTERNET_ERROR_BASE + 160) // BUGBUG
  1976. #define ERROR_INTERNET_SECURITY_CHANNEL_ERROR (INTERNET_ERROR_BASE + 157) // BUGBUG
  1977. #define ERROR_INTERNET_UNABLE_TO_CACHE_FILE (INTERNET_ERROR_BASE + 158) // BUGBUG
  1978. #define ERROR_INTERNET_TCPIP_NOT_INSTALLED (INTERNET_ERROR_BASE + 159) // BUGBUG
  1979. #define INTERNET_ERROR_LAST ERROR_INTERNET_TCPIP_NOT_INSTALLED
  1980. //#endif // !defined(_WINERROR_)
  1981. //
  1982. // URLCACHE APIs
  1983. //
  1984. #if !defined(_WINX32_) && !defined(_URLCACHEAPI_)
  1985. #define URLCACHEAPI DECLSPEC_IMPORT
  1986. #else
  1987. #define URLCACHEAPI
  1988. #endif
  1989. //
  1990. // datatype definitions.
  1991. //
  1992. //
  1993. // cache entry type flags.
  1994. //
  1995. #define NORMAL_CACHE_ENTRY 0x00000001
  1996. #define STABLE_CACHE_ENTRY 0x00000002
  1997. #define STICKY_CACHE_ENTRY 0x00000004
  1998. #define SPARSE_CACHE_ENTRY 0x00010000
  1999. #define OCX_CACHE_ENTRY 0x00020000
  2000. #define COOKIE_CACHE_ENTRY 0x00100000
  2001. #define URLHISTORY_CACHE_ENTRY 0x00200000
  2002. //
  2003. // INTERNET_CACHE_ENTRY_INFO -
  2004. //
  2005. typedef struct _INTERNET_CACHE_ENTRY_INFOA {
  2006. DWORD dwStructSize; // version of cache system.
  2007. LPSTR lpszSourceUrlName; // embedded pointer to the URL name string.
  2008. LPSTR lpszLocalFileName; // embedded pointer to the local file name.
  2009. DWORD CacheEntryType; // cache type bit mask.
  2010. DWORD dwUseCount; // current users count of the cache entry.
  2011. DWORD dwHitRate; // num of times the cache entry was retrieved.
  2012. DWORD dwSizeLow; // low DWORD of the file size.
  2013. DWORD dwSizeHigh; // high DWORD of the file size.
  2014. FILETIME LastModifiedTime; // last modified time of the file in GMT format.
  2015. FILETIME ExpireTime; // expire time of the file in GMT format
  2016. FILETIME LastAccessTime; // last accessed time in GMT format
  2017. FILETIME LastSyncTime; // last time the URL was synchronized
  2018. // with the source
  2019. LPBYTE lpHeaderInfo; // embedded pointer to the header info.
  2020. DWORD dwHeaderInfoSize; // size of the above header.
  2021. LPSTR lpszFileExtension; // File extension used to retrieve the urldata as a file.
  2022. DWORD dwReserved; // reserved for future use.
  2023. } INTERNET_CACHE_ENTRY_INFOA, * LPINTERNET_CACHE_ENTRY_INFOA;
  2024. typedef struct _INTERNET_CACHE_ENTRY_INFOW {
  2025. DWORD dwStructSize; // version of cache system.
  2026. LPSTR lpszSourceUrlName; // embedded pointer to the URL name string.
  2027. LPWSTR lpszLocalFileName; // embedded pointer to the local file name.
  2028. DWORD CacheEntryType; // cache type bit mask.
  2029. DWORD dwUseCount; // current users count of the cache entry.
  2030. DWORD dwHitRate; // num of times the cache entry was retrieved.
  2031. DWORD dwSizeLow; // low DWORD of the file size.
  2032. DWORD dwSizeHigh; // high DWORD of the file size.
  2033. FILETIME LastModifiedTime; // last modified time of the file in GMT format.
  2034. FILETIME ExpireTime; // expire time of the file in GMT format
  2035. FILETIME LastAccessTime; // last accessed time in GMT format
  2036. FILETIME LastSyncTime; // last time the URL was synchronized
  2037. // with the source
  2038. LPBYTE lpHeaderInfo; // embedded pointer to the header info.
  2039. DWORD dwHeaderInfoSize; // size of the above header.
  2040. LPWSTR lpszFileExtension; // File extension used to retrieve the urldata as a file.
  2041. DWORD dwReserved; // reserved for future use.
  2042. } INTERNET_CACHE_ENTRY_INFOW, * LPINTERNET_CACHE_ENTRY_INFOW;
  2043. #ifdef UNICODE
  2044. typedef INTERNET_CACHE_ENTRY_INFOW INTERNET_CACHE_ENTRY_INFO;
  2045. typedef LPINTERNET_CACHE_ENTRY_INFOW LPINTERNET_CACHE_ENTRY_INFO;
  2046. #else
  2047. typedef INTERNET_CACHE_ENTRY_INFOA INTERNET_CACHE_ENTRY_INFO;
  2048. typedef LPINTERNET_CACHE_ENTRY_INFOA LPINTERNET_CACHE_ENTRY_INFO;
  2049. #endif // UNICODE
  2050. //
  2051. // Cache APIs
  2052. //
  2053. URLCACHEAPI
  2054. BOOL
  2055. WINAPI
  2056. CreateUrlCacheEntryA(
  2057. IN LPCSTR lpszUrlName,
  2058. IN DWORD dwExpectedFileSize,
  2059. IN LPCSTR lpszFileExtension,
  2060. OUT LPSTR lpszFileName,
  2061. IN DWORD dwReserved
  2062. );
  2063. URLCACHEAPI
  2064. BOOL
  2065. WINAPI
  2066. CreateUrlCacheEntryW(
  2067. IN LPCSTR lpszUrlName,
  2068. IN DWORD dwExpectedFileSize,
  2069. IN LPCSTR lpszFileExtension,
  2070. OUT LPWSTR lpszFileName,
  2071. IN DWORD dwReserved
  2072. );
  2073. #ifdef UNICODE
  2074. #define CreateUrlCacheEntry CreateUrlCacheEntryW
  2075. #else
  2076. #define CreateUrlCacheEntry CreateUrlCacheEntryA
  2077. #endif // !UNICODE
  2078. URLCACHEAPI
  2079. BOOL
  2080. WINAPI
  2081. CommitUrlCacheEntryA(
  2082. IN LPCSTR lpszUrlName,
  2083. IN LPCSTR lpszLocalFileName,
  2084. IN FILETIME ExpireTime,
  2085. IN FILETIME LastModifiedTime,
  2086. IN DWORD CacheEntryType,
  2087. IN LPBYTE lpHeaderInfo,
  2088. IN DWORD dwHeaderSize,
  2089. IN LPCSTR lpszFileExtension,
  2090. IN DWORD dwReserved
  2091. );
  2092. URLCACHEAPI
  2093. BOOL
  2094. WINAPI
  2095. CommitUrlCacheEntryW(
  2096. IN LPCSTR lpszUrlName,
  2097. IN LPCWSTR lpszLocalFileName,
  2098. IN FILETIME ExpireTime,
  2099. IN FILETIME LastModifiedTime,
  2100. IN DWORD CacheEntryType,
  2101. IN LPBYTE lpHeaderInfo,
  2102. IN DWORD dwHeaderSize,
  2103. IN LPCWSTR lpszFileExtension,
  2104. IN DWORD dwReserved
  2105. );
  2106. #ifdef UNICODE
  2107. #define CommitUrlCacheEntry CommitUrlCacheEntryW
  2108. #else
  2109. #define CommitUrlCacheEntry CommitUrlCacheEntryA
  2110. #endif // !UNICODE
  2111. URLCACHEAPI
  2112. BOOL
  2113. WINAPI
  2114. RetrieveUrlCacheEntryFileA(
  2115. IN LPCSTR lpszUrlName,
  2116. OUT LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  2117. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize,
  2118. IN DWORD dwReserved
  2119. );
  2120. URLCACHEAPI
  2121. BOOL
  2122. WINAPI
  2123. RetrieveUrlCacheEntryFileW(
  2124. IN LPCSTR lpszUrlName,
  2125. OUT LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  2126. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize,
  2127. IN DWORD dwReserved
  2128. );
  2129. #ifdef UNICODE
  2130. #define RetrieveUrlCacheEntryFile RetrieveUrlCacheEntryFileW
  2131. #else
  2132. #define RetrieveUrlCacheEntryFile RetrieveUrlCacheEntryFileA
  2133. #endif // !UNICODE
  2134. URLCACHEAPI
  2135. BOOL
  2136. WINAPI
  2137. UnlockUrlCacheEntryFile(
  2138. IN LPCSTR lpszUrlName,
  2139. IN DWORD dwReserved
  2140. );
  2141. URLCACHEAPI
  2142. HANDLE
  2143. WINAPI
  2144. RetrieveUrlCacheEntryStreamA(
  2145. IN LPCSTR lpszUrlName,
  2146. OUT LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  2147. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize,
  2148. IN BOOL fRandomRead,
  2149. IN DWORD dwReserved
  2150. );
  2151. URLCACHEAPI
  2152. HANDLE
  2153. WINAPI
  2154. RetrieveUrlCacheEntryStreamW(
  2155. IN LPCSTR lpszUrlName,
  2156. OUT LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  2157. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize,
  2158. IN BOOL fRandomRead,
  2159. IN DWORD dwReserved
  2160. );
  2161. #ifdef UNICODE
  2162. #define RetrieveUrlCacheEntryStream RetrieveUrlCacheEntryStreamW
  2163. #else
  2164. #define RetrieveUrlCacheEntryStream RetrieveUrlCacheEntryStreamA
  2165. #endif // !UNICODE
  2166. URLCACHEAPI
  2167. BOOL
  2168. WINAPI
  2169. ReadUrlCacheEntryStream(
  2170. IN HANDLE hUrlCacheStream,
  2171. IN DWORD dwLocation,
  2172. IN OUT LPVOID lpBuffer,
  2173. IN OUT LPDWORD lpdwLen,
  2174. IN DWORD Reserved
  2175. );
  2176. URLCACHEAPI
  2177. BOOL
  2178. WINAPI
  2179. UnlockUrlCacheEntryStream(
  2180. IN HANDLE hUrlCacheStream,
  2181. IN DWORD Reserved
  2182. );
  2183. URLCACHEAPI
  2184. BOOL
  2185. WINAPI
  2186. GetUrlCacheEntryInfoA(
  2187. IN LPCSTR lpszUrlName,
  2188. OUT LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  2189. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize
  2190. );
  2191. URLCACHEAPI
  2192. BOOL
  2193. WINAPI
  2194. GetUrlCacheEntryInfoW(
  2195. IN LPCSTR lpszUrlName,
  2196. OUT LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  2197. IN OUT LPDWORD lpdwCacheEntryInfoBufferSize
  2198. );
  2199. #ifdef UNICODE
  2200. #define GetUrlCacheEntryInfo GetUrlCacheEntryInfoW
  2201. #else
  2202. #define GetUrlCacheEntryInfo GetUrlCacheEntryInfoA
  2203. #endif // !UNICODE
  2204. #define CACHE_ENTRY_ATTRIBUTE_FC 0x00000004
  2205. #define CACHE_ENTRY_HITRATE_FC 0x00000010
  2206. #define CACHE_ENTRY_MODTIME_FC 0x00000040
  2207. #define CACHE_ENTRY_EXPTIME_FC 0x00000080
  2208. #define CACHE_ENTRY_ACCTIME_FC 0x00000100
  2209. #define CACHE_ENTRY_SYNCTIME_FC 0x00000200
  2210. #define CACHE_ENTRY_HEADERINFO_FC 0x00000400
  2211. URLCACHEAPI
  2212. BOOL
  2213. WINAPI
  2214. SetUrlCacheEntryInfoA(
  2215. IN LPCSTR lpszUrlName,
  2216. IN LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,
  2217. IN DWORD dwFieldControl
  2218. );
  2219. URLCACHEAPI
  2220. BOOL
  2221. WINAPI
  2222. SetUrlCacheEntryInfoW(
  2223. IN LPCSTR lpszUrlName,
  2224. IN LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,
  2225. IN DWORD dwFieldControl
  2226. );
  2227. #ifdef UNICODE
  2228. #define SetUrlCacheEntryInfo SetUrlCacheEntryInfoW
  2229. #else
  2230. #define SetUrlCacheEntryInfo SetUrlCacheEntryInfoA
  2231. #endif // !UNICODE
  2232. URLCACHEAPI
  2233. HANDLE
  2234. WINAPI
  2235. FindFirstUrlCacheEntryA(
  2236. IN LPCSTR lpszUrlSearchPattern,
  2237. OUT LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,
  2238. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize
  2239. );
  2240. URLCACHEAPI
  2241. HANDLE
  2242. WINAPI
  2243. FindFirstUrlCacheEntryW(
  2244. IN LPCSTR lpszUrlSearchPattern,
  2245. OUT LPINTERNET_CACHE_ENTRY_INFOW lpFirstCacheEntryInfo,
  2246. IN OUT LPDWORD lpdwFirstCacheEntryInfoBufferSize
  2247. );
  2248. #ifdef UNICODE
  2249. #define FindFirstUrlCacheEntry FindFirstUrlCacheEntryW
  2250. #else
  2251. #define FindFirstUrlCacheEntry FindFirstUrlCacheEntryA
  2252. #endif // !UNICODE
  2253. URLCACHEAPI
  2254. BOOL
  2255. WINAPI
  2256. FindNextUrlCacheEntryA(
  2257. IN HANDLE hEnumHandle,
  2258. OUT LPINTERNET_CACHE_ENTRY_INFOA lpNextCacheEntryInfo,
  2259. IN OUT LPDWORD lpdwNextCacheEntryInfoBufferSize
  2260. );
  2261. URLCACHEAPI
  2262. BOOL
  2263. WINAPI
  2264. FindNextUrlCacheEntryW(
  2265. IN HANDLE hEnumHandle,
  2266. OUT LPINTERNET_CACHE_ENTRY_INFOW lpNextCacheEntryInfo,
  2267. IN OUT LPDWORD lpdwNextCacheEntryInfoBufferSize
  2268. );
  2269. #ifdef UNICODE
  2270. #define FindNextUrlCacheEntry FindNextUrlCacheEntryW
  2271. #else
  2272. #define FindNextUrlCacheEntry FindNextUrlCacheEntryA
  2273. #endif // !UNICODE
  2274. URLCACHEAPI
  2275. BOOL
  2276. WINAPI
  2277. FindCloseUrlCache(
  2278. IN HANDLE hEnumHandle
  2279. );
  2280. URLCACHEAPI
  2281. BOOL
  2282. WINAPI
  2283. DeleteUrlCacheEntry(
  2284. IN LPCSTR lpszUrlName
  2285. );
  2286. #if defined(__cplusplus)
  2287. }
  2288. #endif
  2289. /*
  2290. * Return packing to whatever it was before we
  2291. * entered this file
  2292. */
  2293. #pragma pack(pop, wininet)
  2294. #endif // !defined(_WININET_)