| 1 | /* |
| 2 | * $Id: Process.java,v 1.1.1.5 2004/05/25 20:23:16 hastings Exp $ |
| 3 | * |
| 4 | * (c) Copyright, Moebius Solutions, Inc., 2004 |
| 5 | * |
| 6 | * All Rights Reserved |
| 7 | * |
| 8 | * This material may be reproduced by or for the U. S. Government |
| 9 | * pursuant to the copyright license under the clause at |
| 10 | * DFARS 252.227-7014 (OCT 2001). |
| 11 | */ |
| 12 | |
| 13 | package com.moesol.bindings.platform_sdk.base_services; |
| 14 | |
| 15 | import com.moesol.bindings.NativeLibraryLoader; |
| 16 | import com.moesol.bindings.platform_sdk.windows_api.PlatformSDK; |
| 17 | import com.moesol.bindings.platform_sdk.windows_api.Win32Exception; |
| 18 | |
| 19 | /** |
| 20 | * @author robert |
| 21 | */ |
| 22 | public class Process { |
| 23 | static { |
| 24 | NativeLibraryLoader.loadLibrary("com_moesol_bindings"); |
| 25 | } |
| 26 | public static String GetEnvironmentVariable(String name) { |
| 27 | return jni_GetEnvironmentVariable(name); |
| 28 | } |
| 29 | public static void SetEnvironmentVariable(String name, String value) { |
| 30 | boolean r = jni_SetEnvironmentVariable(name, value); |
| 31 | if (!r) { |
| 32 | throw new Win32Exception(PlatformSDK.GetLastError()); |
| 33 | } |
| 34 | } |
| 35 | private static native String jni_GetEnvironmentVariable(String name); |
| 36 | private static native boolean jni_SetEnvironmentVariable(String name, |
| 37 | String value); |
| 38 | } |