Commit 2801436a authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wineandroid: Move DllMain to separated file.

parent abb69b8d
......@@ -7,6 +7,7 @@ EXTRADLLFLAGS = -mcygwin
C_SRCS = \
device.c \
dllmain.c \
init.c \
keyboard.c \
opengl.c \
......
......@@ -34,6 +34,7 @@
#include "winbase.h"
#include "ntgdi.h"
#include "wine/gdi_driver.h"
#include "unixlib.h"
#include "android_native.h"
......
/*
* wineandroid.drv entry points
*
* Copyright 2022 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "unixlib.h"
/***********************************************************************
* dll initialisation routine
*/
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
{
if (reason == DLL_PROCESS_ATTACH) return TRUE;
DisableThreadLibraryCalls( inst );
return !ANDROID_CALL(init, NULL);
}
......@@ -556,7 +556,7 @@ JavaVM **p_java_vm = NULL;
jobject *p_java_object = NULL;
unsigned short *p_java_gdt_sel = NULL;
static BOOL process_attach(void)
static HRESULT android_init( void *arg )
{
pthread_mutexattr_t attr;
jclass class;
......@@ -565,7 +565,7 @@ static BOOL process_attach(void)
JavaVM *java_vm;
void *ntdll;
if (!(ntdll = dlopen( "ntdll.so", RTLD_NOW ))) return FALSE;
if (!(ntdll = dlopen( "ntdll.so", RTLD_NOW ))) return STATUS_UNSUCCESSFUL;
p_java_vm = dlsym( ntdll, "java_vm" );
p_java_object = dlsym( ntdll, "java_object" );
......@@ -598,19 +598,20 @@ static BOOL process_attach(void)
#endif
}
__wine_set_user_driver( &android_drv_funcs, WINE_GDI_DRIVER_VERSION );
return TRUE;
return STATUS_SUCCESS;
}
/***********************************************************************
* dll initialisation routine
*/
BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
const unixlib_entry_t __wine_unix_call_funcs[] =
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( inst );
return process_attach();
}
return TRUE;
android_init,
};
C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count );
/* FIXME: Use __wine_unix_call instead */
NTSTATUS unix_call( enum android_funcs code, void *params )
{
return __wine_unix_call_funcs[code]( params );
}
/*
* Copyright 2022 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "ntuser.h"
#include "wine/unixlib.h"
enum android_funcs
{
unix_init,
unix_funcs_count
};
/* FIXME: Use __wine_unix_call when the rest of the stack is ready */
extern NTSTATUS unix_call( enum android_funcs func, void *arg ) DECLSPEC_HIDDEN;
#define ANDROID_CALL(func, params) unix_call( unix_ ## func, params )
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