Structures

Structures


The following section describes the Win32 Internet function data structures and their uses.
GOPHER_ATTRIBUTE_TYPE
GOPHER_FIND_DATA
HTTP_VERSION_INFO
INTERNET_ASYNC_RESULT
INTERNET_AUTHNOTIFY_DATA
INTERNET_BUFFERS
INTERNET_CACHE_ENTRY_INFO
INTERNET_CERTIFICATE_INFO
INTERNET_CONNECTED_INFO
INTERNET_ONLINE_OFFLINE_INFO
INTERNET_PREFETCH_STATUS
INTERNET_PROXY_INFO
INTERNET_SCHEME
INTERNET_VERSION_INFO
URL_COMPONENTS

GOPHER_ATTRIBUTE_TYPE

typedef struct {
    DWORD CategoryId
    DWORD AttributeId
    union {
        GOPHER_ADMIN_ATTRIBUTE Admin;
        GOPHER_MOD_DATE_ATTRIBUTE ModDate;
        GOPHER_SCORE_ATTRIBUTE Score;
        GOPHER_SCORE_RANGE_ATTRIBUTE ScoreRange;
        GOPHER_SITE_ATTRIBUTE Site;
        GOPHER_ORGANIZATION_ATTRIBUTE Organization;
        GOPHER_LOCATION_ATTRIBUTE Location;
        GOPHER_GEOGRAPHICAL_LOCATION_ATTRIBUTE GeographicalLocation;
        GOPHER_TIMEZONE_ATTRIBUTE TimeZone;
        GOPHER_PROVIDER_ATTRIBUTE Provider;
        GOPHER_VERSION_ATTRIBUTE Version;
        GOPHER_ABSTRACT_ATTRIBUTE Abstract;
        GOPHER_VIEW_ATTRIBUTE View;
        GOPHER_VERONICA_ATTRIBUTE Veronica;
        GOPHER_ASK_ATTRIBUTE_TYPE Ask;
        GOPHER_UNKNOWN_ATTRIBUTE Unknown;
    } AttributeType;
} GOPHER_ATTRIBUTE_TYPE, *LPGOPHER_ATTRIBUTE_TYPE;

Contains the relevant information of a single Gopher attribute for an object.

CategoryId
Gopher name for the attribute. The possible values include:
GOPHER_CATEGORY_ID_ABSTRACT
GOPHER_CATEGORY_ID_ADMIN
GOPHER_CATEGORY_ID_ALL
GOPHER_CATEGORY_ID_INFO
GOPHER_CATEGORY_ID_UNKNOWN
GOPHER_CATEGORY_ID_VERONICA
GOPHER_CATEGORY_ID_VIEWS
AttributeId
Identifier of the structure contained in the AttributeType member. The possible values include:
GOPHER_ATTRIBUTE_ID_ABSTRACT
GOPHER_ATTRIBUTE_ID_ADMIN
GOPHER_ATTRIBUTE_ID_GEOG
GOPHER_ATTRIBUTE_ID_LOCATION
GOPHER_ATTRIBUTE_ID_MOD_DATE
GOPHER_ATTRIBUTE_ID_ORG
GOPHER_ATTRIBUTE_ID_PROVIDER
GOPHER_ATTRIBUTE_ID_RANGE
GOPHER_ATTRIBUTE_ID_SCORE
GOPHER_ATTRIBUTE_ID_SITE
GOPHER_ATTRIBUTE_ID_TIMEZONE
GOPHER_ATTRIBUTE_ID_TREEWALK
GOPHER_ATTRIBUTE_ID_TTL
GOPHER_ATTRIBUTE_ID_UNKNOWN
GOPHER_ATTRIBUTE_ID_VERSION
GOPHER_ATTRIBUTE_ID_VIEW
AttributeType
Actual setting for the Gopher attribute. The specific value of AttributeType depends on the AttributeId member. The definitions of the various attribute structures are available in Wininet.h.

See also GopherGetAttribute

GOPHER_FIND_DATA

typedef struct {
    TCHAR DisplayString[MAX_GOPHER_DISPLAY_TEXT + 1];
    DWORD GopherType;
    DWORD SizeLow;
    DWORD SizeHigh;
    FILETIME LastModificationTime;
    TCHAR Locator[MAX_GOPHER_LOCATOR_LENGTH + 1];
} GOPHER_FIND_DATA, FAR *LPGOPHER_FIND_DATA;

Contains information retrieved by the GopherFindFirstFile and InternetFindNextFile functions.

DisplayString
String that contains the friendly name of an object. An application can display this string to allow the user to select the object.
GopherType
Mask of flags that describe the item returned. Can be one of the following values:
GOPHER_TYPE_ASK Ask+ item.
GOPHER_TYPE_BINARY Binary file.
GOPHER_TYPE_BITMAP Bitmap file.
GOPHER_TYPE_CALENDAR Calendar file.
GOPHER_TYPE_CSO CSO telephone book server.
GOPHER_TYPE_DIRECTORY Directory of additional Gopher items.
GOPHER_TYPE_DOS_ARCHIVE MS-DOS archive file.
GOPHER_TYPE_ERROR Indicator of an error condition.
GOPHER_TYPE_GIF GIF graphics file.
GOPHER_TYPE_GOPHER_PLUS Gopher+ item.
GOPHER_TYPE_HTML HTML document.
GOPHER_TYPE_IMAGE Image file.
GOPHER_TYPE_INDEX_SERVER Index server.
GOPHER_TYPE_INLINE Inline file.
GOPHER_TYPE_MAC_BINHEX Macintosh file in BINHEX format.
GOPHER_TYPE_MOVIE Movie file.
GOPHER_TYPE_PDF PDF file.
GOPHER_TYPE_REDUNDANT Indicator of a duplicated server. The information contained within is a duplicate of the primary server. The primary server is defined as the last directory entry that did not have a GOPHER_TYPE_REDUNDANT type.
GOPHER_TYPE_SOUND Sound file.
GOPHER_TYPE_TELNET Telnet server.
GOPHER_TYPE_TEXT_FILE ASCII text file.
GOPHER_TYPE_TN3270 TN3270 server.
GOPHER_TYPE_UNIX_UUENCODED UUENCODED file.
GOPHER_TYPE_UNKNOWN Item type is unknown.
SizeLow
Low 32 bits of the file size.
SizeHigh
High 32 bits of the file size.
LastModificationTime
Time when the file was last modified.
Locator
String that identifies the file. An application can pass the locator string to GopherOpenFile or GopherFindFirstFile.

HTTP_VERSION_INFO

typedef  struct{
    DWORD dwMajorVersion;
    DWORD dwMinorVersion; 

Contains the global HTTP version (either 1.0 or 1.1).

dwMajorVersion
Major version number. Must be 1.
dwMinorVersion
Minor version number. Can be either 1 or 0.

INTERNET_ASYNC_RESULT

typedef struct {
    DWORD dwResult;
    DWORD dwError;
} INTERNET_ASYNC_RESULT, * LPINTERNET_ASYNC_RESULT;

Contains the result of a call to an asynchronous function. This structure is used with INTERNET_STATUS_CALLBACK.

dwResult
HINTERNET, DWORD, or BOOL return code from an asynchronous function.
dwError
Error message if dwResult indicates that the function failed. If the operation succeeded, this member usually contains ERROR_SUCCESS.

INTERNET_AUTHNOTIFY_DATA

typedef struct {
    DWORD cbStruct;
    DWORD dwOptions;
    PFN_PUTHNOTIFY pfnNotify;
    DWORD dwConext;    	
} INTERNET_AUTHNOTIFY_DATA;
cbStruct
Size of the structure.
dwOptions
Reserved; must be set to zero.
pfnNotify
Notification callback to retry InternetErrorDlg.
dwContext
Context to pass to the notification function.

INTERNET_BUFFERS

typedef struct _INTERNET_BUFFERS {
    DWORD dwStructSize; 
    struct _INTERNET_BUFFERS * Next;
    LPCTSTR lpcszHeader;
    DWORD dwHeadersLength;
    DWORD dwHeadersTotal;
    LPVOID lpvBuffer;
    DWORD dwBufferLength;
    DWORD dwBufferTotal;
    DWORD dwOffsetLow; 
    DWORD dwOffsetHigh;
} INTERNET_BUFFERS, * LPINTERNET_BUFFERS;

Contains both the data and header information.

dwStructSize
Double-word value used for API versioning. Set to the size of the INTERNET_BUFFERS structure.
Next
Address of the next INTERNET_BUFFERS structure.
lpcszHeader
String value containing the headers. This value can be NULL.
dwHeadersLength
Double-word value containing the length of the headers if lpcszHeader is not NULL.
dwHeadersTotal
Double-word value that contains the size of the headers if there is not enough memory in the buffer.
lpvBuffer
Address of the data buffer.
dwBufferLength
Double-word value that contains the length of the buffer if lpvBuffer is not NULL.
dwBufferTotal
Double-word value that contains the total size of the chunk or the content length if it is not chunked.
dwOffsetLow
Double-word value that is used for read ranges.
dwOffsetHigh
Double-word value that is used for read ranges.

INTERNET_CACHE_ENTRY_INFO

typedef struct _CACHE_ENTRY_INFO {
    DWORD dwStructSize;
    LPSTR lpszSourceUrlName;
    LPSTR lpszLocalFileName;
    DWORD CacheEntryType;
    DWORD dwUseCount;
    DWORD dwHitRate;
    DWORD dwSizeLow;
    DWORD dwSizeHigh;
    FILETIME LastModifiedTime;
    FILETIME ExpireTime;
    FILETIME LastAccessTime;
    FILETIME LastSyncTime;
    LPBYTE lpHeaderInfo;
    DWORD dwHeaderInfoSize;
    LPSTR lpszFileExtension;
    union (DWORD dwReserved; DWORD dwExemptDelta;)
} INTERNET_CACHE_ENTRY_INFO, *LPINTERNET_CACHE_ENTRY_INFO;

Contains information about an entry in the cache.

dwStructSize
Size, in bytes, of this structure.
lpszSourceUrlName
Address of a string that contains the URL name. The string occupies memory area at the end of this structure.
lpszLocalFileName
Address of a string that contains the local file name. The string occupies memory area at the end of this structure.
CacheEntryType
Cache type bitmask. Currently, the cache entry type value of resources from the Internet is equal to zero. For History and Cookie entries, the cache entry type is a combination of two values. One value determines how the cache entry is handled; the second value indicates what is being cached.

The value that determines how the cache entry is handled can be one of the following:
NORMAL_CACHE_ENTRY Normal cache entry; can be deleted to recover space for new entries.
SPARSE_CACHE_ENTRY Not currently implemented.
STABLE_CACHE_ENTRY Not currently implemented.
STICKY_CACHE_ENTRY Sticky cache entry that is exempt from scavenging for amount of time specified by dwExemptDelta. The default value set by CommitUrlCacheEntry is one day.

The value that indicates what is being cached can be one of the following:
COOKIE_CACHE_ENTRY Cookie cache entry.
OCX_CACHE_ENTRY Not currently implemented.
URLHISTORY_CACHE_ENTRY Visited link cache entry.

dwUseCount
Current user count of the cache entry.
dwHitRate
Number of times the cache entry was retrieved.
dwSizeLow
Low-order double word of the file size.
dwSizeHigh
High-order double word of the file size.
LastModifiedTime
Last modified time of this URL, in GMT format.
ExpireTime
Expiration time of this file, in GMT format.
LastAccessTime
Last accessed time, in GMT format.
LastSyncTime
Last time the cache was synchronized.
lpHeaderInfo
Address of a buffer that contains the header information. The buffer occupies memory at the end of this structure.
dwHeaderInfoSize
Size of the lpHeaderInfo buffer.
lpszFileExtension
Address of a string that contains the file extension used to retrieve the data as a file. The string occupies memory area at the end of this structure.
union (DWORD dwReserved; DWORD dwExemptDelta;)
Exemption time, in seconds, from the last accessed time.

There is no cache entry size limit, so applications that need to enumerate the cache must be prepared to allocate variable-sized buffers. For more information, see Appendix B: Using Buffers.

INTERNET_CERTIFICATE_INFO

typedef struct {
    FILETIME ftExpiry;
    FILETIME ftStart;
    LPSTR lpszSubjectInfo;
    LPSTR lpszIssuerInfo;
    LPSTR lpszProtocolName;
    LPSTR lpszSignatureAlgName;
    LPSTR lpszEncryptionAlgName;
    DWORD dwKeySize;
} INTERNET_CERTIFICATE_INFO, * LPINTERNET_CERTIFICATE_INFO;

Contains certificate information returned from the server. This structure is used by the InternetQueryOption function.

ftExpiry
FILETIME structure that contains the date the certificate expires.
ftStart
FILETIME structure that contains the date the certificate becomes valid.
lpszSubjectInfo
Address of a buffer that contains the name of the organization, site, and server for which the certificate was issued.
lpszIssuerInfo
Address of a buffer that contains the name of the organization, site, and server that issued the certificate.
lpszProtocolName
Address of a buffer that contains the name of the protocol used to provide the secure connection.
lpszSignatureAlgName
Address of a buffer that contains the name of the algorithm used for signing the certificate.
lpszEncryptionAlgName
Address of a buffer that contains the name of the algorithm used for doing encryption over the secure channel (SSL/PCT) connection.
dwKeySize
Size, in bytes, of the key.

Applications requesting this information must free pointers that are allocated and placed in the returned structure.

INTERNET_CONNECTED_INFO

typedef struct {
    DWORD dwConnectedState;
    DWORD dwFlags
} INTERNET_CONNECTED_INFO, * LPINTERNET_CONNECTED_INFO;

Contains the information to set the global online/offline state.

dwConnectedState
DWORD value that contains the state information. Can be one of the following values:
INTERNET_STATE_CONNECTED Connected to network. Replaces INTERNET_STATE_ONLINE.
INTERNET_STATE_DISCONNECTED Disconnected from network. Replaces INTERNET_STATE_OFFLINE.
INTERNET_STATE_DISCONNECTED_BY_USER Disconnected by user request. Replaces INTERNET_STATE_OFFLINE_USER.
INTERNET_STATE_IDLE No network requests are being made by Win32 Internet functions.
INTERNET_STATE_BUSY Network requests are being made by WinInet.
dwFlags
DWORD value that controls the transition between states. Can be ISO_FORCE_DISCONNECTED, which puts Win32 Internet functions into offline mode. All outstanding requests will be aborted with a canceled error.

INTERNET_ONLINE_OFFLINE_INFO

Replaced by INTERNET_CONNECTED_INFO.

INTERNET_PREFETCH_STATUS

typedef struct {
    DWORD dwStatus;
    DWORD dwSize;
} INTERNET_PREFETCH_STATUS, * LPINTERNET_PREFETCH_STATUS;

Contains the status of a prefetch download operation.

dwStatus
Status of the download. Can be one of the following values:
INTERNET_PREFETCH_ABORTED Operation was aborted.
INTERNET_PREFETCH_COMPLETE Operation has completed.
INTERNET_PREFETCH_PROGRESS Operation is in progress.
dwSize
Size, in bytes, of data downloaded so far.

INTERNET_PROXY_INFO

typedef struct {
    DWORD dwAccessType;
    LPCSTR lpszProxy;
    LPCSTR lpszProxyBypass;
} INTERNET_PROXY_INFO, * LPINTERNET_PROXY_INFO;

Contains information that is supplied with the INTERNET_OPTION_PROXY value to get or set proxy information on a handle obtained from a call to the InternetOpen function.

dwAccessType
Access type. Can be one of the following values:
INTERNET_OPEN_TYPE_DIRECT Internet accessed through a direct connection.
INTERNET_OPEN_TYPE_PRECONFIG Applies only when setting proxy information.
INTERNET_OPEN_TYPE_PROXY Internet accessed using a proxy.
lpszProxy
Proxy server list.
lpszProxyBypass
Proxy bypass list.

INTERNET_SCHEME

typedef enum {
    INTERNET_SCHEME_PARTIAL = -2,
    INTERNET_SCHEME_UNKNOWN = -1,
    INTERNET_SCHEME_DEFAULT = 0,
    INTERNET_SCHEME_FTP,
    INTERNET_SCHEME_GOPHER,
    INTERNET_SCHEME_HTTP,
    INTERNET_SCHEME_HTTPS,
    INTERNET_SCHEME_FILE,
    INTERNET_SCHEME_NEWS,
    INTERNET_SCHEME_MAILTO,
    INTERNET_SCHEME_FIRST = INTERNET_SCHEME_FTP,
    INTERNET_SCHEME_LAST = INTERNET_SCHEME_MAILTO
} INTERNET_SCHEME, * LPINTERNET_SCHEME;

Defines the flags used with the nScheme member of the URL_COMPONENTS structure.

INTERNET_SCHEME_PARTIAL
Partial URL.
INTERNET_SCHEME_UNKNOWN
Unknown URL scheme.
INTERNET_SCHEME_DEFAULT
Default URL scheme.
INTERNET_SCHEME_FTP
FTP URL scheme (ftp:).
INTERNET_SCHEME_GOPHER
Gopher URL scheme (gopher:).
INTERNET_SCHEME_HTTP
HTTP URL scheme (http:).
INTERNET_SCHEME_HTTPS
HTTPS URL scheme (https:).
INTERNET_SCHEME_FILE
File URL scheme (file:).
INTERNET_SCHEME_NEWS
News URL scheme (news:).
INTERNET_SCHEME_MAILTO
Mail URL scheme (mailto:).
INTERNET_SCHEME_FIRST
Lowest known scheme value.
INTERNET_SCHEME_LAST
Highest known scheme value.

INTERNET_VERSION_INFO

typedef struct {
    DWORD dwMajorVersion;
    DWORD dwMinorVersion;
} INTERNET_VERSION_INFO, * LPINTERNET_VERSION_INFO;

Contains the HTTP version number of the server. This structure is used when passing the INTERNET_OPTION_VERSION flag to the InternetQueryOption function.

dwMajorVersion
Major version number.
dwMinorVersion
Minor version number.

URL_COMPONENTS

typedef struct {
    DWORD dwStructSize;
    LPSTR lpszScheme;
    DWORD dwSchemeLength;
    INTERNET_SCHEME nScheme;
    LPSTR lpszHostName;
    DWORD dwHostNameLength;
    INTERNET_PORT nPort;
    LPSTR lpszUserName;
    DWORD dwUserNameLength;
    LPSTR lpszPassword;
    DWORD dwPasswordLength;
    LPSTR lpszUrlPath;
    DWORD dwUrlPathLength;
    LPSTR lpszExtraInfo;
    DWORD dwExtraInfoLength;
} URL_COMPONENTS;

Contains the constituent parts of a URL. This structure is used with the InternetCrackUrl and InternetCreateUrl functions.

dwStructSize
Size, in bytes, of this structure. Used for version checking. The size of this structure must be set to initialize this structure properly.
lpszScheme
Address of a buffer that contains the scheme name.
dwSchemeLength
Length of the scheme name.
nScheme
Enumerated scheme type, if known. For a list of scheme types, see INTERNET_SCHEME.
lpszHostName
Address of a buffer that contains the host name.
dwHostNameLength
Length of the host name.
nPort
Converted port number.
lpszUserName
Address of a buffer that contains the user name.
dwUserNameLength
Length of the user name.
lpszPassword
Address of a buffer that contains the password.
dwPasswordLength
Length of the password.
lpszUrlPath
Address of a buffer that contains the URL path.
dwUrlPathLength
Length of the URL path.
lpszExtraInfo
Address of a buffer that contains the extra information (for example, ?foo or #foo).
dwExtraInfoLength
Length of the extra information.

For InternetCrackUrl, if a pointer member and its corresponding length member are both zero, that component is not returned. If the pointer member is NULL but the length member is not zero, both the pointer and length members are returned. If both pointer and corresponding length members are nonzero, the pointer member points to a buffer where the component is copied. The component may be un-escaped, depending on the dwFlags parameter of InternetCrackUrl.

For InternetCreateUrl, the pointer members should be NULL if the component is not required. If the corresponding length member is zero, the pointer member is the address of a zero-terminated string. If the length member is not zero, it is the string length of the corresponding pointer member.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.