WinHttpDetectAutoProxyUrl (winhttp)
Last changed: brubli@outlook.com-141.249.133.142

.

Get pac url from DHCP or DNS.

C# Signature:

[DllImport("winhttp.dll", SetLastError = true, CharSet = CharSet.Unicode)]

[return: MarshalAs(UnmanagedType.Bool)]

public static extern Boolean WinHttpDetectAutoProxyConfigUrl(

    UInt32 dwAutoDetectFlags,
    [MarshalAs(UnmanagedType.LPWStr)] out String ppwstrAutoConfigUrl

);

VB Signature:

Declare Function WinHttpDetectAutoProxyUrl Lib "winhttp.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

Values for dwAutoDetectFlags :

    UInt32 WINHTTP_AUTO_DETECT_TYPE_DHCP = 0x00000001;
    UInt32 WINHTTP_AUTO_DETECT_TYPE_DNS_A = 0x00000002;

or both

    WINHTTP_AUTO_DETECT_TYPE_DHCP|WINHTTP_AUTO_DETECT_TYPE_DNS_A

If both the DHCP and DNS auto detect flags are set, DHCP is used first; if no PAC URL is discovered using DHCP, then DNS is used

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Documentation