Compartir a través de


API Flags

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Many of the Windows Internet Services (WinInet) functions accept an array of unsigned long integer flags as a parameter. The following table shows the defined flags.

Constant Description

INTERNET_FLAG_ASYNC

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

INTERNET_FLAG_CACHE_ASYNC

Allows a lazy cache write.

INTERNET_FLAG_CACHE_IF_NET_FAIL

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

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

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 because FTP is the only protocol that typically performs multiple operations during the same session. The WinInet function caches a single connection handle for each HINTERNET handle generated by InternetOpen. Only the InternetOpenUrl function.

INTERNET_FLAG_FORMS_SUBMIT

Indicates that this is a Forms submission.

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_FWD_BACK

Indicates that the function should use the copy of the resource that is currently in the Internet cache. Such resource information as the expiration date is not checked. If the requested item is not found in the Internet cache, the system will attempt 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

Forces a reload if there was 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, HttpOpenRequest, and InternetOpenUrl.

INTERNET_FLAG_IGNORE_CERT_CN_INVALID

Disables checking of SSL/TLS-based certificates that are returned from the server against the host name given in the request. WinInet functions use 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

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

INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP

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

INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS

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

INTERNET_FLAG_KEEP_CONNECTION

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), Windows NT LAN Manager (NTLM), and other types of authentication.

INTERNET_FLAG_MUST_CACHE_REQUEST

Identical to the preferred value INTERNET_FLAG_NEED_FILE. This flag 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.

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.

INTERNET_FLAG_NO_AUTH

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

INTERNET_FLAG_NO_AUTO_REDIRECT

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

INTERNET_FLAG_NO_CACHE_WRITE

Does not add the returned entity to the cache. This flag is used by HttpOpenRequest and InternetOpenUrl. If the INTERNET_FLAG_HYPERLINK is also specified, WinInet will create the cache file but will not commit it.

INTERNET_FLAG_NO_COOKIES

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

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

INTERNET_FLAG_OFFLINE

Identical to INTERNET_FLAG_FROM_CACHE. This flag 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

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

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

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

INTERNET_FLAG_READ_PREFETCH

This flag is currently disabled.

INTERNET_FLAG_RELOAD

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.

INTERNET_FLAG_RESYNCHRONIZE

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.

INTERNET_FLAG_SECURE

Uses secure transaction semantics. This translates to using Secure Sockets Layer/Transport Layer Security (SSL/TLS) 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.

INTERNET_FLAG_TRANSFER_ASCII

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

INTERNET_FLAG_TRANSFER_BINARY

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

INTERNET_NO_CALLBACK

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

WININET_API_FLAG_ASYNC

Forces asynchronous operations.

WININET_API_FLAG_SYNC

Forces synchronous operations.

WININET_API_FLAG_USE_CONTEXT

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

Requirements

Header wininet.h
Windows Embedded CE Windows CE 2.12 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

WinInet Constants