// Path: lib/src/WinRun4J/src/org/boris/winrun4j/PInvoke.java
// public static class ByteArrayBuilder
// {
//     private byte[] array;
// 
//     public void set(byte[] array) {
//         this.array = array;
//     }
// 
//     public byte[] toArray() {
//         return array;
//     }
// }
// 
// Path: lib/src/WinRun4J/src/org/boris/winrun4j/PInvoke.java
// public static class IntPtr
// {
//     public long value;
// 
//     public IntPtr() {
//     }
// 
//     public IntPtr(long value) {
//         this.value = value;
//     }
// 
//     public int intValue() {
//         return (int) value;
//     }
// 
//     public String toString() {
//         return Long.toString(value);
//     }
// }
// 
// Path: lib/src/WinRun4J/src/org/boris/winrun4j/PInvoke.java
// public interface Struct
// {
// }
// 
// 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;
//     }
// }


import org.boris.winrun4j.PInvoke.ByteArrayBuilder;
import org.boris.winrun4j.PInvoke.DllImport;
import org.boris.winrun4j.PInvoke.IntPtr;
import org.boris.winrun4j.PInvoke.Out;
import org.boris.winrun4j.PInvoke.Struct;
import org.boris.winrun4j.PInvoke.UIntPtr;
/*******************************************************************************
 * This program and the accompanying materials
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at 
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     Peter Smith
 *******************************************************************************/
package org.boris.winrun4j;


public class Registry
{
    static {
        PInvoke.bind(Registry.class, "advapi32.dll");
    }

    // Value Types
    public static final int REG_NONE = 0;
    public static final int REG_SZ = 1;
    public static final int REG_EXPAND_SZ = 2;
    public static final int REG_BINARY = 3;
    public static final int REG_DWORD = 4;
    public static final int REG_DWORD_LITTLE_ENDIAN = 4;
    public static final int REG_DWORD_BIG_ENDIAN = 5;
    public static final int REG_LINK = 6;
    public static final int REG_MULTI_SZ = 7;
    public static final int REG_RESOURCE_LIST = 8;
    public static final int REG_FULL_RESOURCE_DESCRIPTOR = 9;
    public static final int REG_RESOURCE_REQUIREMENTS_LIST = 10;
    public static final int REG_QWORD = 11;
    public static final int REG_QWORD_LITTLE_ENDIAN = 11;

    @DllImport(entryPoint = "RegCloseKey")
    public static native int closeKey(long hKey);

    @DllImport(entryPoint = "RegCreateKeyW")
// Path: lib/src/WinRun4J/src/org/boris/winrun4j/PInvoke.java
// public static class ByteArrayBuilder
// {
//     private byte[] array;
// 
//     public void set(byte[] array) {
//         this.array = array;
//     }
// 
//     public byte[] toArray() {
//         return array;
//     }
// }
// 
// Path: lib/src/WinRun4J/src/org/boris/winrun4j/PInvoke.java
// public static class IntPtr
// {
//     public long value;
// 
//     public IntPtr() {
//     }
// 
//     public IntPtr(long value) {
//         this.value = value;
//     }
// 
//     public int intValue() {
//         return (int) value;
//     }
// 
//     public String toString() {
//         return Long.toString(value);
//     }
// }
// 
// Path: lib/src/WinRun4J/src/org/boris/winrun4j/PInvoke.java
// public interface Struct
// {
// }
// 
// 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
import org.boris.winrun4j.PInvoke.ByteArrayBuilder;
import org.boris.winrun4j.PInvoke.DllImport;
import org.boris.winrun4j.PInvoke.IntPtr;
import org.boris.winrun4j.PInvoke.Out;
import org.boris.winrun4j.PInvoke.Struct;
import org.boris.winrun4j.PInvoke.UIntPtr;

/*******************************************************************************
 * This program and the accompanying materials
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at 
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     Peter Smith
 *******************************************************************************/
package org.boris.winrun4j;


public class Registry
{
    static {
        PInvoke.bind(Registry.class, "advapi32.dll");
    }

    // Value Types
    public static final int REG_NONE = 0;
    public static final int REG_SZ = 1;
    public static final int REG_EXPAND_SZ = 2;
    public static final int REG_BINARY = 3;
    public static final int REG_DWORD = 4;
    public static final int REG_DWORD_LITTLE_ENDIAN = 4;
    public static final int REG_DWORD_BIG_ENDIAN = 5;
    public static final int REG_LINK = 6;
    public static final int REG_MULTI_SZ = 7;
    public static final int REG_RESOURCE_LIST = 8;
    public static final int REG_FULL_RESOURCE_DESCRIPTOR = 9;
    public static final int REG_RESOURCE_REQUIREMENTS_LIST = 10;
    public static final int REG_QWORD = 11;
    public static final int REG_QWORD_LITTLE_ENDIAN = 11;

    @DllImport(entryPoint = "RegCloseKey")
    public static native int closeKey(long hKey);

    @DllImport(entryPoint = "RegCreateKeyW")
    public static native int createKey(long hKey, String lpSubKey, @Out UIntPtr phkResult);