home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Visual Basic.60 / COMMON / TOOLS / VB / WININET / WININET.TXT
Encoding:
Text File  |  1998-05-06  |  21.4 KB  |  429 lines

  1. ' ------------------------------------------------------------------------
  2. '
  3. '    WININET.TXT -- WININET API Declarations for Visual Basic
  4. '              Copyright (C) 1998 Microsoft Corporation
  5. '
  6. '  This file is required for the Visual Basic 6.0 version of the APILoader.
  7. '  This file is backwards compatible with previous releases
  8. '  of the APILoader with the exception that Constants are no longer declared
  9. '  as Global or Public in this file.
  10. '
  11. '  This file contains only the Const, Type,
  12. '  and Declare statements for the WININET APIs.
  13. '
  14. '  You have a royalty-free right to use, modify, reproduce and distribute
  15. '  this file (and/or any modified version) in any way you find useful,
  16. '  provided that you agree that Microsoft has no warranty, obligation or
  17. '  liability for its contents.  Refer to the Microsoft Windows Programmer's
  18. '  Reference for further information.
  19. '
  20. ' ------------------------------------------------------------------------
  21.  
  22. Const MAX_PATH = 260
  23. Const NO_ERROR = 0
  24. Const FILE_ATTRIBUTE_READONLY = &H1
  25. Const FILE_ATTRIBUTE_HIDDEN = &H2
  26. Const FILE_ATTRIBUTE_SYSTEM = &H4
  27. Const FILE_ATTRIBUTE_DIRECTORY = &H10
  28. Const FILE_ATTRIBUTE_ARCHIVE = &H20
  29. Const FILE_ATTRIBUTE_NORMAL = &H80
  30. Const FILE_ATTRIBUTE_TEMPORARY = &H100
  31. Const FILE_ATTRIBUTE_COMPRESSED = &H800
  32. Const FILE_ATTRIBUTE_OFFLINE = &H1000
  33.  
  34.  
  35. Type FILETIME
  36.         dwLowDateTime As Long
  37.         dwHighDateTime As Long
  38. End Type
  39.  
  40. Type WIN32_FIND_DATA
  41.         dwFileAttributes As Long
  42.         ftCreationTime As FILETIME
  43.         ftLastAccessTime As FILETIME
  44.         ftLastWriteTime As FILETIME
  45.         nFileSizeHigh As Long
  46.         nFileSizeLow As Long
  47.         dwReserved0 As Long
  48.         dwReserved1 As Long
  49.         cFileName As String * MAX_PATH
  50.         cAlternate As String * 14
  51. End Type
  52.  
  53.  
  54. Const ERROR_NO_MORE_FILES = 18
  55.  
  56. Declare Function InternetFindNextFile Lib "wininet.dll" Alias "InternetFindNextFileA" (ByVal hFind As Long, lpvFindData As WIN32_FIND_DATA) As Long
  57.     
  58. Declare Function FtpFindFirstFile Lib "wininet.dll" Alias "FtpFindFirstFileA" (ByVal hFtpSession As Long, ByVal lpszSearchFile As String, lpFindFileData As WIN32_FIND_DATA, ByVal dwFlags As Long, ByVal dwContent As Long) As Long
  59.  
  60. Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" (ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, ByVal lpszNewFile As String, ByVal fFailIfExists As Boolean, ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean
  61.  
  62. Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hFtpSession As Long, ByVal lpszLocalFile As String, ByVal lpszRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean
  63.  
  64. Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias "FtpSetCurrentDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean
  65. Declare Function FtpGetCurrentDirectory Lib "wininet.dll" Alias "FtpGetCurrentDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory As String, ByRef lpdwCurrentDirectory As Long) As Boolean
  66.  
  67. ' Initializes an application's use of the Win32 Internet functions
  68. Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
  69.  
  70. ' User agent constant.
  71. Const scUserAgent = "vb wininet"
  72.  
  73. ' Use registry access settings.
  74. Const INTERNET_OPEN_TYPE_PRECONFIG = 0
  75. Const INTERNET_OPEN_TYPE_DIRECT = 1
  76. Const INTERNET_OPEN_TYPE_PROXY = 3
  77. Const INTERNET_INVALID_PORT_NUMBER = 0
  78.  
  79. Const FTP_TRANSFER_TYPE_ASCII = &H1
  80. Const FTP_TRANSFER_TYPE_BINARY = &H2
  81.  
  82. ' Opens a HTTP session for a given site.
  83. Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" (ByVal hInternetSession As Long, ByVal sServerName As String, ByVal nServerPort As Integer, ByVal sUsername As String, ByVal sPassword As String, ByVal lService As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
  84.                 
  85. Declare Function InternetGetLastResponseInfo Lib "wininet.dll" Alias "InternetGetLastResponseInfoA" (lpdwError As Long, ByVal lpszBuffer As String, lpdwBufferLength As Long) As Boolean
  86.  
  87. ' Number of the TCP/IP port on the server to connect to.
  88. Const INTERNET_DEFAULT_FTP_PORT = 21
  89. Const INTERNET_DEFAULT_GOPHER_PORT = 70
  90. Const INTERNET_DEFAULT_HTTP_PORT = 80
  91. Const INTERNET_DEFAULT_HTTPS_PORT = 443
  92. Const INTERNET_DEFAULT_SOCKS_PORT = 1080
  93.  
  94. Const INTERNET_OPTION_CONNECT_TIMEOUT = 2
  95. Const INTERNET_OPTION_RECEIVE_TIMEOUT = 6
  96. Const INTERNET_OPTION_SEND_TIMEOUT = 5
  97.  
  98. Const INTERNET_OPTION_USERNAME = 28
  99. Const INTERNET_OPTION_PASSWORD = 29
  100. Const INTERNET_OPTION_PROXY_USERNAME = 43
  101. Const INTERNET_OPTION_PROXY_PASSWORD = 44
  102.  
  103. ' Type of service to access.
  104. Const INTERNET_SERVICE_FTP = 1
  105. Const INTERNET_SERVICE_GOPHER = 2
  106. Const INTERNET_SERVICE_HTTP = 3
  107.  
  108. ' Opens an HTTP request handle.
  109. Declare Function HttpOpenRequest Lib "wininet.dll" Alias "HttpOpenRequestA" (ByVal hHttpSession As Long, ByVal sVerb As String, ByVal sObjectName As String, ByVal sVersion As String, ByVal sReferer As String, ByVal something As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
  110.  
  111. Const GENERIC_READ = &H80000000
  112. Const GENERIC_WRITE = &H40000000
  113.  
  114. ' Sends the specified request to the HTTP server.
  115. Declare Function HttpSendRequest Lib "wininet.dll" Alias "HttpSendRequestA" (ByVal hHttpRequest As Long, ByVal sHeaders As String, ByVal lHeadersLength As Long, ByVal sOptional As String, ByVal lOptionalLength As Long) As Integer
  116.  
  117. ' Queries for information about an HTTP request.
  118. Declare Function HttpQueryInfo Lib "wininet.dll" Alias "HttpQueryInfoA" (ByVal hHttpRequest As Long, ByVal lInfoLevel As Long, ByRef sBuffer As Any, ByRef lBufferLength As Long, ByRef lIndex As Long) As Integer
  119.  
  120. ' InternetErrorDlg
  121. Declare Function InternetErrorDlg Lib "wininet.dll" (ByVal hWnd As Long, ByVal hInternet As Long, ByVal dwError As Long, ByVal dwFlags As Long, ByVal lppvData As Long) As Long
  122.  
  123. ' InternetErrorDlg constants
  124. Const FLAGS_ERROR_UI_FILTER_FOR_ERRORS = &H1
  125. Const FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS = &H2
  126. Const FLAGS_ERROR_UI_FLAGS_GENERATE_DATA = &H4
  127. Const FLAGS_ERROR_UI_FLAGS_NO_UI = &H8
  128. Const FLAGS_ERROR_UI_SERIALIZE_DIALOGS = &H10
  129.  
  130. Declare Function GetDesktopWindow Lib "user32.dll" () As Long
  131.  
  132. ' The possible values for the lInfoLevel parameter include:
  133. Const HTTP_QUERY_CONTENT_TYPE = 1
  134. Const HTTP_QUERY_CONTENT_LENGTH = 5
  135. Const HTTP_QUERY_EXPIRES = 10
  136. Const HTTP_QUERY_LAST_MODIFIED = 11
  137. Const HTTP_QUERY_PRAGMA = 17
  138. Const HTTP_QUERY_VERSION = 18
  139. Const HTTP_QUERY_STATUS_CODE = 19
  140. Const HTTP_QUERY_STATUS_TEXT = 20
  141. Const HTTP_QUERY_RAW_HEADERS = 21
  142. Const HTTP_QUERY_RAW_HEADERS_CRLF = 22
  143. Const HTTP_QUERY_FORWARDED = 30
  144. Const HTTP_QUERY_SERVER = 37
  145. Const HTTP_QUERY_USER_AGENT = 39
  146. Const HTTP_QUERY_SET_COOKIE = 43
  147. Const HTTP_QUERY_REQUEST_METHOD = 45
  148. Const HTTP_STATUS_DENIED = 401
  149. Const HTTP_STATUS_PROXY_AUTH_REQ = 407
  150.  
  151. ' Add this flag to the about flags to get request header.
  152. Const HTTP_QUERY_FLAG_REQUEST_HEADERS = &H80000000
  153. Const HTTP_QUERY_FLAG_NUMBER = &H20000000
  154.  
  155. ' Reads data from a handle opened by the HttpOpenRequest function.
  156. Declare Function InternetReadFile Lib "wininet.dll" (ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Integer
  157.  
  158. Type INTERNET_BUFFERS
  159.     dwStructSize As Long        ' used for API versioning. Set to sizeof(INTERNET_BUFFERS)
  160.     Next As Long                ' INTERNET_BUFFERS chain of buffers
  161.     lpcszHeader As Long       ' pointer to headers (may be NULL)
  162.     dwHeadersLength As Long     ' length of headers if not NULL
  163.     dwHeadersTotal As Long      ' size of headers if not enough buffer
  164.     lpvBuffer As Long           ' pointer to data buffer (may be NULL)
  165.     dwBufferLength As Long      ' length of data buffer if not NULL
  166.     dwBufferTotal As Long       ' total size of chunk, or content-length if not chunked
  167.     dwOffsetLow As Long         ' used for read-ranges (only used in HttpSendRequest2)
  168.     dwOffsetHigh As Long
  169. End Type
  170.  
  171. Declare Function HttpSendRequestEx Lib "wininet.dll" Alias "HttpSendRequestExA" (ByVal hHttpRequest As Long, lpBuffersIn As INTERNET_BUFFERS, ByVal lpBuffersOut As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
  172.  
  173. Declare Function HttpEndRequest Lib "wininet.dll" Alias "HttpEndRequestA" (ByVal hHttpRequest As Long, ByVal lpBuffersOut As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Long
  174.  
  175.  
  176. Declare Function InternetWriteFile Lib "wininet.dll" (ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumberOfBytesToRead As Long, lNumberOfBytesRead As Long) As Integer
  177.  
  178. Declare Function FtpOpenFile Lib "wininet.dll" Alias "FtpOpenFileA" (ByVal hFtpSession As Long, ByVal sFileName As String, ByVal lAccess As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
  179. Declare Function FtpDeleteFile Lib "wininet.dll" Alias "FtpDeleteFileA" (ByVal hFtpSession As Long, ByVal lpszFileName As String) As Boolean
  180. Declare Function InternetSetOption Lib "wininet.dll" Alias "InternetSetOptionA" (ByVal hInternet As Long, ByVal lOption As Long, ByRef sBuffer As Any, ByVal lBufferLength As Long) As Integer
  181. Declare Function InternetSetOptionStr Lib "wininet.dll" Alias "InternetSetOptionA" (ByVal hInternet As Long, ByVal lOption As Long, ByVal sBuffer As String, ByVal lBufferLength As Long) As Integer
  182.  
  183. ' Closes a single Internet handle or a subtree of Internet handles.
  184. Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long) As Integer
  185.  
  186. ' Queries an Internet option on the specified handle
  187. Declare Function InternetQueryOption Lib "wininet.dll" Alias "InternetQueryOptionA" (ByVal hInternet As Long, ByVal lOption As Long, ByRef sBuffer As Any, ByRef lBufferLength As Long) As Integer
  188.  
  189. ' Returns the version number of Wininet.dll.
  190. Const INTERNET_OPTION_VERSION = 40
  191.  
  192. ' Contains the version number of the DLL that contains the Windows Internet
  193. ' functions (Wininet.dll). This structure is used when passing the
  194. ' INTERNET_OPTION_VERSION flag to the InternetQueryOption function.
  195. Type tWinInetDLLVersion
  196.     lMajorVersion As Long
  197.     lMinorVersion As Long
  198. End Type
  199.  
  200. ' Adds one or more HTTP request headers to the HTTP request handle.
  201. Declare Function HttpAddRequestHeaders Lib "wininet.dll" Alias "HttpAddRequestHeadersA" (ByVal hHttpRequest As Long, ByVal sHeaders As String, ByVal lHeadersLength As Long, ByVal lModifiers As Long) As Integer
  202.  
  203. ' Flags to modify the semantics of this function. Can be a combination of these values:
  204.  
  205. ' Adds the header only if it does not already exist; otherwise, an error is returned.
  206. Const HTTP_ADDREQ_FLAG_ADD_IF_NEW = &H10000000
  207.  
  208. ' Adds the header if it does not exist. Used with REPLACE.
  209. Const HTTP_ADDREQ_FLAG_ADD = &H20000000
  210.  
  211. ' Replaces or removes a header. If the header value is empty and the header is found,
  212. ' it is removed. If not empty, the header value is replaced
  213. Const HTTP_ADDREQ_FLAG_REPLACE = &H80000000
  214.  
  215. ' Internet Errors
  216. Const INTERNET_ERROR_BASE = 12000
  217.  
  218. Const ERROR_INTERNET_OUT_OF_HANDLES = (INTERNET_ERROR_BASE + 1)
  219. Const ERROR_INTERNET_TIMEOUT = (INTERNET_ERROR_BASE + 2)
  220. Const ERROR_INTERNET_EXTENDED_ERROR = (INTERNET_ERROR_BASE + 3)
  221. Const ERROR_INTERNET_INTERNAL_ERROR = (INTERNET_ERROR_BASE + 4)
  222. Const ERROR_INTERNET_INVALID_URL = (INTERNET_ERROR_BASE + 5)
  223. Const ERROR_INTERNET_UNRECOGNIZED_SCHEME = (INTERNET_ERROR_BASE + 6)
  224. Const ERROR_INTERNET_NAME_NOT_RESOLVED = (INTERNET_ERROR_BASE + 7)
  225. Const ERROR_INTERNET_PROTOCOL_NOT_FOUND = (INTERNET_ERROR_BASE + 8)
  226. Const ERROR_INTERNET_INVALID_OPTION = (INTERNET_ERROR_BASE + 9)
  227. Const ERROR_INTERNET_BAD_OPTION_LENGTH = (INTERNET_ERROR_BASE + 10)
  228. Const ERROR_INTERNET_OPTION_NOT_SETTABLE = (INTERNET_ERROR_BASE + 11)
  229. Const ERROR_INTERNET_SHUTDOWN = (INTERNET_ERROR_BASE + 12)
  230. Const ERROR_INTERNET_INCORRECT_USER_NAME = (INTERNET_ERROR_BASE + 13)
  231. Const ERROR_INTERNET_INCORRECT_PASSWORD = (INTERNET_ERROR_BASE + 14)
  232. Const ERROR_INTERNET_LOGIN_FAILURE = (INTERNET_ERROR_BASE + 15)
  233. Const ERROR_INTERNET_INVALID_OPERATION = (INTERNET_ERROR_BASE + 16)
  234. Const ERROR_INTERNET_OPERATION_CANCELLED = (INTERNET_ERROR_BASE + 17)
  235. Const ERROR_INTERNET_INCORRECT_HANDLE_TYPE = (INTERNET_ERROR_BASE + 18)
  236. Const ERROR_INTERNET_INCORRECT_HANDLE_STATE = (INTERNET_ERROR_BASE + 19)
  237. Const ERROR_INTERNET_NOT_PROXY_REQUEST = (INTERNET_ERROR_BASE + 20)
  238. Const ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND = (INTERNET_ERROR_BASE + 21)
  239. Const ERROR_INTERNET_BAD_REGISTRY_PARAMETER = (INTERNET_ERROR_BASE + 22)
  240. Const ERROR_INTERNET_NO_DIRECT_ACCESS = (INTERNET_ERROR_BASE + 23)
  241. Const ERROR_INTERNET_NO_CONTEXT = (INTERNET_ERROR_BASE + 24)
  242. Const ERROR_INTERNET_NO_CALLBACK = (INTERNET_ERROR_BASE + 25)
  243. Const ERROR_INTERNET_REQUEST_PENDING = (INTERNET_ERROR_BASE + 26)
  244. Const ERROR_INTERNET_INCORRECT_FORMAT = (INTERNET_ERROR_BASE + 27)
  245. Const ERROR_INTERNET_ITEM_NOT_FOUND = (INTERNET_ERROR_BASE + 28)
  246. Const ERROR_INTERNET_CANNOT_CONNECT = (INTERNET_ERROR_BASE + 29)
  247. Const ERROR_INTERNET_CONNECTION_ABORTED = (INTERNET_ERROR_BASE + 30)
  248. Const ERROR_INTERNET_CONNECTION_RESET = (INTERNET_ERROR_BASE + 31)
  249. Const ERROR_INTERNET_FORCE_RETRY = (INTERNET_ERROR_BASE + 32)
  250. Const ERROR_INTERNET_INVALID_PROXY_REQUEST = (INTERNET_ERROR_BASE + 33)
  251. Const ERROR_INTERNET_NEED_UI = (INTERNET_ERROR_BASE + 34)
  252.  
  253. Const ERROR_INTERNET_HANDLE_EXISTS = (INTERNET_ERROR_BASE + 36)
  254. Const ERROR_INTERNET_SEC_CERT_DATE_INVALID = (INTERNET_ERROR_BASE + 37)
  255. Const ERROR_INTERNET_SEC_CERT_CN_INVALID = (INTERNET_ERROR_BASE + 38)
  256. Const ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR = (INTERNET_ERROR_BASE + 39)
  257. Const ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR = (INTERNET_ERROR_BASE + 40)
  258. Const ERROR_INTERNET_MIXED_SECURITY = (INTERNET_ERROR_BASE + 41)
  259. Const ERROR_INTERNET_CHG_POST_IS_NON_SECURE = (INTERNET_ERROR_BASE + 42)
  260. Const ERROR_INTERNET_POST_IS_NON_SECURE = (INTERNET_ERROR_BASE + 43)
  261. Const ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED = (INTERNET_ERROR_BASE + 44)
  262. Const ERROR_INTERNET_INVALID_CA = (INTERNET_ERROR_BASE + 45)
  263. Const ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP = (INTERNET_ERROR_BASE + 46)
  264. Const ERROR_INTERNET_ASYNC_THREAD_FAILED = (INTERNET_ERROR_BASE + 47)
  265. Const ERROR_INTERNET_REDIRECT_SCHEME_CHANGE = (INTERNET_ERROR_BASE + 48)
  266. Const ERROR_INTERNET_DIALOG_PENDING = (INTERNET_ERROR_BASE + 49)
  267. Const ERROR_INTERNET_RETRY_DIALOG = (INTERNET_ERROR_BASE + 50)
  268. Const ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR = (INTERNET_ERROR_BASE + 52)
  269. Const ERROR_INTERNET_INSERT_CDROM = (INTERNET_ERROR_BASE + 53)
  270.  
  271. ' FTP API errors
  272.  
  273. Const ERROR_FTP_TRANSFER_IN_PROGRESS = (INTERNET_ERROR_BASE + 110)
  274. Const ERROR_FTP_DROPPED = (INTERNET_ERROR_BASE + 111)
  275. Const ERROR_FTP_NO_PASSIVE_MODE = (INTERNET_ERROR_BASE + 112)
  276.  
  277. ' gopher API errors
  278.  
  279. Const ERROR_GOPHER_PROTOCOL_ERROR = (INTERNET_ERROR_BASE + 130)
  280. Const ERROR_GOPHER_NOT_FILE = (INTERNET_ERROR_BASE + 131)
  281. Const ERROR_GOPHER_DATA_ERROR = (INTERNET_ERROR_BASE + 132)
  282. Const ERROR_GOPHER_END_OF_DATA = (INTERNET_ERROR_BASE + 133)
  283. Const ERROR_GOPHER_INVALID_LOCATOR = (INTERNET_ERROR_BASE + 134)
  284. Const ERROR_GOPHER_INCORRECT_LOCATOR_TYPE = (INTERNET_ERROR_BASE + 135)
  285. Const ERROR_GOPHER_NOT_GOPHER_PLUS = (INTERNET_ERROR_BASE + 136)
  286. Const ERROR_GOPHER_ATTRIBUTE_NOT_FOUND = (INTERNET_ERROR_BASE + 137)
  287. Const ERROR_GOPHER_UNKNOWN_LOCATOR = (INTERNET_ERROR_BASE + 138)
  288.  
  289. ' HTTP API errors
  290.  
  291. Const ERROR_HTTP_HEADER_NOT_FOUND = (INTERNET_ERROR_BASE + 150)
  292. Const ERROR_HTTP_DOWNLEVEL_SERVER = (INTERNET_ERROR_BASE + 151)
  293. Const ERROR_HTTP_INVALID_SERVER_RESPONSE = (INTERNET_ERROR_BASE + 152)
  294. Const ERROR_HTTP_INVALID_HEADER = (INTERNET_ERROR_BASE + 153)
  295. Const ERROR_HTTP_INVALID_QUERY_REQUEST = (INTERNET_ERROR_BASE + 154)
  296. Const ERROR_HTTP_HEADER_ALREADY_EXISTS = (INTERNET_ERROR_BASE + 155)
  297. Const ERROR_HTTP_REDIRECT_FAILED = (INTERNET_ERROR_BASE + 156)
  298. Const ERROR_HTTP_NOT_REDIRECTED = (INTERNET_ERROR_BASE + 160)
  299. Const ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION = (INTERNET_ERROR_BASE + 161)
  300. Const ERROR_HTTP_COOKIE_DECLINED = (INTERNET_ERROR_BASE + 162)
  301. Const ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION = (INTERNET_ERROR_BASE + 168)
  302.  
  303. ' additional Internet API error codes
  304.  
  305. Const ERROR_INTERNET_SECURITY_CHANNEL_ERROR = (INTERNET_ERROR_BASE + 157)
  306. Const ERROR_INTERNET_UNABLE_TO_CACHE_FILE = (INTERNET_ERROR_BASE + 158)
  307. Const ERROR_INTERNET_TCPIP_NOT_INSTALLED = (INTERNET_ERROR_BASE + 159)
  308. Const ERROR_INTERNET_DISCONNECTED = (INTERNET_ERROR_BASE + 163)
  309. Const ERROR_INTERNET_SERVER_UNREACHABLE = (INTERNET_ERROR_BASE + 164)
  310. Const ERROR_INTERNET_PROXY_SERVER_UNREACHABLE = (INTERNET_ERROR_BASE + 165)
  311.  
  312. Const ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT = (INTERNET_ERROR_BASE + 166)
  313. Const ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT = (INTERNET_ERROR_BASE + 167)
  314. Const ERROR_INTERNET_SEC_INVALID_CERT = (INTERNET_ERROR_BASE + 169)
  315. Const ERROR_INTERNET_SEC_CERT_REVOKED = (INTERNET_ERROR_BASE + 170)
  316.  
  317. ' InternetAutodial specific errors
  318.  
  319. Const ERROR_INTERNET_FAILED_DUETOSECURITYCHECK = (INTERNET_ERROR_BASE + 171)
  320.  
  321. Const INTERNET_ERROR_LAST = ERROR_INTERNET_FAILED_DUETOSECURITYCHECK
  322.  
  323. '
  324. ' flags common to open functions (not InternetOpen()):
  325. '
  326.  
  327. Const INTERNET_FLAG_RELOAD = &H80000000             ' retrieve the original item
  328.  
  329. '
  330. ' flags for InternetOpenUrl():
  331. '
  332.  
  333. Const INTERNET_FLAG_RAW_DATA = &H40000000           ' FTP/gopher find: receive the item as raw (structured) data
  334. Const INTERNET_FLAG_EXISTING_CONNECT = &H20000000   ' FTP: use existing InternetConnect handle for server if possible
  335.  
  336. '
  337. ' flags for InternetOpen():
  338. '
  339.  
  340. Const INTERNET_FLAG_ASYNC = &H10000000              ' this request is asynchronous (where supported)
  341.  
  342. '
  343. ' protocol-specific flags:
  344. '
  345.  
  346. Const INTERNET_FLAG_PASSIVE = &H8000000             ' used for FTP connections
  347.  
  348. '
  349. ' additional cache flags
  350. '
  351.  
  352. Const INTERNET_FLAG_NO_CACHE_WRITE = &H4000000      ' don't write this item to the cache
  353. Const INTERNET_FLAG_DONT_CACHE = INTERNET_FLAG_NO_CACHE_WRITE
  354. Const INTERNET_FLAG_MAKE_PERSISTENT = &H2000000     ' make this item persistent in cache
  355. Const INTERNET_FLAG_FROM_CACHE = &H1000000          ' use offline semantics
  356. Const INTERNET_FLAG_OFFLINE = INTERNET_FLAG_FROM_CACHE
  357.  
  358. '
  359. ' additional flags
  360. '
  361.  
  362. Const INTERNET_FLAG_SECURE = &H800000               ' use PCT/SSL if applicable (HTTP)
  363. Const INTERNET_FLAG_KEEP_CONNECTION = &H400000      ' use keep-alive semantics
  364. Const INTERNET_FLAG_NO_AUTO_REDIRECT = &H200000     ' don't handle redirections automatically
  365. Const INTERNET_FLAG_READ_PREFETCH = &H100000        ' do background read prefetch
  366. Const INTERNET_FLAG_NO_COOKIES = &H80000            ' no automatic cookie handling
  367. Const INTERNET_FLAG_NO_AUTH = &H40000               ' no automatic authentication handling
  368. Const INTERNET_FLAG_CACHE_IF_NET_FAIL = &H10000     ' return cache file if net request fails
  369.  
  370. '
  371. ' Security Ignore Flags, Allow HttpOpenRequest to overide
  372. '  Secure Channel (SSL/PCT) failures of the following types.
  373. '
  374.  
  375. Const INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP = &H8000       ' ex: https:// to http://
  376. Const INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS = &H4000      ' ex: http:// to https://
  377. Const INTERNET_FLAG_IGNORE_CERT_DATE_INVALID = &H2000      ' expired X509 Cert.
  378. Const INTERNET_FLAG_IGNORE_CERT_CN_INVALID = &H1000        ' bad common name in X509 Cert.
  379.  
  380. '
  381. ' more caching flags
  382. '
  383.  
  384. Const INTERNET_FLAG_RESYNCHRONIZE = &H800           ' asking wininet to update an item if it is newer
  385. Const INTERNET_FLAG_HYPERLINK = &H400               ' asking wininet to do hyperlinking semantic which works right for scripts
  386. Const INTERNET_FLAG_NO_UI = &H200                   ' no cookie popup
  387. Const INTERNET_FLAG_PRAGMA_NOCACHE = &H100          ' asking wininet to add "pragma: no-cache"
  388. Const INTERNET_FLAG_CACHE_ASYNC = &H80              ' ok to perform lazy cache-write
  389. Const INTERNET_FLAG_FORMS_SUBMIT = &H40             ' this is a forms submit
  390. Const INTERNET_FLAG_NEED_FILE = &H10                ' need a file for this request
  391. Const INTERNET_FLAG_MUST_CACHE_REQUEST = INTERNET_FLAG_NEED_FILE
  392.  
  393. '
  394. ' flags for FTP
  395. '
  396.  
  397. Const INTERNET_FLAG_TRANSFER_ASCII = FTP_TRANSFER_TYPE_ASCII       ' = &H00000001
  398. Const INTERNET_FLAG_TRANSFER_BINARY = FTP_TRANSFER_TYPE_BINARY     ' = &H00000002
  399.  
  400. '
  401. ' flags field masks
  402. '
  403.  
  404. Const SECURITY_INTERNET_MASK = INTERNET_FLAG_IGNORE_CERT_CN_INVALID Or INTERNET_FLAG_IGNORE_CERT_DATE_INVALID Or INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS Or INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP
  405.  
  406. Const INTERNET_FLAGS_MASK = INTERNET_FLAG_RELOAD Or INTERNET_FLAG_RAW_DATA Or INTERNET_FLAG_EXISTING_CONNECT Or INTERNET_FLAG_ASYNC Or INTERNET_FLAG_PASSIVE Or INTERNET_FLAG_NO_CACHE_WRITE Or INTERNET_FLAG_MAKE_PERSISTENT Or INTERNET_FLAG_FROM_CACHE Or INTERNET_FLAG_SECURE Or INTERNET_FLAG_KEEP_CONNECTION Or INTERNET_FLAG_NO_AUTO_REDIRECT Or INTERNET_FLAG_READ_PREFETCH Or INTERNET_FLAG_NO_COOKIES Or INTERNET_FLAG_NO_AUTH Or INTERNET_FLAG_CACHE_IF_NET_FAIL Or SECURITY_INTERNET_MASK Or INTERNET_FLAG_RESYNCHRONIZE Or INTERNET_FLAG_HYPERLINK Or INTERNET_FLAG_NO_UI Or INTERNET_FLAG_PRAGMA_NOCACHE Or INTERNET_FLAG_CACHE_ASYNC Or INTERNET_FLAG_FORMS_SUBMIT Or INTERNET_FLAG_NEED_FILE Or INTERNET_FLAG_TRANSFER_BINARY Or INTERNET_FLAG_TRANSFER_ASCII
  407.  
  408.  
  409. Const INTERNET_ERROR_MASK_INSERT_CDROM = &H1
  410.  
  411. Const INTERNET_OPTIONS_MASK = (Not INTERNET_FLAGS_MASK)
  412.  
  413. '
  414. ' common per-API flags (new APIs)
  415. '
  416.  
  417. Const WININET_API_FLAG_ASYNC = &H1                  ' force async operation
  418. Const WININET_API_FLAG_SYNC = &H4                   ' force sync operation
  419. Const WININET_API_FLAG_USE_CONTEXT = &H8            ' use value supplied in dwContext (even if 0)
  420.  
  421. '
  422. ' INTERNET_NO_CALLBACK - if this value is presented as the dwContext parameter
  423. ' then no call-backs will be made for that API
  424. '
  425.  
  426. Const INTERNET_NO_CALLBACK = 0
  427.  
  428.