-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
155 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
diff --git a/client/Android/android_freerdp.c b/client/Android/android_freerdp.c | ||
index 0fd987f446e..014c4d4db96 100644 | ||
--- a/client/Android/android_freerdp.c | ||
+++ b/client/Android/android_freerdp.c | ||
@@ -1093,7 +1093,10 @@ jint JNI_OnLoad(JavaVM* vm, void* reserved) | ||
(*env)->RegisterNatives(env, activityClass, methods, sizeof(methods) / sizeof(methods[0])); | ||
/* create global reference for class */ | ||
gJavaActivityClass = (*env)->NewGlobalRef(env, activityClass); | ||
+ | ||
g_JavaVm = vm; | ||
+ winpr_set_java_vm((void*)vm); | ||
+ | ||
return init_callback_environment(vm, env); | ||
} | ||
|
||
diff --git a/winpr/include/winpr/sysinfo.h b/winpr/include/winpr/sysinfo.h | ||
index c14e999d970..7af615947bd 100644 | ||
--- a/winpr/include/winpr/sysinfo.h | ||
+++ b/winpr/include/winpr/sysinfo.h | ||
@@ -344,6 +344,20 @@ extern "C" | ||
#define PF_SSE_INSTRUCTIONS_AVAILABLE PF_XMMI_INSTRUCTIONS_AVAILABLE | ||
#define PF_SSE2_INSTRUCTIONS_AVAILABLE PF_XMMI64_INSTRUCTIONS_AVAILABLE | ||
|
||
+#ifdef ANDROID | ||
+ | ||
+ /* | ||
+ * Call winpr_set_java_vm() from JNI_OnLoad in a shared library: | ||
+ * JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) | ||
+ * and then call winpr_get_java_vm to obtain the JavaVM* handle. | ||
+ * The functions use void* to avoid including jni.h in exported headers. | ||
+ */ | ||
+ | ||
+ WINPR_API void winpr_set_java_vm(void* vm); | ||
+ WINPR_API void* winpr_get_java_vm(); | ||
+ | ||
+#endif | ||
+ | ||
#ifdef __cplusplus | ||
} | ||
#endif | ||
diff --git a/winpr/libwinpr/sysinfo/sysinfo.c b/winpr/libwinpr/sysinfo/sysinfo.c | ||
index dd15bb374e2..a4d0ddf90cc 100644 | ||
--- a/winpr/libwinpr/sysinfo/sysinfo.c | ||
+++ b/winpr/libwinpr/sysinfo/sysinfo.c | ||
@@ -988,3 +988,20 @@ BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature) | ||
#endif | ||
return ret; | ||
} | ||
+ | ||
+#ifdef ANDROID | ||
+ | ||
+#include <jni.h> | ||
+static JavaVM* g_JavaVM = NULL; | ||
+ | ||
+void winpr_set_java_vm(void* vm) | ||
+{ | ||
+ g_JavaVM = (JavaVM*)vm; | ||
+} | ||
+ | ||
+void* winpr_get_java_vm() | ||
+{ | ||
+ return (void*)g_JavaVM; | ||
+} | ||
+ | ||
+#endif | ||
diff --git a/winpr/libwinpr/timezone/timezone.c b/winpr/libwinpr/timezone/timezone.c | ||
index b29ecab33dd..c42928d6738 100644 | ||
--- a/winpr/libwinpr/timezone/timezone.c | ||
+++ b/winpr/libwinpr/timezone/timezone.c | ||
@@ -151,18 +151,12 @@ static char* winpr_get_timezone_from_link(void) | ||
|
||
#if defined(ANDROID) | ||
#include <jni.h> | ||
-static JavaVM* jniVm = NULL; | ||
- | ||
-JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) | ||
-{ | ||
- jniVm = vm; | ||
- return JNI_VERSION_1_6; | ||
-} | ||
|
||
static char* winpr_get_android_timezone_identifier(void) | ||
{ | ||
char* tzid = NULL; | ||
JNIEnv* jniEnv; | ||
+ JavaVM* jniVm = (JavaVM*)winpr_get_java_vm(); | ||
|
||
/* Preferred: Try to get identifier from java TimeZone class */ | ||
if (jniVm && ((*jniVm)->GetEnv(jniVm, (void**)&jniEnv, JNI_VERSION_1_6) == JNI_OK)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
diff --git a/server/Windows/cli/CMakeLists.txt b/server/Windows/cli/CMakeLists.txt | ||
index fcfa811..e4d4360 100644 | ||
--- a/server/Windows/cli/CMakeLists.txt | ||
+++ b/server/Windows/cli/CMakeLists.txt | ||
@@ -41,6 +41,7 @@ set (${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/ | ||
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS}) | ||
|
||
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME "wfreerdp-server") | ||
+set_target_properties(${MODULE_NAME} PROPERTIES PDB_NAME "${MODULE_NAME}.pdb") | ||
|
||
set(${MODULE_PREFIX}_LIBS wfreerdp-server) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters