From ed05e577cd9258874b83766e27c54c046a8e3084 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 4 Dec 2006 23:17:57 +0000 Subject: [PATCH] add windows linkage --- .../sigar/vmware/VMControlLibrary.java | 90 ++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-) diff --git a/bindings/java/src/org/hyperic/sigar/vmware/VMControlLibrary.java b/bindings/java/src/org/hyperic/sigar/vmware/VMControlLibrary.java index fe56b0a5..b4695695 100644 --- a/bindings/java/src/org/hyperic/sigar/vmware/VMControlLibrary.java +++ b/bindings/java/src/org/hyperic/sigar/vmware/VMControlLibrary.java @@ -23,8 +23,17 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.Arrays; +import java.util.ArrayList; +import java.util.List; + +import org.hyperic.sigar.SigarLoader; +import org.hyperic.sigar.win32.RegistryKey; +import org.hyperic.sigar.win32.Win32Exception; public class VMControlLibrary { + public static final String REGISTRY_ROOT = + "SOFTWARE\\VMware, Inc."; + public static final String PROP_VMCONTROL_SHLIB = "vmcontrol.shlib"; @@ -36,6 +45,9 @@ public class VMControlLibrary { private static final String VMCONTROL = "vmcontrol"; + private static final String VMCONTROL_DLL = + VMCONTROL + "lib.dll"; + private static final String VMCONTROL_OBJ = getProperty("vmcontrol.o", "control-only/" + VMCONTROL + ".o"); @@ -90,9 +102,71 @@ public class VMControlLibrary { link(VMCONTROL + ".so"); } + private static void linkWin32() { + List dlls = new ArrayList(); + + RegistryKey root = null; + try { + root = + RegistryKey.LocalMachine.openSubKey(REGISTRY_ROOT); + + String[] keys = root.getSubKeyNames(); + for (int i=0; i