about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-01-30 15:23:23 +0100
committerptitSeb <sebastien.chev@gmail.com>2025-01-30 15:23:23 +0100
commiteb7858d23ac646a43c70120b18330786cdae0970 (patch)
tree7dcaed0e70352ef819c2564714026f63e4d06bca /src
parent1db09fe897b79b6cdbb7fb9af7a9570c949d0d79 (diff)
downloadbox64-eb7858d23ac646a43c70120b18330786cdae0970.tar.gz
box64-eb7858d23ac646a43c70120b18330786cdae0970.zip
[BOX32][WRAPPER] Fixed a 32bits libcups wrapped function
Diffstat (limited to 'src')
-rw-r--r--src/wrapped32/generated/functions_list.txt3
-rw-r--r--src/wrapped32/generated/wrappedlibcupstypes32.h4
-rw-r--r--src/wrapped32/generated/wrapper32.c2
-rw-r--r--src/wrapped32/generated/wrapper32.h1
-rw-r--r--src/wrapped32/wrappedlibcups.c10
-rw-r--r--src/wrapped32/wrappedlibcups_private.h2
6 files changed, 16 insertions, 6 deletions
diff --git a/src/wrapped32/generated/functions_list.txt b/src/wrapped32/generated/functions_list.txt
index 265e37c8..bda7fd26 100644
--- a/src/wrapped32/generated/functions_list.txt
+++ b/src/wrapped32/generated/functions_list.txt
@@ -784,7 +784,6 @@
 #() iFXLbpp_ -> iFXLB
 #() iFXbLC_i -> iFXBi
 #() uFpubpu_ -> uFpuB
-#() pFpibpp_ -> pFpiB
 #() vFLbL_bL_ -> vFLBB
 #() vFpbLdd_i -> vFpBi
 #() vFpbp_bp_ -> vFpBB
@@ -2412,6 +2411,8 @@ wrappedlibcups:
   - cupsGetDests
 - vFip:
   - cupsFreeDests
+- pFpip:
+  - cupsGetOption
 wrappedlibdl:
 - iEp:
   - dlclose
diff --git a/src/wrapped32/generated/wrappedlibcupstypes32.h b/src/wrapped32/generated/wrappedlibcupstypes32.h
index e7654f52..3c3b63f8 100644
--- a/src/wrapped32/generated/wrappedlibcupstypes32.h
+++ b/src/wrapped32/generated/wrappedlibcupstypes32.h
@@ -13,9 +13,11 @@
 
 typedef int32_t (*iFp_t)(void*);
 typedef void (*vFip_t)(int32_t, void*);
+typedef void* (*pFpip_t)(void*, int32_t, void*);
 
 #define SUPER() ADDED_FUNCTIONS() \
 	GO(cupsGetDests, iFp_t) \
-	GO(cupsFreeDests, vFip_t)
+	GO(cupsFreeDests, vFip_t) \
+	GO(cupsGetOption, pFpip_t)
 
 #endif // __wrappedlibcupsTYPES32_H_
diff --git a/src/wrapped32/generated/wrapper32.c b/src/wrapped32/generated/wrapper32.c
index 5fed3b4d..70a8c017 100644
--- a/src/wrapped32/generated/wrapper32.c
+++ b/src/wrapped32/generated/wrapper32.c
@@ -878,7 +878,6 @@ typedef int32_t (*iFpbpu_p_t)(void*, struct_pu_t*, void*);
 typedef int32_t (*iFXLbpp__t)(void*, uintptr_t, struct_pp_t*);
 typedef int32_t (*iFXbLC_i_t)(void*, struct_LC_t*, int32_t);
 typedef uint32_t (*uFpubpu__t)(void*, uint32_t, struct_pu_t*);
-typedef void* (*pFpibpp__t)(void*, int32_t, struct_pp_t*);
 typedef void (*vFLbL_bL__t)(uintptr_t, struct_L_t*, struct_L_t*);
 typedef void (*vFpbLdd_i_t)(void*, struct_Ldd_t*, int32_t);
 typedef void (*vFpbp_bp__t)(void*, struct_p_t*, struct_p_t*);
@@ -2912,7 +2911,6 @@ void iFpbpu_p_32(x64emu_t *emu, uintptr_t fcn) { iFpbpu_p_t fn = (iFpbpu_p_t)fcn
 void iFXLbpp__32(x64emu_t *emu, uintptr_t fcn) { iFXLbpp__t fn = (iFXLbpp__t)fcn; struct_pp_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pp(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); 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); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pp(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); }
 void iFXbLC_i_32(x64emu_t *emu, uintptr_t fcn) { iFXbLC_i_t fn = (iFXbLC_i_t)fcn; struct_LC_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_LC(&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, from_ptri(int32_t, R_ESP + 12)); if (*(ptr_t*)(from_ptr((R_ESP + 8)))) to_struct_LC(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void uFpubpu__32(x64emu_t *emu, uintptr_t fcn) { uFpubpu__t fn = (uFpubpu__t)fcn; struct_pu_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pu(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = (uint32_t)fn(from_ptriv(R_ESP + 4), from_ptri(uint32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pu(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); }
-void pFpibpp__32(x64emu_t *emu, uintptr_t fcn) { pFpibpp__t fn = (pFpibpp__t)fcn; struct_pp_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_pp(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); R_EAX = to_ptrv(fn(from_ptriv(R_ESP + 4), from_ptri(int32_t, R_ESP + 8), *(ptr_t*)(from_ptr((R_ESP + 12))) ? &arg_12 : NULL)); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_pp(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); }
 void vFLbL_bL__32(x64emu_t *emu, uintptr_t fcn) { vFLbL_bL__t fn = (vFLbL_bL__t)fcn; struct_L_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_L(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); 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)))); fn(from_ulong(from_ptri(ulong_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 + 8)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_L(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); }
 void vFpbLdd_i_32(x64emu_t *emu, uintptr_t fcn) { vFpbLdd_i_t fn = (vFpbLdd_i_t)fcn; struct_Ldd_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_Ldd(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); 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_Ldd(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); }
 void vFpbp_bp__32(x64emu_t *emu, uintptr_t fcn) { vFpbp_bp__t fn = (vFpbp_bp__t)fcn; struct_p_t arg_8={0}; if (*(ptr_t*)(from_ptr((R_ESP + 8)))) from_struct_p(&arg_8, *(ptr_t*)(from_ptr((R_ESP + 8)))); struct_p_t arg_12={0}; if (*(ptr_t*)(from_ptr((R_ESP + 12)))) from_struct_p(&arg_12, *(ptr_t*)(from_ptr((R_ESP + 12)))); fn(from_ptriv(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 + 8)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 8))), &arg_8); if (*(ptr_t*)(from_ptr((R_ESP + 12)))) to_struct_p(*(ptr_t*)(from_ptr((R_ESP + 12))), &arg_12); }
diff --git a/src/wrapped32/generated/wrapper32.h b/src/wrapped32/generated/wrapper32.h
index ae70cd36..09c2bce9 100644
--- a/src/wrapped32/generated/wrapper32.h
+++ b/src/wrapped32/generated/wrapper32.h
@@ -825,7 +825,6 @@ void iFpbpu_p_32(x64emu_t *emu, uintptr_t fnc);
 void iFXLbpp__32(x64emu_t *emu, uintptr_t fnc);
 void iFXbLC_i_32(x64emu_t *emu, uintptr_t fnc);
 void uFpubpu__32(x64emu_t *emu, uintptr_t fnc);
-void pFpibpp__32(x64emu_t *emu, uintptr_t fnc);
 void vFLbL_bL__32(x64emu_t *emu, uintptr_t fnc);
 void vFpbLdd_i_32(x64emu_t *emu, uintptr_t fnc);
 void vFpbp_bp__32(x64emu_t *emu, uintptr_t fnc);
diff --git a/src/wrapped32/wrappedlibcups.c b/src/wrapped32/wrappedlibcups.c
index fbdb7268..caaa0e53 100644
--- a/src/wrapped32/wrappedlibcups.c
+++ b/src/wrapped32/wrappedlibcups.c
@@ -206,4 +206,14 @@ EXPORT int my32_cupsGetDests(x64emu_t* emu, ptr_t* p)
     return ret;
 }
 
+EXPORT void* my32_cupsGetOption(x64emu_t* emu, void* name, int num_options, my_cups_option_32_t* options)
+{
+    my_cups_option_t options_l[num_options];
+    for(int i=0; i<num_options; ++i) {
+        options_l[i].name = from_ptrv(options[i].name);
+        options_l[i].value = from_ptrv(options[i].value);
+    }
+    return my->cupsGetOption(name, num_options, options_l);
+}
+
 #include "wrappedlib_init32.h"
diff --git a/src/wrapped32/wrappedlibcups_private.h b/src/wrapped32/wrappedlibcups_private.h
index 00351980..48825806 100644
--- a/src/wrapped32/wrappedlibcups_private.h
+++ b/src/wrapped32/wrappedlibcups_private.h
@@ -135,7 +135,7 @@ GO(cupsGetIntegerOption, iFpibpp_)
 //GOM(cupsGetJobs, iFEbp_pii)
 //GOM(cupsGetJobs2, iFEpbp_pii)
 //GOM(cupsGetNamedDest, pFEppp)
-GO(cupsGetOption, pFpibpp_)
+GOM(cupsGetOption, pFEpip)
 //GO(_cupsGetPassword, 
 GO(cupsGetPassword, pFp)
 GO(cupsGetPassword2, pFpppp)