Commit 4935576d authored by Alexandre Julliard's avatar Alexandre Julliard

wineandroid.drv: Load libwine dynamically.

parent 1a047044
MODULE = wineandroid.drv
IMPORTS = uuid ole32 user32 gdi32 advapi32 ntoskrnl
EXTRALIBS = -lwine
C_SRCS = \
device.c \
......
......@@ -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 */
......@@ -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 );
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment