Skip to content
/ wine Public
forked from wine-mirror/wine

Commit

Permalink
win32u: replace calling unix functions by unix_call and remove callba…
Browse files Browse the repository at this point in the history
…ck unix_funcs
  • Loading branch information
fan-wenjie authored and Gcenx committed Apr 1, 2023
1 parent e7dd9ee commit d303439
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 65 deletions.
1 change: 0 additions & 1 deletion dlls/win32u/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@ C_SRCS = \
vulkan.c \
window.c \
winstation.c \
wrappers.c

font_EXTRADEFS = -DWINE_FONT_DIR=\"`${MAKEDEP} -R ${datadir}/wine ${fontdir}`\"
12 changes: 0 additions & 12 deletions dlls/win32u/gdiobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,12 +1027,6 @@ BOOL WINAPI NtGdiSetColorAdjustment( HDC hdc, const COLORADJUSTMENT *ca )
return FALSE;
}


static struct unix_funcs unix_funcs =
{
__wine_send_input,
};

void gdi_init(void)
{
pthread_mutexattr_t attr;
Expand All @@ -1050,9 +1044,3 @@ void gdi_init(void)
dpi = font_init();
init_stock_objects( dpi );
}

NTSTATUS callbacks_init( void *args )
{
*(const struct unix_funcs **)args = &unix_funcs;
return 0;
}
7 changes: 6 additions & 1 deletion dlls/win32u/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,14 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
&win32u_handle, sizeof(win32u_handle), NULL ))
{
__wine_unix_call( win32u_handle, 0, &__wine_syscall_dispatcher );
wrappers_init( win32u_handle );
}
break;
}
return TRUE;
}

BOOL CDECL __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput )
{
struct __wine_send_input_params params = { hwnd, input, rawinput };
return (BOOL)__wine_unix_call( win32u_handle, 1, &params);
}
8 changes: 7 additions & 1 deletion dlls/win32u/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,16 @@ static NTSTATUS init( void *dispatcher )
return ntdll_init_syscalls( 1, &syscall_table, dispatcher );
}

static NTSTATUS win32u_send_input(void *args)
{
struct __wine_send_input_params *params = (struct __wine_send_input_params *)args;
return (NTSTATUS)__wine_send_input(params->hwnd, params->input, params->rawinput);
}

unixlib_entry_t __wine_unix_call_funcs[] =
{
init,
callbacks_init,
win32u_send_input,
};

#ifdef _WIN64
Expand Down
8 changes: 4 additions & 4 deletions dlls/win32u/win32u_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@
#include "wine/debug.h"
#include "wine/server.h"

struct unix_funcs
struct __wine_send_input_params
{
/* Wine-specific functions */
BOOL (CDECL *wine_send_input)( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput );
HWND hwnd;
const INPUT *input;
const RAWINPUT *rawinput;
};

/* clipboard.c */
Expand Down Expand Up @@ -244,7 +245,6 @@ static inline void release_win_ptr( struct tagWND *ptr )
user_unlock();
}

extern void wrappers_init( unixlib_handle_t handle ) DECLSPEC_HIDDEN;
extern void gdi_init(void) DECLSPEC_HIDDEN;
extern NTSTATUS callbacks_init( void *args ) DECLSPEC_HIDDEN;
extern void winstation_init(void) DECLSPEC_HIDDEN;
Expand Down
46 changes: 0 additions & 46 deletions dlls/win32u/wrappers.c

This file was deleted.

3 comments on commit d303439

@Gcenx
Copy link
Owner

@Gcenx Gcenx commented on d303439 Apr 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reckenrode this branch contains a rebased copy of the out of tree wow branch this gets some 32Bit applications working.

This does disabled printers though until printing is reworked upstream, after that these should land directly in upstream.

@reckenrode
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the ping. Am I assuming correctly this is using WoW64 rather than the modified clang?

There’s an open issue (NixOS/nixpkgs#137734) in the nixpkgs repo regarding this support on Darwin. These patches would allow some support even if there are currently limitations.

@Gcenx
Copy link
Owner

@Gcenx Gcenx commented on d303439 Apr 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, upstream wouldn't accept 32on64 due to the custom compiler requirement where as there "experimental wow" (new wow64) uses a standard gcc toolchain or llvm/clang (preferably with a mingw toolchain) will build the host unix libraries along with multiple windows libraries.

Using the following configure options --enable-archs=i386,x86_64 will build i386 & x86_64 windows binaries plus this out of tree patchset gets a number of 32Bit gui applications working. The out of tree patchset came from https://gitlab.winehq.org/jacek/wine/-/tree/wow it just hasn't been rebased for a while nor was this commit merged from an open MR but that changed matched on in winecx22.x so I've pulled it in.

While not yet supported it will eventually be possible for build wine for arm64 and run i386,x86_64 windows binaries.

Please sign in to comment.