home *** CD-ROM | disk | FTP | other *** search
/ PC World Plus! (NZ) 2001 June / HDC50.iso / Runimage / Delphi50 / Source / Rtl / Win / WININET.PAS < prev    next >
Pascal/Delphi Source File  |  1999-08-11  |  146KB  |  3,037 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Run-time Library                 }
  5. {       Win32 Internet API Interface Unit               }
  6. {                                                       }
  7. {       Copyright (c) 1985-1999, Microsoft Corporation  }
  8. {                                                       }
  9. {       Translator: Inprise Corporation                 }
  10. {                                                       }
  11. {*******************************************************}
  12.  
  13. unit WinInet;
  14.  
  15. {$WEAKPACKAGEUNIT}
  16.  
  17. interface
  18.  
  19. uses Windows;
  20.  
  21. { Contains manifests, functions, types and prototypes for 
  22.   Microsoft Windows Internet Extensions }
  23.  
  24.  
  25. { internet types }
  26.  
  27. {$HPPEMIT '#include <wininet.h>'}
  28.  
  29. type
  30.   HINTERNET = Pointer; 
  31.   {$EXTERNALSYM HINTERNET}
  32.   PHINTERNET = ^HINTERNET;
  33.   LPHINTERNET = PHINTERNET; 
  34.   {$EXTERNALSYM LPHINTERNET}
  35.  
  36.   INTERNET_PORT = Word; 
  37.   {$EXTERNALSYM INTERNET_PORT}
  38.   PINTERNET_PORT = ^INTERNET_PORT;
  39.   LPINTERNET_PORT = PINTERNET_PORT; 
  40.   {$EXTERNALSYM LPINTERNET_PORT}
  41.  
  42. { Internet APIs }
  43.  
  44. { manifests }
  45.  
  46. const
  47.   INTERNET_INVALID_PORT_NUMBER = 0;                 { use the protocol-specific default }
  48.   {$EXTERNALSYM INTERNET_INVALID_PORT_NUMBER}
  49.   INTERNET_DEFAULT_FTP_PORT = 21;                   { default for FTP servers }
  50.   {$EXTERNALSYM INTERNET_DEFAULT_FTP_PORT}
  51.   INTERNET_DEFAULT_GOPHER_PORT = 70;                {    "     "  gopher " }
  52.   {$EXTERNALSYM INTERNET_DEFAULT_GOPHER_PORT}
  53.   INTERNET_DEFAULT_HTTP_PORT = 80;                  {    "     "  HTTP   " }
  54.   {$EXTERNALSYM INTERNET_DEFAULT_HTTP_PORT}
  55.   INTERNET_DEFAULT_HTTPS_PORT = 443;                {    "     "  HTTPS  " }
  56.   {$EXTERNALSYM INTERNET_DEFAULT_HTTPS_PORT}
  57.   INTERNET_DEFAULT_SOCKS_PORT = 1080;               { default for SOCKS firewall servers.}
  58.   {$EXTERNALSYM INTERNET_DEFAULT_SOCKS_PORT}
  59.  
  60.   MAX_CACHE_ENTRY_INFO_SIZE = 4096;
  61.   {$EXTERNALSYM MAX_CACHE_ENTRY_INFO_SIZE}
  62.  
  63.  
  64. { maximum field lengths (arbitrary) }
  65.  
  66.   INTERNET_MAX_HOST_NAME_LENGTH = 256;
  67.   {$EXTERNALSYM INTERNET_MAX_HOST_NAME_LENGTH}
  68.   INTERNET_MAX_USER_NAME_LENGTH = 128;
  69.   {$EXTERNALSYM INTERNET_MAX_USER_NAME_LENGTH}
  70.   INTERNET_MAX_PASSWORD_LENGTH = 128;
  71.   {$EXTERNALSYM INTERNET_MAX_PASSWORD_LENGTH}
  72.   INTERNET_MAX_PORT_NUMBER_LENGTH = 5;              { INTERNET_PORT is unsigned short }
  73.   {$EXTERNALSYM INTERNET_MAX_PORT_NUMBER_LENGTH}
  74.   INTERNET_MAX_PORT_NUMBER_VALUE = 65535;           { maximum unsigned short value }
  75.   {$EXTERNALSYM INTERNET_MAX_PORT_NUMBER_VALUE}
  76.   INTERNET_MAX_PATH_LENGTH = 2048;
  77.   {$EXTERNALSYM INTERNET_MAX_PATH_LENGTH}
  78.   INTERNET_MAX_SCHEME_LENGTH = 32;                   { longest protocol name length }
  79.   {$EXTERNALSYM INTERNET_MAX_SCHEME_LENGTH}
  80.   INTERNET_MAX_PROTOCOL_NAME = 'gopher';            { longest protocol name }
  81.   {$EXTERNALSYM INTERNET_MAX_PROTOCOL_NAME}
  82.   INTERNET_MAX_URL_LENGTH = ((SizeOf(INTERNET_MAX_PROTOCOL_NAME) - 1)
  83.                             + SizeOf('://')
  84.                             + INTERNET_MAX_PATH_LENGTH);
  85.   {$EXTERNALSYM INTERNET_MAX_URL_LENGTH}
  86.  
  87. { values returned by InternetQueryOption with INTERNET_OPTION_KEEP_CONNECTION: }
  88.  
  89.   INTERNET_KEEP_ALIVE_UNKNOWN = -1;
  90.   {$EXTERNALSYM INTERNET_KEEP_ALIVE_UNKNOWN}
  91.   INTERNET_KEEP_ALIVE_ENABLED = 1;
  92.   {$EXTERNALSYM INTERNET_KEEP_ALIVE_ENABLED}
  93.   INTERNET_KEEP_ALIVE_DISABLED = 0;
  94.   {$EXTERNALSYM INTERNET_KEEP_ALIVE_DISABLED}
  95.  
  96. { flags returned by InternetQueryOption with INTERNET_OPTION_REQUEST_FLAGS }
  97.  
  98.   INTERNET_REQFLAG_FROM_CACHE   = $00000001;
  99.   {$EXTERNALSYM INTERNET_REQFLAG_FROM_CACHE}
  100.   INTERNET_REQFLAG_ASYNC        = $00000002;
  101.   {$EXTERNALSYM INTERNET_REQFLAG_ASYNC}
  102.   INTERNET_REQFLAG_VIA_PROXY    = $00000004;  { request was made via a proxy }
  103.   {$EXTERNALSYM INTERNET_REQFLAG_VIA_PROXY}
  104.   INTERNET_REQFLAG_NO_HEADERS   = $00000008;  { orginal response contained no headers }
  105.   {$EXTERNALSYM INTERNET_REQFLAG_NO_HEADERS}
  106.   INTERNET_REQFLAG_PASSIVE      = $00000010;  { FTP: passive-mode connection }
  107.   {$EXTERNALSYM INTERNET_REQFLAG_PASSIVE}
  108.   INTERNET_REQFLAG_CACHE_WRITE_DISABLED = $00000040;  { HTTPS: this request not cacheable }
  109.   {$EXTERNALSYM INTERNET_REQFLAG_CACHE_WRITE_DISABLED}
  110.  
  111. { flags common to open functions (not InternetOpen): }
  112.  
  113.   INTERNET_FLAG_RELOAD = $80000000;                 { retrieve the original item }
  114.   {$EXTERNALSYM INTERNET_FLAG_RELOAD}
  115.  
  116. { flags for InternetOpenUrl: }
  117.  
  118.   INTERNET_FLAG_RAW_DATA = $40000000;               { receive the item as raw data }
  119.   {$EXTERNALSYM INTERNET_FLAG_RAW_DATA}
  120.   INTERNET_FLAG_EXISTING_CONNECT = $20000000;       { do not create new connection object }
  121.   {$EXTERNALSYM INTERNET_FLAG_EXISTING_CONNECT}
  122.  
  123. { flags for InternetOpen: }
  124.  
  125.   INTERNET_FLAG_ASYNC = $10000000;                  { this request is asynchronous (where supported) }
  126.   {$EXTERNALSYM INTERNET_FLAG_ASYNC}
  127.  
  128. { protocol-specific flags: }
  129.  
  130.   INTERNET_FLAG_PASSIVE = $08000000;                { used for FTP connections }
  131.   {$EXTERNALSYM INTERNET_FLAG_PASSIVE}
  132.  
  133. { additional cache flags }
  134.  
  135.   INTERNET_FLAG_NO_CACHE_WRITE        = $04000000;  { don't write this item to the cache }
  136.   {$EXTERNALSYM INTERNET_FLAG_NO_CACHE_WRITE}
  137.   INTERNET_FLAG_DONT_CACHE            = INTERNET_FLAG_NO_CACHE_WRITE;
  138.   {$EXTERNALSYM INTERNET_FLAG_DONT_CACHE}
  139.   INTERNET_FLAG_MAKE_PERSISTENT       = $02000000;  { make this item persistent in cache }
  140.   {$EXTERNALSYM INTERNET_FLAG_MAKE_PERSISTENT}
  141.   INTERNET_FLAG_FROM_CACHE            = $01000000;  { use offline semantics }
  142.   {$EXTERNALSYM INTERNET_FLAG_FROM_CACHE}
  143.   INTERNET_FLAG_OFFLINE               = $01000000;  { use offline semantics }
  144.   {$EXTERNALSYM INTERNET_FLAG_OFFLINE}
  145.  
  146. { additional flags }
  147.  
  148.   INTERNET_FLAG_SECURE                = $00800000;  { use PCT/SSL if applicable (HTTP) }
  149.   {$EXTERNALSYM INTERNET_FLAG_SECURE}
  150.   INTERNET_FLAG_KEEP_CONNECTION       = $00400000;  { use keep-alive semantics }
  151.   {$EXTERNALSYM INTERNET_FLAG_KEEP_CONNECTION}
  152.   INTERNET_FLAG_NO_AUTO_REDIRECT      = $00200000;  { don't handle redirections automatically }
  153.   {$EXTERNALSYM INTERNET_FLAG_NO_AUTO_REDIRECT}
  154.   INTERNET_FLAG_READ_PREFETCH         = $00100000;  { do background read prefetch }
  155.   {$EXTERNALSYM INTERNET_FLAG_READ_PREFETCH}
  156.   INTERNET_FLAG_NO_COOKIES            = $00080000;  { no automatic cookie handling }
  157.   {$EXTERNALSYM INTERNET_FLAG_NO_COOKIES}
  158.   INTERNET_FLAG_NO_AUTH               = $00040000;  { no automatic authentication handling }
  159.   {$EXTERNALSYM INTERNET_FLAG_NO_AUTH}
  160.   INTERNET_FLAG_CACHE_IF_NET_FAIL     = $00010000;  { return cache file if net request fails }
  161.   {$EXTERNALSYM INTERNET_FLAG_CACHE_IF_NET_FAIL}
  162.  
  163. { Security Ignore Flags, Allow HttpOpenRequest to overide
  164.   Secure Channel (SSL/PCT) failures of the following types. }
  165.  
  166.   INTERNET_FLAG_IGNORE_CERT_CN_INVALID        = $00001000; { bad common name in X509 Cert. }
  167.   {$EXTERNALSYM INTERNET_FLAG_IGNORE_CERT_CN_INVALID}
  168.   INTERNET_FLAG_IGNORE_CERT_DATE_INVALID      = $00002000; { expired X509 Cert. }
  169.   {$EXTERNALSYM INTERNET_FLAG_IGNORE_CERT_DATE_INVALID}
  170.   INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS      = $00004000; { ex: http:// to https:// }
  171.   {$EXTERNALSYM INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS}
  172.   INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP       = $00008000; { ex: https:// to http:// }
  173.   {$EXTERNALSYM INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP}
  174.  
  175. //
  176. // more caching flags
  177. //
  178.  
  179.   INTERNET_FLAG_RESYNCHRONIZE     = $00000800;  // asking wininet to update an item if it is newer
  180.   {$EXTERNALSYM INTERNET_FLAG_RESYNCHRONIZE}
  181.   INTERNET_FLAG_HYPERLINK         = $00000400;  // asking wininet to do hyperlinking semantic which works right for scripts
  182.   {$EXTERNALSYM INTERNET_FLAG_HYPERLINK}
  183.   INTERNET_FLAG_NO_UI             = $00000200;  // no cookie popup
  184.   {$EXTERNALSYM INTERNET_FLAG_NO_UI}
  185.   INTERNET_FLAG_PRAGMA_NOCACHE    = $00000100;  // asking wininet to add "pragma: no-cache"
  186.   {$EXTERNALSYM INTERNET_FLAG_PRAGMA_NOCACHE}
  187.   INTERNET_FLAG_CACHE_ASYNC       = $00000080;  // ok to perform lazy cache-write
  188.   {$EXTERNALSYM INTERNET_FLAG_CACHE_ASYNC}
  189.   INTERNET_FLAG_FORMS_SUBMIT      = $00000040;  // this is a forms submit
  190.   {$EXTERNALSYM INTERNET_FLAG_FORMS_SUBMIT}
  191.   INTERNET_FLAG_NEED_FILE         = $00000010;  // need a file for this request
  192.   {$EXTERNALSYM INTERNET_FLAG_NEED_FILE}
  193.   INTERNET_FLAG_MUST_CACHE_REQUEST = INTERNET_FLAG_NEED_FILE;
  194.   {$EXTERNALSYM INTERNET_FLAG_MUST_CACHE_REQUEST}  
  195.  
  196. { FTP }
  197.  
  198. { manifests }
  199. const
  200. { flags for FTP }
  201.   FTP_TRANSFER_TYPE_UNKNOWN   = $00000000;
  202.   {$EXTERNALSYM FTP_TRANSFER_TYPE_UNKNOWN}
  203.   FTP_TRANSFER_TYPE_ASCII     = $00000001;
  204.   {$EXTERNALSYM FTP_TRANSFER_TYPE_ASCII}
  205.   FTP_TRANSFER_TYPE_BINARY    = $00000002;
  206.   {$EXTERNALSYM FTP_TRANSFER_TYPE_BINARY}
  207.  
  208.   FTP_TRANSFER_TYPE_MASK      = FTP_TRANSFER_TYPE_ASCII or
  209.                                 FTP_TRANSFER_TYPE_BINARY;
  210.   {$EXTERNALSYM FTP_TRANSFER_TYPE_MASK}
  211.  
  212.   INTERNET_FLAG_TRANSFER_ASCII        = FTP_TRANSFER_TYPE_ASCII;
  213.   {$EXTERNALSYM INTERNET_FLAG_TRANSFER_ASCII}
  214.   INTERNET_FLAG_TRANSFER_BINARY       = FTP_TRANSFER_TYPE_BINARY;
  215.   {$EXTERNALSYM INTERNET_FLAG_TRANSFER_BINARY}
  216.  
  217. { flags field masks }
  218.  
  219.   SECURITY_INTERNET_MASK      = INTERNET_FLAG_IGNORE_CERT_CN_INVALID or
  220.                                 INTERNET_FLAG_IGNORE_CERT_DATE_INVALID or
  221.                                 INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS or
  222.                                 INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP;
  223.   {$EXTERNALSYM SECURITY_INTERNET_MASK}
  224.  
  225.   SECURITY_SET_MASK           = SECURITY_INTERNET_MASK;
  226.   {$EXTERNALSYM SECURITY_SET_MASK}
  227.  
  228.   INTERNET_FLAGS_MASK         = INTERNET_FLAG_RELOAD              or
  229.                                 INTERNET_FLAG_RAW_DATA            or
  230.                                 INTERNET_FLAG_EXISTING_CONNECT    or
  231.                                 INTERNET_FLAG_ASYNC               or
  232.                                 INTERNET_FLAG_PASSIVE             or
  233.                                 INTERNET_FLAG_NO_CACHE_WRITE      or
  234.                                 INTERNET_FLAG_MAKE_PERSISTENT     or
  235.                                 INTERNET_FLAG_FROM_CACHE          or
  236.                                 INTERNET_FLAG_SECURE              or
  237.                                 INTERNET_FLAG_KEEP_CONNECTION     or
  238.                                 INTERNET_FLAG_NO_AUTO_REDIRECT    or
  239.                                 INTERNET_FLAG_READ_PREFETCH       or
  240.                                 INTERNET_FLAG_NO_COOKIES          or
  241.                                 INTERNET_FLAG_NO_AUTH             or
  242.                                 INTERNET_FLAG_CACHE_IF_NET_FAIL   or
  243.                                 SECURITY_INTERNET_MASK            or
  244.                                 INTERNET_FLAG_RESYNCHRONIZE       or
  245.                                 INTERNET_FLAG_HYPERLINK           or
  246.                                 INTERNET_FLAG_NO_UI               or
  247.                                 INTERNET_FLAG_PRAGMA_NOCACHE      or
  248.                                 INTERNET_FLAG_CACHE_ASYNC         or
  249.                                 INTERNET_FLAG_FORMS_SUBMIT        or
  250.                                 INTERNET_FLAG_NEED_FILE           or
  251.                                 INTERNET_FLAG_TRANSFER_BINARY     or
  252.                                 INTERNET_FLAG_TRANSFER_ASCII;
  253.   {$EXTERNALSYM INTERNET_FLAGS_MASK}
  254.  
  255.   INTERNET_ERROR_MASK_INSERT_CDROM = $1;
  256.   {$EXTERNALSYM INTERNET_ERROR_MASK_INSERT_CDROM}
  257.  
  258.   INTERNET_OPTIONS_MASK       =  not INTERNET_FLAGS_MASK;
  259.   {$EXTERNALSYM INTERNET_OPTIONS_MASK}
  260.  
  261. //
  262. // common per-API flags (new APIs)
  263. //
  264.  
  265.   WININET_API_FLAG_ASYNC          = $00000001;  // force async operation
  266.   {$EXTERNALSYM WININET_API_FLAG_ASYNC}
  267.   WININET_API_FLAG_SYNC           = $00000004;  // force sync operation
  268.   {$EXTERNALSYM WININET_API_FLAG_SYNC}
  269.   WININET_API_FLAG_USE_CONTEXT    = $00000008;  // use value supplied in dwContext (even if 0)
  270.   {$EXTERNALSYM WININET_API_FLAG_USE_CONTEXT}
  271.  
  272. { INTERNET_NO_CALLBACK - if this value is presented as the dwContext parameter }
  273. { then no call-backs will be made for that API }
  274.  
  275.   INTERNET_NO_CALLBACK = 0;
  276.   {$EXTERNALSYM INTERNET_NO_CALLBACK}
  277.  
  278. { structures/types }
  279.  
  280. type
  281.   PInternetScheme = ^TInternetScheme;
  282.   TInternetScheme = Integer;
  283. const
  284.   INTERNET_SCHEME_PARTIAL = -2;
  285.   {$EXTERNALSYM INTERNET_SCHEME_PARTIAL}
  286.   INTERNET_SCHEME_UNKNOWN = -1;
  287.   {$EXTERNALSYM INTERNET_SCHEME_UNKNOWN}
  288.   INTERNET_SCHEME_DEFAULT = 0;
  289.   {$EXTERNALSYM INTERNET_SCHEME_DEFAULT}
  290.   INTERNET_SCHEME_FTP = 1;
  291.   {$EXTERNALSYM INTERNET_SCHEME_FTP}
  292.   INTERNET_SCHEME_GOPHER = 2;
  293.   {$EXTERNALSYM INTERNET_SCHEME_GOPHER}
  294.   INTERNET_SCHEME_HTTP = 3;
  295.   {$EXTERNALSYM INTERNET_SCHEME_HTTP}
  296.   INTERNET_SCHEME_HTTPS = 4;
  297.   {$EXTERNALSYM INTERNET_SCHEME_HTTPS}
  298.   INTERNET_SCHEME_FILE = 5;
  299.   {$EXTERNALSYM INTERNET_SCHEME_FILE}
  300.   INTERNET_SCHEME_NEWS = 6;
  301.   {$EXTERNALSYM INTERNET_SCHEME_NEWS}
  302.   INTERNET_SCHEME_MAILTO = 7;
  303.   {$EXTERNALSYM INTERNET_SCHEME_MAILTO}
  304.   INTERNET_SCHEME_FIRST = INTERNET_SCHEME_FTP;
  305.   {$EXTERNALSYM INTERNET_SCHEME_FIRST}
  306.   INTERNET_SCHEME_LAST = INTERNET_SCHEME_MAILTO;
  307.   {$EXTERNALSYM INTERNET_SCHEME_LAST}
  308.  
  309. { TInternetAsyncResult - this structure is returned to the application via }
  310. { the callback with INTERNET_STATUS_REQUEST_COMPLETE. It is not sufficient to }
  311. { just return the result of the async operation. If the API failed then the }
  312. { app cannot call GetLastError because the thread context will be incorrect. }
  313. { Both the value returned by the async API and any resultant error code are }
  314. { made available. The app need not check dwError if dwResult indicates that }
  315. { the API succeeded (in this case dwError will be ERROR_SUCCESS) }
  316.  
  317. type
  318.   PInternetAsyncResult = ^TInternetAsyncResult;
  319.   TInternetAsyncResult = packed record
  320.     dwResult: DWORD; { the HINTERNET, DWORD or BOOL return code from an async API }
  321.     dwError: DWORD; { dwError - the error code if the API failed }
  322.   end;
  323.  
  324.   PInternetPrefetchStatus = ^TInternetPrefetchStatus;
  325.   TInternetPrefetchStatus = packed record
  326.     dwStatus: DWORD;  { dwStatus - status of download. See INTERNET_PREFETCH_ flags }
  327.     dwSize: DWORD;    { dwSize - size of file downloaded so far }
  328.   end;
  329.  
  330. const
  331. { INTERNET_PREFETCH_STATUS - dwStatus values }
  332.   INTERNET_PREFETCH_PROGRESS      = 0;
  333.   {$EXTERNALSYM INTERNET_PREFETCH_PROGRESS}
  334.   INTERNET_PREFETCH_COMPLETE      = 1;
  335.   {$EXTERNALSYM INTERNET_PREFETCH_COMPLETE}
  336.   INTERNET_PREFETCH_ABORTED       = 2;
  337.   {$EXTERNALSYM INTERNET_PREFETCH_ABORTED}
  338.  
  339. type
  340. { TInternetProxyInfo - structure supplied with INTERNET_OPTION_PROXY to get/ }
  341. { set proxy information on a InternetOpen handle }
  342.   PInternetProxyInfo = ^INTERNET_PROXY_INFO;
  343.   INTERNET_PROXY_INFO = record
  344.     dwAccessType: DWORD;       { dwAccessType - INTERNET_OPEN_TYPE_DIRECT, INTERNET_OPEN_TYPE_PROXY, or }
  345.     lpszProxy: LPCSTR;        { lpszProxy - proxy server list }
  346.     lpszProxyBypass: LPCSTR;  { lpszProxyBypass - proxy bypass list }
  347.   end;
  348.   {$EXTERNALSYM INTERNET_PROXY_INFO}
  349.   TInternetProxyInfo = INTERNET_PROXY_INFO;
  350.   LPINTERNET_PROXY_INFO = PInternetProxyInfo;
  351.   {$EXTERNALSYM LPINTERNET_PROXY_INFO}
  352.  
  353. { INTERNET_VERSION_INFO - version information returned via }
  354. { InternetQueryOption(..., INTERNET_OPTION_VERSION, ...) }
  355.  
  356.   PInternetVersionInfo = ^INTERNET_VERSION_INFO;
  357.   INTERNET_VERSION_INFO = record
  358.     dwMajorVersion: DWORD;
  359.     dwMinorVersion: DWORD;
  360.   end;
  361.   {$EXTERNALSYM INTERNET_VERSION_INFO}
  362.   TInternetVersionInfo = INTERNET_VERSION_INFO;
  363.   LPINTERNET_VERSION_INFO = PInternetVersionInfo;
  364.   {$EXTERNALSYM LPINTERNET_VERSION_INFO}
  365.  
  366. { HTTP_VERSION_INFO - query or set global HTTP version (1.0 or 1.1) }
  367.   PHttpVersionInfo = ^HTTP_VERSION_INFO;
  368.   HTTP_VERSION_INFO = record
  369.     dwMajorVersion: DWORD;
  370.     dwMinorVersion: DWORD;
  371.   end;
  372.   {$EXTERNALSYM HTTP_VERSION_INFO}
  373.   THttpVersionInfo = HTTP_VERSION_INFO;
  374.   LPHTTP_VERSION_INFO = PHttpVersionInfo;
  375.   {$EXTERNALSYM LPHTTP_VERSION_INFO}
  376.  
  377. { INTERNET_CONNECTED_INFO - information used to set the global connected state }
  378.  
  379.   PInternetConnectedInfo = ^INTERNET_CONNECTED_INFO;
  380.   INTERNET_CONNECTED_INFO = record
  381.       dwConnectedState: DWORD;     {dwConnectedState - new connected/disconnected state.}
  382.       dwFlags: DWORD;              {dwFlags - flags controlling connected->disconnected (or disconnected-> }
  383.                                    {connected) transition. See below}
  384.   end;
  385.   {$EXTERNALSYM INTERNET_CONNECTED_INFO}
  386.   TInternetConnectedInfo = INTERNET_CONNECTED_INFO;
  387.   LPINTERNET_CONNECTED_INFO = PInternetConnectedInfo;
  388.   {$EXTERNALSYM LPINTERNET_CONNECTED_INFO}
  389.  
  390. { flags for INTERNET_CONNECTED_INFO dwFlags }
  391.  
  392. { ISO_FORCE_DISCONNECTED - if set when putting Wininet into disconnected mode, }
  393. { all outstanding requests will be aborted with a cancelled error }
  394.  
  395. const
  396.   ISO_FORCE_DISCONNECTED  = $00000001;
  397.   {$EXTERNALSYM ISO_FORCE_DISCONNECTED}
  398.  
  399. { URL_COMPONENTS - the constituent parts of an URL. Used in InternetCrackUrl }
  400. { and InternetCreateUrl }
  401.  
  402. { For InternetCrackUrl, if a pointer field and its corresponding length field }
  403. { are both 0 then that component is not returned; If the pointer field is NULL }
  404. { but the length field is not zero, then both the pointer and length fields are }
  405. { returned; if both pointer and corresponding length fields are non-zero then }
  406. { the pointer field points to a buffer where the component is copied. The }
  407. { component may be un-escaped, depending on dwFlags }
  408.  
  409. { For InternetCreateUrl, the pointer fields should be nil if the component }
  410. { is not required. If the corresponding length field is zero then the pointer }
  411. { field is the address of a zero-terminated string. If the length field is not }
  412. { zero then it is the string length of the corresponding pointer field }
  413.  
  414. type
  415.   PURLComponents = ^URL_COMPONENTS;
  416.   URL_COMPONENTS = record
  417.     dwStructSize: DWORD;        { size of this structure. Used in version check }
  418.     lpszScheme: LPSTR;         { pointer to scheme name }
  419.     dwSchemeLength: DWORD;      { length of scheme name }
  420.     nScheme: TInternetScheme;    { enumerated scheme type (if known) }
  421.     lpszHostName: LPSTR;       { pointer to host name }
  422.     dwHostNameLength: DWORD;    { length of host name }
  423.     nPort: INTERNET_PORT;       { converted port number }
  424.     lpszUserName: LPSTR;       { pointer to user name }
  425.     dwUserNameLength: DWORD;    { length of user name }
  426.     lpszPassword: LPSTR;       { pointer to password }
  427.     dwPasswordLength: DWORD;    { length of password }
  428.     lpszUrlPath: LPSTR;        { pointer to URL-path }
  429.     dwUrlPathLength: DWORD;     { length of URL-path }
  430.     lpszExtraInfo: LPSTR;      { pointer to extra information (e.g. ?foo or #foo) }
  431.     dwExtraInfoLength: DWORD;   { length of extra information }
  432.   end;
  433.   {$EXTERNALSYM URL_COMPONENTS}
  434.   TURLComponents = URL_COMPONENTS;
  435.   LPURL_COMPONENTS = PURLComponents;
  436.   {$EXTERNALSYM LPURL_COMPONENTS}
  437.   
  438. { TInternetCertificateInfo lpBuffer - contains the certificate returned from
  439.   the server }
  440.  
  441.   PInternetCertificateInfo = ^INTERNET_CERTIFICATE_INFO;
  442.   INTERNET_CERTIFICATE_INFO = record
  443.     ftExpiry: TFileTime;             { ftExpiry - date the certificate expires. }
  444.     ftStart: TFileTime;              { ftStart - date the certificate becomes valid. }
  445.     lpszSubjectInfo: LPSTR;        { lpszSubjectInfo - the name of organization, site, and server }
  446.                                     {   the cert. was issued for. }
  447.     lpszIssuerInfo: LPSTR;         { lpszIssuerInfo - the name of orgainzation, site, and server }
  448.                                     {   the cert was issues by. }
  449.     lpszProtocolName: LPSTR;       { lpszProtocolName - the name of the protocol used to provide the secure }
  450.                                     {   connection. }
  451.     lpszSignatureAlgName: LPSTR;   { lpszSignatureAlgName - the name of the algorithm used for signing }
  452.                                     {  the certificate. }
  453.     lpszEncryptionAlgName: LPSTR;  { lpszEncryptionAlgName - the name of the algorithm used for }
  454.                                     {  doing encryption over the secure channel (SSL/PCT) connection. }
  455.     dwKeySize: DWORD;               { dwKeySize - size of the key. }
  456.   end;
  457.   {$EXTERNALSYM INTERNET_CERTIFICATE_INFO}
  458.   TInternetCertificateInfo = INTERNET_CERTIFICATE_INFO;
  459.   LPINTERNET_CERTIFICATE_INFO = pInternetCertificateInfo;
  460.   {$EXTERNALSYM LPINTERNET_CERTIFICATE_INFO}
  461.  
  462. { INTERNET_BUFFERS - combines headers and data. May be chained for e.g. file }
  463. { upload or scatter/gather operations. For chunked read/write, lpcszHeader }
  464. { contains the chunked-ext }
  465.   PInternetBuffersA = ^INTERNET_BUFFERSA;
  466.   PInternetBuffersW = ^INTERNET_BUFFERSW;
  467.   PInternetBuffers = PInternetBuffersA;
  468.   INTERNET_BUFFERSA = record
  469.     dwStructSize: DWORD;      { used for API versioning. Set to sizeof(INTERNET_BUFFERS) }
  470.     Next: PInternetBuffers;   { chain of buffers }
  471.     lpcszHeader: PAnsiChar;       { pointer to headers (may be NULL) }
  472.     dwHeadersLength: DWORD;   { length of headers if not NULL }
  473.     dwHeadersTotal: DWORD;    { size of headers if not enough buffer }
  474.     lpvBuffer: Pointer;       { pointer to data buffer (may be NULL) }
  475.     dwBufferLength: DWORD;    { length of data buffer if not NULL }
  476.     dwBufferTotal: DWORD;     { total size of chunk, or content-length if not chunked }
  477.     dwOffsetLow: DWORD;       { used for read-ranges (only used in HttpSendRequest2) }
  478.     dwOffsetHigh: DWORD;
  479.   end;
  480.   {$EXTERNALSYM INTERNET_BUFFERSA}
  481.   TInternetBuffersA = INTERNET_BUFFERSA;
  482.   LPINTERNET_BUFFERSA = PInternetBuffersA;
  483.   {$EXTERNALSYM LPINTERNET_BUFFERSA}
  484.   INTERNET_BUFFERSW = record
  485.     dwStructSize: DWORD;      { used for API versioning. Set to sizeof(INTERNET_BUFFERS) }
  486.     Next: PInternetBuffers;   { chain of buffers }
  487.     lpcszHeader: PAnsiChar;       { pointer to headers (may be NULL) }
  488.     dwHeadersLength: DWORD;   { length of headers if not NULL }
  489.     dwHeadersTotal: DWORD;    { size of headers if not enough buffer }
  490.     lpvBuffer: Pointer;       { pointer to data buffer (may be NULL) }
  491.     dwBufferLength: DWORD;    { length of data buffer if not NULL }
  492.     dwBufferTotal: DWORD;     { total size of chunk, or content-length if not chunked }
  493.     dwOffsetLow: DWORD;       { used for read-ranges (only used in HttpSendRequest2) }
  494.     dwOffsetHigh: DWORD;
  495.   end;
  496.   {$EXTERNALSYM INTERNET_BUFFERSW}
  497.   TInternetBuffersW = INTERNET_BUFFERSW;
  498.   LPINTERNET_BUFFERSW = PInternetBuffersW;
  499.   {$EXTERNALSYM LPINTERNET_BUFFERSW}
  500.   INTERNET_BUFFERS = INTERNET_BUFFERSA;
  501.   
  502. { prototypes }
  503.  
  504. function InternetTimeFromSystemTime(const pst: TSystemTime;
  505.   dwRFC: DWORD; lpszTime: LPSTR; cbTime: DWORD): BOOL; stdcall;
  506.   {$EXTERNALSYM InternetTimeFromSystemTime}
  507.  
  508. const
  509. { constants for InternetTimeFromSystemTime }
  510.   INTERNET_RFC1123_FORMAT         = 0;
  511.   {$EXTERNALSYM INTERNET_RFC1123_FORMAT}
  512.   INTERNET_RFC1123_BUFSIZE        = 30;
  513.   {$EXTERNALSYM INTERNET_RFC1123_BUFSIZE}
  514.  
  515. function InternetCrackUrlA(lpszUrl: PAnsiChar; dwUrlLength, dwFlags: DWORD;
  516.   var lpUrlComponents: TURLComponents): BOOL; stdcall;
  517.   {$EXTERNALSYM InternetCrackUrlA}
  518. function InternetCrackUrlW(lpszUrl: PWideChar; dwUrlLength, dwFlags: DWORD;
  519.   var lpUrlComponents: TURLComponents): BOOL; stdcall;
  520.   {$EXTERNALSYM InternetCrackUrlW}
  521. function InternetCrackUrl(lpszUrl: PChar; dwUrlLength, dwFlags: DWORD;
  522.   var lpUrlComponents: TURLComponents): BOOL; stdcall;
  523.   {$EXTERNALSYM InternetCrackUrl}
  524.  
  525. function InternetCreateUrlA(var lpUrlComponents: TURLComponents;
  526.   dwFlags: DWORD; lpszUrl: PAnsiChar; var dwUrlLength: DWORD): BOOL; stdcall;
  527.   {$EXTERNALSYM InternetCreateUrlA}
  528. function InternetCreateUrlW(var lpUrlComponents: TURLComponents;
  529.   dwFlags: DWORD; lpszUrl: PWideChar; var dwUrlLength: DWORD): BOOL; stdcall;
  530.   {$EXTERNALSYM InternetCreateUrlW}
  531. function InternetCreateUrl(var lpUrlComponents: TURLComponents;
  532.   dwFlags: DWORD; lpszUrl: PChar; var dwUrlLength: DWORD): BOOL; stdcall;
  533.   {$EXTERNALSYM InternetCreateUrl}
  534.  
  535. function InternetCanonicalizeUrlA(lpszUrl: PAnsiChar;
  536.   lpszBuffer: PAnsiChar; var lpdwBufferLength: DWORD;
  537.   dwFlags: DWORD): BOOL; stdcall;
  538.   {$EXTERNALSYM InternetCanonicalizeUrlA}
  539. function InternetCanonicalizeUrlW(lpszUrl: PWideChar;
  540.   lpszBuffer: PWideChar; var lpdwBufferLength: DWORD;
  541.   dwFlags: DWORD): BOOL; stdcall;
  542.   {$EXTERNALSYM InternetCanonicalizeUrlW}
  543. function InternetCanonicalizeUrl(lpszUrl: PChar;
  544.   lpszBuffer: PChar; var lpdwBufferLength: DWORD;
  545.   dwFlags: DWORD): BOOL; stdcall;
  546.   {$EXTERNALSYM InternetCanonicalizeUrl}
  547.  
  548. function InternetCombineUrlA(lpszBaseUrl, lpszRelativeUrl: PAnsiChar;
  549.   lpszBuffer: PAnsiChar; var lpdwBufferLength: DWORD;
  550.   dwFlags: DWORD): BOOL; stdcall;
  551.   {$EXTERNALSYM InternetCombineUrlA}
  552. function InternetCombineUrlW(lpszBaseUrl, lpszRelativeUrl: PWideChar;
  553.   lpszBuffer: PWideChar; var lpdwBufferLength: DWORD;
  554.   dwFlags: DWORD): BOOL; stdcall;
  555.   {$EXTERNALSYM InternetCombineUrlW}
  556. function InternetCombineUrl(lpszBaseUrl, lpszRelativeUrl: PChar;
  557.   lpszBuffer: PChar; var lpdwBufferLength: DWORD;
  558.   dwFlags: DWORD): BOOL; stdcall;
  559.   {$EXTERNALSYM InternetCombineUrl}
  560.  
  561. const
  562. { flags for InternetCrackUrl and InternetCreateUrl }
  563.  
  564.   ICU_ESCAPE          = $80000000;  { (un)escape URL characters }
  565.   {$EXTERNALSYM ICU_ESCAPE}
  566.   ICU_USERNAME        = $40000000;  { use internal username & password }
  567.   {$EXTERNALSYM ICU_USERNAME}
  568.  
  569. { flags for InternetCanonicalizeUrl and InternetCombineUrl }
  570.  
  571.   ICU_NO_ENCODE       = $20000000;  { Don't convert unsafe characters to escape sequence }
  572.   {$EXTERNALSYM ICU_NO_ENCODE}
  573.   ICU_DECODE          = $10000000;  { Convert escape sequences to characters }
  574.   {$EXTERNALSYM ICU_DECODE}
  575.   ICU_NO_META         = $08000000;  { Don't convert .. etc. meta path sequences }
  576.   {$EXTERNALSYM ICU_NO_META}
  577.   ICU_ENCODE_SPACES_ONLY     = $04000000;  { Encode spaces only }
  578.   {$EXTERNALSYM ICU_ENCODE_SPACES_ONLY}
  579.   ICU_BROWSER_MODE    = $02000000;  { Special encode/decode rules for browser }
  580.   {$EXTERNALSYM ICU_BROWSER_MODE}
  581.  
  582. function InternetOpenA(lpszAgent: PAnsiChar; dwAccessType: DWORD; 
  583.   lpszProxy, lpszProxyBypass: PAnsiChar; dwFlags: DWORD): HINTERNET; stdcall;
  584.   {$EXTERNALSYM InternetOpenA}
  585. function InternetOpenW(lpszAgent: PWideChar; dwAccessType: DWORD; 
  586.   lpszProxy, lpszProxyBypass: PWideChar; dwFlags: DWORD): HINTERNET; stdcall;
  587.   {$EXTERNALSYM InternetOpenW}
  588. function InternetOpen(lpszAgent: PChar; dwAccessType: DWORD; 
  589.   lpszProxy, lpszProxyBypass: PChar; dwFlags: DWORD): HINTERNET; stdcall;
  590.   {$EXTERNALSYM InternetOpen}
  591.  
  592. { access types for InternetOpen }
  593. const
  594.   INTERNET_OPEN_TYPE_PRECONFIG        = 0;  { use registry configuration }
  595.   {$EXTERNALSYM INTERNET_OPEN_TYPE_PRECONFIG}
  596.   INTERNET_OPEN_TYPE_DIRECT           = 1;  { direct to net }
  597.   {$EXTERNALSYM INTERNET_OPEN_TYPE_DIRECT}
  598.   INTERNET_OPEN_TYPE_PROXY            = 3;  { via named proxy }
  599.   {$EXTERNALSYM INTERNET_OPEN_TYPE_PROXY}
  600.   INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY  = 4;   { prevent using java/script/INS }
  601.   {$EXTERNALSYM INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY}
  602.  
  603. { old names for access types }
  604.  
  605.   PRE_CONFIG_INTERNET_ACCESS      = INTERNET_OPEN_TYPE_PRECONFIG;
  606.   {$EXTERNALSYM PRE_CONFIG_INTERNET_ACCESS}
  607.   LOCAL_INTERNET_ACCESS           = INTERNET_OPEN_TYPE_DIRECT;
  608.   {$EXTERNALSYM LOCAL_INTERNET_ACCESS}
  609.   GATEWAY_INTERNET_ACCESS         = 2;  { Internet via gateway }
  610.   {$EXTERNALSYM GATEWAY_INTERNET_ACCESS}
  611.   CERN_PROXY_INTERNET_ACCESS      = INTERNET_OPEN_TYPE_PROXY;
  612.   {$EXTERNALSYM CERN_PROXY_INTERNET_ACCESS}
  613.  
  614. function InternetCloseHandle(hInet: HINTERNET): BOOL; stdcall;
  615.   {$EXTERNALSYM InternetCloseHandle}
  616.  
  617. function InternetConnectA(hInet: HINTERNET; lpszServerName: PAnsiChar;
  618.   nServerPort: INTERNET_PORT; lpszUsername: PAnsiChar; lpszPassword: PAnsiChar;
  619.   dwService: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
  620.   {$EXTERNALSYM InternetConnectA}
  621. function InternetConnectW(hInet: HINTERNET; lpszServerName: PWideChar;
  622.   nServerPort: INTERNET_PORT; lpszUsername: PWideChar; lpszPassword: PWideChar;
  623.   dwService: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
  624.   {$EXTERNALSYM InternetConnectW}
  625. function InternetConnect(hInet: HINTERNET; lpszServerName: PChar;
  626.   nServerPort: INTERNET_PORT; lpszUsername: PChar; lpszPassword: PChar;
  627.   dwService: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
  628.   {$EXTERNALSYM InternetConnect}
  629.  
  630. { service types for InternetConnect }
  631. const
  632.   INTERNET_SERVICE_URL = 0;
  633.   {$EXTERNALSYM INTERNET_SERVICE_URL}
  634.   INTERNET_SERVICE_FTP = 1;
  635.   {$EXTERNALSYM INTERNET_SERVICE_FTP}
  636.   INTERNET_SERVICE_GOPHER = 2;
  637.   {$EXTERNALSYM INTERNET_SERVICE_GOPHER}
  638.   INTERNET_SERVICE_HTTP = 3;
  639.   {$EXTERNALSYM INTERNET_SERVICE_HTTP}
  640.  
  641. function InternetOpenUrlA(hInet: HINTERNET; lpszUrl: PAnsiChar;
  642.   lpszHeaders: PAnsiChar; dwHeadersLength: DWORD; dwFlags: DWORD;
  643.   dwContext: DWORD): HINTERNET; stdcall;
  644.   {$EXTERNALSYM InternetOpenUrlA}
  645. function InternetOpenUrlW(hInet: HINTERNET; lpszUrl: PWideChar;
  646.   lpszHeaders: PWideChar; dwHeadersLength: DWORD; dwFlags: DWORD;
  647.   dwContext: DWORD): HINTERNET; stdcall;
  648.   {$EXTERNALSYM InternetOpenUrlW}
  649. function InternetOpenUrl(hInet: HINTERNET; lpszUrl: PChar;
  650.   lpszHeaders: PChar; dwHeadersLength: DWORD; dwFlags: DWORD;
  651.   dwContext: DWORD): HINTERNET; stdcall;
  652.   {$EXTERNALSYM InternetOpenUrl}
  653.  
  654. function InternetReadFile(hFile: HINTERNET; lpBuffer: Pointer;
  655.   dwNumberOfBytesToRead: DWORD; var lpdwNumberOfBytesRead: DWORD): BOOL; stdcall;
  656.   {$EXTERNALSYM InternetReadFile}
  657.  
  658. function InternetReadFileExA(hFile: HINTERNET;  lpBuffersOut: Pointer;
  659.   dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
  660.   {$EXTERNALSYM InternetReadFileExA}
  661. function InternetReadFileExW(hFile: HINTERNET;  lpBuffersOut: Pointer;
  662.   dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
  663.   {$EXTERNALSYM InternetReadFileExW}
  664. function InternetReadFileEx(hFile: HINTERNET;  lpBuffersOut: Pointer;
  665.   dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
  666.   {$EXTERNALSYM InternetReadFileEx}
  667.  
  668. { flags for InternetReadFileEx() }
  669. const
  670.   IRF_ASYNC       = WININET_API_FLAG_ASYNC;
  671.   {$EXTERNALSYM IRF_ASYNC}
  672.   IRF_SYNC        = WININET_API_FLAG_SYNC;
  673.   {$EXTERNALSYM IRF_SYNC}
  674.   IRF_USE_CONTEXT = WININET_API_FLAG_USE_CONTEXT;
  675.   {$EXTERNALSYM IRF_USE_CONTEXT}
  676.   IRF_NO_WAIT     = $00000008;
  677.   {$EXTERNALSYM IRF_NO_WAIT}
  678.  
  679. function InternetSetFilePointer(hFile: HINTERNET;
  680.   lDistanceToMove: Longint; pReserved: Pointer;
  681.   dwMoveMethod, dwContext: DWORD): DWORD; stdcall;
  682.   {$EXTERNALSYM InternetSetFilePointer}
  683.  
  684. function InternetWriteFile(hFile: HINTERNET; lpBuffer: Pointer;
  685.   dwNumberOfBytesToWrite: DWORD;
  686.   var lpdwNumberOfBytesWritten: DWORD): BOOL; stdcall;
  687.   {$EXTERNALSYM InternetWriteFile}
  688.  
  689. function InternetQueryDataAvailable(hFile: HINTERNET; var lpdwNumberOfBytesAvailable: DWORD;
  690.   dwFlags, dwContext: DWORD): BOOL; stdcall;
  691.   {$EXTERNALSYM InternetQueryDataAvailable}
  692.  
  693. function InternetFindNextFileA(hFind: HINTERNET; lpvFindData: Pointer): BOOL; stdcall;
  694.   {$EXTERNALSYM InternetFindNextFileA}
  695. function InternetFindNextFileW(hFind: HINTERNET; lpvFindData: Pointer): BOOL; stdcall;
  696.   {$EXTERNALSYM InternetFindNextFileW}
  697. function InternetFindNextFile(hFind: HINTERNET; lpvFindData: Pointer): BOOL; stdcall;
  698.   {$EXTERNALSYM InternetFindNextFile}
  699.  
  700. function InternetQueryOptionA(hInet: HINTERNET; dwOption: DWORD;
  701.   lpBuffer: Pointer; var lpdwBufferLength: DWORD): BOOL; stdcall;
  702.   {$EXTERNALSYM InternetQueryOptionA}
  703. function InternetQueryOptionW(hInet: HINTERNET; dwOption: DWORD;
  704.   lpBuffer: Pointer; var lpdwBufferLength: DWORD): BOOL; stdcall;
  705.   {$EXTERNALSYM InternetQueryOptionW}
  706. function InternetQueryOption(hInet: HINTERNET; dwOption: DWORD;
  707.   lpBuffer: Pointer; var lpdwBufferLength: DWORD): BOOL; stdcall;
  708.   {$EXTERNALSYM InternetQueryOption}
  709.  
  710. function InternetSetOptionA(hInet: HINTERNET; dwOption: DWORD;
  711.   lpBuffer: Pointer; dwBufferLength: DWORD): BOOL; stdcall;
  712.   {$EXTERNALSYM InternetSetOptionA}
  713. function InternetSetOptionW(hInet: HINTERNET; dwOption: DWORD;
  714.   lpBuffer: Pointer; dwBufferLength: DWORD): BOOL; stdcall;
  715.   {$EXTERNALSYM InternetSetOptionW}
  716. function InternetSetOption(hInet: HINTERNET; dwOption: DWORD;
  717.   lpBuffer: Pointer; dwBufferLength: DWORD): BOOL; stdcall;
  718.   {$EXTERNALSYM InternetSetOption}
  719.  
  720. function InternetSetOptionExA(hInet: HINTERNET; dwOption: DWORD;
  721.   lpBuffer: Pointer; dwBufferLength, dwFlags: DWORD): BOOL; stdcall;
  722.   {$EXTERNALSYM InternetSetOptionExA}
  723. function InternetSetOptionExW(hInet: HINTERNET; dwOption: DWORD;
  724.   lpBuffer: Pointer; dwBufferLength, dwFlags: DWORD): BOOL; stdcall;
  725.   {$EXTERNALSYM InternetSetOptionExW}
  726. function InternetSetOptionEx(hInet: HINTERNET; dwOption: DWORD;
  727.   lpBuffer: Pointer; dwBufferLength, dwFlags: DWORD): BOOL; stdcall;
  728.   {$EXTERNALSYM InternetSetOptionEx}
  729.  
  730. function InternetLockRequestFile(hInternet: HINTERNET;
  731.   lphLockRequestInfo: PHandle): BOOL; stdcall;
  732.   {$EXTERNALSYM InternetLockRequestFile}
  733.  
  734. function InternetUnlockRequestFile(hLockRequestInfo: THANDLE): BOOL; stdcall;
  735.   {$EXTERNALSYM InternetUnlockRequestFile}
  736.  
  737. { flags for InternetSetOptionEx() }
  738. const
  739.   ISO_GLOBAL      = $00000001;  { modify option globally }
  740.   {$EXTERNALSYM ISO_GLOBAL}
  741.   ISO_REGISTRY    = $00000002;  { write option to registry (where applicable) }
  742.   {$EXTERNALSYM ISO_REGISTRY}
  743.   ISO_VALID_FLAGS = ISO_GLOBAL or ISO_REGISTRY;
  744.   {$EXTERNALSYM ISO_VALID_FLAGS}
  745.  
  746. { options manifests for Internet(Query or Set)Option }
  747. const
  748.   INTERNET_OPTION_CALLBACK = 1;
  749.   {$EXTERNALSYM INTERNET_OPTION_CALLBACK}
  750.   INTERNET_OPTION_CONNECT_TIMEOUT = 2;
  751.   {$EXTERNALSYM INTERNET_OPTION_CONNECT_TIMEOUT}
  752.   INTERNET_OPTION_CONNECT_RETRIES = 3;
  753.   {$EXTERNALSYM INTERNET_OPTION_CONNECT_RETRIES}
  754.   INTERNET_OPTION_CONNECT_BACKOFF = 4;
  755.   {$EXTERNALSYM INTERNET_OPTION_CONNECT_BACKOFF}
  756.   INTERNET_OPTION_SEND_TIMEOUT = 5;
  757.   {$EXTERNALSYM INTERNET_OPTION_SEND_TIMEOUT}
  758.   INTERNET_OPTION_CONTROL_SEND_TIMEOUT       = INTERNET_OPTION_SEND_TIMEOUT;
  759.   {$EXTERNALSYM INTERNET_OPTION_CONTROL_SEND_TIMEOUT}
  760.   INTERNET_OPTION_RECEIVE_TIMEOUT = 6;
  761.   {$EXTERNALSYM INTERNET_OPTION_RECEIVE_TIMEOUT}
  762.   INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT    = INTERNET_OPTION_RECEIVE_TIMEOUT;
  763.   {$EXTERNALSYM INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT}
  764.   INTERNET_OPTION_DATA_SEND_TIMEOUT = 7;
  765.   {$EXTERNALSYM INTERNET_OPTION_DATA_SEND_TIMEOUT}
  766.   INTERNET_OPTION_DATA_RECEIVE_TIMEOUT = 8;
  767.   {$EXTERNALSYM INTERNET_OPTION_DATA_RECEIVE_TIMEOUT}
  768.   INTERNET_OPTION_HANDLE_TYPE = 9;
  769.   {$EXTERNALSYM INTERNET_OPTION_HANDLE_TYPE}
  770.   INTERNET_OPTION_READ_BUFFER_SIZE = 12;
  771.   {$EXTERNALSYM INTERNET_OPTION_READ_BUFFER_SIZE}
  772.   INTERNET_OPTION_WRITE_BUFFER_SIZE = 13;
  773.   {$EXTERNALSYM INTERNET_OPTION_WRITE_BUFFER_SIZE}
  774.   INTERNET_OPTION_ASYNC_ID = 15;
  775.   {$EXTERNALSYM INTERNET_OPTION_ASYNC_ID}
  776.   INTERNET_OPTION_ASYNC_PRIORITY = 16;
  777.   {$EXTERNALSYM INTERNET_OPTION_ASYNC_PRIORITY}
  778.   INTERNET_OPTION_PARENT_HANDLE               = 21;
  779.   {$EXTERNALSYM INTERNET_OPTION_PARENT_HANDLE}
  780.   INTERNET_OPTION_KEEP_CONNECTION             = 22;
  781.   {$EXTERNALSYM INTERNET_OPTION_KEEP_CONNECTION}
  782.   INTERNET_OPTION_REQUEST_FLAGS               = 23;
  783.   {$EXTERNALSYM INTERNET_OPTION_REQUEST_FLAGS}
  784.   INTERNET_OPTION_EXTENDED_ERROR              = 24;
  785.   {$EXTERNALSYM INTERNET_OPTION_EXTENDED_ERROR}
  786.   INTERNET_OPTION_OFFLINE_MODE                = 26;
  787.   {$EXTERNALSYM INTERNET_OPTION_OFFLINE_MODE}
  788.   INTERNET_OPTION_CACHE_STREAM_HANDLE         = 27;
  789.   {$EXTERNALSYM INTERNET_OPTION_CACHE_STREAM_HANDLE}
  790.   INTERNET_OPTION_USERNAME                    = 28;
  791.   {$EXTERNALSYM INTERNET_OPTION_USERNAME}
  792.   INTERNET_OPTION_PASSWORD                    = 29;
  793.   {$EXTERNALSYM INTERNET_OPTION_PASSWORD}
  794.   INTERNET_OPTION_ASYNC                       = 30;
  795.   {$EXTERNALSYM INTERNET_OPTION_ASYNC}
  796.   INTERNET_OPTION_SECURITY_FLAGS              = 31;
  797.   {$EXTERNALSYM INTERNET_OPTION_SECURITY_FLAGS}
  798.   INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT = 32;
  799.   {$EXTERNALSYM INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT}
  800.   INTERNET_OPTION_DATAFILE_NAME               = 33;
  801.   {$EXTERNALSYM INTERNET_OPTION_DATAFILE_NAME}
  802.   INTERNET_OPTION_URL                         = 34;
  803.   {$EXTERNALSYM INTERNET_OPTION_URL}
  804.   INTERNET_OPTION_SECURITY_CERTIFICATE        = 35;
  805.   {$EXTERNALSYM INTERNET_OPTION_SECURITY_CERTIFICATE}
  806.   INTERNET_OPTION_SECURITY_KEY_BITNESS        = 36;
  807.   {$EXTERNALSYM INTERNET_OPTION_SECURITY_KEY_BITNESS}
  808.   INTERNET_OPTION_REFRESH                     = 37;
  809.   {$EXTERNALSYM INTERNET_OPTION_REFRESH}
  810.   INTERNET_OPTION_PROXY                       = 38;
  811.   {$EXTERNALSYM INTERNET_OPTION_PROXY}
  812.   INTERNET_OPTION_SETTINGS_CHANGED            = 39;
  813.   {$EXTERNALSYM INTERNET_OPTION_SETTINGS_CHANGED}
  814.   INTERNET_OPTION_VERSION                     = 40;
  815.   {$EXTERNALSYM INTERNET_OPTION_VERSION}
  816.   INTERNET_OPTION_USER_AGENT                  = 41;
  817.   {$EXTERNALSYM INTERNET_OPTION_USER_AGENT}
  818.   INTERNET_OPTION_END_BROWSER_SESSION         = 42;
  819.   {$EXTERNALSYM INTERNET_OPTION_END_BROWSER_SESSION}
  820.   INTERNET_OPTION_PROXY_USERNAME              = 43;
  821.   {$EXTERNALSYM INTERNET_OPTION_PROXY_USERNAME}
  822.   INTERNET_OPTION_PROXY_PASSWORD              = 44;
  823.   {$EXTERNALSYM INTERNET_OPTION_PROXY_PASSWORD}
  824.   INTERNET_OPTION_CONTEXT_VALUE               = 45;
  825.   {$EXTERNALSYM INTERNET_OPTION_CONTEXT_VALUE}
  826.   INTERNET_OPTION_CONNECT_LIMIT               = 46;
  827.   {$EXTERNALSYM INTERNET_OPTION_CONNECT_LIMIT}
  828.   INTERNET_OPTION_SECURITY_SELECT_CLIENT_CERT = 47;
  829.   {$EXTERNALSYM INTERNET_OPTION_SECURITY_SELECT_CLIENT_CERT}
  830.   INTERNET_OPTION_POLICY                      = 48;
  831.   {$EXTERNALSYM INTERNET_OPTION_POLICY}
  832.   INTERNET_OPTION_DISCONNECTED_TIMEOUT        = 49;
  833.   {$EXTERNALSYM INTERNET_OPTION_DISCONNECTED_TIMEOUT}
  834.   INTERNET_OPTION_CONNECTED_STATE             = 50;
  835.   {$EXTERNALSYM INTERNET_OPTION_CONNECTED_STATE}
  836.   INTERNET_OPTION_IDLE_STATE                  = 51;
  837.   {$EXTERNALSYM INTERNET_OPTION_IDLE_STATE}
  838.   INTERNET_OPTION_OFFLINE_SEMANTICS           = 52;
  839.   {$EXTERNALSYM INTERNET_OPTION_OFFLINE_SEMANTICS}
  840.   INTERNET_OPTION_SECONDARY_CACHE_KEY         = 53;
  841.   {$EXTERNALSYM INTERNET_OPTION_SECONDARY_CACHE_KEY}
  842.   INTERNET_OPTION_CALLBACK_FILTER             = 54;
  843.   {$EXTERNALSYM INTERNET_OPTION_CALLBACK_FILTER}
  844.   INTERNET_OPTION_CONNECT_TIME                = 55;
  845.   {$EXTERNALSYM INTERNET_OPTION_CONNECT_TIME}
  846.   INTERNET_OPTION_SEND_THROUGHPUT             = 56;
  847.   {$EXTERNALSYM INTERNET_OPTION_SEND_THROUGHPUT}
  848.   INTERNET_OPTION_RECEIVE_THROUGHPUT          = 57;
  849.   {$EXTERNALSYM INTERNET_OPTION_RECEIVE_THROUGHPUT}
  850.   INTERNET_OPTION_REQUEST_PRIORITY            = 58;
  851.   {$EXTERNALSYM INTERNET_OPTION_REQUEST_PRIORITY}
  852.   INTERNET_OPTION_HTTP_VERSION                = 59;
  853.   {$EXTERNALSYM INTERNET_OPTION_HTTP_VERSION}
  854.   INTERNET_OPTION_RESET_URLCACHE_SESSION      = 60;
  855.   {$EXTERNALSYM INTERNET_OPTION_RESET_URLCACHE_SESSION}
  856.   INTERNET_OPTION_ERROR_MASK                  = 62;
  857.   {$EXTERNALSYM INTERNET_OPTION_ERROR_MASK}
  858.   INTERNET_FIRST_OPTION                      = INTERNET_OPTION_CALLBACK;
  859.   {$EXTERNALSYM INTERNET_FIRST_OPTION}
  860.   INTERNET_LAST_OPTION                       = INTERNET_OPTION_PROXY;
  861.   {$EXTERNALSYM INTERNET_LAST_OPTION}
  862.  
  863. { values for INTERNET_OPTION_PRIORITY }
  864.  
  865.   INTERNET_PRIORITY_FOREGROUND = 1000;
  866.   {$EXTERNALSYM INTERNET_PRIORITY_FOREGROUND}
  867.  
  868. { handle types }
  869.  
  870.   INTERNET_HANDLE_TYPE_INTERNET = 1;
  871.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_INTERNET}
  872.   INTERNET_HANDLE_TYPE_CONNECT_FTP = 2;
  873.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_CONNECT_FTP}
  874.   INTERNET_HANDLE_TYPE_CONNECT_GOPHER = 3;
  875.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_CONNECT_GOPHER}
  876.   INTERNET_HANDLE_TYPE_CONNECT_HTTP = 4;
  877.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_CONNECT_HTTP}
  878.   INTERNET_HANDLE_TYPE_FTP_FIND = 5;
  879.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_FTP_FIND}
  880.   INTERNET_HANDLE_TYPE_FTP_FIND_HTML = 6;
  881.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_FTP_FIND_HTML}
  882.   INTERNET_HANDLE_TYPE_FTP_FILE = 7;
  883.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_FTP_FILE}
  884.   INTERNET_HANDLE_TYPE_FTP_FILE_HTML = 8;
  885.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_FTP_FILE_HTML}
  886.   INTERNET_HANDLE_TYPE_GOPHER_FIND = 9;
  887.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_GOPHER_FIND}
  888.   INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML = 10;
  889.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML}
  890.   INTERNET_HANDLE_TYPE_GOPHER_FILE = 11;
  891.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_GOPHER_FILE}
  892.   INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML = 12;
  893.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML}
  894.   INTERNET_HANDLE_TYPE_HTTP_REQUEST = 13;
  895.   {$EXTERNALSYM INTERNET_HANDLE_TYPE_HTTP_REQUEST}
  896.  
  897. { values for INTERNET_OPTION_SECURITY_FLAGS }
  898.  
  899.   SECURITY_FLAG_SECURE                        = $00000001; { can query only }
  900.   {$EXTERNALSYM SECURITY_FLAG_SECURE}
  901.   SECURITY_FLAG_SSL                           = $00000002;
  902.   {$EXTERNALSYM SECURITY_FLAG_SSL}
  903.   SECURITY_FLAG_SSL3                          = $00000004;
  904.   {$EXTERNALSYM SECURITY_FLAG_SSL3}
  905.   SECURITY_FLAG_PCT                           = $00000008;
  906.   {$EXTERNALSYM SECURITY_FLAG_PCT}
  907.   SECURITY_FLAG_PCT4                          = $00000010;
  908.   {$EXTERNALSYM SECURITY_FLAG_PCT4}
  909.   SECURITY_FLAG_IETFSSL4                      = $00000020;
  910.   {$EXTERNALSYM SECURITY_FLAG_IETFSSL4}
  911.   SECURITY_FLAG_STRENGTH_WEAK                 = $10000000;
  912.   {$EXTERNALSYM SECURITY_FLAG_STRENGTH_WEAK}
  913.   SECURITY_FLAG_STRENGTH_MEDIUM               = $40000000;
  914.   {$EXTERNALSYM SECURITY_FLAG_STRENGTH_MEDIUM}
  915.   SECURITY_FLAG_STRENGTH_STRONG               = $20000000;
  916.   {$EXTERNALSYM SECURITY_FLAG_STRENGTH_STRONG}
  917.   SECURITY_FLAG_40BIT                         = SECURITY_FLAG_STRENGTH_WEAK;
  918.   {$EXTERNALSYM SECURITY_FLAG_40BIT}
  919.   SECURITY_FLAG_128BIT                        = SECURITY_FLAG_STRENGTH_STRONG;
  920.   {$EXTERNALSYM SECURITY_FLAG_128BIT}
  921.   SECURITY_FLAG_56BIT                         = SECURITY_FLAG_STRENGTH_MEDIUM;
  922.   {$EXTERNALSYM SECURITY_FLAG_56BIT}
  923.   SECURITY_FLAG_UNKNOWNBIT                    = $80000000;
  924.   {$EXTERNALSYM SECURITY_FLAG_UNKNOWNBIT}
  925.   SECURITY_FLAG_NORMALBITNESS                 = SECURITY_FLAG_40BIT;
  926.   {$EXTERNALSYM SECURITY_FLAG_NORMALBITNESS}
  927.   SECURITY_FLAG_IGNORE_REVOCATION             = $00000080;
  928.   {$EXTERNALSYM SECURITY_FLAG_IGNORE_REVOCATION}
  929.   SECURITY_FLAG_IGNORE_UNKNOWN_CA             = $00000100;
  930.   {$EXTERNALSYM SECURITY_FLAG_IGNORE_UNKNOWN_CA}
  931.   SECURITY_FLAG_IGNORE_WRONG_USAGE            = $00000200;
  932.   {$EXTERNALSYM SECURITY_FLAG_IGNORE_WRONG_USAGE}
  933.   SECURITY_FLAG_IGNORE_CERT_CN_INVALID        = INTERNET_FLAG_IGNORE_CERT_CN_INVALID;
  934.   {$EXTERNALSYM SECURITY_FLAG_IGNORE_CERT_CN_INVALID}
  935.   SECURITY_FLAG_IGNORE_CERT_DATE_INVALID      = INTERNET_FLAG_IGNORE_CERT_DATE_INVALID;
  936.   {$EXTERNALSYM SECURITY_FLAG_IGNORE_CERT_DATE_INVALID}
  937.   SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS      = INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS;
  938.   {$EXTERNALSYM SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS}
  939.   SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP       = INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP;
  940.   {$EXTERNALSYM SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP}
  941.  
  942. function InternetGetLastResponseInfoA(var lpdwError: DWORD; lpszBuffer: PAnsiChar;
  943.   var lpdwBufferLength: DWORD): BOOL; stdcall;
  944.   {$EXTERNALSYM InternetGetLastResponseInfoA}
  945. function InternetGetLastResponseInfoW(var lpdwError: DWORD; lpszBuffer: PWideChar;
  946.   var lpdwBufferLength: DWORD): BOOL; stdcall;
  947.   {$EXTERNALSYM InternetGetLastResponseInfoW}
  948. function InternetGetLastResponseInfo(var lpdwError: DWORD; lpszBuffer: PChar;
  949.   var lpdwBufferLength: DWORD): BOOL; stdcall;
  950.   {$EXTERNALSYM InternetGetLastResponseInfo}
  951.  
  952. { callback function for InternetSetStatusCallback }
  953. type
  954.  
  955.  
  956.  
  957.  
  958.   INTERNET_STATUS_CALLBACK = TFarProc;
  959.   {$EXTERNALSYM INTERNET_STATUS_CALLBACK}
  960.   TFNInternetStatusCallback = INTERNET_STATUS_CALLBACK;
  961.   PFNInternetStatusCallback = ^TFNInternetStatusCallback;
  962.   LPINTERNET_STATUS_CALLBACK = PFNInternetStatusCallback;
  963.   {$EXTERNALSYM LPINTERNET_STATUS_CALLBACK}
  964.  
  965. function InternetSetStatusCallback(hInet: HINTERNET;
  966.   lpfnInternetCallback: PFNInternetStatusCallback): PFNInternetStatusCallback; stdcall;
  967.   {$EXTERNALSYM InternetSetStatusCallback}
  968.  
  969. { status manifests for Internet status callback }
  970. const
  971.   INTERNET_STATUS_RESOLVING_NAME              = 10;
  972.   {$EXTERNALSYM INTERNET_STATUS_RESOLVING_NAME}
  973.   INTERNET_STATUS_NAME_RESOLVED               = 11;
  974.   {$EXTERNALSYM INTERNET_STATUS_NAME_RESOLVED}
  975.   INTERNET_STATUS_CONNECTING_TO_SERVER        = 20;
  976.   {$EXTERNALSYM INTERNET_STATUS_CONNECTING_TO_SERVER}
  977.   INTERNET_STATUS_CONNECTED_TO_SERVER         = 21;
  978.   {$EXTERNALSYM INTERNET_STATUS_CONNECTED_TO_SERVER}
  979.   INTERNET_STATUS_SENDING_REQUEST             = 30;
  980.   {$EXTERNALSYM INTERNET_STATUS_SENDING_REQUEST}
  981.   INTERNET_STATUS_REQUEST_SENT                = 31;
  982.   {$EXTERNALSYM INTERNET_STATUS_REQUEST_SENT}
  983.   INTERNET_STATUS_RECEIVING_RESPONSE          = 40;
  984.   {$EXTERNALSYM INTERNET_STATUS_RECEIVING_RESPONSE}
  985.   INTERNET_STATUS_RESPONSE_RECEIVED           = 41;
  986.   {$EXTERNALSYM INTERNET_STATUS_RESPONSE_RECEIVED}
  987.   INTERNET_STATUS_CTL_RESPONSE_RECEIVED       = 42;
  988.   {$EXTERNALSYM INTERNET_STATUS_CTL_RESPONSE_RECEIVED}
  989.   INTERNET_STATUS_PREFETCH                    = 43;
  990.   {$EXTERNALSYM INTERNET_STATUS_PREFETCH}
  991.   INTERNET_STATUS_CLOSING_CONNECTION          = 50;
  992.   {$EXTERNALSYM INTERNET_STATUS_CLOSING_CONNECTION}
  993.   INTERNET_STATUS_CONNECTION_CLOSED           = 51;
  994.   {$EXTERNALSYM INTERNET_STATUS_CONNECTION_CLOSED}
  995.   INTERNET_STATUS_HANDLE_CREATED              = 60;
  996.   {$EXTERNALSYM INTERNET_STATUS_HANDLE_CREATED}
  997.   INTERNET_STATUS_HANDLE_CLOSING              = 70;
  998.   {$EXTERNALSYM INTERNET_STATUS_HANDLE_CLOSING}
  999.   INTERNET_STATUS_REQUEST_COMPLETE            = 100;
  1000.   {$EXTERNALSYM INTERNET_STATUS_REQUEST_COMPLETE}
  1001.   INTERNET_STATUS_REDIRECT                    = 110;
  1002.   {$EXTERNALSYM INTERNET_STATUS_REDIRECT}
  1003.   INTERNET_STATUS_INTERMEDIATE_RESPONSE       = 120;
  1004.   {$EXTERNALSYM INTERNET_STATUS_INTERMEDIATE_RESPONSE}
  1005.   INTERNET_STATUS_STATE_CHANGE                = 200;
  1006.   {$EXTERNALSYM INTERNET_STATUS_STATE_CHANGE}
  1007.  
  1008. { the following can be indicated in a state change notification: }
  1009.   INTERNET_STATE_CONNECTED                    = $00000001;  { connected state (mutually exclusive with disconnected) }
  1010.   {$EXTERNALSYM INTERNET_STATE_CONNECTED}
  1011.   INTERNET_STATE_DISCONNECTED                 = $00000002;  { disconnected from network }
  1012.   {$EXTERNALSYM INTERNET_STATE_DISCONNECTED}
  1013.   INTERNET_STATE_DISCONNECTED_BY_USER         = $00000010;  { disconnected by user request }
  1014.   {$EXTERNALSYM INTERNET_STATE_DISCONNECTED_BY_USER}
  1015.   INTERNET_STATE_IDLE                         = $00000100;  { no network requests being made (by Wininet) }
  1016.   {$EXTERNALSYM INTERNET_STATE_IDLE}
  1017.   INTERNET_STATE_BUSY                         = $00000200;  { network requests being made (by Wininet) }
  1018.   {$EXTERNALSYM INTERNET_STATE_BUSY}
  1019.  
  1020. { if the following value is returned by InternetSetStatusCallback, then }
  1021. { probably an invalid (non-code) address was supplied for the callback }
  1022.  
  1023.   INTERNET_INVALID_STATUS_CALLBACK = (-1);
  1024.   {$EXTERNALSYM INTERNET_INVALID_STATUS_CALLBACK}
  1025.  
  1026. { prototypes }
  1027.  
  1028. function FtpFindFirstFileA(hConnect: HINTERNET; lpszSearchFile: PAnsiChar;
  1029.   var lpFindFileData: TWin32FindDataA; dwFlags: DWORD;
  1030.   dwContext: DWORD): HINTERNET; stdcall;
  1031.   {$EXTERNALSYM FtpFindFirstFileA}
  1032. function FtpFindFirstFileW(hConnect: HINTERNET; lpszSearchFile: PWideChar;
  1033.   var lpFindFileData: TWin32FindDataW; dwFlags: DWORD;
  1034.   dwContext: DWORD): HINTERNET; stdcall;
  1035.   {$EXTERNALSYM FtpFindFirstFileW}
  1036. function FtpFindFirstFile(hConnect: HINTERNET; lpszSearchFile: PChar;
  1037.   var lpFindFileData: TWin32FindData; dwFlags: DWORD;
  1038.   dwContext: DWORD): HINTERNET; stdcall;
  1039.   {$EXTERNALSYM FtpFindFirstFile}
  1040.  
  1041. function FtpGetFileA(hConnect: HINTERNET; lpszRemoteFile: PAnsiChar;
  1042.   lpszNewFile: PAnsiChar; fFailIfExists: BOOL; dwFlagsAndAttributes: DWORD;
  1043.   dwFlags: DWORD; dwContext: DWORD): BOOL stdcall;
  1044.   {$EXTERNALSYM FtpGetFileA}
  1045. function FtpGetFileW(hConnect: HINTERNET; lpszRemoteFile: PWideChar;
  1046.   lpszNewFile: PWideChar; fFailIfExists: BOOL; dwFlagsAndAttributes: DWORD;
  1047.   dwFlags: DWORD; dwContext: DWORD): BOOL stdcall;
  1048.   {$EXTERNALSYM FtpGetFileW}
  1049. function FtpGetFile(hConnect: HINTERNET; lpszRemoteFile: PChar;
  1050.   lpszNewFile: PChar; fFailIfExists: BOOL; dwFlagsAndAttributes: DWORD;
  1051.   dwFlags: DWORD; dwContext: DWORD): BOOL stdcall;
  1052.   {$EXTERNALSYM FtpGetFile}
  1053.  
  1054. function FtpPutFileA(hConnect: HINTERNET; lpszLocalFile: PAnsiChar;
  1055.   lpszNewRemoteFile: PAnsiChar; dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
  1056.   {$EXTERNALSYM FtpPutFileA}
  1057. function FtpPutFileW(hConnect: HINTERNET; lpszLocalFile: PWideChar;
  1058.   lpszNewRemoteFile: PWideChar; dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
  1059.   {$EXTERNALSYM FtpPutFileW}
  1060. function FtpPutFile(hConnect: HINTERNET; lpszLocalFile: PChar;
  1061.   lpszNewRemoteFile: PChar; dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
  1062.   {$EXTERNALSYM FtpPutFile}
  1063.  
  1064. function FtpDeleteFileA(hConnect: HINTERNET; lpszFileName: PAnsiChar): BOOL; stdcall;
  1065.   {$EXTERNALSYM FtpDeleteFileA}
  1066. function FtpDeleteFileW(hConnect: HINTERNET; lpszFileName: PWideChar): BOOL; stdcall;
  1067.   {$EXTERNALSYM FtpDeleteFileW}
  1068. function FtpDeleteFile(hConnect: HINTERNET; lpszFileName: PChar): BOOL; stdcall;
  1069.   {$EXTERNALSYM FtpDeleteFile}
  1070.  
  1071. function FtpRenameFileA(hConnect: HINTERNET; lpszExisting: PAnsiChar;
  1072.   lpszNew: PAnsiChar): BOOL; stdcall;
  1073.   {$EXTERNALSYM FtpRenameFileA}
  1074. function FtpRenameFileW(hConnect: HINTERNET; lpszExisting: PWideChar;
  1075.   lpszNew: PWideChar): BOOL; stdcall;
  1076.   {$EXTERNALSYM FtpRenameFileW}
  1077. function FtpRenameFile(hConnect: HINTERNET; lpszExisting: PChar;
  1078.   lpszNew: PChar): BOOL; stdcall;
  1079.   {$EXTERNALSYM FtpRenameFile}
  1080.  
  1081. function FtpOpenFileA(hConnect: HINTERNET; lpszFileName: PAnsiChar;
  1082.   dwAccess: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
  1083.   {$EXTERNALSYM FtpOpenFileA}
  1084. function FtpOpenFileW(hConnect: HINTERNET; lpszFileName: PWideChar;
  1085.   dwAccess: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
  1086.   {$EXTERNALSYM FtpOpenFileW}
  1087. function FtpOpenFile(hConnect: HINTERNET; lpszFileName: PChar;
  1088.   dwAccess: DWORD; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
  1089.   {$EXTERNALSYM FtpOpenFile}
  1090.  
  1091. function FtpCreateDirectoryA(hConnect: HINTERNET; lpszDirectory: PAnsiChar): BOOL; stdcall;
  1092.   {$EXTERNALSYM FtpCreateDirectoryA}
  1093. function FtpCreateDirectoryW(hConnect: HINTERNET; lpszDirectory: PWideChar): BOOL; stdcall;
  1094.   {$EXTERNALSYM FtpCreateDirectoryW}
  1095. function FtpCreateDirectory(hConnect: HINTERNET; lpszDirectory: PChar): BOOL; stdcall;
  1096.   {$EXTERNALSYM FtpCreateDirectory}
  1097.  
  1098. function FtpRemoveDirectoryA(hConnect: HINTERNET; lpszDirectory: PAnsiChar): BOOL; stdcall;
  1099.   {$EXTERNALSYM FtpRemoveDirectoryA}
  1100. function FtpRemoveDirectoryW(hConnect: HINTERNET; lpszDirectory: PWideChar): BOOL; stdcall;
  1101.   {$EXTERNALSYM FtpRemoveDirectoryW}
  1102. function FtpRemoveDirectory(hConnect: HINTERNET; lpszDirectory: PChar): BOOL; stdcall;
  1103.   {$EXTERNALSYM FtpRemoveDirectory}
  1104.  
  1105. function FtpSetCurrentDirectoryA(hConnect: HINTERNET; lpszDirectory: PAnsiChar): BOOL; stdcall;
  1106.   {$EXTERNALSYM FtpSetCurrentDirectoryA}
  1107. function FtpSetCurrentDirectoryW(hConnect: HINTERNET; lpszDirectory: PWideChar): BOOL; stdcall;
  1108.   {$EXTERNALSYM FtpSetCurrentDirectoryW}
  1109. function FtpSetCurrentDirectory(hConnect: HINTERNET; lpszDirectory: PChar): BOOL; stdcall;
  1110.   {$EXTERNALSYM FtpSetCurrentDirectory}
  1111.  
  1112. function FtpGetCurrentDirectoryA(hConnect: HINTERNET;
  1113.   lpszCurrentDirectory: PAnsiChar; var lpdwCurrentDirectory: DWORD): BOOL; stdcall;
  1114.   {$EXTERNALSYM FtpGetCurrentDirectoryA}
  1115. function FtpGetCurrentDirectoryW(hConnect: HINTERNET;
  1116.   lpszCurrentDirectory: PWideChar; var lpdwCurrentDirectory: DWORD): BOOL; stdcall;
  1117.   {$EXTERNALSYM FtpGetCurrentDirectoryW}
  1118. function FtpGetCurrentDirectory(hConnect: HINTERNET;
  1119.   lpszCurrentDirectory: PChar; var lpdwCurrentDirectory: DWORD): BOOL; stdcall;
  1120.   {$EXTERNALSYM FtpGetCurrentDirectory}
  1121.  
  1122. function FtpCommandA(hConnect: HINTERNET; fExpectResponse: BOOL;
  1123.   dwFlags: DWORD; lpszCommand: PAnsiChar; dwContext: DWORD): BOOL; stdcall;
  1124.   {$EXTERNALSYM FtpCommandA}
  1125. function FtpCommandW(hConnect: HINTERNET; fExpectResponse: BOOL;
  1126.   dwFlags: DWORD; lpszCommand: PWideChar; dwContext: DWORD): BOOL; stdcall;
  1127.   {$EXTERNALSYM FtpCommandW}
  1128. function FtpCommand(hConnect: HINTERNET; fExpectResponse: BOOL;
  1129.   dwFlags: DWORD; lpszCommand: PChar; dwContext: DWORD): BOOL; stdcall;
  1130.   {$EXTERNALSYM FtpCommand}
  1131.  
  1132. { Gopher }
  1133.  
  1134. { manifests }
  1135.  
  1136. { string field lengths (in characters, not bytes) }
  1137. const
  1138.   MAX_GOPHER_DISPLAY_TEXT   = 128;
  1139.   {$EXTERNALSYM MAX_GOPHER_DISPLAY_TEXT}
  1140.   MAX_GOPHER_SELECTOR_TEXT  = 256;
  1141.   {$EXTERNALSYM MAX_GOPHER_SELECTOR_TEXT}
  1142.   MAX_GOPHER_HOST_NAME      = INTERNET_MAX_HOST_NAME_LENGTH;
  1143.   {$EXTERNALSYM MAX_GOPHER_HOST_NAME}
  1144.   MAX_GOPHER_LOCATOR_LENGTH = 1
  1145.                               + MAX_GOPHER_DISPLAY_TEXT
  1146.                               + 1
  1147.                               + MAX_GOPHER_SELECTOR_TEXT
  1148.                               + 1
  1149.                               + MAX_GOPHER_HOST_NAME
  1150.                               + 1
  1151.                               + INTERNET_MAX_PORT_NUMBER_LENGTH
  1152.                               + 1
  1153.                               + 1
  1154.                               + 2;
  1155.   {$EXTERNALSYM MAX_GOPHER_LOCATOR_LENGTH}
  1156.  
  1157. { structures/types }
  1158.  
  1159. { GOPHER_FIND_DATA - returns the results of a GopherFindFirstFile/ }
  1160. { InternetFindNextFile request }
  1161.  
  1162. type
  1163.   PGopherFindDataA = ^GOPHER_FIND_DATAA;
  1164.   PGopherFindDataW = ^GOPHER_FIND_DATAW;
  1165.   PGopherFindData = PGopherFindDataA;
  1166.   GOPHER_FIND_DATAA = record
  1167.     DisplayString: packed array[0..MAX_GOPHER_DISPLAY_TEXT-1] of AnsiChar;
  1168.     GopherType: DWORD;  { GopherType - if known }
  1169.     SizeLow: DWORD;
  1170.     SizeHigh: DWORD;
  1171.     LastModificationTime: TFileTime;
  1172.     Locator: packed array[0..MAX_GOPHER_LOCATOR_LENGTH-1] of AnsiChar;
  1173.   end;
  1174.   {$EXTERNALSYM GOPHER_FIND_DATAA}
  1175.   GOPHER_FIND_DATAW = record
  1176.     DisplayString: packed array[0..MAX_GOPHER_DISPLAY_TEXT-1] of WideChar;
  1177.     GopherType: DWORD;  { GopherType - if known }
  1178.     SizeLow: DWORD;
  1179.     SizeHigh: DWORD;
  1180.     LastModificationTime: TFileTime;
  1181.     Locator: packed array[0..MAX_GOPHER_LOCATOR_LENGTH-1] of WideChar;
  1182.   end;
  1183.   {$EXTERNALSYM GOPHER_FIND_DATAW}
  1184.   GOPHER_FIND_DATA = GOPHER_FIND_DATAA;
  1185.   TGopherFindDataA = GOPHER_FIND_DATAA;
  1186.   LPGOPHER_FIND_DATAA = PGopherFindDataA;
  1187.   {$EXTERNALSYM LPGOPHER_FIND_DATAA}
  1188.   TGopherFindDataW = GOPHER_FIND_DATAW;
  1189.   LPGOPHER_FIND_DATAW = PGopherFindDataW;
  1190.   {$EXTERNALSYM LPGOPHER_FIND_DATAW}
  1191.   TGopherFindData = TGopherFindDataA;
  1192.  
  1193. { manifests for GopherType }
  1194. const
  1195.   GOPHER_TYPE_TEXT_FILE = $00000001;
  1196.   {$EXTERNALSYM GOPHER_TYPE_TEXT_FILE}
  1197.   GOPHER_TYPE_DIRECTORY = $00000002;
  1198.   {$EXTERNALSYM GOPHER_TYPE_DIRECTORY}
  1199.   GOPHER_TYPE_CSO = $00000004;
  1200.   {$EXTERNALSYM GOPHER_TYPE_CSO}
  1201.   GOPHER_TYPE_ERROR = $00000008;
  1202.   {$EXTERNALSYM GOPHER_TYPE_ERROR}
  1203.   GOPHER_TYPE_MAC_BINHEX = $00000010;
  1204.   {$EXTERNALSYM GOPHER_TYPE_MAC_BINHEX}
  1205.   GOPHER_TYPE_DOS_ARCHIVE = $00000020;
  1206.   {$EXTERNALSYM GOPHER_TYPE_DOS_ARCHIVE}
  1207.   GOPHER_TYPE_UNIX_UUENCODED = $00000040;
  1208.   {$EXTERNALSYM GOPHER_TYPE_UNIX_UUENCODED}
  1209.   GOPHER_TYPE_INDEX_SERVER = $00000080;
  1210.   {$EXTERNALSYM GOPHER_TYPE_INDEX_SERVER}
  1211.   GOPHER_TYPE_TELNET = $00000100;
  1212.   {$EXTERNALSYM GOPHER_TYPE_TELNET}
  1213.   GOPHER_TYPE_BINARY = $00000200;
  1214.   {$EXTERNALSYM GOPHER_TYPE_BINARY}
  1215.   GOPHER_TYPE_REDUNDANT = $00000400;
  1216.   {$EXTERNALSYM GOPHER_TYPE_REDUNDANT}
  1217.   GOPHER_TYPE_TN3270 = $00000800;
  1218.   {$EXTERNALSYM GOPHER_TYPE_TN3270}
  1219.   GOPHER_TYPE_GIF = $00001000;
  1220.   {$EXTERNALSYM GOPHER_TYPE_GIF}
  1221.   GOPHER_TYPE_IMAGE = $00002000;
  1222.   {$EXTERNALSYM GOPHER_TYPE_IMAGE}
  1223.   GOPHER_TYPE_BITMAP = $00004000;
  1224.   {$EXTERNALSYM GOPHER_TYPE_BITMAP}
  1225.   GOPHER_TYPE_MOVIE = $00008000;
  1226.   {$EXTERNALSYM GOPHER_TYPE_MOVIE}
  1227.   GOPHER_TYPE_SOUND = $00010000;
  1228.   {$EXTERNALSYM GOPHER_TYPE_SOUND}
  1229.   GOPHER_TYPE_HTML = $00020000;
  1230.   {$EXTERNALSYM GOPHER_TYPE_HTML}
  1231.   GOPHER_TYPE_PDF = $00040000;
  1232.   {$EXTERNALSYM GOPHER_TYPE_PDF}
  1233.   GOPHER_TYPE_CALENDAR = $00080000;
  1234.   {$EXTERNALSYM GOPHER_TYPE_CALENDAR}
  1235.   GOPHER_TYPE_INLINE = $00100000;
  1236.   {$EXTERNALSYM GOPHER_TYPE_INLINE}
  1237.   GOPHER_TYPE_UNKNOWN = $20000000;
  1238.   {$EXTERNALSYM GOPHER_TYPE_UNKNOWN}
  1239.   GOPHER_TYPE_ASK = $40000000;
  1240.   {$EXTERNALSYM GOPHER_TYPE_ASK}
  1241.   GOPHER_TYPE_GOPHER_PLUS = $80000000;
  1242.   {$EXTERNALSYM GOPHER_TYPE_GOPHER_PLUS}
  1243.  
  1244. { Gopher Type functions }
  1245.  
  1246. function IS_GOPHER_FILE(GopherType: DWORD): BOOL;
  1247.   {$EXTERNALSYM IS_GOPHER_FILE}
  1248. function IS_GOPHER_DIRECTORY(GopherType: DWORD): BOOL;
  1249.   {$EXTERNALSYM IS_GOPHER_DIRECTORY}
  1250. function IS_GOPHER_PHONE_SERVER(GopherType: DWORD): BOOL;
  1251.   {$EXTERNALSYM IS_GOPHER_PHONE_SERVER
  1252. function IS_GOPHER_ERROR(GopherType: DWORD): BOOL;
  1253.   {$EXTERNALSYM IS_GOPHER_ERROR}
  1254. function IS_GOPHER_INDEX_SERVER(GopherType: DWORD): BOOL;
  1255.   {$EXTERNALSYM IS_GOPHER_INDEX_SERVER}
  1256. function IS_GOPHER_TELNET_SESSION(GopherType: DWORD): BOOL;
  1257.   {$EXTERNALSYM IS_GOPHER_TELNET_SESSION}
  1258. function IS_GOPHER_BACKUP_SERVER(GopherType: DWORD): BOOL;
  1259.   {$EXTERNALSYM IS_GOPHER_BACKUP_SERVER}
  1260. function IS_GOPHER_TN3270_SESSION(GopherType: DWORD): BOOL;
  1261.   {$EXTERNALSYM IS_GOPHER_TN3270_SESSION}
  1262. function IS_GOPHER_ASK(GopherType: DWORD): BOOL;
  1263.   {$EXTERNALSYM IS_GOPHER_ASK}
  1264. function IS_GOPHER_PLUS(GopherType: DWORD): BOOL;
  1265.   {$EXTERNALSYM IS_GOPHER_PLUS}
  1266. function IS_GOPHER_TYPE_KNOWN(GopherType: DWORD): BOOL;
  1267.   {$EXTERNALSYM IS_GOPHER_TYPE_KNOWN}
  1268.  
  1269. { GOPHER_TYPE_FILE_MASK - use this to determine if a locator identifies a }
  1270. { (known) file type }
  1271. const
  1272.   GOPHER_TYPE_FILE_MASK = GOPHER_TYPE_TEXT_FILE
  1273.                           or GOPHER_TYPE_MAC_BINHEX
  1274.                           or GOPHER_TYPE_DOS_ARCHIVE
  1275.                           or GOPHER_TYPE_UNIX_UUENCODED
  1276.                           or GOPHER_TYPE_BINARY
  1277.                           or GOPHER_TYPE_GIF
  1278.                           or GOPHER_TYPE_IMAGE
  1279.                           or GOPHER_TYPE_BITMAP
  1280.                           or GOPHER_TYPE_MOVIE
  1281.                           or GOPHER_TYPE_SOUND
  1282.                           or GOPHER_TYPE_HTML
  1283.                           or GOPHER_TYPE_PDF
  1284.                           or GOPHER_TYPE_CALENDAR
  1285.                           or GOPHER_TYPE_INLINE;
  1286.   {$EXTERNALSYM GOPHER_TYPE_FILE_MASK}
  1287.  
  1288. { structured gopher attributes (as defined in gopher+ protocol document) }
  1289. type
  1290.   PGopherAdminAttributeType = ^GOPHER_ADMIN_ATTRIBUTE_TYPE;
  1291.   GOPHER_ADMIN_ATTRIBUTE_TYPE = record
  1292.     Comment: LPCSTR;
  1293.     EmailAddress: LPCSTR;
  1294.   end;
  1295.   {$EXTERNALSYM GOPHER_ADMIN_ATTRIBUTE_TYPE}
  1296.   TGopherAdminAttributeType = GOPHER_ADMIN_ATTRIBUTE_TYPE;
  1297.   LPGOPHER_ADMIN_ATTRIBUTE_TYPE = PGopherAdminAttributeType;
  1298.   {$EXTERNALSYM LPGOPHER_ADMIN_ATTRIBUTE_TYPE}
  1299.  
  1300.   PGopherModDateAttributeType = ^GOPHER_MOD_DATE_ATTRIBUTE_TYPE;
  1301.   GOPHER_MOD_DATE_ATTRIBUTE_TYPE = record
  1302.     DateAndTime: TFileTime;
  1303.   end;
  1304.   {$EXTERNALSYM GOPHER_MOD_DATE_ATTRIBUTE_TYPE}
  1305.   TGopherModDateAttributeType = GOPHER_MOD_DATE_ATTRIBUTE_TYPE;
  1306.   LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE = PGopherModDateAttributeType;
  1307.   {$EXTERNALSYM LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE}
  1308.  
  1309.   PGopherTtlAttributeType = ^GOPHER_TTL_ATTRIBUTE_TYPE;
  1310.   GOPHER_TTL_ATTRIBUTE_TYPE = record
  1311.     Ttl: DWORD;
  1312.   end;
  1313.   {$EXTERNALSYM GOPHER_TTL_ATTRIBUTE_TYPE}
  1314.   TGopherTtlAttributeType = GOPHER_TTL_ATTRIBUTE_TYPE;
  1315.   LPGOPHER_TTL_ATTRIBUTE_TYPE = PGopherTtlAttributeType;
  1316.   {$EXTERNALSYM LPGOPHER_TTL_ATTRIBUTE_TYPE}
  1317.  
  1318.   PGopherScoreAttributeType = ^GOPHER_SCORE_ATTRIBUTE_TYPE;
  1319.   GOPHER_SCORE_ATTRIBUTE_TYPE = record
  1320.     Score: Integer;
  1321.   end;
  1322.   {$EXTERNALSYM GOPHER_SCORE_ATTRIBUTE_TYPE}
  1323.   TGopherScoreAttributeType = GOPHER_SCORE_ATTRIBUTE_TYPE;
  1324.   LPGOPHER_SCORE_ATTRIBUTE_TYPE = PGopherScoreAttributeType;
  1325.   {$EXTERNALSYM LPGOPHER_SCORE_ATTRIBUTE_TYPE}
  1326.  
  1327.   PGopherScoreRangeAttributeType = ^GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE;
  1328.   GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE = record
  1329.     LowerBound: Integer;
  1330.     UpperBound: Integer;
  1331.   end;
  1332.   {$EXTERNALSYM GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE}
  1333.   TGopherScoreRangeAttributeType = GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE;
  1334.   LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE = PGopherScoreRangeAttributeType;
  1335.   {$EXTERNALSYM LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE}
  1336.  
  1337.   PGopherSiteAttributeType = ^GOPHER_SITE_ATTRIBUTE_TYPE;
  1338.   GOPHER_SITE_ATTRIBUTE_TYPE = record
  1339.     Site: LPCSTR;
  1340.   end;
  1341.   {$EXTERNALSYM GOPHER_SITE_ATTRIBUTE_TYPE}
  1342.   TGopherSiteAttributeType = GOPHER_SITE_ATTRIBUTE_TYPE;
  1343.   LPGOPHER_SITE_ATTRIBUTE_TYPE = PGopherSiteAttributeType;
  1344.   {$EXTERNALSYM LPGOPHER_SITE_ATTRIBUTE_TYPE}
  1345.  
  1346.   PGopherOrganizationAttributeType = ^GOPHER_ORGANIZATION_ATTRIBUTE_TYPE;
  1347.   GOPHER_ORGANIZATION_ATTRIBUTE_TYPE = record
  1348.     Organization: LPCSTR;
  1349.   end;
  1350.   {$EXTERNALSYM GOPHER_ORGANIZATION_ATTRIBUTE_TYPE}
  1351.   TGopherOrganizationAttributeType = GOPHER_ORGANIZATION_ATTRIBUTE_TYPE;
  1352.   LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPE = PGopherOrganizationAttributeType;
  1353.   {$EXTERNALSYM LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPE}
  1354.  
  1355.   PGopherLocationAttributeType = ^GOPHER_LOCATION_ATTRIBUTE_TYPE;
  1356.   GOPHER_LOCATION_ATTRIBUTE_TYPE = record
  1357.     Location: LPCSTR;
  1358.   end;
  1359.   {$EXTERNALSYM GOPHER_LOCATION_ATTRIBUTE_TYPE}
  1360.   TGopherLocationAttributeType = GOPHER_LOCATION_ATTRIBUTE_TYPE;
  1361.   LPGOPHER_LOCATION_ATTRIBUTE_TYPE = PGopherLocationAttributeType;
  1362.   {$EXTERNALSYM LPGOPHER_LOCATION_ATTRIBUTE_TYPE}
  1363.  
  1364.   PGopherGeographicalLocationAttributeType = ^GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE;
  1365.   GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE = record
  1366.     DegreesNorth: Integer;
  1367.     MinutesNorth: Integer;
  1368.     SecondsNorth: Integer;
  1369.     DegreesEast: Integer;
  1370.     MinutesEast: Integer;
  1371.     SecondsEast: Integer;
  1372.   end;
  1373.   {$EXTERNALSYM GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE}
  1374.   TGopherGeographicalLocationAttributeType = GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE;
  1375.   LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE = PGopherGeographicalLocationAttributeType;
  1376.   {$EXTERNALSYM LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE}
  1377.  
  1378.   PGopherTimezoneAttributeType = ^TGopherTimezoneAttributeType;
  1379.   GOPHER_TIMEZONE_ATTRIBUTE_TYPE = record
  1380.     Zone: Integer;
  1381.   end;
  1382.   {$EXTERNALSYM GOPHER_TIMEZONE_ATTRIBUTE_TYPE}
  1383.   TGopherTimezoneAttributeType = GOPHER_TIMEZONE_ATTRIBUTE_TYPE;
  1384.   LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE = PGopherTimezoneAttributeType;
  1385.   {$EXTERNALSYM LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE}
  1386.  
  1387.   PGopherProviderAttributeType = ^GOPHER_PROVIDER_ATTRIBUTE_TYPE;
  1388.   GOPHER_PROVIDER_ATTRIBUTE_TYPE = record
  1389.     Provider: LPCSTR;
  1390.   end;
  1391.   {$EXTERNALSYM GOPHER_PROVIDER_ATTRIBUTE_TYPE}
  1392.   TGopherProviderAttributeType = GOPHER_PROVIDER_ATTRIBUTE_TYPE;
  1393.   LPGOPHER_PROVIDER_ATTRIBUTE_TYPE = PGopherProviderAttributeType;
  1394.   {$EXTERNALSYM LPGOPHER_PROVIDER_ATTRIBUTE_TYPE}
  1395.  
  1396.   PGopherVersionAttributeType = ^GOPHER_VERSION_ATTRIBUTE_TYPE;
  1397.   GOPHER_VERSION_ATTRIBUTE_TYPE = record
  1398.     Version: LPCSTR;
  1399.   end;
  1400.   {$EXTERNALSYM GOPHER_VERSION_ATTRIBUTE_TYPE}
  1401.   TGopherVersionAttributeType = GOPHER_VERSION_ATTRIBUTE_TYPE;
  1402.   LPGOPHER_VERSION_ATTRIBUTE_TYPE = PGopherVersionAttributeType;
  1403.   {$EXTERNALSYM LPGOPHER_VERSION_ATTRIBUTE_TYPE}
  1404.  
  1405.   PGopherAbstractAttributeType = ^GOPHER_ABSTRACT_ATTRIBUTE_TYPE;
  1406.   GOPHER_ABSTRACT_ATTRIBUTE_TYPE = record
  1407.     ShortAbstract: LPCSTR;
  1408.     AbstractFile: LPCSTR;
  1409.   end;
  1410.   {$EXTERNALSYM GOPHER_ABSTRACT_ATTRIBUTE_TYPE}
  1411.   TGopherAbstractAttributeType = GOPHER_ABSTRACT_ATTRIBUTE_TYPE;
  1412.   LPGOPHER_ABSTRACT_ATTRIBUTE_TYPE = PGopherAbstractAttributeType;
  1413.   {$EXTERNALSYM LPGOPHER_ABSTRACT_ATTRIBUTE_TYPE}
  1414.  
  1415.   PGopherViewAttributeType = ^GOPHER_VIEW_ATTRIBUTE_TYPE;
  1416.   GOPHER_VIEW_ATTRIBUTE_TYPE = record
  1417.     ContentType: LPCSTR;
  1418.     Language: LPCSTR;
  1419.     Size: DWORD;
  1420.   end;
  1421.   {$EXTERNALSYM GOPHER_VIEW_ATTRIBUTE_TYPE}
  1422.   TGopherViewAttributeType = GOPHER_VIEW_ATTRIBUTE_TYPE;
  1423.   LPGOPHER_VIEW_ATTRIBUTE_TYPE = PGopherViewAttributeType;
  1424.   {$EXTERNALSYM LPGOPHER_VIEW_ATTRIBUTE_TYPE}
  1425.  
  1426.   PGopherVeronicaAttributeType = ^GOPHER_VERONICA_ATTRIBUTE_TYPE;
  1427.   GOPHER_VERONICA_ATTRIBUTE_TYPE = record
  1428.     TreeWalk: BOOL;
  1429.   end;
  1430.   {$EXTERNALSYM GOPHER_VERONICA_ATTRIBUTE_TYPE}
  1431.   TGopherVeronicaAttributeType = GOPHER_VERONICA_ATTRIBUTE_TYPE;
  1432.   LPGOPHER_VERONICA_ATTRIBUTE_TYPE = PGopherVeronicaAttributeType;
  1433.   {$EXTERNALSYM LPGOPHER_VERONICA_ATTRIBUTE_TYPE}
  1434.  
  1435.   PGopherAskAttributeType = ^GOPHER_ASK_ATTRIBUTE_TYPE;
  1436.   GOPHER_ASK_ATTRIBUTE_TYPE = record
  1437.     QuestionType: LPCSTR;
  1438.     QuestionText: LPCSTR;
  1439.   end;
  1440.   {$EXTERNALSYM GOPHER_ASK_ATTRIBUTE_TYPE}
  1441.   TGopherAskAttributeType = GOPHER_ASK_ATTRIBUTE_TYPE;
  1442.   LPGOPHER_ASK_ATTRIBUTE_TYPE = PGopherAskAttributeType;
  1443.   {$EXTERNALSYM LPGOPHER_ASK_ATTRIBUTE_TYPE}
  1444.  
  1445. { GOPHER_UNKNOWN_ATTRIBUTE_TYPE - this is returned if we retrieve an attribute }
  1446. { that is not specified in the current gopher/gopher+ documentation. It is up }
  1447. { to the application to parse the information }
  1448.  
  1449.   PGopherUnknownAttributeType = ^GOPHER_UNKNOWN_ATTRIBUTE_TYPE;
  1450.   GOPHER_UNKNOWN_ATTRIBUTE_TYPE = record
  1451.     Text: LPCSTR;
  1452.   end;
  1453.   {$EXTERNALSYM GOPHER_UNKNOWN_ATTRIBUTE_TYPE}
  1454.   TGopherUnknownAttributeType = GOPHER_UNKNOWN_ATTRIBUTE_TYPE;
  1455.   LPGOPHER_UNKNOWN_ATTRIBUTE_TYPE = PGopherUnknownAttributeType;
  1456.   {$EXTERNALSYM LPGOPHER_UNKNOWN_ATTRIBUTE_TYPE}
  1457.  
  1458. { GOPHER_ATTRIBUTE_TYPE - returned in the user's buffer when an enumerated }
  1459. { GopherGetAttribute call is made }
  1460.  
  1461.   PGopherAttributeType = ^GOPHER_ATTRIBUTE_TYPE;
  1462.   GOPHER_ATTRIBUTE_TYPE = record
  1463.     CategoryId: DWORD;  { e.g. GOPHER_CATEGORY_ID_ADMIN }
  1464.     AttributeId: DWORD; { e.g. GOPHER_ATTRIBUTE_ID_ADMIN }
  1465.     case Integer of
  1466.       0: (Admin: TGopherAdminAttributeType);
  1467.       1: (ModDate: TGopherModDateAttributeType);
  1468.       2: (Ttl: TGopherTtlAttributeType);
  1469.       3: (Score: TGopherScoreAttributeType);
  1470.       4: (ScoreRange: TGopherScoreRangeAttributeType);
  1471.       5: (Site: TGopherSiteAttributeType);
  1472.       6: (Organization: TGopherOrganizationAttributeType);
  1473.       7: (Location: TGopherLocationAttributeType);
  1474.       8: (GeographicalLocation: TGopherGeographicalLocationAttributeType);
  1475.       9: (TimeZone: TGopherTimezoneAttributeType);
  1476.       10: (Provider: TGopherProviderAttributeType);
  1477.       11: (Version: TGopherVersionAttributeType);
  1478.       12: (AbstractType: TGopherAbstractAttributeType);
  1479.       13: (View: TGopherViewAttributeType);
  1480.       14: (Veronica: TGopherVeronicaAttributeType);
  1481.       15: (Ask: TGopherAskAttributeType);
  1482.       16: (Unknown: TGopherUnknownAttributeType);
  1483.     end;
  1484.   {$EXTERNALSYM GOPHER_ATTRIBUTE_TYPE}
  1485.   TGopherAttributeType = GOPHER_ATTRIBUTE_TYPE;
  1486.   LPGOPHER_ATTRIBUTE_TYPE = PGopherAttributeType;
  1487.   {$EXTERNALSYM LPGOPHER_ATTRIBUTE_TYPE}
  1488.  
  1489. const
  1490.   MAX_GOPHER_CATEGORY_NAME = 128;           { arbitrary }
  1491.   {$EXTERNALSYM MAX_GOPHER_CATEGORY_NAME}
  1492.   MAX_GOPHER_ATTRIBUTE_NAME = 128;          {     " }
  1493.   {$EXTERNALSYM MAX_GOPHER_ATTRIBUTE_NAME}
  1494.   MIN_GOPHER_ATTRIBUTE_LENGTH = 256;        {     " }
  1495.   {$EXTERNALSYM MIN_GOPHER_ATTRIBUTE_LENGTH}
  1496.  
  1497. { known gopher attribute categories. See below for ordinals }
  1498.  
  1499.   GOPHER_INFO_CATEGORY           = '+INFO';
  1500.   {$EXTERNALSYM GOPHER_INFO_CATEGORY}
  1501.   GOPHER_ADMIN_CATEGORY          = '+ADMIN';
  1502.   {$EXTERNALSYM GOPHER_ADMIN_CATEGORY}
  1503.   GOPHER_VIEWS_CATEGORY          = '+VIEWS';
  1504.   {$EXTERNALSYM GOPHER_VIEWS_CATEGORY}
  1505.   GOPHER_ABSTRACT_CATEGORY       = '+ABSTRACT';
  1506.   {$EXTERNALSYM GOPHER_ABSTRACT_CATEGORY}
  1507.   GOPHER_VERONICA_CATEGORY       = '+VERONICA';
  1508.   {$EXTERNALSYM GOPHER_VERONICA_CATEGORY}
  1509.  
  1510. { known gopher attributes. These are the attribute names as defined in the }
  1511. { gopher+ protocol document }
  1512.  
  1513.   GOPHER_ADMIN_ATTRIBUTE         = 'Admin';
  1514.   {$EXTERNALSYM GOPHER_ADMIN_ATTRIBUTE}
  1515.   GOPHER_MOD_DATE_ATTRIBUTE      = 'Mod-Date';
  1516.   {$EXTERNALSYM GOPHER_MOD_DATE_ATTRIBUTE}
  1517.   GOPHER_TTL_ATTRIBUTE           = 'TTL';
  1518.   {$EXTERNALSYM GOPHER_TTL_ATTRIBUTE}
  1519.   GOPHER_SCORE_ATTRIBUTE         = 'Score';
  1520.   {$EXTERNALSYM GOPHER_SCORE_ATTRIBUTE}
  1521.   GOPHER_RANGE_ATTRIBUTE         = 'Score-range';
  1522.   {$EXTERNALSYM GOPHER_RANGE_ATTRIBUTE}
  1523.   GOPHER_SITE_ATTRIBUTE          = 'Site';
  1524.   {$EXTERNALSYM GOPHER_SITE_ATTRIBUTE}
  1525.   GOPHER_ORG_ATTRIBUTE           = 'Org';
  1526.   {$EXTERNALSYM GOPHER_ORG_ATTRIBUTE}
  1527.   GOPHER_LOCATION_ATTRIBUTE      = 'Loc';
  1528.   {$EXTERNALSYM GOPHER_LOCATION_ATTRIBUTE}
  1529.   GOPHER_GEOG_ATTRIBUTE          = 'Geog';
  1530.   {$EXTERNALSYM GOPHER_GEOG_ATTRIBUTE}
  1531.   GOPHER_TIMEZONE_ATTRIBUTE      = 'TZ';
  1532.   {$EXTERNALSYM GOPHER_TIMEZONE_ATTRIBUTE}
  1533.   GOPHER_PROVIDER_ATTRIBUTE      = 'Provider';
  1534.   {$EXTERNALSYM GOPHER_PROVIDER_ATTRIBUTE}
  1535.   GOPHER_VERSION_ATTRIBUTE       = 'Version';
  1536.   {$EXTERNALSYM GOPHER_VERSION_ATTRIBUTE}
  1537.   GOPHER_ABSTRACT_ATTRIBUTE      = 'Abstract';
  1538.   {$EXTERNALSYM GOPHER_ABSTRACT_ATTRIBUTE}
  1539.   GOPHER_VIEW_ATTRIBUTE          = 'View';
  1540.   {$EXTERNALSYM GOPHER_VIEW_ATTRIBUTE}
  1541.   GOPHER_TREEWALK_ATTRIBUTE      = 'treewalk';
  1542.   {$EXTERNALSYM GOPHER_TREEWALK_ATTRIBUTE}
  1543.  
  1544. { identifiers for attribute strings }
  1545.  
  1546.   GOPHER_ATTRIBUTE_ID_BASE = $abcccc00;
  1547.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_BASE}
  1548.   GOPHER_CATEGORY_ID_ALL = GOPHER_ATTRIBUTE_ID_BASE + 1;
  1549.   {$EXTERNALSYM GOPHER_CATEGORY_ID_ALL}
  1550.   GOPHER_CATEGORY_ID_INFO = GOPHER_ATTRIBUTE_ID_BASE + 2;
  1551.   {$EXTERNALSYM GOPHER_CATEGORY_ID_INFO}
  1552.   GOPHER_CATEGORY_ID_ADMIN = GOPHER_ATTRIBUTE_ID_BASE + 3;
  1553.   {$EXTERNALSYM GOPHER_CATEGORY_ID_ADMIN}
  1554.   GOPHER_CATEGORY_ID_VIEWS = GOPHER_ATTRIBUTE_ID_BASE + 4;
  1555.   {$EXTERNALSYM GOPHER_CATEGORY_ID_VIEWS}
  1556.   GOPHER_CATEGORY_ID_ABSTRACT = GOPHER_ATTRIBUTE_ID_BASE + 5;
  1557.   {$EXTERNALSYM GOPHER_CATEGORY_ID_ABSTRACT}
  1558.   GOPHER_CATEGORY_ID_VERONICA = GOPHER_ATTRIBUTE_ID_BASE + 6;
  1559.   {$EXTERNALSYM GOPHER_CATEGORY_ID_VERONICA}
  1560.   GOPHER_CATEGORY_ID_ASK = GOPHER_ATTRIBUTE_ID_BASE + 7;
  1561.   {$EXTERNALSYM GOPHER_CATEGORY_ID_ASK}
  1562.   GOPHER_CATEGORY_ID_UNKNOWN = GOPHER_ATTRIBUTE_ID_BASE + 8;
  1563.   {$EXTERNALSYM GOPHER_CATEGORY_ID_UNKNOWN}
  1564.   GOPHER_ATTRIBUTE_ID_ALL = GOPHER_ATTRIBUTE_ID_BASE + 9;
  1565.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_ALL}
  1566.   GOPHER_ATTRIBUTE_ID_ADMIN = GOPHER_ATTRIBUTE_ID_BASE + 10;
  1567.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_ADMIN}
  1568.   GOPHER_ATTRIBUTE_ID_MOD_DATE = GOPHER_ATTRIBUTE_ID_BASE + 11;
  1569.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_MOD_DATE}
  1570.   GOPHER_ATTRIBUTE_ID_TTL = GOPHER_ATTRIBUTE_ID_BASE + 12;
  1571.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_TTL}
  1572.   GOPHER_ATTRIBUTE_ID_SCORE = GOPHER_ATTRIBUTE_ID_BASE + 13;
  1573.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_SCORE}
  1574.   GOPHER_ATTRIBUTE_ID_RANGE = GOPHER_ATTRIBUTE_ID_BASE + 14;
  1575.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_RANGE}
  1576.   GOPHER_ATTRIBUTE_ID_SITE = GOPHER_ATTRIBUTE_ID_BASE + 15;
  1577.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_SITE}
  1578.   GOPHER_ATTRIBUTE_ID_ORG = GOPHER_ATTRIBUTE_ID_BASE + 16;
  1579.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_ORG}
  1580.   GOPHER_ATTRIBUTE_ID_LOCATION = GOPHER_ATTRIBUTE_ID_BASE + 17;
  1581.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_LOCATION}
  1582.   GOPHER_ATTRIBUTE_ID_GEOG = GOPHER_ATTRIBUTE_ID_BASE + 18;
  1583.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_GEOG}
  1584.   GOPHER_ATTRIBUTE_ID_TIMEZONE = GOPHER_ATTRIBUTE_ID_BASE + 19;
  1585.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_TIMEZONE}
  1586.   GOPHER_ATTRIBUTE_ID_PROVIDER = GOPHER_ATTRIBUTE_ID_BASE + 20;
  1587.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_PROVIDER}
  1588.   GOPHER_ATTRIBUTE_ID_VERSION = GOPHER_ATTRIBUTE_ID_BASE + 21;
  1589.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_VERSION}
  1590.   GOPHER_ATTRIBUTE_ID_ABSTRACT = GOPHER_ATTRIBUTE_ID_BASE + 22;
  1591.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_ABSTRACT}
  1592.   GOPHER_ATTRIBUTE_ID_VIEW = GOPHER_ATTRIBUTE_ID_BASE + 23;
  1593.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_VIEW}
  1594.   GOPHER_ATTRIBUTE_ID_TREEWALK = GOPHER_ATTRIBUTE_ID_BASE + 24;
  1595.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_TREEWALK}
  1596.   GOPHER_ATTRIBUTE_ID_UNKNOWN = GOPHER_ATTRIBUTE_ID_BASE + 25;
  1597.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ID_UNKNOWN}
  1598.   
  1599. { prototypes }
  1600.  
  1601. function GopherCreateLocatorA(lpszHost: PAnsiChar; nServerPort: INTERNET_PORT;
  1602.   lpszDisplayString: PAnsiChar; lpszSelectorString: PAnsiChar; dwGopherType: DWORD;
  1603.   lpszLocator: PAnsiChar; var lpdwBufferLength: DWORD): BOOL; stdcall;
  1604.   {$EXTERNALSYM GopherCreateLocatorA}
  1605. function GopherCreateLocatorW(lpszHost: PWideChar; nServerPort: INTERNET_PORT;
  1606.   lpszDisplayString: PWideChar; lpszSelectorString: PWideChar; dwGopherType: DWORD;
  1607.   lpszLocator: PWideChar; var lpdwBufferLength: DWORD): BOOL; stdcall;
  1608.   {$EXTERNALSYM GopherCreateLocatorW}
  1609. function GopherCreateLocator(lpszHost: PChar; nServerPort: INTERNET_PORT;
  1610.   lpszDisplayString: PChar; lpszSelectorString: PChar; dwGopherType: DWORD;
  1611.   lpszLocator: PChar; var lpdwBufferLength: DWORD): BOOL; stdcall;
  1612.   {$EXTERNALSYM GopherCreateLocator}
  1613.  
  1614. function GopherGetLocatorTypeA(lpszLocator: PAnsiChar;
  1615.   var lpdwGopherType: DWORD): BOOL; stdcall;
  1616.   {$EXTERNALSYM GopherGetLocatorTypeA}
  1617. function GopherGetLocatorTypeW(lpszLocator: PWideChar;
  1618.   var lpdwGopherType: DWORD): BOOL; stdcall;
  1619.   {$EXTERNALSYM GopherGetLocatorTypeW}
  1620. function GopherGetLocatorType(lpszLocator: PChar;
  1621.   var lpdwGopherType: DWORD): BOOL; stdcall;
  1622.   {$EXTERNALSYM GopherGetLocatorType}
  1623.  
  1624. function GopherFindFirstFileA(hConnect: HINTERNET; lpszLocator: PAnsiChar;
  1625.   lpszSearchString: PAnsiChar; var lpFindData: TGopherFindDataA; dwFlags: DWORD;
  1626.   dwContext: DWORD): HINTERNET; stdcall;
  1627.   {$EXTERNALSYM GopherFindFirstFileA}
  1628. function GopherFindFirstFileW(hConnect: HINTERNET; lpszLocator: PWideChar;
  1629.   lpszSearchString: PWideChar; var lpFindData: TGopherFindDataW; dwFlags: DWORD;
  1630.   dwContext: DWORD): HINTERNET; stdcall;
  1631.   {$EXTERNALSYM GopherFindFirstFileW}
  1632. function GopherFindFirstFile(hConnect: HINTERNET; lpszLocator: PChar;
  1633.   lpszSearchString: PChar; var lpFindData: TGopherFindData; dwFlags: DWORD;
  1634.   dwContext: DWORD): HINTERNET; stdcall;
  1635.   {$EXTERNALSYM GopherFindFirstFile}
  1636.  
  1637. function GopherOpenFileA(hConnect: HINTERNET; lpszLocator: PAnsiChar;
  1638.   lpszView: PAnsiChar; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
  1639.   {$EXTERNALSYM GopherOpenFileA}
  1640. function GopherOpenFileW(hConnect: HINTERNET; lpszLocator: PWideChar;
  1641.   lpszView: PWideChar; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
  1642.   {$EXTERNALSYM GopherOpenFileW}
  1643. function GopherOpenFile(hConnect: HINTERNET; lpszLocator: PChar;
  1644.   lpszView: PChar; dwFlags: DWORD; dwContext: DWORD): HINTERNET; stdcall;
  1645.   {$EXTERNALSYM GopherOpenFile}
  1646.  
  1647. type
  1648.  
  1649.  
  1650.  
  1651.   GOPHER_ATTRIBUTE_ENUMERATOR = TFarProc;
  1652.   {$EXTERNALSYM GOPHER_ATTRIBUTE_ENUMERATOR}
  1653.   TFNGopherAttributeEnumerator = GOPHER_ATTRIBUTE_ENUMERATOR;
  1654.   PFNGopherAttributeEnumerator = ^TFNGopherAttributeEnumerator;
  1655.  
  1656. function GopherGetAttributeA(hConnect: HINTERNET; lpszLocator: PAnsiChar;
  1657.   lpszAttributeName: PAnsiChar; lpBuffer: Pointer; dwBufferLength: DWORD;
  1658.   var lpdwCharactersReturned: DWORD; lpfnEnumerator: PFNGopherAttributeEnumerator;
  1659.   dwContext: DWORD): BOOL; stdcall;
  1660.   {$EXTERNALSYM GopherGetAttributeA}
  1661. function GopherGetAttributeW(hConnect: HINTERNET; lpszLocator: PWideChar;
  1662.   lpszAttributeName: PWideChar; lpBuffer: Pointer; dwBufferLength: DWORD;
  1663.   var lpdwCharactersReturned: DWORD; lpfnEnumerator: PFNGopherAttributeEnumerator;
  1664.   dwContext: DWORD): BOOL; stdcall;
  1665.   {$EXTERNALSYM GopherGetAttributeW}
  1666. function GopherGetAttribute(hConnect: HINTERNET; lpszLocator: PChar;
  1667.   lpszAttributeName: PChar; lpBuffer: Pointer; dwBufferLength: DWORD;
  1668.   var lpdwCharactersReturned: DWORD; lpfnEnumerator: PFNGopherAttributeEnumerator;
  1669.   dwContext: DWORD): BOOL; stdcall;
  1670.   {$EXTERNALSYM GopherGetAttribute}
  1671.  
  1672. { HTTP }
  1673.  
  1674. { manifests }
  1675.  
  1676. const
  1677. { the default major/minor HTTP version numbers }
  1678.  
  1679.   HTTP_MAJOR_VERSION = 1;
  1680.   {$EXTERNALSYM HTTP_MAJOR_VERSION}
  1681.   HTTP_MINOR_VERSION = 0;
  1682.   {$EXTERNALSYM HTTP_MINOR_VERSION}
  1683.   HTTP_VERSION       = 'HTTP/1.0';
  1684.   {$EXTERNALSYM HTTP_VERSION}
  1685.  
  1686. { HttpQueryInfo info levels. Generally, there is one info level }
  1687. { for each potential RFC822/HTTP/MIME header that an HTTP server }
  1688. { may send as part of a request response. }
  1689.  
  1690. { The HTTP_QUERY_RAW_HEADERS info level is provided for clients }
  1691. { that choose to perform their own header parsing. }
  1692.  
  1693.   HTTP_QUERY_MIME_VERSION                     = 0;
  1694.   {$EXTERNALSYM HTTP_QUERY_MIME_VERSION}
  1695.   HTTP_QUERY_CONTENT_TYPE                     = 1;
  1696.   {$EXTERNALSYM HTTP_QUERY_CONTENT_TYPE}
  1697.   HTTP_QUERY_CONTENT_TRANSFER_ENCODING        = 2;
  1698.   {$EXTERNALSYM HTTP_QUERY_CONTENT_TRANSFER_ENCODING}
  1699.   HTTP_QUERY_CONTENT_ID                       = 3;
  1700.   {$EXTERNALSYM HTTP_QUERY_CONTENT_ID}
  1701.   HTTP_QUERY_CONTENT_DESCRIPTION              = 4;
  1702.   {$EXTERNALSYM HTTP_QUERY_CONTENT_DESCRIPTION}
  1703.   HTTP_QUERY_CONTENT_LENGTH                   = 5;
  1704.   {$EXTERNALSYM HTTP_QUERY_CONTENT_LENGTH}
  1705.   HTTP_QUERY_CONTENT_LANGUAGE                 = 6;
  1706.   {$EXTERNALSYM HTTP_QUERY_CONTENT_LANGUAGE}
  1707.   HTTP_QUERY_ALLOW                            = 7;
  1708.   {$EXTERNALSYM HTTP_QUERY_ALLOW}
  1709.   HTTP_QUERY_PUBLIC                           = 8;
  1710.   {$EXTERNALSYM HTTP_QUERY_PUBLIC}
  1711.   HTTP_QUERY_DATE                             = 9;
  1712.   {$EXTERNALSYM HTTP_QUERY_DATE}
  1713.   HTTP_QUERY_EXPIRES                          = 10;
  1714.   {$EXTERNALSYM HTTP_QUERY_EXPIRES}
  1715.   HTTP_QUERY_LAST_MODIFIED                    = 11;
  1716.   {$EXTERNALSYM HTTP_QUERY_LAST_MODIFIED}
  1717.   HTTP_QUERY_MESSAGE_ID                       = 12;
  1718.   {$EXTERNALSYM HTTP_QUERY_MESSAGE_ID}
  1719.   HTTP_QUERY_URI                              = 13;
  1720.   {$EXTERNALSYM HTTP_QUERY_URI}
  1721.   HTTP_QUERY_DERIVED_FROM                     = 14;
  1722.   {$EXTERNALSYM HTTP_QUERY_DERIVED_FROM}
  1723.   HTTP_QUERY_COST                             = 15;
  1724.   {$EXTERNALSYM HTTP_QUERY_COST}
  1725.   HTTP_QUERY_LINK                             = 16;
  1726.   {$EXTERNALSYM HTTP_QUERY_LINK}
  1727.   HTTP_QUERY_PRAGMA                           = 17;
  1728.   {$EXTERNALSYM HTTP_QUERY_PRAGMA}
  1729.   HTTP_QUERY_VERSION                          = 18; { special: part of status line }
  1730.   {$EXTERNALSYM HTTP_QUERY_VERSION}
  1731.   HTTP_QUERY_STATUS_CODE                      = 19; { special: part of status line }
  1732.   {$EXTERNALSYM HTTP_QUERY_STATUS_CODE}
  1733.   HTTP_QUERY_STATUS_TEXT                      = 20; { special: part of status line }
  1734.   {$EXTERNALSYM HTTP_QUERY_STATUS_TEXT}
  1735.   HTTP_QUERY_RAW_HEADERS                      = 21; { special: all headers as ASCIIZ }
  1736.   {$EXTERNALSYM HTTP_QUERY_RAW_HEADERS}
  1737.   HTTP_QUERY_RAW_HEADERS_CRLF                 = 22; { special: all headers }
  1738.   {$EXTERNALSYM HTTP_QUERY_RAW_HEADERS_CRLF}
  1739.   HTTP_QUERY_CONNECTION                       = 23;
  1740.   {$EXTERNALSYM HTTP_QUERY_CONNECTION}
  1741.   HTTP_QUERY_ACCEPT                           = 24;
  1742.   {$EXTERNALSYM HTTP_QUERY_ACCEPT}
  1743.   HTTP_QUERY_ACCEPT_CHARSET                   = 25;
  1744.   {$EXTERNALSYM HTTP_QUERY_ACCEPT_CHARSET}
  1745.   HTTP_QUERY_ACCEPT_ENCODING                  = 26;
  1746.   {$EXTERNALSYM HTTP_QUERY_ACCEPT_ENCODING}
  1747.   HTTP_QUERY_ACCEPT_LANGUAGE                  = 27;
  1748.   {$EXTERNALSYM HTTP_QUERY_ACCEPT_LANGUAGE}
  1749.   HTTP_QUERY_AUTHORIZATION                    = 28;
  1750.   {$EXTERNALSYM HTTP_QUERY_AUTHORIZATION}
  1751.   HTTP_QUERY_CONTENT_ENCODING                 = 29;
  1752.   {$EXTERNALSYM HTTP_QUERY_CONTENT_ENCODING}
  1753.   HTTP_QUERY_FORWARDED                        = 30;
  1754.   {$EXTERNALSYM HTTP_QUERY_FORWARDED}
  1755.   HTTP_QUERY_FROM                             = 31;
  1756.   {$EXTERNALSYM HTTP_QUERY_FROM}
  1757.   HTTP_QUERY_IF_MODIFIED_SINCE                = 32;
  1758.   {$EXTERNALSYM HTTP_QUERY_IF_MODIFIED_SINCE}
  1759.   HTTP_QUERY_LOCATION                         = 33;
  1760.   {$EXTERNALSYM HTTP_QUERY_LOCATION}
  1761.   HTTP_QUERY_ORIG_URI                         = 34;
  1762.   {$EXTERNALSYM HTTP_QUERY_ORIG_URI}
  1763.   HTTP_QUERY_REFERER                          = 35;
  1764.   {$EXTERNALSYM HTTP_QUERY_REFERER}
  1765.   HTTP_QUERY_RETRY_AFTER                      = 36;
  1766.   {$EXTERNALSYM HTTP_QUERY_RETRY_AFTER}
  1767.   HTTP_QUERY_SERVER                           = 37;
  1768.   {$EXTERNALSYM HTTP_QUERY_SERVER}
  1769.   HTTP_QUERY_TITLE                            = 38;
  1770.   {$EXTERNALSYM HTTP_QUERY_TITLE}
  1771.   HTTP_QUERY_USER_AGENT                       = 39;
  1772.   {$EXTERNALSYM HTTP_QUERY_USER_AGENT}
  1773.   HTTP_QUERY_WWW_AUTHENTICATE                 = 40;
  1774.   {$EXTERNALSYM HTTP_QUERY_WWW_AUTHENTICATE}
  1775.   HTTP_QUERY_PROXY_AUTHENTICATE               = 41;
  1776.   {$EXTERNALSYM HTTP_QUERY_PROXY_AUTHENTICATE}
  1777.   HTTP_QUERY_ACCEPT_RANGES                    = 42;
  1778.   {$EXTERNALSYM HTTP_QUERY_ACCEPT_RANGES}
  1779.   HTTP_QUERY_SET_COOKIE                       = 43;
  1780.   {$EXTERNALSYM HTTP_QUERY_SET_COOKIE}
  1781.   HTTP_QUERY_COOKIE                           = 44;
  1782.   {$EXTERNALSYM HTTP_QUERY_COOKIE}
  1783.   HTTP_QUERY_REQUEST_METHOD                   = 45;  { special: GET/POST etc. }
  1784.   {$EXTERNALSYM HTTP_QUERY_REQUEST_METHOD}
  1785.   HTTP_QUERY_REFRESH                          = 46;
  1786.   {$EXTERNALSYM HTTP_QUERY_REFRESH}
  1787.   HTTP_QUERY_CONTENT_DISPOSITION              = 47;
  1788.   {$EXTERNALSYM HTTP_QUERY_CONTENT_DISPOSITION}
  1789.  
  1790. { HTTP 1.1 defined headers }
  1791.  
  1792.   HTTP_QUERY_AGE                              = 48;
  1793.   {$EXTERNALSYM HTTP_QUERY_AGE}
  1794.   HTTP_QUERY_CACHE_CONTROL                    = 49;
  1795.   {$EXTERNALSYM HTTP_QUERY_CACHE_CONTROL}
  1796.   HTTP_QUERY_CONTENT_BASE                     = 50;
  1797.   {$EXTERNALSYM HTTP_QUERY_CONTENT_BASE}
  1798.   HTTP_QUERY_CONTENT_LOCATION                 = 51;
  1799.   {$EXTERNALSYM HTTP_QUERY_CONTENT_LOCATION}
  1800.   HTTP_QUERY_CONTENT_MD5                      = 52;
  1801.   {$EXTERNALSYM HTTP_QUERY_CONTENT_MD5}
  1802.   HTTP_QUERY_CONTENT_RANGE                    = 53;
  1803.   {$EXTERNALSYM HTTP_QUERY_CONTENT_RANGE}
  1804.   HTTP_QUERY_ETAG                             = 54;
  1805.   {$EXTERNALSYM HTTP_QUERY_ETAG}
  1806.   HTTP_QUERY_HOST                             = 55;
  1807.   {$EXTERNALSYM HTTP_QUERY_HOST}
  1808.   HTTP_QUERY_IF_MATCH                         = 56;
  1809.   {$EXTERNALSYM HTTP_QUERY_IF_MATCH}
  1810.   HTTP_QUERY_IF_NONE_MATCH                    = 57;
  1811.   {$EXTERNALSYM HTTP_QUERY_IF_NONE_MATCH}
  1812.   HTTP_QUERY_IF_RANGE                         = 58;
  1813.   {$EXTERNALSYM HTTP_QUERY_IF_RANGE}
  1814.   HTTP_QUERY_IF_UNMODIFIED_SINCE              = 59;
  1815.   {$EXTERNALSYM HTTP_QUERY_IF_UNMODIFIED_SINCE}
  1816.   HTTP_QUERY_MAX_FORWARDS                     = 60;
  1817.   {$EXTERNALSYM HTTP_QUERY_MAX_FORWARDS}
  1818.   HTTP_QUERY_PROXY_AUTHORIZATION              = 61;
  1819.   {$EXTERNALSYM HTTP_QUERY_PROXY_AUTHORIZATION}
  1820.   HTTP_QUERY_RANGE                            = 62;
  1821.   {$EXTERNALSYM HTTP_QUERY_RANGE}
  1822.   HTTP_QUERY_TRANSFER_ENCODING                = 63;
  1823.   {$EXTERNALSYM HTTP_QUERY_TRANSFER_ENCODING}
  1824.   HTTP_QUERY_UPGRADE                          = 64;
  1825.   {$EXTERNALSYM HTTP_QUERY_UPGRADE}
  1826.   HTTP_QUERY_VARY                             = 65;
  1827.   {$EXTERNALSYM HTTP_QUERY_VARY}
  1828.   HTTP_QUERY_VIA                              = 66;
  1829.   {$EXTERNALSYM HTTP_QUERY_VIA}
  1830.   HTTP_QUERY_WARNING                          = 67;
  1831.   {$EXTERNALSYM HTTP_QUERY_WARNING}
  1832.   HTTP_QUERY_MAX                              = 67;
  1833.   {$EXTERNALSYM HTTP_QUERY_MAX}
  1834.  
  1835. { HTTP_QUERY_CUSTOM - if this special value is supplied as the dwInfoLevel }
  1836. { parameter of HttpQueryInfo then the lpBuffer parameter contains the name }
  1837. { of the header we are to query }
  1838.   HTTP_QUERY_CUSTOM                           = 65535;
  1839.   {$EXTERNALSYM HTTP_QUERY_CUSTOM}
  1840.  
  1841. { HTTP_QUERY_FLAG_REQUEST_HEADERS - if this bit is set in the dwInfoLevel }
  1842. { parameter of HttpQueryInfo then the request headers will be queried for the }
  1843. { request information }
  1844.   HTTP_QUERY_FLAG_REQUEST_HEADERS             = $80000000;
  1845.   {$EXTERNALSYM HTTP_QUERY_FLAG_REQUEST_HEADERS}
  1846.  
  1847. { HTTP_QUERY_FLAG_SYSTEMTIME - if this bit is set in the dwInfoLevel parameter }
  1848. { of HttpQueryInfo AND the header being queried contains date information, }
  1849. { e.g. the "Expires:" header then lpBuffer will contain a SYSTEMTIME structure }
  1850. { containing the date and time information converted from the header string }
  1851.   HTTP_QUERY_FLAG_SYSTEMTIME                  = $40000000;
  1852.   {$EXTERNALSYM HTTP_QUERY_FLAG_SYSTEMTIME}
  1853.  
  1854. { HTTP_QUERY_FLAG_NUMBER - if this bit is set in the dwInfoLevel parameter of }
  1855. { HttpQueryInfo, then the value of the header will be converted to a number }
  1856. { before being returned to the caller, if applicable }
  1857.   HTTP_QUERY_FLAG_NUMBER                      = $20000000;
  1858.   {$EXTERNALSYM HTTP_QUERY_FLAG_NUMBER}
  1859.  
  1860. { HTTP_QUERY_FLAG_COALESCE - combine the values from several headers of the }
  1861. { same name into the output buffer }
  1862.   HTTP_QUERY_FLAG_COALESCE                    = $10000000;
  1863.   {$EXTERNALSYM HTTP_QUERY_FLAG_COALESCE}
  1864.  
  1865.   HTTP_QUERY_MODIFIER_FLAGS_MASK              = HTTP_QUERY_FLAG_REQUEST_HEADERS or
  1866.                                                 HTTP_QUERY_FLAG_SYSTEMTIME or
  1867.                                                 HTTP_QUERY_FLAG_NUMBER or
  1868.                                                 HTTP_QUERY_FLAG_COALESCE;
  1869.   {$EXTERNALSYM HTTP_QUERY_MODIFIER_FLAGS_MASK}
  1870.  
  1871.   HTTP_QUERY_HEADER_MASK                      = not HTTP_QUERY_MODIFIER_FLAGS_MASK;
  1872.   {$EXTERNALSYM HTTP_QUERY_HEADER_MASK}
  1873.  
  1874. {  HTTP Response Status Codes: }
  1875.   HTTP_STATUS_CONTINUE            = 100;    { OK to continue with request }
  1876.   {$EXTERNALSYM HTTP_STATUS_CONTINUE}
  1877.   HTTP_STATUS_SWITCH_PROTOCOLS    = 101;    { server has switched protocols in upgrade header }
  1878.   {$EXTERNALSYM HTTP_STATUS_SWITCH_PROTOCOLS}
  1879.   HTTP_STATUS_OK                  = 200;    { request completed }
  1880.   {$EXTERNALSYM HTTP_STATUS_OK}
  1881.   HTTP_STATUS_CREATED             = 201;    { object created, reason = new URI }
  1882.   {$EXTERNALSYM HTTP_STATUS_CREATED}
  1883.   HTTP_STATUS_ACCEPTED            = 202;    { async completion (TBS) }
  1884.   {$EXTERNALSYM HTTP_STATUS_ACCEPTED}
  1885.   HTTP_STATUS_PARTIAL             = 203;    { partial completion }
  1886.   {$EXTERNALSYM HTTP_STATUS_PARTIAL}
  1887.   HTTP_STATUS_NO_CONTENT          = 204;    { no info to return }
  1888.   {$EXTERNALSYM HTTP_STATUS_NO_CONTENT}
  1889.   HTTP_STATUS_RESET_CONTENT       = 205;    { request completed, but clear form }
  1890.   {$EXTERNALSYM HTTP_STATUS_RESET_CONTENT}
  1891.   HTTP_STATUS_PARTIAL_CONTENT     = 206;    { partial GET furfilled }
  1892.   {$EXTERNALSYM HTTP_STATUS_PARTIAL_CONTENT}
  1893.   HTTP_STATUS_AMBIGUOUS           = 300;    { server couldn't decide what to return }
  1894.   {$EXTERNALSYM HTTP_STATUS_AMBIGUOUS}
  1895.   HTTP_STATUS_MOVED               = 301;    { object permanently moved }
  1896.   {$EXTERNALSYM HTTP_STATUS_MOVED}
  1897.   HTTP_STATUS_REDIRECT            = 302;    { object temporarily moved }
  1898.   {$EXTERNALSYM HTTP_STATUS_REDIRECT}
  1899.   HTTP_STATUS_REDIRECT_METHOD     = 303;    { redirection w/ new access method }
  1900.   {$EXTERNALSYM HTTP_STATUS_REDIRECT_METHOD}
  1901.   HTTP_STATUS_NOT_MODIFIED        = 304;    { if-modified-since was not modified }
  1902.   {$EXTERNALSYM HTTP_STATUS_NOT_MODIFIED}
  1903.   HTTP_STATUS_USE_PROXY           = 305;    { redirection to proxy, location header specifies proxy to use }
  1904.   {$EXTERNALSYM HTTP_STATUS_USE_PROXY}
  1905.   HTTP_STATUS_REDIRECT_KEEP_VERB  = 307;    { HTTP/1.1: keep same verb }
  1906.   {$EXTERNALSYM HTTP_STATUS_REDIRECT_KEEP_VERB}
  1907.   HTTP_STATUS_BAD_REQUEST         = 400;    { invalid syntax }
  1908.   {$EXTERNALSYM HTTP_STATUS_BAD_REQUEST}
  1909.   HTTP_STATUS_DENIED              = 401;    { access denied }
  1910.   {$EXTERNALSYM HTTP_STATUS_DENIED}
  1911.   HTTP_STATUS_PAYMENT_REQ         = 402;    { payment required }
  1912.   {$EXTERNALSYM HTTP_STATUS_PAYMENT_REQ}
  1913.   HTTP_STATUS_FORBIDDEN           = 403;    { request forbidden }
  1914.   {$EXTERNALSYM HTTP_STATUS_FORBIDDEN}
  1915.   HTTP_STATUS_NOT_FOUND           = 404;    { object not found }
  1916.   {$EXTERNALSYM HTTP_STATUS_NOT_FOUND}
  1917.   HTTP_STATUS_BAD_METHOD          = 405;    { method is not allowed }
  1918.   {$EXTERNALSYM HTTP_STATUS_BAD_METHOD}
  1919.   HTTP_STATUS_NONE_ACCEPTABLE     = 406;    { no response acceptable to client found }
  1920.   {$EXTERNALSYM HTTP_STATUS_NONE_ACCEPTABLE}
  1921.   HTTP_STATUS_PROXY_AUTH_REQ      = 407;    { proxy authentication required }
  1922.   {$EXTERNALSYM HTTP_STATUS_PROXY_AUTH_REQ}
  1923.   HTTP_STATUS_REQUEST_TIMEOUT     = 408;    { server timed out waiting for request }
  1924.   {$EXTERNALSYM HTTP_STATUS_REQUEST_TIMEOUT}
  1925.   HTTP_STATUS_CONFLICT            = 409;    { user should resubmit with more info }
  1926.   {$EXTERNALSYM HTTP_STATUS_CONFLICT}
  1927.   HTTP_STATUS_GONE                = 410;    { the resource is no longer available }
  1928.   {$EXTERNALSYM HTTP_STATUS_GONE}
  1929.   HTTP_STATUS_AUTH_REFUSED        = 411;    { couldn't authorize client }
  1930.   {$EXTERNALSYM HTTP_STATUS_AUTH_REFUSED}
  1931.   HTTP_STATUS_PRECOND_FAILED      = 412;    { precondition given in request failed }
  1932.   {$EXTERNALSYM HTTP_STATUS_PRECOND_FAILED}
  1933.   HTTP_STATUS_REQUEST_TOO_LARGE   = 413;    { request entity was too large }
  1934.   {$EXTERNALSYM HTTP_STATUS_REQUEST_TOO_LARGE}
  1935.   HTTP_STATUS_URI_TOO_LONG        = 414;    { request URI too long }
  1936.   {$EXTERNALSYM HTTP_STATUS_URI_TOO_LONG}
  1937.   HTTP_STATUS_UNSUPPORTED_MEDIA   = 415;    { unsupported media type }
  1938.   {$EXTERNALSYM HTTP_STATUS_UNSUPPORTED_MEDIA}
  1939.   HTTP_STATUS_SERVER_ERROR        = 500;    { internal server error }
  1940.   {$EXTERNALSYM HTTP_STATUS_SERVER_ERROR}
  1941.   HTTP_STATUS_NOT_SUPPORTED       = 501;    { required not supported }
  1942.   {$EXTERNALSYM HTTP_STATUS_NOT_SUPPORTED}
  1943.   HTTP_STATUS_BAD_GATEWAY         = 502;    { error response received from gateway }
  1944.   {$EXTERNALSYM HTTP_STATUS_BAD_GATEWAY}
  1945.   HTTP_STATUS_SERVICE_UNAVAIL     = 503;    { temporarily overloaded }
  1946.   {$EXTERNALSYM HTTP_STATUS_SERVICE_UNAVAIL}
  1947.   HTTP_STATUS_GATEWAY_TIMEOUT     = 504;    { timed out waiting for gateway }
  1948.   {$EXTERNALSYM HTTP_STATUS_GATEWAY_TIMEOUT}
  1949.   HTTP_STATUS_VERSION_NOT_SUP     = 505;    { HTTP version not supported }
  1950.   {$EXTERNALSYM HTTP_STATUS_VERSION_NOT_SUP}
  1951.   HTTP_STATUS_FIRST               = HTTP_STATUS_CONTINUE;
  1952.   {$EXTERNALSYM HTTP_STATUS_FIRST}
  1953.   HTTP_STATUS_LAST                = HTTP_STATUS_VERSION_NOT_SUP;
  1954.   {$EXTERNALSYM HTTP_STATUS_LAST}
  1955.  
  1956. { prototypes }
  1957.  
  1958. function HttpOpenRequestA(hConnect: HINTERNET; lpszVerb: PAnsiChar;
  1959.   lpszObjectName: PAnsiChar; lpszVersion: PAnsiChar; lpszReferrer: PAnsiChar;
  1960.   lplpszAcceptTypes: PLPSTR; dwFlags: DWORD;
  1961.   dwContext: DWORD): HINTERNET; stdcall;
  1962.   {$EXTERNALSYM HttpOpenRequestA}
  1963. function HttpOpenRequestW(hConnect: HINTERNET; lpszVerb: PWideChar;
  1964.   lpszObjectName: PWideChar; lpszVersion: PWideChar; lpszReferrer: PWideChar;
  1965.   lplpszAcceptTypes: PLPWSTR; dwFlags: DWORD;
  1966.   dwContext: DWORD): HINTERNET; stdcall;
  1967.   {$EXTERNALSYM HttpOpenRequestW}
  1968. function HttpOpenRequest(hConnect: HINTERNET; lpszVerb: PChar;
  1969.   lpszObjectName: PChar; lpszVersion: PChar; lpszReferrer: PChar;
  1970.   lplpszAcceptTypes: PLPSTR; dwFlags: DWORD;
  1971.   dwContext: DWORD): HINTERNET; stdcall;
  1972.   {$EXTERNALSYM HttpOpenRequest}
  1973.  
  1974. function HttpAddRequestHeadersA(hRequest: HINTERNET; lpszHeaders: PAnsiChar;
  1975.   dwHeadersLength: DWORD; dwModifiers: DWORD): BOOL; stdcall;
  1976.   {$EXTERNALSYM HttpAddRequestHeadersA}
  1977. function HttpAddRequestHeadersW(hRequest: HINTERNET; lpszHeaders: PWideChar;
  1978.   dwHeadersLength: DWORD; dwModifiers: DWORD): BOOL; stdcall;
  1979.   {$EXTERNALSYM HttpAddRequestHeadersW}
  1980. function HttpAddRequestHeaders(hRequest: HINTERNET; lpszHeaders: PChar;
  1981.   dwHeadersLength: DWORD; dwModifiers: DWORD): BOOL; stdcall;
  1982.   {$EXTERNALSYM HttpAddRequestHeaders}
  1983.  
  1984. const
  1985. { values for dwModifiers parameter of HttpAddRequestHeaders }
  1986.  
  1987.   HTTP_ADDREQ_INDEX_MASK          = $0000FFFF;
  1988.   {$EXTERNALSYM HTTP_ADDREQ_INDEX_MASK}
  1989.   HTTP_ADDREQ_FLAGS_MASK          = $FFFF0000;
  1990.   {$EXTERNALSYM HTTP_ADDREQ_FLAGS_MASK}
  1991.  
  1992. { HTTP_ADDREQ_FLAG_ADD_IF_NEW - the header will only be added if it doesn't }
  1993. { already exist }
  1994.  
  1995.   HTTP_ADDREQ_FLAG_ADD_IF_NEW     = $10000000;
  1996.   {$EXTERNALSYM HTTP_ADDREQ_FLAG_ADD_IF_NEW}
  1997.  
  1998. { HTTP_ADDREQ_FLAG_ADD - if HTTP_ADDREQ_FLAG_REPLACE is set but the header is }
  1999. { not found then if this flag is set, the header is added anyway, so long as }
  2000. { there is a valid header-value }
  2001.  
  2002.   HTTP_ADDREQ_FLAG_ADD            = $20000000;
  2003.   {$EXTERNALSYM HTTP_ADDREQ_FLAG_ADD}
  2004.  
  2005. { HTTP_ADDREQ_FLAG_COALESCE - coalesce headers with same name. e.g. }
  2006. { "Accept: text/*" and "Accept: audio/*" with this flag results in a single }
  2007. { header: "Accept: text/*, audio/*" }
  2008.  
  2009.   HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA           = $40000000;
  2010.   {$EXTERNALSYM HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA}
  2011.   HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON       = $01000000;
  2012.   {$EXTERNALSYM HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON}
  2013.   HTTP_ADDREQ_FLAG_COALESCE                      = HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA;
  2014.   {$EXTERNALSYM HTTP_ADDREQ_FLAG_COALESCE}
  2015.  
  2016. { HTTP_ADDREQ_FLAG_REPLACE - replaces the specified header. Only one header can }
  2017. { be supplied in the buffer. If the header to be replaced is not the first }
  2018. { in a list of headers with the same name, then the relative index should be }
  2019. { supplied in the low 8 bits of the dwModifiers parameter. If the header-value }
  2020. { part is missing, then the header is removed }
  2021.  
  2022.   HTTP_ADDREQ_FLAG_REPLACE        = $80000000;
  2023.   {$EXTERNALSYM HTTP_ADDREQ_FLAG_REPLACE}
  2024.  
  2025. function HttpSendRequestA(hRequest: HINTERNET; lpszHeaders: PAnsiChar; 
  2026.   dwHeadersLength: DWORD; lpOptional: Pointer; 
  2027.   dwOptionalLength: DWORD): BOOL; stdcall;
  2028.   {$EXTERNALSYM HttpSendRequestA}
  2029. function HttpSendRequestW(hRequest: HINTERNET; lpszHeaders: PWideChar; 
  2030.   dwHeadersLength: DWORD; lpOptional: Pointer; 
  2031.   dwOptionalLength: DWORD): BOOL; stdcall;
  2032.   {$EXTERNALSYM HttpSendRequestW}
  2033. function HttpSendRequest(hRequest: HINTERNET; lpszHeaders: PChar; 
  2034.   dwHeadersLength: DWORD; lpOptional: Pointer; 
  2035.   dwOptionalLength: DWORD): BOOL; stdcall;
  2036.   {$EXTERNALSYM HttpSendRequest}
  2037.  
  2038. function HttpSendRequestExA(hRequest: HINTERNET; lpBuffersIn: PInternetBuffers;
  2039.     lpBuffersOut: PInternetBuffers;
  2040.     dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
  2041.   {$EXTERNALSYM HttpSendRequestExA}
  2042. function HttpSendRequestExW(hRequest: HINTERNET; lpBuffersIn: PInternetBuffers;
  2043.     lpBuffersOut: PInternetBuffers;
  2044.     dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
  2045.   {$EXTERNALSYM HttpSendRequestExW}
  2046. function HttpSendRequestEx(hRequest: HINTERNET; lpBuffersIn: PInternetBuffers;
  2047.     lpBuffersOut: PInternetBuffers;
  2048.     dwFlags: DWORD; dwContext: DWORD): BOOL; stdcall;
  2049.   {$EXTERNALSYM HttpSendRequestEx}
  2050.  
  2051. { flags for HttpSendRequestEx(), HttpEndRequest() }
  2052. const
  2053.   HSR_ASYNC       = WININET_API_FLAG_ASYNC;          { force async }
  2054.   {$EXTERNALSYM HSR_ASYNC}
  2055.   HSR_SYNC        = WININET_API_FLAG_SYNC;           { force sync }
  2056.   {$EXTERNALSYM HSR_SYNC}
  2057.   HSR_USE_CONTEXT = WININET_API_FLAG_USE_CONTEXT;    { use dwContext value }
  2058.   {$EXTERNALSYM HSR_USE_CONTEXT}
  2059.   HSR_INITIATE    = $00000008;                       { iterative operation (completed by HttpEndRequest) }
  2060.   {$EXTERNALSYM HSR_INITIATE}
  2061.   HSR_DOWNLOAD    = $00000010;                       { download to file }
  2062.   {$EXTERNALSYM HSR_DOWNLOAD}
  2063.   HSR_CHUNKED     = $00000020;                       { operation is send of chunked data }
  2064.   {$EXTERNALSYM HSR_CHUNKED}
  2065.  
  2066. function HttpEndRequestA(hRequest: HINTERNET;
  2067.   lpBuffersOut: PInternetBuffers; dwFlags: DWORD;
  2068.   dwContext: DWORD): BOOL; stdcall;
  2069.   {$EXTERNALSYM HttpEndRequestA}
  2070. function HttpEndRequestW(hRequest: HINTERNET;
  2071.   lpBuffersOut: PInternetBuffers; dwFlags: DWORD;
  2072.   dwContext: DWORD): BOOL; stdcall;
  2073.   {$EXTERNALSYM HttpEndRequestW}
  2074. function HttpEndRequest(hRequest: HINTERNET;
  2075.   lpBuffersOut: PInternetBuffers; dwFlags: DWORD;
  2076.   dwContext: DWORD): BOOL; stdcall;
  2077.   {$EXTERNALSYM HttpEndRequest}
  2078.  
  2079. function HttpQueryInfoA(hRequest: HINTERNET; dwInfoLevel: DWORD;
  2080.   lpvBuffer: Pointer; var lpdwBufferLength: DWORD;
  2081.   var lpdwReserved: DWORD): BOOL; stdcall;
  2082.   {$EXTERNALSYM HttpQueryInfoA}
  2083. function HttpQueryInfoW(hRequest: HINTERNET; dwInfoLevel: DWORD;
  2084.   lpvBuffer: Pointer; var lpdwBufferLength: DWORD;
  2085.   var lpdwReserved: DWORD): BOOL; stdcall;
  2086.   {$EXTERNALSYM HttpQueryInfoW}
  2087. function HttpQueryInfo(hRequest: HINTERNET; dwInfoLevel: DWORD;
  2088.   lpvBuffer: Pointer; var lpdwBufferLength: DWORD;
  2089.   var lpdwReserved: DWORD): BOOL; stdcall;
  2090.   {$EXTERNALSYM HttpQueryInfo}
  2091.  
  2092. { Cookie APIs }
  2093.  
  2094. function InternetSetCookieA(lpszUrl, lpszCookieName,
  2095.   lpszCookieData: PAnsiChar): BOOL; stdcall;
  2096.   {$EXTERNALSYM InternetSetCookieA}
  2097. function InternetSetCookieW(lpszUrl, lpszCookieName,
  2098.   lpszCookieData: PWideChar): BOOL; stdcall;
  2099.   {$EXTERNALSYM InternetSetCookieW}
  2100. function InternetSetCookie(lpszUrl, lpszCookieName,
  2101.   lpszCookieData: PChar): BOOL; stdcall;
  2102.   {$EXTERNALSYM InternetSetCookie}
  2103.  
  2104. function InternetGetCookieA(lpszUrl, lpszCookieName,
  2105.   lpszCookieData: PAnsiChar; var lpdwSize: DWORD): BOOL; stdcall;
  2106.   {$EXTERNALSYM InternetGetCookieA}
  2107. function InternetGetCookieW(lpszUrl, lpszCookieName,
  2108.   lpszCookieData: PWideChar; var lpdwSize: DWORD): BOOL; stdcall;
  2109.   {$EXTERNALSYM InternetGetCookieW}
  2110. function InternetGetCookie(lpszUrl, lpszCookieName,
  2111.   lpszCookieData: PChar; var lpdwSize: DWORD): BOOL; stdcall;
  2112.   {$EXTERNALSYM InternetGetCookie}
  2113.  
  2114. function InternetAttemptConnect(dwReserved: DWORD): DWORD; stdcall;
  2115.   {$EXTERNALSYM InternetAttemptConnect}
  2116.  
  2117. function InternetCheckConnectionA(lpszUrl: PAnsiChar; dwFlags: DWORD;
  2118.     dwReserved: DWORD): BOOL; stdcall;
  2119.   {$EXTERNALSYM InternetCheckConnectionA}
  2120. function InternetCheckConnectionW(lpszUrl: PAnsiChar; dwFlags: DWORD;
  2121.     dwReserved: DWORD): BOOL; stdcall;
  2122.   {$EXTERNALSYM InternetCheckConnectionW}
  2123. function InternetCheckConnection(lpszUrl: PAnsiChar; dwFlags: DWORD;
  2124.     dwReserved: DWORD): BOOL; stdcall;
  2125.   {$EXTERNALSYM InternetCheckConnection}
  2126.  
  2127. { Internet UI }
  2128.  
  2129. { InternetErrorDlg - Provides UI for certain Errors. }
  2130. const
  2131.   FLAGS_ERROR_UI_FILTER_FOR_ERRORS            = $01;
  2132.   {$EXTERNALSYM FLAGS_ERROR_UI_FILTER_FOR_ERRORS}
  2133.   FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS         = $02;
  2134.   {$EXTERNALSYM FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS}
  2135.   FLAGS_ERROR_UI_FLAGS_GENERATE_DATA          = $04;
  2136.   {$EXTERNALSYM FLAGS_ERROR_UI_FLAGS_GENERATE_DATA}
  2137.   FLAGS_ERROR_UI_FLAGS_NO_UI                  = $08;
  2138.   {$EXTERNALSYM FLAGS_ERROR_UI_FLAGS_NO_UI}
  2139.   FLAGS_ERROR_UI_SERIALIZE_DIALOGS            = $10;
  2140.   {$EXTERNALSYM FLAGS_ERROR_UI_SERIALIZE_DIALOGS}
  2141.  
  2142. function InternetAuthNotifyCallback(
  2143.     dwContext: DWORD;     { as passed to InternetErrorDlg }
  2144.     dwReturn: DWORD;      { error code: success, resend, or cancel }
  2145.     lpReserved: Pointer   { reserved: will be set to null }
  2146. ): DWORD; stdcall;
  2147.   {$EXTERNALSYM InternetAuthNotifyCallback}
  2148.  
  2149. type
  2150.   PFN_AUTH_NOTIFY = function(dwContext:DWORD; dwReturn:DWORD;
  2151.     lpReserved:Pointer): DWORD;
  2152.   {$EXTERNALSYM PFN_AUTH_NOTIFY}
  2153.  
  2154. function InternetErrorDlg(hWnd: HWND; hRequest: HINTERNET;
  2155.   dwError, dwFlags: DWORD; var lppvData: Pointer): DWORD; stdcall;
  2156.   {$EXTERNALSYM InternetErrorDlg}
  2157.  
  2158. function InternetConfirmZoneCrossing(hWnd: HWND;
  2159.   szUrlPrev, szUrlNew: LPSTR; bPost: BOOL): DWORD; stdcall;
  2160.   {$EXTERNALSYM InternetConfirmZoneCrossing}
  2161.  
  2162. const
  2163. { Internet API error returns }
  2164.  
  2165.   INTERNET_ERROR_BASE                         = 12000;
  2166.   {$EXTERNALSYM INTERNET_ERROR_BASE}
  2167.   ERROR_INTERNET_OUT_OF_HANDLES               = INTERNET_ERROR_BASE + 1;
  2168.   {$EXTERNALSYM ERROR_INTERNET_OUT_OF_HANDLES}
  2169.   ERROR_INTERNET_TIMEOUT                      = INTERNET_ERROR_BASE + 2;
  2170.   {$EXTERNALSYM ERROR_INTERNET_TIMEOUT}
  2171.   ERROR_INTERNET_EXTENDED_ERROR               = INTERNET_ERROR_BASE + 3;
  2172.   {$EXTERNALSYM ERROR_INTERNET_EXTENDED_ERROR}
  2173.   ERROR_INTERNET_INTERNAL_ERROR               = INTERNET_ERROR_BASE + 4;
  2174.   {$EXTERNALSYM ERROR_INTERNET_INTERNAL_ERROR}
  2175.   ERROR_INTERNET_INVALID_URL                  = INTERNET_ERROR_BASE + 5;
  2176.   {$EXTERNALSYM ERROR_INTERNET_INVALID_URL}
  2177.   ERROR_INTERNET_UNRECOGNIZED_SCHEME          = INTERNET_ERROR_BASE + 6;
  2178.   {$EXTERNALSYM ERROR_INTERNET_UNRECOGNIZED_SCHEME}
  2179.   ERROR_INTERNET_NAME_NOT_RESOLVED            = INTERNET_ERROR_BASE + 7;
  2180.   {$EXTERNALSYM ERROR_INTERNET_NAME_NOT_RESOLVED}
  2181.   ERROR_INTERNET_PROTOCOL_NOT_FOUND           = INTERNET_ERROR_BASE + 8;
  2182.   {$EXTERNALSYM ERROR_INTERNET_PROTOCOL_NOT_FOUND}
  2183.   ERROR_INTERNET_INVALID_OPTION               = INTERNET_ERROR_BASE + 9;
  2184.   {$EXTERNALSYM ERROR_INTERNET_INVALID_OPTION}
  2185.   ERROR_INTERNET_BAD_OPTION_LENGTH            = INTERNET_ERROR_BASE + 10;
  2186.   {$EXTERNALSYM ERROR_INTERNET_BAD_OPTION_LENGTH}
  2187.   ERROR_INTERNET_OPTION_NOT_SETTABLE          = INTERNET_ERROR_BASE + 11;
  2188.   {$EXTERNALSYM ERROR_INTERNET_OPTION_NOT_SETTABLE}
  2189.   ERROR_INTERNET_SHUTDOWN                     = INTERNET_ERROR_BASE + 12;
  2190.   {$EXTERNALSYM ERROR_INTERNET_SHUTDOWN}
  2191.   ERROR_INTERNET_INCORRECT_USER_NAME          = INTERNET_ERROR_BASE + 13;
  2192.   {$EXTERNALSYM ERROR_INTERNET_INCORRECT_USER_NAME}
  2193.   ERROR_INTERNET_INCORRECT_PASSWORD           = INTERNET_ERROR_BASE + 14;
  2194.   {$EXTERNALSYM ERROR_INTERNET_INCORRECT_PASSWORD}
  2195.   ERROR_INTERNET_LOGIN_FAILURE                = INTERNET_ERROR_BASE + 15;
  2196.   {$EXTERNALSYM ERROR_INTERNET_LOGIN_FAILURE}
  2197.   ERROR_INTERNET_INVALID_OPERATION            = INTERNET_ERROR_BASE + 16;
  2198.   {$EXTERNALSYM ERROR_INTERNET_INVALID_OPERATION}
  2199.   ERROR_INTERNET_OPERATION_CANCELLED          = INTERNET_ERROR_BASE + 17;
  2200.   {$EXTERNALSYM ERROR_INTERNET_OPERATION_CANCELLED}
  2201.   ERROR_INTERNET_INCORRECT_HANDLE_TYPE        = INTERNET_ERROR_BASE + 18;
  2202.   {$EXTERNALSYM ERROR_INTERNET_INCORRECT_HANDLE_TYPE}
  2203.   ERROR_INTERNET_INCORRECT_HANDLE_STATE       = INTERNET_ERROR_BASE + 19;
  2204.   {$EXTERNALSYM ERROR_INTERNET_INCORRECT_HANDLE_STATE}
  2205.   ERROR_INTERNET_NOT_PROXY_REQUEST            = INTERNET_ERROR_BASE + 20;
  2206.   {$EXTERNALSYM ERROR_INTERNET_NOT_PROXY_REQUEST}
  2207.   ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND     = INTERNET_ERROR_BASE + 21;
  2208.   {$EXTERNALSYM ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND}
  2209.   ERROR_INTERNET_BAD_REGISTRY_PARAMETER       = INTERNET_ERROR_BASE + 22;
  2210.   {$EXTERNALSYM ERROR_INTERNET_BAD_REGISTRY_PARAMETER}
  2211.   ERROR_INTERNET_NO_DIRECT_ACCESS             = INTERNET_ERROR_BASE + 23;
  2212.   {$EXTERNALSYM ERROR_INTERNET_NO_DIRECT_ACCESS}
  2213.   ERROR_INTERNET_NO_CONTEXT                   = INTERNET_ERROR_BASE + 24;
  2214.   {$EXTERNALSYM ERROR_INTERNET_NO_CONTEXT}
  2215.   ERROR_INTERNET_NO_CALLBACK                  = INTERNET_ERROR_BASE + 25;
  2216.   {$EXTERNALSYM ERROR_INTERNET_NO_CALLBACK}
  2217.   ERROR_INTERNET_REQUEST_PENDING              = INTERNET_ERROR_BASE + 26;
  2218.   {$EXTERNALSYM ERROR_INTERNET_REQUEST_PENDING}
  2219.   ERROR_INTERNET_INCORRECT_FORMAT             = INTERNET_ERROR_BASE + 27;
  2220.   {$EXTERNALSYM ERROR_INTERNET_INCORRECT_FORMAT}
  2221.   ERROR_INTERNET_ITEM_NOT_FOUND               = INTERNET_ERROR_BASE + 28;
  2222.   {$EXTERNALSYM ERROR_INTERNET_ITEM_NOT_FOUND}
  2223.   ERROR_INTERNET_CANNOT_CONNECT               = INTERNET_ERROR_BASE + 29;
  2224.   {$EXTERNALSYM ERROR_INTERNET_CANNOT_CONNECT}
  2225.   ERROR_INTERNET_CONNECTION_ABORTED           = INTERNET_ERROR_BASE + 30;
  2226.   {$EXTERNALSYM ERROR_INTERNET_CONNECTION_ABORTED}
  2227.   ERROR_INTERNET_CONNECTION_RESET             = INTERNET_ERROR_BASE + 31;
  2228.   {$EXTERNALSYM ERROR_INTERNET_CONNECTION_RESET}
  2229.   ERROR_INTERNET_FORCE_RETRY                  = INTERNET_ERROR_BASE + 32;
  2230.   {$EXTERNALSYM ERROR_INTERNET_FORCE_RETRY}
  2231.   ERROR_INTERNET_INVALID_PROXY_REQUEST        = INTERNET_ERROR_BASE + 33;
  2232.   {$EXTERNALSYM ERROR_INTERNET_INVALID_PROXY_REQUEST}
  2233.   ERROR_INTERNET_HANDLE_EXISTS                = INTERNET_ERROR_BASE + 36;
  2234.   {$EXTERNALSYM ERROR_INTERNET_HANDLE_EXISTS}
  2235.   ERROR_INTERNET_SEC_CERT_DATE_INVALID        = INTERNET_ERROR_BASE + 37;
  2236.   {$EXTERNALSYM ERROR_INTERNET_SEC_CERT_DATE_INVALID}
  2237.   ERROR_INTERNET_SEC_CERT_CN_INVALID          = INTERNET_ERROR_BASE + 38;
  2238.   {$EXTERNALSYM ERROR_INTERNET_SEC_CERT_CN_INVALID}
  2239.   ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR       = INTERNET_ERROR_BASE + 39;
  2240.   {$EXTERNALSYM ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR}
  2241.   ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR       = INTERNET_ERROR_BASE + 40;
  2242.   {$EXTERNALSYM ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR}
  2243.   ERROR_INTERNET_MIXED_SECURITY               = INTERNET_ERROR_BASE + 41;
  2244.   {$EXTERNALSYM ERROR_INTERNET_MIXED_SECURITY}
  2245.   ERROR_INTERNET_CHG_POST_IS_NON_SECURE       = INTERNET_ERROR_BASE + 42;
  2246.   {$EXTERNALSYM ERROR_INTERNET_CHG_POST_IS_NON_SECURE}
  2247.   ERROR_INTERNET_POST_IS_NON_SECURE           = INTERNET_ERROR_BASE + 43;
  2248.   {$EXTERNALSYM ERROR_INTERNET_POST_IS_NON_SECURE}
  2249.   ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED      = INTERNET_ERROR_BASE + 44;
  2250.   {$EXTERNALSYM ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED}
  2251.   ERROR_INTERNET_INVALID_CA                   = INTERNET_ERROR_BASE + 45;
  2252.   {$EXTERNALSYM ERROR_INTERNET_INVALID_CA}
  2253.   ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP        = INTERNET_ERROR_BASE + 46;
  2254.   {$EXTERNALSYM ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP}
  2255.   ERROR_INTERNET_ASYNC_THREAD_FAILED          = INTERNET_ERROR_BASE + 47;
  2256.   {$EXTERNALSYM ERROR_INTERNET_ASYNC_THREAD_FAILED}
  2257.   ERROR_INTERNET_REDIRECT_SCHEME_CHANGE       = INTERNET_ERROR_BASE + 48;
  2258.   {$EXTERNALSYM ERROR_INTERNET_REDIRECT_SCHEME_CHANGE}
  2259.   ERROR_INTERNET_DIALOG_PENDING               = INTERNET_ERROR_BASE + 49;
  2260.   {$EXTERNALSYM ERROR_INTERNET_DIALOG_PENDING}
  2261.   ERROR_INTERNET_RETRY_DIALOG                 = INTERNET_ERROR_BASE + 50;
  2262.   {$EXTERNALSYM ERROR_INTERNET_RETRY_DIALOG}
  2263.   ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR      = INTERNET_ERROR_BASE + 52;
  2264.   {$EXTERNALSYM ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR}
  2265.   ERROR_INTERNET_INSERT_CDROM                 = INTERNET_ERROR_BASE + 53;
  2266.   {$EXTERNALSYM ERROR_INTERNET_INSERT_CDROM}
  2267.  
  2268. { FTP API errors }
  2269.  
  2270.   ERROR_FTP_TRANSFER_IN_PROGRESS              = INTERNET_ERROR_BASE + 110;
  2271.   {$EXTERNALSYM ERROR_FTP_TRANSFER_IN_PROGRESS}
  2272.   ERROR_FTP_DROPPED                           = INTERNET_ERROR_BASE + 111;
  2273.   {$EXTERNALSYM ERROR_FTP_DROPPED}
  2274.   ERROR_FTP_NO_PASSIVE_MODE                   = INTERNET_ERROR_BASE + 112;
  2275.   {$EXTERNALSYM ERROR_FTP_NO_PASSIVE_MODE}
  2276.  
  2277. { gopher API errors }
  2278.  
  2279.   ERROR_GOPHER_PROTOCOL_ERROR                 = INTERNET_ERROR_BASE + 130;
  2280.   {$EXTERNALSYM ERROR_GOPHER_PROTOCOL_ERROR}
  2281.   ERROR_GOPHER_NOT_FILE                       = INTERNET_ERROR_BASE + 131;
  2282.   {$EXTERNALSYM ERROR_GOPHER_NOT_FILE}
  2283.   ERROR_GOPHER_DATA_ERROR                     = INTERNET_ERROR_BASE + 132;
  2284.   {$EXTERNALSYM ERROR_GOPHER_DATA_ERROR}
  2285.   ERROR_GOPHER_END_OF_DATA                    = INTERNET_ERROR_BASE + 133;
  2286.   {$EXTERNALSYM ERROR_GOPHER_END_OF_DATA}
  2287.   ERROR_GOPHER_INVALID_LOCATOR                = INTERNET_ERROR_BASE + 134;
  2288.   {$EXTERNALSYM ERROR_GOPHER_INVALID_LOCATOR}
  2289.   ERROR_GOPHER_INCORRECT_LOCATOR_TYPE         = INTERNET_ERROR_BASE + 135;
  2290.   {$EXTERNALSYM ERROR_GOPHER_INCORRECT_LOCATOR_TYPE}
  2291.   ERROR_GOPHER_NOT_GOPHER_PLUS                = INTERNET_ERROR_BASE + 136;
  2292.   {$EXTERNALSYM ERROR_GOPHER_NOT_GOPHER_PLUS}
  2293.   ERROR_GOPHER_ATTRIBUTE_NOT_FOUND            = INTERNET_ERROR_BASE + 137;
  2294.   {$EXTERNALSYM ERROR_GOPHER_ATTRIBUTE_NOT_FOUND}
  2295.   ERROR_GOPHER_UNKNOWN_LOCATOR                = INTERNET_ERROR_BASE + 138;
  2296.   {$EXTERNALSYM ERROR_GOPHER_UNKNOWN_LOCATOR}
  2297.  
  2298. { HTTP API errors }
  2299.  
  2300.   ERROR_HTTP_HEADER_NOT_FOUND                 = INTERNET_ERROR_BASE + 150;
  2301.   {$EXTERNALSYM ERROR_HTTP_HEADER_NOT_FOUND}
  2302.   ERROR_HTTP_DOWNLEVEL_SERVER                 = INTERNET_ERROR_BASE + 151;
  2303.   {$EXTERNALSYM ERROR_HTTP_DOWNLEVEL_SERVER}
  2304.   ERROR_HTTP_INVALID_SERVER_RESPONSE          = INTERNET_ERROR_BASE + 152;
  2305.   {$EXTERNALSYM ERROR_HTTP_INVALID_SERVER_RESPONSE}
  2306.   ERROR_HTTP_INVALID_HEADER                   = INTERNET_ERROR_BASE + 153;
  2307.   {$EXTERNALSYM ERROR_HTTP_INVALID_HEADER}
  2308.   ERROR_HTTP_INVALID_QUERY_REQUEST            = INTERNET_ERROR_BASE + 154;
  2309.   {$EXTERNALSYM ERROR_HTTP_INVALID_QUERY_REQUEST}
  2310.   ERROR_HTTP_HEADER_ALREADY_EXISTS            = INTERNET_ERROR_BASE + 155;
  2311.   {$EXTERNALSYM ERROR_HTTP_HEADER_ALREADY_EXISTS}
  2312.   ERROR_HTTP_REDIRECT_FAILED                  = INTERNET_ERROR_BASE + 156;
  2313.   {$EXTERNALSYM ERROR_HTTP_REDIRECT_FAILED}
  2314.   ERROR_HTTP_NOT_REDIRECTED                   = INTERNET_ERROR_BASE + 160;
  2315.   {$EXTERNALSYM ERROR_HTTP_NOT_REDIRECTED}
  2316.   ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION        = INTERNET_ERROR_BASE + 161;
  2317.   {$EXTERNALSYM ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION}
  2318.   ERROR_HTTP_COOKIE_DECLINED                  = INTERNET_ERROR_BASE + 162;
  2319.   {$EXTERNALSYM ERROR_HTTP_COOKIE_DECLINED}
  2320.   ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION      = INTERNET_ERROR_BASE + 168;
  2321.   {$EXTERNALSYM ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION}
  2322.  
  2323. { additional Internet API error codes }
  2324.   ERROR_INTERNET_SECURITY_CHANNEL_ERROR       = INTERNET_ERROR_BASE + 157;
  2325.   {$EXTERNALSYM ERROR_INTERNET_SECURITY_CHANNEL_ERROR}
  2326.   ERROR_INTERNET_UNABLE_TO_CACHE_FILE         = INTERNET_ERROR_BASE + 158;
  2327.   {$EXTERNALSYM ERROR_INTERNET_UNABLE_TO_CACHE_FILE}
  2328.   ERROR_INTERNET_TCPIP_NOT_INSTALLED          = INTERNET_ERROR_BASE + 159;
  2329.   {$EXTERNALSYM ERROR_INTERNET_TCPIP_NOT_INSTALLED}
  2330.   ERROR_INTERNET_DISCONNECTED                 = INTERNET_ERROR_BASE + 163;
  2331.   {$EXTERNALSYM ERROR_INTERNET_DISCONNECTED}
  2332.   ERROR_INTERNET_SERVER_UNREACHABLE           = INTERNET_ERROR_BASE + 164;
  2333.   {$EXTERNALSYM ERROR_INTERNET_SERVER_UNREACHABLE}
  2334.   ERROR_INTERNET_PROXY_SERVER_UNREACHABLE     = INTERNET_ERROR_BASE + 165;
  2335.   {$EXTERNALSYM ERROR_INTERNET_PROXY_SERVER_UNREACHABLE}
  2336.   ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT        = INTERNET_ERROR_BASE + 166;
  2337.   {$EXTERNALSYM ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT}
  2338.   ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT    = INTERNET_ERROR_BASE + 167;
  2339.   {$EXTERNALSYM ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT}
  2340.   ERROR_INTERNET_SEC_INVALID_CERT             = INTERNET_ERROR_BASE + 169;
  2341.   {$EXTERNALSYM ERROR_INTERNET_SEC_INVALID_CERT}
  2342.   ERROR_INTERNET_SEC_CERT_REVOKED             = INTERNET_ERROR_BASE + 170;
  2343.   {$EXTERNALSYM ERROR_INTERNET_SEC_CERT_REVOKED}
  2344.  
  2345. { InternetAutodial specific errors }
  2346.  
  2347.   ERROR_INTERNET_FAILED_DUETOSECURITYCHECK    = INTERNET_ERROR_BASE + 171;
  2348.   {$EXTERNALSYM ERROR_INTERNET_FAILED_DUETOSECURITYCHECK}
  2349.   INTERNET_ERROR_LAST                         = ERROR_INTERNET_FAILED_DUETOSECURITYCHECK;
  2350.   {$EXTERNALSYM INTERNET_ERROR_LAST}
  2351.  
  2352. { URLCACHE APIs }
  2353.  
  2354. { datatype definitions. }
  2355.  
  2356. { cache entry type flags. }
  2357.  
  2358.   NORMAL_CACHE_ENTRY          = $00000001;
  2359.   {$EXTERNALSYM NORMAL_CACHE_ENTRY}
  2360.   STABLE_CACHE_ENTRY          = $00000002;
  2361.   {$EXTERNALSYM STABLE_CACHE_ENTRY}
  2362.   STICKY_CACHE_ENTRY          = $00000004;
  2363.   {$EXTERNALSYM STICKY_CACHE_ENTRY}
  2364.   COOKIE_CACHE_ENTRY          = $00100000;
  2365.   {$EXTERNALSYM COOKIE_CACHE_ENTRY}
  2366.   URLHISTORY_CACHE_ENTRY      = $00200000;
  2367.   {$EXTERNALSYM URLHISTORY_CACHE_ENTRY}
  2368.   TRACK_OFFLINE_CACHE_ENTRY   = $00000010;
  2369.   {$EXTERNALSYM TRACK_OFFLINE_CACHE_ENTRY}
  2370.   TRACK_ONLINE_CACHE_ENTRY    = $00000020;
  2371.   {$EXTERNALSYM TRACK_ONLINE_CACHE_ENTRY}
  2372.   SPARSE_CACHE_ENTRY          = $00010000;
  2373.   {$EXTERNALSYM SPARSE_CACHE_ENTRY}
  2374.   OCX_CACHE_ENTRY             = $00020000;
  2375.   {$EXTERNALSYM OCX_CACHE_ENTRY}
  2376.  
  2377.   URLCACHE_FIND_DEFAULT_FILTER = NORMAL_CACHE_ENTRY or
  2378.                                  COOKIE_CACHE_ENTRY or
  2379.                                  URLHISTORY_CACHE_ENTRY or
  2380.                                  TRACK_OFFLINE_CACHE_ENTRY or
  2381.                                  TRACK_ONLINE_CACHE_ENTRY or
  2382.                                  STICKY_CACHE_ENTRY;
  2383.   {$EXTERNALSYM URLCACHE_FIND_DEFAULT_FILTER}
  2384.  
  2385. type
  2386.   PInternetCacheEntryInfoA = ^INTERNET_CACHE_ENTRY_INFOA;
  2387.   INTERNET_CACHE_ENTRY_INFOA = record
  2388.     dwStructSize: DWORD;         { version of cache system. ?? do we need this for all entries? }
  2389.     lpszSourceUrlName: PAnsiChar;    { embedded pointer to the URL name string. }
  2390.     lpszLocalFileName: PAnsiChar;   { embedded pointer to the local file name. }
  2391.     CacheEntryType: DWORD;       { cache type bit mask. }
  2392.     dwUseCount: DWORD;           { current users count of the cache entry. }
  2393.     dwHitRate: DWORD;            { num of times the cache entry was retrieved. }
  2394.     dwSizeLow: DWORD;            { low DWORD of the file size. }
  2395.     dwSizeHigh: DWORD;           { high DWORD of the file size. }
  2396.     LastModifiedTime: TFileTime; { last modified time of the file in GMT format. }
  2397.     ExpireTime: TFileTime;       { expire time of the file in GMT format }
  2398.     LastAccessTime: TFileTime;   { last accessed time in GMT format }
  2399.     LastSyncTime: TFileTime;     { last time the URL was synchronized }
  2400.                                  { with the source }
  2401.     lpHeaderInfo: PBYTE;         { embedded pointer to the header info. }
  2402.     dwHeaderInfoSize: DWORD;     { size of the above header. }
  2403.     lpszFileExtension: PAnsiChar;   { File extension used to retrive the urldata as a file. }
  2404.     dwReserved: DWORD;           { reserved for future use. }
  2405.   end;
  2406.   {$EXTERNALSYM INTERNET_CACHE_ENTRY_INFOA}
  2407.   PInternetCacheEntryInfoW = ^INTERNET_CACHE_ENTRY_INFOW;
  2408.   INTERNET_CACHE_ENTRY_INFOW = record
  2409.     dwStructSize: DWORD;         { version of cache system. ?? do we need this for all entries? }
  2410.     lpszSourceUrlName: PAnsiChar;    { embedded pointer to the URL name string. }
  2411.     lpszLocalFileName: PWideChar;   { embedded pointer to the local file name. }
  2412.     CacheEntryType: DWORD;       { cache type bit mask. }
  2413.     dwUseCount: DWORD;           { current users count of the cache entry. }
  2414.     dwHitRate: DWORD;            { num of times the cache entry was retrieved. }
  2415.     dwSizeLow: DWORD;            { low DWORD of the file size. }
  2416.     dwSizeHigh: DWORD;           { high DWORD of the file size. }
  2417.     LastModifiedTime: TFileTime; { last modified time of the file in GMT format. }
  2418.     ExpireTime: TFileTime;       { expire time of the file in GMT format }
  2419.     LastAccessTime: TFileTime;   { last accessed time in GMT format }
  2420.     LastSyncTime: TFileTime;     { last time the URL was synchronized }
  2421.                                  { with the source }
  2422.     lpHeaderInfo: PBYTE;         { embedded pointer to the header info. }
  2423.     dwHeaderInfoSize: DWORD;     { size of the above header. }
  2424.     lpszFileExtension: PWideChar;   { File extension used to retrive the urldata as a file. }
  2425.     dwReserved: DWORD;           { reserved for future use. }
  2426.   end;
  2427.   {$EXTERNALSYM INTERNET_CACHE_ENTRY_INFOW}
  2428.   PInternetCacheEntryInfo = PInternetCacheEntryInfoA;
  2429.   TInternetCacheEntryInfoA = INTERNET_CACHE_ENTRY_INFOA;
  2430.   LPINTERNET_CACHE_ENTRY_INFOA = PInternetCacheEntryInfoA;
  2431.   {$EXTERNALSYM LPINTERNET_CACHE_ENTRY_INFOA}
  2432.   TInternetCacheEntryInfoW = INTERNET_CACHE_ENTRY_INFOW;
  2433.   LPINTERNET_CACHE_ENTRY_INFOW = PInternetCacheEntryInfoW;
  2434.   {$EXTERNALSYM LPINTERNET_CACHE_ENTRY_INFOW}
  2435.   TInternetCacheEntryInfo = TInternetCacheEntryInfoA;
  2436.  
  2437. { Cache APIs }
  2438.  
  2439. function CreateUrlCacheEntryA(lpszUrlName: PAnsiChar;
  2440.   dwExpectedFileSize: DWORD; lpszFileExtension: PAnsiChar;
  2441.   lpszFileName: PAnsiChar; dwReserved: DWORD): BOOL; stdcall;
  2442.   {$EXTERNALSYM CreateUrlCacheEntryA}
  2443. function CreateUrlCacheEntryW(lpszUrlName: PAnsiChar;
  2444.   dwExpectedFileSize: DWORD; lpszFileExtension: PAnsiChar;
  2445.   lpszFileName: PWideChar; dwReserved: DWORD): BOOL; stdcall;
  2446.   {$EXTERNALSYM CreateUrlCacheEntryW}
  2447. function CreateUrlCacheEntry(lpszUrlName: PAnsiChar;
  2448.   dwExpectedFileSize: DWORD; lpszFileExtension: PAnsiChar;
  2449.   lpszFileName: PChar; dwReserved: DWORD): BOOL; stdcall;
  2450.   {$EXTERNALSYM CreateUrlCacheEntry}
  2451.  
  2452. function CommitUrlCacheEntryA(lpszUrlName, lpszLocalFileName: PAnsiChar;
  2453.   ExpireTime, LastModifiedTime: TFileTime;  CacheEntryType: DWORD;
  2454.   lpHeaderInfo: PBYTE; dwHeaderSize: DWORD; lpszFileExtension: PAnsiChar;
  2455.   dwReserved: DWORD): BOOL; stdcall;
  2456.   {$EXTERNALSYM CommitUrlCacheEntryA}
  2457. function CommitUrlCacheEntryW(lpszUrlName, lpszLocalFileName: PAnsiChar;
  2458.   ExpireTime, LastModifiedTime: TFileTime;  CacheEntryType: DWORD;
  2459.   lpHeaderInfo: PBYTE; dwHeaderSize: DWORD; lpszFileExtension: PWideChar;
  2460.   dwReserved: DWORD): BOOL; stdcall;
  2461.   {$EXTERNALSYM CommitUrlCacheEntryW}
  2462. function CommitUrlCacheEntry(lpszUrlName, lpszLocalFileName: PAnsiChar;
  2463.   ExpireTime, LastModifiedTime: TFileTime;  CacheEntryType: DWORD;
  2464.   lpHeaderInfo: PBYTE; dwHeaderSize: DWORD; lpszFileExtension: PChar;
  2465.   dwReserved: DWORD): BOOL; stdcall;
  2466.   {$EXTERNALSYM CommitUrlCacheEntry}
  2467.  
  2468. function RetrieveUrlCacheEntryFileA(lpszUrlName: PAnsiChar;
  2469.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2470.   var lpdwCacheEntryInfoBufferSize: DWORD;
  2471.   dwReserved: DWORD): BOOL; stdcall;
  2472.   {$EXTERNALSYM RetrieveUrlCacheEntryFileA}
  2473. function RetrieveUrlCacheEntryFileW(lpszUrlName: PAnsiChar;
  2474.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2475.   var lpdwCacheEntryInfoBufferSize: DWORD;
  2476.   dwReserved: DWORD): BOOL; stdcall;
  2477.   {$EXTERNALSYM RetrieveUrlCacheEntryFileW}
  2478. function RetrieveUrlCacheEntryFile(lpszUrlName: PAnsiChar;
  2479.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2480.   var lpdwCacheEntryInfoBufferSize: DWORD;
  2481.   dwReserved: DWORD): BOOL; stdcall;
  2482.   {$EXTERNALSYM RetrieveUrlCacheEntryFile}
  2483.  
  2484. function UnlockUrlCacheEntryFile(lpszUrlName: LPCSTR;
  2485.   dwReserved: DWORD): BOOL; stdcall;
  2486.   {$EXTERNALSYM UnlockUrlCacheEntryFile}
  2487.  
  2488. function RetrieveUrlCacheEntryStreamA(lpszUrlName: PAnsiChar;
  2489.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2490.   var lpdwCacheEntryInfoBufferSize: DWORD; fRandomRead: BOOL;
  2491.   dwReserved: DWORD): BOOL; stdcall;
  2492.   {$EXTERNALSYM RetrieveUrlCacheEntryStreamA}
  2493. function RetrieveUrlCacheEntryStreamW(lpszUrlName: PAnsiChar;
  2494.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2495.   var lpdwCacheEntryInfoBufferSize: DWORD; fRandomRead: BOOL;
  2496.   dwReserved: DWORD): BOOL; stdcall;
  2497.   {$EXTERNALSYM RetrieveUrlCacheEntryStreamW}
  2498. function RetrieveUrlCacheEntryStream(lpszUrlName: PAnsiChar;
  2499.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2500.   var lpdwCacheEntryInfoBufferSize: DWORD; fRandomRead: BOOL;
  2501.   dwReserved: DWORD): BOOL; stdcall;
  2502.   {$EXTERNALSYM RetrieveUrlCacheEntryStream}
  2503.  
  2504. function ReadUrlCacheEntryStream(hUrlCacheStream: THandle;
  2505.   dwLocation: DWORD; var lpBuffer: Pointer;
  2506.   var lpdwLen: DWORD; Reserved: DWORD): BOOL; stdcall;
  2507.   {$EXTERNALSYM ReadUrlCacheEntryStream}
  2508.  
  2509. function UnlockUrlCacheEntryStream(hUrlCacheStream: THandle;
  2510.   Reserved: DWORD): BOOL; stdcall;
  2511.   {$EXTERNALSYM UnlockUrlCacheEntryStream}
  2512.  
  2513. function GetUrlCacheEntryInfoA(lpszUrlName: PAnsiChar;
  2514.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2515.   var lpdwCacheEntryInfoBufferSize: DWORD): BOOL; stdcall;
  2516.   {$EXTERNALSYM GetUrlCacheEntryInfoA}
  2517. function GetUrlCacheEntryInfoW(lpszUrlName: PAnsiChar;
  2518.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2519.   var lpdwCacheEntryInfoBufferSize: DWORD): BOOL; stdcall;
  2520.   {$EXTERNALSYM GetUrlCacheEntryInfoW}
  2521. function GetUrlCacheEntryInfo(lpszUrlName: PAnsiChar;
  2522.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2523.   var lpdwCacheEntryInfoBufferSize: DWORD): BOOL; stdcall;
  2524.   {$EXTERNALSYM GetUrlCacheEntryInfo}
  2525.  
  2526. function GetUrlCacheEntryInfoExA(
  2527.     lpszUrl: PAnsiChar;
  2528.     lpCacheEntryInfo: PInternetCacheEntryInfo;
  2529.     lpdwCacheEntryInfoBufSize: LPDWORD;
  2530.     lpszReserved: PAnsiChar; { must pass nil }
  2531.     lpdwReserved: LPDWORD; { must pass nil }
  2532.     lpReserved: Pointer; { must pass nil }
  2533.     dwFlags: DWORD { reserved }
  2534.     ): BOOL; stdcall;
  2535.   {$EXTERNALSYM GetUrlCacheEntryInfoExA}
  2536. function GetUrlCacheEntryInfoExW(
  2537.     lpszUrl: PAnsiChar;
  2538.     lpCacheEntryInfo: PInternetCacheEntryInfo;
  2539.     lpdwCacheEntryInfoBufSize: LPDWORD;
  2540.     lpszReserved: PAnsiChar; { must pass nil }
  2541.     lpdwReserved: LPDWORD; { must pass nil }
  2542.     lpReserved: Pointer; { must pass nil }
  2543.     dwFlags: DWORD { reserved }
  2544.     ): BOOL; stdcall;
  2545.   {$EXTERNALSYM GetUrlCacheEntryInfoExW}
  2546. function GetUrlCacheEntryInfoEx(
  2547.     lpszUrl: PAnsiChar;
  2548.     lpCacheEntryInfo: PInternetCacheEntryInfo;
  2549.     lpdwCacheEntryInfoBufSize: LPDWORD;
  2550.     lpszReserved: PAnsiChar; { must pass nil }
  2551.     lpdwReserved: LPDWORD; { must pass nil }
  2552.     lpReserved: Pointer; { must pass nil }
  2553.     dwFlags: DWORD { reserved }
  2554.     ): BOOL; stdcall;
  2555.   {$EXTERNALSYM GetUrlCacheEntryInfoEx}
  2556.  
  2557. const
  2558.   CACHE_ENTRY_ATTRIBUTE_FC        = $00000004;
  2559.   {$EXTERNALSYM CACHE_ENTRY_ATTRIBUTE_FC}
  2560.   CACHE_ENTRY_HITRATE_FC          = $00000010;
  2561.   {$EXTERNALSYM CACHE_ENTRY_HITRATE_FC}
  2562.   CACHE_ENTRY_MODTIME_FC          = $00000040;
  2563.   {$EXTERNALSYM CACHE_ENTRY_MODTIME_FC}
  2564.   CACHE_ENTRY_EXPTIME_FC          = $00000080;
  2565.   {$EXTERNALSYM CACHE_ENTRY_EXPTIME_FC}
  2566.   CACHE_ENTRY_ACCTIME_FC          = $00000100;
  2567.   {$EXTERNALSYM CACHE_ENTRY_ACCTIME_FC}
  2568.   CACHE_ENTRY_SYNCTIME_FC         = $00000200;
  2569.   {$EXTERNALSYM CACHE_ENTRY_SYNCTIME_FC}
  2570.   CACHE_ENTRY_HEADERINFO_FC       = $00000400;
  2571.   {$EXTERNALSYM CACHE_ENTRY_HEADERINFO_FC}
  2572.   CACHE_ENTRY_EXEMPT_DELTA_FC     = $00000800;
  2573.   {$EXTERNALSYM CACHE_ENTRY_EXEMPT_DELTA_FC}
  2574.  
  2575. function SetUrlCacheEntryInfoA(lpszUrlName: PAnsiChar;
  2576.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2577.   dwFieldControl: DWORD): BOOL; stdcall;
  2578.   {$EXTERNALSYM SetUrlCacheEntryInfoA}
  2579. function SetUrlCacheEntryInfoW(lpszUrlName: PAnsiChar;
  2580.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2581.   dwFieldControl: DWORD): BOOL; stdcall;
  2582.   {$EXTERNALSYM SetUrlCacheEntryInfoW}
  2583. function SetUrlCacheEntryInfo(lpszUrlName: PAnsiChar;
  2584.   var lpCacheEntryInfo: TInternetCacheEntryInfo;
  2585.   dwFieldControl: DWORD): BOOL; stdcall;
  2586.   {$EXTERNALSYM SetUrlCacheEntryInfo}
  2587.  
  2588. type
  2589.   GROUPID = Int64;
  2590.   {$EXTERNALSYM GROUPID}
  2591.  
  2592. function CreateUrlCacheGroup(dwFlags: DWORD;
  2593.   lpReserved: Pointer { must pass nill }
  2594.   ): Int64; stdcall;
  2595.   {$EXTERNALSYM CreateUrlCacheGroup}
  2596.  
  2597. function DeleteUrlCacheGroup(GroupId: Int64;
  2598.     dwFlags: DWORD;    { must pass 0 }
  2599.     lpReserved: Pointer { must pass nill }
  2600.     ): Bool; stdcall;
  2601.   {$EXTERNALSYM DeleteUrlCacheGroup}
  2602.  
  2603. { Flags for SetUrlCacheEntryGroup }
  2604.  
  2605. const
  2606.   INTERNET_CACHE_GROUP_ADD      = 0;
  2607.   {$EXTERNALSYM INTERNET_CACHE_GROUP_ADD}
  2608.   INTERNET_CACHE_GROUP_REMOVE   = 1;
  2609.   {$EXTERNALSYM INTERNET_CACHE_GROUP_REMOVE}
  2610.  
  2611. function SetUrlCacheEntryGroup(lpszUrlName: LPCSTR; dwFlags: DWORD;
  2612.   GroupId: Int64;
  2613.   pbGroupAttributes: PChar; { must pass nil }
  2614.   cbGroupAttributes: DWORD;  { must pass 0 }
  2615.   lpReserved: Pointer        { must pass nil }
  2616.   ): Bool; stdcall;
  2617.   {$EXTERNALSYM SetUrlCacheEntryGroup}
  2618.  
  2619. function FindFirstUrlCacheEntryExA(lpszUrlSearchPattern: PAnsiChar;
  2620.     dwFlags: DWORD;
  2621.     dwFilter: DWORD;
  2622.     GroupId: GROUPID;
  2623.     lpFirstCacheEntryInfo: PInternetCacheEntryInfo;
  2624.     lpdwFirstCacheEntryInfoBufferSize: LPDWORD;
  2625.     lpGroupAttributes: Pointer;  { must pass nil }
  2626.     pcbGroupAttributes: LPDWORD;    { must pass nil }
  2627.     lpReserved: Pointer             { must pass nil }
  2628.     ): THandle; stdcall;
  2629.   {$EXTERNALSYM FindFirstUrlCacheEntryExA}
  2630. function FindFirstUrlCacheEntryExW(lpszUrlSearchPattern: PAnsiChar;
  2631.     dwFlags: DWORD;
  2632.     dwFilter: DWORD;
  2633.     GroupId: GROUPID;
  2634.     lpFirstCacheEntryInfo: PInternetCacheEntryInfo;
  2635.     lpdwFirstCacheEntryInfoBufferSize: LPDWORD;
  2636.     lpGroupAttributes: Pointer;  { must pass nil }
  2637.     pcbGroupAttributes: LPDWORD;    { must pass nil }
  2638.     lpReserved: Pointer             { must pass nil }
  2639.     ): THandle; stdcall;
  2640.   {$EXTERNALSYM FindFirstUrlCacheEntryExW}
  2641. function FindFirstUrlCacheEntryEx(lpszUrlSearchPattern: PAnsiChar;
  2642.     dwFlags: DWORD;
  2643.     dwFilter: DWORD;
  2644.     GroupId: GROUPID;
  2645.     lpFirstCacheEntryInfo: PInternetCacheEntryInfo;
  2646.     lpdwFirstCacheEntryInfoBufferSize: LPDWORD;
  2647.     lpGroupAttributes: Pointer;  { must pass nil }
  2648.     pcbGroupAttributes: LPDWORD;    { must pass nil }
  2649.     lpReserved: Pointer             { must pass nil }
  2650.     ): THandle; stdcall;
  2651.   {$EXTERNALSYM FindFirstUrlCacheEntryEx}
  2652.  
  2653. function FindNextUrlCacheEntryExA(hEnumHandle: THANDLE;
  2654.     lpFirstCacheEntryInfo: PInternetCacheEntryInfo;
  2655.     lpdwFirstCacheEntryInfoBufferSize: LPDWORD;
  2656.     lpGroupAttributes: Pointer;  { must pass nil }
  2657.     pcbGroupAttributes: LPDWORD;    { must pass nil }
  2658.     lpReserved: Pointer             { must pass nil }
  2659.     ): BOOL; stdcall;
  2660.   {$EXTERNALSYM FindNextUrlCacheEntryExA}
  2661. function FindNextUrlCacheEntryExW(hEnumHandle: THANDLE;
  2662.     lpFirstCacheEntryInfo: PInternetCacheEntryInfo;
  2663.     lpdwFirstCacheEntryInfoBufferSize: LPDWORD;
  2664.     lpGroupAttributes: Pointer;  { must pass nil }
  2665.     pcbGroupAttributes: LPDWORD;    { must pass nil }
  2666.     lpReserved: Pointer             { must pass nil }
  2667.     ): BOOL; stdcall;
  2668.   {$EXTERNALSYM FindNextUrlCacheEntryExW}
  2669. function FindNextUrlCacheEntryEx(hEnumHandle: THANDLE;
  2670.     lpFirstCacheEntryInfo: PInternetCacheEntryInfo;
  2671.     lpdwFirstCacheEntryInfoBufferSize: LPDWORD;
  2672.     lpGroupAttributes: Pointer;  { must pass nil }
  2673.     pcbGroupAttributes: LPDWORD;    { must pass nil }
  2674.     lpReserved: Pointer             { must pass nil }
  2675.     ): BOOL; stdcall;
  2676.   {$EXTERNALSYM FindNextUrlCacheEntryEx}
  2677.  
  2678. function FindFirstUrlCacheEntryA(lpszUrlSearchPattern: PAnsiChar;
  2679.   var lpFirstCacheEntryInfo: TInternetCacheEntryInfo;
  2680.   var lpdwFirstCacheEntryInfoBufferSize: DWORD): THandle; stdcall;
  2681.   {$EXTERNALSYM FindFirstUrlCacheEntryA}
  2682. function FindFirstUrlCacheEntryW(lpszUrlSearchPattern: PAnsiChar;
  2683.   var lpFirstCacheEntryInfo: TInternetCacheEntryInfo;
  2684.   var lpdwFirstCacheEntryInfoBufferSize: DWORD): THandle; stdcall;
  2685.   {$EXTERNALSYM FindFirstUrlCacheEntryW}
  2686. function FindFirstUrlCacheEntry(lpszUrlSearchPattern: PAnsiChar;
  2687.   var lpFirstCacheEntryInfo: TInternetCacheEntryInfo;
  2688.   var lpdwFirstCacheEntryInfoBufferSize: DWORD): THandle; stdcall;
  2689.   {$EXTERNALSYM FindFirstUrlCacheEntry}
  2690.  
  2691. function FindNextUrlCacheEntryA(hEnumHandle: THandle;
  2692.   var lpNextCacheEntryInfo: TInternetCacheEntryInfo;
  2693.   var lpdwNextCacheEntryInfoBufferSize: DWORD): BOOL; stdcall;
  2694.   {$EXTERNALSYM FindNextUrlCacheEntryA}
  2695. function FindNextUrlCacheEntryW(hEnumHandle: THandle;
  2696.   var lpNextCacheEntryInfo: TInternetCacheEntryInfo;
  2697.   var lpdwNextCacheEntryInfoBufferSize: DWORD): BOOL; stdcall;
  2698.   {$EXTERNALSYM FindNextUrlCacheEntryW}
  2699. function FindNextUrlCacheEntry(hEnumHandle: THandle;
  2700.   var lpNextCacheEntryInfo: TInternetCacheEntryInfo;
  2701.   var lpdwNextCacheEntryInfoBufferSize: DWORD): BOOL; stdcall;
  2702.   {$EXTERNALSYM FindNextUrlCacheEntry}
  2703.  
  2704. function FindCloseUrlCache(hEnumHandle: THandle): BOOL; stdcall;
  2705.   {$EXTERNALSYM FindCloseUrlCache}
  2706.  
  2707. function DeleteUrlCacheEntry(lpszUrlName: LPCSTR): BOOL; stdcall;
  2708.   {$EXTERNALSYM DeleteUrlCacheEntry}
  2709.  
  2710. function InternetDial(hwndParent: HWND; lpszConnectoid: LPTSTR; dwFlags: DWORD;
  2711.   lpdwConnection: LPDWORD; dwReserved: DWORD): DWORD; stdcall;
  2712.   {$EXTERNALSYM InternetDial}
  2713.  
  2714. { Flags for InternetDial - must not conflict with InternetAutodial flags }
  2715. {                          as they are valid here also.                  }
  2716. const
  2717.   INTERNET_DIAL_UNATTENDED       = $8000;
  2718.   {$EXTERNALSYM INTERNET_DIAL_UNATTENDED}
  2719.  
  2720. function InternetHangUp(dwConnection: DWORD; dwReserved: DWORD): DWORD; stdcall;
  2721.   {$EXTERNALSYM InternetHangUp}
  2722.  
  2723. const
  2724.   INTERENT_GOONLINE_REFRESH = $00000001;
  2725.   {$EXTERNALSYM INTERENT_GOONLINE_REFRESH}
  2726.   INTERENT_GOONLINE_MASK    = $00000001;
  2727.   {$EXTERNALSYM INTERENT_GOONLINE_MASK}
  2728.  
  2729. function InternetGoOnline(lpszURL: LPTSTR; hwndParent: HWND;
  2730.   dwFlags: DWORD): BOOL; stdcall;
  2731.   {$EXTERNALSYM InternetGoOnline}
  2732.  
  2733. function InternetAutodial(dwFlags: DWORD; dwReserved: DWORD): BOOL; stdcall;
  2734.   {$EXTERNALSYM InternetAutodial}
  2735.  
  2736. { Flags for InternetAutodial }
  2737. const
  2738.   INTERNET_AUTODIAL_FORCE_ONLINE          = 1;
  2739.   {$EXTERNALSYM INTERNET_AUTODIAL_FORCE_ONLINE}
  2740.   INTERNET_AUTODIAL_FORCE_UNATTENDED      = 2;
  2741.   {$EXTERNALSYM INTERNET_AUTODIAL_FORCE_UNATTENDED}
  2742.   INTERNET_AUTODIAL_FAILIFSECURITYCHECK   = 4;
  2743.   {$EXTERNALSYM INTERNET_AUTODIAL_FAILIFSECURITYCHECK}
  2744.   INTERNET_AUTODIAL_FLAGS_MASK  = INTERNET_AUTODIAL_FORCE_ONLINE or
  2745.                                   INTERNET_AUTODIAL_FORCE_UNATTENDED or
  2746.                                   INTERNET_AUTODIAL_FAILIFSECURITYCHECK;
  2747.   {$EXTERNALSYM INTERNET_AUTODIAL_FLAGS_MASK}
  2748.  
  2749. function InternetAutodialHangup(dwReserved: DWORD): BOOL; stdcall;
  2750.   {$EXTERNALSYM InternetAutodialHangup}
  2751.  
  2752. function InternetGetConnectedState(lpdwFlags: LPDWORD;
  2753.   dwReserved: DWORD): BOOL; stdcall;
  2754.   {$EXTERNALSYM InternetGetConnectedState}
  2755.  
  2756. { Flags for InternetGetConnectedState }
  2757. const
  2758.   INTERNET_CONNECTION_MODEM           = 1;
  2759.   {$EXTERNALSYM INTERNET_CONNECTION_MODEM}
  2760.   INTERNET_CONNECTION_LAN             = 2;
  2761.   {$EXTERNALSYM INTERNET_CONNECTION_LAN}
  2762.   INTERNET_CONNECTION_PROXY           = 4;
  2763.   {$EXTERNALSYM INTERNET_CONNECTION_PROXY}
  2764.   INTERNET_CONNECTION_MODEM_BUSY      = 8;
  2765.   {$EXTERNALSYM INTERNET_CONNECTION_MODEM_BUSY}
  2766.  
  2767. { Custom dial handler functions }
  2768.  
  2769. { Custom dial handler prototype }
  2770. type
  2771.   PFN_DIAL_HANDLER = function(A:HWND; B:LPCSTR; C:DWORD; D:LPDWORD): DWORD; stdcall;
  2772.   {$EXTERNALSYM PFN_DIAL_HANDLER}
  2773.  
  2774. { Flags for custom dial handler }
  2775. const
  2776.   INTERNET_CUSTOMDIAL_CONNECT         = 0;
  2777.   {$EXTERNALSYM INTERNET_CUSTOMDIAL_CONNECT}
  2778.   INTERNET_CUSTOMDIAL_UNATTENDED      = 1;
  2779.   {$EXTERNALSYM INTERNET_CUSTOMDIAL_UNATTENDED}
  2780.   INTERNET_CUSTOMDIAL_DISCONNECT      = 2;
  2781.   {$EXTERNALSYM INTERNET_CUSTOMDIAL_DISCONNECT}
  2782.   INTERNET_CUSTOMDIAL_SHOWOFFLINE     = 4;
  2783.   {$EXTERNALSYM INTERNET_CUSTOMDIAL_SHOWOFFLINE}
  2784.  
  2785. { Custom dial handler supported functionality flags }
  2786.   INTERNET_CUSTOMDIAL_SAFE_FOR_UNATTENDED = 1;
  2787.   {$EXTERNALSYM INTERNET_CUSTOMDIAL_SAFE_FOR_UNATTENDED}
  2788.   INTERNET_CUSTOMDIAL_WILL_SUPPLY_STATE   = 2;
  2789.   {$EXTERNALSYM INTERNET_CUSTOMDIAL_WILL_SUPPLY_STATE}
  2790.   INTERNET_CUSTOMDIAL_CAN_HANGUP          = 4;
  2791.   {$EXTERNALSYM INTERNET_CUSTOMDIAL_CAN_HANGUP}
  2792.  
  2793. function InternetSetDialState(lpszConnectoid: LPCTSTR; dwState: DWORD;
  2794.   dwReserved: DWORD): BOOL; stdcall;
  2795.   {$EXTERNALSYM InternetSetDialState}
  2796.  
  2797. implementation
  2798.  
  2799. const
  2800.   winetdll = 'wininet.dll';
  2801.  
  2802. function CommitUrlCacheEntryA;          external winetdll name 'CommitUrlCacheEntryA';
  2803. function CommitUrlCacheEntryW;          external winetdll name 'CommitUrlCacheEntryW';
  2804. function CommitUrlCacheEntry;          external winetdll name 'CommitUrlCacheEntryA';
  2805. function CreateUrlCacheEntryA;          external winetdll name 'CreateUrlCacheEntryA';
  2806. function CreateUrlCacheEntryW;          external winetdll name 'CreateUrlCacheEntryW';
  2807. function CreateUrlCacheEntry;          external winetdll name 'CreateUrlCacheEntryA';
  2808. function DeleteUrlCacheEntry;             external winetdll name 'DeleteUrlCacheEntry';
  2809. function FindCloseUrlCache;               external winetdll name 'FindCloseUrlCache';
  2810. function FindFirstUrlCacheEntryA;       external winetdll name 'FindFirstUrlCacheEntryA';
  2811. function FindFirstUrlCacheEntryW;       external winetdll name 'FindFirstUrlCacheEntryW';
  2812. function FindFirstUrlCacheEntry;       external winetdll name 'FindFirstUrlCacheEntryA';
  2813. function FindNextUrlCacheEntryA;        external winetdll name 'FindNextUrlCacheEntryA';
  2814. function FindNextUrlCacheEntryW;        external winetdll name 'FindNextUrlCacheEntryW';
  2815. function FindNextUrlCacheEntry;        external winetdll name 'FindNextUrlCacheEntryA';
  2816. function FtpCommandA;                   external winetdll name 'FtpCommandA';
  2817. function FtpCommandW;                   external winetdll name 'FtpCommandW';
  2818. function FtpCommand;                   external winetdll name 'FtpCommandA';
  2819. function FtpCreateDirectoryA;           external winetdll name 'FtpCreateDirectoryA';
  2820. function FtpCreateDirectoryW;           external winetdll name 'FtpCreateDirectoryW';
  2821. function FtpCreateDirectory;           external winetdll name 'FtpCreateDirectoryA';
  2822. function FtpDeleteFileA;                external winetdll name 'FtpDeleteFileA';
  2823. function FtpDeleteFileW;                external winetdll name 'FtpDeleteFileW';
  2824. function FtpDeleteFile;                external winetdll name 'FtpDeleteFileA';
  2825. function FtpFindFirstFileA;             external winetdll name 'FtpFindFirstFileA';
  2826. function FtpFindFirstFileW;             external winetdll name 'FtpFindFirstFileW';
  2827. function FtpFindFirstFile;             external winetdll name 'FtpFindFirstFileA';
  2828. function FtpGetCurrentDirectoryA;       external winetdll name 'FtpGetCurrentDirectoryA';
  2829. function FtpGetCurrentDirectoryW;       external winetdll name 'FtpGetCurrentDirectoryW';
  2830. function FtpGetCurrentDirectory;       external winetdll name 'FtpGetCurrentDirectoryA';
  2831. function FtpGetFileA;                   external winetdll name 'FtpGetFileA';
  2832. function FtpGetFileW;                   external winetdll name 'FtpGetFileW';
  2833. function FtpGetFile;                   external winetdll name 'FtpGetFileA';
  2834. function FtpOpenFileA;                  external winetdll name 'FtpOpenFileA';
  2835. function FtpOpenFileW;                  external winetdll name 'FtpOpenFileW';
  2836. function FtpOpenFile;                  external winetdll name 'FtpOpenFileA';
  2837. function FtpPutFileA;                   external winetdll name 'FtpPutFileA';
  2838. function FtpPutFileW;                   external winetdll name 'FtpPutFileW';
  2839. function FtpPutFile;                   external winetdll name 'FtpPutFileA';
  2840. function FtpRemoveDirectoryA;           external winetdll name 'FtpRemoveDirectoryA';
  2841. function FtpRemoveDirectoryW;           external winetdll name 'FtpRemoveDirectoryW';
  2842. function FtpRemoveDirectory;           external winetdll name 'FtpRemoveDirectoryA';
  2843. function FtpRenameFileA;                external winetdll name 'FtpRenameFileA';
  2844. function FtpRenameFileW;                external winetdll name 'FtpRenameFileW';
  2845. function FtpRenameFile;                external winetdll name 'FtpRenameFileA';
  2846. function FtpSetCurrentDirectoryA;       external winetdll name 'FtpSetCurrentDirectoryA';
  2847. function FtpSetCurrentDirectoryW;       external winetdll name 'FtpSetCurrentDirectoryW';
  2848. function FtpSetCurrentDirectory;       external winetdll name 'FtpSetCurrentDirectoryA';
  2849. function GetUrlCacheEntryInfoA;         external winetdll name 'GetUrlCacheEntryInfoA';
  2850. function GetUrlCacheEntryInfoW;         external winetdll name 'GetUrlCacheEntryInfoW';
  2851. function GetUrlCacheEntryInfo;         external winetdll name 'GetUrlCacheEntryInfoA';
  2852. function GopherCreateLocatorA;          external winetdll name 'GopherCreateLocatorA';
  2853. function GopherCreateLocatorW;          external winetdll name 'GopherCreateLocatorW';
  2854. function GopherCreateLocator;          external winetdll name 'GopherCreateLocatorA';
  2855. function GopherFindFirstFileA;          external winetdll name 'GopherFindFirstFileA';
  2856. function GopherFindFirstFileW;          external winetdll name 'GopherFindFirstFileW';
  2857. function GopherFindFirstFile;          external winetdll name 'GopherFindFirstFileA';
  2858. function GopherGetAttributeA;           external winetdll name 'GopherGetAttributeA';
  2859. function GopherGetAttributeW;           external winetdll name 'GopherGetAttributeW';
  2860. function GopherGetAttribute;           external winetdll name 'GopherGetAttributeA';
  2861. function GopherGetLocatorTypeA;         external winetdll name 'GopherGetLocatorTypeA';
  2862. function GopherGetLocatorTypeW;         external winetdll name 'GopherGetLocatorTypeW';
  2863. function GopherGetLocatorType;         external winetdll name 'GopherGetLocatorTypeA';
  2864. function GopherOpenFileA;               external winetdll name 'GopherOpenFileA';
  2865. function GopherOpenFileW;               external winetdll name 'GopherOpenFileW';
  2866. function GopherOpenFile;               external winetdll name 'GopherOpenFileA';
  2867. function HttpAddRequestHeadersA;        external winetdll name 'HttpAddRequestHeadersA';
  2868. function HttpAddRequestHeadersW;        external winetdll name 'HttpAddRequestHeadersW';
  2869. function HttpAddRequestHeaders;        external winetdll name 'HttpAddRequestHeadersA';
  2870. function HttpOpenRequestA;              external winetdll name 'HttpOpenRequestA';
  2871. function HttpOpenRequestW;              external winetdll name 'HttpOpenRequestW';
  2872. function HttpOpenRequest;              external winetdll name 'HttpOpenRequestA';
  2873. function HttpQueryInfoA;                external winetdll name 'HttpQueryInfoA';
  2874. function HttpQueryInfoW;                external winetdll name 'HttpQueryInfoW';
  2875. function HttpQueryInfo;                external winetdll name 'HttpQueryInfoA';
  2876. function HttpSendRequestA;              external winetdll name 'HttpSendRequestA';
  2877. function HttpSendRequestW;              external winetdll name 'HttpSendRequestW';
  2878. function HttpSendRequest;              external winetdll name 'HttpSendRequestA';
  2879. function InternetCanonicalizeUrlA;      external winetdll name 'InternetCanonicalizeUrlA';
  2880. function InternetCanonicalizeUrlW;      external winetdll name 'InternetCanonicalizeUrlW';
  2881. function InternetCanonicalizeUrl;      external winetdll name 'InternetCanonicalizeUrlA';
  2882. function InternetCloseHandle;             external winetdll name 'InternetCloseHandle';
  2883. function InternetCombineUrlA;           external winetdll name 'InternetCombineUrlA';
  2884. function InternetCombineUrlW;           external winetdll name 'InternetCombineUrlW';
  2885. function InternetCombineUrl;           external winetdll name 'InternetCombineUrlA';
  2886. function InternetConfirmZoneCrossing;     external winetdll name 'InternetConfirmZoneCrossing';
  2887. function InternetConnectA;              external winetdll name 'InternetConnectA';
  2888. function InternetConnectW;              external winetdll name 'InternetConnectW';
  2889. function InternetConnect;              external winetdll name 'InternetConnectA';
  2890. function InternetCrackUrlA;             external winetdll name 'InternetCrackUrlA';
  2891. function InternetCrackUrlW;             external winetdll name 'InternetCrackUrlW';
  2892. function InternetCrackUrl;             external winetdll name 'InternetCrackUrlA';
  2893. function InternetCreateUrlA;            external winetdll name 'InternetCreateUrlA';
  2894. function InternetCreateUrlW;            external winetdll name 'InternetCreateUrlW';
  2895. function InternetCreateUrl;            external winetdll name 'InternetCreateUrlA';
  2896. function InternetErrorDlg;                external winetdll name 'InternetErrorDlg';
  2897. function InternetFindNextFileA;         external winetdll name 'InternetFindNextFileA';
  2898. function InternetFindNextFileW;         external winetdll name 'InternetFindNextFileW';
  2899. function InternetFindNextFile;         external winetdll name 'InternetFindNextFileA';
  2900. function InternetGetCookieA;            external winetdll name 'InternetGetCookieA';
  2901. function InternetGetCookieW;            external winetdll name 'InternetGetCookieW';
  2902. function InternetGetCookie;            external winetdll name 'InternetGetCookieA';
  2903. function InternetGetLastResponseInfoA;  external winetdll name 'InternetGetLastResponseInfoA';
  2904. function InternetGetLastResponseInfoW;  external winetdll name 'InternetGetLastResponseInfoW';
  2905. function InternetGetLastResponseInfo;  external winetdll name 'InternetGetLastResponseInfoA';
  2906. function InternetOpenA;                 external winetdll name 'InternetOpenA';
  2907. function InternetOpenW;                 external winetdll name 'InternetOpenW';
  2908. function InternetOpen;                 external winetdll name 'InternetOpenA';
  2909. function InternetOpenUrlA;              external winetdll name 'InternetOpenUrlA';
  2910. function InternetOpenUrlW;              external winetdll name 'InternetOpenUrlW';
  2911. function InternetOpenUrl;              external winetdll name 'InternetOpenUrlA';
  2912. function InternetQueryDataAvailable;      external winetdll name 'InternetQueryDataAvailable';
  2913. function InternetQueryOptionA;          external winetdll name 'InternetQueryOptionA';
  2914. function InternetQueryOptionW;          external winetdll name 'InternetQueryOptionW';
  2915. function InternetQueryOption;          external winetdll name 'InternetQueryOptionA';
  2916. function InternetReadFile;                external winetdll name 'InternetReadFile';
  2917. function InternetSetCookieA;            external winetdll name 'InternetSetCookieA';
  2918. function InternetSetCookieW;            external winetdll name 'InternetSetCookieW';
  2919. function InternetSetCookie;            external winetdll name 'InternetSetCookieA';
  2920. function InternetSetFilePointer;          external winetdll name 'InternetSetFilePointer';
  2921. function InternetSetOptionA;            external winetdll name 'InternetSetOptionA';
  2922. function InternetSetOptionW;            external winetdll name 'InternetSetOptionW';
  2923. function InternetSetOption;            external winetdll name 'InternetSetOptionA';
  2924. function InternetSetOptionExA;          external winetdll name 'InternetSetOptionExA';
  2925. function InternetSetOptionExW;          external winetdll name 'InternetSetOptionExW';
  2926. function InternetSetOptionEx;          external winetdll name 'InternetSetOptionExA';
  2927. function InternetSetStatusCallback;       external winetdll name 'InternetSetStatusCallback';
  2928. function InternetTimeFromSystemTime;      external winetdll name 'InternetTimeFromSystemTime';
  2929. function InternetWriteFile;               external winetdll name 'InternetWriteFile';
  2930. function ReadUrlCacheEntryStream;         external winetdll name 'ReadUrlCacheEntryStream';
  2931. function RetrieveUrlCacheEntryFileA;    external winetdll name 'RetrieveUrlCacheEntryFileA';
  2932. function RetrieveUrlCacheEntryFileW;    external winetdll name 'RetrieveUrlCacheEntryFileW';
  2933. function RetrieveUrlCacheEntryFile;    external winetdll name 'RetrieveUrlCacheEntryFileA';
  2934. function RetrieveUrlCacheEntryStreamA;  external winetdll name 'RetrieveUrlCacheEntryStreamA';
  2935. function RetrieveUrlCacheEntryStreamW;  external winetdll name 'RetrieveUrlCacheEntryStreamW';
  2936. function RetrieveUrlCacheEntryStream;  external winetdll name 'RetrieveUrlCacheEntryStreamA';
  2937. function SetUrlCacheEntryInfoA;         external winetdll name 'SetUrlCacheEntryInfoA';
  2938. function SetUrlCacheEntryInfoW;         external winetdll name 'SetUrlCacheEntryInfoW';
  2939. function SetUrlCacheEntryInfo;         external winetdll name 'SetUrlCacheEntryInfoA';
  2940. function UnlockUrlCacheEntryFile;         external winetdll name 'UnlockUrlCacheEntryFile';
  2941. function UnlockUrlCacheEntryStream;       external winetdll name 'UnlockUrlCacheEntryStream';
  2942.  
  2943. function CreateUrlCacheGroup;             external winetdll name 'CreateUrlCacheGroup';
  2944. function DeleteUrlCacheGroup;             external winetdll name 'DeleteUrlCacheGroup';
  2945. function FindFirstUrlCacheEntryExA;     external winetdll name 'FindFirstUrlCacheEntryExA';
  2946. function FindFirstUrlCacheEntryExW;     external winetdll name 'FindFirstUrlCacheEntryExW';
  2947. function FindFirstUrlCacheEntryEx;     external winetdll name 'FindFirstUrlCacheEntryExA';
  2948. function FindNextUrlCacheEntryExA;      external winetdll name 'FindNextUrlCacheEntryExA';
  2949. function FindNextUrlCacheEntryExW;      external winetdll name 'FindNextUrlCacheEntryExW';
  2950. function FindNextUrlCacheEntryEx;      external winetdll name 'FindNextUrlCacheEntryExA';
  2951. function GetUrlCacheEntryInfoExA;       external winetdll name 'GetUrlCacheEntryInfoExA';
  2952. function GetUrlCacheEntryInfoExW;       external winetdll name 'GetUrlCacheEntryInfoExW';
  2953. function GetUrlCacheEntryInfoEx;       external winetdll name 'GetUrlCacheEntryInfoExA';
  2954. function HttpEndRequestA;               external winetdll name 'HttpEndRequestA';
  2955. function HttpEndRequestW;               external winetdll name 'HttpEndRequestW';
  2956. function HttpEndRequest;               external winetdll name 'HttpEndRequestA';
  2957. function InternetAttemptConnect;          external winetdll name 'InternetAttemptConnect';
  2958. function InternetAuthNotifyCallback;      external winetdll name 'InternetAuthNotifyCallback';
  2959. function InternetAutodial;                external winetdll name 'InternetAutodial';
  2960. function InternetAutodialHangup;          external winetdll name 'InternetAutodialHangup';
  2961. function InternetCheckConnectionA;      external winetdll name 'InternetCheckConnectionA';
  2962. function InternetCheckConnectionW;      external winetdll name 'InternetCheckConnectionW';
  2963. function InternetCheckConnection;      external winetdll name 'InternetCheckConnectionA';
  2964. function InternetDial;                    external winetdll name 'InternetDial';
  2965. function InternetGetConnectedState;       external winetdll name 'InternetGetConnectedState';
  2966. function InternetGoOnline;                external winetdll name 'InternetGoOnline';
  2967. function InternetHangUp;                  external winetdll name 'InternetHangUp';
  2968. function InternetLockRequestFile;         external winetdll name 'InternetLockRequestFile';
  2969. function InternetReadFileExA;           external winetdll name 'InternetReadFileExA';
  2970. function InternetReadFileExW;           external winetdll name 'InternetReadFileExW';
  2971. function InternetReadFileEx;           external winetdll name 'InternetReadFileExA';
  2972. function InternetSetDialState;            external winetdll name 'InternetSetDialState';
  2973. function InternetUnlockRequestFile;       external winetdll name 'InternetUnlockRequestFile';
  2974. function SetUrlCacheEntryGroup;           external winetdll name 'SetUrlCacheEntryGroup';
  2975. function HttpSendRequestExA;            external winetdll name 'HttpSendRequestExA';
  2976. function HttpSendRequestExW;            external winetdll name 'HttpSendRequestExW';
  2977. function HttpSendRequestEx;            external winetdll name 'HttpSendRequestExA';
  2978.  
  2979.  
  2980.  
  2981. function IS_GOPHER_FILE(GopherType: DWORD): BOOL;
  2982. begin
  2983.   Result := GopherType and GOPHER_TYPE_FILE_MASK = 0;
  2984. end;
  2985.  
  2986. function IS_GOPHER_DIRECTORY(GopherType: DWORD): BOOL;
  2987. begin
  2988.   Result := GopherType and GOPHER_TYPE_DIRECTORY = 0;
  2989. end;
  2990.  
  2991. function IS_GOPHER_PHONE_SERVER(GopherType: DWORD): BOOL;
  2992. begin
  2993.   Result := GopherType and GOPHER_TYPE_CSO = 0;
  2994. end;
  2995.  
  2996. function IS_GOPHER_ERROR(GopherType: DWORD): BOOL;
  2997. begin
  2998.   Result := GopherType and GOPHER_TYPE_ERROR = 0;
  2999. end;
  3000.  
  3001. function IS_GOPHER_INDEX_SERVER(GopherType: DWORD): BOOL;
  3002. begin
  3003.   Result := GopherType and GOPHER_TYPE_INDEX_SERVER = 0;
  3004. end;
  3005.  
  3006. function IS_GOPHER_TELNET_SESSION(GopherType: DWORD): BOOL;
  3007. begin
  3008.   Result := GopherType and GOPHER_TYPE_TELNET = 0;
  3009. end;
  3010.  
  3011. function IS_GOPHER_BACKUP_SERVER(GopherType: DWORD): BOOL;
  3012. begin
  3013.   Result := GopherType and GOPHER_TYPE_REDUNDANT = 0;
  3014. end;
  3015.  
  3016. function IS_GOPHER_TN3270_SESSION(GopherType: DWORD): BOOL;
  3017. begin
  3018.   Result := GopherType and GOPHER_TYPE_TN3270 = 0;
  3019. end;
  3020.  
  3021. function IS_GOPHER_ASK(GopherType: DWORD): BOOL;
  3022. begin
  3023.   Result := GopherType and GOPHER_TYPE_ASK = 0;
  3024. end;
  3025.  
  3026. function IS_GOPHER_PLUS(GopherType: DWORD): BOOL;
  3027. begin
  3028.   Result := GopherType and GOPHER_TYPE_GOPHER_PLUS = 0;
  3029. end;
  3030.  
  3031. function IS_GOPHER_TYPE_KNOWN(GopherType: DWORD): BOOL;
  3032. begin
  3033.   Result := GopherType and GOPHER_TYPE_UNKNOWN = 0;
  3034. end;
  3035.  
  3036. end.
  3037.