Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _WININET_
      7 #define _WININET_
      8 
      9 #include <_mingw_unicode.h>
     10 #include <specstrings.h>
     11 
     12 #ifdef _WIN64
     13 #include <pshpack8.h>
     14 #else
     15 #include <pshpack4.h>
     16 #endif
     17 
     18 #if defined(__cplusplus)
     19 extern "C" {
     20 #endif
     21 
     22 #define INTERNETAPI EXTERN_C DECLSPEC_IMPORT HRESULT WINAPI
     23 #define INTERNETAPI_(type) EXTERN_C DECLSPEC_IMPORT type WINAPI
     24 #define URLCACHEAPI EXTERN_C DECLSPEC_IMPORT HRESULT WINAPI
     25 #define URLCACHEAPI_(type) EXTERN_C DECLSPEC_IMPORT type WINAPI
     26 
     27 #define BOOLAPI INTERNETAPI_(WINBOOL)
     28 
     29   typedef LPVOID HINTERNET;
     30   typedef HINTERNET *LPHINTERNET;
     31 
     32   typedef WORD INTERNET_PORT;
     33   typedef INTERNET_PORT *LPINTERNET_PORT;
     34 
     35 #define INTERNET_INVALID_PORT_NUMBER 0
     36 
     37 #define INTERNET_DEFAULT_FTP_PORT 21
     38 #define INTERNET_DEFAULT_GOPHER_PORT 70
     39 #define INTERNET_DEFAULT_HTTP_PORT 80
     40 #define INTERNET_DEFAULT_HTTPS_PORT 443
     41 #define INTERNET_DEFAULT_SOCKS_PORT 1080
     42 
     43 #define INTERNET_MAX_HOST_NAME_LENGTH 256
     44 #define INTERNET_MAX_USER_NAME_LENGTH 128
     45 #define INTERNET_MAX_PASSWORD_LENGTH 128
     46 #define INTERNET_MAX_PORT_NUMBER_LENGTH 5
     47 #define INTERNET_MAX_PORT_NUMBER_VALUE 65535
     48 #define INTERNET_MAX_PATH_LENGTH 2048
     49 #define INTERNET_MAX_SCHEME_LENGTH 32
     50 #define INTERNET_MAX_URL_LENGTH (INTERNET_MAX_SCHEME_LENGTH + sizeof("://") + INTERNET_MAX_PATH_LENGTH)
     51 
     52 #define INTERNET_KEEP_ALIVE_UNKNOWN ((DWORD)-1)
     53 #define INTERNET_KEEP_ALIVE_ENABLED 1
     54 #define INTERNET_KEEP_ALIVE_DISABLED 0
     55 
     56 #define INTERNET_REQFLAG_FROM_CACHE 0x00000001
     57 #define INTERNET_REQFLAG_ASYNC 0x00000002
     58 #define INTERNET_REQFLAG_VIA_PROXY 0x00000004
     59 #define INTERNET_REQFLAG_NO_HEADERS 0x00000008
     60 #define INTERNET_REQFLAG_PASSIVE 0x00000010
     61 #define INTERNET_REQFLAG_CACHE_WRITE_DISABLED 0x00000040
     62 #define INTERNET_REQFLAG_NET_TIMEOUT 0x00000080
     63 
     64 #define INTERNET_FLAG_RELOAD 0x80000000
     65 
     66 #define INTERNET_FLAG_RAW_DATA 0x40000000
     67 #define INTERNET_FLAG_EXISTING_CONNECT 0x20000000
     68 
     69 #define INTERNET_FLAG_ASYNC 0x10000000
     70 
     71 #define INTERNET_FLAG_PASSIVE 0x08000000
     72 
     73 #define INTERNET_FLAG_NO_CACHE_WRITE 0x04000000
     74 #define INTERNET_FLAG_DONT_CACHE INTERNET_FLAG_NO_CACHE_WRITE
     75 #define INTERNET_FLAG_MAKE_PERSISTENT 0x02000000
     76 #define INTERNET_FLAG_FROM_CACHE 0x01000000
     77 #define INTERNET_FLAG_OFFLINE INTERNET_FLAG_FROM_CACHE
     78 
     79 #define INTERNET_FLAG_SECURE 0x00800000
     80 #define INTERNET_FLAG_KEEP_CONNECTION 0x00400000
     81 #define INTERNET_FLAG_NO_AUTO_REDIRECT 0x00200000
     82 #define INTERNET_FLAG_READ_PREFETCH 0x00100000
     83 #define INTERNET_FLAG_NO_COOKIES 0x00080000
     84 #define INTERNET_FLAG_NO_AUTH 0x00040000
     85 #define INTERNET_FLAG_RESTRICTED_ZONE 0x00020000
     86 #define INTERNET_FLAG_CACHE_IF_NET_FAIL 0x00010000
     87 
     88 #define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP 0x00008000
     89 #define INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS 0x00004000
     90 #define INTERNET_FLAG_IGNORE_CERT_DATE_INVALID 0x00002000
     91 #define INTERNET_FLAG_IGNORE_CERT_CN_INVALID 0x00001000
     92 
     93 #define INTERNET_FLAG_RESYNCHRONIZE 0x00000800
     94 #define INTERNET_FLAG_HYPERLINK 0x00000400
     95 #define INTERNET_FLAG_NO_UI 0x00000200
     96 #define INTERNET_FLAG_PRAGMA_NOCACHE 0x00000100
     97 #define INTERNET_FLAG_CACHE_ASYNC 0x00000080
     98 #define INTERNET_FLAG_FORMS_SUBMIT 0x00000040
     99 #define INTERNET_FLAG_FWD_BACK 0x00000020
    100 #define INTERNET_FLAG_NEED_FILE 0x00000010
    101 #define INTERNET_FLAG_MUST_CACHE_REQUEST INTERNET_FLAG_NEED_FILE
    102 
    103 #define INTERNET_FLAG_TRANSFER_ASCII FTP_TRANSFER_TYPE_ASCII
    104 #define INTERNET_FLAG_TRANSFER_BINARY FTP_TRANSFER_TYPE_BINARY
    105 
    106 #define SECURITY_INTERNET_MASK (INTERNET_FLAG_IGNORE_CERT_CN_INVALID | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS | INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP)
    107 #define INTERNET_FLAGS_MASK (INTERNET_FLAG_RELOAD | INTERNET_FLAG_RAW_DATA | INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_ASYNC | INTERNET_FLAG_PASSIVE | INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_MAKE_PERSISTENT | INTERNET_FLAG_FROM_CACHE | INTERNET_FLAG_SECURE | INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_AUTO_REDIRECT | INTERNET_FLAG_READ_PREFETCH | INTERNET_FLAG_NO_COOKIES | INTERNET_FLAG_NO_AUTH | INTERNET_FLAG_CACHE_IF_NET_FAIL | SECURITY_INTERNET_MASK | INTERNET_FLAG_RESYNCHRONIZE | INTERNET_FLAG_HYPERLINK | INTERNET_FLAG_NO_UI | INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_CACHE_ASYNC | INTERNET_FLAG_FORMS_SUBMIT | INTERNET_FLAG_NEED_FILE | INTERNET_FLAG_RESTRICTED_ZONE | INTERNET_FLAG_TRANSFER_BINARY | INTERNET_FLAG_TRANSFER_ASCII | INTERNET_FLAG_FWD_BACK | INTERNET_FLAG_BGUPDATE)
    108 
    109 #define INTERNET_ERROR_MASK_INSERT_CDROM 0x1
    110 #define INTERNET_ERROR_MASK_COMBINED_SEC_CERT 0x2
    111 #define INTERNET_ERROR_MASK_NEED_MSN_SSPI_PKG 0X4
    112 #define INTERNET_ERROR_MASK_LOGIN_FAILURE_DISPLAY_ENTITY_BODY 0x8
    113 
    114 #define INTERNET_OPTIONS_MASK (~INTERNET_FLAGS_MASK)
    115 
    116 #define WININET_API_FLAG_ASYNC 0x00000001
    117 #define WININET_API_FLAG_SYNC 0x00000004
    118 #define WININET_API_FLAG_USE_CONTEXT 0x00000008
    119 
    120 #define INTERNET_NO_CALLBACK 0
    121 
    122   typedef enum {
    123     INTERNET_SCHEME_PARTIAL = -2,INTERNET_SCHEME_UNKNOWN = -1,INTERNET_SCHEME_DEFAULT = 0,INTERNET_SCHEME_FTP,INTERNET_SCHEME_GOPHER,
    124     INTERNET_SCHEME_HTTP,INTERNET_SCHEME_HTTPS,INTERNET_SCHEME_FILE,INTERNET_SCHEME_NEWS,INTERNET_SCHEME_MAILTO,INTERNET_SCHEME_SOCKS,
    125     INTERNET_SCHEME_JAVASCRIPT,INTERNET_SCHEME_VBSCRIPT,INTERNET_SCHEME_RES,INTERNET_SCHEME_FIRST = INTERNET_SCHEME_FTP,
    126     INTERNET_SCHEME_LAST = INTERNET_SCHEME_RES
    127   } INTERNET_SCHEME,*LPINTERNET_SCHEME;
    128 
    129   typedef struct {
    130     DWORD_PTR dwResult;
    131     DWORD dwError;
    132   } INTERNET_ASYNC_RESULT,*LPINTERNET_ASYNC_RESULT;
    133 
    134   typedef struct {
    135     DWORD_PTR Socket;
    136     DWORD SourcePort;
    137     DWORD DestPort;
    138     DWORD Flags;
    139   } INTERNET_DIAGNOSTIC_SOCKET_INFO,*LPINTERNET_DIAGNOSTIC_SOCKET_INFO;
    140 
    141 #define IDSI_FLAG_KEEP_ALIVE 0x00000001
    142 #define IDSI_FLAG_SECURE 0x00000002
    143 #define IDSI_FLAG_PROXY 0x00000004
    144 #define IDSI_FLAG_TUNNEL 0x00000008
    145 
    146   typedef struct {
    147     DWORD dwAccessType;
    148     LPCTSTR lpszProxy;
    149     LPCTSTR lpszProxyBypass;
    150   } INTERNET_PROXY_INFO,*LPINTERNET_PROXY_INFO;
    151 
    152   typedef struct {
    153     DWORD dwOption;
    154     union {
    155       DWORD dwValue;
    156       LPSTR pszValue;
    157       FILETIME ftValue;
    158     } Value;
    159   } INTERNET_PER_CONN_OPTIONA,*LPINTERNET_PER_CONN_OPTIONA;
    160 
    161   typedef struct {
    162     DWORD dwOption;
    163     union {
    164       DWORD dwValue;
    165       LPWSTR pszValue;
    166       FILETIME ftValue;
    167     } Value;
    168   } INTERNET_PER_CONN_OPTIONW,*LPINTERNET_PER_CONN_OPTIONW;
    169 
    170   __MINGW_TYPEDEF_AW(INTERNET_PER_CONN_OPTION)
    171   __MINGW_TYPEDEF_AW(LPINTERNET_PER_CONN_OPTION)
    172 
    173   typedef struct {
    174     DWORD dwSize;
    175     LPSTR pszConnection;
    176     DWORD dwOptionCount;
    177     DWORD dwOptionError;
    178     LPINTERNET_PER_CONN_OPTIONA pOptions;
    179   } INTERNET_PER_CONN_OPTION_LISTA,*LPINTERNET_PER_CONN_OPTION_LISTA;
    180 
    181   typedef struct {
    182     DWORD dwSize;
    183     LPWSTR pszConnection;
    184     DWORD dwOptionCount;
    185     DWORD dwOptionError;
    186     LPINTERNET_PER_CONN_OPTIONW pOptions;
    187   } INTERNET_PER_CONN_OPTION_LISTW,*LPINTERNET_PER_CONN_OPTION_LISTW;
    188 
    189   __MINGW_TYPEDEF_AW(INTERNET_PER_CONN_OPTION_LIST)
    190   __MINGW_TYPEDEF_AW(LPINTERNET_PER_CONN_OPTION_LIST)
    191 
    192 #define INTERNET_PER_CONN_FLAGS 1
    193 #define INTERNET_PER_CONN_PROXY_SERVER 2
    194 #define INTERNET_PER_CONN_PROXY_BYPASS 3
    195 #define INTERNET_PER_CONN_AUTOCONFIG_URL 4
    196 #define INTERNET_PER_CONN_AUTODISCOVERY_FLAGS 5
    197 #define INTERNET_PER_CONN_AUTOCONFIG_SECONDARY_URL 6
    198 #define INTERNET_PER_CONN_AUTOCONFIG_RELOAD_DELAY_MINS 7
    199 #define INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_TIME 8
    200 #define INTERNET_PER_CONN_AUTOCONFIG_LAST_DETECT_URL 9
    201 #define INTERNET_PER_CONN_FLAGS_UI 10
    202 
    203 #define PROXY_TYPE_DIRECT 0x00000001
    204 #define PROXY_TYPE_PROXY 0x00000002
    205 #define PROXY_TYPE_AUTO_PROXY_URL 0x00000004
    206 #define PROXY_TYPE_AUTO_DETECT 0x00000008
    207 
    208 #define AUTO_PROXY_FLAG_USER_SET 0x00000001
    209 #define AUTO_PROXY_FLAG_ALWAYS_DETECT 0x00000002
    210 #define AUTO_PROXY_FLAG_DETECTION_RUN 0x00000004
    211 #define AUTO_PROXY_FLAG_MIGRATED 0x00000008
    212 #define AUTO_PROXY_FLAG_DONT_CACHE_PROXY_RESULT 0x00000010
    213 #define AUTO_PROXY_FLAG_CACHE_INIT_RUN 0x00000020
    214 #define AUTO_PROXY_FLAG_DETECTION_SUSPECT 0x00000040
    215 
    216   typedef struct {
    217     DWORD dwMajorVersion;
    218     DWORD dwMinorVersion;
    219   } INTERNET_VERSION_INFO,*LPINTERNET_VERSION_INFO;
    220 
    221   typedef struct {
    222     DWORD dwMajorVersion;
    223     DWORD dwMinorVersion;
    224   } HTTP_VERSION_INFO,*LPHTTP_VERSION_INFO;
    225 
    226   typedef struct {
    227     DWORD dwConnectedState;
    228     DWORD dwFlags;
    229   } INTERNET_CONNECTED_INFO,*LPINTERNET_CONNECTED_INFO;
    230 
    231 #define ISO_FORCE_DISCONNECTED 0x00000001
    232 
    233   typedef struct {
    234     DWORD dwStructSize;
    235     LPSTR lpszScheme;
    236     DWORD dwSchemeLength;
    237     INTERNET_SCHEME nScheme;
    238     LPSTR lpszHostName;
    239     DWORD dwHostNameLength;
    240     INTERNET_PORT nPort;
    241     LPSTR lpszUserName;
    242     DWORD dwUserNameLength;
    243     LPSTR lpszPassword;
    244     DWORD dwPasswordLength;
    245     LPSTR lpszUrlPath;
    246     DWORD dwUrlPathLength;
    247     LPSTR lpszExtraInfo;
    248     DWORD dwExtraInfoLength;
    249   } URL_COMPONENTSA,*LPURL_COMPONENTSA;
    250 
    251   typedef struct {
    252     DWORD dwStructSize;
    253     LPWSTR lpszScheme;
    254     DWORD dwSchemeLength;
    255     INTERNET_SCHEME nScheme;
    256     LPWSTR lpszHostName;
    257     DWORD dwHostNameLength;
    258     INTERNET_PORT nPort;
    259     LPWSTR lpszUserName;
    260     DWORD dwUserNameLength;
    261     LPWSTR lpszPassword;
    262     DWORD dwPasswordLength;
    263     LPWSTR lpszUrlPath;
    264     DWORD dwUrlPathLength;
    265     LPWSTR lpszExtraInfo;
    266     DWORD dwExtraInfoLength;
    267   } URL_COMPONENTSW,*LPURL_COMPONENTSW;
    268 
    269   __MINGW_TYPEDEF_AW(URL_COMPONENTS)
    270   __MINGW_TYPEDEF_AW(LPURL_COMPONENTS)
    271 
    272   typedef struct {
    273     FILETIME ftExpiry;
    274     FILETIME ftStart;
    275     LPTSTR lpszSubjectInfo;
    276     LPTSTR lpszIssuerInfo;
    277     LPTSTR lpszProtocolName;
    278     LPTSTR lpszSignatureAlgName;
    279     LPTSTR lpszEncryptionAlgName;
    280     DWORD dwKeySize;
    281   } INTERNET_CERTIFICATE_INFO,*LPINTERNET_CERTIFICATE_INFO;
    282 
    283   typedef struct _INTERNET_BUFFERSA {
    284     DWORD dwStructSize;
    285     struct _INTERNET_BUFFERSA *Next;
    286     LPCSTR lpcszHeader;
    287     DWORD dwHeadersLength;
    288     DWORD dwHeadersTotal;
    289     LPVOID lpvBuffer;
    290     DWORD dwBufferLength;
    291     DWORD dwBufferTotal;
    292     DWORD dwOffsetLow;
    293     DWORD dwOffsetHigh;
    294   } INTERNET_BUFFERSA,*LPINTERNET_BUFFERSA;
    295 
    296   typedef struct _INTERNET_BUFFERSW {
    297     DWORD dwStructSize;
    298     struct _INTERNET_BUFFERSW *Next;
    299     LPCWSTR lpcszHeader;
    300     DWORD dwHeadersLength;
    301     DWORD dwHeadersTotal;
    302     LPVOID lpvBuffer;
    303     DWORD dwBufferLength;
    304     DWORD dwBufferTotal;
    305     DWORD dwOffsetLow;
    306     DWORD dwOffsetHigh;
    307   } INTERNET_BUFFERSW,*LPINTERNET_BUFFERSW;
    308 
    309   __MINGW_TYPEDEF_AW(INTERNET_BUFFERS)
    310   __MINGW_TYPEDEF_AW(LPINTERNET_BUFFERS)
    311 
    312 #if defined(UNICODE)
    313 #define InternetTimeFromSystemTime InternetTimeFromSystemTimeW
    314 #else
    315   BOOLAPI InternetTimeFromSystemTime(CONST SYSTEMTIME *pst,DWORD dwRFC,LPSTR lpszTime,DWORD cbTime);
    316 #endif
    317 
    318   BOOLAPI InternetTimeFromSystemTimeA(CONST SYSTEMTIME *pst,DWORD dwRFC,LPSTR lpszTime,DWORD cbTime);
    319   BOOLAPI InternetTimeFromSystemTimeW(CONST SYSTEMTIME *pst,DWORD dwRFC,LPWSTR lpszTime,DWORD cbTime);
    320 
    321 #define INTERNET_RFC1123_FORMAT 0
    322 #define INTERNET_RFC1123_BUFSIZE 30
    323 
    324 #define InternetCrackUrl __MINGW_NAME_AW(InternetCrackUrl)
    325 #define InternetCreateUrl __MINGW_NAME_AW(InternetCreateUrl)
    326 #define InternetCanonicalizeUrl __MINGW_NAME_AW(InternetCanonicalizeUrl)
    327 #define InternetCombineUrl __MINGW_NAME_AW(InternetCombineUrl)
    328 
    329 #if defined(UNICODE)
    330 #define InternetTimeToSystemTime InternetTimeToSystemTimeW
    331 #else
    332   BOOLAPI InternetTimeToSystemTime(LPCSTR lpszTime,SYSTEMTIME *pst,DWORD dwReserved);
    333 #endif
    334 
    335   BOOLAPI InternetTimeToSystemTimeA(LPCSTR lpszTime,SYSTEMTIME *pst,DWORD dwReserved);
    336   BOOLAPI InternetTimeToSystemTimeW(LPCWSTR lpszTime,SYSTEMTIME *pst,DWORD dwReserved);
    337   BOOLAPI InternetCrackUrlA(LPCSTR lpszUrl,DWORD dwUrlLength,DWORD dwFlags,LPURL_COMPONENTSA lpUrlComponents);
    338   BOOLAPI InternetCrackUrlW(LPCWSTR lpszUrl,DWORD dwUrlLength,DWORD dwFlags,LPURL_COMPONENTSW lpUrlComponents);
    339   BOOLAPI InternetCreateUrlA(LPURL_COMPONENTSA lpUrlComponents,DWORD dwFlags,LPSTR lpszUrl,LPDWORD lpdwUrlLength);
    340   BOOLAPI InternetCreateUrlW(LPURL_COMPONENTSW lpUrlComponents,DWORD dwFlags,LPWSTR lpszUrl,LPDWORD lpdwUrlLength);
    341   BOOLAPI InternetCanonicalizeUrlA(LPCSTR lpszUrl,LPSTR lpszBuffer,LPDWORD lpdwBufferLength,DWORD dwFlags);
    342   BOOLAPI InternetCanonicalizeUrlW(LPCWSTR lpszUrl,LPWSTR lpszBuffer,LPDWORD lpdwBufferLength,DWORD dwFlags);
    343   BOOLAPI InternetCombineUrlA(LPCSTR lpszBaseUrl,LPCSTR lpszRelativeUrl,LPSTR lpszBuffer,LPDWORD lpdwBufferLength,DWORD dwFlags);
    344   BOOLAPI InternetCombineUrlW(LPCWSTR lpszBaseUrl,LPCWSTR lpszRelativeUrl,LPWSTR lpszBuffer,LPDWORD lpdwBufferLength,DWORD dwFlags);
    345 
    346 #define ICU_ESCAPE 0x80000000
    347 #define ICU_USERNAME 0x40000000
    348 
    349 #define ICU_NO_ENCODE 0x20000000
    350 #define ICU_DECODE 0x10000000
    351 #define ICU_NO_META 0x08000000
    352 #define ICU_ENCODE_SPACES_ONLY 0x04000000
    353 #define ICU_BROWSER_MODE 0x02000000
    354 #define ICU_ENCODE_PERCENT 0x00001000
    355 
    356 #define InternetOpen __MINGW_NAME_AW(InternetOpen)
    357 
    358   INTERNETAPI_(HINTERNET) InternetOpenA(LPCSTR lpszAgent,DWORD dwAccessType,LPCSTR lpszProxy,LPCSTR lpszProxyBypass,DWORD dwFlags);
    359   INTERNETAPI_(HINTERNET) InternetOpenW(LPCWSTR lpszAgent,DWORD dwAccessType,LPCWSTR lpszProxy,LPCWSTR lpszProxyBypass,DWORD dwFlags);
    360 
    361 #define INTERNET_OPEN_TYPE_PRECONFIG 0
    362 #define INTERNET_OPEN_TYPE_DIRECT 1
    363 #define INTERNET_OPEN_TYPE_PROXY 3
    364 #define INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY 4
    365 
    366 #define PRE_CONFIG_INTERNET_ACCESS INTERNET_OPEN_TYPE_PRECONFIG
    367 #define LOCAL_INTERNET_ACCESS INTERNET_OPEN_TYPE_DIRECT
    368 #define CERN_PROXY_INTERNET_ACCESS INTERNET_OPEN_TYPE_PROXY
    369 
    370 #define InternetConnect __MINGW_NAME_AW(InternetConnect)
    371 
    372   BOOLAPI InternetCloseHandle(HINTERNET hInternet);
    373   INTERNETAPI_(HINTERNET) InternetConnectA(HINTERNET hInternet,LPCSTR lpszServerName,INTERNET_PORT nServerPort,LPCSTR lpszUserName,LPCSTR lpszPassword,DWORD dwService,DWORD dwFlags,DWORD_PTR dwContext);
    374   INTERNETAPI_(HINTERNET) InternetConnectW(HINTERNET hInternet,LPCWSTR lpszServerName,INTERNET_PORT nServerPort,LPCWSTR lpszUserName,LPCWSTR lpszPassword,DWORD dwService,DWORD dwFlags,DWORD_PTR dwContext);
    375 
    376 #define INTERNET_SERVICE_FTP 1
    377 #define INTERNET_SERVICE_GOPHER 2
    378 #define INTERNET_SERVICE_HTTP 3
    379 
    380 #define InternetOpenUrl __MINGW_NAME_AW(InternetOpenUrl)
    381 #define InternetReadFileEx __MINGW_NAME_AW(InternetReadFileEx)
    382 
    383   INTERNETAPI_(HINTERNET) InternetOpenUrlA(HINTERNET hInternet,LPCSTR lpszUrl,LPCSTR lpszHeaders,DWORD dwHeadersLength,DWORD dwFlags,DWORD_PTR dwContext);
    384   INTERNETAPI_(HINTERNET) InternetOpenUrlW(HINTERNET hInternet,LPCWSTR lpszUrl,LPCWSTR lpszHeaders,DWORD dwHeadersLength,DWORD dwFlags,DWORD_PTR dwContext);
    385   BOOLAPI InternetReadFile(HINTERNET hFile,LPVOID lpBuffer,DWORD dwNumberOfBytesToRead,LPDWORD lpdwNumberOfBytesRead);
    386   INTERNETAPI_(WINBOOL) InternetReadFileExA(HINTERNET hFile,LPINTERNET_BUFFERSA lpBuffersOut,DWORD dwFlags,DWORD_PTR dwContext);
    387   INTERNETAPI_(WINBOOL) InternetReadFileExW(HINTERNET hFile,LPINTERNET_BUFFERSW lpBuffersOut,DWORD dwFlags,DWORD_PTR dwContext);
    388 
    389 #define IRF_ASYNC WININET_API_FLAG_ASYNC
    390 #define IRF_SYNC WININET_API_FLAG_SYNC
    391 #define IRF_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT
    392 #define IRF_NO_WAIT 0x00000008
    393 
    394 #define InternetFindNextFile __MINGW_NAME_AW(InternetFindNextFile)
    395 #define InternetQueryOption __MINGW_NAME_AW(InternetQueryOption)
    396 #define InternetSetOption __MINGW_NAME_AW(InternetSetOption)
    397 #define InternetSetOptionEx __MINGW_NAME_AW(InternetSetOptionEx)
    398 
    399   INTERNETAPI_(DWORD) InternetSetFilePointer(HINTERNET hFile,LONG lDistanceToMove,PVOID pReserved,DWORD dwMoveMethod,DWORD_PTR dwContext);
    400   BOOLAPI InternetWriteFile(HINTERNET hFile,LPCVOID lpBuffer,DWORD dwNumberOfBytesToWrite,LPDWORD lpdwNumberOfBytesWritten);
    401   BOOLAPI InternetQueryDataAvailable(HINTERNET hFile,LPDWORD lpdwNumberOfBytesAvailable,DWORD dwFlags,DWORD_PTR dwContext);
    402   BOOLAPI InternetFindNextFileA(HINTERNET hFind,LPVOID lpvFindData);
    403   BOOLAPI InternetFindNextFileW(HINTERNET hFind,LPVOID lpvFindData);
    404   BOOLAPI InternetQueryOptionA(HINTERNET hInternet,DWORD dwOption,LPVOID lpBuffer,LPDWORD lpdwBufferLength);
    405   BOOLAPI InternetQueryOptionW(HINTERNET hInternet,DWORD dwOption,LPVOID lpBuffer,LPDWORD lpdwBufferLength);
    406   BOOLAPI InternetSetOptionA(HINTERNET hInternet,DWORD dwOption,LPVOID lpBuffer,DWORD dwBufferLength);
    407   BOOLAPI InternetSetOptionW(HINTERNET hInternet,DWORD dwOption,LPVOID lpBuffer,DWORD dwBufferLength);
    408   BOOLAPI InternetSetOptionExA(HINTERNET hInternet,DWORD dwOption,LPVOID lpBuffer,DWORD dwBufferLength,DWORD dwFlags);
    409   BOOLAPI InternetSetOptionExW(HINTERNET hInternet,DWORD dwOption,LPVOID lpBuffer,DWORD dwBufferLength,DWORD dwFlags);
    410   BOOLAPI InternetLockRequestFile(HINTERNET hInternet,HANDLE *lphLockRequestInfo);
    411   BOOLAPI InternetUnlockRequestFile(HANDLE hLockRequestInfo);
    412 
    413 #define ISO_GLOBAL 0x00000001
    414 #define ISO_REGISTRY 0x00000002
    415 
    416 #define ISO_VALID_FLAGS (ISO_GLOBAL | ISO_REGISTRY)
    417 
    418 #define INTERNET_OPTION_CALLBACK 1
    419 #define INTERNET_OPTION_CONNECT_TIMEOUT 2
    420 #define INTERNET_OPTION_CONNECT_RETRIES 3
    421 #define INTERNET_OPTION_CONNECT_BACKOFF 4
    422 #define INTERNET_OPTION_SEND_TIMEOUT 5
    423 #define INTERNET_OPTION_CONTROL_SEND_TIMEOUT INTERNET_OPTION_SEND_TIMEOUT
    424 #define INTERNET_OPTION_RECEIVE_TIMEOUT 6
    425 #define INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT INTERNET_OPTION_RECEIVE_TIMEOUT
    426 #define INTERNET_OPTION_DATA_SEND_TIMEOUT 7
    427 #define INTERNET_OPTION_DATA_RECEIVE_TIMEOUT 8
    428 #define INTERNET_OPTION_HANDLE_TYPE 9
    429 #define INTERNET_OPTION_LISTEN_TIMEOUT 11
    430 #define INTERNET_OPTION_READ_BUFFER_SIZE 12
    431 #define INTERNET_OPTION_WRITE_BUFFER_SIZE 13
    432 
    433 #define INTERNET_OPTION_ASYNC_ID 15
    434 #define INTERNET_OPTION_ASYNC_PRIORITY 16
    435 
    436 #define INTERNET_OPTION_PARENT_HANDLE 21
    437 #define INTERNET_OPTION_KEEP_CONNECTION 22
    438 #define INTERNET_OPTION_REQUEST_FLAGS 23
    439 #define INTERNET_OPTION_EXTENDED_ERROR 24
    440 
    441 #define INTERNET_OPTION_OFFLINE_MODE 26
    442 #define INTERNET_OPTION_CACHE_STREAM_HANDLE 27
    443 #define INTERNET_OPTION_USERNAME 28
    444 #define INTERNET_OPTION_PASSWORD 29
    445 #define INTERNET_OPTION_ASYNC 30
    446 #define INTERNET_OPTION_SECURITY_FLAGS 31
    447 #define INTERNET_OPTION_SECURITY_CERTIFICATE_STRUCT 32
    448 #define INTERNET_OPTION_DATAFILE_NAME 33
    449 #define INTERNET_OPTION_URL 34
    450 #define INTERNET_OPTION_SECURITY_CERTIFICATE 35
    451 #define INTERNET_OPTION_SECURITY_KEY_BITNESS 36
    452 #define INTERNET_OPTION_REFRESH 37
    453 #define INTERNET_OPTION_PROXY 38
    454 #define INTERNET_OPTION_SETTINGS_CHANGED 39
    455 #define INTERNET_OPTION_VERSION 40
    456 #define INTERNET_OPTION_USER_AGENT 41
    457 #define INTERNET_OPTION_END_BROWSER_SESSION 42
    458 #define INTERNET_OPTION_PROXY_USERNAME 43
    459 #define INTERNET_OPTION_PROXY_PASSWORD 44
    460 #define INTERNET_OPTION_CONTEXT_VALUE 45
    461 #define INTERNET_OPTION_CONNECT_LIMIT 46
    462 #define INTERNET_OPTION_SECURITY_SELECT_CLIENT_CERT 47
    463 #define INTERNET_OPTION_POLICY 48
    464 #define INTERNET_OPTION_DISCONNECTED_TIMEOUT 49
    465 #define INTERNET_OPTION_CONNECTED_STATE 50
    466 #define INTERNET_OPTION_IDLE_STATE 51
    467 #define INTERNET_OPTION_OFFLINE_SEMANTICS 52
    468 #define INTERNET_OPTION_SECONDARY_CACHE_KEY 53
    469 #define INTERNET_OPTION_CALLBACK_FILTER 54
    470 #define INTERNET_OPTION_CONNECT_TIME 55
    471 #define INTERNET_OPTION_SEND_THROUGHPUT 56
    472 #define INTERNET_OPTION_RECEIVE_THROUGHPUT 57
    473 #define INTERNET_OPTION_REQUEST_PRIORITY 58
    474 #define INTERNET_OPTION_HTTP_VERSION 59
    475 #define INTERNET_OPTION_RESET_URLCACHE_SESSION 60
    476 #define INTERNET_OPTION_ERROR_MASK 62
    477 #define INTERNET_OPTION_FROM_CACHE_TIMEOUT 63
    478 #define INTERNET_OPTION_BYPASS_EDITED_ENTRY 64
    479 #define INTERNET_OPTION_DIAGNOSTIC_SOCKET_INFO 67
    480 #define INTERNET_OPTION_CODEPAGE 68
    481 #define INTERNET_OPTION_CACHE_TIMESTAMPS 69
    482 #define INTERNET_OPTION_DISABLE_AUTODIAL 70
    483 #define INTERNET_OPTION_MAX_CONNS_PER_SERVER 73
    484 #define INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER 74
    485 #define INTERNET_OPTION_PER_CONNECTION_OPTION 75
    486 #define INTERNET_OPTION_DIGEST_AUTH_UNLOAD 76
    487 #define INTERNET_OPTION_IGNORE_OFFLINE 77
    488 #define INTERNET_OPTION_IDENTITY 78
    489 #define INTERNET_OPTION_REMOVE_IDENTITY 79
    490 #define INTERNET_OPTION_ALTER_IDENTITY 80
    491 #define INTERNET_OPTION_SUPPRESS_BEHAVIOR 81
    492 #define INTERNET_OPTION_AUTODIAL_MODE 82
    493 #define INTERNET_OPTION_AUTODIAL_CONNECTION 83
    494 #define INTERNET_OPTION_CLIENT_CERT_CONTEXT 84
    495 #define INTERNET_OPTION_AUTH_FLAGS 85
    496 #define INTERNET_OPTION_COOKIES_3RD_PARTY 86
    497 #define INTERNET_OPTION_DISABLE_PASSPORT_AUTH 87
    498 #define INTERNET_OPTION_SEND_UTF8_SERVERNAME_TO_PROXY 88
    499 #define INTERNET_OPTION_EXEMPT_CONNECTION_LIMIT 89
    500 #define INTERNET_OPTION_ENABLE_PASSPORT_AUTH 90
    501 
    502 #define INTERNET_OPTION_HIBERNATE_INACTIVE_WORKER_THREADS 91
    503 #define INTERNET_OPTION_ACTIVATE_WORKER_THREADS 92
    504 #define INTERNET_OPTION_RESTORE_WORKER_THREAD_DEFAULTS 93
    505 #define INTERNET_OPTION_SOCKET_SEND_BUFFER_LENGTH 94
    506 #define INTERNET_OPTION_PROXY_SETTINGS_CHANGED 95
    507 
    508 #define INTERNET_OPTION_DATAFILE_EXT 96
    509 
    510 #define INTERNET_FIRST_OPTION INTERNET_OPTION_CALLBACK
    511 #define INTERNET_LAST_OPTION INTERNET_OPTION_DATAFILE_EXT
    512 
    513 #define INTERNET_PRIORITY_FOREGROUND 1000
    514 
    515 #define INTERNET_HANDLE_TYPE_INTERNET 1
    516 #define INTERNET_HANDLE_TYPE_CONNECT_FTP 2
    517 #define INTERNET_HANDLE_TYPE_CONNECT_GOPHER 3
    518 #define INTERNET_HANDLE_TYPE_CONNECT_HTTP 4
    519 #define INTERNET_HANDLE_TYPE_FTP_FIND 5
    520 #define INTERNET_HANDLE_TYPE_FTP_FIND_HTML 6
    521 #define INTERNET_HANDLE_TYPE_FTP_FILE 7
    522 #define INTERNET_HANDLE_TYPE_FTP_FILE_HTML 8
    523 #define INTERNET_HANDLE_TYPE_GOPHER_FIND 9
    524 #define INTERNET_HANDLE_TYPE_GOPHER_FIND_HTML 10
    525 #define INTERNET_HANDLE_TYPE_GOPHER_FILE 11
    526 #define INTERNET_HANDLE_TYPE_GOPHER_FILE_HTML 12
    527 #define INTERNET_HANDLE_TYPE_HTTP_REQUEST 13
    528 #define INTERNET_HANDLE_TYPE_FILE_REQUEST 14
    529 
    530 #define AUTH_FLAG_DISABLE_NEGOTIATE 0x00000001
    531 #define AUTH_FLAG_ENABLE_NEGOTIATE 0x00000002
    532 #define AUTH_FLAG_DISABLE_BASIC_CLEARCHANNEL 0x00000004
    533 
    534 #define SECURITY_FLAG_SECURE 0x00000001
    535 #define SECURITY_FLAG_STRENGTH_WEAK 0x10000000
    536 #define SECURITY_FLAG_STRENGTH_MEDIUM 0x40000000
    537 #define SECURITY_FLAG_STRENGTH_STRONG 0x20000000
    538 #define SECURITY_FLAG_UNKNOWNBIT 0x80000000
    539 #define SECURITY_FLAG_FORTEZZA 0x08000000
    540 #define SECURITY_FLAG_NORMALBITNESS SECURITY_FLAG_STRENGTH_WEAK
    541 
    542 #define SECURITY_FLAG_SSL 0x00000002
    543 #define SECURITY_FLAG_SSL3 0x00000004
    544 #define SECURITY_FLAG_PCT 0x00000008
    545 #define SECURITY_FLAG_PCT4 0x00000010
    546 #define SECURITY_FLAG_IETFSSL4 0x00000020
    547 
    548 #define SECURITY_FLAG_40BIT SECURITY_FLAG_STRENGTH_WEAK
    549 #define SECURITY_FLAG_128BIT SECURITY_FLAG_STRENGTH_STRONG
    550 #define SECURITY_FLAG_56BIT SECURITY_FLAG_STRENGTH_MEDIUM
    551 
    552 #define SECURITY_FLAG_IGNORE_REVOCATION 0x00000080
    553 #define SECURITY_FLAG_IGNORE_UNKNOWN_CA 0x00000100
    554 #define SECURITY_FLAG_IGNORE_WRONG_USAGE 0x00000200
    555 
    556 #define SECURITY_FLAG_IGNORE_CERT_CN_INVALID INTERNET_FLAG_IGNORE_CERT_CN_INVALID
    557 #define SECURITY_FLAG_IGNORE_CERT_DATE_INVALID INTERNET_FLAG_IGNORE_CERT_DATE_INVALID
    558 
    559 #define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTPS INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS
    560 #define SECURITY_FLAG_IGNORE_REDIRECT_TO_HTTP INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP
    561 
    562 #define SECURITY_SET_MASK (SECURITY_FLAG_IGNORE_REVOCATION | SECURITY_FLAG_IGNORE_UNKNOWN_CA | SECURITY_FLAG_IGNORE_CERT_CN_INVALID | SECURITY_FLAG_IGNORE_CERT_DATE_INVALID | SECURITY_FLAG_IGNORE_WRONG_USAGE)
    563 
    564 #define AUTODIAL_MODE_NEVER 1
    565 #define AUTODIAL_MODE_ALWAYS 2
    566 #define AUTODIAL_MODE_NO_NETWORK_PRESENT 4
    567 
    568 #define InternetGetLastResponseInfo __MINGW_NAME_AW(InternetGetLastResponseInfo)
    569 
    570   BOOLAPI InternetGetLastResponseInfoA(LPDWORD lpdwError,LPSTR lpszBuffer,LPDWORD lpdwBufferLength);
    571   BOOLAPI InternetGetLastResponseInfoW(LPDWORD lpdwError,LPWSTR lpszBuffer,LPDWORD lpdwBufferLength);
    572 
    573   typedef VOID (CALLBACK *INTERNET_STATUS_CALLBACK)(HINTERNET hInternet,DWORD_PTR dwContext,DWORD dwInternetStatus,LPVOID lpvStatusInformation,DWORD dwStatusInformationLength);
    574   typedef INTERNET_STATUS_CALLBACK *LPINTERNET_STATUS_CALLBACK;
    575 
    576 #if defined(UNICODE)
    577 #define InternetSetStatusCallback InternetSetStatusCallbackW
    578 #else
    579   INTERNETAPI_(INTERNET_STATUS_CALLBACK) InternetSetStatusCallback(HINTERNET hInternet,INTERNET_STATUS_CALLBACK lpfnInternetCallback);
    580 #endif
    581 
    582   INTERNETAPI_(INTERNET_STATUS_CALLBACK) InternetSetStatusCallbackA(HINTERNET hInternet,INTERNET_STATUS_CALLBACK lpfnInternetCallback);
    583   INTERNETAPI_(INTERNET_STATUS_CALLBACK) InternetSetStatusCallbackW(HINTERNET hInternet,INTERNET_STATUS_CALLBACK lpfnInternetCallback);
    584 
    585 #define INTERNET_STATUS_RESOLVING_NAME 10
    586 #define INTERNET_STATUS_NAME_RESOLVED 11
    587 #define INTERNET_STATUS_CONNECTING_TO_SERVER 20
    588 #define INTERNET_STATUS_CONNECTED_TO_SERVER 21
    589 #define INTERNET_STATUS_SENDING_REQUEST 30
    590 #define INTERNET_STATUS_REQUEST_SENT 31
    591 #define INTERNET_STATUS_RECEIVING_RESPONSE 40
    592 #define INTERNET_STATUS_RESPONSE_RECEIVED 41
    593 #define INTERNET_STATUS_CTL_RESPONSE_RECEIVED 42
    594 #define INTERNET_STATUS_PREFETCH 43
    595 #define INTERNET_STATUS_CLOSING_CONNECTION 50
    596 #define INTERNET_STATUS_CONNECTION_CLOSED 51
    597 #define INTERNET_STATUS_HANDLE_CREATED 60
    598 #define INTERNET_STATUS_HANDLE_CLOSING 70
    599 #define INTERNET_STATUS_DETECTING_PROXY 80
    600 #define INTERNET_STATUS_REQUEST_COMPLETE 100
    601 #define INTERNET_STATUS_REDIRECT 110
    602 #define INTERNET_STATUS_INTERMEDIATE_RESPONSE 120
    603 #define INTERNET_STATUS_USER_INPUT_REQUIRED 140
    604 #define INTERNET_STATUS_STATE_CHANGE 200
    605 #define INTERNET_STATUS_COOKIE_SENT 320
    606 #define INTERNET_STATUS_COOKIE_RECEIVED 321
    607 #define INTERNET_STATUS_PRIVACY_IMPACTED 324
    608 #define INTERNET_STATUS_P3P_HEADER 325
    609 #define INTERNET_STATUS_P3P_POLICYREF 326
    610 #define INTERNET_STATUS_COOKIE_HISTORY 327
    611 
    612 #define INTERNET_STATE_CONNECTED 0x00000001
    613 #define INTERNET_STATE_DISCONNECTED 0x00000002
    614 #define INTERNET_STATE_DISCONNECTED_BY_USER 0x00000010
    615 #define INTERNET_STATE_IDLE 0x00000100
    616 #define INTERNET_STATE_BUSY 0x00000200
    617 
    618   typedef enum {
    619     COOKIE_STATE_UNKNOWN = 0x0,COOKIE_STATE_ACCEPT = 0x1,COOKIE_STATE_PROMPT = 0x2,COOKIE_STATE_LEASH = 0x3,COOKIE_STATE_DOWNGRADE = 0x4,
    620     COOKIE_STATE_REJECT = 0x5,COOKIE_STATE_MAX = COOKIE_STATE_REJECT
    621   } InternetCookieState;
    622 
    623   typedef struct {
    624     int cSession;
    625     int cPersistent;
    626     int cAccepted;
    627     int cLeashed;
    628     int cDowngraded;
    629     int cBlocked;
    630     const char *pszLocation;
    631   } IncomingCookieState;
    632 
    633   typedef struct {
    634     int cSent;
    635     int cSuppressed;
    636 
    637     const char *pszLocation;
    638   } OutgoingCookieState;
    639 
    640   typedef struct {
    641     WINBOOL fAccepted;
    642     WINBOOL fLeashed;
    643     WINBOOL fDowngraded;
    644     WINBOOL fRejected;
    645   } InternetCookieHistory;
    646 
    647   typedef struct {
    648     DWORD dwCookieState;
    649     WINBOOL fAllowSession;
    650   } CookieDecision;
    651 
    652 #define INTERNET_INVALID_STATUS_CALLBACK ((INTERNET_STATUS_CALLBACK)(INT_PTR)-1)
    653 
    654 #define FTP_TRANSFER_TYPE_UNKNOWN 0x00000000
    655 #define FTP_TRANSFER_TYPE_ASCII 0x00000001
    656 #define FTP_TRANSFER_TYPE_BINARY 0x00000002
    657 
    658 #define FTP_TRANSFER_TYPE_MASK (FTP_TRANSFER_TYPE_ASCII | FTP_TRANSFER_TYPE_BINARY)
    659 
    660 #define FtpFindFirstFile __MINGW_NAME_AW(FtpFindFirstFile)
    661 #define FtpGetFile __MINGW_NAME_AW(FtpGetFile)
    662 #define FtpPutFile __MINGW_NAME_AW(FtpPutFile)
    663 #define FtpDeleteFile __MINGW_NAME_AW(FtpDeleteFile)
    664 #define FtpRenameFile __MINGW_NAME_AW(FtpRenameFile)
    665 #define FtpOpenFile __MINGW_NAME_AW(FtpOpenFile)
    666 #define FtpCreateDirectory __MINGW_NAME_AW(FtpCreateDirectory)
    667 #define FtpRemoveDirectory __MINGW_NAME_AW(FtpRemoveDirectory)
    668 #define FtpSetCurrentDirectory __MINGW_NAME_AW(FtpSetCurrentDirectory)
    669 #define FtpGetCurrentDirectory __MINGW_NAME_AW(FtpGetCurrentDirectory)
    670 #define FtpCommand __MINGW_NAME_AW(FtpCommand)
    671 
    672   INTERNETAPI_(HINTERNET) FtpFindFirstFileA(HINTERNET hConnect,LPCSTR lpszSearchFile,LPWIN32_FIND_DATAA lpFindFileData,DWORD dwFlags,DWORD_PTR dwContext);
    673   INTERNETAPI_(HINTERNET) FtpFindFirstFileW(HINTERNET hConnect,LPCWSTR lpszSearchFile,LPWIN32_FIND_DATAW lpFindFileData,DWORD dwFlags,DWORD_PTR dwContext);
    674   BOOLAPI FtpGetFileA(HINTERNET hConnect,LPCSTR lpszRemoteFile,LPCSTR lpszNewFile,WINBOOL fFailIfExists,DWORD dwFlagsAndAttributes,DWORD dwFlags,DWORD_PTR dwContext);
    675   BOOLAPI FtpGetFileW(HINTERNET hConnect,LPCWSTR lpszRemoteFile,LPCWSTR lpszNewFile,WINBOOL fFailIfExists,DWORD dwFlagsAndAttributes,DWORD dwFlags,DWORD_PTR dwContext);
    676   BOOLAPI FtpPutFileA(HINTERNET hConnect,LPCSTR lpszLocalFile,LPCSTR lpszNewRemoteFile,DWORD dwFlags,DWORD_PTR dwContext);
    677   BOOLAPI FtpPutFileW(HINTERNET hConnect,LPCWSTR lpszLocalFile,LPCWSTR lpszNewRemoteFile,DWORD dwFlags,DWORD_PTR dwContext);
    678   BOOLAPI FtpGetFileEx(HINTERNET hFtpSession,LPCSTR lpszRemoteFile,LPCWSTR lpszNewFile,WINBOOL fFailIfExists,DWORD dwFlagsAndAttributes,DWORD dwFlags,DWORD_PTR dwContext);
    679   BOOLAPI FtpPutFileEx(HINTERNET hFtpSession,LPCWSTR lpszLocalFile,LPCSTR lpszNewRemoteFile,DWORD dwFlags,DWORD_PTR dwContext);
    680   BOOLAPI FtpDeleteFileA(HINTERNET hConnect,LPCSTR lpszFileName);
    681   BOOLAPI FtpDeleteFileW(HINTERNET hConnect,LPCWSTR lpszFileName);
    682   BOOLAPI FtpRenameFileA(HINTERNET hConnect,LPCSTR lpszExisting,LPCSTR lpszNew);
    683   BOOLAPI FtpRenameFileW(HINTERNET hConnect,LPCWSTR lpszExisting,LPCWSTR lpszNew);
    684   INTERNETAPI_(HINTERNET) FtpOpenFileA(HINTERNET hConnect,LPCSTR lpszFileName,DWORD dwAccess,DWORD dwFlags,DWORD_PTR dwContext);
    685   INTERNETAPI_(HINTERNET) FtpOpenFileW(HINTERNET hConnect,LPCWSTR lpszFileName,DWORD dwAccess,DWORD dwFlags,DWORD_PTR dwContext);
    686   BOOLAPI FtpCreateDirectoryA(HINTERNET hConnect,LPCSTR lpszDirectory);
    687   BOOLAPI FtpCreateDirectoryW(HINTERNET hConnect,LPCWSTR lpszDirectory);
    688   BOOLAPI FtpRemoveDirectoryA(HINTERNET hConnect,LPCSTR lpszDirectory);
    689   BOOLAPI FtpRemoveDirectoryW(HINTERNET hConnect,LPCWSTR lpszDirectory);
    690   BOOLAPI FtpSetCurrentDirectoryA(HINTERNET hConnect,LPCSTR lpszDirectory);
    691   BOOLAPI FtpSetCurrentDirectoryW(HINTERNET hConnect,LPCWSTR lpszDirectory);
    692   BOOLAPI FtpGetCurrentDirectoryA(HINTERNET hConnect,LPSTR lpszCurrentDirectory,LPDWORD lpdwCurrentDirectory);
    693   BOOLAPI FtpGetCurrentDirectoryW(HINTERNET hConnect,LPWSTR lpszCurrentDirectory,LPDWORD lpdwCurrentDirectory);
    694   BOOLAPI FtpCommandA(HINTERNET hConnect,WINBOOL fExpectResponse,DWORD dwFlags,LPCSTR lpszCommand,DWORD_PTR dwContext,HINTERNET *phFtpCommand);
    695   BOOLAPI FtpCommandW(HINTERNET hConnect,WINBOOL fExpectResponse,DWORD dwFlags,LPCWSTR lpszCommand,DWORD_PTR dwContext,HINTERNET *phFtpCommand);
    696   INTERNETAPI_(DWORD) FtpGetFileSize(HINTERNET hFile,LPDWORD lpdwFileSizeHigh);
    697 
    698 #define MAX_GOPHER_DISPLAY_TEXT 128
    699 #define MAX_GOPHER_SELECTOR_TEXT 256
    700 #define MAX_GOPHER_HOST_NAME INTERNET_MAX_HOST_NAME_LENGTH
    701 #define MAX_GOPHER_LOCATOR_LENGTH (1 + MAX_GOPHER_DISPLAY_TEXT + 1 + MAX_GOPHER_SELECTOR_TEXT + 1 + MAX_GOPHER_HOST_NAME + 1 + INTERNET_MAX_PORT_NUMBER_LENGTH + 1 + 1 + 2)
    702 
    703   typedef struct {
    704     CHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1];
    705     DWORD GopherType;
    706     DWORD SizeLow;
    707     DWORD SizeHigh;
    708     FILETIME LastModificationTime;
    709     CHAR Locator[MAX_GOPHER_LOCATOR_LENGTH + 1];
    710   } GOPHER_FIND_DATAA,*LPGOPHER_FIND_DATAA;
    711 
    712   typedef struct {
    713     WCHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1];
    714     DWORD GopherType;
    715     DWORD SizeLow;
    716     DWORD SizeHigh;
    717     FILETIME LastModificationTime;
    718     WCHAR Locator[MAX_GOPHER_LOCATOR_LENGTH + 1];
    719   } GOPHER_FIND_DATAW,*LPGOPHER_FIND_DATAW;
    720 
    721   __MINGW_TYPEDEF_AW(GOPHER_FIND_DATA)
    722   __MINGW_TYPEDEF_AW(LPGOPHER_FIND_DATA)
    723 
    724 #define GOPHER_TYPE_TEXT_FILE 0x00000001
    725 #define GOPHER_TYPE_DIRECTORY 0x00000002
    726 #define GOPHER_TYPE_CSO 0x00000004
    727 #define GOPHER_TYPE_ERROR 0x00000008
    728 #define GOPHER_TYPE_MAC_BINHEX 0x00000010
    729 #define GOPHER_TYPE_DOS_ARCHIVE 0x00000020
    730 #define GOPHER_TYPE_UNIX_UUENCODED 0x00000040
    731 #define GOPHER_TYPE_INDEX_SERVER 0x00000080
    732 #define GOPHER_TYPE_TELNET 0x00000100
    733 #define GOPHER_TYPE_BINARY 0x00000200
    734 #define GOPHER_TYPE_REDUNDANT 0x00000400
    735 #define GOPHER_TYPE_TN3270 0x00000800
    736 #define GOPHER_TYPE_GIF 0x00001000
    737 #define GOPHER_TYPE_IMAGE 0x00002000
    738 #define GOPHER_TYPE_BITMAP 0x00004000
    739 #define GOPHER_TYPE_MOVIE 0x00008000
    740 #define GOPHER_TYPE_SOUND 0x00010000
    741 #define GOPHER_TYPE_HTML 0x00020000
    742 #define GOPHER_TYPE_PDF 0x00040000
    743 #define GOPHER_TYPE_CALENDAR 0x00080000
    744 #define GOPHER_TYPE_INLINE 0x00100000
    745 #define GOPHER_TYPE_UNKNOWN 0x20000000
    746 #define GOPHER_TYPE_ASK 0x40000000
    747 #define GOPHER_TYPE_GOPHER_PLUS 0x80000000
    748 
    749 #define IS_GOPHER_FILE(type) (WINBOOL)(((type) & GOPHER_TYPE_FILE_MASK) ? TRUE : FALSE)
    750 #define IS_GOPHER_DIRECTORY(type) (WINBOOL)(((type) & GOPHER_TYPE_DIRECTORY) ? TRUE : FALSE)
    751 #define IS_GOPHER_PHONE_SERVER(type) (WINBOOL)(((type) & GOPHER_TYPE_CSO) ? TRUE : FALSE)
    752 #define IS_GOPHER_ERROR(type) (WINBOOL)(((type) & GOPHER_TYPE_ERROR) ? TRUE : FALSE)
    753 #define IS_GOPHER_INDEX_SERVER(type) (WINBOOL)(((type) & GOPHER_TYPE_INDEX_SERVER) ? TRUE : FALSE)
    754 #define IS_GOPHER_TELNET_SESSION(type) (WINBOOL)(((type) & GOPHER_TYPE_TELNET) ? TRUE : FALSE)
    755 #define IS_GOPHER_BACKUP_SERVER(type) (WINBOOL)(((type) & GOPHER_TYPE_REDUNDANT) ? TRUE : FALSE)
    756 #define IS_GOPHER_TN3270_SESSION(type) (WINBOOL)(((type) & GOPHER_TYPE_TN3270) ? TRUE : FALSE)
    757 #define IS_GOPHER_ASK(type) (WINBOOL)(((type) & GOPHER_TYPE_ASK) ? TRUE : FALSE)
    758 #define IS_GOPHER_PLUS(type) (WINBOOL)(((type) & GOPHER_TYPE_GOPHER_PLUS) ? TRUE : FALSE)
    759 
    760 #define IS_GOPHER_TYPE_KNOWN(type) (WINBOOL)(((type) & GOPHER_TYPE_UNKNOWN) ? FALSE : TRUE)
    761 
    762 #define GOPHER_TYPE_FILE_MASK (GOPHER_TYPE_TEXT_FILE | GOPHER_TYPE_MAC_BINHEX | GOPHER_TYPE_DOS_ARCHIVE | GOPHER_TYPE_UNIX_UUENCODED | GOPHER_TYPE_BINARY | GOPHER_TYPE_GIF | GOPHER_TYPE_IMAGE | GOPHER_TYPE_BITMAP | GOPHER_TYPE_MOVIE | GOPHER_TYPE_SOUND | GOPHER_TYPE_HTML | GOPHER_TYPE_PDF | GOPHER_TYPE_CALENDAR | GOPHER_TYPE_INLINE)
    763 
    764   typedef struct {
    765     LPCTSTR Comment;
    766     LPCTSTR EmailAddress;
    767   } GOPHER_ADMIN_ATTRIBUTE_TYPE,*LPGOPHER_ADMIN_ATTRIBUTE_TYPE;
    768 
    769   typedef struct {
    770     FILETIME DateAndTime;
    771   } GOPHER_MOD_DATE_ATTRIBUTE_TYPE,*LPGOPHER_MOD_DATE_ATTRIBUTE_TYPE;
    772 
    773   typedef struct {
    774     DWORD Ttl;
    775   } GOPHER_TTL_ATTRIBUTE_TYPE,*LPGOPHER_TTL_ATTRIBUTE_TYPE;
    776 
    777   typedef struct {
    778     INT Score;
    779   } GOPHER_SCORE_ATTRIBUTE_TYPE,*LPGOPHER_SCORE_ATTRIBUTE_TYPE;
    780 
    781   typedef struct {
    782     INT LowerBound;
    783     INT UpperBound;
    784   } GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE,*LPGOPHER_SCORE_RANGE_ATTRIBUTE_TYPE;
    785 
    786   typedef struct {
    787     LPCTSTR Site;
    788   } GOPHER_SITE_ATTRIBUTE_TYPE,*LPGOPHER_SITE_ATTRIBUTE_TYPE;
    789 
    790   typedef struct {
    791     LPCTSTR Organization;
    792   } GOPHER_ORGANIZATION_ATTRIBUTE_TYPE,*LPGOPHER_ORGANIZATION_ATTRIBUTE_TYPE;
    793 
    794   typedef struct {
    795     LPCTSTR Location;
    796   } GOPHER_LOCATION_ATTRIBUTE_TYPE,*LPGOPHER_LOCATION_ATTRIBUTE_TYPE;
    797 
    798   typedef struct {
    799     INT DegreesNorth;
    800     INT MinutesNorth;
    801     INT SecondsNorth;
    802     INT DegreesEast;
    803     INT MinutesEast;
    804     INT SecondsEast;
    805   } GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE,*LPGOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE;
    806 
    807   typedef struct {
    808     INT Zone;
    809   } GOPHER_TIMEZONE_ATTRIBUTE_TYPE,*LPGOPHER_TIMEZONE_ATTRIBUTE_TYPE;
    810 
    811   typedef struct {
    812     LPCTSTR Provider;
    813   } GOPHER_PROVIDER_ATTRIBUTE_TYPE,*LPGOPHER_PROVIDER_ATTRIBUTE_TYPE;
    814 
    815   typedef struct {
    816     LPCTSTR Version;
    817   } GOPHER_VERSION_ATTRIBUTE_TYPE,*LPGOPHER_VERSION_ATTRIBUTE_TYPE;
    818 
    819   typedef struct {
    820     LPCTSTR ShortAbstract;
    821     LPCTSTR AbstractFile;
    822   } GOPHER_ABSTRACT_ATTRIBUTE_TYPE,*LPGOPHER_ABSTRACT_ATTRIBUTE_TYPE;
    823 
    824   typedef struct {
    825     LPCTSTR ContentType;
    826     LPCTSTR Language;
    827     DWORD Size;
    828   } GOPHER_VIEW_ATTRIBUTE_TYPE,*LPGOPHER_VIEW_ATTRIBUTE_TYPE;
    829 
    830   typedef struct {
    831     WINBOOL TreeWalk;
    832   } GOPHER_VERONICA_ATTRIBUTE_TYPE,*LPGOPHER_VERONICA_ATTRIBUTE_TYPE;
    833 
    834   typedef struct {
    835     LPCTSTR QuestionType;
    836     LPCTSTR QuestionText;
    837   } GOPHER_ASK_ATTRIBUTE_TYPE,*LPGOPHER_ASK_ATTRIBUTE_TYPE;
    838 
    839   typedef struct {
    840     LPCTSTR Text;
    841   } GOPHER_UNKNOWN_ATTRIBUTE_TYPE,*LPGOPHER_UNKNOWN_ATTRIBUTE_TYPE;
    842 
    843   typedef struct {
    844     DWORD CategoryId;
    845     DWORD AttributeId;
    846     union {
    847       GOPHER_ADMIN_ATTRIBUTE_TYPE Admin;
    848       GOPHER_MOD_DATE_ATTRIBUTE_TYPE ModDate;
    849       GOPHER_TTL_ATTRIBUTE_TYPE Ttl;
    850       GOPHER_SCORE_ATTRIBUTE_TYPE Score;
    851       GOPHER_SCORE_RANGE_ATTRIBUTE_TYPE ScoreRange;
    852       GOPHER_SITE_ATTRIBUTE_TYPE Site;
    853       GOPHER_ORGANIZATION_ATTRIBUTE_TYPE Organization;
    854       GOPHER_LOCATION_ATTRIBUTE_TYPE Location;
    855       GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE_TYPE GeographicalLocation;
    856       GOPHER_TIMEZONE_ATTRIBUTE_TYPE TimeZone;
    857       GOPHER_PROVIDER_ATTRIBUTE_TYPE Provider;
    858       GOPHER_VERSION_ATTRIBUTE_TYPE Version;
    859       GOPHER_ABSTRACT_ATTRIBUTE_TYPE Abstract;
    860       GOPHER_VIEW_ATTRIBUTE_TYPE View;
    861       GOPHER_VERONICA_ATTRIBUTE_TYPE Veronica;
    862       GOPHER_ASK_ATTRIBUTE_TYPE Ask;
    863       GOPHER_UNKNOWN_ATTRIBUTE_TYPE Unknown;
    864     } AttributeType;
    865   } GOPHER_ATTRIBUTE_TYPE,*LPGOPHER_ATTRIBUTE_TYPE;
    866 
    867 #define MAX_GOPHER_CATEGORY_NAME 128
    868 #define MAX_GOPHER_ATTRIBUTE_NAME 128
    869 #define MIN_GOPHER_ATTRIBUTE_LENGTH 256
    870 
    871 #define GOPHER_INFO_CATEGORY TEXT("+INFO")
    872 #define GOPHER_ADMIN_CATEGORY TEXT("+ADMIN")
    873 #define GOPHER_VIEWS_CATEGORY TEXT("+VIEWS")
    874 #define GOPHER_ABSTRACT_CATEGORY TEXT("+ABSTRACT")
    875 #define GOPHER_VERONICA_CATEGORY TEXT("+VERONICA")
    876 
    877 #define GOPHER_ADMIN_ATTRIBUTE TEXT("Admin")
    878 #define GOPHER_MOD_DATE_ATTRIBUTE TEXT("Mod-Date")
    879 #define GOPHER_TTL_ATTRIBUTE TEXT("TTL")
    880 #define GOPHER_SCORE_ATTRIBUTE TEXT("Score")
    881 #define GOPHER_RANGE_ATTRIBUTE TEXT("Score-range")
    882 #define GOPHER_SITE_ATTRIBUTE TEXT("Site")
    883 #define GOPHER_ORG_ATTRIBUTE TEXT("Org")
    884 #define GOPHER_LOCATION_ATTRIBUTE TEXT("Loc")
    885 #define GOPHER_GEOG_ATTRIBUTE TEXT("Geog")
    886 #define GOPHER_TIMEZONE_ATTRIBUTE TEXT("TZ")
    887 #define GOPHER_PROVIDER_ATTRIBUTE TEXT("Provider")
    888 #define GOPHER_VERSION_ATTRIBUTE TEXT("Version")
    889 #define GOPHER_ABSTRACT_ATTRIBUTE TEXT("Abstract")
    890 #define GOPHER_VIEW_ATTRIBUTE TEXT("View")
    891 #define GOPHER_TREEWALK_ATTRIBUTE TEXT("treewalk")
    892 
    893 #define GOPHER_ATTRIBUTE_ID_BASE 0xabcccc00
    894 
    895 #define GOPHER_CATEGORY_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 1)
    896 
    897 #define GOPHER_CATEGORY_ID_INFO (GOPHER_ATTRIBUTE_ID_BASE + 2)
    898 #define GOPHER_CATEGORY_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 3)
    899 #define GOPHER_CATEGORY_ID_VIEWS (GOPHER_ATTRIBUTE_ID_BASE + 4)
    900 #define GOPHER_CATEGORY_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 5)
    901 #define GOPHER_CATEGORY_ID_VERONICA (GOPHER_ATTRIBUTE_ID_BASE + 6)
    902 #define GOPHER_CATEGORY_ID_ASK (GOPHER_ATTRIBUTE_ID_BASE + 7)
    903 
    904 #define GOPHER_CATEGORY_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 8)
    905 
    906 #define GOPHER_ATTRIBUTE_ID_ALL (GOPHER_ATTRIBUTE_ID_BASE + 9)
    907 
    908 #define GOPHER_ATTRIBUTE_ID_ADMIN (GOPHER_ATTRIBUTE_ID_BASE + 10)
    909 #define GOPHER_ATTRIBUTE_ID_MOD_DATE (GOPHER_ATTRIBUTE_ID_BASE + 11)
    910 #define GOPHER_ATTRIBUTE_ID_TTL (GOPHER_ATTRIBUTE_ID_BASE + 12)
    911 #define GOPHER_ATTRIBUTE_ID_SCORE (GOPHER_ATTRIBUTE_ID_BASE + 13)
    912 #define GOPHER_ATTRIBUTE_ID_RANGE (GOPHER_ATTRIBUTE_ID_BASE + 14)
    913 #define GOPHER_ATTRIBUTE_ID_SITE (GOPHER_ATTRIBUTE_ID_BASE + 15)
    914 #define GOPHER_ATTRIBUTE_ID_ORG (GOPHER_ATTRIBUTE_ID_BASE + 16)
    915 #define GOPHER_ATTRIBUTE_ID_LOCATION (GOPHER_ATTRIBUTE_ID_BASE + 17)
    916 #define GOPHER_ATTRIBUTE_ID_GEOG (GOPHER_ATTRIBUTE_ID_BASE + 18)
    917 #define GOPHER_ATTRIBUTE_ID_TIMEZONE (GOPHER_ATTRIBUTE_ID_BASE + 19)
    918 #define GOPHER_ATTRIBUTE_ID_PROVIDER (GOPHER_ATTRIBUTE_ID_BASE + 20)
    919 #define GOPHER_ATTRIBUTE_ID_VERSION (GOPHER_ATTRIBUTE_ID_BASE + 21)
    920 #define GOPHER_ATTRIBUTE_ID_ABSTRACT (GOPHER_ATTRIBUTE_ID_BASE + 22)
    921 #define GOPHER_ATTRIBUTE_ID_VIEW (GOPHER_ATTRIBUTE_ID_BASE + 23)
    922 #define GOPHER_ATTRIBUTE_ID_TREEWALK (GOPHER_ATTRIBUTE_ID_BASE + 24)
    923 
    924 #define GOPHER_ATTRIBUTE_ID_UNKNOWN (GOPHER_ATTRIBUTE_ID_BASE + 25)
    925 
    926 #define GopherCreateLocator __MINGW_NAME_AW(GopherCreateLocator)
    927 #define GopherGetLocatorType __MINGW_NAME_AW(GopherGetLocatorType)
    928 #define GopherFindFirstFile __MINGW_NAME_AW(GopherFindFirstFile)
    929 #define GopherOpenFile __MINGW_NAME_AW(GopherOpenFile)
    930 #define GopherGetAttribute __MINGW_NAME_AW(GopherGetAttribute)
    931 
    932   BOOLAPI GopherCreateLocatorA(LPCSTR lpszHost,INTERNET_PORT nServerPort,LPCSTR lpszDisplayString,LPCSTR lpszSelectorString,DWORD dwGopherType,LPSTR lpszLocator,LPDWORD lpdwBufferLength);
    933   BOOLAPI GopherCreateLocatorW(LPCWSTR lpszHost,INTERNET_PORT nServerPort,LPCWSTR lpszDisplayString,LPCWSTR lpszSelectorString,DWORD dwGopherType,LPWSTR lpszLocator,LPDWORD lpdwBufferLength);
    934   BOOLAPI GopherGetLocatorTypeA(LPCSTR lpszLocator,LPDWORD lpdwGopherType);
    935   BOOLAPI GopherGetLocatorTypeW(LPCWSTR lpszLocator,LPDWORD lpdwGopherType);
    936   INTERNETAPI_(HINTERNET) GopherFindFirstFileA(HINTERNET hConnect,LPCSTR lpszLocator,LPCSTR lpszSearchString,LPGOPHER_FIND_DATAA lpFindData,DWORD dwFlags,DWORD_PTR dwContext);
    937   INTERNETAPI_(HINTERNET) GopherFindFirstFileW(HINTERNET hConnect,LPCWSTR lpszLocator,LPCWSTR lpszSearchString,LPGOPHER_FIND_DATAW lpFindData,DWORD dwFlags,DWORD_PTR dwContext);
    938   INTERNETAPI_(HINTERNET) GopherOpenFileA(HINTERNET hConnect,LPCSTR lpszLocator,LPCSTR lpszView,DWORD dwFlags,DWORD_PTR dwContext);
    939   INTERNETAPI_(HINTERNET) GopherOpenFileW(HINTERNET hConnect,LPCWSTR lpszLocator,LPCWSTR lpszView,DWORD dwFlags,DWORD_PTR dwContext);
    940 
    941   typedef WINBOOL (CALLBACK *GOPHER_ATTRIBUTE_ENUMERATOR)(LPGOPHER_ATTRIBUTE_TYPE lpAttributeInfo,DWORD dwError);
    942 
    943   BOOLAPI GopherGetAttributeA(HINTERNET hConnect,LPCSTR lpszLocator,LPCSTR lpszAttributeName,LPBYTE lpBuffer,DWORD dwBufferLength,LPDWORD lpdwCharactersReturned,GOPHER_ATTRIBUTE_ENUMERATOR lpfnEnumerator,DWORD_PTR dwContext);
    944   BOOLAPI GopherGetAttributeW(HINTERNET hConnect,LPCWSTR lpszLocator,LPCWSTR lpszAttributeName,LPBYTE lpBuffer,DWORD dwBufferLength,LPDWORD lpdwCharactersReturned,GOPHER_ATTRIBUTE_ENUMERATOR lpfnEnumerator,DWORD_PTR dwContext);
    945 
    946 #define HTTP_MAJOR_VERSION 1
    947 #define HTTP_MINOR_VERSION 0
    948 
    949 #define HTTP_VERSIONA "HTTP/1.0"
    950 #define HTTP_VERSIONW L"HTTP/1.0"
    951 
    952 #define HTTP_VERSION __MINGW_NAME_AW(HTTP_VERSION)
    953 
    954 #define HTTP_QUERY_MIME_VERSION 0
    955 #define HTTP_QUERY_CONTENT_TYPE 1
    956 #define HTTP_QUERY_CONTENT_TRANSFER_ENCODING 2
    957 #define HTTP_QUERY_CONTENT_ID 3
    958 #define HTTP_QUERY_CONTENT_DESCRIPTION 4
    959 #define HTTP_QUERY_CONTENT_LENGTH 5
    960 #define HTTP_QUERY_CONTENT_LANGUAGE 6
    961 #define HTTP_QUERY_ALLOW 7
    962 #define HTTP_QUERY_PUBLIC 8
    963 #define HTTP_QUERY_DATE 9
    964 #define HTTP_QUERY_EXPIRES 10
    965 #define HTTP_QUERY_LAST_MODIFIED 11
    966 #define HTTP_QUERY_MESSAGE_ID 12
    967 #define HTTP_QUERY_URI 13
    968 #define HTTP_QUERY_DERIVED_FROM 14
    969 #define HTTP_QUERY_COST 15
    970 #define HTTP_QUERY_LINK 16
    971 #define HTTP_QUERY_PRAGMA 17
    972 #define HTTP_QUERY_VERSION 18
    973 #define HTTP_QUERY_STATUS_CODE 19
    974 #define HTTP_QUERY_STATUS_TEXT 20
    975 #define HTTP_QUERY_RAW_HEADERS 21
    976 #define HTTP_QUERY_RAW_HEADERS_CRLF 22
    977 #define HTTP_QUERY_CONNECTION 23
    978 #define HTTP_QUERY_ACCEPT 24
    979 #define HTTP_QUERY_ACCEPT_CHARSET 25
    980 #define HTTP_QUERY_ACCEPT_ENCODING 26
    981 #define HTTP_QUERY_ACCEPT_LANGUAGE 27
    982 #define HTTP_QUERY_AUTHORIZATION 28
    983 #define HTTP_QUERY_CONTENT_ENCODING 29
    984 #define HTTP_QUERY_FORWARDED 30
    985 #define HTTP_QUERY_FROM 31
    986 #define HTTP_QUERY_IF_MODIFIED_SINCE 32
    987 #define HTTP_QUERY_LOCATION 33
    988 #define HTTP_QUERY_ORIG_URI 34
    989 #define HTTP_QUERY_REFERER 35
    990 #define HTTP_QUERY_RETRY_AFTER 36
    991 #define HTTP_QUERY_SERVER 37
    992 #define HTTP_QUERY_TITLE 38
    993 #define HTTP_QUERY_USER_AGENT 39
    994 #define HTTP_QUERY_WWW_AUTHENTICATE 40
    995 #define HTTP_QUERY_PROXY_AUTHENTICATE 41
    996 #define HTTP_QUERY_ACCEPT_RANGES 42
    997 #define HTTP_QUERY_SET_COOKIE 43
    998 #define HTTP_QUERY_COOKIE 44
    999 #define HTTP_QUERY_REQUEST_METHOD 45
   1000 #define HTTP_QUERY_REFRESH 46
   1001 #define HTTP_QUERY_CONTENT_DISPOSITION 47
   1002 
   1003 #define HTTP_QUERY_AGE 48
   1004 #define HTTP_QUERY_CACHE_CONTROL 49
   1005 #define HTTP_QUERY_CONTENT_BASE 50
   1006 #define HTTP_QUERY_CONTENT_LOCATION 51
   1007 #define HTTP_QUERY_CONTENT_MD5 52
   1008 #define HTTP_QUERY_CONTENT_RANGE 53
   1009 #define HTTP_QUERY_ETAG 54
   1010 #define HTTP_QUERY_HOST 55
   1011 #define HTTP_QUERY_IF_MATCH 56
   1012 #define HTTP_QUERY_IF_NONE_MATCH 57
   1013 #define HTTP_QUERY_IF_RANGE 58
   1014 #define HTTP_QUERY_IF_UNMODIFIED_SINCE 59
   1015 #define HTTP_QUERY_MAX_FORWARDS 60
   1016 #define HTTP_QUERY_PROXY_AUTHORIZATION 61
   1017 #define HTTP_QUERY_RANGE 62
   1018 #define HTTP_QUERY_TRANSFER_ENCODING 63
   1019 #define HTTP_QUERY_UPGRADE 64
   1020 #define HTTP_QUERY_VARY 65
   1021 #define HTTP_QUERY_VIA 66
   1022 #define HTTP_QUERY_WARNING 67
   1023 #define HTTP_QUERY_EXPECT 68
   1024 #define HTTP_QUERY_PROXY_CONNECTION 69
   1025 #define HTTP_QUERY_UNLESS_MODIFIED_SINCE 70
   1026 
   1027 #define HTTP_QUERY_ECHO_REQUEST 71
   1028 #define HTTP_QUERY_ECHO_REPLY 72
   1029 
   1030 #define HTTP_QUERY_ECHO_HEADERS 73
   1031 #define HTTP_QUERY_ECHO_HEADERS_CRLF 74
   1032 
   1033 #define HTTP_QUERY_PROXY_SUPPORT 75
   1034 #define HTTP_QUERY_AUTHENTICATION_INFO 76
   1035 #define HTTP_QUERY_PASSPORT_URLS 77
   1036 #define HTTP_QUERY_PASSPORT_CONFIG 78
   1037 
   1038 #define HTTP_QUERY_MAX 78
   1039 #define HTTP_QUERY_CUSTOM 65535
   1040 
   1041 #define HTTP_QUERY_FLAG_REQUEST_HEADERS 0x80000000
   1042 #define HTTP_QUERY_FLAG_SYSTEMTIME 0x40000000
   1043 #define HTTP_QUERY_FLAG_NUMBER 0x20000000
   1044 #define HTTP_QUERY_FLAG_COALESCE 0x10000000
   1045 #define HTTP_QUERY_MODIFIER_FLAGS_MASK (HTTP_QUERY_FLAG_REQUEST_HEADERS | HTTP_QUERY_FLAG_SYSTEMTIME | HTTP_QUERY_FLAG_NUMBER | HTTP_QUERY_FLAG_COALESCE)
   1046 #define HTTP_QUERY_HEADER_MASK (~HTTP_QUERY_MODIFIER_FLAGS_MASK)
   1047 
   1048 #define HTTP_STATUS_CONTINUE 100
   1049 #define HTTP_STATUS_SWITCH_PROTOCOLS 101
   1050 
   1051 #define HTTP_STATUS_OK 200
   1052 #define HTTP_STATUS_CREATED 201
   1053 #define HTTP_STATUS_ACCEPTED 202
   1054 #define HTTP_STATUS_PARTIAL 203
   1055 #define HTTP_STATUS_NO_CONTENT 204
   1056 #define HTTP_STATUS_RESET_CONTENT 205
   1057 #define HTTP_STATUS_PARTIAL_CONTENT 206
   1058 
   1059 #define HTTP_STATUS_AMBIGUOUS 300
   1060 #define HTTP_STATUS_MOVED 301
   1061 #define HTTP_STATUS_REDIRECT 302
   1062 #define HTTP_STATUS_REDIRECT_METHOD 303
   1063 #define HTTP_STATUS_NOT_MODIFIED 304
   1064 #define HTTP_STATUS_USE_PROXY 305
   1065 #define HTTP_STATUS_REDIRECT_KEEP_VERB 307
   1066 
   1067 #define HTTP_STATUS_BAD_REQUEST 400
   1068 #define HTTP_STATUS_DENIED 401
   1069 #define HTTP_STATUS_PAYMENT_REQ 402
   1070 #define HTTP_STATUS_FORBIDDEN 403
   1071 #define HTTP_STATUS_NOT_FOUND 404
   1072 #define HTTP_STATUS_BAD_METHOD 405
   1073 #define HTTP_STATUS_NONE_ACCEPTABLE 406
   1074 #define HTTP_STATUS_PROXY_AUTH_REQ 407
   1075 #define HTTP_STATUS_REQUEST_TIMEOUT 408
   1076 #define HTTP_STATUS_CONFLICT 409
   1077 #define HTTP_STATUS_GONE 410
   1078 #define HTTP_STATUS_LENGTH_REQUIRED 411
   1079 #define HTTP_STATUS_PRECOND_FAILED 412
   1080 #define HTTP_STATUS_REQUEST_TOO_LARGE 413
   1081 #define HTTP_STATUS_URI_TOO_LONG 414
   1082 #define HTTP_STATUS_UNSUPPORTED_MEDIA 415
   1083 #define HTTP_STATUS_RETRY_WITH 449
   1084 
   1085 #define HTTP_STATUS_SERVER_ERROR 500
   1086 #define HTTP_STATUS_NOT_SUPPORTED 501
   1087 #define HTTP_STATUS_BAD_GATEWAY 502
   1088 #define HTTP_STATUS_SERVICE_UNAVAIL 503
   1089 #define HTTP_STATUS_GATEWAY_TIMEOUT 504
   1090 #define HTTP_STATUS_VERSION_NOT_SUP 505
   1091 
   1092 #define HTTP_STATUS_FIRST HTTP_STATUS_CONTINUE
   1093 #define HTTP_STATUS_LAST HTTP_STATUS_VERSION_NOT_SUP
   1094 
   1095 #define HttpOpenRequest __MINGW_NAME_AW(HttpOpenRequest)
   1096 #define HttpAddRequestHeaders __MINGW_NAME_AW(HttpAddRequestHeaders)
   1097 
   1098   INTERNETAPI_(HINTERNET) HttpOpenRequestA(HINTERNET hConnect,LPCSTR lpszVerb,LPCSTR lpszObjectName,LPCSTR lpszVersion,LPCSTR lpszReferrer,LPCSTR *lplpszAcceptTypes,DWORD dwFlags,DWORD_PTR dwContext);
   1099   INTERNETAPI_(HINTERNET) HttpOpenRequestW(HINTERNET hConnect,LPCWSTR lpszVerb,LPCWSTR lpszObjectName,LPCWSTR lpszVersion,LPCWSTR lpszReferrer,LPCWSTR *lplpszAcceptTypes,DWORD dwFlags,DWORD_PTR dwContext);
   1100   BOOLAPI HttpAddRequestHeadersA(HINTERNET hRequest,LPCSTR lpszHeaders,DWORD dwHeadersLength,DWORD dwModifiers);
   1101   BOOLAPI HttpAddRequestHeadersW(HINTERNET hRequest,LPCWSTR lpszHeaders,DWORD dwHeadersLength,DWORD dwModifiers);
   1102 
   1103 #define HTTP_ADDREQ_INDEX_MASK 0x0000FFFF
   1104 #define HTTP_ADDREQ_FLAGS_MASK 0xFFFF0000
   1105 
   1106 #define HTTP_ADDREQ_FLAG_ADD_IF_NEW 0x10000000
   1107 #define HTTP_ADDREQ_FLAG_ADD 0x20000000
   1108 #define HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA 0x40000000
   1109 #define HTTP_ADDREQ_FLAG_COALESCE_WITH_SEMICOLON 0x01000000
   1110 #define HTTP_ADDREQ_FLAG_COALESCE HTTP_ADDREQ_FLAG_COALESCE_WITH_COMMA
   1111 #define HTTP_ADDREQ_FLAG_REPLACE 0x80000000
   1112 
   1113 #define HttpSendRequest __MINGW_NAME_AW(HttpSendRequest)
   1114 #define HttpSendRequestEx __MINGW_NAME_AW(HttpSendRequestEx)
   1115 
   1116   BOOLAPI HttpSendRequestA(HINTERNET hRequest,LPCSTR lpszHeaders,DWORD dwHeadersLength,LPVOID lpOptional,DWORD dwOptionalLength);
   1117   BOOLAPI HttpSendRequestW(HINTERNET hRequest,LPCWSTR lpszHeaders,DWORD dwHeadersLength,LPVOID lpOptional,DWORD dwOptionalLength);
   1118   INTERNETAPI_(WINBOOL) HttpSendRequestExA(HINTERNET hRequest,LPINTERNET_BUFFERSA lpBuffersIn,LPINTERNET_BUFFERSA lpBuffersOut,DWORD dwFlags,DWORD_PTR dwContext);
   1119   INTERNETAPI_(WINBOOL) HttpSendRequestExW(HINTERNET hRequest,LPINTERNET_BUFFERSW lpBuffersIn,LPINTERNET_BUFFERSW lpBuffersOut,DWORD dwFlags,DWORD_PTR dwContext);
   1120 
   1121 #define HSR_ASYNC WININET_API_FLAG_ASYNC
   1122 #define HSR_SYNC WININET_API_FLAG_SYNC
   1123 #define HSR_USE_CONTEXT WININET_API_FLAG_USE_CONTEXT
   1124 #define HSR_INITIATE 0x00000008
   1125 #define HSR_DOWNLOAD 0x00000010
   1126 #define HSR_CHUNKED 0x00000020
   1127 
   1128 #define HttpEndRequest __MINGW_NAME_AW(HttpEndRequest)
   1129 #define HttpQueryInfo __MINGW_NAME_AW(HttpQueryInfo)
   1130 
   1131   INTERNETAPI_(WINBOOL) HttpEndRequestA(HINTERNET hRequest,LPINTERNET_BUFFERSA lpBuffersOut,DWORD dwFlags,DWORD_PTR dwContext);
   1132   INTERNETAPI_(WINBOOL) HttpEndRequestW(HINTERNET hRequest,LPINTERNET_BUFFERSW lpBuffersOut,DWORD dwFlags,DWORD_PTR dwContext);
   1133   BOOLAPI HttpQueryInfoA(HINTERNET hRequest,DWORD dwInfoLevel,LPVOID lpBuffer,LPDWORD lpdwBufferLength,LPDWORD lpdwIndex);
   1134   BOOLAPI HttpQueryInfoW(HINTERNET hRequest,DWORD dwInfoLevel,LPVOID lpBuffer,LPDWORD lpdwBufferLength,LPDWORD lpdwIndex);
   1135 
   1136 #define INTERNET_COOKIE_IS_SECURE 0x01
   1137 #define INTERNET_COOKIE_IS_SESSION 0x02
   1138 
   1139 #define INTERNET_COOKIE_THIRD_PARTY 0x10
   1140 #define INTERNET_COOKIE_PROMPT_REQUIRED 0x20
   1141 #define INTERNET_COOKIE_EVALUATE_P3P 0x40
   1142 #define INTERNET_COOKIE_APPLY_P3P 0x80
   1143 
   1144 #define INTERNET_COOKIE_P3P_ENABLED 0x100
   1145 #define INTERNET_COOKIE_IS_RESTRICTED 0x200
   1146 #define INTERNET_COOKIE_IE6 0x400
   1147 #define INTERNET_COOKIE_IS_LEGACY 0x800
   1148 
   1149 #define InternetSetCookie __MINGW_NAME_AW(InternetSetCookie)
   1150 #define InternetGetCookie __MINGW_NAME_AW(InternetGetCookie)
   1151 #define InternetSetCookieEx __MINGW_NAME_AW(InternetSetCookieEx)
   1152 #define InternetGetCookieEx __MINGW_NAME_AW(InternetGetCookieEx)
   1153 #define InternetCheckConnection __MINGW_NAME_AW(InternetCheckConnection)
   1154 
   1155   BOOLAPI InternetSetCookieA(LPCSTR lpszUrl,LPCSTR lpszCookieName,LPCSTR lpszCookieData);
   1156   BOOLAPI InternetSetCookieW(LPCWSTR lpszUrl,LPCWSTR lpszCookieName,LPCWSTR lpszCookieData);
   1157   BOOLAPI InternetGetCookieA(LPCSTR lpszUrl,LPCSTR lpszCookieName,LPSTR lpszCookieData,LPDWORD lpdwSize);
   1158   BOOLAPI InternetGetCookieW(LPCWSTR lpszUrl,LPCWSTR lpszCookieName,LPWSTR lpszCookieData,LPDWORD lpdwSize);
   1159   INTERNETAPI_(DWORD) InternetSetCookieExA(LPCSTR lpszUrl,LPCSTR lpszCookieName,LPCSTR lpszCookieData,DWORD dwFlags,DWORD_PTR dwReserved);
   1160   INTERNETAPI_(DWORD) InternetSetCookieExW(LPCWSTR lpszUrl,LPCWSTR lpszCookieName,LPCWSTR lpszCookieData,DWORD dwFlags,DWORD_PTR dwReserved);
   1161   BOOLAPI InternetGetCookieExA(LPCSTR lpszUrl,LPCSTR lpszCookieName,LPSTR lpszCookieData,LPDWORD lpdwSize,DWORD dwFlags,LPVOID lpReserved);
   1162   BOOLAPI InternetGetCookieExW(LPCWSTR lpszUrl,LPCWSTR lpszCookieName,LPWSTR lpszCookieData,LPDWORD lpdwSize,DWORD dwFlags,LPVOID lpReserved);
   1163   INTERNETAPI_(DWORD) InternetAttemptConnect(DWORD dwReserved);
   1164   BOOLAPI InternetCheckConnectionA(LPCSTR lpszUrl,DWORD dwFlags,DWORD dwReserved);
   1165   BOOLAPI InternetCheckConnectionW(LPCWSTR lpszUrl,DWORD dwFlags,DWORD dwReserved);
   1166 
   1167 #define FLAG_ICC_FORCE_CONNECTION 0x00000001
   1168 
   1169 #define FLAGS_ERROR_UI_FILTER_FOR_ERRORS 0x01
   1170 #define FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS 0x02
   1171 #define FLAGS_ERROR_UI_FLAGS_GENERATE_DATA 0x04
   1172 #define FLAGS_ERROR_UI_FLAGS_NO_UI 0x08
   1173 #define FLAGS_ERROR_UI_SERIALIZE_DIALOGS 0x10
   1174 
   1175   DWORD InternetAuthNotifyCallback(DWORD_PTR dwContext,DWORD dwReturn,LPVOID lpReserved);
   1176   typedef DWORD (CALLBACK *PFN_AUTH_NOTIFY) (DWORD_PTR,DWORD,LPVOID);
   1177 
   1178   typedef struct {
   1179     DWORD cbStruct;
   1180     DWORD dwOptions;
   1181     PFN_AUTH_NOTIFY pfnNotify;
   1182     DWORD_PTR dwContext;
   1183   } INTERNET_AUTH_NOTIFY_DATA;
   1184 
   1185 #if defined(UNICODE)
   1186 #define InternetConfirmZoneCrossing InternetConfirmZoneCrossingW
   1187 #else
   1188   INTERNETAPI_(DWORD) InternetConfirmZoneCrossing(HWND hWnd,LPSTR szUrlPrev,LPSTR szUrlNew,WINBOOL bPost);
   1189 #endif
   1190 
   1191   INTERNETAPI_(WINBOOL) ResumeSuspendedDownload(HINTERNET hRequest,DWORD dwResultCode);
   1192   INTERNETAPI_(DWORD) InternetErrorDlg(HWND hWnd,HINTERNET hRequest,DWORD dwError,DWORD dwFlags,LPVOID *lppvData);
   1193   INTERNETAPI_(DWORD) InternetConfirmZoneCrossingA(HWND hWnd,LPSTR szUrlPrev,LPSTR szUrlNew,WINBOOL bPost);
   1194   INTERNETAPI_(DWORD) InternetConfirmZoneCrossingW(HWND hWnd,LPWSTR szUrlPrev,LPWSTR szUrlNew,WINBOOL bPost);
   1195 
   1196 #define INTERNET_ERROR_BASE 12000
   1197 
   1198 #define ERROR_INTERNET_OUT_OF_HANDLES (INTERNET_ERROR_BASE + 1)
   1199 #define ERROR_INTERNET_TIMEOUT (INTERNET_ERROR_BASE + 2)
   1200 #define ERROR_INTERNET_EXTENDED_ERROR (INTERNET_ERROR_BASE + 3)
   1201 #define ERROR_INTERNET_INTERNAL_ERROR (INTERNET_ERROR_BASE + 4)
   1202 #define ERROR_INTERNET_INVALID_URL (INTERNET_ERROR_BASE + 5)
   1203 #define ERROR_INTERNET_UNRECOGNIZED_SCHEME (INTERNET_ERROR_BASE + 6)
   1204 #define ERROR_INTERNET_NAME_NOT_RESOLVED (INTERNET_ERROR_BASE + 7)
   1205 #define ERROR_INTERNET_PROTOCOL_NOT_FOUND (INTERNET_ERROR_BASE + 8)
   1206 #define ERROR_INTERNET_INVALID_OPTION (INTERNET_ERROR_BASE + 9)
   1207 #define ERROR_INTERNET_BAD_OPTION_LENGTH (INTERNET_ERROR_BASE + 10)
   1208 #define ERROR_INTERNET_OPTION_NOT_SETTABLE (INTERNET_ERROR_BASE + 11)
   1209 #define ERROR_INTERNET_SHUTDOWN (INTERNET_ERROR_BASE + 12)
   1210 #define ERROR_INTERNET_INCORRECT_USER_NAME (INTERNET_ERROR_BASE + 13)
   1211 #define ERROR_INTERNET_INCORRECT_PASSWORD (INTERNET_ERROR_BASE + 14)
   1212 #define ERROR_INTERNET_LOGIN_FAILURE (INTERNET_ERROR_BASE + 15)
   1213 #define ERROR_INTERNET_INVALID_OPERATION (INTERNET_ERROR_BASE + 16)
   1214 #define ERROR_INTERNET_OPERATION_CANCELLED (INTERNET_ERROR_BASE + 17)
   1215 #define ERROR_INTERNET_INCORRECT_HANDLE_TYPE (INTERNET_ERROR_BASE + 18)
   1216 #define ERROR_INTERNET_INCORRECT_HANDLE_STATE (INTERNET_ERROR_BASE + 19)
   1217 #define ERROR_INTERNET_NOT_PROXY_REQUEST (INTERNET_ERROR_BASE + 20)
   1218 #define ERROR_INTERNET_REGISTRY_VALUE_NOT_FOUND (INTERNET_ERROR_BASE + 21)
   1219 #define ERROR_INTERNET_BAD_REGISTRY_PARAMETER (INTERNET_ERROR_BASE + 22)
   1220 #define ERROR_INTERNET_NO_DIRECT_ACCESS (INTERNET_ERROR_BASE + 23)
   1221 #define ERROR_INTERNET_NO_CONTEXT (INTERNET_ERROR_BASE + 24)
   1222 #define ERROR_INTERNET_NO_CALLBACK (INTERNET_ERROR_BASE + 25)
   1223 #define ERROR_INTERNET_REQUEST_PENDING (INTERNET_ERROR_BASE + 26)
   1224 #define ERROR_INTERNET_INCORRECT_FORMAT (INTERNET_ERROR_BASE + 27)
   1225 #define ERROR_INTERNET_ITEM_NOT_FOUND (INTERNET_ERROR_BASE + 28)
   1226 #define ERROR_INTERNET_CANNOT_CONNECT (INTERNET_ERROR_BASE + 29)
   1227 #define ERROR_INTERNET_CONNECTION_ABORTED (INTERNET_ERROR_BASE + 30)
   1228 #define ERROR_INTERNET_CONNECTION_RESET (INTERNET_ERROR_BASE + 31)
   1229 #define ERROR_INTERNET_FORCE_RETRY (INTERNET_ERROR_BASE + 32)
   1230 #define ERROR_INTERNET_INVALID_PROXY_REQUEST (INTERNET_ERROR_BASE + 33)
   1231 #define ERROR_INTERNET_NEED_UI (INTERNET_ERROR_BASE + 34)
   1232 #define ERROR_INTERNET_HANDLE_EXISTS (INTERNET_ERROR_BASE + 36)
   1233 #define ERROR_INTERNET_SEC_CERT_DATE_INVALID (INTERNET_ERROR_BASE + 37)
   1234 #define ERROR_INTERNET_SEC_CERT_CN_INVALID (INTERNET_ERROR_BASE + 38)
   1235 #define ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR (INTERNET_ERROR_BASE + 39)
   1236 #define ERROR_INTERNET_HTTPS_TO_HTTP_ON_REDIR (INTERNET_ERROR_BASE + 40)
   1237 #define ERROR_INTERNET_MIXED_SECURITY (INTERNET_ERROR_BASE + 41)
   1238 #define ERROR_INTERNET_CHG_POST_IS_NON_SECURE (INTERNET_ERROR_BASE + 42)
   1239 #define ERROR_INTERNET_POST_IS_NON_SECURE (INTERNET_ERROR_BASE + 43)
   1240 #define ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED (INTERNET_ERROR_BASE + 44)
   1241 #define ERROR_INTERNET_INVALID_CA (INTERNET_ERROR_BASE + 45)
   1242 #define ERROR_INTERNET_CLIENT_AUTH_NOT_SETUP (INTERNET_ERROR_BASE + 46)
   1243 #define ERROR_INTERNET_ASYNC_THREAD_FAILED (INTERNET_ERROR_BASE + 47)
   1244 #define ERROR_INTERNET_REDIRECT_SCHEME_CHANGE (INTERNET_ERROR_BASE + 48)
   1245 #define ERROR_INTERNET_DIALOG_PENDING (INTERNET_ERROR_BASE + 49)
   1246 #define ERROR_INTERNET_RETRY_DIALOG (INTERNET_ERROR_BASE + 50)
   1247 #define ERROR_INTERNET_HTTPS_HTTP_SUBMIT_REDIR (INTERNET_ERROR_BASE + 52)
   1248 #define ERROR_INTERNET_INSERT_CDROM (INTERNET_ERROR_BASE + 53)
   1249 #define ERROR_INTERNET_FORTEZZA_LOGIN_NEEDED (INTERNET_ERROR_BASE + 54)
   1250 #define ERROR_INTERNET_SEC_CERT_ERRORS (INTERNET_ERROR_BASE + 55)
   1251 #define ERROR_INTERNET_SEC_CERT_NO_REV (INTERNET_ERROR_BASE + 56)
   1252 #define ERROR_INTERNET_SEC_CERT_REV_FAILED (INTERNET_ERROR_BASE + 57)
   1253 #define ERROR_FTP_TRANSFER_IN_PROGRESS (INTERNET_ERROR_BASE + 110)
   1254 #define ERROR_FTP_DROPPED (INTERNET_ERROR_BASE + 111)
   1255 #define ERROR_FTP_NO_PASSIVE_MODE (INTERNET_ERROR_BASE + 112)
   1256 #define ERROR_GOPHER_PROTOCOL_ERROR (INTERNET_ERROR_BASE + 130)
   1257 #define ERROR_GOPHER_NOT_FILE (INTERNET_ERROR_BASE + 131)
   1258 #define ERROR_GOPHER_DATA_ERROR (INTERNET_ERROR_BASE + 132)
   1259 #define ERROR_GOPHER_END_OF_DATA (INTERNET_ERROR_BASE + 133)
   1260 #define ERROR_GOPHER_INVALID_LOCATOR (INTERNET_ERROR_BASE + 134)
   1261 #define ERROR_GOPHER_INCORRECT_LOCATOR_TYPE (INTERNET_ERROR_BASE + 135)
   1262 #define ERROR_GOPHER_NOT_GOPHER_PLUS (INTERNET_ERROR_BASE + 136)
   1263 #define ERROR_GOPHER_ATTRIBUTE_NOT_FOUND (INTERNET_ERROR_BASE + 137)
   1264 #define ERROR_GOPHER_UNKNOWN_LOCATOR (INTERNET_ERROR_BASE + 138)
   1265 #define ERROR_HTTP_HEADER_NOT_FOUND (INTERNET_ERROR_BASE + 150)
   1266 #define ERROR_HTTP_DOWNLEVEL_SERVER (INTERNET_ERROR_BASE + 151)
   1267 #define ERROR_HTTP_INVALID_SERVER_RESPONSE (INTERNET_ERROR_BASE + 152)
   1268 #define ERROR_HTTP_INVALID_HEADER (INTERNET_ERROR_BASE + 153)
   1269 #define ERROR_HTTP_INVALID_QUERY_REQUEST (INTERNET_ERROR_BASE + 154)
   1270 #define ERROR_HTTP_HEADER_ALREADY_EXISTS (INTERNET_ERROR_BASE + 155)
   1271 #define ERROR_HTTP_REDIRECT_FAILED (INTERNET_ERROR_BASE + 156)
   1272 #define ERROR_HTTP_NOT_REDIRECTED (INTERNET_ERROR_BASE + 160)
   1273 #define ERROR_HTTP_COOKIE_NEEDS_CONFIRMATION (INTERNET_ERROR_BASE + 161)
   1274 #define ERROR_HTTP_COOKIE_DECLINED (INTERNET_ERROR_BASE + 162)
   1275 #define ERROR_HTTP_REDIRECT_NEEDS_CONFIRMATION (INTERNET_ERROR_BASE + 168)
   1276 #define ERROR_INTERNET_SECURITY_CHANNEL_ERROR (INTERNET_ERROR_BASE + 157)
   1277 #define ERROR_INTERNET_UNABLE_TO_CACHE_FILE (INTERNET_ERROR_BASE + 158)
   1278 #define ERROR_INTERNET_TCPIP_NOT_INSTALLED (INTERNET_ERROR_BASE + 159)
   1279 #define ERROR_INTERNET_DISCONNECTED (INTERNET_ERROR_BASE + 163)
   1280 #define ERROR_INTERNET_SERVER_UNREACHABLE (INTERNET_ERROR_BASE + 164)
   1281 #define ERROR_INTERNET_PROXY_SERVER_UNREACHABLE (INTERNET_ERROR_BASE + 165)
   1282 #define ERROR_INTERNET_BAD_AUTO_PROXY_SCRIPT (INTERNET_ERROR_BASE + 166)
   1283 #define ERROR_INTERNET_UNABLE_TO_DOWNLOAD_SCRIPT (INTERNET_ERROR_BASE + 167)
   1284 #define ERROR_INTERNET_SEC_INVALID_CERT (INTERNET_ERROR_BASE + 169)
   1285 #define ERROR_INTERNET_SEC_CERT_REVOKED (INTERNET_ERROR_BASE + 170)
   1286 #define ERROR_INTERNET_FAILED_DUETOSECURITYCHECK (INTERNET_ERROR_BASE + 171)
   1287 #define ERROR_INTERNET_NOT_INITIALIZED (INTERNET_ERROR_BASE + 172)
   1288 #define ERROR_INTERNET_NEED_MSN_SSPI_PKG (INTERNET_ERROR_BASE + 173)
   1289 #define ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY (INTERNET_ERROR_BASE + 174)
   1290 
   1291 #define INTERNET_ERROR_LAST ERROR_INTERNET_LOGIN_FAILURE_DISPLAY_ENTITY_BODY
   1292 
   1293 #define NORMAL_CACHE_ENTRY 0x00000001
   1294 #define STICKY_CACHE_ENTRY 0x00000004
   1295 #define EDITED_CACHE_ENTRY 0x00000008
   1296 #define TRACK_OFFLINE_CACHE_ENTRY 0x00000010
   1297 #define TRACK_ONLINE_CACHE_ENTRY 0x00000020
   1298 #define SPARSE_CACHE_ENTRY 0x00010000
   1299 #define COOKIE_CACHE_ENTRY 0x00100000
   1300 #define URLHISTORY_CACHE_ENTRY 0x00200000
   1301 
   1302 #define URLCACHE_FIND_DEFAULT_FILTER NORMAL_CACHE_ENTRY | COOKIE_CACHE_ENTRY | URLHISTORY_CACHE_ENTRY | TRACK_OFFLINE_CACHE_ENTRY | TRACK_ONLINE_CACHE_ENTRY | STICKY_CACHE_ENTRY
   1303 
   1304   typedef struct _INTERNET_CACHE_ENTRY_INFOA {
   1305     DWORD dwStructSize;
   1306     LPSTR lpszSourceUrlName;
   1307     LPSTR lpszLocalFileName;
   1308     DWORD CacheEntryType;
   1309     DWORD dwUseCount;
   1310     DWORD dwHitRate;
   1311     DWORD dwSizeLow;
   1312     DWORD dwSizeHigh;
   1313     FILETIME LastModifiedTime;
   1314     FILETIME ExpireTime;
   1315     FILETIME LastAccessTime;
   1316     FILETIME LastSyncTime;
   1317     LPSTR lpHeaderInfo;
   1318     DWORD dwHeaderInfoSize;
   1319     LPSTR lpszFileExtension;
   1320     __C89_NAMELESS union {
   1321       DWORD dwReserved;
   1322       DWORD dwExemptDelta;
   1323     };
   1324   } INTERNET_CACHE_ENTRY_INFOA,*LPINTERNET_CACHE_ENTRY_INFOA;
   1325 
   1326   typedef struct _INTERNET_CACHE_ENTRY_INFOW {
   1327     DWORD dwStructSize;
   1328     LPWSTR lpszSourceUrlName;
   1329     LPWSTR lpszLocalFileName;
   1330     DWORD CacheEntryType;
   1331     DWORD dwUseCount;
   1332     DWORD dwHitRate;
   1333     DWORD dwSizeLow;
   1334     DWORD dwSizeHigh;
   1335     FILETIME LastModifiedTime;
   1336     FILETIME ExpireTime;
   1337     FILETIME LastAccessTime;
   1338     FILETIME LastSyncTime;
   1339     LPWSTR lpHeaderInfo;
   1340     DWORD dwHeaderInfoSize;
   1341     LPWSTR lpszFileExtension;
   1342     __C89_NAMELESS union {
   1343       DWORD dwReserved;
   1344       DWORD dwExemptDelta;
   1345     };
   1346   } INTERNET_CACHE_ENTRY_INFOW,*LPINTERNET_CACHE_ENTRY_INFOW;
   1347 
   1348   __MINGW_TYPEDEF_AW(INTERNET_CACHE_ENTRY_INFO)
   1349   __MINGW_TYPEDEF_AW(LPINTERNET_CACHE_ENTRY_INFO)
   1350 
   1351   typedef struct _INTERNET_CACHE_TIMESTAMPS {
   1352     FILETIME ftExpires;
   1353     FILETIME ftLastModified;
   1354   } INTERNET_CACHE_TIMESTAMPS,*LPINTERNET_CACHE_TIMESTAMPS;
   1355 
   1356   typedef LONGLONG GROUPID;
   1357 
   1358 #define CACHEGROUP_ATTRIBUTE_GET_ALL 0xffffffff
   1359 #define CACHEGROUP_ATTRIBUTE_BASIC 0x00000001
   1360 #define CACHEGROUP_ATTRIBUTE_FLAG 0x00000002
   1361 #define CACHEGROUP_ATTRIBUTE_TYPE 0x00000004
   1362 #define CACHEGROUP_ATTRIBUTE_QUOTA 0x00000008
   1363 #define CACHEGROUP_ATTRIBUTE_GROUPNAME 0x00000010
   1364 #define CACHEGROUP_ATTRIBUTE_STORAGE 0x00000020
   1365 
   1366 #define CACHEGROUP_FLAG_NONPURGEABLE 0x00000001
   1367 #define CACHEGROUP_FLAG_GIDONLY 0x00000004
   1368 
   1369 #define CACHEGROUP_FLAG_FLUSHURL_ONDELETE 0x00000002
   1370 
   1371 #define CACHEGROUP_SEARCH_ALL 0x00000000
   1372 #define CACHEGROUP_SEARCH_BYURL 0x00000001
   1373 
   1374 #define CACHEGROUP_TYPE_INVALID 0x00000001
   1375 
   1376 #define CACHEGROUP_READWRITE_MASK CACHEGROUP_ATTRIBUTE_TYPE | CACHEGROUP_ATTRIBUTE_QUOTA | CACHEGROUP_ATTRIBUTE_GROUPNAME | CACHEGROUP_ATTRIBUTE_STORAGE
   1377 
   1378 #define GROUPNAME_MAX_LENGTH 120
   1379 #define GROUP_OWNER_STORAGE_SIZE 4
   1380   typedef struct _INTERNET_CACHE_GROUP_INFOA {
   1381     DWORD dwGroupSize;
   1382     DWORD dwGroupFlags;
   1383     DWORD dwGroupType;
   1384     DWORD dwDiskUsage;
   1385     DWORD dwDiskQuota;
   1386     DWORD dwOwnerStorage[GROUP_OWNER_STORAGE_SIZE];
   1387     CHAR szGroupName[GROUPNAME_MAX_LENGTH];
   1388   } INTERNET_CACHE_GROUP_INFOA,*LPINTERNET_CACHE_GROUP_INFOA;
   1389 
   1390   typedef struct _INTERNET_CACHE_GROUP_INFOW {
   1391     DWORD dwGroupSize;
   1392     DWORD dwGroupFlags;
   1393     DWORD dwGroupType;
   1394     DWORD dwDiskUsage;
   1395     DWORD dwDiskQuota;
   1396     DWORD dwOwnerStorage[GROUP_OWNER_STORAGE_SIZE];
   1397     WCHAR szGroupName[GROUPNAME_MAX_LENGTH];
   1398   } INTERNET_CACHE_GROUP_INFOW,*LPINTERNET_CACHE_GROUP_INFOW;
   1399 
   1400   __MINGW_TYPEDEF_AW(INTERNET_CACHE_GROUP_INFO)
   1401   __MINGW_TYPEDEF_AW(LPINTERNET_CACHE_GROUP_INFO)
   1402 
   1403 #define CreateUrlCacheEntry __MINGW_NAME_AW(CreateUrlCacheEntry)
   1404 #define CommitUrlCacheEntry __MINGW_NAME_AW(CommitUrlCacheEntry)
   1405 #define RetrieveUrlCacheEntryFile __MINGW_NAME_AW(RetrieveUrlCacheEntryFile)
   1406 #define UnlockUrlCacheEntryFile __MINGW_NAME_AW(UnlockUrlCacheEntryFile)
   1407 #define RetrieveUrlCacheEntryStream __MINGW_NAME_AW(RetrieveUrlCacheEntryStream)
   1408 #define GetUrlCacheEntryInfo __MINGW_NAME_AW(GetUrlCacheEntryInfo)
   1409 #define GetUrlCacheGroupAttribute __MINGW_NAME_AW(GetUrlCacheGroupAttribute)
   1410 #define SetUrlCacheGroupAttribute __MINGW_NAME_AW(SetUrlCacheGroupAttribute)
   1411 #define GetUrlCacheEntryInfoEx __MINGW_NAME_AW(GetUrlCacheEntryInfoEx)
   1412 
   1413   BOOLAPI CreateUrlCacheEntryA(LPCSTR lpszUrlName,DWORD dwExpectedFileSize,LPCSTR lpszFileExtension,LPSTR lpszFileName,DWORD dwReserved);
   1414   BOOLAPI CreateUrlCacheEntryW(LPCWSTR lpszUrlName,DWORD dwExpectedFileSize,LPCWSTR lpszFileExtension,LPWSTR lpszFileName,DWORD dwReserved);
   1415 #ifndef USE_FIXED_COMMIT_URL_CACHE_ENTRY
   1416   BOOLAPI CommitUrlCacheEntryA(LPCSTR lpszUrlName,LPCSTR lpszLocalFileName,FILETIME ExpireTime,FILETIME LastModifiedTime,DWORD CacheEntryType,LPBYTE lpHeaderInfo,DWORD dwHeaderSize,LPCSTR lpszFileExtension,LPCSTR lpszOriginalUrl);
   1417   BOOLAPI CommitUrlCacheEntryW(LPCWSTR lpszUrlName,LPCWSTR lpszLocalFileName,FILETIME ExpireTime,FILETIME LastModifiedTime,DWORD CacheEntryType,LPWSTR lpszHeaderInfo,DWORD dwHeaders,LPCWSTR lpszFileExtension,LPCWSTR lpszOriginalUrl);
   1418 #else
   1419   CommitUrlCacheEntryA(LPCSTR lpszUrlName,LPCSTR lpszLocalFileName,FILETIME ExpireTime,FILETIME LastModifiedTime,DWORD CacheEntryType,LPCSTR lpHeaderInfo,DWORD dwHeaderSize,LPCSTR lpszFileExtension,LPCSTR lpszOriginalUrl);
   1420   CommitUrlCacheEntryW(LPCWSTR lpszUrlName,LPCWSTR lpszLocalFileName,FILETIME ExpireTime,FILETIME LastModifiedTime,DWORD CacheEntryType,LPCWSTR lpHeaderInfo,DWORD dwHeaderSize,LPCWSTR lpszFileExtension,LPCWSTR lpszOriginalUrl);
   1421 #endif
   1422   BOOLAPI RetrieveUrlCacheEntryFileA(LPCSTR lpszUrlName,LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,LPDWORD lpcbCacheEntryInfo,DWORD dwReserved);
   1423   BOOLAPI RetrieveUrlCacheEntryFileW(LPCWSTR lpszUrlName,LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,LPDWORD lpcbCacheEntryInfo,DWORD dwReserved);
   1424   BOOLAPI UnlockUrlCacheEntryFileA(LPCSTR lpszUrlName,DWORD dwReserved);
   1425   BOOLAPI UnlockUrlCacheEntryFileW(LPCWSTR lpszUrlName,DWORD dwReserved);
   1426   INTERNETAPI_(HANDLE) RetrieveUrlCacheEntryStreamA(LPCSTR lpszUrlName,LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,LPDWORD lpcbCacheEntryInfo,WINBOOL fRandomRead,DWORD dwReserved);
   1427   INTERNETAPI_(HANDLE) RetrieveUrlCacheEntryStreamW(LPCWSTR lpszUrlName,LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,LPDWORD lpcbCacheEntryInfo,WINBOOL fRandomRead,DWORD dwReserved);
   1428   BOOLAPI ReadUrlCacheEntryStream(HANDLE hUrlCacheStream,DWORD dwLocation,LPVOID lpBuffer,LPDWORD lpdwLen,DWORD Reserved);
   1429   BOOLAPI UnlockUrlCacheEntryStream(HANDLE hUrlCacheStream,DWORD Reserved);
   1430   URLCACHEAPI_(WINBOOL) GetUrlCacheEntryInfoA(LPCSTR lpszUrlName,LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,LPDWORD lpcbCacheEntryInfo);
   1431   URLCACHEAPI_(WINBOOL) GetUrlCacheEntryInfoW(LPCWSTR lpszUrlName,LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,LPDWORD lpcbCacheEntryInfo);
   1432   URLCACHEAPI_(HANDLE) FindFirstUrlCacheGroup(DWORD dwFlags,DWORD dwFilter,LPVOID lpSearchCondition,DWORD dwSearchCondition,GROUPID *lpGroupId,LPVOID lpReserved);
   1433   URLCACHEAPI_(WINBOOL) FindNextUrlCacheGroup(HANDLE hFind,GROUPID *lpGroupId,LPVOID lpReserved);
   1434   URLCACHEAPI_(WINBOOL) GetUrlCacheGroupAttributeA(GROUPID gid,DWORD dwFlags,DWORD dwAttributes,LPINTERNET_CACHE_GROUP_INFOA lpGroupInfo,LPDWORD lpdwGroupInfo,LPVOID lpReserved);
   1435   URLCACHEAPI_(WINBOOL) GetUrlCacheGroupAttributeW(GROUPID gid,DWORD dwFlags,DWORD dwAttributes,LPINTERNET_CACHE_GROUP_INFOW lpGroupInfo,LPDWORD lpdwGroupInfo,LPVOID lpReserved);
   1436   URLCACHEAPI_(WINBOOL) SetUrlCacheGroupAttributeA(GROUPID gid,DWORD dwFlags,DWORD dwAttributes,LPINTERNET_CACHE_GROUP_INFOA lpGroupInfo,LPVOID lpReserved);
   1437   URLCACHEAPI_(WINBOOL) SetUrlCacheGroupAttributeW(GROUPID gid,DWORD dwFlags,DWORD dwAttributes,LPINTERNET_CACHE_GROUP_INFOW lpGroupInfo,LPVOID lpReserved);
   1438   INTERNETAPI_(GROUPID) CreateUrlCacheGroup(DWORD dwFlags,LPVOID lpReserved);
   1439   BOOLAPI DeleteUrlCacheGroup(GROUPID GroupId,DWORD dwFlags,LPVOID lpReserved);
   1440   BOOLAPI GetUrlCacheEntryInfoExA(LPCSTR lpszUrl,LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,LPDWORD lpcbCacheEntryInfo,LPSTR lpszRedirectUrl,LPDWORD lpcbRedirectUrl,LPVOID lpReserved,DWORD dwFlags);
   1441   BOOLAPI GetUrlCacheEntryInfoExW(LPCWSTR lpszUrl,LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,LPDWORD lpcbCacheEntryInfo,LPWSTR lpszRedirectUrl,LPDWORD lpcbRedirectUrl,LPVOID lpReserved,DWORD dwFlags);
   1442 
   1443 #define CACHE_ENTRY_ATTRIBUTE_FC 0x00000004
   1444 #define CACHE_ENTRY_HITRATE_FC 0x00000010
   1445 #define CACHE_ENTRY_MODTIME_FC 0x00000040
   1446 #define CACHE_ENTRY_EXPTIME_FC 0x00000080
   1447 #define CACHE_ENTRY_ACCTIME_FC 0x00000100
   1448 #define CACHE_ENTRY_SYNCTIME_FC 0x00000200
   1449 #define CACHE_ENTRY_HEADERINFO_FC 0x00000400
   1450 #define CACHE_ENTRY_EXEMPT_DELTA_FC 0x00000800
   1451 
   1452 #define SetUrlCacheEntryInfo __MINGW_NAME_AW(SetUrlCacheEntryInfo)
   1453 #define FindFirstUrlCacheEntryEx __MINGW_NAME_AW(FindFirstUrlCacheEntryEx)
   1454 #define FindNextUrlCacheEntryEx __MINGW_NAME_AW(FindNextUrlCacheEntryEx)
   1455 #define FindFirstUrlCacheEntry __MINGW_NAME_AW(FindFirstUrlCacheEntry)
   1456 #define FindNextUrlCacheEntry __MINGW_NAME_AW(FindNextUrlCacheEntry)
   1457 
   1458 #if defined(UNICODE)
   1459 #define InternetDial InternetDialW
   1460 #define InternetGoOnline InternetGoOnlineW
   1461 #define DeleteUrlCacheEntry DeleteUrlCacheEntryW
   1462 #define SetUrlCacheEntryGroup SetUrlCacheEntryGroupW
   1463 #else
   1464   BOOLAPI SetUrlCacheEntryGroup(LPCSTR lpszUrlName,DWORD dwFlags,GROUPID GroupId,LPBYTE pbGroupAttributes,DWORD cbGroupAttributes,LPVOID lpReserved);
   1465   BOOLAPI DeleteUrlCacheEntry(LPCSTR lpszUrlName);
   1466   INTERNETAPI_(DWORD) InternetDial(HWND hwndParent,LPSTR lpszConnectoid,DWORD dwFlags,LPDWORD lpdwConnection,DWORD dwReserved);
   1467   INTERNETAPI_(WINBOOL) InternetGoOnline(LPSTR lpszURL,HWND hwndParent,DWORD dwFlags);
   1468 #endif
   1469 
   1470   BOOLAPI SetUrlCacheEntryInfoA(LPCSTR lpszUrlName,LPINTERNET_CACHE_ENTRY_INFOA lpCacheEntryInfo,DWORD dwFieldControl);
   1471   BOOLAPI SetUrlCacheEntryInfoW(LPCWSTR lpszUrlName,LPINTERNET_CACHE_ENTRY_INFOW lpCacheEntryInfo,DWORD dwFieldControl);
   1472   INTERNETAPI_(GROUPID) CreateUrlCacheGroup(DWORD dwFlags,LPVOID lpReserved);
   1473   BOOLAPI DeleteUrlCacheGroup(GROUPID GroupId,DWORD dwFlags,LPVOID lpReserved);
   1474 
   1475 #define INTERNET_CACHE_GROUP_ADD 0
   1476 #define INTERNET_CACHE_GROUP_REMOVE 1
   1477 
   1478   BOOLAPI SetUrlCacheEntryGroupA(LPCSTR lpszUrlName,DWORD dwFlags,GROUPID GroupId,LPBYTE pbGroupAttributes,DWORD cbGroupAttributes,LPVOID lpReserved);
   1479   BOOLAPI SetUrlCacheEntryGroupW(LPCWSTR lpszUrlName,DWORD dwFlags,GROUPID GroupId,LPBYTE pbGroupAttributes,DWORD cbGroupAttributes,LPVOID lpReserved);
   1480   INTERNETAPI_(HANDLE) FindFirstUrlCacheEntryExA(LPCSTR lpszUrlSearchPattern,DWORD dwFlags,DWORD dwFilter,GROUPID GroupId,LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,LPDWORD lpcbEntryInfo,LPVOID lpGroupAttributes,LPDWORD lpcbGroupAttributes,LPVOID lpReserved);
   1481   INTERNETAPI_(HANDLE) FindFirstUrlCacheEntryExW(LPCWSTR lpszUrlSearchPattern,DWORD dwFlags,DWORD dwFilter,GROUPID GroupId,LPINTERNET_CACHE_ENTRY_INFOW lpFirstCacheEntryInfo,LPDWORD lpcbEntryInfo,LPVOID lpGroupAttributes,LPDWORD lpcbGroupAttributes,LPVOID lpReserved);
   1482   BOOLAPI FindNextUrlCacheEntryExA(HANDLE hEnumHandle,LPINTERNET_CACHE_ENTRY_INFOA lpNextCacheEntryInfo,LPDWORD lpcbEntryInfo,LPVOID lpGroupAttributes,LPDWORD lpcbGroupAttributes,LPVOID lpReserved);
   1483   BOOLAPI FindNextUrlCacheEntryExW(HANDLE hEnumHandle,LPINTERNET_CACHE_ENTRY_INFOW lpNextCacheEntryInfo,LPDWORD lpcbEntryInfo,LPVOID lpGroupAttributes,LPDWORD lpcbGroupAttributes,LPVOID lpReserved);
   1484   INTERNETAPI_(HANDLE) FindFirstUrlCacheEntryA(LPCSTR lpszUrlSearchPattern,LPINTERNET_CACHE_ENTRY_INFOA lpFirstCacheEntryInfo,LPDWORD lpcbCacheEntryInfo);
   1485   INTERNETAPI_(HANDLE) FindFirstUrlCacheEntryW(LPCWSTR lpszUrlSearchPattern,LPINTERNET_CACHE_ENTRY_INFOW lpFirstCacheEntryInfo,LPDWORD lpcbCacheEntryInfo);
   1486   BOOLAPI FindNextUrlCacheEntryA(HANDLE hEnumHandle,LPINTERNET_CACHE_ENTRY_INFOA lpNextCacheEntryInfo,LPDWORD lpcbCacheEntryInfo);
   1487   BOOLAPI FindNextUrlCacheEntryW(HANDLE hEnumHandle,LPINTERNET_CACHE_ENTRY_INFOW lpNextCacheEntryInfo,LPDWORD lpcbCacheEntryInfo);
   1488   BOOLAPI FindCloseUrlCache(HANDLE hEnumHandle);
   1489   BOOLAPI DeleteUrlCacheEntryA(LPCSTR lpszUrlName);
   1490   BOOLAPI DeleteUrlCacheEntryW(LPCWSTR lpszUrlName);
   1491   INTERNETAPI_(DWORD) InternetDialA(HWND hwndParent,LPSTR lpszConnectoid,DWORD dwFlags,DWORD_PTR *lpdwConnection,DWORD dwReserved);
   1492   INTERNETAPI_(DWORD) InternetDialW(HWND hwndParent,LPWSTR lpszConnectoid,DWORD dwFlags,DWORD_PTR *lpdwConnection,DWORD dwReserved);
   1493 
   1494 #define INTERNET_DIAL_FORCE_PROMPT 0x2000
   1495 #define INTERNET_DIAL_SHOW_OFFLINE 0x4000
   1496 #define INTERNET_DIAL_UNATTENDED 0x8000
   1497 
   1498   INTERNETAPI_(DWORD) InternetHangUp(DWORD_PTR dwConnection,DWORD dwReserved);
   1499 
   1500 #define INTERENT_GOONLINE_REFRESH 0x00000001
   1501 #define INTERENT_GOONLINE_MASK 0x00000001
   1502 
   1503   INTERNETAPI_(WINBOOL) InternetGoOnlineA(LPSTR lpszURL,HWND hwndParent,DWORD dwFlags);
   1504   INTERNETAPI_(WINBOOL) InternetGoOnlineW(LPWSTR lpszURL,HWND hwndParent,DWORD dwFlags);
   1505 
   1506   INTERNETAPI_(WINBOOL) InternetAutodial(DWORD dwFlags,HWND hwndParent);
   1507 
   1508 #define INTERNET_AUTODIAL_FORCE_ONLINE 1
   1509 #define INTERNET_AUTODIAL_FORCE_UNATTENDED 2
   1510 #define INTERNET_AUTODIAL_FAILIFSECURITYCHECK 4
   1511 #define INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT 8
   1512 
   1513 #define INTERNET_AUTODIAL_FLAGS_MASK (INTERNET_AUTODIAL_FORCE_ONLINE | INTERNET_AUTODIAL_FORCE_UNATTENDED | INTERNET_AUTODIAL_FAILIFSECURITYCHECK | INTERNET_AUTODIAL_OVERRIDE_NET_PRESENT)
   1514 
   1515   INTERNETAPI_(WINBOOL) InternetAutodialHangup(DWORD dwReserved);
   1516   INTERNETAPI_(WINBOOL) InternetGetConnectedState(LPDWORD lpdwFlags,DWORD dwReserved);
   1517   INTERNETAPI_(WINBOOL) InternetGetConnectedStateExA(LPDWORD lpdwFlags,LPSTR lpszConnectionName,DWORD dwBufLen,DWORD dwReserved);
   1518   INTERNETAPI_(WINBOOL) InternetGetConnectedStateExW(LPDWORD lpdwFlags,LPWSTR lpszConnectionName,DWORD dwBufLen,DWORD dwReserved);
   1519 
   1520 #define PROXY_AUTO_DETECT_TYPE_DHCP 1
   1521 #define PROXY_AUTO_DETECT_TYPE_DNS_A 2
   1522 
   1523   struct AutoProxyHelperFunctions;
   1524 
   1525   typedef struct AutoProxyHelperVtbl {
   1526     WINBOOL (WINAPI *IsResolvable)(LPSTR lpszHost);
   1527     DWORD (WINAPI *GetIPAddress)(LPSTR lpszIPAddress,LPDWORD lpdwIPAddressSize);
   1528     DWORD (WINAPI *ResolveHostName)(LPSTR lpszHostName,LPSTR lpszIPAddress,LPDWORD lpdwIPAddressSize);
   1529     WINBOOL (WINAPI *IsInNet)(LPSTR lpszIPAddress,LPSTR lpszDest,LPSTR lpszMask);
   1530   } AutoProxyHelperVtbl;
   1531 
   1532   typedef struct {
   1533     DWORD dwStructSize;
   1534     LPSTR lpszScriptBuffer;
   1535     DWORD dwScriptBufferSize;
   1536   } AUTO_PROXY_SCRIPT_BUFFER,*LPAUTO_PROXY_SCRIPT_BUFFER;
   1537 
   1538   typedef struct AutoProxyHelperFunctions {
   1539     const struct AutoProxyHelperVtbl *lpVtbl;
   1540   } AutoProxyHelperFunctions;
   1541 
   1542   typedef WINBOOL (CALLBACK *pfnInternetInitializeAutoProxyDll)(DWORD dwVersion,LPSTR lpszDownloadedTempFile,LPSTR lpszMime,AutoProxyHelperFunctions *lpAutoProxyCallbacks,LPAUTO_PROXY_SCRIPT_BUFFER lpAutoProxyScriptBuffer);
   1543   typedef WINBOOL (CALLBACK *pfnInternetDeInitializeAutoProxyDll)(LPSTR lpszMime,DWORD dwReserved);
   1544   typedef WINBOOL (CALLBACK *pfnInternetGetProxyInfo)(LPCSTR lpszUrl,DWORD dwUrlLength,LPSTR lpszUrlHostName,DWORD dwUrlHostNameLength,LPSTR *lplpszProxyHostName,LPDWORD lpdwProxyHostNameLength);
   1545 
   1546 #if defined(UNICODE)
   1547 #define InternetGetConnectedStateEx InternetGetConnectedStateExW
   1548 #else
   1549   INTERNETAPI_(WINBOOL) InternetGetConnectedStateEx(LPDWORD lpdwFlags,LPSTR lpszConnectionName,DWORD dwNameLen,DWORD dwReserved);
   1550 #endif
   1551 
   1552   INTERNETAPI_(WINBOOL) InternetInitializeAutoProxyDll(DWORD dwReserved);
   1553   INTERNETAPI_(WINBOOL) InternetDeInitializeAutoProxyDll(LPSTR lpszMime,DWORD dwReserved);
   1554   INTERNETAPI_(WINBOOL) InternetGetProxyInfo(LPCSTR lpszUrl,DWORD dwUrlLength,LPSTR lpszUrlHostName,DWORD dwUrlHostNameLength,LPSTR *lplpszProxyHostName,LPDWORD lpdwProxyHostNameLength);
   1555   INTERNETAPI_(WINBOOL) DetectAutoProxyUrl(LPSTR lpszAutoProxyUrl,DWORD dwAutoProxyUrlLength,DWORD dwDetectFlags);
   1556   INTERNETAPI_(WINBOOL) CreateMD5SSOHash(PWSTR pszChallengeInfo,PWSTR pwszRealm,PWSTR pwszTarget,PBYTE pbHexHash);
   1557 
   1558 #define INTERNET_CONNECTION_MODEM 0x01
   1559 #define INTERNET_CONNECTION_LAN 0x02
   1560 #define INTERNET_CONNECTION_PROXY 0x04
   1561 #define INTERNET_CONNECTION_MODEM_BUSY 0x08
   1562 #define INTERNET_RAS_INSTALLED 0x10
   1563 #define INTERNET_CONNECTION_OFFLINE 0x20
   1564 #define INTERNET_CONNECTION_CONFIGURED 0x40
   1565 
   1566   typedef DWORD (CALLBACK *PFN_DIAL_HANDLER) (HWND,LPCSTR,DWORD,LPDWORD);
   1567 
   1568 #define INTERNET_CUSTOMDIAL_CONNECT 0
   1569 #define INTERNET_CUSTOMDIAL_UNATTENDED 1
   1570 #define INTERNET_CUSTOMDIAL_DISCONNECT 2
   1571 #define INTERNET_CUSTOMDIAL_SHOWOFFLINE 4
   1572 
   1573 #define INTERNET_CUSTOMDIAL_SAFE_FOR_UNATTENDED 1
   1574 #define INTERNET_CUSTOMDIAL_WILL_SUPPLY_STATE 2
   1575 #define INTERNET_CUSTOMDIAL_CAN_HANGUP 4
   1576 
   1577 #define InternetSetPerSiteCookieDecision __MINGW_NAME_AW(InternetSetPerSiteCookieDecision)
   1578 #define InternetGetPerSiteCookieDecision __MINGW_NAME_AW(InternetGetPerSiteCookieDecision)
   1579 #define InternetEnumPerSiteCookieDecision __MINGW_NAME_AW(InternetEnumPerSiteCookieDecision)
   1580 
   1581 #if defined(UNICODE)
   1582 #define InternetSetDialState InternetSetDialStateW
   1583 #else
   1584   INTERNETAPI_(WINBOOL) InternetSetDialState(LPCSTR lpszConnectoid,DWORD dwState,DWORD dwReserved);
   1585 #endif
   1586 
   1587   INTERNETAPI_(WINBOOL) InternetSetDialStateA(LPCSTR lpszConnectoid,DWORD dwState,DWORD dwReserved);
   1588   INTERNETAPI_(WINBOOL) InternetSetDialStateW(LPCWSTR lpszConnectoid,DWORD dwState,DWORD dwReserved);
   1589 
   1590 #define INTERNET_DIALSTATE_DISCONNECTED 1
   1591 
   1592   INTERNETAPI_(WINBOOL) InternetSetPerSiteCookieDecisionA(LPCSTR pchHostName,DWORD dwDecision);
   1593   INTERNETAPI_(WINBOOL) InternetSetPerSiteCookieDecisionW(LPCWSTR pchHostName,DWORD dwDecision);
   1594   INTERNETAPI_(WINBOOL) InternetGetPerSiteCookieDecisionA(LPCSTR pchHostName,unsigned __LONG32 *pResult);
   1595   INTERNETAPI_(WINBOOL) InternetGetPerSiteCookieDecisionW(LPCWSTR pchHostName,unsigned __LONG32 *pResult);
   1596   INTERNETAPI_(WINBOOL) InternetClearAllPerSiteCookieDecisions();
   1597   INTERNETAPI_(WINBOOL) InternetEnumPerSiteCookieDecisionA(LPSTR pszSiteName,unsigned __LONG32 *pcSiteNameSize,unsigned __LONG32 *pdwDecision,unsigned __LONG32 dwIndex);
   1598   INTERNETAPI_(WINBOOL) InternetEnumPerSiteCookieDecisionW(LPWSTR pszSiteName,unsigned __LONG32 *pcSiteNameSize,unsigned __LONG32 *pdwDecision,unsigned __LONG32 dwIndex);
   1599 
   1600 #define INTERNET_IDENTITY_FLAG_PRIVATE_CACHE 0x01
   1601 #define INTERNET_IDENTITY_FLAG_SHARED_CACHE 0x02
   1602 #define INTERNET_IDENTITY_FLAG_CLEAR_DATA 0x04
   1603 #define INTERNET_IDENTITY_FLAG_CLEAR_COOKIES 0x08
   1604 #define INTERNET_IDENTITY_FLAG_CLEAR_HISTORY 0x10
   1605 #define INTERNET_IDENTITY_FLAG_CLEAR_CONTENT 0x20
   1606 
   1607 #define INTERNET_SUPPRESS_RESET_ALL 0x00
   1608 #define INTERNET_SUPPRESS_COOKIE_POLICY 0x01
   1609 #define INTERNET_SUPPRESS_COOKIE_POLICY_RESET 0x02
   1610 
   1611 #define PRIVACY_TEMPLATE_NO_COOKIES 0
   1612 #define PRIVACY_TEMPLATE_HIGH 1
   1613 #define PRIVACY_TEMPLATE_MEDIUM_HIGH 2
   1614 #define PRIVACY_TEMPLATE_MEDIUM 3
   1615 #define PRIVACY_TEMPLATE_MEDIUM_LOW 4
   1616 #define PRIVACY_TEMPLATE_LOW 5
   1617 #define PRIVACY_TEMPLATE_CUSTOM 100
   1618 #define PRIVACY_TEMPLATE_ADVANCED 101
   1619 
   1620 #define PRIVACY_TEMPLATE_MAX PRIVACY_TEMPLATE_LOW
   1621 
   1622 #define PRIVACY_TYPE_FIRST_PARTY 0
   1623 #define PRIVACY_TYPE_THIRD_PARTY 1
   1624 
   1625   INTERNETAPI_(DWORD) PrivacySetZonePreferenceW(DWORD dwZone,DWORD dwType,DWORD dwTemplate,LPCWSTR pszPreference);
   1626   INTERNETAPI_(DWORD) PrivacyGetZonePreferenceW(DWORD dwZone,DWORD dwType,LPDWORD pdwTemplate,LPWSTR pszBuffer,LPDWORD pdwBufferLength);
   1627 
   1628 #if defined(__cplusplus)
   1629 }
   1630 #endif
   1631 
   1632 #include <poppack.h>
   1633 #endif
   1634