Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 17 | #include "nativehelper/JniInvocation.h" |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 18 | |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 19 | #ifdef _WIN32 |
| 20 | #include <windows.h> |
| 21 | #else |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 22 | #include <dlfcn.h> |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 23 | #endif |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 24 | #include <stdlib.h> |
Brian Carlstrom | feeb36c | 2013-10-31 15:18:56 -0700 | [diff] [blame] | 25 | #include <string.h> |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 26 | |
| 27 | #include <cstddef> |
| 28 | |
| 29 | #define LOG_TAG "JniInvocation" |
Logan Chien | b7f05e4 | 2018-04-24 15:30:39 +0800 | [diff] [blame] | 30 | #include <log/log.h> |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 31 | |
Elliott Hughes | 6887571 | 2015-07-31 08:51:17 -0700 | [diff] [blame] | 32 | #ifdef __ANDROID__ |
Dimitry Ivanov | 6bc946f | 2016-01-06 13:37:17 -0800 | [diff] [blame] | 33 | #include <sys/system_properties.h> |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 34 | #endif |
| 35 | |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 36 | #include "android-base/errors.h" |
Orion Hodson | aadb373 | 2018-11-21 12:58:34 +0000 | [diff] [blame] | 37 | #include "JniConstants.h" |
| 38 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 39 | namespace { |
| 40 | |
Tom Cherry | 3c46171 | 2017-12-14 00:00:15 -0800 | [diff] [blame] | 41 | template <typename T> |
| 42 | void UNUSED(const T&) {} |
| 43 | |
| 44 | bool IsDebuggable() { |
| 45 | #ifdef __ANDROID__ |
| 46 | char debuggable[PROP_VALUE_MAX] = {0}; |
| 47 | __system_property_get("ro.debuggable", debuggable); |
| 48 | return strcmp(debuggable, "1") == 0; |
| 49 | #else |
| 50 | return false; |
| 51 | #endif |
| 52 | } |
| 53 | |
| 54 | int GetLibrarySystemProperty(char* buffer) { |
| 55 | #ifdef __ANDROID__ |
| 56 | return __system_property_get("persist.sys.dalvik.vm.lib.2", buffer); |
| 57 | #else |
| 58 | UNUSED(buffer); |
| 59 | return 0; |
| 60 | #endif |
| 61 | } |
| 62 | |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 63 | #ifdef _WIN32 |
| 64 | #define FUNC_POINTER FARPROC |
| 65 | #else |
| 66 | #define FUNC_POINTER void* |
| 67 | #endif |
| 68 | |
| 69 | void* OpenLibrary(const char* filename) { |
| 70 | #ifdef _WIN32 |
| 71 | return LoadLibrary(filename); |
| 72 | #else |
| 73 | // Load with RTLD_NODELETE in order to ensure that libart.so is not unmapped when it is closed. |
| 74 | // This is due to the fact that it is possible that some threads might have yet to finish |
| 75 | // exiting even after JNI_DeleteJavaVM returns, which can lead to segfaults if the library is |
| 76 | // unloaded. |
| 77 | const int kDlopenFlags = RTLD_NOW | RTLD_NODELETE; |
| 78 | return dlopen(filename, kDlopenFlags); |
| 79 | #endif |
| 80 | } |
| 81 | |
| 82 | int CloseLibrary(void* handle) { |
| 83 | #ifdef _WIN32 |
| 84 | return FreeLibrary(static_cast<HMODULE>(handle)); |
| 85 | #else |
| 86 | return dlclose(handle); |
| 87 | #endif |
| 88 | } |
| 89 | |
| 90 | FUNC_POINTER GetSymbol(void* handle, const char* symbol) { |
| 91 | #ifdef _WIN32 |
| 92 | return GetProcAddress(static_cast<HMODULE>(handle), symbol); |
| 93 | #else |
| 94 | return dlsym(handle, symbol); |
| 95 | #endif |
| 96 | } |
| 97 | |
| 98 | std::string GetError() { |
| 99 | #ifdef _WIN32 |
| 100 | return android::base::SystemErrorCodeToString(GetLastError()); |
| 101 | #else |
| 102 | return std::string(dlerror()); |
| 103 | #endif |
| 104 | } |
| 105 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 106 | } // namespace |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 107 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 108 | struct JniInvocationImpl final { |
| 109 | public: |
| 110 | JniInvocationImpl(); |
| 111 | ~JniInvocationImpl(); |
| 112 | |
| 113 | bool Init(const char* library); |
| 114 | |
| 115 | // static const char* GetLibrary(const char* library, char* buffer); |
| 116 | |
| 117 | static const char* GetLibrary(const char* library, |
| 118 | char* buffer, |
| 119 | bool (*is_debuggable)() = IsDebuggable, |
| 120 | int (*get_library_system_property)(char* buffer) = GetLibrarySystemProperty); |
| 121 | |
| 122 | static JniInvocationImpl& GetJniInvocation(); |
| 123 | |
| 124 | jint JNI_GetDefaultJavaVMInitArgs(void* vmargs); |
| 125 | jint JNI_CreateJavaVM(JavaVM** p_vm, JNIEnv** p_env, void* vm_args); |
| 126 | jint JNI_GetCreatedJavaVMs(JavaVM** vms, jsize size, jsize* vm_count); |
| 127 | |
| 128 | private: |
| 129 | JniInvocationImpl(const JniInvocationImpl&) = delete; |
| 130 | JniInvocationImpl& operator=(const JniInvocationImpl&) = delete; |
| 131 | |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 132 | bool FindSymbol(FUNC_POINTER* pointer, const char* symbol); |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 133 | |
| 134 | static JniInvocationImpl* jni_invocation_; |
| 135 | |
| 136 | // Handle to library opened with dlopen(). Library exports |
| 137 | // JNI_GetDefaultJavaVMInitArgs, JNI_CreateJavaVM, JNI_GetCreatedJavaVMs. |
| 138 | void* handle_; |
| 139 | jint (*JNI_GetDefaultJavaVMInitArgs_)(void*); |
| 140 | jint (*JNI_CreateJavaVM_)(JavaVM**, JNIEnv**, void*); |
| 141 | jint (*JNI_GetCreatedJavaVMs_)(JavaVM**, jsize, jsize*); |
| 142 | |
| 143 | friend class JNIInvocation_Debuggable_Test; |
| 144 | friend class JNIInvocation_NonDebuggable_Test; |
| 145 | }; |
| 146 | |
| 147 | // Check JniInvocationImpl size is same as fields, e.g. no vtable present. |
| 148 | static_assert(sizeof(JniInvocationImpl) == 4 * sizeof(uintptr_t)); |
| 149 | |
| 150 | JniInvocationImpl* JniInvocationImpl::jni_invocation_ = NULL; |
| 151 | |
| 152 | JniInvocationImpl::JniInvocationImpl() : |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 153 | handle_(NULL), |
| 154 | JNI_GetDefaultJavaVMInitArgs_(NULL), |
| 155 | JNI_CreateJavaVM_(NULL), |
| 156 | JNI_GetCreatedJavaVMs_(NULL) { |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 157 | LOG_ALWAYS_FATAL_IF(jni_invocation_ != NULL, "JniInvocation instance already initialized"); |
| 158 | jni_invocation_ = this; |
| 159 | } |
| 160 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 161 | JniInvocationImpl::~JniInvocationImpl() { |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 162 | jni_invocation_ = NULL; |
| 163 | if (handle_ != NULL) { |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 164 | CloseLibrary(handle_); |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 165 | } |
| 166 | } |
| 167 | |
Narayan Kamath | 8c4708c | 2014-05-12 16:49:11 +0100 | [diff] [blame] | 168 | static const char* kLibraryFallback = "libart.so"; |
Brian Carlstrom | feeb36c | 2013-10-31 15:18:56 -0700 | [diff] [blame] | 169 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 170 | const char* JniInvocationImpl::GetLibrary(const char* library, |
| 171 | char* buffer, |
| 172 | bool (*is_debuggable)(), |
| 173 | int (*get_library_system_property)(char* buffer)) { |
Elliott Hughes | 6887571 | 2015-07-31 08:51:17 -0700 | [diff] [blame] | 174 | #ifdef __ANDROID__ |
Ningsheng Jian | 88b84ec | 2014-09-17 13:34:09 +0800 | [diff] [blame] | 175 | const char* default_library; |
Andreas Gampe | 5f4f4aa | 2014-08-19 16:57:38 -0700 | [diff] [blame] | 176 | |
Tom Cherry | 3c46171 | 2017-12-14 00:00:15 -0800 | [diff] [blame] | 177 | if (!is_debuggable()) { |
Andreas Gampe | 5f4f4aa | 2014-08-19 16:57:38 -0700 | [diff] [blame] | 178 | // Not a debuggable build. |
| 179 | // Do not allow arbitrary library. Ignore the library parameter. This |
Ningsheng Jian | 88b84ec | 2014-09-17 13:34:09 +0800 | [diff] [blame] | 180 | // will also ignore the default library, but initialize to fallback |
Andreas Gampe | 5f4f4aa | 2014-08-19 16:57:38 -0700 | [diff] [blame] | 181 | // for cleanliness. |
| 182 | library = kLibraryFallback; |
Ningsheng Jian | 88b84ec | 2014-09-17 13:34:09 +0800 | [diff] [blame] | 183 | default_library = kLibraryFallback; |
Andreas Gampe | 5f4f4aa | 2014-08-19 16:57:38 -0700 | [diff] [blame] | 184 | } else { |
| 185 | // Debuggable build. |
| 186 | // Accept the library parameter. For the case it is NULL, load the default |
| 187 | // library from the system property. |
Ningsheng Jian | 88b84ec | 2014-09-17 13:34:09 +0800 | [diff] [blame] | 188 | if (buffer != NULL) { |
Tom Cherry | 3c46171 | 2017-12-14 00:00:15 -0800 | [diff] [blame] | 189 | if (get_library_system_property(buffer) > 0) { |
Dimitry Ivanov | 6bc946f | 2016-01-06 13:37:17 -0800 | [diff] [blame] | 190 | default_library = buffer; |
| 191 | } else { |
| 192 | default_library = kLibraryFallback; |
| 193 | } |
Ningsheng Jian | 88b84ec | 2014-09-17 13:34:09 +0800 | [diff] [blame] | 194 | } else { |
| 195 | // No buffer given, just use default fallback. |
| 196 | default_library = kLibraryFallback; |
| 197 | } |
Andreas Gampe | 5f4f4aa | 2014-08-19 16:57:38 -0700 | [diff] [blame] | 198 | } |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 199 | #else |
Ningsheng Jian | 88b84ec | 2014-09-17 13:34:09 +0800 | [diff] [blame] | 200 | UNUSED(buffer); |
Tom Cherry | 3c46171 | 2017-12-14 00:00:15 -0800 | [diff] [blame] | 201 | UNUSED(is_debuggable); |
| 202 | UNUSED(get_library_system_property); |
Brian Carlstrom | feeb36c | 2013-10-31 15:18:56 -0700 | [diff] [blame] | 203 | const char* default_library = kLibraryFallback; |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 204 | #endif |
| 205 | if (library == NULL) { |
| 206 | library = default_library; |
| 207 | } |
| 208 | |
Andreas Gampe | 5f4f4aa | 2014-08-19 16:57:38 -0700 | [diff] [blame] | 209 | return library; |
| 210 | } |
| 211 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 212 | bool JniInvocationImpl::Init(const char* library) { |
Elliott Hughes | 6887571 | 2015-07-31 08:51:17 -0700 | [diff] [blame] | 213 | #ifdef __ANDROID__ |
Dimitry Ivanov | 6bc946f | 2016-01-06 13:37:17 -0800 | [diff] [blame] | 214 | char buffer[PROP_VALUE_MAX]; |
Ningsheng Jian | 88b84ec | 2014-09-17 13:34:09 +0800 | [diff] [blame] | 215 | #else |
| 216 | char* buffer = NULL; |
| 217 | #endif |
| 218 | library = GetLibrary(library, buffer); |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 219 | handle_ = OpenLibrary(library); |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 220 | if (handle_ == NULL) { |
Brian Carlstrom | feeb36c | 2013-10-31 15:18:56 -0700 | [diff] [blame] | 221 | if (strcmp(library, kLibraryFallback) == 0) { |
| 222 | // Nothing else to try. |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 223 | ALOGE("Failed to dlopen %s: %s", library, GetError().c_str()); |
Brian Carlstrom | feeb36c | 2013-10-31 15:18:56 -0700 | [diff] [blame] | 224 | return false; |
| 225 | } |
| 226 | // Note that this is enough to get something like the zygote |
| 227 | // running, we can't property_set here to fix this for the future |
| 228 | // because we are root and not the system user. See |
| 229 | // RuntimeInit.commonInit for where we fix up the property to |
| 230 | // avoid future fallbacks. http://b/11463182 |
| 231 | ALOGW("Falling back from %s to %s after dlopen error: %s", |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 232 | library, kLibraryFallback, GetError().c_str()); |
Brian Carlstrom | feeb36c | 2013-10-31 15:18:56 -0700 | [diff] [blame] | 233 | library = kLibraryFallback; |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 234 | handle_ = OpenLibrary(library); |
Brian Carlstrom | feeb36c | 2013-10-31 15:18:56 -0700 | [diff] [blame] | 235 | if (handle_ == NULL) { |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 236 | ALOGE("Failed to dlopen %s: %s", library, GetError().c_str()); |
Brian Carlstrom | feeb36c | 2013-10-31 15:18:56 -0700 | [diff] [blame] | 237 | return false; |
| 238 | } |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 239 | } |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 240 | if (!FindSymbol(reinterpret_cast<FUNC_POINTER*>(&JNI_GetDefaultJavaVMInitArgs_), |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 241 | "JNI_GetDefaultJavaVMInitArgs")) { |
| 242 | return false; |
| 243 | } |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 244 | if (!FindSymbol(reinterpret_cast<FUNC_POINTER*>(&JNI_CreateJavaVM_), |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 245 | "JNI_CreateJavaVM")) { |
| 246 | return false; |
| 247 | } |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 248 | if (!FindSymbol(reinterpret_cast<FUNC_POINTER*>(&JNI_GetCreatedJavaVMs_), |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 249 | "JNI_GetCreatedJavaVMs")) { |
| 250 | return false; |
| 251 | } |
| 252 | return true; |
| 253 | } |
| 254 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 255 | jint JniInvocationImpl::JNI_GetDefaultJavaVMInitArgs(void* vmargs) { |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 256 | return JNI_GetDefaultJavaVMInitArgs_(vmargs); |
| 257 | } |
| 258 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 259 | jint JniInvocationImpl::JNI_CreateJavaVM(JavaVM** p_vm, JNIEnv** p_env, void* vm_args) { |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 260 | return JNI_CreateJavaVM_(p_vm, p_env, vm_args); |
| 261 | } |
| 262 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 263 | jint JniInvocationImpl::JNI_GetCreatedJavaVMs(JavaVM** vms, jsize size, jsize* vm_count) { |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 264 | return JNI_GetCreatedJavaVMs_(vms, size, vm_count); |
| 265 | } |
| 266 | |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 267 | bool JniInvocationImpl::FindSymbol(FUNC_POINTER* pointer, const char* symbol) { |
| 268 | *pointer = GetSymbol(handle_, symbol); |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 269 | if (*pointer == NULL) { |
Jerome Gaillard | f0d4205 | 2019-03-12 15:17:22 +0000 | [diff] [blame] | 270 | ALOGE("Failed to find symbol %s: %s\n", symbol, GetError().c_str()); |
| 271 | CloseLibrary(handle_); |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 272 | handle_ = NULL; |
| 273 | return false; |
| 274 | } |
| 275 | return true; |
| 276 | } |
| 277 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 278 | JniInvocationImpl& JniInvocationImpl::GetJniInvocation() { |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 279 | LOG_ALWAYS_FATAL_IF(jni_invocation_ == NULL, |
| 280 | "Failed to create JniInvocation instance before using JNI invocation API"); |
| 281 | return *jni_invocation_; |
| 282 | } |
| 283 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 284 | MODULE_API jint JNI_GetDefaultJavaVMInitArgs(void* vm_args) { |
| 285 | return JniInvocationImpl::GetJniInvocation().JNI_GetDefaultJavaVMInitArgs(vm_args); |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 286 | } |
| 287 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 288 | MODULE_API jint JNI_CreateJavaVM(JavaVM** p_vm, JNIEnv** p_env, void* vm_args) { |
Orion Hodson | aadb373 | 2018-11-21 12:58:34 +0000 | [diff] [blame] | 289 | // Ensure any cached heap objects from previous VM instances are |
| 290 | // invalidated. There is no notification here that a VM is destroyed. These |
| 291 | // cached objects limit us to one VM instance per process. |
| 292 | JniConstants::Uninitialize(); |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 293 | return JniInvocationImpl::GetJniInvocation().JNI_CreateJavaVM(p_vm, p_env, vm_args); |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 294 | } |
| 295 | |
Orion Hodson | b01e7fe | 2018-11-07 06:07:50 +0000 | [diff] [blame] | 296 | MODULE_API jint JNI_GetCreatedJavaVMs(JavaVM** vms, jsize size, jsize* vm_count) { |
| 297 | return JniInvocationImpl::GetJniInvocation().JNI_GetCreatedJavaVMs(vms, size, vm_count); |
| 298 | } |
| 299 | |
| 300 | MODULE_API JniInvocationImpl* JniInvocationCreate() { |
| 301 | return new JniInvocationImpl(); |
| 302 | } |
| 303 | |
| 304 | MODULE_API void JniInvocationDestroy(JniInvocationImpl* instance) { |
| 305 | delete instance; |
| 306 | } |
| 307 | |
| 308 | MODULE_API int JniInvocationInit(JniInvocationImpl* instance, const char* library) { |
| 309 | return instance->Init(library) ? 1 : 0; |
| 310 | } |
| 311 | |
| 312 | MODULE_API const char* JniInvocationGetLibrary(const char* library, char* buffer) { |
| 313 | return JniInvocationImpl::GetLibrary(library, buffer); |
| 314 | } |
| 315 | |
| 316 | MODULE_API const char* JniInvocation::GetLibrary(const char* library, |
| 317 | char* buffer, |
| 318 | bool (*is_debuggable)(), |
| 319 | int (*get_library_system_property)(char* buffer)) { |
| 320 | return JniInvocationImpl::GetLibrary(library, buffer, is_debuggable, get_library_system_property); |
Brian Carlstrom | b2acfa2 | 2013-06-19 15:09:28 -0700 | [diff] [blame] | 321 | } |