Notify WinINet After a Proxy Policy Change
Choose the notification or refresh operation matching the WinINet settings scope, then inspect its return value.
When a WinINet application changes proxy policy, writing the persistent value and making an existing consumer reconsider it are separate operations. Use the WinINet option that matches the scope being changed.
| Option | Documented purpose |
|---|---|
| INTERNET_OPTION_SETTINGS_CHANGED, 39 | Notify the system that registry settings changed, so they are verified on a subsequent InternetConnect call |
| INTERNET_OPTION_REFRESH, 37 | Reread proxy data for the applicable InternetOpen handle |
| INTERNET_OPTION_PROXY_SETTINGS_CHANGED, 95 | Notify WinINet instances that proxy settings changed |
These options are used through InternetSetOption. Their handle and buffer requirements belong to the selected option. For example, the documentation for the proxy-settings notification describes a null buffer and zero buffer length when alerting all available instances.
Keep the settings update, selected handle and notification together in the implementation. Check each Boolean result and obtain the Windows error when a call fails. A helper that ignores every return value cannot establish whether the change or its notification succeeded.
This is WinINet behavior. It does not reconfigure an unrelated WinHTTP session or an application’s explicit proxy object. Nor does it move an established TCP connection to another intermediary. Assess a newly created relevant connection when checking the applied route. If another application still uses the old route, identify its configuration source, stack and account.