dahall / Vanara

A set of .NET libraries for Windows implementing PInvoke calls to many native Windows APIs with supporting wrappers.
MIT License
1.75k stars 190 forks source link

WinINet.InternetSetOption seems breaking change in 4.0.0 #460

Closed GF-Huang closed 2 months ago

GF-Huang commented 2 months ago

Describe the bug and how to reproduce

3.4.17

image

4.0.0

image

What code is involved

WinINet.InternetSetOption(WinINet.HINTERNET.NULL, WinINet.InternetOptionFlags.INTERNET_OPTION_PROXY_SETTINGS_CHANGED)

exception:

Error: System.ArgumentException: INTERNET_OPTION_PROXY_SETTINGS_CHANGED cannot be used to set options that do not require a value.
at Vanara.PInvoke.WinINet.InternetSetOption(HINTERNET hInternet, InternetOptionFlags option)
at Submission#5.<<Initialize>>d__0.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult](ImmutableArray`1 precedingExecutors, Func`2 currentExecutor, StrongBox`1 exceptionHolderOpt, Func`2 catchExceptionOpt, CancellationToken cancellationToken)

Expected behavior No exception as 3.4.17.

dahall commented 2 months ago

Thank you. Fixed for 4.0.1.