about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-09-24 16:50:18 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-09-24 16:50:18 +0200
commitc25fc8cc24bfcd67772971bbe467d0e7c6250d54 (patch)
tree8735add22d08dbb5ca6ca9f5da22a0af2e65f9ab /src
parentbddeac4b456ad4707beb469ddee1652d53b97f59 (diff)
downloadbox64-c25fc8cc24bfcd67772971bbe467d0e7c6250d54.tar.gz
box64-c25fc8cc24bfcd67772971bbe467d0e7c6250d54.zip
[BOX32][WRAPPER] Added a few 32bits function to libxrandr
Diffstat (limited to 'src')
-rw-r--r--src/libtools/my_x11_defs.h60
-rw-r--r--src/libtools/my_x11_defs_32.h59
-rw-r--r--src/wrapped32/generated/functions_list.txt8
-rw-r--r--src/wrapped32/generated/wrappedlibxrandrtypes32.h7
-rw-r--r--src/wrapped32/generated/wrapper32.c6
-rw-r--r--src/wrapped32/generated/wrapper32.h3
-rw-r--r--src/wrapped32/wrappedlibxrandr.c171
-rw-r--r--src/wrapped32/wrappedlibxrandr_private.h18
8 files changed, 322 insertions, 10 deletions
diff --git a/src/libtools/my_x11_defs.h b/src/libtools/my_x11_defs.h
index b1f4a1d6..1c935a31 100644
--- a/src/libtools/my_x11_defs.h
+++ b/src/libtools/my_x11_defs.h
@@ -760,5 +760,65 @@ typedef struct my_XWMHints_s {
 #define XWMHint_WindowGroupHint         (1L << 6)
 #define XWMHint_XUrgencyHint            (1L << 8)
 
+typedef struct my_XRRModeInfo_s {
+    XID                 id;
+    unsigned int        width;
+    unsigned int        height;
+    unsigned long       dotClock;
+    unsigned int        hSyncStart;
+    unsigned int        hSyncEnd;
+    unsigned int        hTotal;
+    unsigned int        hSkew;
+    unsigned int        vSyncStart;
+    unsigned int        vSyncEnd;
+    unsigned int        vTotal;
+    char                *name;
+    unsigned int        nameLength;
+    unsigned long       modeFlags;
+} my_XRRModeInfo_t;
+
+
+typedef struct my_XRRScreenResources_s {
+    unsigned long   timestamp;
+    unsigned long   configTimestamp;
+    int             ncrtc;
+    XID             *crtcs;
+    int             noutput;
+    XID             *outputs;
+    int             nmode;
+    my_XRRModeInfo_t *modes;
+} my_XRRScreenResources_t;
+
+typedef struct my_XRRCrtcInfo_s {
+    unsigned long   timestamp;
+    int             x, y;
+    unsigned int    width, height;
+    XID             mode;
+    uint16_t        rotation;
+    int             noutput;
+    XID             *outputs;
+    uint16_t        rotations;
+    int             npossible;
+    XID             *possible;
+} my_XRRCrtcInfo_t;
+
+typedef struct my_XRROutputInfo_s {
+    unsigned long   timestamp;
+    XID             crtc;
+    char            *name;
+    int             nameLen;
+    unsigned long   mm_width;
+    unsigned long   mm_height;
+    uint16_t        connection;
+    uint16_t        subpixel_order;
+    int             ncrtc;
+    XID             *crtcs;
+    int             nclone;
+    XID             *clones;
+    int             nmode;
+    int             npreferred;
+    XID             *modes;
+} my_XRROutputInfo_t;
+
 
 #endif//MY_X11_DEFS
\ No newline at end of file
diff --git a/src/libtools/my_x11_defs_32.h b/src/libtools/my_x11_defs_32.h
index 0dd9c07d..c0fda3f6 100644
--- a/src/libtools/my_x11_defs_32.h
+++ b/src/libtools/my_x11_defs_32.h
@@ -695,5 +695,64 @@ typedef struct my_XWMHints_32_s {
     XID_32 window_group;
 } my_XWMHints_32_t;
 
+typedef struct my_XRRModeInfo_32_s {
+    XID_32              id;
+    unsigned int        width;
+    unsigned int        height;
+    ulong_t             dotClock;
+    unsigned int        hSyncStart;
+    unsigned int        hSyncEnd;
+    unsigned int        hTotal;
+    unsigned int        hSkew;
+    unsigned int        vSyncStart;
+    unsigned int        vSyncEnd;
+    unsigned int        vTotal;
+    ptr_t               name;   //char*
+    unsigned int        nameLength;
+    ulong_t             modeFlags;
+} my_XRRModeInfo_32_t;
+
+
+typedef struct my_XRRScreenResources_32_s {
+    ulong_t     timestamp;
+    ulong_t     configTimestamp;
+    int         ncrtc;
+    ptr_t       crtcs;  //XID_32*
+    int         noutput;
+    ptr_t       outputs;    //XID_32*
+    int         nmode;
+    ptr_t       modes;  //my_XRRModeInfo_32_t *
+} my_XRRScreenResources_32_t;
+
+typedef struct my_XRRCrtcInfo_32_s {
+    ulong_t         timestamp;
+    int             x, y;
+    unsigned int    width, height;
+    XID_32          mode;
+    uint16_t        rotation;
+    int             noutput;
+    ptr_t           outputs;    //XID_32*
+    uint16_t        rotations;
+    int             npossible;
+    ptr_t           possible;   //XID_32*
+} my_XRRCrtcInfo_32_t;
+
+typedef struct my_XRROutputInfo_32_s {
+    ulong_t         timestamp;
+    XID_32          crtc;
+    ptr_t           name;   //char*
+    int             nameLen;
+    ulong_t         mm_width;
+    ulong_t         mm_height;
+    uint16_t        connection;
+    uint16_t        subpixel_order;
+    int             ncrtc;
+    ptr_t           crtcs; //XID_32*
+    int             nclone;
+    ptr_t           clones; //XID_32*
+    int             nmode;
+    int             npreferred;
+    ptr_t           modes; //XID_32*
+} my_XRROutputInfo_32_t;
 
 #endif//MY_X11_DEFS_32
\ No newline at end of file
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt
index c58cdc05..2c2cee32 100644
--- a/src/wrapped32/generated/functions_list.txt
+++ b/src/wrapped32/generated/functions_list.txt
@@ -182,6 +182,7 @@
 #() LFpL -> LFpL
 #() LFpp -> LFpp
 #() LFXi -> LFXi
+#() LFXL -> LFXL
 #() pFEv -> pFEv
 #() pFEu -> pFEu
 #() pFEp -> pFEp
@@ -365,6 +366,7 @@
 #() pFEpi -> pFEpi
 #() pFEpp -> pFEpp
 #() pFEpV -> pFEpV
+#() pFEXL -> pFEXL
 #() pFipi -> pFipi
 #() pFulu -> pFulu
 #() pFpii -> pFpii
@@ -541,6 +543,7 @@
 #() pFEupp -> pFEupp
 #() pFEppi -> pFEppi
 #() pFEppp -> pFEppp
+#() pFEXpL -> pFEXpL
 #() pFiiiu -> pFiiiu
 #() pFillu -> pFillu
 #() pFippu -> pFippu
@@ -1405,6 +1408,11 @@ wrappedlibx11:
 wrappedlibxcursor:
 wrappedlibxfixes:
 wrappedlibxrandr:
+- pFXL:
+  - XRRGetScreenResources
+- pFXpL:
+  - XRRGetCrtcInfo
+  - XRRGetOutputInfo
 wrappedlibxrender:
 wrappedopenal:
 - vFv:
diff --git a/src/wrapped32/generated/wrappedlibxrandrtypes32.h b/src/wrapped32/generated/wrappedlibxrandrtypes32.h
index afced4f1..6acabbe8 100644
--- a/src/wrapped32/generated/wrappedlibxrandrtypes32.h
+++ b/src/wrapped32/generated/wrappedlibxrandrtypes32.h
@@ -11,7 +11,12 @@
 #define ADDED_FUNCTIONS() 
 #endif
 
+typedef void* (*pFXL_t)(void*, uintptr_t);
+typedef void* (*pFXpL_t)(void*, void*, uintptr_t);
 
-#define SUPER() ADDED_FUNCTIONS()
+#define SUPER() ADDED_FUNCTIONS() \
+	GO(XRRGetScreenResources, pFXL_t) \
+	GO(XRRGetCrtcInfo, pFXpL_t) \
+	GO(XRRGetOutputInfo, pFXpL_t)
 
 #endif // __wrappedlibxrandrTYPES32_H_
diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c
index fd908410..4343715d 100644
--- a/src/wrapped32/generated/wrapper32.c
+++ b/src/wrapped32/generated/wrapper32.c
@@ -271,6 +271,7 @@ typedef intptr_t (*lFpl_t)(void*, intptr_t);
 typedef uintptr_t (*LFpL_t)(void*, uintptr_t);
 typedef uintptr_t (*LFpp_t)(void*, void*);
 typedef uintptr_t (*LFXi_t)(void*, int32_t);
+typedef uintptr_t (*LFXL_t)(void*, uintptr_t);
 typedef void* (*pFEv_t)(x64emu_t*);
 typedef void* (*pFEu_t)(x64emu_t*, uint32_t);
 typedef void* (*pFEp_t)(x64emu_t*, void*);
@@ -454,6 +455,7 @@ typedef void* (*pFEip_t)(x64emu_t*, int32_t, void*);
 typedef void* (*pFEpi_t)(x64emu_t*, void*, int32_t);
 typedef void* (*pFEpp_t)(x64emu_t*, void*, void*);
 typedef void* (*pFEpV_t)(x64emu_t*, void*, void*);
+typedef void* (*pFEXL_t)(x64emu_t*, void*, uintptr_t);
 typedef void* (*pFipi_t)(int32_t, void*, int32_t);
 typedef void* (*pFulu_t)(uint32_t, intptr_t, uint32_t);
 typedef void* (*pFpii_t)(void*, int32_t, int32_t);
@@ -630,6 +632,7 @@ typedef uintptr_t (*LFXLpi_t)(void*, uintptr_t, void*, int32_t);
 typedef void* (*pFEupp_t)(x64emu_t*, uint32_t, void*, void*);
 typedef void* (*pFEppi_t)(x64emu_t*, void*, void*, int32_t);
 typedef void* (*pFEppp_t)(x64emu_t*, void*, void*, void*);
+typedef void* (*pFEXpL_t)(x64emu_t*, void*, void*, uintptr_t);
 typedef void* (*pFiiiu_t)(int32_t, int32_t, int32_t, uint32_t);
 typedef void* (*pFillu_t)(int32_t, intptr_t, intptr_t, uint32_t);
 typedef void* (*pFippu_t)(int32_t, void*, void*, uint32_t);
@@ -1260,6 +1263,7 @@ void lFpl_32(x64emu_t *emu, uintptr_t fcn) { lFpl_t fn = (lFpl_t)fcn; R_EAX = to
 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), to_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))); }
 void LFXi_32(x64emu_t *emu, uintptr_t fcn) { LFXi_t fn = (LFXi_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), from_ptri(int32_t, R_ESP + 8))); }
+void LFXL_32(x64emu_t *emu, uintptr_t fcn) { LFXL_t fn = (LFXL_t)fcn; R_EAX = to_ulong(fn(getDisplay(from_ptriv(R_ESP + 4)), to_ulong(from_ptri(ulong_t, R_ESP + 8)))); }
 void pFEv_32(x64emu_t *emu, uintptr_t fcn) { pFEv_t fn = (pFEv_t)fcn; R_EAX = to_ptrv(fn(emu)); }
 void pFEu_32(x64emu_t *emu, uintptr_t fcn) { pFEu_t fn = (pFEu_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptri(uint32_t, R_ESP + 4))); }
 void pFEp_32(x64emu_t *emu, uintptr_t fcn) { pFEp_t fn = (pFEp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4))); }
@@ -1443,6 +1447,7 @@ void pFEip_32(x64emu_t *emu, uintptr_t fcn) { pFEip_t fn = (pFEip_t)fcn; R_EAX =
 void pFEpi_32(x64emu_t *emu, uintptr_t fcn) { pFEpi_t fn = (pFEpi_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8))); }
 void pFEpp_32(x64emu_t *emu, uintptr_t fcn) { pFEpp_t fn = (pFEpp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8))); }
 void pFEpV_32(x64emu_t *emu, uintptr_t fcn) { pFEpV_t fn = (pFEpV_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptrv(R_ESP + 8))); }
+void pFEXL_32(x64emu_t *emu, uintptr_t fcn) { pFEXL_t fn = (pFEXL_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), to_ulong(from_ptri(ulong_t, R_ESP + 8)))); }
 void pFipi_32(x64emu_t *emu, uintptr_t fcn) { pFipi_t fn = (pFipi_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); }
 void pFulu_32(x64emu_t *emu, uintptr_t fcn) { pFulu_t fn = (pFulu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(uint32_t, R_ESP + 4), to_long(from_ptri(long_t, R_ESP + 8)), from_ptri(uint32_t, R_ESP + 12))); }
 void pFpii_32(x64emu_t *emu, uintptr_t fcn) { pFpii_t fn = (pFpii_t)fcn; R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); }
@@ -1619,6 +1624,7 @@ void LFXLpi_32(x64emu_t *emu, uintptr_t fcn) { LFXLpi_t fn = (LFXLpi_t)fcn; R_EA
 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 pFEppi_32(x64emu_t *emu, uintptr_t fcn) { pFEppi_t fn = (pFEppi_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptri(int32_t, R_ESP + 12))); }
 void pFEppp_32(x64emu_t *emu, uintptr_t fcn) { pFEppp_t fn = (pFEppp_t)fcn; R_EAX = to_ptrv(fn(emu, from_ptriv(R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12))); }
+void pFEXpL_32(x64emu_t *emu, uintptr_t fcn) { pFEXpL_t fn = (pFEXpL_t)fcn; R_EAX = to_ptrv(fn(emu, getDisplay(from_ptriv(R_ESP + 4)), from_ptriv(R_ESP + 8), to_ulong(from_ptri(ulong_t, R_ESP + 12)))); }
 void pFiiiu_32(x64emu_t *emu, uintptr_t fcn) { pFiiiu_t fn = (pFiiiu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptri(int32_t, R_ESP + 8), from_ptri(int32_t, R_ESP + 12), from_ptri(uint32_t, R_ESP + 16))); }
 void pFillu_32(x64emu_t *emu, uintptr_t fcn) { pFillu_t fn = (pFillu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), to_long(from_ptri(long_t, R_ESP + 8)), to_long(from_ptri(long_t, R_ESP + 12)), from_ptri(uint32_t, R_ESP + 16))); }
 void pFippu_32(x64emu_t *emu, uintptr_t fcn) { pFippu_t fn = (pFippu_t)fcn; R_EAX = to_ptrv(fn(from_ptri(int32_t, R_ESP + 4), from_ptriv(R_ESP + 8), from_ptriv(R_ESP + 12), from_ptri(uint32_t, R_ESP + 16))); }
diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h
index 226f700d..a4bfbba9 100644
--- a/src/wrapped32/generated/wrapper32.h
+++ b/src/wrapped32/generated/wrapper32.h
@@ -223,6 +223,7 @@ void lFpl_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);
 void LFXi_32(x64emu_t *emu, uintptr_t fnc);
+void LFXL_32(x64emu_t *emu, uintptr_t fnc);
 void pFEv_32(x64emu_t *emu, uintptr_t fnc);
 void pFEu_32(x64emu_t *emu, uintptr_t fnc);
 void pFEp_32(x64emu_t *emu, uintptr_t fnc);
@@ -406,6 +407,7 @@ void pFEip_32(x64emu_t *emu, uintptr_t fnc);
 void pFEpi_32(x64emu_t *emu, uintptr_t fnc);
 void pFEpp_32(x64emu_t *emu, uintptr_t fnc);
 void pFEpV_32(x64emu_t *emu, uintptr_t fnc);
+void pFEXL_32(x64emu_t *emu, uintptr_t fnc);
 void pFipi_32(x64emu_t *emu, uintptr_t fnc);
 void pFulu_32(x64emu_t *emu, uintptr_t fnc);
 void pFpii_32(x64emu_t *emu, uintptr_t fnc);
@@ -582,6 +584,7 @@ void LFXLpi_32(x64emu_t *emu, uintptr_t fnc);
 void pFEupp_32(x64emu_t *emu, uintptr_t fnc);
 void pFEppi_32(x64emu_t *emu, uintptr_t fnc);
 void pFEppp_32(x64emu_t *emu, uintptr_t fnc);
+void pFEXpL_32(x64emu_t *emu, uintptr_t fnc);
 void pFiiiu_32(x64emu_t *emu, uintptr_t fnc);
 void pFillu_32(x64emu_t *emu, uintptr_t fnc);
 void pFippu_32(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped32/wrappedlibxrandr.c b/src/wrapped32/wrappedlibxrandr.c
index 496ee650..c070dd68 100644
--- a/src/wrapped32/wrappedlibxrandr.c
+++ b/src/wrapped32/wrappedlibxrandr.c
@@ -24,6 +24,177 @@
 #endif
 
 #define LIBNAME libxrandr
+
+#include "libtools/my_x11_defs.h"
+#include "libtools/my_x11_defs_32.h"
+
+#include "generated/wrappedlibxrandrtypes32.h"
+
+#include "wrappercallback32.h"
+
+void convert_XRRModeInfo_to_32(void* d, const void* s)
+{
+    my_XRRModeInfo_32_t *dst = d;
+    const my_XRRModeInfo_t *src = s;
+    dst->id = to_ulong(src->id);
+    dst->width = src->width;
+    dst->height = src->height;
+    dst->dotClock = to_ulong(src->dotClock);
+    dst->hSyncStart = src->hSyncStart;
+    dst->hSyncEnd = src->hSyncEnd;
+    dst->hTotal = src->hTotal;
+    dst->hSkew = src->hSkew;
+    dst->vSyncStart = src->vSyncStart;
+    dst->vSyncEnd = src->vSyncEnd;
+    dst->vTotal = src->vTotal;
+    dst->name = to_ptrv(src->name);
+    dst->nameLength = src->nameLength;
+    dst->modeFlags = to_ulong(src->modeFlags);
+}
+
+void convert_XRRModeInfo_to_64(void* d, const void* s)
+{
+    my_XRRModeInfo_t *dst = d;
+    const my_XRRModeInfo_32_t *src = s;
+    dst->modeFlags = from_ulong(src->modeFlags);
+    dst->nameLength = src->nameLength;
+    dst->name = from_ptrv(src->name);
+    dst->vTotal = src->vTotal;
+    dst->vSyncEnd = src->vSyncEnd;
+    dst->vSyncStart = src->vSyncStart;
+    dst->hSkew = src->hSkew;
+    dst->hTotal = src->hTotal;
+    dst->hSyncEnd = src->hSyncEnd;
+    dst->hSyncStart = src->hSyncStart;
+    dst->dotClock = from_ulong(src->dotClock);
+    dst->height = src->height;
+    dst->width = src->width;
+    dst->id = from_ulong(src->id);
+}
+
+void inplace_XRRScreenResources_shrink(void* s)
+{
+    if(!s) return;
+    my_XRRScreenResources_32_t *dst = s;
+    my_XRRScreenResources_t *src = s;
+    // shrinking, so forward...
+    dst->timestamp = to_ulong(src->timestamp);
+    dst->configTimestamp = to_ulong(src->configTimestamp);
+    dst->ncrtc = src->ncrtc;
+    for(int i=0; i<dst->ncrtc; ++i)
+        ((XID_32*)src->crtcs)[i] = to_ulong(src->crtcs[i]);
+    dst->crtcs = to_ptrv(src->crtcs);
+    dst->noutput = src->noutput;
+    for(int i=0; i<dst->noutput; ++i)
+        ((XID_32*)src->outputs)[i] = to_ulong(src->outputs[i]);
+    dst->outputs = to_ptrv(src->outputs);
+    dst->nmode = src->nmode;
+    for(int i=0; i<dst->noutput; ++i)
+        convert_XRRModeInfo_to_32(&((my_XRRModeInfo_32_t*)src->modes)[i], &src->modes[i]);
+    dst->modes = to_ptrv(src->modes);
+}
+
+void inplace_XRRScreenResources_enlarge(void* s)
+{
+    if(!s) return;
+    my_XRRScreenResources_t *dst = s;
+    my_XRRScreenResources_32_t *src = s;
+    // enlarge, so backward...
+    int nmode = src->nmode;
+    int noutput = src->noutput;
+    int ncrtc = src->ncrtc;
+    dst->modes = from_ptrv(src->modes);
+    for(int i=nmode-1; i>=0; --i)
+        convert_XRRModeInfo_to_64(&dst->modes[i], &((my_XRRModeInfo_32_t*)dst->modes)[i]);
+    dst->nmode = src->nmode;
+    dst->outputs = from_ptrv(src->outputs);
+    for(int i=noutput-1; i>=0; --i)
+        dst->outputs[i] = from_ulong(((XID_32*)dst->outputs)[i]);
+    dst->noutput = src->noutput;
+    dst->crtcs = from_ptrv(src->crtcs);
+    for(int i=ncrtc-1; i>=0; --i)
+        dst->crtcs[i] = from_ulong(((XID_32*)dst->crtcs)[i]);
+    dst->ncrtc = src->ncrtc;
+    dst->configTimestamp = to_ulong(src->configTimestamp);
+    dst->timestamp = to_ulong(src->timestamp);
+}
+
+EXPORT void* my32_XRRGetScreenResources(x64emu_t* emu, void* dpy, XID window)
+{
+    void* ret = my->XRRGetScreenResources(dpy, window);
+    inplace_XRRScreenResources_shrink(ret);
+    return ret;
+}
+
+void inplace_XRRCrtcInfo_shrink(void* s)
+{
+    if(!s) return;
+    my_XRRCrtcInfo_32_t *dst = s;
+    my_XRRCrtcInfo_t *src = s;
+    dst->timestamp = to_ulong(src->timestamp);
+    dst->x = src->x;
+    dst->y = src->y;
+    dst->width = src->width;
+    dst->height = src->height;
+    dst->mode = to_ulong(src->mode);
+    dst->rotation = src->rotation;
+    dst->noutput = src->noutput;
+    for(int i=0; i<dst->noutput; ++i)
+        ((XID_32*)src->outputs)[i] = to_ulong(src->outputs[i]);
+    dst->outputs = to_ptrv(src->outputs);
+    dst->rotations = src->rotations;
+    dst->npossible = src->npossible;
+    for(int i=0; i<dst->npossible; ++i)
+        ((XID_32*)src->possible)[i] = to_ulong(src->possible[i]);
+    dst->possible = to_ptrv(src->possible);
+}
+
+EXPORT void* my32_XRRGetCrtcInfo(x64emu_t* emu, void* dpy, void* res, XID crtc)
+{
+    inplace_XRRScreenResources_enlarge(res);
+    void* ret = my->XRRGetCrtcInfo(dpy, res, crtc);
+    inplace_XRRScreenResources_shrink(res);
+    inplace_XRRCrtcInfo_shrink(ret);
+    return ret;
+}
+
+void inplace_XRROutputInfo_shrink(void* s)
+{
+    if(!s) return;
+    my_XRROutputInfo_32_t *dst = s;
+    my_XRROutputInfo_t *src = s;
+    dst->timestamp = to_ulong(src->timestamp);
+    dst->crtc = src->crtc;
+    dst->name = to_ptrv(src->name);
+    dst->nameLen = src->nameLen;
+    dst->mm_width = to_ulong(src->mm_width);
+    dst->mm_height = to_ulong(src->mm_height);
+    dst->connection = src->connection;
+    dst->subpixel_order = src->subpixel_order;
+    dst->ncrtc = src->ncrtc;
+    for(int i=0; i<dst->ncrtc; ++i)
+        ((XID_32*)src->crtcs)[i] = to_ulong(src->crtcs[i]);
+    dst->crtcs = to_ptrv(src->crtcs);
+    dst->nclone = src->nclone;
+    for(int i=0; i<dst->nclone; ++i)
+        ((XID_32*)src->clones)[i] = to_ulong(src->clones[i]);
+    dst->clones = to_ptrv(src->clones);
+    dst->nmode = src->nmode;
+    dst->npreferred = src->npreferred;
+    for(int i=0; i<dst->nmode; ++i)
+        ((XID_32*)src->modes)[i] = to_ulong(src->modes[i]);
+    dst->modes = to_ptrv(src->modes);
+}
+
+EXPORT void* my32_XRRGetOutputInfo(x64emu_t* emu, void* dpy, void* res, XID window)
+{
+    inplace_XRRScreenResources_enlarge(res);
+    void* ret = my->XRRGetOutputInfo(dpy, res, window);
+    inplace_XRRScreenResources_shrink(res);
+    inplace_XRROutputInfo_shrink(ret);
+    return ret;
+}
+
 #if 0
 #ifdef ANDROID
 #define NEEDED_LIBS "libX11.so", "libXext.so", "libXrender.so"
diff --git a/src/wrapped32/wrappedlibxrandr_private.h b/src/wrapped32/wrappedlibxrandr_private.h
index 5d005bc7..2ff06690 100644
--- a/src/wrapped32/wrappedlibxrandr_private.h
+++ b/src/wrapped32/wrappedlibxrandr_private.h
@@ -2,9 +2,9 @@
 #error Meh...
 #endif
 
-//GO(XRRQueryVersion, iFppp)
-//GO(XRRFreeScreenConfigInfo, vFp)
-//GO(XRRGetCrtcInfo, pFppL)
+GO(XRRQueryVersion, iFXpp)
+GO(XRRFreeScreenConfigInfo, vFp)
+GOM(XRRGetCrtcInfo, pFEXpL)
 //GO(XRRListOutputProperties, pFpLp)
 //GO(XRRQueryExtension, iFppp)
 //GO(XRRAllocModeInfo, pFpi)
@@ -17,9 +17,9 @@
 //GO(XRRGetProviderInfo, pFppL)
 //GO(XRRConfigureOutputProperty, vFpLLiiip)
 //GO(XRRSetOutputPrimary, vFpLL)
-//GO(XRRFreeOutputInfo, vFp)
+GO(XRRFreeOutputInfo, vFp)
 //GO(XRRUpdateConfiguration, iFp)
-//GO(XRRGetScreenResources, pFpL)
+GOM(XRRGetScreenResources, pFEXL)
 //GO(XRRConfigSizes, pFpp)
 //GO(XRRQueryProviderProperty, pFpLL)
 //GO(XRRDeleteOutputProperty, vFpLL)
@@ -28,8 +28,8 @@
 //GO(XRRAllocGamma, pFi)
 //GO(XRRSetScreenSize, vFpLiiii)
 //GO(XRRSetScreenConfigAndRate, iFppLiWwL)
-//GO(XRRFreeScreenResources, vFp)
-//GO(XRRGetOutputPrimary, LFpL)
+GO(XRRFreeScreenResources, vFp)
+GO(XRRGetOutputPrimary, LFXL)
 //GO(XRRCreateMode, LFpLp)
 //GO(XRRConfigCurrentRate, wFp)
 //GO(XRRDestroyMode, vFpL)
@@ -55,7 +55,7 @@
 //GO(XRRFreeGamma, vFp)
 //GO(XRRRootToScreen, iFpL)
 //GO(XRRGetScreenInfo, pFpL)
-//GO(XRRFreeCrtcInfo, vFp)
+GO(XRRFreeCrtcInfo, vFp)
 //GO(XRRGetProviderResources, pFpL)
 //GO(XRRFreeModeInfo, vFp)
 //GO(XRRChangeOutputProperty, vFpLLLiipi)
@@ -65,7 +65,7 @@
 //GO(XRRGetCrtcTransform, iFpLp)
 //GO(XRRTimes, LFpip)
 //GO(XRRDeleteOutputMode, vFpLL)
-//GO(XRRGetOutputInfo, pFppL)
+GOM(XRRGetOutputInfo, pFEXpL)
 //GO(XRRConfigureProviderProperty, vFpLLiiip)
 //GO(XRRAllocateMonitor, pFpi)
 //GO(XRRGetMonitors, pFpLip)