-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
winhttp_data_windows.go
51 lines (43 loc) · 1.7 KB
/
winhttp_data_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package ieproxy
import "golang.org/x/sys/windows"
var winHttp = windows.NewLazySystemDLL("winhttp.dll")
var winHttpGetProxyForURL = winHttp.NewProc("WinHttpGetProxyForUrl")
var winHttpOpen = winHttp.NewProc("WinHttpOpen")
var winHttpCloseHandle = winHttp.NewProc("WinHttpCloseHandle")
var winHttpGetIEProxyConfigForCurrentUser = winHttp.NewProc("WinHttpGetIEProxyConfigForCurrentUser")
var winHttpGetDefaultProxyConfiguration = winHttp.NewProc("WinHttpGetDefaultProxyConfiguration")
type tWINHTTP_AUTOPROXY_OPTIONS struct {
dwFlags autoProxyFlag
dwAutoDetectFlags autoDetectFlag
lpszAutoConfigUrl *uint16
lpvReserved *uint16
dwReserved uint32
fAutoLogonIfChallenged bool
}
type autoProxyFlag uint32
const (
fWINHTTP_AUTOPROXY_AUTO_DETECT = autoProxyFlag(0x00000001)
fWINHTTP_AUTOPROXY_CONFIG_URL = autoProxyFlag(0x00000002)
fWINHTTP_AUTOPROXY_NO_CACHE_CLIENT = autoProxyFlag(0x00080000)
fWINHTTP_AUTOPROXY_NO_CACHE_SVC = autoProxyFlag(0x00100000)
fWINHTTP_AUTOPROXY_NO_DIRECTACCESS = autoProxyFlag(0x00040000)
fWINHTTP_AUTOPROXY_RUN_INPROCESS = autoProxyFlag(0x00010000)
fWINHTTP_AUTOPROXY_RUN_OUTPROCESS_ONLY = autoProxyFlag(0x00020000)
fWINHTTP_AUTOPROXY_SORT_RESULTS = autoProxyFlag(0x00400000)
)
type autoDetectFlag uint32
const (
fWINHTTP_AUTO_DETECT_TYPE_DHCP = autoDetectFlag(0x00000001)
fWINHTTP_AUTO_DETECT_TYPE_DNS_A = autoDetectFlag(0x00000002)
)
type tWINHTTP_PROXY_INFO struct {
dwAccessType uint32
lpszProxy *uint16
lpszProxyBypass *uint16
}
type tWINHTTP_CURRENT_USER_IE_PROXY_CONFIG struct {
fAutoDetect bool
lpszAutoConfigUrl *uint16
lpszProxy *uint16
lpszProxyBypass *uint16
}