InternetErrorDlg function (wininet.h)
Displays a dialog box for the error that is passed to InternetErrorDlg, if an appropriate dialog box exists. If the FLAGS_ERROR_UI_FILTER_FOR_ERRORS flag is used, the function also checks the headers for any hidden errors and displays a dialog box if needed.
Syntax
DWORD InternetErrorDlg(
[in] HWND hWnd,
[in, out] HINTERNET hRequest,
[in] DWORD dwError,
[in] DWORD dwFlags,
[in, out] LPVOID *lppvData
);
Parameters
[in] hWnd
Handle to the parent window for any needed dialog box. If no dialog box is needed and FLAGS_ERROR_UI_FLAGS_NO_UI is passed to dwFlags, then this parameter can be NULL.
[in, out] hRequest
Handle to the Internet connection used in the call to HttpSendRequest.
[in] dwError
Error value for which to display a dialog box. This parameter can be one of the following values.
Value | Meaning |
---|---|
|
Allows the user to confirm the redirect. |
|
Displays a dialog indicating that the auto proxy script is invalid. |
|
Displays a dialog asking the user whether to post the given data on a non-secure channel. |
|
The server is requesting a client certificate.
The return value for this error is always ERROR_SUCCESS, regardless of whether or not the user has selected a certificate. If the user has not selected a certificate then anonymous client authentication will be attempted on the subsequent request. |
|
Notifies the user of the zone crossing to a secure site. |
|
Notifies the user of the zone crossing from a secure site. |
|
Notifies the user that the data being posted is now being redirected to a non-secure site. |
|
Displays a dialog box requesting the user's name and password. |
|
Indicates that the SSL certificate Common Name (host name field) is incorrect. Displays an Invalid SSL Common Name dialog box and lets the user view the incorrect certificate. |
|
Displays a warning to the user concerning mixed secure and non-secure content. |
|
Displays a dialog asking the user whether to post the given data on a non-secure channel. |
|
Indicates that the SSL certificate Common Name (host name field) is incorrect. Displays an Invalid SSL Common Name dialog box and lets the user view the incorrect certificate. Also allows the user to select a certificate in response to a server request. |
|
Displays a warning to the user showing the issues with the server certificate. |
|
Tells the user that the SSL certificate has expired. |
|
Displays a warning to the user showing that the server certificate’s revocation check failed. |
|
Displays a dialog indicating that the server certificate is revoked. |
|
Displays a dialog indicating that the auto proxy script could not be downloaded. |
[in] dwFlags
Actions. This parameter can be one or more of the following values.
Value | Meaning |
---|---|
|
Scans the returned headers for errors. Call InternetErrorDlg with this flag set following a call to HttpSendRequest so as to detect hidden errors. Authentication errors, for example, are normally hidden because the call to HttpSendRequest completes successfully, but by scanning the status codes, InternetErrorDlg can determine that the proxy or server requires authentication. |
|
If the function succeeds, stores the results of the dialog box in the Internet handle. |
|
Queries the Internet handle for needed information. The function constructs the appropriate data structure for the error. (For example, for Cert CN failures, the function grabs the certificate.) |
|
Serializes authentication dialog boxes for concurrent requests on a password cache entry. The lppvData parameter should contain the address of a pointer to an INTERNET_AUTH_NOTIFY_DATA structure, and the client should implement a thread-safe, non-blocking callback function. |
|
Allows the caller to pass NULL to the hWnd parameter without error. To be used in circumstances in which no user interface is required. |
[in, out] lppvData
Pointer to the address of a data structure. The structure can be different for each error that needs to be handled.
Return value
Returns one of the following values, or an error value otherwise.
Return code | Description |
---|---|
|
The function completed successfully.
For more information, see ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED in the dwError parameter. |
|
The function was canceled by the user. |
|
This indicates that the function needs to redo its request. In the case of authentication this indicates that the user clicked the OK button. |
|
The handle to the parent window is invalid. |
Remarks
Always inform the user when any of the following events occur:
- ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR
- ERROR_INTERNET_INVALID_CA
- ERROR_INTERNET_POST_IS_NON_SECURE
- ERROR_INTERNET_SEC_CERT_CN_INVALID
- ERROR_INTERNET_SEC_CERT_DATE_INVALID
Like all other aspects of the WinINet API, this function cannot be safely called from within DllMain or the constructors and destructors of global objects.
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 |
Library | Wininet.lib |
DLL | Wininet.dll |