< prev index next >

src/java.prefs/windows/native/libprefs/WindowsPreferences.c

Print this page




  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #include <stdlib.h>
  27 #include <windows.h>
  28 #include "jni.h"
  29 #include "jni_util.h"
  30 #include "jvm.h"


  31 #ifdef __cplusplus
  32 extern "C" {
  33 #endif
  34 
  35 /*
  36  * Declare library specific JNI_Onload entry if static build
  37  */
  38 DEF_STATIC_JNI_OnLoad
  39 
  40 JNIEXPORT jlongArray JNICALL
  41 Java_java_util_prefs_WindowsPreferences_WindowsRegOpenKey(JNIEnv* env,
  42     jclass this_class, jlong hKey, jbyteArray lpSubKey, jint securityMask) {
  43     char* str = (*env)->GetByteArrayElements(env, lpSubKey, NULL);
  44     CHECK_NULL_RETURN(str, NULL);
  45 
  46     HKEY handle;
  47     int errorCode = RegOpenKeyEx((HKEY) hKey, str, 0, securityMask, &handle);
  48     (*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0);
  49 
  50     jlong tmp[2];




  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #include <stdlib.h>
  27 #include <windows.h>
  28 #include "jni.h"
  29 #include "jni_util.h"
  30 #include "jvm.h"
  31 #include "java_util_prefs_WindowsPreferences.h"
  32 
  33 #ifdef __cplusplus
  34 extern "C" {
  35 #endif
  36 
  37 /*
  38  * Declare library specific JNI_Onload entry if static build
  39  */
  40 DEF_STATIC_JNI_OnLoad
  41 
  42 JNIEXPORT jlongArray JNICALL
  43 Java_java_util_prefs_WindowsPreferences_WindowsRegOpenKey(JNIEnv* env,
  44     jclass this_class, jlong hKey, jbyteArray lpSubKey, jint securityMask) {
  45     char* str = (*env)->GetByteArrayElements(env, lpSubKey, NULL);
  46     CHECK_NULL_RETURN(str, NULL);
  47 
  48     HKEY handle;
  49     int errorCode = RegOpenKeyEx((HKEY) hKey, str, 0, securityMask, &handle);
  50     (*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0);
  51 
  52     jlong tmp[2];


< prev index next >