diff options
| author | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-12 22:33:32 -0800 |
| commit | c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch) | |
| tree | df9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/core/RegKey.java | |
| download | worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip | |
Initial commit
Diffstat (limited to 'NET/worlds/core/RegKey.java')
| -rw-r--r-- | NET/worlds/core/RegKey.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/NET/worlds/core/RegKey.java b/NET/worlds/core/RegKey.java new file mode 100644 index 0000000..86ebf91 --- /dev/null +++ b/NET/worlds/core/RegKey.java @@ -0,0 +1,50 @@ +package NET.worlds.core; + +public class RegKey { + public static final int CLASSES_ROOT = 0; + public static final int CURRENT_USER = 1; + public static final int LOCAL_MACHINE = 2; + public static final int USERS = 3; + public static final int KEYOPEN_READ = 0; + public static final int KEYOPEN_WRITE = 1; + public static final int KEYOPEN_CREATE = 2; + private int hKey; + + static { + nativeInit(); + } + + public static RegKey getRootKey(int type) throws RegKeyNotFoundException { + return new RegKey(getReservedKey(type)); + } + + public RegKey(RegKey base, String subKey, int mode) throws RegKeyNotFoundException { + if (mode == 2) { + this.hKey = createKey(base.hKey, subKey); + } else { + this.hKey = openKey(base.hKey, subKey, mode); + } + } + + public native String getStringValue(String var1); + + public native boolean setStringValue(String var1, String var2, boolean var3); + + public native int getIntValue(String var1); + + public native boolean setIntValue(String var1, int var2); + + public native void close(); + + private static native int getReservedKey(int var0) throws RegKeyNotFoundException; + + private static native int openKey(int var0, String var1, int var2) throws RegKeyNotFoundException; + + private static native int createKey(int var0, String var1); + + public static native void nativeInit(); + + private RegKey(int hKey) { + this.hKey = hKey; + } +} |