mirror of https://github.com/ptitSeb/box64.git
[BOX32][WRAPPER] Fixed 32bits wrapping for XRenderQueryFilters function
This commit is contained in:
parent
b3165e62ab
commit
68f5512ee7
|
@ -1407,3 +1407,35 @@ void* inplace_XDeviceInfo_enlarge(void* a)
|
|||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
|
||||
void* inplace_XFilters_shrink(void* a)
|
||||
{
|
||||
if(a) {
|
||||
my_XFilters_t* src = a;
|
||||
my_XFilters_32_t* dst = a;
|
||||
dst->nfilter = src->nfilter;
|
||||
char** filter = src->filter;
|
||||
dst->filter = to_ptrv(filter);
|
||||
dst->nalias = src->nalias;
|
||||
dst->alias = to_ptrv(src->alias);
|
||||
for(int i=0; i<dst->nfilter; ++i)
|
||||
((ptr_t*)(filter))[i] = to_ptrv(filter[i]);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
void* inplace_XFilters_enlarge(void* a)
|
||||
{
|
||||
if(a) {
|
||||
my_XFilters_t* dst = a;
|
||||
my_XFilters_32_t* src = a;
|
||||
dst->alias = from_ptrv(src->alias);
|
||||
dst->nalias = src->nalias;
|
||||
dst->filter = from_ptrv(src->filter);
|
||||
dst->nfilter = src->nfilter;
|
||||
char** filter = dst->filter;
|
||||
for(int i=dst->nfilter-1; i>=0; --i)
|
||||
filter[i] = from_ptrv(((ptr_t*)(filter))[i]);
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
|
|
@ -113,4 +113,7 @@ void* inplace_XAnyClassInfo_enlarge(void* a);
|
|||
void* inplace_XDeviceInfo_shrink(void* a, int n);
|
||||
void* inplace_XDeviceInfo_enlarge(void* a);
|
||||
|
||||
void* inplace_XFilters_shrink(void* a);
|
||||
void* inplace_XFilters_enlarge(void* a);
|
||||
|
||||
#endif//MY_X11_CONV
|
|
@ -1465,4 +1465,11 @@ typedef struct my_XFixesCursorImage_s {
|
|||
void* name; /* Version >= 2 only */
|
||||
} my_XFixesCursorImage_t;
|
||||
|
||||
typedef struct my_XFilters_s {
|
||||
int nfilter;
|
||||
char **filter;
|
||||
int nalias;
|
||||
short *alias;
|
||||
} my_XFilters_t;
|
||||
|
||||
#endif//MY_X11_DEFS
|
|
@ -1407,4 +1407,11 @@ typedef struct my_XFixesCursorImage_32_s {
|
|||
ptr_t name; /* Version >= 2 only */
|
||||
} my_XFixesCursorImage_32_t;
|
||||
|
||||
typedef struct my_XFilters_32_s {
|
||||
int nfilter;
|
||||
ptr_t filter; //char **
|
||||
int nalias;
|
||||
ptr_t alias; //short *
|
||||
} my_XFilters_32_t;
|
||||
|
||||
#endif//MY_X11_DEFS_32
|
|
@ -3035,6 +3035,8 @@ wrappedlibxrandr:
|
|||
wrappedlibxrender:
|
||||
- pFXi:
|
||||
- XRenderFindStandardFormat
|
||||
- pFXL:
|
||||
- XRenderQueryFilters
|
||||
- pFXp:
|
||||
- XRenderFindVisualFormat
|
||||
- pFXLrLiiwwwwwwwwL_i:
|
||||
|
|
|
@ -12,11 +12,13 @@
|
|||
#endif
|
||||
|
||||
typedef void* (*pFXi_t)(void*, int32_t);
|
||||
typedef void* (*pFXL_t)(void*, uintptr_t);
|
||||
typedef void* (*pFXp_t)(void*, void*);
|
||||
typedef void* (*pFXLrLiiwwwwwwwwL_i_t)(void*, uintptr_t, struct_LiiwwwwwwwwL_t*, int32_t);
|
||||
|
||||
#define SUPER() ADDED_FUNCTIONS() \
|
||||
GO(XRenderFindStandardFormat, pFXi_t) \
|
||||
GO(XRenderQueryFilters, pFXL_t) \
|
||||
GO(XRenderFindVisualFormat, pFXp_t) \
|
||||
GO(XRenderFindFormat, pFXLrLiiwwwwwwwwL_i_t)
|
||||
|
||||
|
|
|
@ -86,6 +86,13 @@ EXPORT void* my32_XRenderFindVisualFormat(x64emu_t* emu, void* dpy, void* visual
|
|||
kh_value(hash_picformat, k) = res;
|
||||
return res;
|
||||
}
|
||||
|
||||
EXPORT void* my32_XRenderQueryFilters(x64emu_t* emu, void* dpy, unsigned long drawable)
|
||||
{
|
||||
void* ret = my->XRenderQueryFilters(dpy, drawable);
|
||||
return inplace_XFilters_shrink(ret);
|
||||
}
|
||||
|
||||
#define CUSTOM_INIT \
|
||||
hash_picformat = kh_init(picformat); \
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ GO(XRenderFreeGlyphSet, vFXL)
|
|||
GO(XRenderFreePicture, vFXL)
|
||||
GO(XRenderParseColor, iFXpp)
|
||||
GO(XRenderQueryExtension, iFXpp)
|
||||
GO(XRenderQueryFilters, pFXL)
|
||||
GOM(XRenderQueryFilters, pFEXL)
|
||||
GO(XRenderQueryFormats, iFX)
|
||||
GO(XRenderQueryPictIndexValues, pFXrLiiwwwwwwwwL_p)
|
||||
GO(XRenderQuerySubpixelOrder, iFXi)
|
||||
|
|
Loading…
Reference in New Issue