Skip to content

Commit

Permalink
[BOX32][WRAPPING] Fixed some issue with intermediate structure conver…
Browse files Browse the repository at this point in the history
…sions
  • Loading branch information
ptitSeb committed Sep 24, 2024
1 parent dc39143 commit d7ad7f0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/wrapped32/generated/converter32.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ void to_struct_LWWWcc(ptr_t d, const struct_LWWWcc_t *src) {
}
void from_struct_pLiL(struct_pLiL_t *dest, ptr_t s) {
uint8_t* src = (uint8_t*)from_ptrv(s);
dest->p0 = *(void**)src; src += 4;
dest->p0 = from_ptrv(*(ptr_t*)src); src += 4;
dest->L1 = from_ulong(*(ulong_t*)src); src += 4;
dest->i2 = *(int*)src; src += 4;
dest->L3 = from_ulong(*(ulong_t*)src); src += 4;
Expand Down
1 change: 1 addition & 0 deletions src/wrapped32/generated/functions_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@
#() LFpBp_i -> LFpBi
#() pFppbp_ -> pFppB
#() vFXLrpLiL_ -> vFXLB
#() vFXLbpLiL_ -> vFXLB
#() iFXLbLWWWcc_ -> iFXLB
#() iFirLLLL_BLLLL_ -> iFiBB
#() pFppriiiiiiiiilt_ -> pFppB
Expand Down
2 changes: 2 additions & 0 deletions src/wrapped32/generated/wrapper32.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ typedef intptr_t (*lFpBp_i_t)(void*, struct_p_t*, int32_t);
typedef uintptr_t (*LFpBp_i_t)(void*, struct_p_t*, int32_t);
typedef void* (*pFppbp__t)(void*, void*, struct_p_t*);
typedef void (*vFXLrpLiL__t)(void*, uintptr_t, struct_pLiL_t*);
typedef void (*vFXLbpLiL__t)(void*, uintptr_t, struct_pLiL_t*);
typedef int32_t (*iFXLbLWWWcc__t)(void*, uintptr_t, struct_LWWWcc_t*);
typedef int32_t (*iFirLLLL_BLLLL__t)(int32_t, struct_LLLL_t*, struct_LLLL_t*);
typedef void* (*pFppriiiiiiiiilt__t)(void*, void*, struct_iiiiiiiiilt_t*);
Expand Down Expand Up @@ -1486,6 +1487,7 @@ void lFpBp_i_32(x64emu_t *emu, uintptr_t fcn) { lFpBp_i_t fn = (lFpBp_i_t)fcn; s
void LFpBp_i_32(x64emu_t *emu, uintptr_t fcn) { LFpBp_i_t fn = (LFpBp_i_t)fcn; struct_p_t arg_8={0}; R_EAX = to_ulong(fn(from_ptriv(R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, from_ptri(int32_t, R_ESP + 12))); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
void pFppbp__32(x64emu_t *emu, uintptr_t fcn) { pFppbp__t fn = (pFppbp__t)fcn; struct_p_t arg_12={0}; from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); }
void vFXLrpLiL__32(x64emu_t *emu, uintptr_t fcn) { vFXLrpLiL__t fn = (vFXLrpLiL__t)fcn; struct_pLiL_t arg_12={0}; from_struct_pLiL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(getDisplay(from_ptriv(R_ESP + 4)), to_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); }
void vFXLbpLiL__32(x64emu_t *emu, uintptr_t fcn) { vFXLbpLiL__t fn = (vFXLbpLiL__t)fcn; struct_pLiL_t arg_12={0}; from_struct_pLiL(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(getDisplay(from_ptriv(R_ESP + 4)), to_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pLiL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); }
void iFXLbLWWWcc__32(x64emu_t *emu, uintptr_t fcn) { iFXLbLWWWcc__t fn = (iFXLbLWWWcc__t)fcn; struct_LWWWcc_t arg_12={0}; from_struct_LWWWcc(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = fn(getDisplay(from_ptriv(R_ESP + 4)), to_ulong(from_ptri(ulong_t, R_ESP + 8)), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LWWWcc(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); }
void iFirLLLL_BLLLL__32(x64emu_t *emu, uintptr_t fcn) { iFirLLLL_BLLLL__t fn = (iFirLLLL_BLLLL__t)fcn; struct_LLLL_t arg_8={0}; from_struct_LLLL(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_LLLL_t arg_12={0}; R_EAX = fn(from_ptri(int32_t, R_ESP + 4), *(ptr_t*)(from_ptr((R_ESP + 8))) ? &arg_8 : NULL, *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_LLLL(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); }
void pFppriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fcn) { pFppriiiiiiiiilt__t fn = (pFppriiiiiiiiilt__t)fcn; struct_iiiiiiiiilt_t arg_12={0}; from_struct_iiiiiiiiilt(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); }
Expand Down
1 change: 1 addition & 0 deletions src/wrapped32/generated/wrapper32.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ void lFpBp_i_32(x64emu_t *emu, uintptr_t fnc);
void LFpBp_i_32(x64emu_t *emu, uintptr_t fnc);
void pFppbp__32(x64emu_t *emu, uintptr_t fnc);
void vFXLrpLiL__32(x64emu_t *emu, uintptr_t fnc);
void vFXLbpLiL__32(x64emu_t *emu, uintptr_t fnc);
void iFXLbLWWWcc__32(x64emu_t *emu, uintptr_t fnc);
void iFirLLLL_BLLLL__32(x64emu_t *emu, uintptr_t fnc);
void pFppriiiiiiiiilt__32(x64emu_t *emu, uintptr_t fnc);
Expand Down
12 changes: 8 additions & 4 deletions src/wrapped32/wrappedlibx11.c
Original file line number Diff line number Diff line change
Expand Up @@ -2297,8 +2297,10 @@ EXPORT int my32_XStringListToTextProperty(x64emu_t* emu, ptr_t* list, int count,
if(list)
for(int i=0; i<count; ++i)
l_list[i] = from_ptrv(list[i]);
//TODO: Need to wrap the XTextProperty produced?
return my->XStringListToTextProperty(list?(&l_list):NULL, count, text);
struct_pLiL_t text_l = {0};
int ret = my->XStringListToTextProperty(list?(&l_list):NULL, count, &text_l);
to_struct_pLiL(to_ptrv(text), &text_l);
return ret;
}

EXPORT int my32_Xutf8TextListToTextProperty(x64emu_t* emu, void* dpy, ptr_t* list, int count, uint32_t style, void* text)
Expand All @@ -2307,8 +2309,10 @@ EXPORT int my32_Xutf8TextListToTextProperty(x64emu_t* emu, void* dpy, ptr_t* lis
if(list)
for(int i=0; i<count; ++i)
l_list[i] = from_ptrv(list[i]);
//TODO: Need to wrap the XTextProperty produced?
return my->Xutf8TextListToTextProperty(dpy, list?(&l_list):NULL, count, style, text);
struct_pLiL_t text_l = {0};
int ret = my->Xutf8TextListToTextProperty(dpy, list?(&l_list):NULL, count, style, &text_l);
to_struct_pLiL(to_ptrv(text), &text_l);
return ret;
}

void convert_XWindowAttributes_to_32(void* d, void* s)
Expand Down
2 changes: 1 addition & 1 deletion src/wrapped32/wrappedlibx11_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ GO(XSetTextProperty, vFXLrpLiL_L)
//GO(XSetWMColormapWindows, iFpLpi)
GOM(XSetWMHints, iFEXLp)
GO(XSetWMIconName, vFXLrpLiL_)
GO(XSetWMName, vFXLrpLiL_)
GO(XSetWMName, vFXLbpLiL_)
GOM(XSetWMNormalHints, vFEXLp)
GOM(XSetWMProperties, vFEXLpppippp)
GOM(XSetWMProtocols, iFEXLpi)
Expand Down

0 comments on commit d7ad7f0

Please sign in to comment.