diff --git a/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF index 07649b97f34..14341ae6e72 100644 --- a/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF +++ b/core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.core.native;singleton:=true -Bundle-Version: 6.0.100.qualifier +Bundle-Version: 6.1.0.qualifier Bundle-Activator: org.eclipse.cdt.internal.core.natives.CNativePlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/core/org.eclipse.cdt.core.native/pom.xml b/core/org.eclipse.cdt.core.native/pom.xml index 0bee5d6e28a..93d4098d2cd 100644 --- a/core/org.eclipse.cdt.core.native/pom.xml +++ b/core/org.eclipse.cdt.core.native/pom.xml @@ -23,7 +23,7 @@ ../../pom.xml - 6.0.100-SNAPSHOT + 6.1.0-SNAPSHOT org.eclipse.cdt.core.native eclipse-plugin diff --git a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/WindowsRegistry.java b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/WindowsRegistry.java index f2054512232..c35b672efb1 100644 --- a/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/WindowsRegistry.java +++ b/core/org.eclipse.cdt.core.native/src/org/eclipse/cdt/utils/WindowsRegistry.java @@ -13,6 +13,8 @@ *******************************************************************************/ package org.eclipse.cdt.utils; +import java.util.Map; + import org.eclipse.cdt.internal.core.natives.CNativePlugin; import org.eclipse.core.runtime.CoreException; @@ -51,6 +53,15 @@ public abstract class WindowsRegistry { */ public abstract String getLocalMachineValue(String subkey, String name); + /** + * Given a subkey of HKEY_LOCAL_MACHINE, return the map of valueName => value. + * The return value is an empty map on error or when the subkey does not exist. + * @param subkey subkey of HKEY_LOCAL_MACHINE + * @return valueName => value map of the entries in subkey + * @since 6.1 + */ + public abstract Map getLocalMachineValues(String subkey); + /** * Given a subkey of HKEY_LOCAL_MACHINE, and an index (starting from 0) * to the key's array of values, return the name of the indexed value. @@ -69,7 +80,7 @@ public abstract class WindowsRegistry { * The return value is null on any error or when the index is invalid. * The key name can be used in the above getLocalMachineValueName() * to retrieve value names. - * @param subkey subkey of HKEY_CURRENT_USER + * @param subkey subkey of HKEY_LOCAL_MACHINE * @param index index to the subkey's array of values, starting from 0. * @return name of registry value or null if not found */ @@ -85,6 +96,15 @@ public abstract class WindowsRegistry { */ public abstract String getCurrentUserValue(String subkey, String name); + /** + * Given a subkey of HKEY_CURRENT_USER, return the map of valueName => value. + * The return value is an empty map on error or when the subkey does not exist. + * @param subkey subkey of HKEY_CURRENT_USER + * @return valueName => value map of the entries in subkey + * @since 6.1 + */ + public abstract Map getCurrentUserValues(String subkey); + /** * Given a subkey of HKEY_CURRENT_USER, and an index (starting from 0) * to the key's array of values, return the name of the indexed value. diff --git a/core/org.eclipse.cdt.core.win32/META-INF/MANIFEST.MF b/core/org.eclipse.cdt.core.win32/META-INF/MANIFEST.MF index 17c5c1cdc83..7abccf9023e 100644 --- a/core/org.eclipse.cdt.core.win32/META-INF/MANIFEST.MF +++ b/core/org.eclipse.cdt.core.win32/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %fragmentName.win32 Bundle-SymbolicName: org.eclipse.cdt.core.win32; singleton:=true -Bundle-Version: 6.0.0.qualifier +Bundle-Version: 6.0.100.qualifier Bundle-Vendor: %providerName -Fragment-Host: org.eclipse.cdt.core.native;bundle-version="[6.0.0,7.0.0)" +Fragment-Host: org.eclipse.cdt.core.native;bundle-version="[6.1.0,7.0.0)" Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-11 Eclipse-PlatformFilter: (osgi.os=win32) diff --git a/core/org.eclipse.cdt.core.win32/pom.xml b/core/org.eclipse.cdt.core.win32/pom.xml index 3c635742105..4de5713f946 100644 --- a/core/org.eclipse.cdt.core.win32/pom.xml +++ b/core/org.eclipse.cdt.core.win32/pom.xml @@ -11,7 +11,7 @@ ../../pom.xml - 6.0.0-SNAPSHOT + 6.0.100-SNAPSHOT org.eclipse.cdt.core.win32 eclipse-plugin diff --git a/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/WindowsRegistryImpl.java b/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/WindowsRegistryImpl.java index 0327dbffcf9..42b0431c76a 100644 --- a/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/WindowsRegistryImpl.java +++ b/core/org.eclipse.cdt.core.win32/src/org/eclipse/cdt/internal/core/win32/WindowsRegistryImpl.java @@ -13,6 +13,9 @@ *******************************************************************************/ package org.eclipse.cdt.internal.core.win32; +import java.util.Collections; +import java.util.Map; + import org.eclipse.cdt.internal.core.natives.CNativePlugin; import org.eclipse.cdt.utils.WindowsRegistry; import org.eclipse.core.runtime.Platform; @@ -41,6 +44,11 @@ public class WindowsRegistryImpl extends WindowsRegistry { return getValue(WinReg.HKEY_LOCAL_MACHINE, subkey, name); } + @Override + public Map getLocalMachineValues(String subkey) { + return getValues(WinReg.HKEY_LOCAL_MACHINE, subkey); + } + @Override public String getLocalMachineValueName(String subkey, int index) { return getValueName(WinReg.HKEY_LOCAL_MACHINE, subkey, index); @@ -56,6 +64,11 @@ public class WindowsRegistryImpl extends WindowsRegistry { return getValue(WinReg.HKEY_CURRENT_USER, subkey, name); } + @Override + public Map getCurrentUserValues(String subkey) { + return getValues(WinReg.HKEY_CURRENT_USER, subkey); + } + @Override public String getCurrentUserValueName(String subkey, int index) { return getValueName(WinReg.HKEY_CURRENT_USER, subkey, index); @@ -118,4 +131,15 @@ public class WindowsRegistryImpl extends WindowsRegistry { return null; } } + + private Map getValues(HKEY key, String subkey) { + try { + return Advapi32Util.registryGetValues(key, subkey); + } catch (Win32Exception e) { + if (DEBUG) { + CNativePlugin.log(String.format("Unable to get values for %s", subkey), e); //$NON-NLS-1$ + } + return Collections.emptyMap(); + } + } }