InternetQueryOption

This function queries an Internet option on the specified handle.

BOOL WINAPI InternetQueryOption(
  HINTERNET hInternet, 
  DWORD dwOption, 
  LPVOID lpBuffer OPTIONAL, 
  LPDWORD lpdwBufferLength
);

Parameters

  • hInternet
    [in] Internet handle on which to query information.
  • dwOption
    [in] Specifies the Internet option to query. Can be one of the Option Flags values.
  • lpBuffer
    [out] Long pointer to a buffer that receives the option setting.
  • lpdwBufferLength
    [in, out] Long pointer to a variable that contains the length of lpBuffer. When the function returns, the variable receives the length of the data placed into lpBuffer. If GetLastError returns ERROR_INSUFFICIENT_BUFFER, this parameter receives the number of bytes required to hold the created URL.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError.

Remarks

The following list shows the options that may be queried through dwOption:

  • INTERNET_OPTION_CALLBACK
  • INTERNET_OPTION_CONTEXT_VALUE
  • INTERNET_OPTION_CONNECT_TIMEOUT
  • INTERNET_OPTION_CONNECT_RETRIES
  • INTERNET_OPTION_CONNECT_BACKOFF
  • INTERNET_OPTION_CONTROL_SEND_TIMEOUT
  • INTERNET_OPTION_CONTROL_RECEIVE_TIMEOUT
  • INTERNET_OPTION_DATA_SEND_TIMEOUT
  • INTERNET_OPTION_DATA_RECEIVE_TIMEOUT
  • INTERNET_OPTION_READ_BUFFER_SIZE
  • INTERNET_OPTION_WRITE_BUFFER_SIZE
  • INTERNET_OPTION_USERNAME
  • INTERNET_OPTION_PASSWORD
  • INTERNET_OPTION_PROXY
  • INTERNET_OPTION_USER_AGENT
  • INTERNET_OPTION_HANDLE_TYPE
  • INTERNET_OPTION_PARENT_HANDLE

GetLastError will return the ERROR_INVALID_PARAMETER if an option flag that is invalid for the specified handle type is passed to the dwOption parameter.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Wininet.h.
Link Library: Wininet.lib.

See Also

FtpGetFile | FtpPutFile | InternetConnect | InternetOpen | InternetSetOption | WinInet Functions

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.