diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/wrapped/generated/functions_list.txt | 3 | ||||
| -rw-r--r-- | src/wrapped/generated/wrappedwaylandclienttypes.h | 2 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.c | 3 | ||||
| -rw-r--r-- | src/wrapped/generated/wrapper.h | 1 | ||||
| -rw-r--r-- | src/wrapped/wrappedwaylandclient.c | 40 | ||||
| -rw-r--r-- | src/wrapped/wrappedwaylandclient_private.h | 34 |
6 files changed, 66 insertions, 17 deletions
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt index 64fc8f9b..4f1868e1 100644 --- a/src/wrapped/generated/functions_list.txt +++ b/src/wrapped/generated/functions_list.txt @@ -2265,6 +2265,7 @@ #() pFpuuuuu #() pFpuuupu #() pFpupuui +#() pFpupuup #() pFpuppip #() pFpupppp #() pFplpppp @@ -5872,6 +5873,8 @@ wrappedvulkan: - vFpuuuupupup: - vkCmdPipelineBarrier wrappedwaylandclient: +- vFp: + - wl_log_set_handler_client - iFppp: - wl_proxy_add_listener wrappedwaylandcursor: diff --git a/src/wrapped/generated/wrappedwaylandclienttypes.h b/src/wrapped/generated/wrappedwaylandclienttypes.h index d9dcd6d7..5cb4ca70 100644 --- a/src/wrapped/generated/wrappedwaylandclienttypes.h +++ b/src/wrapped/generated/wrappedwaylandclienttypes.h @@ -11,9 +11,11 @@ #define ADDED_FUNCTIONS() #endif +typedef void (*vFp_t)(void*); typedef int32_t (*iFppp_t)(void*, void*, void*); #define SUPER() ADDED_FUNCTIONS() \ + GO(wl_log_set_handler_client, vFp_t) \ GO(wl_proxy_add_listener, iFppp_t) #endif // __wrappedwaylandclientTYPES_H_ diff --git a/src/wrapped/generated/wrapper.c b/src/wrapped/generated/wrapper.c index 2a3348a4..7e98d08b 100644 --- a/src/wrapped/generated/wrapper.c +++ b/src/wrapped/generated/wrapper.c @@ -2293,6 +2293,7 @@ typedef void* (*pFpuiiip_t)(void*, uint32_t, int32_t, int32_t, int32_t, void*); typedef void* (*pFpuuuuu_t)(void*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); typedef void* (*pFpuuupu_t)(void*, uint32_t, uint32_t, uint32_t, void*, uint32_t); typedef void* (*pFpupuui_t)(void*, uint32_t, void*, uint32_t, uint32_t, int32_t); +typedef void* (*pFpupuup_t)(void*, uint32_t, void*, uint32_t, uint32_t, void*); typedef void* (*pFpuppip_t)(void*, uint32_t, void*, void*, int32_t, void*); typedef void* (*pFpupppp_t)(void*, uint32_t, void*, void*, void*, void*); typedef void* (*pFplpppp_t)(void*, intptr_t, void*, void*, void*, void*); @@ -5523,6 +5524,7 @@ void pFpuiiip(x64emu_t *emu, uintptr_t fcn) { pFpuiiip_t fn = (pFpuiiip_t)fcn; R void pFpuuuuu(x64emu_t *emu, uintptr_t fcn) { pFpuuuuu_t fn = (pFpuuuuu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (uint32_t)R_R9); } void pFpuuupu(x64emu_t *emu, uintptr_t fcn) { pFpuuupu_t fn = (pFpuuupu_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (uint32_t)R_RDX, (uint32_t)R_RCX, (void*)R_R8, (uint32_t)R_R9); } void pFpupuui(x64emu_t *emu, uintptr_t fcn) { pFpupuui_t fn = (pFpupuui_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (int32_t)R_R9); } +void pFpupuup(x64emu_t *emu, uintptr_t fcn) { pFpupuup_t fn = (pFpupuup_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (uint32_t)R_RCX, (uint32_t)R_R8, (void*)R_R9); } void pFpuppip(x64emu_t *emu, uintptr_t fcn) { pFpuppip_t fn = (pFpuppip_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (int32_t)R_R8, (void*)R_R9); } void pFpupppp(x64emu_t *emu, uintptr_t fcn) { pFpupppp_t fn = (pFpupppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (uint32_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } void pFplpppp(x64emu_t *emu, uintptr_t fcn) { pFplpppp_t fn = (pFplpppp_t)fcn; R_RAX=(uintptr_t)fn((void*)R_RDI, (intptr_t)R_RSI, (void*)R_RDX, (void*)R_RCX, (void*)R_R8, (void*)R_R9); } @@ -8329,6 +8331,7 @@ int isSimpleWrapper(wrapper_t fun) { if (fun == &pFpuuuuu) return 1; if (fun == &pFpuuupu) return 1; if (fun == &pFpupuui) return 1; + if (fun == &pFpupuup) return 1; if (fun == &pFpuppip) return 1; if (fun == &pFpupppp) return 1; if (fun == &pFplpppp) return 1; diff --git a/src/wrapped/generated/wrapper.h b/src/wrapped/generated/wrapper.h index cb0f397d..ea9036c0 100644 --- a/src/wrapped/generated/wrapper.h +++ b/src/wrapped/generated/wrapper.h @@ -2302,6 +2302,7 @@ void pFpuiiip(x64emu_t *emu, uintptr_t fnc); void pFpuuuuu(x64emu_t *emu, uintptr_t fnc); void pFpuuupu(x64emu_t *emu, uintptr_t fnc); void pFpupuui(x64emu_t *emu, uintptr_t fnc); +void pFpupuup(x64emu_t *emu, uintptr_t fnc); void pFpuppip(x64emu_t *emu, uintptr_t fnc); void pFpupppp(x64emu_t *emu, uintptr_t fnc); void pFplpppp(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped/wrappedwaylandclient.c b/src/wrapped/wrappedwaylandclient.c index 4fe3b8f6..1250c5c9 100644 --- a/src/wrapped/wrappedwaylandclient.c +++ b/src/wrapped/wrappedwaylandclient.c @@ -3,6 +3,7 @@ #include <string.h> #define _GNU_SOURCE /* See feature_test_macros(7) */ #include <dlfcn.h> +#include <stdarg.h> #include "wrappedlibs.h" @@ -34,6 +35,40 @@ GO(2) \ GO(3) \ GO(4) +//wl_log_func_t +#ifdef CONVERT_VALIST +#define GO(A) \ +static uintptr_t my_wl_log_func_t_fct_##A = 0; \ +static void my_wl_log_func_t_##A(void* fmt, x64_va_list_t args) \ +{ \ + CONVERT_VALIST(args) \ + RunFunction(my_wl_log_func_t_fct_##A, 2, fmt, VARARGS); \ + } + #else +#define GO(A) \ +static uintptr_t my_wl_log_func_t_fct_##A = 0; \ +static void my_wl_log_func_t_##A(void* fmt, x64_va_list_t args) \ +{ \ + CREATE_VALIST_FROM_VALIST(args, thread_get_emu()->scratch); \ + RunFunction(my_wl_log_func_t_fct_##A, 2, fmt, VARARGS); \ +} +#endif +SUPER() +#undef GO +static void* find_wl_log_func_t_Fct(void* fct) +{ + if(!fct) return fct; + if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct); + #define GO(A) if(my_wl_log_func_t_fct_##A == (uintptr_t)fct) return my_wl_log_func_t_##A; + SUPER() + #undef GO + #define GO(A) if(my_wl_log_func_t_fct_##A == 0) {my_wl_log_func_t_fct_##A = (uintptr_t)fct; return my_wl_log_func_t_##A; } + SUPER() + #undef GO + printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_log_func_t callback\n"); + return NULL; +} + // wl_registry_listener ... typedef struct my_wl_registry_listener_s { uintptr_t global; //vFppupu @@ -561,4 +596,9 @@ EXPORT int my_wl_proxy_add_listener(x64emu_t* emu, void* proxy, void** l, void* return my->wl_proxy_add_listener(proxy, l, data); } +EXPORT void my_wl_log_set_handler_client(x64emu_t* emu, void* f) +{ + my->wl_log_set_handler_client(find_wl_log_func_t_Fct(f)); +} + #include "wrappedlib_init.h" diff --git a/src/wrapped/wrappedwaylandclient_private.h b/src/wrapped/wrappedwaylandclient_private.h index ba81df11..aa67f11c 100644 --- a/src/wrapped/wrappedwaylandclient_private.h +++ b/src/wrapped/wrappedwaylandclient_private.h @@ -1,18 +1,18 @@ #if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA)) -#error meh! +#error Meh... #endif GO(wl_array_add, pFpL) -//GO(wl_array_copy, +GO(wl_array_copy, iFpp) GO(wl_array_init, vFp) GO(wl_array_release, vFp) DATA(wl_buffer_interface, 40) -//DATA(wl_callback_interface, +//DATA(wl_callback_interface, 0) DATA(wl_compositor_interface, 40) -//DATA(wl_data_device_interface, -//DATA(wl_data_device_manager_interface, -//DATA(wl_data_offer_interface, -//DATA(wl_data_source_interface, +//DATA(wl_data_device_interface, 0) +//DATA(wl_data_device_manager_interface, 0) +//DATA(wl_data_offer_interface, 0) +//DATA(wl_data_source_interface, 0) GO(wl_display_cancel_read, vFp) GO(wl_display_connect, pFp) GO(wl_display_connect_to_fd, pFi) @@ -25,7 +25,7 @@ GO(wl_display_dispatch_queue_pending, iFpp) GO(wl_display_flush, iFp) GO(wl_display_get_error, iFp) GO(wl_display_get_fd, iFp) -//GO(wl_display_get_protocol_error, +GO(wl_display_get_protocol_error, uFppp) DATA(wl_display_interface, 40) GO(wl_display_prepare_read, iFp) GO(wl_display_prepare_read_queue, iFpp) @@ -34,36 +34,36 @@ GO(wl_display_roundtrip, iFp) GO(wl_display_roundtrip_queue, iFpp) GO(wl_event_queue_destroy, vFp) DATA(wl_keyboard_interface, 40) -//GO(wl_list_empty, +GO(wl_list_empty, iFp) GO(wl_list_init, vFp) GO(wl_list_insert, vFpp) -//GO(wl_list_insert_list, -//GO(wl_list_length, +GO(wl_list_insert_list, vFpp) +GO(wl_list_length, iFp) GO(wl_list_remove, vFp) -//GO(wl_log_set_handler_client, +GOM(wl_log_set_handler_client, vFEp) DATA(wl_output_interface, 40) DATA(wl_pointer_interface, 40) -//GO(wl_proxy_add_dispatcher, +//GOM(wl_proxy_add_dispatcher, iFEpppp) GOM(wl_proxy_add_listener, iFEppp) GO(wl_proxy_create, pFpp) GO(wl_proxy_create_wrapper, pFp) GO(wl_proxy_destroy, vFp) -//GO(wl_proxy_get_class, +GO(wl_proxy_get_class, pFp) GO(wl_proxy_get_id, uFp) GO(wl_proxy_get_listener, pFp) -//GO(wl_proxy_get_tag, +GO(wl_proxy_get_tag, pFp) GO(wl_proxy_get_user_data, pFp) GO(wl_proxy_get_version, uFp) GO(wl_proxy_marshal, vFpupppppppppp) //VAARGS GO(wl_proxy_marshal_array, vFpup) GO(wl_proxy_marshal_array_constructor, pFpupp) GO(wl_proxy_marshal_array_constructor_versioned, pFpuppu) -//GO(wl_proxy_marshal_array_flags, +GO(wl_proxy_marshal_array_flags, pFpupuup) GO(wl_proxy_marshal_constructor, pFpupppppppppppppppp) //VAARGS GO(wl_proxy_marshal_constructor_versioned, pFpupupppppppppppppppp) //VAARGS GO(wl_proxy_marshal_flags, pFpupuupppppppppppppppppppp) //VAARGS GO(wl_proxy_set_queue, vFpp) -//GO(wl_proxy_set_tag, +GO(wl_proxy_set_tag, vFpp) GO(wl_proxy_set_user_data, vFpp) GO(wl_proxy_wrapper_destroy, vFp) DATA(wl_region_interface, 40) |