// Path: lib/src/WinRun4J/src/org/boris/winrun4j/PInvoke.java
// public static class UIntPtr extends IntPtr
// {
//     public UIntPtr() {
//     }
// 
//     public UIntPtr(long value) {
//         this.value = value;
//     }
// }
// 
// Path: lib/src/WinRun4J/src/org/boris/winrun4j/Registry.java
// public static class QUERY_INFO
// {
//     public String keyClass;
//     public int subKeyCount;
//     public int maxSubkeyLen;
//     public int maxClassLen;
//     public int valueCount;
//     public int maxValueNameLen;
//     public int maxValueLen;
//     public int cbSecurityDescriptor;
//     public FILETIME lastWriteTime;
// }


import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.HashMap;
import java.util.Map;
import org.boris.winrun4j.PInvoke.UIntPtr;
import org.boris.winrun4j.Registry.QUERY_INFO;
        if (k.exists())
            return defaultValue ? k.getString(null) : k.getString(p[p.length - 1]);

        return null;
    }

    /**
     * Opens up the key for this path. Windows doesn't provide a way to open up
     * a path.
     */
    private long openKeyHandle(long handle, String[] path, boolean readOnly) {
        long h = handle;
        if (path == null)
            return h;
        for (int i = 0; i < path.length; i++) {
            long nh = openKeyHandle(h, path[i], readOnly);
            if (h != handle)
                Registry.closeKey(h);
            h = nh;
        }
        return h;
    }

    /**
     * Gets the subkeys for this key.
     * 
     * @return String[].
     */
    public String[] getSubKeyNames() {
        long h = openKeyHandle(handle, path, true);
// Path: lib/src/WinRun4J/src/org/boris/winrun4j/PInvoke.java
// public static class UIntPtr extends IntPtr
// {
//     public UIntPtr() {
//     }
// 
//     public UIntPtr(long value) {
//         this.value = value;
//     }
// }
// 
// Path: lib/src/WinRun4J/src/org/boris/winrun4j/Registry.java
// public static class QUERY_INFO
// {
//     public String keyClass;
//     public int subKeyCount;
//     public int maxSubkeyLen;
//     public int maxClassLen;
//     public int valueCount;
//     public int maxValueNameLen;
//     public int maxValueLen;
//     public int cbSecurityDescriptor;
//     public FILETIME lastWriteTime;
// }


// Path: lib/src/WinRun4J/src/org/boris/winrun4j/RegistryKey.java
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.HashMap;
import java.util.Map;
import org.boris.winrun4j.PInvoke.UIntPtr;
import org.boris.winrun4j.Registry.QUERY_INFO;

        if (k.exists())
            return defaultValue ? k.getString(null) : k.getString(p[p.length - 1]);

        return null;
    }

    /**
     * Opens up the key for this path. Windows doesn't provide a way to open up
     * a path.
     */
    private long openKeyHandle(long handle, String[] path, boolean readOnly) {
        long h = handle;
        if (path == null)
            return h;
        for (int i = 0; i < path.length; i++) {
            long nh = openKeyHandle(h, path[i], readOnly);
            if (h != handle)
                Registry.closeKey(h);
            h = nh;
        }
        return h;
    }

    /**
     * Gets the subkeys for this key.
     * 
     * @return String[].
     */
    public String[] getSubKeyNames() {
        long h = openKeyHandle(handle, path, true);
        QUERY_INFO qi = Registry.queryInfoKey(h);