Signed-off-by: Fan WenJie fanwj@mail.ustc.edu.cn
Hook mmap and munmap seem to be the only solution for drivers such as OpenGL to allocate over 32-bit address. For example, Fairy and Sword 4 has some render problems on master branch of wine. The patch can solve the problems.
-- v3: wineandroid.drv: fix incorrent path of device and init device in ANDROID_CreateDesktop
From: Fan WenJie fanwj@mail.ustc.edu.cn
Signed-off-by: Fan WenJie fanwj@mail.ustc.edu.cn --- dlls/wineandroid.drv/device.c | 2 +- dlls/wineandroid.drv/window.c | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/dlls/wineandroid.drv/device.c b/dlls/wineandroid.drv/device.c index 140ae82fe26..bfe00439d56 100644 --- a/dlls/wineandroid.drv/device.c +++ b/dlls/wineandroid.drv/device.c @@ -1187,7 +1187,7 @@ void start_android_device(void)
static int android_ioctl( enum android_ioctl code, void *in, DWORD in_size, void *out, DWORD *out_size ) { - static const WCHAR deviceW[] = {'\','\','.','\','W','i','n','e','A','n','d','r','o','i','d',0 }; + static const WCHAR deviceW[] = {'\','D','e','v','i','c','e','\','W','i','n','e','A','n','d','r','o','i','d',0 }; static HANDLE device; IO_STATUS_BLOCK iosb; NTSTATUS status; diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index d62a2c53909..aa47d4493c7 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -1210,6 +1210,18 @@ BOOL ANDROID_ProcessEvents( DWORD mask ) return FALSE; }
+static BOOL init_device(void) +{ + HWND hwnd = NtUserGetDesktopWindow(); + struct android_win_data *data; + + init_event_queue(); + start_android_device(); + if (!(data = alloc_win_data( hwnd ))) return FALSE; + release_win_data( data ); + return TRUE; +} + /********************************************************************** * ANDROID_CreateWindow */ @@ -1217,15 +1229,8 @@ BOOL ANDROID_CreateWindow( HWND hwnd ) { TRACE( "%p\n", hwnd );
- if (hwnd == NtUserGetDesktopWindow()) - { - struct android_win_data *data; - - init_event_queue(); - start_android_device(); - if (!(data = alloc_win_data( hwnd ))) return FALSE; - release_win_data( data ); - } + if (hwnd == NtUserGetDesktopWindow() && !screen_width) + return init_device(); return TRUE; }
@@ -1662,6 +1667,7 @@ LRESULT ANDROID_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) */ BOOL ANDROID_CreateDesktop( const WCHAR *name, UINT width, UINT height ) { + if (!(screen_width || init_device())) return FALSE; /* wait until we receive the surface changed event */ while (!screen_width) {
This merge request was closed by Fan WenJie.