wineandroid: Build with msvcrt.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
This commit is contained in:
Jacek Caban 2022-06-06 22:32:48 +02:00 committed by Alexandre Julliard
parent 84bed157e8
commit 5e73717557
9 changed files with 52 additions and 16 deletions

View file

@ -1,9 +1,8 @@
EXTRADEFS = -DWINE_NO_LONG_TYPES
MODULE = wineandroid.drv
IMPORTS = user32 ntoskrnl win32u
EXTRALIBS = $(PTHREAD_LIBS)
EXTRADLLFLAGS = -mcygwin
UNIXLIB = wineandroid.so
IMPORTS = ntoskrnl
EXTRALIBS = -lwin32u $(PTHREAD_LIBS)
C_SRCS = \
device.c \

View file

@ -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_register_window( void *arg ) DECLSPEC_HIDDEN;
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_height DECLSPEC_HIDDEN;

View file

@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include <assert.h>
@ -1174,10 +1178,9 @@ NTSTATUS android_java_uninit( void *arg )
void start_android_device(void)
{
/* FIXME: use KeUserModeCallback instead */
NTSTATUS (WINAPI *func)(void *, ULONG) =
((void **)NtCurrentTeb()->Peb->KernelCallbackTable)[client_start_device];
func( NULL, 0 );
void *ret_ptr;
ULONG ret_len;
thread = ULongToHandle( KeUserModeCallback( client_start_device, NULL, 0, &ret_ptr, &ret_len ));
}

View file

@ -32,6 +32,9 @@
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 );
static HANDLE stop_event;
static HANDLE thread;
@ -122,13 +125,18 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
if (reason == DLL_PROCESS_ATTACH) return TRUE;
DisableThreadLibraryCalls( inst );
if (NtQueryVirtualMemory( GetCurrentProcess(), inst, MemoryWineUnixFuncs,
&unix_handle, sizeof(unix_handle), NULL ))
return FALSE;
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[client_start_device] = android_start_device;
unix_call = params.unix_call;
return TRUE;
}

View file

@ -18,6 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#define NONAMELESSSTRUCT
#define NONAMELESSUNION
#include "config.h"
@ -558,6 +562,10 @@ JavaVM **p_java_vm = NULL;
jobject *p_java_object = 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 )
{
struct init_params *params = arg;
@ -603,6 +611,8 @@ static HRESULT android_init( void *arg )
#endif
}
__wine_set_user_driver( &android_drv_funcs, WINE_GDI_DRIVER_VERSION );
pNtWaitForMultipleObjects = params->pNtWaitForMultipleObjects;
params->unix_call = unix_call;
return STATUS_SUCCESS;
}
@ -621,7 +631,7 @@ 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 )
static NTSTATUS CDECL unix_call( enum android_funcs code, void *params )
{
return __wine_unix_call_funcs[code]( params );
}

View file

@ -26,6 +26,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT

View file

@ -24,6 +24,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include <assert.h>

View file

@ -31,13 +31,14 @@ enum android_funcs
};
/* 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 )
/* android_init params */
struct init_params
{
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 );
};

View file

@ -20,6 +20,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
@ -1164,14 +1168,15 @@ static const struct
static int get_cursor_system_id( const ICONINFOEXW *info )
{
const struct system_cursors *cursors;
const WCHAR *module;
unsigned int i;
HMODULE module;
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++)
if (GetModuleHandleW( module_cursors[i].name ) == module) break;
if (!wcsicmp( module, module_cursors[i].name )) break;
if (i == ARRAY_SIZE( module_cursors )) return 0;
cursors = module_cursors[i].cursors;
@ -1207,8 +1212,8 @@ NTSTATUS ANDROID_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles
if (current_event) mask = 0;
if (process_events( mask )) return count - 1;
}
return NtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL),
!!(flags & MWMO_ALERTABLE), timeout );
return pNtWaitForMultipleObjects( count, handles, !(flags & MWMO_WAITALL),
!!(flags & MWMO_ALERTABLE), timeout );
}
/**********************************************************************