add translation to getKeys and getInstances

This commit is contained in:
Doug MacEachern 2007-03-06 02:21:28 +00:00
parent 3345613037
commit 955891dbef
1 changed files with 5 additions and 2 deletions

View File

@ -201,6 +201,9 @@ public class Pdh extends Win32 {
private static final String DELIM = "\\"; private static final String DELIM = "\\";
private static int[] getCounterIndex(String englishName) { private static int[] getCounterIndex(String englishName) {
if (counters == null) {
return null;
}
return (int[])counters.get(englishName.toLowerCase()); return (int[])counters.get(englishName.toLowerCase());
} }
@ -290,11 +293,11 @@ public class Pdh extends Win32 {
} }
public static String[] getInstances(String path) throws Win32Exception { public static String[] getInstances(String path) throws Win32Exception {
return pdhGetInstances(path); return pdhGetInstances(getCounterName(path));
} }
public static String[] getKeys(String path) throws Win32Exception { public static String[] getKeys(String path) throws Win32Exception {
return pdhGetKeys(path); return pdhGetKeys(getCounterName(path));
} }
public static String[] getObjects() throws Win32Exception { public static String[] getObjects() throws Win32Exception {