From 9271684e5a9f356056a6038f652ec1c15ed16ed2 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 23 Sep 2024 15:12:24 +0200 Subject: [BOX32][WRAPPER] One more 32bits wrapped libX11 function --- src/wrapped32/generated/functions_list.txt | 3 +++ src/wrapped32/generated/wrappedlibx11types32.h | 2 ++ src/wrapped32/generated/wrapper32.c | 2 ++ src/wrapped32/generated/wrapper32.h | 1 + src/wrapped32/wrappedlibx11.c | 15 +++++++++++++++ src/wrapped32/wrappedlibx11_private.h | 2 +- 6 files changed, 24 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt index dcc50379..25cf3ae9 100644 --- a/src/wrapped32/generated/functions_list.txt +++ b/src/wrapped32/generated/functions_list.txt @@ -120,6 +120,7 @@ #() iFEp -> iFEp #() iFEh -> iFEh #() iFEO -> iFEO +#() iFEX -> iFEX #() iFii -> iFii #() iFiI -> iFiI #() iFiu -> iFiu @@ -1320,6 +1321,8 @@ wrappedlibx11: - XDestroyImage - XInitImage - _XInitImageFuncPtrs +- iFX: + - XCloseDisplay - pFp: - XOpenDisplay - iFXp: diff --git a/src/wrapped32/generated/wrappedlibx11types32.h b/src/wrapped32/generated/wrappedlibx11types32.h index 3f0ae230..bb91baa0 100644 --- a/src/wrapped32/generated/wrappedlibx11types32.h +++ b/src/wrapped32/generated/wrappedlibx11types32.h @@ -12,6 +12,7 @@ #endif typedef int32_t (*iFp_t)(void*); +typedef int32_t (*iFX_t)(void*); typedef void* (*pFp_t)(void*); typedef int32_t (*iFXp_t)(void*, void*); typedef void* (*pFpV_t)(void*, ...); @@ -31,6 +32,7 @@ typedef uintptr_t (*LFXLiiuuuiupLp_t)(void*, uintptr_t, int32_t, int32_t, uint32 GO(XDestroyImage, iFp_t) \ GO(XInitImage, iFp_t) \ GO(_XInitImageFuncPtrs, iFp_t) \ + GO(XCloseDisplay, iFX_t) \ GO(XOpenDisplay, pFp_t) \ GO(XNextEvent, iFXp_t) \ GO(XCreateIC, pFpV_t) \ diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c index fc30ef22..93887fe9 100644 --- a/src/wrapped32/generated/wrapper32.c +++ b/src/wrapped32/generated/wrapper32.c @@ -209,6 +209,7 @@ typedef int32_t (*iFEL_t)(x64emu_t*, uintptr_t); typedef int32_t (*iFEp_t)(x64emu_t*, void*); typedef int32_t (*iFEh_t)(x64emu_t*, uintptr_t); typedef int32_t (*iFEO_t)(x64emu_t*, int32_t); +typedef int32_t (*iFEX_t)(x64emu_t*, void*); typedef int32_t (*iFii_t)(int32_t, int32_t); typedef int32_t (*iFiI_t)(int32_t, int64_t); typedef int32_t (*iFiu_t)(int32_t, uint32_t); @@ -1169,6 +1170,7 @@ void iFEL_32(x64emu_t *emu, uintptr_t fcn) { iFEL_t fn = (iFEL_t)fcn; R_EAX = fn void iFEp_32(x64emu_t *emu, uintptr_t fcn) { iFEp_t fn = (iFEp_t)fcn; R_EAX = fn(emu, from_ptriv(R_ESP + 4)); } void iFEh_32(x64emu_t *emu, uintptr_t fcn) { iFEh_t fn = (iFEh_t)fcn; R_EAX = fn(emu, from_hash(from_ptri(ptr_t, R_ESP + 4))); } void iFEO_32(x64emu_t *emu, uintptr_t fcn) { iFEO_t fn = (iFEO_t)fcn; R_EAX = fn(emu, of_convert32(from_ptri(int32_t, R_ESP + 4))); } +void iFEX_32(x64emu_t *emu, uintptr_t fcn) { iFEX_t fn = (iFEX_t)fcn; R_EAX = fn(emu, getDisplay(from_ptriv(R_ESP + 4))); } void iFii_32(x64emu_t *emu, uintptr_t fcn) { iFii_t fn = (iFii_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8)); } void iFiI_32(x64emu_t *emu, uintptr_t fcn) { iFiI_t fn = (iFiI_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int64_t, R_ESP + 8)); } void iFiu_32(x64emu_t *emu, uintptr_t fcn) { iFiu_t fn = (iFiu_t)fcn; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8)); } diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h index 741a42c5..389e2c6c 100644 --- a/src/wrapped32/generated/wrapper32.h +++ b/src/wrapped32/generated/wrapper32.h @@ -161,6 +161,7 @@ void iFEL_32(x64emu_t *emu, uintptr_t fnc); void iFEp_32(x64emu_t *emu, uintptr_t fnc); void iFEh_32(x64emu_t *emu, uintptr_t fnc); void iFEO_32(x64emu_t *emu, uintptr_t fnc); +void iFEX_32(x64emu_t *emu, uintptr_t fnc); void iFii_32(x64emu_t *emu, uintptr_t fnc); void iFiI_32(x64emu_t *emu, uintptr_t fnc); void iFiu_32(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped32/wrappedlibx11.c b/src/wrapped32/wrappedlibx11.c index 964727b6..eeb8e0fd 100644 --- a/src/wrapped32/wrappedlibx11.c +++ b/src/wrapped32/wrappedlibx11.c @@ -1674,6 +1674,21 @@ EXPORT void* my32_XOpenDisplay(x64emu_t* emu, void* d) return ret; } +EXPORT int my32_XCloseDisplay(x64emu_t* emu, void* dpy) +{ + int ret = my->XCloseDisplay(dpy); + if(ret) + for(int i=0; i