|
Lines 27-32
Link Here
|
| 27 |
|
27 |
|
| 28 |
import org.eclipse.core.runtime.IPath; |
28 |
import org.eclipse.core.runtime.IPath; |
| 29 |
import org.eclipse.core.runtime.Platform; |
29 |
import org.eclipse.core.runtime.Platform; |
|
|
30 |
import org.eclipse.hyades.execution.recorder.local.appadapters.JNIWrapper; |
| 30 |
|
31 |
|
| 31 |
/** |
32 |
/** |
| 32 |
* @author mdunn |
33 |
* @author mdunn |
|
Lines 66-73
Link Here
|
| 66 |
private String proxyOverrideString = ""; |
67 |
private String proxyOverrideString = ""; |
| 67 |
private String autoConfigURLString = ""; |
68 |
private String autoConfigURLString = ""; |
| 68 |
|
69 |
|
|
|
70 |
private boolean bUseNativeRegistryInterface = false; |
| 71 |
private JNIWrapper jniWrapper = null; |
| 72 |
|
| 69 |
public RecorderRegistryInfo() { |
73 |
public RecorderRegistryInfo() { |
| 70 |
StringBuffer inputFileContents = getRegistryInfo(); |
74 |
StringBuffer inputFileContents = getRegistryInfo(); |
|
|
75 |
if (bUseNativeRegistryInterface) |
| 76 |
inputFileContents = getRegistryInfoUsingNativeAPI(); |
| 71 |
// below is for bugzilla 177396 mdd |
77 |
// below is for bugzilla 177396 mdd |
| 72 |
String checkVistaError=inputFileContents.toString(); |
78 |
String checkVistaError=inputFileContents.toString(); |
| 73 |
if (checkVistaError.equalsIgnoreCase("VISTA_ADMIN_ERROR")) { |
79 |
if (checkVistaError.equalsIgnoreCase("VISTA_ADMIN_ERROR")) { |
|
Lines 154-160
Link Here
|
| 154 |
if (currentOS.equals("win32")) { |
160 |
if (currentOS.equals("win32")) { |
| 155 |
String myVersion = System.getProperty("os.version"); |
161 |
String myVersion = System.getProperty("os.version"); |
| 156 |
if (myVersion.startsWith("6")) { |
162 |
if (myVersion.startsWith("6")) { |
| 157 |
inputFileContents.append("VISTA_ADMIN_ERROR"); |
163 |
try{ |
|
|
164 |
// Bugilla 168597, use native registry calls |
| 165 |
// instead of displaying an error message |
| 166 |
jniWrapper = new JNIWrapper(); |
| 167 |
bUseNativeRegistryInterface = true; |
| 168 |
} |
| 169 |
catch (UnsatisfiedLinkError e2){ |
| 170 |
inputFileContents.append("VISTA_ADMIN_ERROR"); |
| 171 |
} |
| 158 |
} |
172 |
} |
| 159 |
else { |
173 |
else { |
| 160 |
inputFileContents.append("WINDOWS_ADMIN_ERROR"); |
174 |
inputFileContents.append("WINDOWS_ADMIN_ERROR"); |
|
Lines 183-188
Link Here
|
| 183 |
} |
197 |
} |
| 184 |
return inputFileContents; |
198 |
return inputFileContents; |
| 185 |
} |
199 |
} |
|
|
200 |
|
| 201 |
// added for Bugilla 168597 |
| 202 |
StringBuffer getRegistryInfoUsingNativeAPI(){ |
| 203 |
StringBuffer inputFileContents = new StringBuffer(); |
| 204 |
// fire up an instance of the JNI layer to start using native code |
| 205 |
AddSettingToBuffer(jniWrapper, inputFileContents, "ProxyEnable"); |
| 206 |
AddSettingToBuffer(jniWrapper, inputFileContents, "AutoConfigURL"); |
| 207 |
AddSettingToBuffer(jniWrapper, inputFileContents, "ProxyServer"); |
| 208 |
AddSettingToBuffer(jniWrapper, inputFileContents, "ProxyOverride"); |
| 209 |
|
| 210 |
return inputFileContents; |
| 211 |
} |
| 212 |
|
| 213 |
private void AddSettingToBuffer(JNIWrapper jniWrapper, StringBuffer inputFileContents, String name){ |
| 214 |
String setting = jniWrapper.getInternetSetting(name); |
| 215 |
if (setting != null && setting.length() > 0){ |
| 216 |
inputFileContents.append("\"" + name + "\"=" + setting + "\r\n"); |
| 217 |
} |
| 218 |
return; |
| 219 |
} |
| 220 |
|
| 221 |
|
| 186 |
private boolean checkProxyEnabled(StringBuffer inputBuffer) |
222 |
private boolean checkProxyEnabled(StringBuffer inputBuffer) |
| 187 |
{ |
223 |
{ |
| 188 |
boolean comparesOK = false; |
224 |
boolean comparesOK = false; |