home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / AutoPC / apcsdk10.exe / data1.cab / Emulation_Include_Files / wininet.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-05-13  |  53.5 KB  |  1,890 lines

  1. /*++
  2.  
  3. Copyright (c) 1995-1997  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. #pragma pack(push, wininet, 4)
  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.     LPCSTR lpszProxy;
  311.  
  312.     //
  313.     // lpszProxyBypass - proxy bypass list
  314.     //
  315.  
  316.     LPCSTR lpszProxyBypass;
  317. } INTERNET_PROXY_INFOA, * LPINTERNET_PROXY_INFOA;
  318.  
  319. typedef struct {
  320.  
  321.     //
  322.     // dwAccessType - INTERNET_OPEN_TYPE_DIRECT, INTERNET_OPEN_TYPE_PROXY, or
  323.     // INTERNET_OPEN_TYPE_PRECONFIG (set only)
  324.     //
  325.  
  326.     DWORD dwAccessType;
  327.  
  328.     //
  329.     // lpszProxy - proxy server list
  330.     //
  331.  
  332.     LPCWSTR lpszProxy;
  333.  
  334.     //
  335.     // lpszProxyBypass - proxy bypass list
  336.     //
  337.  
  338.     LPCWSTR lpszProxyBypass;
  339. } INTERNET_PROXY_INFOW, * LPINTERNET_PROXY_INFOW;
  340.  
  341. #ifdef UNICODE
  342. typedef INTERNET_PROXY_INFOW INTERNET_PROXY_INFO;
  343. typedef LPINTERNET_PROXY_INFOW LPINTERNET_PROXY_INFO;
  344. #else
  345. typedef INTERNET_PROXY_INFOA INTERNET_PROXY_INFO;
  346. typedef LPINTERNET_PROXY_INFOA LPINTERNET_PROXY_INFO;
  347. #endif // UNICODE
  348.  
  349. //
  350. // INTERNET_VERSION_INFO - version information returned via
  351. // InternetQueryOption(..., INTERNET_OPTION_VERSION, ...)
  352. //
  353.  
  354. typedef struct {
  355.     DWORD dwMajorVersion;
  356.     DWORD dwMinorVersion;
  357. } INTERNET_VERSION_INFO, * LPINTERNET_VERSION_INFO;
  358.  
  359. //
  360. // URL_COMPONENTS - the constituent parts of an URL. Used in InternetCrackUrl()
  361. // and InternetCreateUrl()
  362. //
  363. // For InternetCrackUrl(), if a pointer field and its corresponding length field
  364. // are both 0 then that component is not returned; If the pointer field is NULL
  365. // but the length field is not zero, then both the pointer and length fields are
  366. // returned; if both pointer and corresponding length fields are non-zero then
  367. // the pointer field points to a buffer where the component is copied. The
  368. // component may be un-escaped, depending on dwFlags
  369. //
  370. // For InternetCreateUrl(), the pointer fields should be NULL if the component
  371. // is not required. If the corresponding length field is zero then the pointer
  372. // field is the address of a zero-terminated string. If the length field is not
  373. // zero then it is the string length of the corresponding pointer field
  374. //
  375.  
  376. typedef struct {
  377.     DWORD   dwStructSize;       // size of this structure. Used in version check
  378.     LPSTR   lpszScheme;         // pointer to scheme name
  379.     DWORD   dwSchemeLength;     // length of scheme name
  380.     INTERNET_SCHEME nScheme;    // enumerated scheme type (if known)
  381.     LPSTR   lpszHostName;       // pointer to host name
  382.     DWORD   dwHostNameLength;   // length of host name
  383.     INTERNET_PORT nPort;        // converted port number
  384.     LPSTR   lpszUserName;       // pointer to user name
  385.     DWORD   dwUserNameLength;   // length of user name
  386.     LPSTR   lpszPassword;       // pointer to password
  387.     DWORD   dwPasswordLength;   // length of password
  388.     LPSTR   lpszUrlPath;        // pointer to URL-path
  389.     DWORD   dwUrlPathLength;    // length of URL-path
  390.     LPSTR   lpszExtraInfo;      // pointer to extra information (e.g. ?foo or #foo)
  391.     DWORD   dwExtraInfoLength;  // length of extra information
  392. } URL_COMPONENTSA, * LPURL_COMPONENTSA;
  393. typedef struct {
  394.     DWORD   dwStructSize;       // size of this structure. Used in version check
  395.     LPWSTR  lpszScheme;         // pointer to scheme name
  396.     DWORD   dwSchemeLength;     // length of scheme name
  397.     INTERNET_SCHEME nScheme;    // enumerated scheme type (if known)
  398.     LPWSTR  lpszHostName;       // pointer to host name
  399.     DWORD   dwHostNameLength;   // length of host name
  400.     INTERNET_PORT nPort;        // converted port number
  401.     LPWSTR  lpszUserName;       // pointer to user name
  402.     DWORD   dwUserNameLength;   // length of user name
  403.     LPWSTR  lpszPassword;       // pointer to password
  404.     DWORD   dwPasswordLength;   // length of password
  405.     LPWSTR  lpszUrlPath;        // pointer to URL-path
  406.     DWORD   dwUrlPathLength;    // length of URL-path
  407.     LPWSTR  lpszExtraInfo;      // pointer to extra information (e.g. ?foo or #foo)
  408.     DWORD   dwExtraInfoLength;  // length of extra information
  409. } URL_COMPONENTSW, * LPURL_COMPONENTSW;
  410. #ifdef UNICODE
  411. typedef URL_COMPONENTSW URL_COMPONENTS;
  412. typedef LPURL_COMPONENTSW LPURL_COMPONENTS;
  413. #else
  414. typedef URL_COMPONENTSA URL_COMPONENTS;
  415. typedef LPURL_COMPONENTSA LPURL_COMPONENTS;
  416. #endif // UNICODE
  417.  
  418. //
  419. // INTERNET_CERTIFICATE_INFO lpBuffer - contains the certificate returned from
  420. // the server
  421. //
  422.  
  423. typedef struct {
  424.  
  425.     //
  426.     // ftExpiry - date the certificate expires.
  427.     //
  428.  
  429.     FILETIME ftExpiry;
  430.  
  431.     //
  432.     // ftStart - date the certificate becomes valid.
  433.     //
  434.  
  435.     FILETIME ftStart;
  436.  
  437.     //
  438.     // lpszSubjectInfo - the name of organization, site, and server
  439.     //   the cert. was issued for.
  440.     //
  441.  
  442.     LPWSTR lpszSubjectInfo;
  443.  
  444.     //
  445.     // lpszIssuerInfo - the name of orgainzation, site, and server
  446.     //   the cert was issues by.
  447.     //
  448.  
  449.     LPWSTR lpszIssuerInfo;
  450.  
  451.     //
  452.     // lpszProtocolName - the name of the protocol used to provide the secure
  453.     //   connection.
  454.     //
  455.  
  456.     LPWSTR lpszProtocolName;
  457.  
  458.     //
  459.     // lpszSignatureAlgName - the name of the algorithm used for signing
  460.     //  the certificate.
  461.     //
  462.  
  463.     LPWSTR lpszSignatureAlgName;
  464.  
  465.     //
  466.     // lpszEncryptionAlgName - the name of the algorithm used for
  467.     //  doing encryption over the secure channel (SSL/PCT) connection.
  468.     //
  469.  
  470.     LPWSTR lpszEncryptionAlgName;
  471.  
  472.     //
  473.     // dwKeySize - size of the key.
  474.     //
  475.  
  476.     DWORD dwKeySize;
  477.  
  478. } INTERNET_CERTIFICATE_INFOW, * LPINTERNET_CERTIFICATE_INFOW;
  479.  
  480. typedef struct {
  481.  
  482.     //
  483.     // ftExpiry - date the certificate expires.
  484.     //
  485.  
  486.     FILETIME ftExpiry;
  487.  
  488.     //
  489.     // ftStart - date the certificate becomes valid.
  490.     //
  491.  
  492.     FILETIME ftStart;
  493.  
  494.     //
  495.     // lpszSubjectInfo - the name of organization, site, and server
  496.     //   the cert. was issued for.
  497.     //
  498.  
  499.     LPSTR lpszSubjectInfo;
  500.  
  501.     //
  502.     // lpszIssuerInfo - the name of orgainzation, site, and server
  503.     //   the cert was issues by.
  504.     //
  505.  
  506.     LPSTR lpszIssuerInfo;
  507.  
  508.     //
  509.     // lpszProtocolName - the name of the protocol used to provide the secure
  510.     //   connection.
  511.     //
  512.  
  513.     LPSTR lpszProtocolName;
  514.  
  515.     //
  516.     // lpszSignatureAlgName - the name of the algorithm used for signing
  517.     //  the certificate.
  518.     //
  519.  
  520.     LPSTR lpszSignatureAlgName;
  521.  
  522.     //
  523.     // lpszEncryptionAlgName - the name of the algorithm used for
  524.     //  doing encryption over the secure channel (SSL/PCT) connection.
  525.     //
  526.  
  527.     LPSTR lpszEncryptionAlgName;
  528.  
  529.     //
  530.     // dwKeySize - size of the key.
  531.     //
  532.  
  533.     DWORD dwKeySize;
  534.  
  535. } INTERNET_CERTIFICATE_INFOA, * LPINTERNET_CERTIFICATE_INFOA;
  536.  
  537. #ifdef UNICODE
  538.     typedef INTERNET_CERTIFICATE_INFOW INTERNET_CERTIFICATE_INFO;
  539.     typedef LPINTERNET_CERTIFICATE_INFOW LPINTERNET_CERTIFICATE_INFO;
  540. #else
  541.     typedef INTERNET_CERTIFICATE_INFOA INTERNET_CERTIFICATE_INFO;
  542.     typedef LPINTERNET_CERTIFICATE_INFOA LPINTERNET_CERTIFICATE_INFO;
  543. #endif //UNICODE
  544.  
  545. //
  546. // prototypes
  547. //
  548.  
  549. INTERNETAPI
  550. BOOL
  551. WINAPI
  552. InternetTimeFromSystemTimeA(
  553.     IN  CONST SYSTEMTIME *pst,  // input GMT time
  554.     IN  DWORD dwRFC,            // RFC format
  555.     OUT LPSTR lpszTime,         // output string buffer
  556.     IN  DWORD cbTime            // output buffer size
  557.     );
  558. INTERNETAPI
  559. BOOL
  560. WINAPI
  561. InternetTimeFromSystemTimeW(
  562.     IN  CONST SYSTEMTIME *pst,  // input GMT time
  563.     IN  DWORD dwRFC,            // RFC format
  564.     OUT LPWSTR lpszTime,        // output string buffer
  565.     IN  DWORD cbTime            // output buffer size
  566.     );
  567. #ifdef UNICODE
  568. #define InternetTimeFromSystemTime    InternetTimeFromSystemTimeW
  569. #else
  570. #define InternetTimeFromSystemTime    InternetTimeFromSystemTimeA
  571. #endif // !UNICODE
  572.  
  573.  
  574. //
  575. // constants for InternetTimeFromSystemTime
  576. //
  577.  
  578. #define INTERNET_RFC1123_FORMAT     0
  579. #define INTERNET_RFC1123_BUFSIZE   30
  580.  
  581. INTERNETAPI
  582. BOOL
  583. WINAPI
  584. InternetTimeToSystemTimeA(
  585.     IN  LPCSTR lpszTime,         // NULL terminated string
  586.     OUT SYSTEMTIME *pst,         // output in GMT time
  587.     IN  DWORD dwReserved
  588.     );
  589.  
  590. INTERNETAPI
  591. BOOL
  592. WINAPI
  593. InternetTimeToSystemTimeW(
  594.     IN  LPCWSTR lpszTime,         // NULL terminated string
  595.     OUT SYSTEMTIME *pst,         // output in GMT time
  596.     IN  DWORD dwReserved
  597.     );
  598.  
  599. #ifdef UNICODE
  600. #define InternetTimeToSystemTime    InternetTimeToSystemTimeW
  601. #else
  602. #define InternetTimeToSystemTime    InternetTimeToSystemTimeA
  603. #endif // !UNICODE
  604.  
  605. INTERNETAPI
  606. BOOL
  607. WINAPI
  608. InternetDebugGetLocalTime(
  609.     OUT SYSTEMTIME * pstLocalTime,
  610.     OUT DWORD      * pdwReserved
  611. );
  612.  
  613. INTERNETAPI
  614. BOOL
  615. WINAPI
  616. InternetCrackUrlA(
  617.     IN LPCSTR lpszUrl,
  618.     IN DWORD dwUrlLength,
  619.     IN DWORD dwFlags,
  620.     IN OUT LPURL_COMPONENTSA lpUrlComponents
  621.     );
  622. INTERNETAPI
  623. BOOL
  624. WINAPI
  625. InternetCrackUrlW(
  626.     IN LPCWSTR lpszUrl,
  627.     IN DWORD dwUrlLength,
  628.     IN DWORD dwFlags,
  629.     IN OUT LPURL_COMPONENTSW lpUrlComponents
  630.     );
  631. #ifdef UNICODE
  632. #define InternetCrackUrl  InternetCrackUrlW
  633. #else
  634. #define InternetCrackUrl  InternetCrackUrlA
  635. #endif // !UNICODE
  636.  
  637. INTERNETAPI
  638. BOOL
  639. WINAPI
  640. InternetCreateUrlA(
  641.     IN LPURL_COMPONENTSA lpUrlComponents,
  642.     IN DWORD dwFlags,
  643.     OUT LPSTR lpszUrl,
  644.     IN OUT LPDWORD lpdwUrlLength
  645.     );
  646. INTERNETAPI
  647. BOOL
  648. WINAPI
  649. InternetCreateUrlW(
  650.     IN LPURL_COMPONENTSW lpUrlComponents,
  651.     IN DWORD dwFlags,
  652.     OUT LPWSTR lpszUrl,
  653.     IN OUT LPDWORD lpdwUrlLength
  654.     );
  655. #ifdef UNICODE
  656. #define InternetCreateUrl  InternetCreateUrlW
  657. #else
  658. #define InternetCreateUrl  InternetCreateUrlA
  659. #endif // !UNICODE
  660.  
  661. INTERNETAPI
  662. BOOL
  663. WINAPI
  664. InternetCanonicalizeUrlA(
  665.     IN LPCSTR lpszUrl,
  666.     OUT LPSTR lpszBuffer,
  667.     IN OUT LPDWORD lpdwBufferLength,
  668.     IN DWORD dwFlags
  669.     );
  670. INTERNETAPI
  671. BOOL
  672. WINAPI
  673. InternetCanonicalizeUrlW(
  674.     IN LPCWSTR lpszUrl,
  675.     OUT LPWSTR lpszBuffer,
  676.     IN OUT LPDWORD lpdwBufferLength,
  677.     IN DWORD dwFlags
  678.     );
  679. #ifdef UNICODE
  680. #define InternetCanonicalizeUrl  InternetCanonicalizeUrlW
  681. #else
  682. #define InternetCanonicalizeUrl  InternetCanonicalizeUrlA
  683. #endif // !UNICODE
  684.  
  685. INTERNETAPI
  686. BOOL
  687. WINAPI
  688. InternetCombineUrlA(
  689.     IN LPCSTR lpszBaseUrl,
  690.     IN LPCSTR lpszRelativeUrl,
  691.     OUT LPSTR lpszBuffer,
  692.     IN OUT LPDWORD lpdwBufferLength,
  693.     IN DWORD dwFlags
  694.     );
  695. INTERNETAPI
  696. BOOL
  697. WINAPI
  698. InternetCombineUrlW(
  699.     IN LPCWSTR lpszBaseUrl,
  700.     IN LPCWSTR lpszRelativeUrl,
  701.     OUT LPWSTR lpszBuffer,
  702.     IN OUT LPDWORD lpdwBufferLength,
  703.     IN DWORD dwFlags
  704.     );
  705. #ifdef UNICODE
  706. #define InternetCombineUrl  InternetCombineUrlW
  707. #else
  708. #define InternetCombineUrl  InternetCombineUrlA
  709. #endif // !UNICODE
  710.  
  711. //
  712. // flags for InternetCrackUrl() and InternetCreateUrl()
  713. //
  714.  
  715. #define ICU_ESCAPE      0x80000000  // (un)escape URL characters
  716. #define ICU_USERNAME    0x40000000  // use internal username & password
  717.  
  718. //
  719. // flags for InternetCanonicalizeUrl() and InternetCombineUrl()
  720. //
  721.  
  722. #define ICU_NO_ENCODE   0x20000000  // Don't convert unsafe characters to escape sequence
  723. #define ICU_DECODE      0x10000000  // Convert %XX escape sequences to characters
  724. #define ICU_NO_META     0x08000000  // Don't convert .. etc. meta path sequences
  725. #define ICU_ENCODE_SPACES_ONLY 0x04000000  // Encode spaces only
  726. #define ICU_BROWSER_MODE 0x02000000 // Special encode/decode rules for browser
  727.  
  728. INTERNETAPI
  729. HINTERNET
  730. WINAPI
  731. InternetOpenA(
  732.     IN LPCSTR lpszAgent,
  733.     IN DWORD dwAccessType,
  734.     IN LPCSTR lpszProxy OPTIONAL,
  735.     IN LPCSTR lpszProxyBypass OPTIONAL,
  736.     IN DWORD dwFlags
  737.     );
  738. INTERNETAPI
  739. HINTERNET
  740. WINAPI
  741. InternetOpenW(
  742.     IN LPCWSTR lpszAgent,
  743.     IN DWORD dwAccessType,
  744.     IN LPCWSTR lpszProxy OPTIONAL,
  745.     IN LPCWSTR lpszProxyBypass OPTIONAL,
  746.     IN DWORD dwFlags
  747.     );
  748. #ifdef UNICODE
  749. #define InternetOpen  InternetOpenW
  750. #else
  751. #define InternetOpen  InternetOpenA
  752. #endif // !UNICODE
  753.  
  754. //
  755. // access types for InternetOpen()
  756. //
  757.  
  758. #define INTERNET_OPEN_TYPE_PRECONFIG    0   // use registry configuration
  759. #define INTERNET_OPEN_TYPE_DIRECT       1   // direct to net
  760. #define INTERNET_OPEN_TYPE_PROXY        3   // via named proxy
  761.  
  762. #define PRE_CONFIG_INTERNET_ACCESS  INTERNET_OPEN_TYPE_PRECONFIG
  763. #define LOCAL_INTERNET_ACCESS       INTERNET_OPEN_TYPE_DIRECT
  764. #define GATEWAY_INTERNET_ACCESS     2   // Internet via gateway
  765. #define CERN_PROXY_INTERNET_ACCESS  INTERNET_OPEN_TYPE_PROXY
  766.  
  767. INTERNETAPI
  768. BOOL
  769. WINAPI
  770. InternetCloseHandle(
  771.     IN HINTERNET hInternet
  772.     );
  773.  
  774. INTERNETAPI
  775. HINTERNET
  776. WINAPI
  777. InternetConnectA(
  778.     IN HINTERNET hInternet,
  779.     IN LPCSTR lpszServerName,
  780.     IN INTERNET_PORT nServerPort,
  781.     IN LPCSTR lpszUserName OPTIONAL,
  782.     IN LPCSTR lpszPassword OPTIONAL,
  783.     IN DWORD dwService,
  784.     IN DWORD dwFlags,
  785.     IN DWORD dwContext
  786.     );
  787. INTERNETAPI
  788. HINTERNET
  789. WINAPI
  790. InternetConnectW(
  791.     IN HINTERNET hInternet,
  792.     IN LPCWSTR lpszServerName,
  793.     IN INTERNET_PORT nServerPort,
  794.     IN LPCWSTR lpszUserName OPTIONAL,
  795.     IN LPCWSTR lpszPassword OPTIONAL,
  796.     IN DWORD dwService,
  797.     IN DWORD dwFlags,
  798.     IN DWORD dwContext
  799.     );
  800. #ifdef UNICODE
  801. #define InternetConnect  InternetConnectW
  802. #else
  803. #define InternetConnect  InternetConnectA
  804. #endif // !UNICODE
  805.  
  806. //
  807. // service types for InternetConnect()
  808. //
  809.  
  810. #define INTERNET_SERVICE_FTP    1
  811. #define INTERNET_SERVICE_HTTP   3
  812.  
  813. INTERNETAPI
  814. HINTERNET
  815. WINAPI
  816. InternetOpenUrlA(
  817.     IN HINTERNET hInternet,
  818.     IN LPCSTR lpszUrl,
  819.     IN LPCSTR lpszHeaders OPTIONAL,
  820.     IN DWORD dwHeadersLength,
  821.     IN DWORD dwFlags,
  822.     IN DWORD dwContext
  823.     );
  824. INTERNETAPI
  825. HINTERNET
  826. WINAPI
  827. InternetOpenUrlW(
  828.     IN HINTERNET hInternet,
  829.     IN LPCWSTR lpszUrl,
  830.     IN LPCWSTR lpszHeaders OPTIONAL,
  831.     IN DWORD dwHeadersLength,
  832.     IN DWORD dwFlags,
  833.     IN DWORD dwContext
  834.     );
  835. #ifdef UNICODE
  836. #define InternetOpenUrl  InternetOpenUrlW
  837. #else
  838. #define InternetOpenUrl  InternetOpenUrlA
  839. #endif // !UNICODE
  840.  
  841. INTERNETAPI
  842. BOOL
  843. WINAPI
  844. InternetReadFile(
  845.     IN HINTERNET hFile,
  846.     IN LPVOID lpBuffer,
  847.     IN DWORD dwNumberOfBytesToRead,
  848.     OUT LPDWORD lpdwNumberOfBytesRead
  849.     );
  850.  
  851. INTERNETAPI
  852. DWORD
  853. WINAPI
  854. InternetSetFilePointer(
  855.     IN HINTERNET hFile,
  856.     IN LONG  lDistanceToMove,
  857.     IN PVOID pReserved,
  858.     IN DWORD dwMoveMethod,
  859.     IN DWORD dwContext
  860.     );
  861.  
  862. INTERNETAPI
  863. BOOL
  864. WINAPI
  865. InternetWriteFile(
  866.     IN HINTERNET hFile,
  867.     IN LPCVOID lpBuffer,
  868.     IN DWORD dwNumberOfBytesToWrite,
  869.     OUT LPDWORD lpdwNumberOfBytesWritten
  870.     );
  871.  
  872. INTERNETAPI
  873. BOOL
  874. WINAPI
  875. InternetQueryDataAvailable(
  876.     IN HINTERNET hFile,
  877.     OUT LPDWORD lpdwNumberOfBytesAvailable,
  878.     IN DWORD dwFlags,
  879.     IN DWORD dwContext
  880.     );
  881.  
  882. INTERNETAPI
  883. BOOL
  884. WINAPI
  885. InternetFindNextFileA(
  886.     IN HINTERNET hFind,
  887.     OUT LPVOID lpvFindData
  888.     );
  889. INTERNETAPI
  890. BOOL
  891. WINAPI
  892. InternetFindNextFileW(
  893.     IN HINTERNET hFind,
  894.     OUT LPVOID lpvFindData
  895.     );
  896. #ifdef UNICODE
  897. #define InternetFindNextFile  InternetFindNextFileW
  898. #else
  899. #define InternetFindNextFile  InternetFindNextFileA
  900. #endif // !UNICODE
  901.  
  902. INTERNETAPI
  903. BOOL
  904. WINAPI
  905. InternetQueryOptionA(
  906.     IN HINTERNET hInternet OPTIONAL,
  907.     IN DWORD dwOption,
  908.     OUT LPVOID lpBuffer OPTIONAL,
  909.     IN OUT LPDWORD lpdwBufferLength
  910.     );
  911. INTERNETAPI
  912. BOOL
  913. WINAPI
  914. InternetQueryOptionW(
  915.     IN HINTERNET hInternet OPTIONAL,
  916.     IN DWORD dwOption,
  917.     OUT LPVOID lpBuffer OPTIONAL,
  918.     IN OUT LPDWORD lpdwBufferLength
  919.     );
  920. #ifdef UNICODE
  921. #define InternetQueryOption  InternetQueryOptionW
  922. #else
  923. #define InternetQueryOption  InternetQueryOptionA
  924. #endif // !UNICODE
  925.  
  926. INTERNETAPI
  927. BOOL
  928. WINAPI
  929. InternetSetOptionA(
  930.     IN HINTERNET hInternet OPTIONAL,
  931.     IN DWORD dwOption,
  932.     IN LPVOID lpBuffer,
  933.     IN DWORD dwBufferLength
  934.     );
  935. INTERNETAPI
  936. BOOL
  937. WINAPI
  938. InternetSetOptionW(
  939.     IN HINTERNET hInternet OPTIONAL,
  940.     IN DWORD dwOption,
  941.     IN LPVOID lpBuffer,
  942.     IN DWORD dwBufferLength
  943.     );
  944. #ifdef UNICODE
  945. #define InternetSetOption  InternetSetOptionW
  946. #else
  947. #define InternetSetOption  InternetSetOptionA
  948. #endif // !UNICODE
  949.  
  950. INTERNETAPI
  951. BOOL
  952. WINAPI
  953. InternetSetOptionExA(
  954.     IN HINTERNET hInternet OPTIONAL,
  955.     IN DWORD dwOption,
  956.     IN LPVOID lpBuffer,
  957.     IN DWORD dwBufferLength,
  958.     IN DWORD dwFlags
  959.     );
  960. INTERNETAPI
  961. BOOL
  962. WINAPI
  963. InternetSetOptionExW(
  964.     IN HINTERNET hInternet OPTIONAL,
  965.     IN DWORD dwOption,
  966.     IN LPVOID lpBuffer,
  967.     IN DWORD dwBufferLength,
  968.     IN DWORD dwFlags
  969.     );
  970. #ifdef UNICODE
  971. #define InternetSetOptionEx  InternetSetOptionExW
  972. #else
  973. #define InternetSetOptionEx  InternetSetOptionExA
  974. #endif // !UNICODE
  975.  
  976. //
  977. // flags for InternetSetOptionEx()
  978. //
  979.  
  980. #define ISO_GLOBAL      0x00000001  // modify option globally
  981. #define ISO_REGISTRY    0x00000002  // write option to registry (where applicable)
  982.  
  983. #define ISO_VALID_FLAGS (ISO_GLOBAL | ISO_REGISTRY)
  984.  
  985. //
  986. // options manifests for Internet{Query|Set}Option
  987. //
  988.  
  989. #define INTERNET_OPTION_CALLBACK                1
  990. #define INTERNET_OPTION_CONNECT_TIMEOUT         2
  991. #define INTERNET_OPTION_CONNECT_RETRIES         3
  992. #define INTERNET_OPTION_CONNECT_BACKOFF         4
  993. #define INTERNET_OPTION_SEND_TIMEOUT            5
  994. #define INTERNET_OPTION_CONTROL_SEND_TIMEOUT    INTERNET_OPTION_SEND_TIMEOUT
  995. #define INTERNET_OPTION_RECEIVE_TIMEOUT         6
  996. #define INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT INTERNET_OPTION_RECEIVE_TIMEOUT
  997. #define INTERNET_OPTION_DATA_SEND_TIMEOUT       7
  998. #define INTERNET_OPTION_DATA_RECEIVE_TIMEOUT    8
  999. #define INTERNET_OPTION_HANDLE_TYPE             9
  1000. #define INTERNET_OPTION_CONTEXT_VALUE           10
  1001. #define INTERNET_OPTION_LISTEN_TIMEOUT          11
  1002. #define INTERNET_OPTION_READ_BUFFER_SIZE        12
  1003. #define INTERNET_OPTION_WRITE_BUFFER_SIZE       13
  1004.  
  1005. #define INTERNET_OPTION_ASYNC_ID                15
  1006. #define INTERNET_OPTION_ASYNC_PRIORITY          16
  1007.  
  1008. #define INTERNET_OPTION_PARENT_HANDLE           21
  1009. #define INTERNET_OPTION_KEEP_CONNECTION         22
  1010. #define INTERNET_OPTION_REQUEST_FLAGS           23
  1011. #define INTERNET_OPTION_EXTENDED_ERROR          24
  1012.  
  1013. #define INTERNET_OPTION_OFFLINE_MODE            26
  1014. #define INTERNET_OPTION_CACHE_STREAM_HANDLE     27
  1015. #define INTERNET_OPTION_USERNAME                28
  1016. #define INTERNET_OPTION_PASSWORD                29
  1017. #define INTERNET_OPTION_ASYNC                   30
  1018. #define INTERNET_OPTION_SECURITY_FLAGS          31
  1019. #define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT    32
  1020. #define INTERNET_OPTION_DATAFILE_NAME           33
  1021. #define INTERNET_OPTION_URL                     34
  1022. #define INTERNET_OPTION_SECURITY_CERTIFICATE    35
  1023. #define INTERNET_OPTION_SECURITY_KEY_BITNESS    36
  1024. #define INTERNET_OPTION_REFRESH                 37
  1025. #define INTERNET_OPTION_PROXY                   38
  1026. #define INTERNET_OPTION_SETTINGS_CHANGED        39
  1027. #define INTERNET_OPTION_VERSION                 40
  1028. #define INTERNET_OPTION_USER_AGENT              41
  1029.  
  1030. #define INTERNET_FIRST_OPTION                   INTERNET_OPTION_CALLBACK
  1031. #define INTERNET_LAST_OPTION                    INTERNET_OPTION_USER_AGENT
  1032.  
  1033. //
  1034. // values for INTERNET_OPTION_PRIORITY
  1035. //
  1036.  
  1037. #define INTERNET_PRIORITY_FOREGROUND            1000
  1038.  
  1039. //
  1040. // handle types
  1041. //
  1042.  
  1043. #define INTERNET_HANDLE_TYPE_INTERNET           1
  1044. #define INTERNET_HANDLE_TYPE_CONNECT_FTP        2
  1045. #define INTERNET_HANDLE_TYPE_CONNECT_HTTP       4
  1046. #define INTERNET_HANDLE_TYPE_FTP_FIND           5
  1047. #define INTERNET_HANDLE_TYPE_FTP_FIND_HTML      6
  1048. #define INTERNET_HANDLE_TYPE_FTP_FILE           7
  1049. #define INTERNET_HANDLE_TYPE_FTP_FILE_HTML      8
  1050. #define INTERNET_HANDLE_TYPE_HTTP_REQUEST       13
  1051.  
  1052. //
  1053. // values for INTERNET_OPTION_SECURITY_FLAGS
  1054. //
  1055.  
  1056. #define SECURITY_FLAG_SECURE                    0x00000001 // can query only
  1057. #define SECURITY_FLAG_SSL                       0x00000002
  1058. #define SECURITY_FLAG_SSL3                      0x00000004
  1059. #define SECURITY_FLAG_PCT                       0x00000008
  1060. #define SECURITY_FLAG_PCT4                      0x00000010
  1061. #define SECURITY_FLAG_IETFSSL4                  0x00000020
  1062.  
  1063. #define SECURITY_FLAG_40BIT                     0x10000000
  1064. #define SECURITY_FLAG_128BIT                    0x20000000
  1065. #define SECURITY_FLAG_56BIT                     0x40000000
  1066. #define SECURITY_FLAG_UNKNOWNBIT                0x80000000
  1067. #define SECURITY_FLAG_NORMALBITNESS             SECURITY_FLAG_40BIT
  1068.  
  1069. #define SECURITY_FLAG_IGNORE_CERT_CN_INVALID    INTERNET_FLAG_IGNORE_CERT_CN_INVALID
  1070. #define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID  INTERNET_FLAG_IGNORE_CERT_DATE_INVALID
  1071. #define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS  INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
  1072. #define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP   INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP
  1073.  
  1074. INTERNETAPI
  1075. BOOL
  1076. WINAPI
  1077. InternetGetLastResponseInfoA(
  1078.     OUT LPDWORD lpdwError,
  1079.     OUT LPSTR lpszBuffer OPTIONAL,
  1080.     IN OUT LPDWORD lpdwBufferLength
  1081.     );
  1082. INTERNETAPI
  1083. BOOL
  1084. WINAPI
  1085. InternetGetLastResponseInfoW(
  1086.     OUT LPDWORD lpdwError,
  1087.     OUT LPWSTR lpszBuffer OPTIONAL,
  1088.     IN OUT LPDWORD lpdwBufferLength
  1089.     );
  1090. #ifdef UNICODE
  1091. #define InternetGetLastResponseInfo  InternetGetLastResponseInfoW
  1092. #else
  1093. #define InternetGetLastResponseInfo  InternetGetLastResponseInfoA
  1094. #endif // !UNICODE
  1095.  
  1096. //
  1097. // callback function for InternetSetStatusCallback
  1098. //
  1099.  
  1100. typedef
  1101. VOID
  1102. (CALLBACK * INTERNET_STATUS_CALLBACK)(
  1103.     IN HINTERNET hInternet,
  1104.     IN DWORD dwContext,
  1105.     IN DWORD dwInternetStatus,
  1106.     IN LPVOID lpvStatusInformation OPTIONAL,
  1107.     IN DWORD dwStatusInformationLength
  1108.     );
  1109.  
  1110. typedef INTERNET_STATUS_CALLBACK * LPINTERNET_STATUS_CALLBACK;
  1111.  
  1112. INTERNETAPI
  1113. INTERNET_STATUS_CALLBACK
  1114. WINAPI
  1115. InternetSetStatusCallback(
  1116.     IN HINTERNET hInternet,
  1117.     IN INTERNET_STATUS_CALLBACK lpfnInternetCallback
  1118.     );
  1119.  
  1120. //
  1121. // status manifests for Internet status callback
  1122. //
  1123.  
  1124. #define INTERNET_STATUS_RESOLVING_NAME          10
  1125. #define INTERNET_STATUS_NAME_RESOLVED           11
  1126. #define INTERNET_STATUS_CONNECTING_TO_SERVER    20
  1127. #define INTERNET_STATUS_CONNECTED_TO_SERVER     21
  1128. #define INTERNET_STATUS_SENDING_REQUEST         30
  1129. #define INTERNET_STATUS_REQUEST_SENT            31
  1130. #define INTERNET_STATUS_RECEIVING_RESPONSE      40
  1131. #define INTERNET_STATUS_RESPONSE_RECEIVED       41
  1132. #define INTERNET_STATUS_CTL_RESPONSE_RECEIVED   42
  1133. #define INTERNET_STATUS_PREFETCH                43
  1134. #define INTERNET_STATUS_CLOSING_CONNECTION      50
  1135. #define INTERNET_STATUS_CONNECTION_CLOSED       51
  1136. #define INTERNET_STATUS_HANDLE_CREATED          60
  1137. #define INTERNET_STATUS_HANDLE_CLOSING          70
  1138. #define INTERNET_STATUS_REQUEST_COMPLETE        100
  1139. #define INTERNET_STATUS_REDIRECT                110
  1140.  
  1141. //
  1142. // if the following value is returned by InternetSetStatusCallback, then
  1143. // probably an invalid (non-code) address was supplied for the callback
  1144. //
  1145.  
  1146. #define INTERNET_INVALID_STATUS_CALLBACK        ((INTERNET_STATUS_CALLBACK)(-1L))
  1147.  
  1148. // @CESYSGEN IF WININET_INETFTP
  1149.  
  1150. //
  1151. // FTP
  1152. //
  1153.  
  1154. //
  1155. // manifests
  1156. //
  1157.  
  1158. #define FTP_TRANSFER_TYPE_UNKNOWN   0x00000000
  1159. #define FTP_TRANSFER_TYPE_ASCII     0x00000001
  1160. #define FTP_TRANSFER_TYPE_BINARY    0x00000002
  1161.  
  1162. #define FTP_TRANSFER_TYPE_MASK      (FTP_TRANSFER_TYPE_ASCII | FTP_TRANSFER_TYPE_BINARY)
  1163.  
  1164. //
  1165. // prototypes
  1166. //
  1167.  
  1168. INTERNETAPI
  1169. HINTERNET
  1170. WINAPI
  1171. FtpFindFirstFileA(
  1172.     IN HINTERNET hConnect,
  1173.     IN LPCSTR lpszSearchFile OPTIONAL,
  1174.     OUT LPWIN32_FIND_DATAA lpFindFileData OPTIONAL,
  1175.     IN DWORD dwFlags,
  1176.     IN DWORD dwContext
  1177.     );
  1178. INTERNETAPI
  1179. HINTERNET
  1180. WINAPI
  1181. FtpFindFirstFileW(
  1182.     IN HINTERNET hConnect,
  1183.     IN LPCWSTR lpszSearchFile OPTIONAL,
  1184.     OUT LPWIN32_FIND_DATAW lpFindFileData OPTIONAL,
  1185.     IN DWORD dwFlags,
  1186.     IN DWORD dwContext
  1187.     );
  1188. #ifdef UNICODE
  1189. #define FtpFindFirstFile  FtpFindFirstFileW
  1190. #else
  1191. #define FtpFindFirstFile  FtpFindFirstFileA
  1192. #endif // !UNICODE
  1193.  
  1194. INTERNETAPI
  1195. BOOL
  1196. WINAPI
  1197. FtpGetFileA(
  1198.     IN HINTERNET hConnect,
  1199.     IN LPCSTR lpszRemoteFile,
  1200.     IN LPCSTR lpszNewFile,
  1201.     IN BOOL fFailIfExists,
  1202.     IN DWORD dwFlagsAndAttributes,
  1203.     IN DWORD dwFlags,
  1204.     IN DWORD dwContext
  1205.     );
  1206. INTERNETAPI
  1207. BOOL
  1208. WINAPI
  1209. FtpGetFileW(
  1210.     IN HINTERNET hConnect,
  1211.     IN LPCWSTR lpszRemoteFile,
  1212.     IN LPCWSTR lpszNewFile,
  1213.     IN BOOL fFailIfExists,
  1214.     IN DWORD dwFlagsAndAttributes,
  1215.     IN DWORD dwFlags,
  1216.     IN DWORD dwContext
  1217.     );
  1218. #ifdef UNICODE
  1219. #define FtpGetFile  FtpGetFileW
  1220. #else
  1221. #define FtpGetFile  FtpGetFileA
  1222. #endif // !UNICODE
  1223.  
  1224. INTERNETAPI
  1225. BOOL
  1226. WINAPI
  1227. FtpPutFileA(
  1228.     IN HINTERNET hConnect,
  1229.     IN LPCSTR lpszLocalFile,
  1230.     IN LPCSTR lpszNewRemoteFile,
  1231.     IN DWORD dwFlags,
  1232.     IN DWORD dwContext
  1233.     );
  1234. INTERNETAPI
  1235. BOOL
  1236. WINAPI
  1237. FtpPutFileW(
  1238.     IN HINTERNET hConnect,
  1239.     IN LPCWSTR lpszLocalFile,
  1240.     IN LPCWSTR lpszNewRemoteFile,
  1241.     IN DWORD dwFlags,
  1242.     IN DWORD dwContext
  1243.     );
  1244. #ifdef UNICODE
  1245. #define FtpPutFile  FtpPutFileW
  1246. #else
  1247. #define FtpPutFile  FtpPutFileA
  1248. #endif // !UNICODE
  1249.  
  1250. INTERNETAPI
  1251. BOOL
  1252. WINAPI
  1253. FtpDeleteFileA(
  1254.     IN HINTERNET hConnect,
  1255.     IN LPCSTR lpszFileName
  1256.     );
  1257. INTERNETAPI
  1258. BOOL
  1259. WINAPI
  1260. FtpDeleteFileW(
  1261.     IN HINTERNET hConnect,
  1262.     IN LPCWSTR lpszFileName
  1263.     );
  1264. #ifdef UNICODE
  1265. #define FtpDeleteFile  FtpDeleteFileW
  1266. #else
  1267. #define FtpDeleteFile  FtpDeleteFileA
  1268. #endif // !UNICODE
  1269.  
  1270. INTERNETAPI
  1271. BOOL
  1272. WINAPI
  1273. FtpRenameFileA(
  1274.     IN HINTERNET hConnect,
  1275.     IN LPCSTR lpszExisting,
  1276.     IN LPCSTR lpszNew
  1277.     );
  1278. INTERNETAPI
  1279. BOOL
  1280. WINAPI
  1281. FtpRenameFileW(
  1282.     IN HINTERNET hConnect,
  1283.     IN LPCWSTR lpszExisting,
  1284.     IN LPCWSTR lpszNew
  1285.     );
  1286. #ifdef UNICODE
  1287. #define FtpRenameFile  FtpRenameFileW
  1288. #else
  1289. #define FtpRenameFile  FtpRenameFileA
  1290. #endif // !UNICODE
  1291.  
  1292. INTERNETAPI
  1293. HINTERNET
  1294. WINAPI
  1295. FtpOpenFileA(
  1296.     IN HINTERNET hConnect,
  1297.     IN LPCSTR lpszFileName,
  1298.     IN DWORD dwAccess,
  1299.     IN DWORD dwFlags,
  1300.     IN DWORD dwContext
  1301.     );
  1302. INTERNETAPI
  1303. HINTERNET
  1304. WINAPI
  1305. FtpOpenFileW(
  1306.     IN HINTERNET hConnect,
  1307.     IN LPCWSTR lpszFileName,
  1308.     IN DWORD dwAccess,
  1309.     IN DWORD dwFlags,
  1310.     IN DWORD dwContext
  1311.     );
  1312. #ifdef UNICODE
  1313. #define FtpOpenFile  FtpOpenFileW
  1314. #else
  1315. #define FtpOpenFile  FtpOpenFileA
  1316. #endif // !UNICODE
  1317.  
  1318. INTERNETAPI
  1319. BOOL
  1320. WINAPI
  1321. FtpCreateDirectoryA(
  1322.     IN HINTERNET hConnect,
  1323.     IN LPCSTR lpszDirectory
  1324.     );
  1325. INTERNETAPI
  1326. BOOL
  1327. WINAPI
  1328. FtpCreateDirectoryW(
  1329.     IN HINTERNET hConnect,
  1330.     IN LPCWSTR lpszDirectory
  1331.     );
  1332. #ifdef UNICODE
  1333. #define FtpCreateDirectory  FtpCreateDirectoryW
  1334. #else
  1335. #define FtpCreateDirectory  FtpCreateDirectoryA
  1336. #endif // !UNICODE
  1337.  
  1338. INTERNETAPI
  1339. BOOL
  1340. WINAPI
  1341. FtpRemoveDirectoryA(
  1342.     IN HINTERNET hConnect,
  1343.     IN LPCSTR lpszDirectory
  1344.     );
  1345. INTERNETAPI
  1346. BOOL
  1347. WINAPI
  1348. FtpRemoveDirectoryW(
  1349.     IN HINTERNET hConnect,
  1350.     IN LPCWSTR lpszDirectory
  1351.     );
  1352. #ifdef UNICODE
  1353. #define FtpRemoveDirectory  FtpRemoveDirectoryW
  1354. #else
  1355. #define FtpRemoveDirectory  FtpRemoveDirectoryA
  1356. #endif // !UNICODE
  1357.  
  1358. INTERNETAPI
  1359. BOOL
  1360. WINAPI
  1361. FtpSetCurrentDirectoryA(
  1362.     IN HINTERNET hConnect,
  1363.     IN LPCSTR lpszDirectory
  1364.     );
  1365. INTERNETAPI
  1366. BOOL
  1367. WINAPI
  1368. FtpSetCurrentDirectoryW(
  1369.     IN HINTERNET hConnect,
  1370.     IN LPCWSTR lpszDirectory
  1371.     );
  1372. #ifdef UNICODE
  1373. #define FtpSetCurrentDirectory  FtpSetCurrentDirectoryW
  1374. #else
  1375. #define FtpSetCurrentDirectory  FtpSetCurrentDirectoryA
  1376. #endif // !UNICODE
  1377.  
  1378. INTERNETAPI
  1379. BOOL
  1380. WINAPI
  1381. FtpGetCurrentDirectoryA(
  1382.     IN HINTERNET hConnect,
  1383.     OUT LPSTR lpszCurrentDirectory,
  1384.     IN OUT LPDWORD lpdwCurrentDirectory
  1385.     );
  1386. INTERNETAPI
  1387. BOOL
  1388. WINAPI
  1389. FtpGetCurrentDirectoryW(
  1390.     IN HINTERNET hConnect,
  1391.     OUT LPWSTR lpszCurrentDirectory,
  1392.     IN OUT LPDWORD lpdwCurrentDirectory
  1393.     );
  1394. #ifdef UNICODE
  1395. #define FtpGetCurrentDirectory  FtpGetCurrentDirectoryW
  1396. #else
  1397. #define FtpGetCurrentDirectory  FtpGetCurrentDirectoryA
  1398. #endif // !UNICODE
  1399.  
  1400. INTERNETAPI
  1401. BOOL
  1402. WINAPI
  1403. FtpCommandA(
  1404.     IN HINTERNET hConnect,
  1405.     IN BOOL fExpectResponse,
  1406.     IN DWORD dwFlags,
  1407.     IN LPCSTR lpszCommand,
  1408.     IN DWORD dwContext
  1409.     );
  1410. INTERNETAPI
  1411. BOOL
  1412. WINAPI
  1413. FtpCommandW(
  1414.     IN HINTERNET hConnect,
  1415.     IN BOOL fExpectResponse,
  1416.     IN DWORD dwFlags,
  1417.     IN LPCWSTR lpszCommand,
  1418.     IN DWORD dwContext
  1419.     );
  1420. #ifdef UNICODE
  1421. #define FtpCommand  FtpCommandW
  1422. #else
  1423. #define FtpCommand  FtpCommandA
  1424. #endif // !UNICODE
  1425.  
  1426. // @CESYSGEN ENDIF
  1427.  
  1428. //
  1429. // HTTP
  1430. //
  1431.  
  1432. //
  1433. // manifests
  1434. //
  1435.  
  1436. //
  1437. // the default major/minor HTTP version numbers
  1438. //
  1439.  
  1440. #define HTTP_MAJOR_VERSION      1
  1441. #define HTTP_MINOR_VERSION      0
  1442.  
  1443. #define HTTP_VERSION            TEXT("HTTP/1.0")
  1444.  
  1445. //
  1446. // HttpQueryInfo info levels. Generally, there is one info level
  1447. // for each potential RFC822/HTTP/MIME header that an HTTP server
  1448. // may send as part of a request response.
  1449. //
  1450. // The HTTP_QUERY_RAW_HEADERS info level is provided for clients
  1451. // that choose to perform their own header parsing.
  1452. //
  1453.  
  1454. #define HTTP_QUERY_MIME_VERSION                 0
  1455. #define HTTP_QUERY_CONTENT_TYPE                 1
  1456. #define HTTP_QUERY_CONTENT_TRANSFER_ENCODING    2
  1457. #define HTTP_QUERY_CONTENT_ID                   3
  1458. #define HTTP_QUERY_CONTENT_DESCRIPTION          4
  1459. #define HTTP_QUERY_CONTENT_LENGTH               5
  1460. #define HTTP_QUERY_CONTENT_LANGUAGE             6
  1461. #define HTTP_QUERY_ALLOW                        7
  1462. #define HTTP_QUERY_PUBLIC                       8
  1463. #define HTTP_QUERY_DATE                         9
  1464. #define HTTP_QUERY_EXPIRES                      10
  1465. #define HTTP_QUERY_LAST_MODIFIED                11
  1466. #define HTTP_QUERY_MESSAGE_ID                   12
  1467. #define HTTP_QUERY_URI                          13
  1468. #define HTTP_QUERY_DERIVED_FROM                 14
  1469. #define HTTP_QUERY_COST                         15
  1470. #define HTTP_QUERY_LINK                         16
  1471. #define HTTP_QUERY_PRAGMA                       17
  1472. #define HTTP_QUERY_VERSION                      18  // special: part of status line
  1473. #define HTTP_QUERY_STATUS_CODE                  19  // special: part of status line
  1474. #define HTTP_QUERY_STATUS_TEXT                  20  // special: part of status line
  1475. #define HTTP_QUERY_RAW_HEADERS                  21  // special: all headers as ASCIIZ
  1476. #define HTTP_QUERY_RAW_HEADERS_CRLF             22  // special: all headers
  1477. #define HTTP_QUERY_CONNECTION                   23
  1478. #define HTTP_QUERY_ACCEPT                       24
  1479. #define HTTP_QUERY_ACCEPT_CHARSET               25
  1480. #define HTTP_QUERY_ACCEPT_ENCODING              26
  1481. #define HTTP_QUERY_ACCEPT_LANGUAGE              27
  1482. #define HTTP_QUERY_AUTHORIZATION                28
  1483. #define HTTP_QUERY_CONTENT_ENCODING             29
  1484. #define HTTP_QUERY_FORWARDED                    30
  1485. #define HTTP_QUERY_FROM                         31
  1486. #define HTTP_QUERY_IF_MODIFIED_SINCE            32
  1487. #define HTTP_QUERY_LOCATION                     33
  1488. #define HTTP_QUERY_ORIG_URI                     34
  1489. #define HTTP_QUERY_REFERER                      35
  1490. #define HTTP_QUERY_RETRY_AFTER                  36
  1491. #define HTTP_QUERY_SERVER                       37
  1492. #define HTTP_QUERY_TITLE                        38
  1493. #define HTTP_QUERY_USER_AGENT                   39
  1494. #define HTTP_QUERY_WWW_AUTHENTICATE             40
  1495. #define HTTP_QUERY_PROXY_AUTHENTICATE           41
  1496. #define HTTP_QUERY_ACCEPT_RANGES                42
  1497. #define HTTP_QUERY_SET_COOKIE                   43
  1498. #define HTTP_QUERY_COOKIE                       44
  1499. #define HTTP_QUERY_REQUEST_METHOD               45  // special: GET/POST etc.
  1500.  
  1501. #define HTTP_QUERY_MAX                          45
  1502.  
  1503. //
  1504. // HTTP_QUERY_CUSTOM - if this special value is supplied as the dwInfoLevel
  1505. // parameter of HttpQueryInfo() then the lpBuffer parameter contains the name
  1506. // of the header we are to query
  1507. //
  1508.  
  1509. #define HTTP_QUERY_CUSTOM                       65535
  1510.  
  1511. //
  1512. // HTTP_QUERY_FLAG_REQUEST_HEADERS - if this bit is set in the dwInfoLevel
  1513. // parameter of HttpQueryInfo() then the request headers will be queried for the
  1514. // request information
  1515. //
  1516.  
  1517. #define HTTP_QUERY_FLAG_REQUEST_HEADERS         0x80000000
  1518.  
  1519. //
  1520. // HTTP_QUERY_FLAG_SYSTEMTIME - if this bit is set in the dwInfoLevel parameter
  1521. // of HttpQueryInfo() AND the header being queried contains date information,
  1522. // e.g. the "Expires:" header then lpBuffer will contain a SYSTEMTIME structure
  1523. // containing the date and time information converted from the header string
  1524. //
  1525.  
  1526. #define HTTP_QUERY_FLAG_SYSTEMTIME              0x40000000
  1527.  
  1528. //
  1529. // HTTP_QUERY_FLAG_NUMBER - if this bit is set in the dwInfoLevel parameter of
  1530. // HttpQueryInfo(), then the value of the header will be converted to a number
  1531. // before being returned to the caller, if applicable
  1532. //
  1533.  
  1534. #define HTTP_QUERY_FLAG_NUMBER                  0x20000000
  1535.  
  1536. //
  1537. // HTTP_QUERY_FLAG_COALESCE - combine the values from several headers of the
  1538. // same name into the output buffer
  1539. //
  1540.  
  1541. #define HTTP_QUERY_FLAG_COALESCE                0x10000000
  1542.  
  1543. #define HTTP_QUERY_MODIFIER_FLAGS_MASK          (HTTP_QUERY_FLAG_REQUEST_HEADERS    \
  1544.                                                 | HTTP_QUERY_FLAG_SYSTEMTIME        \
  1545.                                                 | HTTP_QUERY_FLAG_NUMBER            \
  1546.                                                 | HTTP_QUERY_FLAG_COALESCE          \
  1547.                                                 )
  1548.  
  1549. #define HTTP_QUERY_HEADER_MASK                  (~HTTP_QUERY_MODIFIER_FLAGS_MASK)
  1550.  
  1551. //
  1552. // HTTP Response Status Codes:
  1553. //
  1554.  
  1555. #define HTTP_STATUS_OK              200     // request completed
  1556. #define HTTP_STATUS_CREATED         201     // object created, reason = new URI
  1557. #define HTTP_STATUS_ACCEPTED        202     // async completion (TBS)
  1558. #define HTTP_STATUS_PARTIAL         203     // partial completion
  1559. #define HTTP_STATUS_NO_CONTENT      204     // no info to return
  1560.  
  1561. #define HTTP_STATUS_AMBIGUOUS       300     // server couldn't decide what to return
  1562. #define HTTP_STATUS_MOVED           301     // object permanently moved
  1563. #define HTTP_STATUS_REDIRECT        302     // object temporarily moved
  1564. #define HTTP_STATUS_REDIRECT_METHOD 303     // redirection w/ new access method
  1565. #define HTTP_STATUS_NOT_MODIFIED    304     // if-modified-since was not modified
  1566.  
  1567. #define HTTP_STATUS_BAD_REQUEST     400     // invalid syntax
  1568. #define HTTP_STATUS_DENIED          401     // access denied
  1569. #define HTTP_STATUS_PAYMENT_REQ     402     // payment required
  1570. #define HTTP_STATUS_FORBIDDEN       403     // request forbidden
  1571. #define HTTP_STATUS_NOT_FOUND       404     // object not found
  1572. #define HTTP_STATUS_BAD_METHOD      405     // method is not allowed
  1573. #define HTTP_STATUS_NONE_ACCEPTABLE 406     // no response acceptable to client found
  1574. #define HTTP_STATUS_PROXY_AUTH_REQ  407     // proxy authentication required
  1575. #define HTTP_STATUS_REQUEST_TIMEOUT 408     // server timed out waiting for request
  1576. #define HTTP_STATUS_CONFLICT        409     // user should resubmit with more info
  1577. #define HTTP_STATUS_GONE            410     // the resource is no longer available
  1578. #define HTTP_STATUS_AUTH_REFUSED    411     // couldn't authorize client
  1579.  
  1580. #define HTTP_STATUS_SERVER_ERROR    500     // internal server error
  1581. #define HTTP_STATUS_NOT_SUPPORTED   501     // required not supported
  1582. #define HTTP_STATUS_BAD_GATEWAY     502     // error response received from gateway
  1583. #define HTTP_STATUS_SERVICE_UNAVAIL 503     // temporarily overloaded
  1584. #define HTTP_STATUS_GATEWAY_TIMEOUT 504     // timed out waiting for gateway
  1585.  
  1586. //
  1587. // prototypes
  1588. //
  1589.  
  1590. INTERNETAPI
  1591. HINTERNET
  1592. WINAPI
  1593. HttpOpenRequestA(
  1594.     IN HINTERNET hConnect,
  1595.     IN LPCSTR lpszVerb,
  1596.     IN LPCSTR lpszObjectName,
  1597.     IN LPCSTR lpszVersion,
  1598.     IN LPCSTR lpszReferrer OPTIONAL,
  1599.     IN LPCSTR FAR * lplpszAcceptTypes OPTIONAL,
  1600.     IN DWORD dwFlags,
  1601.     IN DWORD dwContext
  1602.     );
  1603. INTERNETAPI
  1604. HINTERNET
  1605. WINAPI
  1606. HttpOpenRequestW(
  1607.     IN HINTERNET hConnect,
  1608.     IN LPCWSTR lpszVerb,
  1609.     IN LPCWSTR lpszObjectName,
  1610.     IN LPCWSTR lpszVersion,
  1611.     IN LPCWSTR lpszReferrer OPTIONAL,
  1612.     IN LPCWSTR FAR * lplpszAcceptTypes OPTIONAL,
  1613.     IN DWORD dwFlags,
  1614.     IN DWORD dwContext
  1615.     );
  1616. #ifdef UNICODE
  1617. #define HttpOpenRequest  HttpOpenRequestW
  1618. #else
  1619. #define HttpOpenRequest  HttpOpenRequestA
  1620. #endif // !UNICODE
  1621.  
  1622. INTERNETAPI
  1623. BOOL
  1624. WINAPI
  1625. HttpAddRequestHeadersA(
  1626.     IN HINTERNET hRequest,
  1627.     IN LPCSTR lpszHeaders,
  1628.     IN DWORD dwHeadersLength,
  1629.     IN DWORD dwModifiers
  1630.     );
  1631. INTERNETAPI
  1632. BOOL
  1633. WINAPI
  1634. HttpAddRequestHeadersW(
  1635.     IN HINTERNET hRequest,
  1636.     IN LPCWSTR lpszHeaders,
  1637.     IN DWORD dwHeadersLength,
  1638.     IN DWORD dwModifiers
  1639.     );
  1640. #ifdef UNICODE
  1641. #define HttpAddRequestHeaders  HttpAddRequestHeadersW
  1642. #else
  1643. #define HttpAddRequestHeaders  HttpAddRequestHeadersA
  1644. #endif // !UNICODE
  1645.  
  1646. //
  1647. // values for dwModifiers parameter of HttpAddRequestHeaders()
  1648. //
  1649.  
  1650. #define HTTP_ADDREQ_INDEX_MASK      0x0000FFFF
  1651. #define HTTP_ADDREQ_FLAGS_MASK      0xFFFF0000
  1652.  
  1653. //
  1654. // HTTP_ADDREQ_FLAG_ADD_IF_NEW - the header will only be added if it doesn't
  1655. // already exist
  1656. //
  1657.  
  1658. #define HTTP_ADDREQ_FLAG_ADD_IF_NEW 0x10000000
  1659.  
  1660. //
  1661. // HTTP_ADDREQ_FLAG_ADD - if HTTP_ADDREQ_FLAG_REPLACE is set but the header is
  1662. // not found then if this flag is set, the header is added anyway, so long as
  1663. // there is a valid header-value
  1664. //
  1665.  
  1666. #define HTTP_ADDREQ_FLAG_ADD        0x20000000
  1667.  
  1668. //
  1669. // HTTP_ADDREQ_FLAG_COALESCE - coalesce headers with same name. e.g.
  1670. // "Accept: text/*" and "Accept: audio/*" with this flag results in a single
  1671. // header: "Accept: text/*, audio/*"
  1672. //
  1673.  
  1674. //
  1675. // HTTP_ADDREQ_FLAG_COALESCE - coalesce headers with same name. e.g.
  1676. // "Accept: text/*" and "Accept: audio/*" with this flag results in a single
  1677. // header: "Accept: text/*, audio/*"
  1678. //
  1679.  
  1680. #define HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA       0x40000000
  1681.  
  1682. #define HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON   0x01000000
  1683.  
  1684. #define HTTP_ADDREQ_FLAG_COALESCE                  HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
  1685.  
  1686. //
  1687. // HTTP_ADDREQ_FLAG_REPLACE - replaces the specified header. Only one header can
  1688. // be supplied in the buffer. If the header to be replaced is not the first
  1689. // in a list of headers with the same name, then the relative index should be
  1690. // supplied in the low 8 bits of the dwModifiers parameter. If the header-value
  1691. // part is missing, then the header is removed
  1692. //
  1693.  
  1694. #define HTTP_ADDREQ_FLAG_REPLACE    0x80000000
  1695.  
  1696. INTERNETAPI
  1697. BOOL
  1698. WINAPI
  1699. HttpSendRequestA(
  1700.     IN HINTERNET hRequest,
  1701.     IN LPCSTR lpszHeaders OPTIONAL,
  1702.     IN DWORD dwHeadersLength,
  1703.     IN LPVOID lpOptional OPTIONAL,
  1704.     IN DWORD dwOptionalLength
  1705.     );
  1706. INTERNETAPI
  1707. BOOL
  1708. WINAPI
  1709. HttpSendRequestW(
  1710.     IN HINTERNET hRequest,
  1711.     IN LPCWSTR lpszHeaders OPTIONAL,
  1712.     IN DWORD dwHeadersLength,
  1713.     IN LPVOID lpOptional OPTIONAL,
  1714.     IN DWORD dwOptionalLength
  1715.     );
  1716. #ifdef UNICODE
  1717. #define HttpSendRequest  HttpSendRequestW
  1718. #else
  1719. #define HttpSendRequest  HttpSendRequestA
  1720. #endif // !UNICODE
  1721.  
  1722. INTERNETAPI
  1723. BOOL
  1724. WINAPI
  1725. HttpQueryInfoA(
  1726.     IN HINTERNET hRequest,
  1727.     IN DWORD dwInfoLevel,
  1728.     IN OUT LPVOID lpBuffer OPTIONAL,
  1729.     IN OUT LPDWORD lpdwBufferLength,
  1730.     IN OUT LPDWORD lpdwIndex OPTIONAL
  1731.     );
  1732. INTERNETAPI
  1733. BOOL
  1734. WINAPI
  1735. HttpQueryInfoW(
  1736.     IN HINTERNET hRequest,
  1737.     IN DWORD dwInfoLevel,
  1738.     IN OUT LPVOID lpBuffer OPTIONAL,
  1739.     IN OUT LPDWORD lpdwBufferLength,
  1740.     IN OUT LPDWORD lpdwIndex OPTIONAL
  1741.     );
  1742. #ifdef UNICODE
  1743. #define HttpQueryInfo  HttpQueryInfoW
  1744. #else
  1745. #define HttpQueryInfo  HttpQueryInfoA
  1746. #endif // !UNICODE
  1747.  
  1748. //
  1749. // offline browsing
  1750. //
  1751.  
  1752. INTERNETAPI
  1753. DWORD
  1754. WINAPI
  1755. InternetAttemptConnect(
  1756.     DWORD dwReserved
  1757.     );
  1758.  
  1759. //
  1760. // Internet UI
  1761. //
  1762.  
  1763. //
  1764. // InternetErrorDlg - Provides UI for certain Errors.
  1765. //
  1766.  
  1767. #define FLAGS_ERROR_UI_FILTER_FOR_ERRORS        0x01
  1768. #define FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS     0x02
  1769. #define FLAGS_ERROR_UI_FLAGS_GENERATE_DATA      0x04
  1770. #define FLAGS_ERROR_UI_FLAGS_NO_UI              0x08
  1771.  
  1772. INTERNETAPI
  1773. DWORD
  1774. WINAPI
  1775. InternetErrorDlg(
  1776.      IN HWND hWnd,
  1777.      IN OUT HINTERNET hRequest,
  1778.      IN DWORD dwError,
  1779.      IN DWORD dwFlags,
  1780.      IN OUT LPVOID * lppvData
  1781.      );
  1782.  
  1783. INTERNETAPI
  1784. DWORD
  1785. WINAPI
  1786. InternetConfirmZoneCrossing(
  1787.      IN HWND hWnd,
  1788.      IN LPSTR szUrlPrev,
  1789.      IN LPSTR szUrlNew,
  1790.      IN BOOL bPost
  1791.      );
  1792.  
  1793. //#if !defined(_WINERROR_)
  1794.  
  1795. //
  1796. // Internet API error returns
  1797. //
  1798.  
  1799. #define INTERNET_ERROR_BASE                     12000
  1800.  
  1801. #define ERROR_INTERNET_OUT_OF_HANDLES           (INTERNET_ERROR_BASE + 1)
  1802. #define ERROR_INTERNET_TIMEOUT                  (INTERNET_ERROR_BASE + 2)
  1803. #define ERROR_INTERNET_EXTENDED_ERROR           (INTERNET_ERROR_BASE + 3)
  1804. #define ERROR_INTERNET_INTERNAL_ERROR           (INTERNET_ERROR_BASE + 4)
  1805. #define ERROR_INTERNET_INVALID_URL              (INTERNET_ERROR_BASE + 5)
  1806. #define ERROR_INTERNET_UNRECOGNIZED_SCHEME      (INTERNET_ERROR_BASE + 6)
  1807. #define ERROR_INTERNET_NAME_NOT_RESOLVED        (INTERNET_ERROR_BASE + 7)
  1808. #define ERROR_INTERNET_PROTOCOL_NOT_FOUND       (INTERNET_ERROR_BASE + 8)
  1809. #define ERROR_INTERNET_INVALID_OPTION           (INTERNET_ERROR_BASE + 9)
  1810. #define ERROR_INTERNET_BAD_OPTION_LENGTH        (INTERNET_ERROR_BASE + 10)
  1811. #define ERROR_INTERNET_OPTION_NOT_SETTABLE      (INTERNET_ERROR_BASE + 11)
  1812. #define ERROR_INTERNET_SHUTDOWN                 (INTERNET_ERROR_BASE + 12)
  1813. #define ERROR_INTERNET_INCORRECT_USER_NAME      (INTERNET_ERROR_BASE + 13)
  1814. #define ERROR_INTERNET_INCORRECT_PASSWORD       (INTERNET_ERROR_BASE + 14)
  1815. #define ERROR_INTERNET_LOGIN_FAILURE            (INTERNET_ERROR_BASE + 15)
  1816. #define ERROR_INTERNET_INVALID_OPERATION        (INTERNET_ERROR_BASE + 16)
  1817. #define ERROR_INTERNET_OPERATION_CANCELLED      (INTERNET_ERROR_BASE + 17)
  1818. #define ERROR_INTERNET_INCORRECT_HANDLE_TYPE    (INTERNET_ERROR_BASE + 18)
  1819. #define ERROR_INTERNET_INCORRECT_HANDLE_STATE   (INTERNET_ERROR_BASE + 19)
  1820. #define ERROR_INTERNET_NOT_PROXY_REQUEST        (INTERNET_ERROR_BASE + 20)
  1821. #define ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND (INTERNET_ERROR_BASE + 21)
  1822. #define ERROR_INTERNET_BAD_REGISTRY_PARAMETER   (INTERNET_ERROR_BASE + 22)
  1823. #define ERROR_INTERNET_NO_DIRECT_ACCESS         (INTERNET_ERROR_BASE + 23)
  1824. #define ERROR_INTERNET_NO_CONTEXT               (INTERNET_ERROR_BASE + 24)
  1825. #define ERROR_INTERNET_NO_CALLBACK              (INTERNET_ERROR_BASE + 25)
  1826. #define ERROR_INTERNET_REQUEST_PENDING          (INTERNET_ERROR_BASE + 26)
  1827. #define ERROR_INTERNET_INCORRECT_FORMAT         (INTERNET_ERROR_BASE + 27)
  1828. #define ERROR_INTERNET_ITEM_NOT_FOUND           (INTERNET_ERROR_BASE + 28)
  1829. #define ERROR_INTERNET_CANNOT_CONNECT           (INTERNET_ERROR_BASE + 29)
  1830. #define ERROR_INTERNET_CONNECTION_ABORTED       (INTERNET_ERROR_BASE + 30)
  1831. #define ERROR_INTERNET_CONNECTION_RESET         (INTERNET_ERROR_BASE + 31)
  1832. #define ERROR_INTERNET_FORCE_RETRY              (INTERNET_ERROR_BASE + 32)
  1833. #define ERROR_INTERNET_INVALID_PROXY_REQUEST    (INTERNET_ERROR_BASE + 33)
  1834. #define ERROR_INTERNET_NEED_UI                  (INTERNET_ERROR_BASE + 34)
  1835.  
  1836. #define ERROR_INTERNET_HANDLE_EXISTS            (INTERNET_ERROR_BASE + 36)
  1837. #define ERROR_INTERNET_SEC_CERT_DATE_INVALID    (INTERNET_ERROR_BASE + 37)
  1838. #define ERROR_INTERNET_SEC_CERT_CN_INVALID      (INTERNET_ERROR_BASE + 38)
  1839. #define ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR   (INTERNET_ERROR_BASE + 39)
  1840. #define ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR   (INTERNET_ERROR_BASE + 40)
  1841. #define ERROR_INTERNET_MIXED_SECURITY           (INTERNET_ERROR_BASE + 41)
  1842. #define ERROR_INTERNET_CHG_POST_IS_NON_SECURE   (INTERNET_ERROR_BASE + 42)
  1843. #define ERROR_INTERNET_POST_IS_NON_SECURE       (INTERNET_ERROR_BASE + 43)
  1844. #define ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED  (INTERNET_ERROR_BASE + 44)
  1845. #define ERROR_INTERNET_INVALID_CA               (INTERNET_ERROR_BASE + 45)
  1846. #define ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP    (INTERNET_ERROR_BASE + 46)
  1847. #define ERROR_INTERNET_ASYNC_THREAD_FAILED      (INTERNET_ERROR_BASE + 47)
  1848. #define ERROR_INTERNET_REDIRECT_SCHEME_CHANGE   (INTERNET_ERROR_BASE + 48)
  1849.  
  1850. //
  1851. // FTP API errors
  1852. //
  1853.  
  1854. #define ERROR_FTP_TRANSFER_IN_PROGRESS          (INTERNET_ERROR_BASE + 110)
  1855. #define ERROR_FTP_DROPPED                       (INTERNET_ERROR_BASE + 111)
  1856. #define ERROR_FTP_NO_PASSIVE_MODE               (INTERNET_ERROR_BASE + 112)
  1857.  
  1858. //
  1859. // HTTP API errors
  1860. //
  1861.  
  1862. #define ERROR_HTTP_HEADER_NOT_FOUND             (INTERNET_ERROR_BASE + 150)
  1863. #define ERROR_HTTP_DOWNLEVEL_SERVER             (INTERNET_ERROR_BASE + 151)
  1864. #define ERROR_HTTP_INVALID_SERVER_RESPONSE      (INTERNET_ERROR_BASE + 152)
  1865. #define ERROR_HTTP_INVALID_HEADER               (INTERNET_ERROR_BASE + 153)
  1866. #define ERROR_HTTP_INVALID_QUERY_REQUEST        (INTERNET_ERROR_BASE + 154)
  1867. #define ERROR_HTTP_HEADER_ALREADY_EXISTS        (INTERNET_ERROR_BASE + 155)
  1868. #define ERROR_HTTP_REDIRECT_FAILED              (INTERNET_ERROR_BASE + 156)
  1869. #define ERROR_HTTP_NOT_REDIRECTED               (INTERNET_ERROR_BASE + 160) 
  1870.  
  1871. #define ERROR_INTERNET_SECURITY_CHANNEL_ERROR   (INTERNET_ERROR_BASE + 157) 
  1872. #define ERROR_INTERNET_UNABLE_TO_CACHE_FILE     (INTERNET_ERROR_BASE + 158) 
  1873. #define ERROR_INTERNET_TCPIP_NOT_INSTALLED      (INTERNET_ERROR_BASE + 159) 
  1874.  
  1875. #define INTERNET_ERROR_LAST                     ERROR_INTERNET_TCPIP_NOT_INSTALLED
  1876.  
  1877. //#endif // !defined(_WINERROR_)
  1878.  
  1879. #if defined(__cplusplus)
  1880. }
  1881. #endif
  1882.  
  1883. /*
  1884.  * Return packing to whatever it was before we
  1885.  * entered this file
  1886.  */
  1887. #pragma pack(pop, wininet)
  1888.  
  1889. #endif // !defined(_WININET_)
  1890.