Commit 5e737175 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wineandroid: Build with msvcrt.

parent 84bed157
EXTRADEFS = -DWINE_NO_LONG_TYPES EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = wineandroid.drv MODULE = wineandroid.drv
IMPORTS = user32 ntoskrnl win32u UNIXLIB = wineandroid.so
EXTRALIBS = $(PTHREAD_LIBS) IMPORTS = ntoskrnl
EXTRALIBS = -lwin32u $(PTHREAD_LIBS)
EXTRADLLFLAGS = -mcygwin
C_SRCS = \ C_SRCS = \
device.c \ device.c \
......
...@@ -120,6 +120,8 @@ extern NTSTATUS android_java_init( void *arg ) DECLSPEC_HIDDEN; ...@@ -120,6 +120,8 @@ extern NTSTATUS android_java_init( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS android_java_uninit( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS android_java_uninit( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS android_register_window( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS android_register_window( void *arg ) DECLSPEC_HIDDEN;
extern PNTAPCFUNC register_window_callback; extern PNTAPCFUNC register_window_callback;
extern NTSTATUS (WINAPI *pNtWaitForMultipleObjects)( ULONG,const HANDLE*,BOOLEAN,
BOOLEAN,const LARGE_INTEGER* ) DECLSPEC_HIDDEN;
extern unsigned int screen_width DECLSPEC_HIDDEN; extern unsigned int screen_width DECLSPEC_HIDDEN;
extern unsigned int screen_height DECLSPEC_HIDDEN; extern unsigned int screen_height DECLSPEC_HIDDEN;
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#include "config.h" #include "config.h"
#include <assert.h> #include <assert.h>
...@@ -1174,10 +1178,9 @@ NTSTATUS android_java_uninit( void *arg ) ...@@ -1174,10 +1178,9 @@ NTSTATUS android_java_uninit( void *arg )
void start_android_device(void) void start_android_device(void)
{ {
/* FIXME: use KeUserModeCallback instead */ void *ret_ptr;
NTSTATUS (WINAPI *func)(void *, ULONG) = ULONG ret_len;
((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[client_start_device]; thread = ULongToHandle( KeUserModeCallback( client_start_device, NULL, 0, &ret_ptr, &ret_len ));
func( NULL, 0 );
} }
......
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
WINE_DEFAULT_DEBUG_CHANNEL(android); WINE_DEFAULT_DEBUG_CHANNEL(android);
static unixlib_handle_t unix_handle;
static NTSTATUS (CDECL *unix_call)( enum android_funcs code, void *params );
extern NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event ); extern NTSTATUS CDECL wine_ntoskrnl_main_loop( HANDLE stop_event );
static HANDLE stop_event; static HANDLE stop_event;
static HANDLE thread; static HANDLE thread;
...@@ -122,13 +125,18 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) ...@@ -122,13 +125,18 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
if (reason == DLL_PROCESS_ATTACH) return TRUE; if (reason == DLL_PROCESS_ATTACH) return TRUE;
DisableThreadLibraryCalls( inst ); DisableThreadLibraryCalls( inst );
if (NtQueryVirtualMemory( GetCurrentProcess(), inst, MemoryWineUnixFuncs,
&unix_handle, sizeof(unix_handle), NULL ))
return FALSE;
params.register_window_callback = register_window_callback; params.register_window_callback = register_window_callback;
if (ANDROID_CALL( init, &params )) return FALSE; params.pNtWaitForMultipleObjects = NtWaitForMultipleObjects;
if (__wine_unix_call( unix_handle, unix_init, &params )) return FALSE;
callback_table = NtCurrentTeb()->Peb->KernelCallbackTable; callback_table = NtCurrentTeb()->Peb->KernelCallbackTable;
callback_table[client_start_device] = android_start_device; callback_table[client_start_device] = android_start_device;
unix_call = params.unix_call;
return TRUE; return TRUE;
} }
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#define NONAMELESSSTRUCT #define NONAMELESSSTRUCT
#define NONAMELESSUNION #define NONAMELESSUNION
#include "config.h" #include "config.h"
...@@ -558,6 +562,10 @@ JavaVM **p_java_vm = NULL; ...@@ -558,6 +562,10 @@ JavaVM **p_java_vm = NULL;
jobject *p_java_object = NULL; jobject *p_java_object = NULL;
unsigned short *p_java_gdt_sel = NULL; unsigned short *p_java_gdt_sel = NULL;
static NTSTATUS CDECL unix_call( enum android_funcs code, void *params );
NTSTATUS (WINAPI *pNtWaitForMultipleObjects)( ULONG,const HANDLE*,BOOLEAN,
BOOLEAN,const LARGE_INTEGER* );
static HRESULT android_init( void *arg ) static HRESULT android_init( void *arg )
{ {
struct init_params *params = arg; struct init_params *params = arg;
...@@ -603,6 +611,8 @@ static HRESULT android_init( void *arg ) ...@@ -603,6 +611,8 @@ static HRESULT android_init( void *arg )
#endif #endif
} }
__wine_set_user_driver( &android_drv_funcs, WINE_GDI_DRIVER_VERSION ); __wine_set_user_driver( &android_drv_funcs, WINE_GDI_DRIVER_VERSION );
pNtWaitForMultipleObjects = params->pNtWaitForMultipleObjects;
params->unix_call = unix_call;
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
...@@ -621,7 +631,7 @@ C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count ); ...@@ -621,7 +631,7 @@ C_ASSERT( ARRAYSIZE(__wine_unix_call_funcs) == unix_funcs_count );
/* FIXME: Use __wine_unix_call instead */ /* FIXME: Use __wine_unix_call instead */
NTSTATUS unix_call( enum android_funcs code, void *params ) static NTSTATUS CDECL unix_call( enum android_funcs code, void *params )
{ {
return __wine_unix_call_funcs[code]( params ); return __wine_unix_call_funcs[code]( params );
} }
...@@ -26,6 +26,10 @@ ...@@ -26,6 +26,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#define NONAMELESSUNION #define NONAMELESSUNION
#define NONAMELESSSTRUCT #define NONAMELESSSTRUCT
......
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#include "config.h" #include "config.h"
#include <assert.h> #include <assert.h>
......
...@@ -31,13 +31,14 @@ enum android_funcs ...@@ -31,13 +31,14 @@ enum android_funcs
}; };
/* FIXME: Use __wine_unix_call when the rest of the stack is ready */ /* 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 ) #define ANDROID_CALL(func, params) unix_call( unix_ ## func, params )
/* android_init params */ /* android_init params */
struct init_params struct init_params
{ {
PNTAPCFUNC register_window_callback; PNTAPCFUNC register_window_callback;
NTSTATUS (WINAPI *pNtWaitForMultipleObjects)( ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER* );
NTSTATUS (CDECL *unix_call)( enum android_funcs code, void *params );
}; };
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#define NONAMELESSUNION #define NONAMELESSUNION
#define NONAMELESSSTRUCT #define NONAMELESSSTRUCT
...@@ -1164,14 +1168,15 @@ static const struct ...@@ -1164,14 +1168,15 @@ static const struct
static int get_cursor_system_id( const ICONINFOEXW *info ) static int get_cursor_system_id( const ICONINFOEXW *info )
{ {
const struct system_cursors *cursors; const struct system_cursors *cursors;
const WCHAR *module;
unsigned int i; unsigned int i;
HMODULE module;
if (info->szResName[0]) return 0; /* only integer resources are supported here */ if (info->szResName[0]) return 0; /* only integer resources are supported here */
if (!(module = GetModuleHandleW( info->szModName ))) return 0;
if ((module = wcsrchr( info->szModName, '\\' ))) module++;
else module = info->szModName;
for (i = 0; i < ARRAY_SIZE( module_cursors ); i++) for (i = 0; i < ARRAY_SIZE( module_cursors ); i++)
if (GetModuleHandleW( module_cursors[i].name ) == module) break; if (!wcsicmp( module, module_cursors[i].name )) break;
if (i == ARRAY_SIZE( module_cursors )) return 0; if (i == ARRAY_SIZE( module_cursors )) return 0;
cursors = module_cursors[i].cursors; cursors = module_cursors[i].cursors;
...@@ -1207,8 +1212,8 @@ NTSTATUS ANDROID_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles ...@@ -1207,8 +1212,8 @@ NTSTATUS ANDROID_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles
if (current_event) mask = 0; if (current_event) mask = 0;
if (process_events( mask )) return count - 1; if (process_events( mask )) return count - 1;
} }
return NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL), return pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL),
!!(flags & MWMO_ALERTABLE), timeout ); !!(flags & MWMO_ALERTABLE), timeout );
} }
/********************************************************************** /**********************************************************************
......
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