INTERNET_STATUS_CALLBACK callback function (wininet.h)
Prototype for an application-defined status callback function.
The INTERNET_STATUS_CALLBACK type defines a pointer to this callback function.InternetStatusCallback is a placeholder for the application-defined function name.
Syntax
INTERNET_STATUS_CALLBACK InternetStatusCallback;
void InternetStatusCallback(
[in] HINTERNET hInternet,
[in] DWORD_PTR dwContext,
[in] DWORD dwInternetStatus,
[in] LPVOID lpvStatusInformation,
[in] DWORD dwStatusInformationLength
)
{...}
Parameters
[in] hInternet
The handle for which the callback function is called.
[in] dwContext
A pointer to a variable that specifies the application-defined context value associated with hInternet.
[in] dwInternetStatus
A status code that indicates why the callback function is called. This parameter can be one of the following values.
Value | Meaning |
---|---|
|
Closing the connection to the server. The lpvStatusInformation parameter is NULL. |
|
Successfully connected to the socket address (SOCKADDR) pointed to by lpvStatusInformation. |
|
Connecting to the socket address (SOCKADDR) pointed to by lpvStatusInformation. |
|
Successfully closed the connection to the server. The lpvStatusInformation parameter is NULL. |
|
Retrieving content from the cache. Contains data about past cookie events for the URL such as if cookies were accepted, rejected, downgraded, or leashed.
The lpvStatusInformation parameter is a pointer to an InternetCookieHistory structure. |
|
Indicates the number of cookies that were accepted, rejected, downgraded (changed from persistent to session cookies), or leashed (will be sent out only in 1st party context). The lpvStatusInformation parameter is a DWORD with the number of cookies received. |
|
Indicates the number of cookies that were either sent or suppressed, when a request is sent. The lpvStatusInformation parameter is a DWORD with the number of cookies sent or suppressed. |
|
Not implemented. |
|
Notifies the client application that a proxy has been detected. |
|
This handle value has been terminated. pvStatusInformation contains the address of the handle being closed. The lpvStatusInformation parameter contains the address of the handle being closed. |
|
Used by InternetConnect to indicate it has created the new handle. This lets the application call InternetCloseHandle from another thread, if the connect is taking too long. The lpvStatusInformation parameter contains the address of an HINTERNET handle. |
|
Received an intermediate (100 level) status code message from the server. |
|
Successfully found the IP address of the name contained in lpvStatusInformation. The lpvStatusInformation parameter points to a PCTSTR containing the host name. |
|
The response has a P3P header in it. |
|
Not implemented. |
|
Not implemented. |
|
Not implemented. |
|
Waiting for the server to respond to a request. The lpvStatusInformation parameter is NULL. |
|
An HTTP request is about to automatically redirect the request. The lpvStatusInformation parameter points to the new URL. At this point, the application can read any data returned by the server with the redirect response and can query the response headers. It can also cancel the operation by closing the handle. This callback is not made if the original request specified INTERNET_FLAG_NO_AUTO_REDIRECT. |
|
An asynchronous operation has been completed. The lpvStatusInformation parameter contains the address of an INTERNET_ASYNC_RESULT structure. |
|
Successfully sent the information request to the server. The lpvStatusInformation parameter points to a DWORD value that contains the number of bytes sent. |
|
Looking up the IP address of the name contained in lpvStatusInformation. The lpvStatusInformation parameter points to a PCTSTR containing the host name. |
|
Successfully received a response from the server. |
|
Sending the information request to the server. The lpvStatusInformation parameter is NULL. |
|
Moved between a secure (HTTPS) and a nonsecure (HTTP) site. The user must be informed of this change; otherwise, the user is at risk of disclosing sensitive information involuntarily. When this flag is set, the lpvStatusInformation parameter points to a status DWORD that contains additional flags. |
[in] lpvStatusInformation
A pointer to additional status information. When the INTERNET_STATUS_STATE_CHANGE flag is set, lpvStatusInformation points to a DWORD that contains one or more of the following flags:
[in] dwStatusInformationLength
The size, in bytes, of the data pointed to by lpvStatusInformation.
Return value
None
Remarks
Because callbacks are made during processing of the request, the application should spend little time in the callback function to avoid degrading data throughput on the network. For example, displaying a dialog box in a callback function can be such a lengthy operation that the server terminates the request.
The callback function can be called in a thread context different from the thread that initiated the request.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | wininet.h |