diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-10-12 18:39:09 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-10-12 18:40:31 +0200 |
| commit | b6cd19b78bf3cce7cdc55c4210f5174eb8b76e28 (patch) | |
| tree | 9e4cd0c62f25f42145ac0e8f80c8caa82789d38c /src/wrapped32 | |
| parent | 6a3a19da68b6d4d59d368172f2f3e411326258fd (diff) | |
| download | box64-b6cd19b78bf3cce7cdc55c4210f5174eb8b76e28.tar.gz box64-b6cd19b78bf3cce7cdc55c4210f5174eb8b76e28.zip | |
[BOX32] More work on libX11 and friends, using more shadow structure like Screen and Visual (help wine, probably other too)
Diffstat (limited to 'src/wrapped32')
| -rw-r--r-- | src/wrapped32/generated/functions_list.txt | 19 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrappedlibx11types32.h | 4 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrappedlibxexttypes32.h | 9 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.c | 16 | ||||
| -rw-r--r-- | src/wrapped32/generated/wrapper32.h | 8 | ||||
| -rw-r--r-- | src/wrapped32/wrappedlibgl.c | 17 | ||||
| -rw-r--r-- | src/wrapped32/wrappedlibx11.c | 89 | ||||
| -rw-r--r-- | src/wrapped32/wrappedlibx11_private.h | 4 | ||||
| -rw-r--r-- | src/wrapped32/wrappedlibxext.c | 70 | ||||
| -rw-r--r-- | src/wrapped32/wrappedlibxext_private.h | 10 | ||||
| -rw-r--r-- | src/wrapped32/wrappedlibxrender.c | 23 |
11 files changed, 187 insertions, 82 deletions
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt index a33d9a55..2c75c3cc 100644 --- a/src/wrapped32/generated/functions_list.txt +++ b/src/wrapped32/generated/functions_list.txt @@ -230,6 +230,7 @@ #() lFpl -> lFpl #() lFpL -> lFpL #() LFEL -> LFEL +#() LFEp -> LFEp #() LFLi -> LFLi #() LFpL -> LFpL #() LFpp -> LFpp @@ -293,7 +294,6 @@ #() iFSBliu_ -> iFSB #() iFbppi_i -> iFBi #() iFXbiip_ -> iFXB -#() iFXbLipi_ -> iFXB #() iFrLL_BLL_ -> iFBB #() LFXrLiiuL_ -> LFXB #() vFbll_rllll_ -> vFBB @@ -808,7 +808,6 @@ #() LFppLa -> LFppLa #() LFXCii -> LFXCii #() LFXLuu -> LFXLuu -#() LFXLpi -> LFXLpi #() LFXpLp -> LFXpLp #() pFEupp -> pFEupp #() pFEpip -> pFEpip @@ -1026,6 +1025,7 @@ #() UFuiCiu -> UFuiCiu #() lFpuipC -> lFpuipC #() LFEppLL -> LFEppLL +#() LFEXLpi -> LFEXLpi #() LFpLppa -> LFpLppa #() LFXLuuu -> LFXLuuu #() LFXLpuu -> LFXLpuu @@ -1295,7 +1295,6 @@ #() iFXLibL_ubL_u -> iFXLiBuBu #() vFXLpiibpiip_i -> vFXLpiiBi #() iFXLpiibpiiL_i -> iFXLpiiBi -#() LFXLpbLipi_uuu -> LFXLpBuuu #() LFXLLuubLWWWcc_bLWWWcc_ -> LFXLLuuBB #() LFXLLbLWWWcc_bLWWWcc_uu -> LFXLLBBuu #() vFiiiiuuip -> vFiiiiuuip @@ -1345,6 +1344,7 @@ #() uFuipppppp -> uFuipppppp #() uFuupuuiuf -> uFuupuuiuf #() uFulpppppp -> uFulpppppp +#() LFEXLppuuu -> LFEXLppuuu #() LFXLpuuLLu -> LFXLpuuLLu #() iFXLLiippBL_ -> iFXLLiippB #() iFXLpppbL_pp -> iFXLpppBpp @@ -1395,7 +1395,7 @@ #() iFXiLLLiiibiip_ -> iFXiLLLiiiB #() iFXLbL_bL_ppppp -> iFXLBBppppp #() vFXiLLrLiiuL_iipi -> vFXiLLBiipi -#() pFEXbpLiLLLii_uipbLipi_uu -> pFEXBuipBuu +#() pFEXbpLiLLLii_uippuu -> pFEXBuippuu #() vFEXLpppippp -> vFEXLpppippp #() vFiiiiiiiiii -> vFiiiiiiiiii #() vFiiiiiiiiui -> vFiiiiiiiiui @@ -2013,6 +2013,8 @@ wrappedlibx11: - iFX: - XCloseDisplay - XGrabServer +- LFp: + - XVisualIDFromVisual - pFp: - XSetErrorHandler - XSetIOErrorHandler @@ -2077,6 +2079,8 @@ wrappedlibx11: - iFXppp: - XCheckIfEvent - XIfEvent +- LFXLpi: + - XCreateColormap - pFXlpp: - XGetVisualInfo - iFXbpLiL_pp: @@ -2141,6 +2145,9 @@ wrappedlibxext: - XSetExtensionErrorHandler - iFpX: - XextRemoveDisplay +- iFXp: + - XShmAttach + - XShmDetach - pFpX: - XextFindDisplay - pFXpp: @@ -2149,7 +2156,9 @@ wrappedlibxext: - XShmGetImage - pFpXppip: - XextAddDisplay -- pFXbpLiLLLii_uipbLipi_uu: +- LFXLppuuu: + - XShmCreatePixmap +- pFXbpLiLLLii_uippuu: - XShmCreateImage - iFXLppiiiiuui: - XShmPutImage diff --git a/src/wrapped32/generated/wrappedlibx11types32.h b/src/wrapped32/generated/wrappedlibx11types32.h index 1c148794..055fee0d 100644 --- a/src/wrapped32/generated/wrappedlibx11types32.h +++ b/src/wrapped32/generated/wrappedlibx11types32.h @@ -15,6 +15,7 @@ typedef void (*vFp_t)(void*); typedef void (*vFX_t)(void*); typedef int32_t (*iFp_t)(void*); typedef int32_t (*iFX_t)(void*); +typedef uintptr_t (*LFp_t)(void*); typedef void* (*pFp_t)(void*); typedef void* (*pFX_t)(void*); typedef void* (*XFp_t)(void*); @@ -40,6 +41,7 @@ typedef int32_t (*iFXLLp_t)(void*, uintptr_t, uintptr_t, void*); typedef int32_t (*iFXLpi_t)(void*, uintptr_t, void*, int32_t); typedef int32_t (*iFXLpp_t)(void*, uintptr_t, void*, void*); typedef int32_t (*iFXppp_t)(void*, void*, void*, void*); +typedef uintptr_t (*LFXLpi_t)(void*, uintptr_t, void*, int32_t); typedef void* (*pFXlpp_t)(void*, intptr_t, void*, void*); typedef int32_t (*iFXbpLiL_pp_t)(void*, struct_pLiL_t*, void*, void*); typedef int32_t (*iFppipp_t)(void*, void*, int32_t, void*, void*); @@ -74,6 +76,7 @@ typedef uintptr_t (*LFXLiiuuuiupLp_t)(void*, uintptr_t, int32_t, int32_t, uint32 GO(_XInitImageFuncPtrs, iFp_t) \ GO(XCloseDisplay, iFX_t) \ GO(XGrabServer, iFX_t) \ + GO(XVisualIDFromVisual, LFp_t) \ GO(XSetErrorHandler, pFp_t) \ GO(XSetIOErrorHandler, pFp_t) \ GO(XGetModifierMapping, pFX_t) \ @@ -113,6 +116,7 @@ typedef uintptr_t (*LFXLiiuuuiupLp_t)(void*, uintptr_t, int32_t, int32_t, uint32 GO(XGetWMNormalHints, iFXLpp_t) \ GO(XCheckIfEvent, iFXppp_t) \ GO(XIfEvent, iFXppp_t) \ + GO(XCreateColormap, LFXLpi_t) \ GO(XGetVisualInfo, pFXlpp_t) \ GO(XmbTextPropertyToTextList, iFXbpLiL_pp_t) \ GO(XLookupString, iFppipp_t) \ diff --git a/src/wrapped32/generated/wrappedlibxexttypes32.h b/src/wrapped32/generated/wrappedlibxexttypes32.h index 9f95f95b..ef459e28 100644 --- a/src/wrapped32/generated/wrappedlibxexttypes32.h +++ b/src/wrapped32/generated/wrappedlibxexttypes32.h @@ -15,11 +15,13 @@ typedef void (*vFp_t)(void*); typedef void* (*pFv_t)(void); typedef void* (*pFp_t)(void*); typedef int32_t (*iFpX_t)(void*, void*); +typedef int32_t (*iFXp_t)(void*, void*); typedef void* (*pFpX_t)(void*, void*); typedef void* (*pFXpp_t)(void*, void*, void*); typedef int32_t (*iFXLpiiL_t)(void*, uintptr_t, void*, int32_t, int32_t, uintptr_t); typedef void* (*pFpXppip_t)(void*, void*, void*, void*, int32_t, void*); -typedef void* (*pFXbpLiLLLii_uipbLipi_uu_t)(void*, struct_pLiLLLii_t*, uint32_t, int32_t, void*, struct_Lipi_t*, uint32_t, uint32_t); +typedef uintptr_t (*LFXLppuuu_t)(void*, uintptr_t, void*, void*, uint32_t, uint32_t, uint32_t); +typedef void* (*pFXbpLiLLLii_uippuu_t)(void*, struct_pLiLLLii_t*, uint32_t, int32_t, void*, void*, uint32_t, uint32_t); typedef int32_t (*iFXLppiiiiuui_t)(void*, uintptr_t, void*, void*, int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t); #define SUPER() ADDED_FUNCTIONS() \ @@ -28,11 +30,14 @@ typedef int32_t (*iFXLppiiiiuui_t)(void*, uintptr_t, void*, void*, int32_t, int3 GO(XextCreateExtension, pFv_t) \ GO(XSetExtensionErrorHandler, pFp_t) \ GO(XextRemoveDisplay, iFpX_t) \ + GO(XShmAttach, iFXp_t) \ + GO(XShmDetach, iFXp_t) \ GO(XextFindDisplay, pFpX_t) \ GO(XdbeGetVisualInfo, pFXpp_t) \ GO(XShmGetImage, iFXLpiiL_t) \ GO(XextAddDisplay, pFpXppip_t) \ - GO(XShmCreateImage, pFXbpLiLLLii_uipbLipi_uu_t) \ + GO(XShmCreatePixmap, LFXLppuuu_t) \ + GO(XShmCreateImage, pFXbpLiLLLii_uippuu_t) \ GO(XShmPutImage, iFXLppiiiiuui_t) #endif // __wrappedlibxextTYPES32_H_ diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c index 397d198b..a4fa97fd 100644 --- a/src/wrapped32/generated/wrapper32.c +++ b/src/wrapped32/generated/wrapper32.c @@ -320,6 +320,7 @@ typedef intptr_t (*lFpu_t)(void*, uint32_t); typedef intptr_t (*lFpl_t)(void*, intptr_t); typedef intptr_t (*lFpL_t)(void*, uintptr_t); typedef uintptr_t (*LFEL_t)(x64emu_t*, uintptr_t); +typedef uintptr_t (*LFEp_t)(x64emu_t*, void*); typedef uintptr_t (*LFLi_t)(uintptr_t, int32_t); typedef uintptr_t (*LFpL_t)(void*, uintptr_t); typedef uintptr_t (*LFpp_t)(void*, void*); @@ -383,7 +384,6 @@ typedef int32_t (*iFXbip__t)(void*, struct_ip_t*); typedef int32_t (*iFSBliu__t)(void*, struct_liu_t*); typedef int32_t (*iFbppi_i_t)(struct_ppi_t*, int32_t); typedef int32_t (*iFXbiip__t)(void*, struct_iip_t*); -typedef int32_t (*iFXbLipi__t)(void*, struct_Lipi_t*); typedef int32_t (*iFrLL_BLL__t)(struct_LL_t*, struct_LL_t*); typedef uintptr_t (*LFXrLiiuL__t)(void*, struct_LiiuL_t*); typedef void (*vFbll_rllll__t)(struct_ll_t*, struct_llll_t*); @@ -898,7 +898,6 @@ typedef uintptr_t (*LFppLp_t)(void*, void*, uintptr_t, void*); typedef uintptr_t (*LFppLa_t)(void*, void*, uintptr_t, void*); typedef uintptr_t (*LFXCii_t)(void*, uint8_t, int32_t, int32_t); typedef uintptr_t (*LFXLuu_t)(void*, uintptr_t, uint32_t, uint32_t); -typedef uintptr_t (*LFXLpi_t)(void*, uintptr_t, void*, int32_t); typedef uintptr_t (*LFXpLp_t)(void*, void*, uintptr_t, void*); typedef void* (*pFEupp_t)(x64emu_t*, uint32_t, void*, void*); typedef void* (*pFEpip_t)(x64emu_t*, void*, int32_t, void*); @@ -1116,6 +1115,7 @@ typedef uint32_t (*uFpLLLS_t)(void*, uintptr_t, uintptr_t, uintptr_t, void*); typedef uint64_t (*UFuiCiu_t)(uint32_t, int32_t, uint8_t, int32_t, uint32_t); typedef intptr_t (*lFpuipC_t)(void*, uint32_t, int32_t, void*, uint8_t); typedef uintptr_t (*LFEppLL_t)(x64emu_t*, void*, void*, uintptr_t, uintptr_t); +typedef uintptr_t (*LFEXLpi_t)(x64emu_t*, void*, uintptr_t, void*, int32_t); typedef uintptr_t (*LFpLppa_t)(void*, uintptr_t, void*, void*, void*); typedef uintptr_t (*LFXLuuu_t)(void*, uintptr_t, uint32_t, uint32_t, uint32_t); typedef uintptr_t (*LFXLpuu_t)(void*, uintptr_t, void*, uint32_t, uint32_t); @@ -1385,7 +1385,6 @@ typedef int32_t (*iFXiLibiip_ip_t)(void*, int32_t, uintptr_t, int32_t, struct_ii typedef int32_t (*iFXLibL_ubL_u_t)(void*, uintptr_t, int32_t, struct_L_t*, uint32_t, struct_L_t*, uint32_t); typedef void (*vFXLpiibpiip_i_t)(void*, uintptr_t, void*, int32_t, int32_t, struct_piip_t*, int32_t); typedef int32_t (*iFXLpiibpiiL_i_t)(void*, uintptr_t, void*, int32_t, int32_t, struct_piiL_t*, int32_t); -typedef uintptr_t (*LFXLpbLipi_uuu_t)(void*, uintptr_t, void*, struct_Lipi_t*, uint32_t, uint32_t, uint32_t); typedef uintptr_t (*LFXLLuubLWWWcc_bLWWWcc__t)(void*, uintptr_t, uintptr_t, uint32_t, uint32_t, struct_LWWWcc_t*, struct_LWWWcc_t*); typedef uintptr_t (*LFXLLbLWWWcc_bLWWWcc_uu_t)(void*, uintptr_t, uintptr_t, struct_LWWWcc_t*, struct_LWWWcc_t*, uint32_t, uint32_t); typedef void (*vFiiiiuuip_t)(int32_t, int32_t, int32_t, int32_t, uint32_t, uint32_t, int32_t, void*); @@ -1435,6 +1434,7 @@ typedef uint8_t (*CFuiifpppp_t)(uint32_t, int32_t, int32_t, float, void*, void*, typedef uint32_t (*uFuipppppp_t)(uint32_t, int32_t, void*, void*, void*, void*, void*, void*); typedef uint32_t (*uFuupuuiuf_t)(uint32_t, uint32_t, void*, uint32_t, uint32_t, int32_t, uint32_t, float); typedef uint32_t (*uFulpppppp_t)(uint32_t, intptr_t, void*, void*, void*, void*, void*, void*); +typedef uintptr_t (*LFEXLppuuu_t)(x64emu_t*, void*, uintptr_t, void*, void*, uint32_t, uint32_t, uint32_t); typedef uintptr_t (*LFXLpuuLLu_t)(void*, uintptr_t, void*, uint32_t, uint32_t, uintptr_t, uintptr_t, uint32_t); typedef int32_t (*iFXLLiippBL__t)(void*, uintptr_t, uintptr_t, int32_t, int32_t, void*, void*, struct_L_t*); typedef int32_t (*iFXLpppbL_pp_t)(void*, uintptr_t, void*, void*, void*, struct_L_t*, void*, void*); @@ -1485,7 +1485,7 @@ typedef int32_t (*iFXiLiiibiip_ip_t)(void*, int32_t, uintptr_t, int32_t, int32_t typedef int32_t (*iFXiLLLiiibiip__t)(void*, int32_t, uintptr_t, uintptr_t, uintptr_t, int32_t, int32_t, int32_t, struct_iip_t*); typedef int32_t (*iFXLbL_bL_ppppp_t)(void*, uintptr_t, struct_L_t*, struct_L_t*, void*, void*, void*, void*, void*); typedef void (*vFXiLLrLiiuL_iipi_t)(void*, int32_t, uintptr_t, uintptr_t, struct_LiiuL_t*, int32_t, int32_t, void*, int32_t); -typedef void* (*pFEXbpLiLLLii_uipbLipi_uu_t)(x64emu_t*, void*, struct_pLiLLLii_t*, uint32_t, int32_t, void*, struct_Lipi_t*, uint32_t, uint32_t); +typedef void* (*pFEXbpLiLLLii_uippuu_t)(x64emu_t*, void*, struct_pLiLLLii_t*, uint32_t, int32_t, void*, void*, uint32_t, uint32_t); typedef void (*vFEXLpppippp_t)(x64emu_t*, void*, uintptr_t, void*, void*, void*, int32_t, void*, void*, void*); typedef void (*vFiiiiiiiiii_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t); typedef void (*vFiiiiiiiiui_t)(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, uint32_t, int32_t); @@ -1817,6 +1817,7 @@ void lFpu_32(x64emu_t *emu, uintptr_t fcn) { lFpu_t fn = (lFpu_t)fcn; R_EAX = to void lFpl_32(x64emu_t *emu, uintptr_t fcn) { lFpl_t fn = (lFpl_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)))); } void lFpL_32(x64emu_t *emu, uintptr_t fcn) { lFpL_t fn = (lFpL_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); } void LFEL_32(x64emu_t *emu, uintptr_t fcn) { LFEL_t fn = (LFEL_t)fcn; R_EAX = to_ulong(fn(emu, from_ulong(from_ptri(ulong_t, R_ESP + 4)))); } +void LFEp_32(x64emu_t *emu, uintptr_t fcn) { LFEp_t fn = (LFEp_t)fcn; R_EAX = to_ulong(fn(emu, from_ptriv(R_ESP + 4))); } void LFLi_32(x64emu_t *emu, uintptr_t fcn) { LFLi_t fn = (LFLi_t)fcn; R_EAX = to_ulong(fn(from_ulong(from_ptri(ulong_t, R_ESP + 4)), from_ptri(int32_t, R_ESP + 8))); } void LFpL_32(x64emu_t *emu, uintptr_t fcn) { LFpL_t fn = (LFpL_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)))); } void LFpp_32(x64emu_t *emu, uintptr_t fcn) { LFpp_t fn = (LFpp_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); } @@ -1880,7 +1881,6 @@ void iFXbip__32(x64emu_t *emu, uintptr_t fcn) { iFXbip__t fn = (iFXbip__t)fcn; s void iFSBliu__32(x64emu_t *emu, uintptr_t fcn) { iFSBliu__t fn = (iFSBliu__t)fcn; struct_liu_t arg_8={0}; R_EAX = fn(io_convert32(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_liu(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } void iFbppi_i_32(x64emu_t *emu, uintptr_t fcn) { iFbppi_i_t fn = (iFbppi_i_t)fcn; struct_ppi_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ppi(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, from_ptri(int32_t, R_ESP + 8)); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ppi(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } void iFXbiip__32(x64emu_t *emu, uintptr_t fcn) { iFXbiip__t fn = (iFXbiip__t)fcn; struct_iip_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_iip(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_iip(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } -void iFXbLipi__32(x64emu_t *emu, uintptr_t fcn) { iFXbLipi__t fn = (iFXbLipi__t)fcn; struct_Lipi_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_Lipi(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_Lipi(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } void iFrLL_BLL__32(x64emu_t *emu, uintptr_t fcn) { iFrLL_BLL__t fn = (iFrLL_BLL__t)fcn; struct_LL_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_LL(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_LL_t arg_8={0}; R_EAX = fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_LL(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } void LFXrLiiuL__32(x64emu_t *emu, uintptr_t fcn) { LFXrLiiuL__t fn = (LFXrLiiuL__t)fcn; struct_LiiuL_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_LiiuL(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL)); } void vFbll_rllll__32(x64emu_t *emu, uintptr_t fcn) { vFbll_rllll__t fn = (vFbll_rllll__t)fcn; struct_ll_t arg_4={0}; if (*(ptr_t*)(from_ptr((R_ESP + 4)))) from_struct_ll(&arg_4, *(ptr_t*)(from_ptr((R_ESP + 4)))); struct_llll_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_llll(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); fn(*(ptr_t*)(from_ptr((R_ESP + 4))) ? &arg_4 : NULL, *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 4)))) to_struct_ll(*(ptr_t*)(from_ptr((R_ESP + 4))), &arg_4); } @@ -2395,7 +2395,6 @@ void LFppLp_32(x64emu_t *emu, uintptr_t fcn) { LFppLp_t fn = (LFppLp_t)fcn; R_EA void LFppLa_32(x64emu_t *emu, uintptr_t fcn) { LFppLa_t fn = (LFppLa_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_locale(from_ptri(ptr_t, R_ESP + 16)))); } void LFXCii_32(x64emu_t *emu, uintptr_t fcn) { LFXCii_t fn = (LFXCii_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(uint8_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } void LFXLuu_32(x64emu_t *emu, uintptr_t fcn) { LFXLuu_t fn = (LFXLuu_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16))); } -void LFXLpi_32(x64emu_t *emu, uintptr_t fcn) { LFXLpi_t fn = (LFXLpi_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } void LFXpLp_32(x64emu_t *emu, uintptr_t fcn) { LFXpLp_t fn = (LFXpLp_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptriv(R_ESP + 16))); } void pFEupp_32(x64emu_t *emu, uintptr_t fcn) { pFEupp_t fn = (pFEupp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(uint32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); } void pFEpip_32(x64emu_t *emu, uintptr_t fcn) { pFEpip_t fn = (pFEpip_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12))); } @@ -2613,6 +2612,7 @@ void uFpLLLS_32(x64emu_t *emu, uintptr_t fcn) { uFpLLLS_t fn = (uFpLLLS_t)fcn; R void UFuiCiu_32(x64emu_t *emu, uintptr_t fcn) { UFuiCiu_t fn = (UFuiCiu_t)fcn; ui64_t r; r.u = (uint64_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(uint8_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20)); R_EAX = r.d[0]; R_EDX = r.d[1]; } void lFpuipC_32(x64emu_t *emu, uintptr_t fcn) { lFpuipC_t fn = (lFpuipC_t)fcn; R_EAX = to_long(fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint8_t, R_ESP + 20))); } void LFEppLL_32(x64emu_t *emu, uintptr_t fcn) { LFEppLL_t fn = (LFEppLL_t)fcn; R_EAX = to_ulong(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)))); } +void LFEXLpi_32(x64emu_t *emu, uintptr_t fcn) { LFEXLpi_t fn = (LFEXLpi_t)fcn; R_EAX = to_ulong(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16))); } void LFpLppa_32(x64emu_t *emu, uintptr_t fcn) { LFpLppa_t fn = (LFpLppa_t)fcn; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_locale(from_ptri(ptr_t, R_ESP + 20)))); } void LFXLuuu_32(x64emu_t *emu, uintptr_t fcn) { LFXLuuu_t fn = (LFXLuuu_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20))); } void LFXLpuu_32(x64emu_t *emu, uintptr_t fcn) { LFXLpuu_t fn = (LFXLpuu_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20))); } @@ -2882,7 +2882,6 @@ void iFXiLibiip_ip_32(x64emu_t *emu, uintptr_t fcn) { iFXiLibiip_ip_t fn = (iFXi void iFXLibL_ubL_u_32(x64emu_t *emu, uintptr_t fcn) { iFXLibL_ubL_u_t fn = (iFXLibL_ubL_u_t)fcn; struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_L_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_L(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptri(int32_t, R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(uint32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, from_ptri(uint32_t, R_ESP + 28)); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } void vFXLpiibpiip_i_32(x64emu_t *emu, uintptr_t fcn) { vFXLpiibpiip_i_t fn = (vFXLpiibpiip_i_t)fcn; struct_piip_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_piip(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, from_ptri(int32_t, R_ESP + 28)); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_piip(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } void iFXLpiibpiiL_i_32(x64emu_t *emu, uintptr_t fcn) { iFXLpiibpiiL_i_t fn = (iFXLpiibpiiL_i_t)fcn; struct_piiL_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_piiL(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, from_ptri(int32_t, R_ESP + 28)); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_piiL(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } -void LFXLpbLipi_uuu_32(x64emu_t *emu, uintptr_t fcn) { LFXLpbLipi_uuu_t fn = (LFXLpbLipi_uuu_t)fcn; struct_Lipi_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_Lipi(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28))); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_Lipi(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } void LFXLLuubLWWWcc_bLWWWcc__32(x64emu_t *emu, uintptr_t fcn) { LFXLLuubLWWWcc_bLWWWcc__t fn = (LFXLLuubLWWWcc_bLWWWcc__t)fcn; struct_LWWWcc_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_LWWWcc(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); struct_LWWWcc_t arg_28={0}; if (*(ptr_t*)(from_ptr((R_ESP + 28)))) from_struct_LWWWcc(&arg_28, *(ptr_t*)(from_ptr((R_ESP + 28)))); R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, *(ptr_t*)(from_ptr((R_ESP + 28))) ? &arg_28 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); if (*(ptr_t*)(from_ptr((R_ESP + 28)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 28))), &arg_28); } void LFXLLbLWWWcc_bLWWWcc_uu_32(x64emu_t *emu, uintptr_t fcn) { LFXLLbLWWWcc_bLWWWcc_uu_t fn = (LFXLLbLWWWcc_bLWWWcc_uu_t)fcn; struct_LWWWcc_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_LWWWcc(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); struct_LWWWcc_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_LWWWcc(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28))); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); if (*(ptr_t*)(from_ptr((R_ESP + 20)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 20))), &arg_20); } void vFiiiiuuip_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiuuip_t fn = (vFiiiiuuip_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32)); } @@ -2932,6 +2931,7 @@ void CFuiifpppp_32(x64emu_t *emu, uintptr_t fcn) { CFuiifpppp_t fn = (CFuiifpppp void uFuipppppp_32(x64emu_t *emu, uintptr_t fcn) { uFuipppppp_t fn = (uFuipppppp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); } void uFuupuuiuf_32(x64emu_t *emu, uintptr_t fcn) { uFuupuuiuf_t fn = (uFuupuuiuf_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(float, R_ESP + 32)); } void uFulpppppp_32(x64emu_t *emu, uintptr_t fcn) { uFulpppppp_t fn = (uFulpppppp_t)fcn; R_EAX = (uint32_t)fn(from_ptri(uint32_t, R_ESP + 4), from_long(from_ptri(long_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); } +void LFEXLppuuu_32(x64emu_t *emu, uintptr_t fcn) { LFEXLppuuu_t fn = (LFEXLppuuu_t)fcn; R_EAX = to_ulong(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ptri(uint32_t, R_ESP + 24), from_ptri(uint32_t, R_ESP + 28))); } void LFXLpuuLLu_32(x64emu_t *emu, uintptr_t fcn) { LFXLpuuLLu_t fn = (LFXLpuuLLu_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16), from_ptri(uint32_t, R_ESP + 20), from_ulong(from_ptri(ulong_t, R_ESP + 24)), from_ulong(from_ptri(ulong_t, R_ESP + 28)), from_ptri(uint32_t, R_ESP + 32))); } void iFXLLiippBL__32(x64emu_t *emu, uintptr_t fcn) { iFXLLiippBL__t fn = (iFXLLiippBL__t)fcn; struct_L_t arg_32={0}; R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), *(ptr_t*)(from_ptr((R_ESP + 32))) ? &arg_32 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 32)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 32))), &arg_32); } void iFXLpppbL_pp_32(x64emu_t *emu, uintptr_t fcn) { iFXLpppbL_pp_t fn = (iFXLpppbL_pp_t)fcn; struct_L_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_L(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32)); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } @@ -2982,7 +2982,7 @@ void iFXiLiiibiip_ip_32(x64emu_t *emu, uintptr_t fcn) { iFXiLiiibiip_ip_t fn = ( void iFXiLLLiiibiip__32(x64emu_t *emu, uintptr_t fcn) { iFXiLLLiiibiip__t fn = (iFXiLLLiiibiip__t)fcn; struct_iip_t arg_36={0}; if (*(ptr_t*)(from_ptr((R_ESP + 36)))) from_struct_iip(&arg_36, *(ptr_t*)(from_ptr((R_ESP + 36)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), from_ulong(from_ptri(ulong_t, R_ESP + 20)), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), *(ptr_t*)(from_ptr((R_ESP + 36))) ? &arg_36 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 36)))) to_struct_iip(*(ptr_t*)(from_ptr((R_ESP + 36))), &arg_36); } void iFXLbL_bL_ppppp_32(x64emu_t *emu, uintptr_t fcn) { iFXLbL_bL_ppppp_t fn = (iFXLbL_bL_ppppp_t)fcn; struct_L_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_L(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); struct_L_t arg_16={0}; if (*(ptr_t*)(from_ptr((R_ESP + 16)))) from_struct_L(&arg_16, *(ptr_t*)(from_ptr((R_ESP + 16)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL, *(ptr_t*)(from_ptr((R_ESP + 16))) ? &arg_16 : NULL, from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); if (*(ptr_t*)(from_ptr((R_ESP + 16)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 16))), &arg_16); } void vFXiLLrLiiuL_iipi_32(x64emu_t *emu, uintptr_t fcn) { vFXiLLrLiiuL_iipi_t fn = (vFXiLLrLiiuL_iipi_t)fcn; struct_LiiuL_t arg_20={0}; if (*(ptr_t*)(from_ptr((R_ESP + 20)))) from_struct_LiiuL(&arg_20, *(ptr_t*)(from_ptr((R_ESP + 20)))); fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8), from_ulong(from_ptri(ulong_t, R_ESP + 12)), from_ulong(from_ptri(ulong_t, R_ESP + 16)), *(ptr_t*)(from_ptr((R_ESP + 20))) ? &arg_20 : NULL, from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptriv(R_ESP + 32), from_ptri(int32_t, R_ESP + 36)); } -void pFEXbpLiLLLii_uipbLipi_uu_32(x64emu_t *emu, uintptr_t fcn) { pFEXbpLiLLLii_uipbLipi_uu_t fn = (pFEXbpLiLLLii_uipbLipi_uu_t)fcn; struct_pLiLLLii_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pLiLLLii(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_Lipi_t arg_24={0}; if (*(ptr_t*)(from_ptr((R_ESP + 24)))) from_struct_Lipi(&arg_24, *(ptr_t*)(from_ptr((R_ESP + 24)))); R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), *(ptr_t*)(from_ptr((R_ESP + 24))) ? &arg_24 : NULL, from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pLiLLLii(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 24)))) to_struct_Lipi(*(ptr_t*)(from_ptr((R_ESP + 24))), &arg_24); } +void pFEXbpLiLLLii_uippuu_32(x64emu_t *emu, uintptr_t fcn) { pFEXbpLiLLLii_uippuu_t fn = (pFEXbpLiLLLii_uippuu_t)fcn; struct_pLiLLLii_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_pLiLLLii(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(uint32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptriv(R_ESP + 20), from_ptriv(R_ESP + 24), from_ptri(uint32_t, R_ESP + 28), from_ptri(uint32_t, R_ESP + 32))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_pLiLLLii(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); } void vFEXLpppippp_32(x64emu_t *emu, uintptr_t fcn) { vFEXLpppippp_t fn = (vFEXLpppippp_t)fcn; fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ulong(from_ptri(ulong_t, R_ESP + 8)), from_ptriv(R_ESP + 12), from_ptriv(R_ESP + 16), from_ptriv(R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptriv(R_ESP + 28), from_ptriv(R_ESP + 32), from_ptriv(R_ESP + 36)); } void vFiiiiiiiiii_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiiiii_t fn = (vFiiiiiiiiii_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(int32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40)); } void vFiiiiiiiiui_32(x64emu_t *emu, uintptr_t fcn) { vFiiiiiiiiui_t fn = (vFiiiiiiiiui_t)fcn; fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(int32_t, R_ESP + 16), from_ptri(int32_t, R_ESP + 20), from_ptri(int32_t, R_ESP + 24), from_ptri(int32_t, R_ESP + 28), from_ptri(int32_t, R_ESP + 32), from_ptri(uint32_t, R_ESP + 36), from_ptri(int32_t, R_ESP + 40)); } diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h index 5e57b8a7..a34df650 100644 --- a/src/wrapped32/generated/wrapper32.h +++ b/src/wrapped32/generated/wrapper32.h @@ -271,6 +271,7 @@ void lFpu_32(x64emu_t *emu, uintptr_t fnc); void lFpl_32(x64emu_t *emu, uintptr_t fnc); void lFpL_32(x64emu_t *emu, uintptr_t fnc); void LFEL_32(x64emu_t *emu, uintptr_t fnc); +void LFEp_32(x64emu_t *emu, uintptr_t fnc); void LFLi_32(x64emu_t *emu, uintptr_t fnc); void LFpL_32(x64emu_t *emu, uintptr_t fnc); void LFpp_32(x64emu_t *emu, uintptr_t fnc); @@ -334,7 +335,6 @@ void iFXbip__32(x64emu_t *emu, uintptr_t fnc); void iFSBliu__32(x64emu_t *emu, uintptr_t fnc); void iFbppi_i_32(x64emu_t *emu, uintptr_t fnc); void iFXbiip__32(x64emu_t *emu, uintptr_t fnc); -void iFXbLipi__32(x64emu_t *emu, uintptr_t fnc); void iFrLL_BLL__32(x64emu_t *emu, uintptr_t fnc); void LFXrLiiuL__32(x64emu_t *emu, uintptr_t fnc); void vFbll_rllll__32(x64emu_t *emu, uintptr_t fnc); @@ -849,7 +849,6 @@ void LFppLp_32(x64emu_t *emu, uintptr_t fnc); void LFppLa_32(x64emu_t *emu, uintptr_t fnc); void LFXCii_32(x64emu_t *emu, uintptr_t fnc); void LFXLuu_32(x64emu_t *emu, uintptr_t fnc); -void LFXLpi_32(x64emu_t *emu, uintptr_t fnc); void LFXpLp_32(x64emu_t *emu, uintptr_t fnc); void pFEupp_32(x64emu_t *emu, uintptr_t fnc); void pFEpip_32(x64emu_t *emu, uintptr_t fnc); @@ -1067,6 +1066,7 @@ void uFpLLLS_32(x64emu_t *emu, uintptr_t fnc); void UFuiCiu_32(x64emu_t *emu, uintptr_t fnc); void lFpuipC_32(x64emu_t *emu, uintptr_t fnc); void LFEppLL_32(x64emu_t *emu, uintptr_t fnc); +void LFEXLpi_32(x64emu_t *emu, uintptr_t fnc); void LFpLppa_32(x64emu_t *emu, uintptr_t fnc); void LFXLuuu_32(x64emu_t *emu, uintptr_t fnc); void LFXLpuu_32(x64emu_t *emu, uintptr_t fnc); @@ -1336,7 +1336,6 @@ void iFXiLibiip_ip_32(x64emu_t *emu, uintptr_t fnc); void iFXLibL_ubL_u_32(x64emu_t *emu, uintptr_t fnc); void vFXLpiibpiip_i_32(x64emu_t *emu, uintptr_t fnc); void iFXLpiibpiiL_i_32(x64emu_t *emu, uintptr_t fnc); -void LFXLpbLipi_uuu_32(x64emu_t *emu, uintptr_t fnc); void LFXLLuubLWWWcc_bLWWWcc__32(x64emu_t *emu, uintptr_t fnc); void LFXLLbLWWWcc_bLWWWcc_uu_32(x64emu_t *emu, uintptr_t fnc); void vFiiiiuuip_32(x64emu_t *emu, uintptr_t fnc); @@ -1386,6 +1385,7 @@ void CFuiifpppp_32(x64emu_t *emu, uintptr_t fnc); void uFuipppppp_32(x64emu_t *emu, uintptr_t fnc); void uFuupuuiuf_32(x64emu_t *emu, uintptr_t fnc); void uFulpppppp_32(x64emu_t *emu, uintptr_t fnc); +void LFEXLppuuu_32(x64emu_t *emu, uintptr_t fnc); void LFXLpuuLLu_32(x64emu_t *emu, uintptr_t fnc); void iFXLLiippBL__32(x64emu_t *emu, uintptr_t fnc); void iFXLpppbL_pp_32(x64emu_t *emu, uintptr_t fnc); @@ -1436,7 +1436,7 @@ void iFXiLiiibiip_ip_32(x64emu_t *emu, uintptr_t fnc); void iFXiLLLiiibiip__32(x64emu_t *emu, uintptr_t fnc); void iFXLbL_bL_ppppp_32(x64emu_t *emu, uintptr_t fnc); void vFXiLLrLiiuL_iipi_32(x64emu_t *emu, uintptr_t fnc); -void pFEXbpLiLLLii_uipbLipi_uu_32(x64emu_t *emu, uintptr_t fnc); +void pFEXbpLiLLLii_uippuu_32(x64emu_t *emu, uintptr_t fnc); void vFEXLpppippp_32(x64emu_t *emu, uintptr_t fnc); void vFiiiiiiiiii_32(x64emu_t *emu, uintptr_t fnc); void vFiiiiiiiiui_32(x64emu_t *emu, uintptr_t fnc); diff --git a/src/wrapped32/wrappedlibgl.c b/src/wrapped32/wrappedlibgl.c index 8a45afe2..d520a6a8 100644 --- a/src/wrapped32/wrappedlibgl.c +++ b/src/wrapped32/wrappedlibgl.c @@ -16,8 +16,7 @@ #include "librarian.h" #include "callback.h" #include "gltools.h" -#include "libtools/my_x11_defs.h" -#include "libtools/my_x11_defs_32.h" +#include "libtools/my_x11_conv.h" extern const char* libglName; #define LIBNAME libgl @@ -28,8 +27,6 @@ extern const char* libglName; void* getDisplay(void* d); // define in 32bits wrappedx11.c -void convert_XVisualInfo_to_32(void* d, void* s); -void convert_XVisualInfo_to_64(void* d, void* s); // FIXME: old wrapped* type of file, cannot use generated/wrappedlibgltypes.h void* getGLProcAddress32(x64emu_t* emu, glprocaddress_t procaddr, const char* rname); EXPORT void* my32_glXGetProcAddress(x64emu_t* emu, void* name) @@ -498,7 +495,7 @@ static void* my32_glXGetVisualFromFBConfig_##A(x64emu_t* emu, void* dpy, void* c if(!res) \ return NULL; \ my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; \ - convert_XVisualInfo_to_32(vinfo, res); \ + convert_XVisualInfo_to_32(dpy, vinfo, res); \ return vinfo; \ } SUPER() @@ -526,7 +523,7 @@ static void* my32_glXChooseVisual_##A(x64emu_t* emu, void* dpy, int screen, int* if(!res) \ return NULL; \ my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; \ - convert_XVisualInfo_to_32(vinfo, res); \ + convert_XVisualInfo_to_32(dpy, vinfo, res); \ return vinfo; \ } SUPER() @@ -551,7 +548,7 @@ static void* my32_glXCreateContext_##A(x64emu_t* emu, void* dpy, my_XVisualInfo_ if(!my32_glXCreateContext_fct_##A) \ return NULL; \ my_XVisualInfo_t info_l = {0}; \ - convert_XVisualInfo_to_64(&info_l, info); \ + convert_XVisualInfo_to_64(dpy, &info_l, info); \ return my32_glXCreateContext_fct_##A (dpy, &info_l, shared, direct); \ } SUPER() @@ -946,7 +943,7 @@ EXPORT void* my32_glXGetVisualFromFBConfig(x64emu_t* emu, void* dpy, void* confi void* res = my->glXGetVisualFromFBConfig(dpy, config); if(!res) return NULL; my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; - convert_XVisualInfo_to_32(vinfo, res); + convert_XVisualInfo_to_32(dpy, vinfo, res); return vinfo; } @@ -955,14 +952,14 @@ EXPORT void* my32_glXChooseVisual(x64emu_t* emu, void* dpy, int screen, int* att void* res = my->glXChooseVisual(dpy, screen, attr); if(!res) return NULL; my_XVisualInfo_32_t* vinfo = (my_XVisualInfo_32_t*)res; - convert_XVisualInfo_to_32(vinfo, res); + convert_XVisualInfo_to_32(dpy, vinfo, res); return vinfo; } EXPORT void* my32_glXCreateContext(x64emu_t* emu, void* dpy, my_XVisualInfo_32_t* info, void* shared, int direct) { my_XVisualInfo_t info_l = {0}; - convert_XVisualInfo_to_64(&info_l, info); + convert_XVisualInfo_to_64(dpy, &info_l, info); return my->glXCreateContext(dpy, &info_l, shared, direct); } diff --git a/src/wrapped32/wrappedlibx11.c b/src/wrapped32/wrappedlibx11.c index cfd99314..e2256ba5 100644 --- a/src/wrapped32/wrappedlibx11.c +++ b/src/wrapped32/wrappedlibx11.c @@ -38,8 +38,7 @@ typedef int (*WireToEventProc)(void*, void*, void*); typedef int(*EventHandler) (void*,void*,void*); int32_t my32_XIfEvent(x64emu_t* emu, void* d,void* ev, EventHandler h, void* arg); -void UnwrapXImage(void* d, void* s); -void WrapXImage(void* d, void* s); +void delShmInfo(my_XShmSegmentInfo_t* a); // edfine in Xext, to remove a saved ShmInfo typedef void (*vFp_t)(void*); typedef int (*iFp_t)(void*); @@ -200,6 +199,8 @@ static int my32_error_handler_##A(void* dpy, void* error) { \ static my_XErrorEvent_32_t evt = {0}; \ convert_XErrorEvent_to_32(&evt, error); \ + printf_log(LOG_DEBUG, "Calling Xerrorhandler(%p, %p), err=%hhu/%hhu/%hhu\n", \ + dpy, error, evt.error_code, evt.request_code, evt.minor_code); \ return (int)RunFunctionFmt(my32_error_handler_fct_##A, "pp", FindDisplay(dpy), &evt); \ } SUPER() @@ -584,14 +585,14 @@ static void* find_async_handler_Fct(void* fct) static uintptr_t my32_create_image_fct_##A = 0; \ static void* my32_create_image_##A(void* a, void* b, uint32_t c, int d, int e, void* f, uint32_t g, uint32_t h, int i, int j) \ { \ - void* ret = (void*)RunFunctionFmt(my32_create_image_fct_##A, "ppuiipuuii", FindDisplay(a), b, c, d, e, f, g, h, i, j); \ + void* ret = (void*)RunFunctionFmt(my32_create_image_fct_##A, "ppuiipuuii", FindDisplay(a), convert_Visual_to_32(a, b), c, d, e, f, g, h, i, j); \ UnwrapXImage(ret, ret); \ return ret; \ } \ static pFXpuiipuuii_t my32_rev_create_image_fct_##A = NULL; \ static void* my32_rev_create_image_##A(void* a, void* b, uint32_t c, int d, int e, void* f, uint32_t g, uint32_t h, int i, int j) \ { \ - void* ret = my32_rev_create_image_fct_##A (getDisplay(a), b, c, d, e, f, g, h, i, j); \ + void* ret = my32_rev_create_image_fct_##A (getDisplay(a), convert_Visual_to_64(a, b), c, d, e, f, g, h, i, j); \ WrapXImage(ret, ret); \ return ret; \ } @@ -633,24 +634,31 @@ static void* reverse_create_image_Fct(library_t* lib, void* fct) SUPER() #undef GO if(f) - return (void*)AddCheckBridge(lib->w.bridge, pFXpuiipuuii_32, f, 0, "ximage_create_image"); + return (void*)AddCheckBridge(lib->w.bridge, pFXpuiipuuii_32, f, 0, "Ximage_create_image"); printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 create_image callback\n"); return fct; } // destroy_image #define GO(A) \ -static uintptr_t my32_destroy_image_fct_##A = 0; \ -static int my32_destroy_image_##A(void* a) \ -{ \ - inplace_XImage_shrink(a); \ - return (int)RunFunctionFmt(my32_destroy_image_fct_##A, "p", a); \ -} \ -static iFp_t my32_rev_destroy_image_fct_##A = NULL; \ -static int my32_rev_destroy_image_##A(void* a) \ -{ \ - inplace_XImage_enlarge(a); \ - to_hash_d((uintptr_t)((XImage*)a)->obdata); \ - return my32_rev_destroy_image_fct_##A (a); \ +static uintptr_t my32_destroy_image_fct_##A = 0; \ +static int my32_destroy_image_##A(void* a) \ +{ \ + void* obdata = ((XImage*)a)->obdata; \ + inplace_XImage_shrink(a); \ + int ret = (int)RunFunctionFmt(my32_destroy_image_fct_##A, "p", a); \ + to_hash_d((uintptr_t)obdata); \ + if(obdata) delShmInfo(obdata); \ + return ret; \ +} \ +static iFp_t my32_rev_destroy_image_fct_##A = NULL; \ +static int my32_rev_destroy_image_##A(void* a) \ +{ \ + inplace_XImage_enlarge(a); \ + to_hash_d((uintptr_t)((XImage*)a)->obdata); \ + void* obdata = ((XImage*)a)->obdata; \ + int ret = my32_rev_destroy_image_fct_##A (a); \ + if(obdata) delShmInfo(obdata); \ + return ret; \ } SUPER() #undef GO @@ -690,7 +698,7 @@ static void* reverse_destroy_image_Fct(library_t* lib, void* fct) SUPER() #undef GO if(f) - return (void*)AddCheckBridge(lib->w.bridge, iFp_32, f, 0, "ximage_destroy_image"); + return (void*)AddCheckBridge(lib->w.bridge, iFp_32, f, 0, "Ximage_destroy_image"); printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 destroy_image callback\n"); return fct; } @@ -750,7 +758,7 @@ static void* reverse_get_pixel_Fct(library_t* lib, void* fct) SUPER() #undef GO if(f) - return (void*)AddCheckBridge(lib->w.bridge, LFpii_32, f, 0, "ximage_get_pixel"); + return (void*)AddCheckBridge(lib->w.bridge, LFpii_32, f, 0, "Ximage_get_pixel"); printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 get_pixel callback\n"); return fct; } @@ -810,7 +818,7 @@ static void* reverse_put_pixel_Fct(library_t* lib, void* fct) SUPER() #undef GO if(f) - return (void*)AddCheckBridge(lib->w.bridge, iFpiiL_32, f, 0, "ximage_put_pixel"); + return (void*)AddCheckBridge(lib->w.bridge, iFpiiL_32, f, 0, "Ximage_put_pixel"); printf_log(LOG_NONE, "Warning, no more slot for reverse 32bits libX11 put_pixel callback\n"); return fct; } @@ -946,16 +954,16 @@ void* my32_XCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t depth, in int32_t my32_XInitImage(x64emu_t* emu, void* img); -void* my32_XGetImage(x64emu_t* emu, void* disp, size_t drawable, int32_t x, int32_t y +void* my32_XGetImage(x64emu_t* emu, void* disp, XID drawable, int32_t x, int32_t y , uint32_t w, uint32_t h, uint32_t plane, int32_t fmt); -int32_t my32_XPutImage(x64emu_t* emu, void* disp, size_t drawable, void* gc, void* image +int32_t my32_XPutImage(x64emu_t* emu, void* disp, XID drawable, void* gc, void* image , int32_t src_x, int32_t src_y, int32_t dst_x, int32_t dst_y , uint32_t w, uint32_t h); -void* my32_XGetSubImage(x64emu_t* emu, void* disp, size_t drawable +void* my32_XGetSubImage(x64emu_t* emu, void* disp, XID drawable , int32_t x, int32_t y - , uint32_t w, uint32_t h, size_t plane, int32_t fmt + , uint32_t w, uint32_t h, XID plane, int32_t fmt , void* image, int32_t dst_x, int32_t dst_y); void my32_XDestroyImage(x64emu_t* emu, void* image); @@ -1519,7 +1527,7 @@ EXPORT void* my32_XCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t de , void* data, uint32_t w, uint32_t h, int32_t pad, int32_t bpl) { - XImage *img = my->XCreateImage(disp, vis, depth, fmt, off, data, w, h, pad, bpl); + XImage *img = my->XCreateImage(disp, convert_Visual_to_64(disp, vis), depth, fmt, off, data, w, h, pad, bpl); if(!img) return img; // bridge all access functions... @@ -1537,7 +1545,7 @@ EXPORT int32_t my32_XInitImage(x64emu_t* emu, void* img) return ret; } -EXPORT void* my32_XGetImage(x64emu_t* emu, void* disp, size_t drawable, int32_t x, int32_t y +EXPORT void* my32_XGetImage(x64emu_t* emu, void* disp, XID drawable, int32_t x, int32_t y , uint32_t w, uint32_t h, uint32_t plane, int32_t fmt) { @@ -1549,10 +1557,13 @@ EXPORT void* my32_XGetImage(x64emu_t* emu, void* disp, size_t drawable, int32_t return img; } -EXPORT void my32__XInitImageFuncPtrs(x64emu_t* emu, XImage* img) +EXPORT void my32__XInitImageFuncPtrs(x64emu_t* emu, XImage_32* img) { - my->_XInitImageFuncPtrs(img); - inplace_XImage_shrink(img); + XImage img_l = {0}; + img->f.add_pixel = img->f.create_image = img->f.destroy_image = img->f.get_pixel = img->f.put_pixel = img->f.sub_image = 0; + UnwrapXImage(&img_l, img); + my->_XInitImageFuncPtrs(&img_l); + WrapXImage(img, &img_l); } EXPORT int32_t my32_XPutImage(x64emu_t* emu, void* disp, size_t drawable, void* gc, void* image @@ -1566,9 +1577,9 @@ EXPORT int32_t my32_XPutImage(x64emu_t* emu, void* disp, size_t drawable, void* return r; } -EXPORT void* my32_XGetSubImage(x64emu_t* emu, void* disp, size_t drawable +EXPORT void* my32_XGetSubImage(x64emu_t* emu, void* disp, XID drawable , int32_t x, int32_t y - , uint32_t w, uint32_t h, size_t plane, int32_t fmt + , uint32_t w, uint32_t h, XID plane, int32_t fmt , void* image, int32_t dst_x, int32_t dst_y) { @@ -1686,7 +1697,7 @@ EXPORT XID my32_XCreateWindow(x64emu_t* emu, void* d, XID Window, int x, int y, my_XSetWindowAttributes_t attrib; if(attr) convert_XSetWindowAttributes_to_64(&attrib, attr); - return my->XCreateWindow(d, Window, x, y, width, height, border_width, depth, cl, visual, mask, attr?(&attrib):NULL); + return my->XCreateWindow(d, Window, x, y, width, height, border_width, depth, cl, convert_Visual_to_64(d, visual), mask, attr?(&attrib):NULL); } EXPORT int my32_XNextEvent(x64emu_t* emu, void* dpy, my_XEvent_32_t* evt) @@ -2132,12 +2143,22 @@ EXPORT void* my32_XGetIMValues(x64emu_t* emu, void* xim, ptr_t* b) EXPORT void* my32_XGetVisualInfo(x64emu_t* emu, void* dpy, long mask, my_XVisualInfo_32_t* template, int* n) { my_XVisualInfo_t template_l = {0}; - if(template) convert_XVisualInfo_to_64(&template_l, template); + if(template) convert_XVisualInfo_to_64(dpy, &template_l, template); my_XVisualInfo_t* ret = my->XGetVisualInfo(dpy, mask, template?(&template_l):NULL, n); - inplace_XVisualInfo_shrink(ret); + inplace_XVisualInfo_shrink(dpy, ret); return ret; } +EXPORT XID my32_XVisualIDFromVisual(x64emu_t* emu, my_Visual_32_t* v) +{ + return from_ulong(v->visualid); +} + +EXPORT XID my32_XCreateColormap(x64emu_t* emu, void* dpy, XID w, my_Visual_32_t* v, int alloc) +{ + return my->XCreateColormap(dpy, w, convert_Visual_to_64(dpy, v), alloc); +} + EXPORT int my32_XQueryColors(x64emu_t* emu, void* dpy, XID map, my_XColor_32_t* defs, int ncolor) { struct_LWWWcc_t defs_l[ncolor]; diff --git a/src/wrapped32/wrappedlibx11_private.h b/src/wrapped32/wrappedlibx11_private.h index 597e7594..a32c5d46 100644 --- a/src/wrapped32/wrappedlibx11_private.h +++ b/src/wrapped32/wrappedlibx11_private.h @@ -209,7 +209,7 @@ GO(XCopyGC, iFXpLp) GO(XCopyPlane, iFXLLpiiuuiiL) //GO(_XCopyToArg, GO(XCreateBitmapFromData, LFXLpuu) -GO(XCreateColormap, LFXLpi) +GOM(XCreateColormap, LFEXLpi) GO(XCreateFontCursor, LFXu) GOM(XCreateFontSet, pFEXpppp) GO(XCreateGC, pFXLLbiLLLiiiiiiiLLiiLiiiiLic_) @@ -1195,7 +1195,7 @@ GO(Xutf8TextPerCharExtents, iFppippippp) GOM(XVaCreateNestedList, pFEiV) GO(XVendorRelease, iFX) GO(_XVIDtoVisual, pFXL) -GO(XVisualIDFromVisual, LFp) +GOM(XVisualIDFromVisual, LFEp) GO(XWarpPointer, iFXLLiiuuii) //GO(_XwcDefaultDrawImageString, //GO(_XwcDefaultDrawString, diff --git a/src/wrapped32/wrappedlibxext.c b/src/wrapped32/wrappedlibxext.c index daadc460..8acbdee7 100644 --- a/src/wrapped32/wrappedlibxext.c +++ b/src/wrapped32/wrappedlibxext.c @@ -402,10 +402,44 @@ static void* find_error_string_Fct(void* fct) #undef SUPER +KHASH_MAP_INIT_INT(shminfo, my_XShmSegmentInfo_t*); +static kh_shminfo_t* shminfos = NULL; + +my_XShmSegmentInfo_t* getShmInfo(void* a) +{ + if(!a) return NULL; + ptr_t key = to_ptrv(a); + khint_t k = kh_get(shminfo, shminfos, key); + my_XShmSegmentInfo_t* ret = NULL; + if(k==kh_end(shminfos)) { + int r; + k = kh_put(shminfo, shminfos, key, &r); + ret = kh_value(shminfos, k) = calloc(1, sizeof(my_XShmSegmentInfo_t)); + } else + ret = kh_value(shminfos, k); + convert_XShmSegmentInfo_to_64(ret, a); + return ret; +} + +void delShmInfo(my_XShmSegmentInfo_t* a) +{ + if(!a) return; + my_XShmSegmentInfo_t* b; + kh_foreach_value(shminfos, b, + if(a==b) { + free(a); + kh_del(shminfo, shminfos, __i); + return; + } + ); +} + EXPORT void* my32_XShmCreateImage(x64emu_t* emu, void* disp, void* vis, uint32_t depth, int32_t fmt , void* data, void* shminfo, uint32_t w, uint32_t h) { - XImage *img = my->XShmCreateImage(disp, vis, depth, fmt, data, shminfo, w, h); + my_XShmSegmentInfo_t* shminfo_l = getShmInfo(shminfo); + XImage *img = my->XShmCreateImage(disp, convert_Visual_to_64(disp, vis), depth, fmt, data, shminfo_l, w, h); + convert_XShmSegmentInfo_to_32(shminfo, shminfo_l); inplace_XImage_shrink(img); return img; } @@ -428,6 +462,30 @@ EXPORT int32_t my32_XShmGetImage(x64emu_t* emu, void* disp, size_t drawable, voi return r; } +EXPORT XID my32_XShmCreatePixmap(x64emu_t* emu, void* dpy, XID d, void* data, void* shminfo, uint32_t width, uint32_t height, uint32_t depth) +{ + my_XShmSegmentInfo_t* shminfo_l = getShmInfo(shminfo); + XID ret = my->XShmCreatePixmap(dpy, d, data, shminfo_l, width, height, depth); + convert_XShmSegmentInfo_to_32(shminfo, shminfo_l); // just in case + return ret; +} + +EXPORT int my32_XShmAttach(x64emu_t* emu, void* dpy, void* shminfo) +{ + my_XShmSegmentInfo_t* shminfo_l = getShmInfo(shminfo); + int ret = my->XShmAttach(dpy, shminfo_l); + convert_XShmSegmentInfo_to_32(shminfo, shminfo_l); // just in case + return ret; +} + +EXPORT int my32_XShmDetach(x64emu_t* emu, void* dpy, void* shminfo) +{ + my_XShmSegmentInfo_t* shminfo_l = getShmInfo(shminfo); + int ret = my->XShmDetach(dpy, shminfo_l); + convert_XShmSegmentInfo_to_32(shminfo, shminfo_l); // just in case + return ret; +} + EXPORT void* my32_XSetExtensionErrorHandler(x64emu_t* emu, void* handler) { (void)emu; @@ -519,4 +577,14 @@ EXPORT int my32_XextRemoveDisplay(x64emu_t* emu, void* ext, void* dpy) #define NEEDED_LIBS "libX11.so.6", "libxcb.so.1", "libXau.so.6", "libdl.so.2", "libXdmcp.so.6" #endif #endif + +#define CUSTOM_INIT \ + shminfos = kh_init(shminfo); + +#define CUSTOM_FINI \ + my_XShmSegmentInfo_t* info; \ + kh_foreach_value(shminfos, info, free(info)); \ + kh_destroy(shminfo, shminfos); \ + shminfos = NULL; + #include "wrappedlib_init32.h" diff --git a/src/wrapped32/wrappedlibxext_private.h b/src/wrapped32/wrappedlibxext_private.h index ea66930f..0d189dbc 100644 --- a/src/wrapped32/wrappedlibxext_private.h +++ b/src/wrapped32/wrappedlibxext_private.h @@ -78,14 +78,14 @@ GO(XShapeQueryExtension, iFXpp) GO(XShapeQueryExtents, iFXLpppppppppp) GO(XShapeQueryVersion, iFXpp) GO(XShapeSelectInput, vFXLL) -GO(XShmAttach, iFXbLipi_) -GOM(XShmCreateImage, pFEXbpLiLLLii_uipbLipi_uu) -GO(XShmCreatePixmap, LFXLpbLipi_uuu) -GO(XShmDetach, iFXbLipi_) +GOM(XShmAttach, iFEXp) //!\ use shminfo +GOM(XShmCreateImage, pFEXbpLiLLLii_uippuu) //!\ use shminfo +GOM(XShmCreatePixmap, LFEXLppuuu) //!\ use shminfo +GOM(XShmDetach, iFEXp) //!\ use shminfo GO(XShmGetEventBase, iFX) GOM(XShmGetImage, iFEXLpiiL) GO(XShmPixmapFormat, iFX) -GOM(XShmPutImage, iFEXLppiiiiuui) // Warning: failed to confirm +GOM(XShmPutImage, iFEXLppiiiiuui) GO(XShmQueryExtension, iFX) GO(XShmQueryVersion, iFXppp) //GO(XSyncAwait, iFppi) diff --git a/src/wrapped32/wrappedlibxrender.c b/src/wrapped32/wrappedlibxrender.c index e1688640..fcef909a 100644 --- a/src/wrapped32/wrappedlibxrender.c +++ b/src/wrapped32/wrappedlibxrender.c @@ -33,8 +33,7 @@ #define NEEDED_LIBS "libX11.so.6" #endif -#include "libtools/my_x11_defs.h" -#include "libtools/my_x11_defs_32.h" +#include "libtools/my_x11_conv.h" #include "generated/wrappedlibxrendertypes32.h" @@ -46,12 +45,13 @@ static kh_picformat_t* hash_picformat; EXPORT void* my32_XRenderFindFormat(x64emu_t* emu, void* dpy, unsigned long mask, void* tmpl, int count) { void* ret = my->XRenderFindFormat(dpy, mask, tmpl, count); + if(!ret) return NULL; khint_t k = kh_get(picformat, hash_picformat, (uintptr_t)ret); if(k!=kh_end(hash_picformat)) return kh_value(hash_picformat, k); int r; k = kh_put(picformat, hash_picformat, (uintptr_t)ret, &r); - struct_LiiuL_t* res = box_calloc(1, sizeof(struct_LiiuL_t)); + struct_LiiuL_t* res = calloc(1, sizeof(struct_LiiuL_t)); to_struct_LiiuL(to_ptrv(res), ret); kh_value(hash_picformat, k) = res; return res; @@ -60,12 +60,13 @@ EXPORT void* my32_XRenderFindFormat(x64emu_t* emu, void* dpy, unsigned long mask EXPORT void* my32_XRenderFindStandardFormat(x64emu_t* emu, void* dpy, int fmt) { void* ret = my->XRenderFindStandardFormat(dpy, fmt); + if(!ret) return NULL; khint_t k = kh_get(picformat, hash_picformat, (uintptr_t)ret); if(k!=kh_end(hash_picformat)) return kh_value(hash_picformat, k); int r; k = kh_put(picformat, hash_picformat, (uintptr_t)ret, &r); - struct_LiiuL_t* res = box_calloc(1, sizeof(struct_LiiuL_t)); + struct_LiiuL_t* res = calloc(1, sizeof(struct_LiiuL_t)); to_struct_LiiuL(to_ptrv(res), ret); kh_value(hash_picformat, k) = res; return res; @@ -73,25 +74,25 @@ EXPORT void* my32_XRenderFindStandardFormat(x64emu_t* emu, void* dpy, int fmt) EXPORT void* my32_XRenderFindVisualFormat(x64emu_t* emu, void* dpy, void* visual) { - void* ret = my->XRenderFindVisualFormat(dpy, visual); + void* ret = my->XRenderFindVisualFormat(dpy, convert_Visual_to_64(dpy, visual)); + if(!ret) return NULL; khint_t k = kh_get(picformat, hash_picformat, (uintptr_t)ret); if(k!=kh_end(hash_picformat)) return kh_value(hash_picformat, k); int r; k = kh_put(picformat, hash_picformat, (uintptr_t)ret, &r); - struct_LiiuL_t* res = box_calloc(1, sizeof(struct_LiiuL_t)); + struct_LiiuL_t* res = calloc(1, sizeof(struct_LiiuL_t)); to_struct_LiiuL(to_ptrv(res), ret); kh_value(hash_picformat, k) = res; return res; } - -#define CUSTOM_INIT \ - hash_picformat = kh_init(picformat); +#define CUSTOM_INIT \ + hash_picformat = kh_init(picformat); \ #define CUSTOM_FINI \ void* p; \ - kh_foreach_value(hash_picformat, p, box_free(p)); \ + kh_foreach_value(hash_picformat, p, free(p)); \ kh_destroy(picformat, hash_picformat); \ - hash_picformat = NULL; + hash_picformat = NULL; \ #include "wrappedlib_init32.h" |