1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <dlfcn.h>
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
#include "x64emu.h"
#include "emu/x64emu_private.h"
#include "callback.h"
#include "librarian.h"
#include "box64context.h"
#include "emu/x64emu_private.h"
#include "callback.h"
#include "myalign.h"
const char* dbusName = "libdbus-1.so.3";
#define LIBNAME dbus
#include "generated/wrappeddbustypes.h"
#include "wrappercallback.h"
#define NF 4
#define SUPER() \
GO(0) \
GO(1) \
GO(2) \
GO(3) \
GO(4) \
GO(5) \
GO(6) \
GO(7) \
// DBusFreeFunction
#define GO(A) \
static uintptr_t my_DBusFreeFunction_fct_##A = 0; \
static void my_DBusFreeFunction_##A(void* p) \
{ \
RunFunctionFmt(my_DBusFreeFunction_fct_##A, "p", p); \
}
SUPER()
#undef GO
static void* find_DBusFreeFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusFreeFunction_fct_##A == (uintptr_t)fct) return my_DBusFreeFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusFreeFunction_fct_##A == 0) {my_DBusFreeFunction_fct_##A = (uintptr_t)fct; return my_DBusFreeFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusFreeFunction callback\n");
return NULL;
}
// DBusHandleMessageFunction
#define GO(A) \
static uintptr_t my_DBusHandleMessageFunction_fct_##A = 0; \
static int my_DBusHandleMessageFunction_##A(void* a, void* b, void* c) \
{ \
return RunFunctionFmt(my_DBusHandleMessageFunction_fct_##A, "ppp", a, b, c); \
}
SUPER()
#undef GO
static void* find_DBusHandleMessageFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusHandleMessageFunction_fct_##A == (uintptr_t)fct) return my_DBusHandleMessageFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusHandleMessageFunction_fct_##A == 0) {my_DBusHandleMessageFunction_fct_##A = (uintptr_t)fct; return my_DBusHandleMessageFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusHandleMessageFunction callback\n");
return NULL;
}
// DBusAddTimeoutFunction
#define GO(A) \
static uintptr_t my_DBusAddTimeoutFunction_fct_##A = 0; \
static int my_DBusAddTimeoutFunction_##A(void* a, void* b) \
{ \
return RunFunctionFmt(my_DBusAddTimeoutFunction_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
static void* find_DBusAddTimeoutFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusAddTimeoutFunction_fct_##A == (uintptr_t)fct) return my_DBusAddTimeoutFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusAddTimeoutFunction_fct_##A == 0) {my_DBusAddTimeoutFunction_fct_##A = (uintptr_t)fct; return my_DBusAddTimeoutFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusAddTimeoutFunction callback\n");
return NULL;
}
// DBusRemoveTimeoutFunction
#define GO(A) \
static uintptr_t my_DBusRemoveTimeoutFunction_fct_##A = 0; \
static void my_DBusRemoveTimeoutFunction_##A(void* a, void* b) \
{ \
RunFunctionFmt(my_DBusRemoveTimeoutFunction_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
static void* find_DBusRemoveTimeoutFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusRemoveTimeoutFunction_fct_##A == (uintptr_t)fct) return my_DBusRemoveTimeoutFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusRemoveTimeoutFunction_fct_##A == 0) {my_DBusRemoveTimeoutFunction_fct_##A = (uintptr_t)fct; return my_DBusRemoveTimeoutFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusRemoveTimeoutFunction callback\n");
return NULL;
}
// DBusTimeoutToggledFunction
#define GO(A) \
static uintptr_t my_DBusTimeoutToggledFunction_fct_##A = 0; \
static void my_DBusTimeoutToggledFunction_##A(void* a, void* b) \
{ \
RunFunctionFmt(my_DBusTimeoutToggledFunction_fct_##A, "pp", a, b); \
}
SUPER()
#undef GO
static void* find_DBusTimeoutToggledFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusTimeoutToggledFunction_fct_##A == (uintptr_t)fct) return my_DBusTimeoutToggledFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusTimeoutToggledFunction_fct_##A == 0) {my_DBusTimeoutToggledFunction_fct_##A = (uintptr_t)fct; return my_DBusTimeoutToggledFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusTimeoutToggledFunction callback\n");
return NULL;
}
// DBusWakeupMainFunction
#define GO(A) \
static uintptr_t my_DBusWakeupMainFunction_fct_##A = 0; \
static void my_DBusWakeupMainFunction_##A(void* a) \
{ \
RunFunctionFmt(my_DBusWakeupMainFunction_fct_##A, "p", a); \
}
SUPER()
#undef GO
static void* find_DBusWakeupMainFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusWakeupMainFunction_fct_##A == (uintptr_t)fct) return my_DBusWakeupMainFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusWakeupMainFunction_fct_##A == 0) {my_DBusWakeupMainFunction_fct_##A = (uintptr_t)fct; return my_DBusWakeupMainFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusWakeupMainFunction callback\n");
return NULL;
}
// DBusPendingCallNotifyFunction
#define GO(A) \
static uintptr_t my_DBusPendingCallNotifyFunction_fct_##A = 0; \
static void my_DBusPendingCallNotifyFunction_##A(void* pending, void* data) \
{ \
RunFunctionFmt(my_DBusPendingCallNotifyFunction_fct_##A, "pp", pending, data);\
}
SUPER()
#undef GO
static void* findDBusPendingCallNotifyFunctionFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusPendingCallNotifyFunction_fct_##A == (uintptr_t)fct) return my_DBusPendingCallNotifyFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusPendingCallNotifyFunction_fct_##A == 0) {my_DBusPendingCallNotifyFunction_fct_##A = (uintptr_t)fct; return my_DBusPendingCallNotifyFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus DBusPendingCallNotifyFunction callback\n");
return NULL;
}
// DBusDispatchStatusFunction
#define GO(A) \
static uintptr_t my_DBusDispatchStatusFunction_fct_##A = 0; \
static void my_DBusDispatchStatusFunction_##A(void* connection, int new_status, void* data) \
{ \
RunFunctionFmt(my_DBusDispatchStatusFunction_fct_##A, "pip", connection, new_status, data);\
}
SUPER()
#undef GO
static void* findDBusDispatchStatusFunctionFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusDispatchStatusFunction_fct_##A == (uintptr_t)fct) return my_DBusDispatchStatusFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusDispatchStatusFunction_fct_##A == 0) {my_DBusDispatchStatusFunction_fct_##A = (uintptr_t)fct; return my_DBusDispatchStatusFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus DBusDispatchStatusFunction callback\n");
return NULL;
}
// DBusAddWatchFunction
#define GO(A) \
static uintptr_t my_DBusAddWatchFunction_fct_##A = 0; \
static int my_DBusAddWatchFunction_##A(void* watch, void* data) \
{ \
return (int)RunFunctionFmt(my_DBusAddWatchFunction_fct_##A, "pp", watch, data);\
}
SUPER()
#undef GO
static void* findDBusAddWatchFunctionFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusAddWatchFunction_fct_##A == (uintptr_t)fct) return my_DBusAddWatchFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusAddWatchFunction_fct_##A == 0) {my_DBusAddWatchFunction_fct_##A = (uintptr_t)fct; return my_DBusAddWatchFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus DBusAddWatchFunction callback\n");
return NULL;
}
// DBusRemoveWatchFunction
#define GO(A) \
static uintptr_t my_DBusRemoveWatchFunction_fct_##A = 0; \
static void my_DBusRemoveWatchFunction_##A(void* watch, void* data) \
{ \
RunFunctionFmt(my_DBusRemoveWatchFunction_fct_##A, "pp", watch, data);\
}
SUPER()
#undef GO
static void* findDBusRemoveWatchFunctionFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusRemoveWatchFunction_fct_##A == (uintptr_t)fct) return my_DBusRemoveWatchFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusRemoveWatchFunction_fct_##A == 0) {my_DBusRemoveWatchFunction_fct_##A = (uintptr_t)fct; return my_DBusRemoveWatchFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus DBusRemoveWatchFunction callback\n");
return NULL;
}
// DBusWatchToggledFunction
#define GO(A) \
static uintptr_t my_DBusWatchToggledFunction_fct_##A = 0; \
static void my_DBusWatchToggledFunction_##A(void* watch, void* data) \
{ \
RunFunctionFmt(my_DBusWatchToggledFunction_fct_##A, "pp", watch, data);\
}
SUPER()
#undef GO
static void* findDBusWatchToggledFunctionFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusWatchToggledFunction_fct_##A == (uintptr_t)fct) return my_DBusWatchToggledFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusWatchToggledFunction_fct_##A == 0) {my_DBusWatchToggledFunction_fct_##A = (uintptr_t)fct; return my_DBusWatchToggledFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus DBusWatchToggledFunction callback\n");
return NULL;
}
// DBusObjectPathUnregisterFunction
#define GO(A) \
static uintptr_t my_DBusObjectPathUnregisterFunction_fct_##A = 0; \
static void my_DBusObjectPathUnregisterFunction_##A(void* connection, void* data) \
{ \
RunFunctionFmt(my_DBusObjectPathUnregisterFunction_fct_##A, "pp", connection, data);\
}
SUPER()
#undef GO
static void* findDBusObjectPathUnregisterFunctionFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusObjectPathUnregisterFunction_fct_##A == (uintptr_t)fct) return my_DBusObjectPathUnregisterFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusObjectPathUnregisterFunction_fct_##A == 0) {my_DBusObjectPathUnregisterFunction_fct_##A = (uintptr_t)fct; return my_DBusObjectPathUnregisterFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus DBusObjectPathUnregisterFunction callback\n");
return NULL;
}
// DBusObjectPathMessageFunction
#define GO(A) \
static uintptr_t my_DBusObjectPathMessageFunction_fct_##A = 0; \
static void my_DBusObjectPathMessageFunction_##A(void* connection, void* message, void* data) \
{ \
RunFunctionFmt(my_DBusObjectPathMessageFunction_fct_##A, "ppp", connection, message, data);\
}
SUPER()
#undef GO
static void* findDBusObjectPathMessageFunctionFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusObjectPathMessageFunction_fct_##A == (uintptr_t)fct) return my_DBusObjectPathMessageFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusObjectPathMessageFunction_fct_##A == 0) {my_DBusObjectPathMessageFunction_fct_##A = (uintptr_t)fct; return my_DBusObjectPathMessageFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus DBusObjectPathMessageFunction callback\n");
return NULL;
}
// dbus_internal_pad
#define GO(A) \
static uintptr_t my_dbus_internal_pad_fct_##A = 0; \
static void my_dbus_internal_pad_##A(void* a, void* b, void* c, void* d) \
{ \
RunFunctionFmt(my_dbus_internal_pad_fct_##A, "pppp", a, b, c, d);\
}
SUPER()
#undef GO
static void* finddbus_internal_padFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_dbus_internal_pad_fct_##A == (uintptr_t)fct) return my_dbus_internal_pad_##A;
SUPER()
#undef GO
#define GO(A) if(my_dbus_internal_pad_fct_##A == 0) {my_dbus_internal_pad_fct_##A = (uintptr_t)fct; return my_dbus_internal_pad_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus dbus_internal_pad callback\n");
return NULL;
}
// DBusNewConnectionFunction
#define GO(A) \
static uintptr_t my_DBusNewConnectionFunction_fct_##A = 0; \
static void my_DBusNewConnectionFunction_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(my_DBusNewConnectionFunction_fct_##A, "pppp", a, b, c); \
}
SUPER()
#undef GO
static void* findDBusNewConnectionFunctionFct(void* fct)
{
if(!fct) return NULL;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusNewConnectionFunction_fct_##A == (uintptr_t)fct) return my_DBusNewConnectionFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusNewConnectionFunction_fct_##A == 0) {my_DBusNewConnectionFunction_fct_##A = (uintptr_t)fct; return my_DBusNewConnectionFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for dbus DBusNewConnectionFunction callback\n");
return NULL;
}
// DBusAllowUnixUserFunction
#define GO(A) \
static uintptr_t my_DBusAllowUnixUserFunction_fct_##A = 0; \
static int my_DBusAllowUnixUserFunction_##A(void* a, unsigned long b, void* c) \
{ \
return RunFunctionFmt(my_DBusAllowUnixUserFunction_fct_##A, "pLp", a, b, c); \
}
SUPER()
#undef GO
static void* find_DBusAllowUnixUserFunction_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_DBusAllowUnixUserFunction_fct_##A == (uintptr_t)fct) return my_DBusAllowUnixUserFunction_##A;
SUPER()
#undef GO
#define GO(A) if(my_DBusAllowUnixUserFunction_fct_##A == 0) {my_DBusAllowUnixUserFunction_fct_##A = (uintptr_t)fct; return my_DBusAllowUnixUserFunction_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for libdbus-1.so DBusAllowUnixUserFunction callback\n");
return NULL;
}
#undef SUPER
EXPORT void my_dbus_timeout_set_data(x64emu_t* emu, void* e, void* p, void* f)
{
(void)emu;
my->dbus_timeout_set_data(e, p, find_DBusFreeFunction_Fct(f));
}
EXPORT int32_t my_dbus_connection_set_timeout_functions(x64emu_t* emu, void* c, void* a, void* r, void* t, void* d, void* f)
{
(void)emu;
return my->dbus_connection_set_timeout_functions(c,
find_DBusAddTimeoutFunction_Fct(a),
find_DBusRemoveTimeoutFunction_Fct(r),
find_DBusTimeoutToggledFunction_Fct(t),
d, find_DBusFreeFunction_Fct(f));
}
EXPORT int my_dbus_connection_add_filter(x64emu_t* emu, void* connection, void* fnc, void* data, void* fr)
{
(void)emu;
return my->dbus_connection_add_filter(connection, find_DBusHandleMessageFunction_Fct(fnc), data, find_DBusFreeFunction_Fct(fr));
}
EXPORT void my_dbus_connection_remove_filter(x64emu_t* emu, void* connection, void* fnc, void* data)
{
(void)emu;
my->dbus_connection_remove_filter(connection, find_DBusHandleMessageFunction_Fct(fnc), data);
}
EXPORT int my_dbus_message_get_args_valist(x64emu_t* emu, void* message, void* e, int arg, x64_va_list_t b)
{
(void)emu;
#ifdef CONVERT_VALIST
CONVERT_VALIST(b);
#else
CREATE_VALIST_FROM_VALIST(b, emu->scratch);
#endif
return my->dbus_message_get_args_valist(message, e, arg, VARARGS);
}
EXPORT int my_dbus_message_get_args(x64emu_t* emu, void* message, void* e, int arg, uint64_t* V)
{
(void)emu;
CREATE_VALIST_FROM_VAARG(V, emu->scratch, 3);
return my->dbus_message_get_args_valist(message, e, arg, VARARGS);
}
EXPORT int my_dbus_message_append_args_valist(x64emu_t* emu, void* message, int arg, x64_va_list_t b)
{
(void)emu;
#ifdef CONVERT_VALIST
CONVERT_VALIST(b);
#else
#if 1
CREATE_VALIST_FROM_VALIST(b, emu->scratch);
#else
va_list sysv_varargs;
uintptr_t *p = (uintptr_t*)(emu->scratch);
int n = (X64_VA_MAX_REG - b->gp_offset)/8;
int x = (X64_VA_MAX_XMM - b->fp_offset)/8;
int idx = 0;
int type = arg;
while(arg) {
if(arg == (int)'d') {
// double
if(x)
*(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_XMM - (x--)*8);
else
*(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
} else if(arg == (int)'a') {
// array
// type
if(n)
*(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
else
*(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
// elements
if(n)
*(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
else
*(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
// number of elements
if(n)
*(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
else
*(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
} else if(arg == (int)'s' || arg == (int)'g' || arg == (int)'o') {
// elements
if(n)
*(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
else
*(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
// number of elements
if(n)
*(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
else
*(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
} else {
if(n)
*(p++) = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
else
*(p++) = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
}
if(n)
arg = *(uintptr_t*)(b->reg_save_area + X64_VA_MAX_REG - (n--)*8);
else
arg = *(uintptr_t*)(b->overflow_arg_area + (idx++)*8);
*(p++) = arg;
}
sysv_varargs = (va_list)p;
#endif
#endif
return my->dbus_message_append_args_valist(message, arg, VARARGS);
}
EXPORT int my_dbus_message_append_args(x64emu_t* emu, void* message, int arg, uint64_t* V)
{
(void)emu;
CREATE_VALIST_FROM_VAARG(V, emu->scratch, 2);
return my->dbus_message_append_args_valist(message, arg, VARARGS);
}
EXPORT int my_dbus_message_set_data(x64emu_t* emu, void* message, int32_t slot, void* data, void* free_func)
{
(void)emu;
return my->dbus_message_set_data(message, slot, data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT int my_dbus_pending_call_set_notify(x64emu_t* emu, void* pending, void* func, void* data, void* free_func)
{
(void)emu;
return my->dbus_pending_call_set_notify(pending, findDBusPendingCallNotifyFunctionFct(func), data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT int my_dbus_pending_call_set_data(x64emu_t* emu, void* pending, int32_t slot, void* data, void* free_func)
{
(void)emu;
return my->dbus_pending_call_set_data(pending, slot, data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT void my_dbus_watch_set_data(x64emu_t* emu, void* watch, void* data, void* free_func)
{
(void)emu;
my->dbus_watch_set_data(watch, data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT void my_dbus_connection_set_dispatch_status_function(x64emu_t* emu, void* connection, void* dispatch, void* data, void* free_func)
{
(void)emu;
my->dbus_connection_set_dispatch_status_function(connection, findDBusDispatchStatusFunctionFct(dispatch), data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT int my_dbus_connection_set_watch_functions(x64emu_t* emu, void* connection, void* add, void* remove, void* toggled, void* data, void* free_func)
{
(void)emu;
return my->dbus_connection_set_watch_functions(connection, findDBusAddWatchFunctionFct(add), findDBusRemoveWatchFunctionFct(remove), findDBusWatchToggledFunctionFct(toggled), data, find_DBusFreeFunction_Fct(free_func));
}
typedef struct my_DBusObjectPathVTable_s
{
void* unregister_function;
void* message_function;
void* pad1;
void* pad2;
void* pad3;
void* pad4;
} my_DBusObjectPathVTable_t;
EXPORT int my_dbus_connection_try_register_object_path(x64emu_t* emu, void* connection, void* path, my_DBusObjectPathVTable_t* vtable, void* data, void* error)
{
(void)emu;
my_DBusObjectPathVTable_t vt = {0};
if(vtable) {
vt.unregister_function = findDBusObjectPathUnregisterFunctionFct(vtable->unregister_function);
vt.message_function = findDBusObjectPathMessageFunctionFct(vtable->message_function);
vt.pad1 = finddbus_internal_padFct(vtable->pad1);
vt.pad2 = finddbus_internal_padFct(vtable->pad2);
vt.pad3 = finddbus_internal_padFct(vtable->pad3);
vt.pad4 = finddbus_internal_padFct(vtable->pad4);
}
return my->dbus_connection_try_register_object_path(connection, path, vtable?&vt:NULL, data, error);
}
EXPORT int my_dbus_connection_register_fallback(x64emu_t* emu, void* connection, void* path, my_DBusObjectPathVTable_t* vtable, void* data)
{
(void)emu;
my_DBusObjectPathVTable_t vt = {0};
if(vtable) {
vt.unregister_function = findDBusObjectPathUnregisterFunctionFct(vtable->unregister_function);
vt.message_function = findDBusObjectPathMessageFunctionFct(vtable->message_function);
vt.pad1 = finddbus_internal_padFct(vtable->pad1);
vt.pad2 = finddbus_internal_padFct(vtable->pad2);
vt.pad3 = finddbus_internal_padFct(vtable->pad3);
vt.pad4 = finddbus_internal_padFct(vtable->pad4);
}
return my->dbus_connection_register_fallback(connection, path, vtable?&vt:NULL, data);
}
EXPORT int my_dbus_connection_register_object_path(x64emu_t* emu, void* connection, void* path, my_DBusObjectPathVTable_t* vtable, void* data)
{
(void)emu;
my_DBusObjectPathVTable_t vt = {0};
if(vtable) {
vt.unregister_function = findDBusObjectPathUnregisterFunctionFct(vtable->unregister_function);
vt.message_function = findDBusObjectPathMessageFunctionFct(vtable->message_function);
vt.pad1 = finddbus_internal_padFct(vtable->pad1);
vt.pad2 = finddbus_internal_padFct(vtable->pad2);
vt.pad3 = finddbus_internal_padFct(vtable->pad3);
vt.pad4 = finddbus_internal_padFct(vtable->pad4);
}
return my->dbus_connection_register_object_path(connection, path, vtable?&vt:NULL, data);
}
EXPORT int my_dbus_connection_set_data(x64emu_t* emu, void* connection, int slot, void* data, void* free_func)
{
(void)emu;
return my->dbus_connection_set_data(connection, slot, data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT void my_dbus_connection_set_wakeup_main_function(x64emu_t* emu, void* connection, void* wakeup, void* data, void* free_func)
{
(void)emu;
my->dbus_connection_set_wakeup_main_function(connection, find_DBusWakeupMainFunction_Fct(wakeup), data, find_DBusFreeFunction_Fct(free_func));
}
EXPORT int my_dbus_connection_try_register_fallback(x64emu_t* emu, void* connection, void* path, my_DBusObjectPathVTable_t* vtable, void* data, void* error)
{
(void)emu;
my_DBusObjectPathVTable_t vt = {0};
if(vtable) {
vt.unregister_function = findDBusObjectPathUnregisterFunctionFct(vtable->unregister_function);
vt.message_function = findDBusObjectPathMessageFunctionFct(vtable->message_function);
vt.pad1 = finddbus_internal_padFct(vtable->pad1);
vt.pad2 = finddbus_internal_padFct(vtable->pad2);
vt.pad3 = finddbus_internal_padFct(vtable->pad3);
vt.pad4 = finddbus_internal_padFct(vtable->pad4);
}
return my->dbus_connection_try_register_fallback(connection, path, vtable?&vt:NULL, data, error);
}
EXPORT int my_dbus_server_set_watch_functions(x64emu_t* emu, void* server, void* add, void* rem, void* toggle, void* data, void* d)
{
return my->dbus_server_set_watch_functions(server, findDBusAddWatchFunctionFct(add), findDBusRemoveWatchFunctionFct(rem), findDBusWatchToggledFunctionFct(toggle), data, find_DBusFreeFunction_Fct(d));
}
EXPORT void my_dbus_server_set_new_connection_function(x64emu_t* emu, void* server, void* f, void* data, void* d)
{
my->dbus_server_set_new_connection_function(server, findDBusNewConnectionFunctionFct(f), data, find_DBusFreeFunction_Fct(d));
}
EXPORT int my_dbus_server_set_timeout_functions(x64emu_t* emu, void* server, void* add, void* rem, void* toggle, void* data, void* d)
{
return my->dbus_server_set_timeout_functions(server, find_DBusAddTimeoutFunction_Fct(add), find_DBusRemoveTimeoutFunction_Fct(rem), find_DBusTimeoutToggledFunction_Fct(toggle), data, find_DBusFreeFunction_Fct(d));
}
EXPORT int my_dbus_server_set_data(x64emu_t* emu, void* server, int slot, void* data, void* d)
{
return my->dbus_server_set_data(server, slot, data, find_DBusFreeFunction_Fct(d));
}
EXPORT void my_dbus_connection_set_unix_user_function(x64emu_t* emu, void* conn, void* f, void* data, void* fr)
{
my->dbus_connection_set_unix_user_function(conn, find_DBusAllowUnixUserFunction_Fct(f), data, find_DBusFreeFunction_Fct(fr));
}
#include "wrappedlib_init.h"
|