![]() | ![]() | ![]() |
| ||
|
INTERNET_STATUS_CALLBACK
VOID (CALLBACK * INTERNET_STATUS_CALLBACK)( IN HINTERNET hInternet, IN DWORD dwContext, IN DWORD dwInternetStatus, IN LPVOID lpvStatusInformation, IN DWORD dwStatusInformationLength );Type used for an application-defined status callback function.
- hInternet
- Handle for which the callback function is being called.
- dwContext
- Application-defined context value associated with hInternet.
- dwInternetStatus
- Status code that indicates why the callback function is being called. Can be one of the following values:
- INTERNET_STATUS_CLOSING_CONNECTION
- Closing the connection to the server. The lpvStatusInformation parameter is NULL.
- INTERNET_STATUS_CONNECTED_TO_SERVER
- Successfully connected to the socket address (SOCKADDR) pointed to by lpvStatusInformation.
- INTERNET_STATUS_CONNECTING_TO_SERVER
- Connecting to the socket address (SOCKADDR) pointed to by lpvStatusInformation.
- INTERNET_STATUS_CONNECTION_CLOSED
- Successfully closed the connection to the server. The lpvStatusInformation parameter is NULL.
- INTERNET_STATUS_CTL_RESPONSE_RECEIVED
- Not currently implemented.
- INTERNET_STATUS_HANDLE_CLOSING
- This handle value is now terminated.
- INTERNET_STATUS_HANDLE_CREATED
- 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.
- INTERNET_STATUS_INTERMEDIATE_RESPONSE
- Received an intermediate (100 level) status code message from the server.
- INTERNET_STATUS_NAME_RESOLVED
- Successfully found the IP address of the name contained in lpvStatusInformation.
- INTERNET_STATUS_PREFETCH
- Not currently implemented.
- INTERNET_STATUS_RECEIVING_RESPONSE
- Waiting for the server to respond to a request. The lpvStatusInformation parameter is NULL.
- INTERNET_STATUS_REDIRECT
- 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.
- INTERNET_STATUS_REQUEST_COMPLETE
- An asynchronous operation has been completed. See InternetOpen for details on INTERNET_FLAG_ASYNC.
- INTERNET_STATUS_REQUEST_SENT
- Successfully sent the information request to the server. The lpvStatusInformation parameter points to a DWORD containing the number of bytes sent.
- INTERNET_STATUS_RESOLVING_NAME
- Looking up the IP address of the name contained in lpvStatusInformation.
- INTERNET_STATUS_RESPONSE_RECEIVED
- Successfully received a response from the server. The lpvStatusInformation parameter points to a DWORD containing the number of bytes received.
- INTERNET_STATUS_SENDING_REQUEST
- Sending the information request to the server. The lpvStatusInformation parameter is NULL.
- INTERNET_STATUS_STATE_CHANGE
- Moved between a secure (HTTPS) and a nonsecure (HTTP) site. Can be one of the following values:
INTERNET_STATE_ONLINE Online state (mutually exclusive with offline). INTERNET_STATE_OFFLINE Offline because no network connection could be established. INTERNET_STATE_OFFLINE_USER Offline by user request. INTERNET_STATE_IDLE No network requests are being made by WinInet. INTERNET_STATE_BUSY Network requests are being made by WinInet. - lpvStatusInformation
- Address of a buffer that contains information pertinent to this call to the callback function.
- dwStatusInformationLength
- Size of the lpvStatusInformation buffer.
The lpvStatusInformation parameter points to an INTERNET_ASYNC_RESULT structure. The dwStatusInformationLength parameter contains the final completion status of the asynchronous function. If this is ERROR_INTERNET_EXTENDED_ERROR, the application can retrieve the server error information by using InternetGetLastResponseInfo.
In the case of INTERNET_STATUS_REQUEST_COMPLETE, lpvStatusInformation is the address of an INTERNET_ASYNC_RESULT structure.
An application uses the callback function to indicate the progress of synchronous and asynchronous functions, and to indicate the completion of an asynchronous request.
Because callbacks are made during processing of the request, the application should spend as little time as possible in the callback function to avoid degrading data throughput on the network. For example, displaying a dialog box in a callback function may 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.
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.