wineandroid.drv: Load libwine dynamically.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-09-11 11:43:21 +02:00
parent 1a0470443d
commit 4935576d4a
4 changed files with 18 additions and 8 deletions

View File

@ -1,6 +1,5 @@
MODULE = wineandroid.drv
IMPORTS = uuid ole32 user32 gdi32 advapi32 ntoskrnl
EXTRALIBS = -lwine
C_SRCS = \
device.c \

View File

@ -155,7 +155,7 @@ union event_data
int send_event( const union event_data *data ) DECLSPEC_HIDDEN;
extern JavaVM *wine_get_java_vm(void);
extern jobject wine_get_java_object(void);
extern JavaVM * (*p_wine_get_java_vm)(void);
extern jobject (*p_wine_get_java_object)(void);
#endif /* __WINE_ANDROID_H */

View File

@ -687,7 +687,7 @@ static int status_to_android_error( NTSTATUS status )
static jobject load_java_method( jmethodID *method, const char *name, const char *args )
{
jobject object = wine_get_java_object();
jobject object = p_wine_get_java_object();
if (!*method)
{
@ -1163,7 +1163,7 @@ static DWORD CALLBACK device_thread( void *arg )
TRACE( "starting process %x\n", GetCurrentProcessId() );
if (!(java_vm = wine_get_java_vm())) return 0; /* not running under Java */
if (!(java_vm = p_wine_get_java_vm())) return 0; /* not running under Java */
init_java_thread( java_vm );

View File

@ -104,7 +104,7 @@ void set_screen_dpi( DWORD dpi )
*/
static void fetch_display_metrics(void)
{
if (wine_get_java_vm()) return; /* for Java threads it will be set when the top view is created */
if (p_wine_get_java_vm()) return; /* for Java threads it will be set when the top view is created */
SERVER_START_REQ( get_window_rectangles )
{
@ -620,16 +620,27 @@ static void load_android_libs(void)
#undef DECL_FUNCPTR
#undef LOAD_FUNCPTR
JavaVM * (*p_wine_get_java_vm)(void) = NULL;
jobject (*p_wine_get_java_object)(void) = NULL;
static BOOL process_attach(void)
{
jclass class;
jobject object = wine_get_java_object();
jobject object;
JNIEnv *jni_env;
JavaVM *java_vm;
void *libwine;
if (!(libwine = dlopen( "libwine.so", RTLD_NOW ))) return FALSE;
p_wine_get_java_vm = dlsym( libwine, "wine_get_java_vm" );
p_wine_get_java_object = dlsym( libwine, "wine_get_java_object" );
object = p_wine_get_java_object();
load_hardware_libs();
if ((java_vm = wine_get_java_vm())) /* running under Java */
if ((java_vm = p_wine_get_java_vm())) /* running under Java */
{
#ifdef __i386__
WORD old_fs;