author | bobv |
Mon, 19 Oct 2015 13:41:09 -0400 | |
changeset 33653 | c1ee09fe3274 |
parent 25859 | 3317bb8137f4 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
33653
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
25859
diff
changeset
|
2 |
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
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 |
* |
|
5506 | 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. |
|
2 | 24 |
*/ |
25 |
||
26 |
#include <stdlib.h> |
|
27 |
#include <windows.h> |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
28 |
#include "jni.h" |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
29 |
#include "jni_util.h" |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
30 |
#include "jvm.h" |
2 | 31 |
#ifdef __cplusplus |
32 |
extern "C" { |
|
33 |
#endif |
|
33653
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
25859
diff
changeset
|
34 |
|
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
25859
diff
changeset
|
35 |
/* |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
25859
diff
changeset
|
36 |
* Declare library specific JNI_Onload entry if static build |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
25859
diff
changeset
|
37 |
*/ |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
25859
diff
changeset
|
38 |
DEF_STATIC_JNI_OnLoad |
c1ee09fe3274
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
25859
diff
changeset
|
39 |
|
2 | 40 |
JNIEXPORT jintArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegOpenKey |
41 |
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray lpSubKey, jint securityMask) { |
|
42 |
HKEY handle; |
|
43 |
char* str; |
|
44 |
int tmp[2]; |
|
45 |
int errorCode=-1; |
|
46 |
jintArray result; |
|
47 |
str = (*env)->GetByteArrayElements(env, lpSubKey, NULL); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
48 |
CHECK_NULL_RETURN(str, NULL); |
2 | 49 |
errorCode = RegOpenKeyEx((HKEY)hKey, str, 0, securityMask, &handle); |
50 |
(*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0); |
|
51 |
tmp[0]= (int) handle; |
|
52 |
tmp[1]= errorCode; |
|
53 |
result = (*env)->NewIntArray(env,2); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
54 |
if (result != NULL) { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
55 |
(*env)->SetIntArrayRegion(env, result, 0, 2, tmp); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
56 |
} |
2 | 57 |
return result; |
58 |
} |
|
59 |
||
60 |
JNIEXPORT jint JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegCloseKey |
|
61 |
(JNIEnv* env, jclass this_class, jint hKey) { |
|
62 |
return (jint) RegCloseKey((HKEY) hKey); |
|
63 |
}; |
|
64 |
||
65 |
JNIEXPORT jintArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegCreateKeyEx |
|
66 |
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray lpSubKey) { |
|
67 |
HKEY handle; |
|
68 |
char* str; |
|
69 |
int tmp[3]; |
|
70 |
DWORD lpdwDisposition; |
|
71 |
int errorCode; |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
72 |
jintArray result = NULL; |
2 | 73 |
str = (*env)->GetByteArrayElements(env, lpSubKey, NULL); |
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
74 |
CHECK_NULL_RETURN(str, NULL); |
2 | 75 |
errorCode = RegCreateKeyEx((HKEY)hKey, str, 0, NULL, |
76 |
REG_OPTION_NON_VOLATILE, KEY_READ, |
|
77 |
NULL, &handle, &lpdwDisposition); |
|
78 |
(*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0); |
|
79 |
tmp[0]= (int) handle; |
|
80 |
tmp[1]= errorCode; |
|
81 |
tmp[2]= lpdwDisposition; |
|
82 |
result = (*env)->NewIntArray(env,3); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
83 |
if (result != NULL) { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
84 |
(*env)->SetIntArrayRegion(env, result, 0, 3, tmp); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
85 |
} |
2 | 86 |
return result; |
87 |
} |
|
88 |
||
89 |
JNIEXPORT jint JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegDeleteKey |
|
90 |
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray lpSubKey) { |
|
91 |
char* str; |
|
92 |
int result; |
|
93 |
str = (*env)->GetByteArrayElements(env, lpSubKey, NULL); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
94 |
CHECK_NULL_RETURN(str, -1); |
2 | 95 |
result = RegDeleteKey((HKEY)hKey, str); |
96 |
(*env)->ReleaseByteArrayElements(env, lpSubKey, str, 0); |
|
97 |
return result; |
|
98 |
||
99 |
}; |
|
100 |
||
101 |
JNIEXPORT jint JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegFlushKey |
|
102 |
(JNIEnv* env, jclass this_class, jint hKey) { |
|
103 |
return RegFlushKey ((HKEY)hKey); |
|
104 |
} |
|
105 |
||
106 |
JNIEXPORT jbyteArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegQueryValueEx |
|
107 |
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray valueName) { |
|
108 |
char* valueNameStr; |
|
109 |
char* buffer; |
|
110 |
jbyteArray result; |
|
111 |
DWORD valueType; |
|
112 |
DWORD valueSize; |
|
113 |
valueNameStr = (*env)->GetByteArrayElements(env, valueName, NULL); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
114 |
CHECK_NULL_RETURN(valueNameStr, NULL); |
2 | 115 |
if (RegQueryValueEx((HKEY)hKey, valueNameStr, NULL, &valueType, NULL, |
116 |
&valueSize) != ERROR_SUCCESS) { |
|
117 |
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0); |
|
118 |
return NULL; |
|
119 |
} |
|
120 |
||
121 |
buffer = (char*)malloc(valueSize); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
122 |
if (buffer != NULL) { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
123 |
if (RegQueryValueEx((HKEY)hKey, valueNameStr, NULL, &valueType, buffer, |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
124 |
&valueSize) != ERROR_SUCCESS) { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
125 |
free(buffer); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
126 |
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
127 |
return NULL; |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
128 |
} |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
129 |
} else { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
130 |
JNU_ThrowOutOfMemoryError(env, "native memory allocation failed"); |
2 | 131 |
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0); |
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
132 |
return NULL; |
2 | 133 |
} |
134 |
||
135 |
if (valueType == REG_SZ) { |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
136 |
result = (*env)->NewByteArray(env, valueSize); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
137 |
if (result != NULL) { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
138 |
(*env)->SetByteArrayRegion(env, result, 0, valueSize, buffer); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
139 |
} |
2 | 140 |
} else { |
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
141 |
result = NULL; |
2 | 142 |
} |
143 |
free(buffer); |
|
144 |
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0); |
|
145 |
return result; |
|
146 |
} |
|
147 |
||
148 |
||
149 |
||
150 |
||
151 |
JNIEXPORT jint JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegSetValueEx |
|
152 |
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray valueName, jbyteArray data) { |
|
153 |
char* valueNameStr; |
|
154 |
char* dataStr; |
|
155 |
int size = -1; |
|
156 |
int nameSize = -1; |
|
157 |
int error_code = -1; |
|
158 |
if ((valueName == NULL)||(data == NULL)) {return -1;} |
|
159 |
size = (*env)->GetArrayLength(env, data); |
|
160 |
dataStr = (*env)->GetByteArrayElements(env, data, NULL); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
161 |
CHECK_NULL_RETURN(dataStr, -1); |
2 | 162 |
valueNameStr = (*env)->GetByteArrayElements(env, valueName, NULL); |
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
163 |
if (valueNameStr != NULL) { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
164 |
error_code = RegSetValueEx((HKEY)hKey, valueNameStr, 0, |
2 | 165 |
REG_SZ, dataStr, size); |
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
166 |
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
167 |
} |
2 | 168 |
(*env)->ReleaseByteArrayElements(env, data, dataStr, 0); |
169 |
return error_code; |
|
170 |
} |
|
171 |
||
172 |
JNIEXPORT jint JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegDeleteValue |
|
173 |
(JNIEnv* env, jclass this_class, jint hKey, jbyteArray valueName) { |
|
174 |
char* valueNameStr; |
|
175 |
int error_code = -1; |
|
176 |
if (valueName == NULL) {return -1;} |
|
177 |
valueNameStr = (*env)->GetByteArrayElements(env, valueName, NULL); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
178 |
CHECK_NULL_RETURN(valueNameStr, -1); |
2 | 179 |
error_code = RegDeleteValue((HKEY)hKey, valueNameStr); |
180 |
(*env)->ReleaseByteArrayElements(env, valueName, valueNameStr, 0); |
|
181 |
return error_code; |
|
182 |
} |
|
183 |
||
184 |
JNIEXPORT jintArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegQueryInfoKey |
|
185 |
(JNIEnv* env, jclass this_class, jint hKey) { |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
186 |
jintArray result = NULL; |
2 | 187 |
int tmp[5]; |
188 |
int valuesNumber = -1; |
|
189 |
int maxValueNameLength = -1; |
|
190 |
int maxSubKeyLength = -1; |
|
191 |
int subKeysNumber = -1; |
|
192 |
int errorCode = -1; |
|
193 |
errorCode = RegQueryInfoKey((HKEY)hKey, NULL, NULL, NULL, |
|
194 |
&subKeysNumber, &maxSubKeyLength, NULL, |
|
195 |
&valuesNumber, &maxValueNameLength, |
|
196 |
NULL, NULL, NULL); |
|
197 |
tmp[0]= subKeysNumber; |
|
198 |
tmp[1]= (int)errorCode; |
|
199 |
tmp[2]= valuesNumber; |
|
200 |
tmp[3]= maxSubKeyLength; |
|
201 |
tmp[4]= maxValueNameLength; |
|
202 |
result = (*env)->NewIntArray(env,5); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
203 |
if (result != NULL) { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
204 |
(*env)->SetIntArrayRegion(env, result, 0, 5, tmp); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
205 |
} |
2 | 206 |
return result; |
207 |
} |
|
208 |
||
209 |
JNIEXPORT jbyteArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegEnumKeyEx |
|
210 |
(JNIEnv* env, jclass this_class, jint hKey , jint subKeyIndex, jint maxKeyLength) { |
|
211 |
int size = maxKeyLength; |
|
212 |
jbyteArray result; |
|
213 |
char* buffer = NULL; |
|
214 |
buffer = (char*)malloc(maxKeyLength); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
215 |
if (buffer == NULL) { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
216 |
JNU_ThrowOutOfMemoryError(env, "native memory allocation failed"); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
217 |
return NULL; |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
218 |
} |
2 | 219 |
if (RegEnumKeyEx((HKEY) hKey, subKeyIndex, buffer, &size, NULL, NULL, |
220 |
NULL, NULL) != ERROR_SUCCESS){ |
|
221 |
free(buffer); |
|
222 |
return NULL; |
|
223 |
} |
|
224 |
result = (*env)->NewByteArray(env, size + 1); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
225 |
if (result != NULL) { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
226 |
(*env)->SetByteArrayRegion(env, result, 0, size + 1, buffer); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
227 |
} |
2 | 228 |
free(buffer); |
229 |
return result; |
|
230 |
} |
|
231 |
||
232 |
JNIEXPORT jbyteArray JNICALL Java_java_util_prefs_WindowsPreferences_WindowsRegEnumValue |
|
233 |
(JNIEnv* env, jclass this_class, jint hKey , jint valueIndex, jint maxValueNameLength){ |
|
234 |
int size = maxValueNameLength; |
|
235 |
jbyteArray result; |
|
236 |
char* buffer = NULL; |
|
237 |
int error_code; |
|
238 |
buffer = (char*)malloc(maxValueNameLength); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
239 |
if (buffer == NULL) { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
240 |
JNU_ThrowOutOfMemoryError(env, "native memory allocation failed"); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
241 |
return NULL; |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
242 |
} |
2 | 243 |
error_code = RegEnumValue((HKEY) hKey, valueIndex, buffer, |
244 |
&size, NULL, NULL, NULL, NULL); |
|
245 |
if (error_code!= ERROR_SUCCESS){ |
|
246 |
free(buffer); |
|
247 |
return NULL; |
|
248 |
} |
|
249 |
result = (*env)->NewByteArray(env, size + 1); |
|
23562
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
250 |
if (result != NULL) { |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
251 |
(*env)->SetByteArrayRegion(env, result, 0, size + 1, buffer); |
596efd9dfcaf
8035340: (prefs) Check jdk/src/windows/native/java/util/WindowsPreference.c for JNI pending exceptions
msheppar
parents:
22951
diff
changeset
|
252 |
} |
2 | 253 |
free(buffer); |
254 |
return result; |
|
255 |
} |
|
256 |
||
257 |
||
258 |
#ifdef __cplusplus |
|
259 |
} |
|
260 |
#endif |