compile insert msWin_WinInet_Equates
/*
   ** Copyright (C) 2013-2023 Revelation Software Inc. All Rights Reserved **
   
   Author    Mr C
   Date      Nov 2018
   Purpose   Equates for use with the WinInet library
         
   Comments
   
   
   Amended  Date       Reason
   =======  ====       ======
   Mr C     21 Nov 23  Added WinInet Error constants 
   Mr C     09 Nov 18  Added HTTP constants

*/
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
#ifndef _MSWIN_WININET_EQUATES_
#define _MSWIN_WININET_EQUATES_
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////

   equ INTERNET_INVALID_PORT_NUMBERS$         to 0           ; * // use the protocol-specific default

   equ INTERNET_DEFAULT_FTP_PORT$             to 21          ; * // default for FTP servers
   equ INTERNET_DEFAULT_GOPHER_PORT$          to 70          ; * //    "     "  gopher "
   equ INTERNET_DEFAULT_HTTP_PORT$            to 80          ; * //    "     "  HTTP   "
   equ INTERNET_DEFAULT_HTTPS_PORT$           to 443         ; * //    "     "  HTTPS  "
   equ INTERNET_DEFAULT_SOCKS_PORT$           to 1080        ; * // default for SOCKS firewall servers.   
   
   * // maximum field lengths (arbitrary)
   equ INTERNET_MAX_HOST_NAME_LENGTH$         to 256
   equ INTERNET_MAX_USER_NAME_LENGTH$         to 128
   equ INTERNET_MAX_PASSWORD_LENGTH$          to 128
   equ INTERNET_MAX_PORT_NUMBER_LENGTH$       to 5           ; * // INTERNET_PORT is unsigned short
   equ INTERNET_MAX_PORT_NUMBER_VALUE$        to 65535       ; * // maximum unsigned short value
   equ INTERNET_MAX_PATH_LENGTH$              to 2048
   equ INTERNET_MAX_SCHEME_LENGTH$            to 32          ; * // longest protocol name length
   equ INTERNET_MAX_URL_LENGTH$               to ( INTERNET_MAX_SCHEME_LENGTH$ + len( "://" ) + INTERNET_MAX_PATH_LENGTH$ )
   
   * // access types for InternetOpen()
   equ INTERNET_OPEN_TYPE_PRECONFIG$                    to 0 ; * // use registry configuration
   equ INTERNET_OPEN_TYPE_DIRECT$                       to 1 ; * // direct to net
   equ INTERNET_OPEN_TYPE_PROXY$                        to 3 ; * // via named proxy
   equ INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY$  to 4 ; * // prevent using java/script/INS
   
   * // service types for InternetConnect()
   equ INTERNET_SERVICE_FTP$                  to 1
   equ INTERNET_SERVICE_GOPHER$               to 2
   equ INTERNET_SERVICE_HTTP$                 to 3
   
   * // values returned by InternetQueryOption() with 
   * // INTERNET_OPTION_KEEP_CONNECTION:
   equ INTERNET_KEEP_ALIVE_UNKNOWN$           to (-1)
   equ INTERNET_KEEP_ALIVE_ENABLED$           to 1
   equ INTERNET_KEEP_ALIVE_DISABLED$          to 0

  * // flags returned by InternetQueryOption() with 
  * // INTERNET_OPTION_REQUEST_FLAGS
   equ INTERNET_REQFLAG_FROM_CACHE$           to 0x00000001  ; * // response came from cache
   equ INTERNET_REQFLAG_ASYNC$                to 0x00000002  ; * // request was made asynchronously
   equ INTERNET_REQFLAG_VIA_PROXY$            to 0x00000004  ; * // request was made via a proxy
   equ INTERNET_REQFLAG_NO_HEADERS$           to 0x00000008  ; * // orginal response contained no headers
   equ INTERNET_REQFLAG_PA$SSIVE$             to 0x00000010  ; * // FTP: passive-mode connection
   equ INTERNET_REQFLAG_CACHE_WRITE_DISABLED$ to 0x00000040  ; * // HTTPS: this request not cacheable
   equ INTERNET_REQFLAG_NET_TIMEOUT$          to 0x00000080  ; * // w/ _FROM_CACHE: net request timed out

   * // flags for IDN enable/disable via INTERNET_OPTION_IDN
   equ INTERNET_FLAG_IDN_DIRECT$              to 0x00000001  ; * // IDN enabled for direct connections
   equ INTERNET_FLAG_IDN_PROXY$               to 0x00000002  ; * // IDN enabled for proxy

   * // flags common to open functions (not InternetOpen()):
   equ INTERNET_FLAG_RELOAD$                  to 0x80000000  ; * // retrieve the original item

   * // flags for InternetOpenUrl():
   equ INTERNET_FLAG_RAW_DATA$                to 0x40000000  ; * // FTP/gopher find: receive the item as raw (structured) data
   equ INTERNET_FLAG_EXISTING_CONNECT$        to 0x20000000  ; * // FTP: use existing InternetConnect handle for server if possible

   * // flags for InternetOpen():
   equ INTERNET_FLAG_ASYNC$                   to 0x10000000  ; * // this request is asynchronous (where supported)

   * // protocol-specific flags:
   equ INTERNET_FLAG_PASSIVE$                 to 0x08000000  ; * // used for FTP connections

   * // additional cache flags
   equ INTERNET_FLAG_NO_CACHE_WRITE$          to 0x04000000  ; * // don't write this item to the cache
   equ INTERNET_FLAG_DONT_CACHE$              to INTERNET_FLAG_NO_CACHE_WRITE$
   equ INTERNET_FLAG_MAKE_PERSISTENT$         to 0x02000000  ; * // make this item persistent in cache
   equ INTERNET_FLAG_FROM_CACHE$              to 0x01000000  ; * // use offline semantics
   equ INTERNET_FLAG_OFFLINE$                 to INTERNET_FLAG_FROM_CACHE$

   * // additional flags
   equ INTERNET_FLAG_SECURE$                  to 0x00800000  ; * // use PCT/SSL if applicable (HTTP)
   equ INTERNET_FLAG_KEEP_CONNECTION$         to 0x00400000  ; * // use keep-alive semantics
   equ INTERNET_FLAG_NO_AUTO_REDIRECT$        to 0x00200000  ; * // don't handle redirections automatically
   equ INTERNET_FLAG_READ_PREFETCH$           to 0x00100000  ; * // do background read prefetch
   equ INTERNET_FLAG_NO_COOKIES$              to 0x00080000  ; * // no automatic cookie handling
   equ INTERNET_FLAG_NO_AUTH$                 to 0x00040000  ; * // no automatic authentication handling
   equ INTERNET_FLAG_RESTRICTED_ZONE$         to 0x00020000  ; * // apply restricted zone policies for cookies, auth
   equ INTERNET_FLAG_CACHE_IF_NET_FAIL$       to 0x00010000  ; * // return cache file if net request fails

   * // Security Ignore Flags, Allow HttpOpenRequest to overide
   * // Secure Channel (SSL/PCT) failures of the following types.
   equ INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP$  to 0x00008000 ; * // ex: https: to http:
   equ INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS$ to 0x00004000 ; * // ex: http: to https:
   equ INTERNET_FLAG_IGNORE_CERT_DATE_INVALID$ to 0x00002000 ; * // expired X509 Cert.
   equ INTERNET_FLAG_IGNORE_CERT_CN_INVALID$   to 0x00001000 ; * // bad common name in X509 Cert.

   * // more caching flags
   equ INTERNET_FLAG_RESYNCHRONIZE$           to 0x00000800  ; * // asking wininet to update an item if it is newer
   equ INTERNET_FLAG_HYPERLINK$               to 0x00000400  ; * // asking wininet to do hyperlinking semantic which works right for scripts
   equ INTERNET_FLAG_NO_UI$                   to 0x00000200  ; * // no cookie popup
   equ INTERNET_FLAG_PRAGMA_NOCACHE$          to 0x00000100  ; * // asking wininet to add "pragma: no-cache"
   equ INTERNET_FLAG_CACHE_ASYNC$             to 0x00000080  ; * // ok to perform lazy cache-write
   equ INTERNET_FLAG_FORMS_SUBMIT$            to 0x00000040  ; * // this is a forms submit
   equ INTERNET_FLAG_FWD_BACK$                to 0x00000020  ; * // fwd-back button op
   equ INTERNET_FLAG_NEED_FILE$               to 0x00000010  ; * // need a file for this request
   equ INTERNET_FLAG_MUST_CACHE_REQUEST$      to INTERNET_FLAG_NEED_FILE$
   
   equ WININET_API_FLAG_ASYNC$                to 0x00000001  ; // force async operation
   equ WININET_API_FLAG_SYNC$                 to 0x00000004  ; // force sync operation
   equ WININET_API_FLAG_USE_CONTEXT$          to 0x00000008  ; // use value supplied in dwContext (even if 0)
   
   equ INTERNET_NO_CALLBACK$                  to 0
   
   ////////////////////////////////////////////////////////////////////////////
   
   // flags for FTP
   
   equ FTP_TRANSFER_TYPE_UNKNOWN$             to 0x00000000
   equ FTP_TRANSFER_TYPE_ASCII$               to 0x00000001
   equ FTP_TRANSFER_TYPE_BINARY$              to 0x00000002
   equ FTP_TRANSFER_TYPE_MASK$                to ( FTP_TRANSFER_TYPE_ASCII$ + FTP_TRANSFER_TYPE_BINARY$ )
   
   equ INTERNET_FLAG_TRANSFER_ASCII$          to FTP_TRANSFER_TYPE_ASCII$ 
   equ INTERNET_FLAG_TRANSFER_BINARY$         to FTP_TRANSFER_TYPE_BINARY$
   
   ////////////////////////////////////////////////////////////////////////////
   
   // flags for HttpAddRequestHeaders
   
   equ HTTP_ADDREQ_INDEX_MASK$                to 0x0000FFFF
   equ HTTP_ADDREQ_FLAGS_MASK$                to 0xFFFF0000
   
   equ HTTP_ADDREQ_FLAG_ADD$                  to 0x20000000
   equ HTTP_ADDREQ_FLAG_ADD_IF_NEW$           to 0x10000000
   
   equ HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA$  to 0x40000000
   equ HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON$ to 0x01000000
   equ HTTP_ADDREQ_FLAG_COALESCE$             to HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA$
   
   // flags for HttpSendRequestEx(), HttpEndRequest()
   equ HSR_ASYNC$                             to WININET_API_FLAG_ASYNC$         ; // force async
   equ HSR_SYNC$                              to WININET_API_FLAG_SYNC$          ; // force sync
   equ HSR_USE_CONTEXT$                       to WININET_API_FLAG_USE_CONTEXT$   ; // use dwContext value
   equ HSR_INITIATE$                          to 0x00000008                      ; // iterative operation (completed by HttpEndRequest)
   equ HSR_DOWNLOAD$                          to 0x00000010                      ; // download to file
   equ HSR_CHUNKED$                           to 0x00000020                      ; // operation is send of chunked data
   
   ////////////////////////////////////////////////////////////////////////////

   // Internet status callback code
   equ INTERNET_STATUS_RESOLVING_NAME$          to 10
   equ INTERNET_STATUS_NAME_RESOLVED$           to 11
   equ INTERNET_STATUS_CONNECTING_TO_SERVER$    to 20
   equ INTERNET_STATUS_CONNECTED_TO_SERVER$     to 21
   equ INTERNET_STATUS_SENDING_REQUEST$         to 30
   equ INTERNET_STATUS_REQUEST_SENT$            to 31
   equ INTERNET_STATUS_RECEIVING_RESPONSE$      to 40
   equ INTERNET_STATUS_RESPONSE_RECEIVED$       to 41
   equ INTERNET_STATUS_CTL_RESPONSE_RECEIVED$   to 42
   equ INTERNET_STATUS_PREFETCH$                to 43
   equ INTERNET_STATUS_CLOSING_CONNECTION$      to 50
   equ INTERNET_STATUS_CONNECTION_CLOSED$       to 51
   equ INTERNET_STATUS_HANDLE_CREATED$          to 60
   equ INTERNET_STATUS_HANDLE_CLOSING$          to 70
   equ INTERNET_STATUS_DETECTING_PROXY$         to 80
   equ INTERNET_STATUS_REQUEST_COMPLETE$        to 100
   equ INTERNET_STATUS_REDIRECT$                to 110
   equ INTERNET_STATUS_INTERMEDIATE_RESPONSE$   to 120
   equ INTERNET_STATUS_USER_INPUT_REQUIRED$     to 140
   equ INTERNET_STATUS_STATE_CHANGE$            to 200
   equ INTERNET_STATUS_COOKIE_SENT$             to 320
   equ INTERNET_STATUS_COOKIE_RECEIVED$         to 321
   equ INTERNET_STATUS_PRIVACY_IMPACTED$        to 324
   equ INTERNET_STATUS_P3P_HEADER$              to 325
   equ INTERNET_STATUS_P3P_POLICYREF$           to 326
   equ INTERNET_STATUS_COOKIE_HISTORY$          to 327
 
   /////////////////////////////////////////////////////////////////////////////
  
   // WinInet Errors
   equ ERROR_INSUFFICIENT_BUFFER$                  to 122
   
   equ INTERNET_ERROR_BASE$                        to 12000
   
   equ ERROR_INTERNET_OUT_OF_HANDLES$              to 12001
   equ ERROR_INTERNET_TIMEOUT$                     to 12002
   equ ERROR_INTERNET_EXTENDED_ERROR$              to 12003
   equ ERROR_INTERNET_INTERNAL_ERROR$              to 12004
   equ ERROR_INTERNET_INVALID_URL$                 to 12005
   equ ERROR_INTERNET_UNRECOGNIZED_SCHEME$         to 12006
   equ ERROR_INTERNET_NAME_NOT_RESOLVED$           to 12007
   equ ERROR_INTERNET_PROTOCOL_NOT_FOUND$          to 12008
   equ ERROR_INTERNET_INVALID_OPTION$              to 12009
   equ ERROR_INTERNET_BAD_OPTION_LENGTH$           to 12010
   equ ERROR_INTERNET_OPTION_NOT_SETTABLE$         to 12011
   equ ERROR_INTERNET_SHUTDOWN$                    to 12012
   equ ERROR_INTERNET_INCORRECT_USER_NAME$         to 12013
   equ ERROR_INTERNET_INCORRECT_PASSWORD$          to 12014
   equ ERROR_INTERNET_LOGIN_FAILURE$               to 12015
   equ ERROR_INTERNET_INVALID_OPERATION$           to 12016
   equ ERROR_INTERNET_OPERATION_CANCELLED$         to 12017
   equ ERROR_INTERNET_INCORRECT_HANDLE_TYPE$       to 12018
   equ ERROR_INTERNET_INCORRECT_HANDLE_STATE$      to 12019
   equ ERROR_INTERNET_NOT_PROXY_REQUEST$           to 12020
   equ ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND$    to 12021
   equ ERROR_INTERNET_BAD_REGISTRY_PARAMETER$      to 12022
   equ ERROR_INTERNET_NO_DIRECT_ACCESS$            to 12023
   equ ERROR_INTERNET_NO_CONTEXT$                  to 12024
   equ ERROR_INTERNET_NO_CALLBACK$                 to 12025
   equ ERROR_INTERNET_REQUEST_PENDING$             to 12026
   equ ERROR_INTERNET_INCORRECT_FORMAT$            to 12027
   equ ERROR_INTERNET_ITEM_NOT_FOUND$              to 12028
   equ ERROR_INTERNET_CANNOT_CONNECT$              to 12029
   equ ERROR_INTERNET_CONNECTION_ABORTED$          to 12030
   equ ERROR_INTERNET_CONNECTION_RESET$            to 12031
   equ ERROR_INTERNET_FORCE_RETRY$                 to 12032
   equ ERROR_INTERNET_INVALID_PROXY_REQUEST$       to 12033
   equ ERROR_INTERNET_NEED_UI$                     to 12034
   equ ERROR_INTERNET_HANDLE_EXISTS$               to 12036
   equ ERROR_INTERNET_SEC_CERT_DATE_INVALID$       to 12037
   equ ERROR_INTERNET_SEC_CERT_CN_INVALID$         to 12038
   equ ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR$      to 12039
   equ ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR$      to 12040
   equ ERROR_INTERNET_MIXED_SECURITY$              to 12041
   equ ERROR_INTERNET_CHG_POST_IS_NON_SECURE$      to 12042
   equ ERROR_INTERNET_POST_IS_NON_SECURE$          to 12043
   equ ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED$     to 12044
   equ ERROR_INTERNET_INVALID_CA$                  to 12045
   equ ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP$       to 12046
   equ ERROR_INTERNET_ASYNC_THREAD_FAILED$         to 12047
   equ ERROR_INTERNET_REDIRECT_SCHEME_CHANGE$      to 12048
   equ ERROR_INTERNET_DIALOG_PENDING$              to 12049
   equ ERROR_INTERNET_RETRY_DIALOG$                to 12050
   equ ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR$     to 12052
   equ ERROR_INTERNET_INSERT_CDROM$                to 12053
   equ ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED$       to 12054
   equ ERROR_INTERNET_SEC_CERT_ERRORS$             to 12055
   equ ERROR_INTERNET_SEC_CERT_NO_REV$             to 12056
   equ ERROR_INTERNET_SEC_CERT_REV_FAILED$         to 12057
   equ ERROR_HTTP_HSTS_REDIRECT_REQUIRED$          to 12060
   equ ERROR_INTERNET_SEC_CERT_WEAK_SIGNATURE$     to 12062
   
   equ ERROR_FTP_TRANSFER_IN_PROGRESS$             to 12110
   equ ERROR_FTP_DROPPED$                          to 12111
   equ ERROR_FTP_NO_PASSIVE_MODE$                  to 12112
   
   equ ERROR_HTTP_HEADER_NOT_FOUND$                to 12150
   equ ERROR_HTTP_DOWNLEVEL_SERVER$                to 12151
   equ ERROR_HTTP_INVALID_SERVER_RESPONSE$         to 12152
   equ ERROR_HTTP_INVALID_HEADER$                  to 12153
   equ ERROR_HTTP_INVALID_QUERY_REQUEST$           to 12154
   equ ERROR_HTTP_HEADER_ALREADY_EXISTS$           to 12155
   equ ERROR_HTTP_REDIRECT_FAILED$                 to 12156
   equ ERROR_HTTP_NOT_REDIRECTED$                  to 12160
   equ ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION$       to 12161
   equ ERROR_HTTP_COOKIE_DECLINED$                 to 12162
   equ ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION$     to 12168

   equ ERROR_INTERNET_SECURITY_CHANNEL_ERROR$      to 12157
   equ ERROR_INTERNET_UNABLE_TO_CACHE_FILE$        to 12158
   equ ERROR_INTERNET_TCPIP_NOT_INSTALLED$         to 12159
   equ ERROR_INTERNET_DISCONNECTED$                to 12163
   equ ERROR_INTERNET_SERVER_UNREACHABLE$          to 12164
   equ ERROR_INTERNET_PROXY_SERVER_UNREACHABLE$    to 12165

   equ ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT$       to 12166
   equ ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT$   to 12167
   equ ERROR_INTERNET_SEC_INVALID_CERT$            to 12169
   equ ERROR_INTERNET_SEC_CERT_REVOKED$            to 12170
   equ ERROR_INTERNET_FAILED_DUETOSECURITYCHECK$   to 12171
   equ ERROR_INTERNET_NOT_INITIALIZED$             to 12172
   equ ERROR_INTERNET_NEED_MSN_SSPI_PKG$           to 12173
   equ ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY$ to 12174
   equ ERROR_INTERNET_DECODING_FAILED$             to 12175

   equ ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED_PROXY$ to 12187
   equ ERROR_INTERNET_SECURE_FAILURE_PROXY$        to 12188
   equ ERROR_INTERNET_HTTP_PROTOCOL_MISMATCH$      to 12190
   
   equ INTERNET_ERROR_LAST$                        to 12190
   
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
#endif
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
