API Flags

Many of the WinINet functions accept an array of flags as a parameter. The following is a brief description of the defined flags.

INTERNET_COOKIE_EVALUATE_P3P

0x80

Indicates that a Platform for Privacy Protection (P3P) header is to be associated with a cookie.

INTERNET_COOKIE_THIRD_PARTY

0x10

Indicates that a third-party cookie is being set or retrieved.

INTERNET_FLAG_ASYNC

0x10000000

Makes only asynchronous requests on handles descended from the handle returned from this function. Only the InternetOpen function uses this flag.

INTERNET_FLAG_CACHE_ASYNC

0x00000080

Allows a lazy cache write.

INTERNET_FLAG_CACHE_IF_NET_FAIL

0x00010000

Returns the resource from the cache if the network request for the resource fails due to an ERROR_INTERNET_CONNECTION_RESET or ERROR_INTERNET_CANNOT_CONNECT error. This flag is used by HttpOpenRequest.

INTERNET_FLAG_DONT_CACHE

0x04000000

Does not add the returned entity to the cache. This is identical to the preferred value, INTERNET_FLAG_NO_CACHE_WRITE.

INTERNET_FLAG_EXISTING_CONNECT

0x20000000

Attempts to use an existing InternetConnect object if one exists with the same attributes required to make the request. This is useful only with FTP operations, since FTP is the only protocol that typically performs multiple operations during the same session. WinINet caches a single connection handle for each HINTERNET handle generated by InternetOpen. The InternetOpenUrl and InternetConnect functions use this flag for Http and Ftp connections.

INTERNET_FLAG_FORMS_SUBMIT

0x00000040

Indicates that this is a Forms submission.

INTERNET_FLAG_FROM_CACHE

0x01000000

Does not make network requests. All entities are returned from the cache. If the requested item is not in the cache, a suitable error, such as ERROR_FILE_NOT_FOUND, is returned. Only the InternetOpen function uses this flag.

INTERNET_FLAG_FWD_BACK

0x00000020

Indicates that the function should use the copy of the resource that is currently in the Internet cache. The expiration date and other information about the resource is not checked. If the requested item is not found in the Internet cache, the system attempts to locate the resource on the network. This value was introduced in Microsoft Internet Explorer 5 and is associated with the Forward and Back button operations of Internet Explorer.

INTERNET_FLAG_HYPERLINK

0x00000400

Forces a reload if there is no Expires time and no LastModified time returned from the server when determining whether to reload the item from the network. This flag can be used by FtpFindFirstFile, FtpGetFile, FtpOpenFile, FtpPutFile, HttpOpenRequest, and InternetOpenUrl.

Windows XP and Windows Server 2003 R2 and earlier: Also used by GopherFindFirstFile and GopherOpenFile.

INTERNET_FLAG_IGNORE_CERT_CN_INVALID

0x00001000

Disables checking of SSL/PCT-based certificates that are returned from the server against the host name given in the request. WinINet uses a simple check against certificates by comparing for matching host names and simple wildcarding rules. This flag can be used by HttpOpenRequest and InternetOpenUrl (for HTTP requests).

INTERNET_FLAG_IGNORE_CERT_DATE_INVALID

0x00002000

Disables checking of SSL/PCT-based certificates for proper validity dates. This flag can be used by HttpOpenRequest and InternetOpenUrl (for HTTP requests).

INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP

0x00008000

Disables detection of this special type of redirect. When this flag is used, WinINet transparently allows redirects from HTTPS to HTTP URLs. This flag can be used by HttpOpenRequest and InternetOpenUrl (for HTTP requests).

INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS

0x00004000

Disables detection of this special type of redirect. When this flag is used, WinINet transparently allow redirects from HTTP to HTTPS URLs. This flag can be used by HttpOpenRequest and InternetOpenUrl (for HTTP requests).

INTERNET_FLAG_KEEP_CONNECTION

0x00400000

Uses keep-alive semantics, if available, for the connection. This flag is used by HttpOpenRequest and InternetOpenUrl (for HTTP requests). This flag is required for Microsoft Network (MSN), NTLM, and other types of authentication.

INTERNET_FLAG_MAKE_PERSISTENT

0x02000000

No longer supported.

INTERNET_FLAG_MUST_CACHE_REQUEST

0x00000010

Identical to the preferred value, INTERNET_FLAG_NEED_FILE. Causes a temporary file to be created if the file cannot be cached. This flag can be used by FtpFindFirstFile, FtpGetFile, FtpOpenFile, FtpPutFile, HttpOpenRequest, and InternetOpenUrl.

Windows XP and Windows Server 2003 R2 and earlier: Also used by GopherFindFirstFile and GopherOpenFile.

INTERNET_FLAG_NEED_FILE

0x00000010

Causes a temporary file to be created if the file cannot be cached. This flag can be used by FtpFindFirstFile, FtpGetFile, FtpOpenFile, FtpPutFile, HttpOpenRequest, and InternetOpenUrl.

Windows XP and Windows Server 2003 R2 and earlier: Also used by GopherFindFirstFile and GopherOpenFile.

INTERNET_FLAG_NO_AUTH

0x00040000

Does not attempt authentication automatically. This flag can be used by HttpOpenRequest and InternetOpenUrl (for HTTP requests).

INTERNET_FLAG_NO_AUTO_REDIRECT

0x00200000

Does not automatically handle redirection in HttpSendRequest. This flag can also be used by InternetOpenUrl for HTTP requests.

INTERNET_FLAG_NO_CACHE_WRITE

0x04000000

Does not add the returned entity to the cache. This flag is used by , HttpOpenRequest, and InternetOpenUrl.

Windows XP and Windows Server 2003 R2 and earlier: Also used by GopherFindFirstFile and GopherOpenFile.

INTERNET_FLAG_NO_COOKIES

0x00080000

Does not automatically add cookie headers to requests, and does not automatically add returned cookies to the cookie database. This flag can be used by HttpOpenRequest and InternetOpenUrl (for HTTP requests).

INTERNET_FLAG_NO_UI

0x00000200

Disables the cookie dialog box. This flag can be used by HttpOpenRequest and InternetOpenUrl (HTTP requests only).

INTERNET_FLAG_OFFLINE

0x01000000

Identical to INTERNET_FLAG_FROM_CACHE. Does not make network requests. All entities are returned from the cache. If the requested item is not in the cache, a suitable error, such as ERROR_FILE_NOT_FOUND, is returned. Only the InternetOpen function uses this flag.

INTERNET_FLAG_PASSIVE

0x08000000

Uses passive FTP semantics. Only InternetConnect and InternetOpenUrl use this flag. InternetConnect uses this flag for FTP requests, and InternetOpenUrl uses this flag for FTP files and directories.

INTERNET_FLAG_PRAGMA_NOCACHE

0x00000100

Forces the request to be resolved by the origin server, even if a cached copy exists on the proxy. The InternetOpenUrl function (on HTTP and HTTPS requests only) and HttpOpenRequest function use this flag.

INTERNET_FLAG_RAW_DATA

0x40000000

Returns the data as a WIN32_FIND_DATA structure when retrieving FTP directory information. If this flag is not specified or if the call is made through a CERN proxy, InternetOpenUrl returns the HTML version of the directory. Only the InternetOpenUrl function uses this flag.

Windows XP and Windows Server 2003 R2 and earlier: Also returns a GOPHER_FIND_DATA structure when retrieving Gopher directory information.

INTERNET_FLAG_READ_PREFETCH

0x00100000

This flag is currently disabled.

INTERNET_FLAG_RELOAD

0x80000000

Forces a download of the requested file, object, or directory listing from the origin server, not from the cache. The FtpFindFirstFile, FtpGetFile, FtpOpenFile, FtpPutFile, HttpOpenRequest, and InternetOpenUrl functions use this flag.

Windows XP and Windows Server 2003 R2 and earlier: Also used by GopherFindFirstFile and GopherOpenFile.

INTERNET_FLAG_RESTRICTED_ZONE

0x00020000

Indicates that the cookie being set is associated with an untrusted site.

INTERNET_FLAG_RESYNCHRONIZE

0x00000800

Reloads HTTP resources if the resource has been modified since the last time it was downloaded. All FTP resources are reloaded. This flag can be used by FtpFindFirstFile, FtpGetFile, FtpOpenFile, FtpPutFile, HttpOpenRequest, and InternetOpenUrl.

Windows XP and Windows Server 2003 R2 and earlier: Also used by GopherFindFirstFile and GopherOpenFile, and Gopher resources are reloaded.

INTERNET_FLAG_SECURE

0x00800000

Uses secure transaction semantics. This translates to using Secure Sockets Layer/Private Communications Technology (SSL/PCT) and is only meaningful in HTTP requests. This flag is used by HttpOpenRequest and InternetOpenUrl, but this is redundant if https:// appears in the URL.The InternetConnect function uses this flag for HTTP connections; all the request handles created under this connection will inherit this flag.

INTERNET_FLAG_TRANSFER_ASCII

0x00000001

Transfers file as ASCII (FTP only). This flag can be used by FtpOpenFile, FtpGetFile, and FtpPutFile.

INTERNET_FLAG_TRANSFER_BINARY

0x00000002

Transfers file as binary (FTP only). This flag can be used by FtpOpenFile, FtpGetFile, and FtpPutFile.

INTERNET_NO_CALLBACK

0x00000000

Indicates that no callbacks should be made for that API. This is used for the dxContext parameter of the functions that allow asynchronous operations.

INTERNET_OPTION_SUPPRESS_SERVER_AUTH

104

Sets an HTTP request object such that it will not logon to origin servers, but will perform automatic logon to HTTP proxy servers. This option differs from the Request flag INTERNET_FLAG_NO_AUTH, which prevents authentication to both proxy servers and origin servers. Setting this mode will suppress the use of any credential material (either previously provided username/password or client SSL certificate) when communicating with an origin server. However, if the request must transit via an authenticating proxy, WinINet will still perform automatic authentication to the HTTP proxy per the Intranet Zone settings for the user. The default Intranet Zone setting is to permit automatic logon using the user s default credentials. To ensure suppression of all identifying information, the caller should combine INTERNET_OPTION_SUPPRESS_SERVER_AUTH with the INTERNET_FLAG_NO_COOKIES request flag. This option may only be set on request objects before they have been sent. Attempts to set this option after the request has been sent will return ERROR_INTERNET_INCORRECT_HANDLE_STATE. No buffer is required for this option. This is used by InternetSetOption on handles returned by HttpOpenRequest only. Version: Requires Internet Explorer 8.0 or later.

WININET_API_FLAG_ASYNC

0x00000001

Forces asynchronous operations.

WININET_API_FLAG_SYNC

0x00000004

Forces synchronous operations.

WININET_API_FLAG_USE_CONTEXT

0x00000008

Forces the API to use the context value, even if it is set to zero.

Remarks

Note

WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft Windows HTTP Services (WinHTTP).

Requirements

Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Wininet.h