home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / win32 / Wininet.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-04  |  77.0 KB  |  2,624 lines

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