Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 89da96a9221173f25e00b0816548edb10221928d (plain) (blame)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*******************************************************************************
 * Copyright (c) 2008 compeople AG and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * 	compeople AG (Stefan Liebig) - initial API and implementation
 *******************************************************************************/
package org.eclipse.core.internal.net.proxy.win32.winhttp;

/**
 * This is the Win32 WinHttp wrapper.
 * <p>
 * Not complete, but offers what we currently need
 * </p>
 */
public final class WinHttp {

	/**
	 * The constant indicates the null proxy name parameter
	 */
	static final String NO_PROXY_NAME= null;

	/**
	 * The constant indicates the null proxy bypass parameter
	 */
	static final String NO_PROXY_BYPASS= null;

	/**
	 * WinHttpOpen - see Microsoft SDK Documentation
	 * 
	 * @param userAgent
	 * @param accessType
	 * @param proxyName
	 * @param proxyBypass
	 * @param flags
	 * @return the handle
	 */
	public static native int open(String userAgent, int accessType, String proxyName, String proxyBypass, int flags);

	/**
	 * WinHttpCloseHandle - see Microsoft SDK Documentation
	 * 
	 * @param hInternet
	 * @return true on success
	 */
	public static native boolean closeHandle(int hInternet);

	/**
	 * WinHttpGetIEProxyConfigForCurrentUser - see Microsoft SDK Documentation
	 * 
	 * @param proxyConfig
	 * @return true on success
	 */
	public static native boolean getIEProxyConfigForCurrentUser(WinHttpCurrentUserIEProxyConfig proxyConfig);

	/**
	 * WinHttpGetProxyForUrl - see Microsoft SDK Documentation
	 * 
	 * @param hSession
	 * @param url
	 * @param autoProxyOptions
	 * @param proxyInfo
	 * @return true on success
	 */
	public static native boolean getProxyForUrl(int hSession, String url, WinHttpAutoProxyOptions autoProxyOptions, WinHttpProxyInfo proxyInfo);

	/**
	 * WinHttpDetectAutoProxyConfigUrl - see Microsoft SDK Documentation
	 * 
	 * @param autoProxyHolder
	 * @return true on success
	 */
	public static native boolean detectAutoProxyConfigUrl(AutoProxyHolder autoProxyHolder);

	/**
	 * GetLastError - see Microsoft SDK Documentation
	 * 
	 * @return the last error code (win32)
	 */
	public static native int getLastError();

	/**
	 * GetLastErrorMessage - formats the last error
	 * 
	 * @return the readable last error code
	 */
	public static native String getLastErrorMessage();

}

Back to the top