Skip to content

Commit

Permalink
Fixed some lib pulse callback (should help both #193 and #293 and may…
Browse files Browse the repository at this point in the history
…be other pulseaudio apps)
  • Loading branch information
ptitSeb committed Dec 31, 2020
1 parent 047df31 commit 25f1e8e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/wrapped/generated/functions_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,7 @@
#() uFpppppi
#() uFpppppp
#() uFSpuiip
#() UFpippup
#() LFEupppp
#() LFpipipi
#() LFpLippp
Expand Down
2 changes: 2 additions & 0 deletions src/wrapped/generated/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,7 @@ typedef uint32_t (*uFppippp_t)(void*, void*, int32_t, void*, void*, void*);
typedef uint32_t (*uFpppppi_t)(void*, void*, void*, void*, void*, int32_t);
typedef uint32_t (*uFpppppp_t)(void*, void*, void*, void*, void*, void*);
typedef uint32_t (*uFSpuiip_t)(void*, void*, uint32_t, int32_t, int32_t, void*);
typedef uint64_t (*UFpippup_t)(void*, int32_t, void*, void*, uint32_t, void*);
typedef uintptr_t (*LFEupppp_t)(x86emu_t*, uint32_t, void*, void*, void*, void*);
typedef uintptr_t (*LFpipipi_t)(void*, int32_t, void*, int32_t, void*, int32_t);
typedef uintptr_t (*LFpLippp_t)(void*, uintptr_t, int32_t, void*, void*, void*);
Expand Down Expand Up @@ -3226,6 +3227,7 @@ void uFppippp(x86emu_t *emu, uintptr_t fcn) { uFppippp_t fn = (uFppippp_t)fcn; R
void uFpppppi(x86emu_t *emu, uintptr_t fcn) { uFpppppi_t fn = (uFpppppi_t)fcn; R_EAX=(uint32_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
void uFpppppp(x86emu_t *emu, uintptr_t fcn) { uFpppppp_t fn = (uFpppppp_t)fcn; R_EAX=(uint32_t)fn(*(void**)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void uFSpuiip(x86emu_t *emu, uintptr_t fcn) { uFSpuiip_t fn = (uFSpuiip_t)fcn; R_EAX=(uint32_t)fn(io_convert(*(void**)(R_ESP + 4)), *(void**)(R_ESP + 8), *(uint32_t*)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(int32_t*)(R_ESP + 20), *(void**)(R_ESP + 24)); }
void UFpippup(x86emu_t *emu, uintptr_t fcn) { UFpippup_t fn = (UFpippup_t)fcn; ui64_t r; r.u=(uint64_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(uint32_t*)(R_ESP + 20), *(void**)(R_ESP + 24)); R_EAX=r.d[0]; R_EDX=r.d[1]; }
void LFEupppp(x86emu_t *emu, uintptr_t fcn) { LFEupppp_t fn = (LFEupppp_t)fcn; R_EAX=(uintptr_t)fn(emu, *(uint32_t*)(R_ESP + 4), *(void**)(R_ESP + 8), *(void**)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20)); }
void LFpipipi(x86emu_t *emu, uintptr_t fcn) { LFpipipi_t fn = (LFpipipi_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(int32_t*)(R_ESP + 8), *(void**)(R_ESP + 12), *(int32_t*)(R_ESP + 16), *(void**)(R_ESP + 20), *(int32_t*)(R_ESP + 24)); }
void LFpLippp(x86emu_t *emu, uintptr_t fcn) { LFpLippp_t fn = (LFpLippp_t)fcn; R_EAX=(uintptr_t)fn(*(void**)(R_ESP + 4), *(uintptr_t*)(R_ESP + 8), *(int32_t*)(R_ESP + 12), *(void**)(R_ESP + 16), *(void**)(R_ESP + 20), *(void**)(R_ESP + 24)); }
Expand Down
1 change: 1 addition & 0 deletions src/wrapped/generated/wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,7 @@ void uFppippp(x86emu_t *emu, uintptr_t fnc);
void uFpppppi(x86emu_t *emu, uintptr_t fnc);
void uFpppppp(x86emu_t *emu, uintptr_t fnc);
void uFSpuiip(x86emu_t *emu, uintptr_t fnc);
void UFpippup(x86emu_t *emu, uintptr_t fnc);
void LFEupppp(x86emu_t *emu, uintptr_t fnc);
void LFpipipi(x86emu_t *emu, uintptr_t fnc);
void LFpLippp(x86emu_t *emu, uintptr_t fnc);
Expand Down
12 changes: 6 additions & 6 deletions src/wrapped/wrappedpulse.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,11 @@ static void* find_context_index_Fct(void* fct)
return NULL;
}
// subscribe_context
#define GO(A) \
static uintptr_t my_subscribe_context_fct_##A = 0; \
static void my_subscribe_context_##A(void* context, uint32_t idx, void* data) \
{ \
RunFunction(my_context, my_subscribe_context_fct_##A, 3, context, idx, data); \
#define GO(A) \
static uintptr_t my_subscribe_context_fct_##A = 0; \
static void my_subscribe_context_##A(void* context, int evt, uint32_t idx, void* data) \
{ \
RunFunction(my_context, my_subscribe_context_fct_##A, 4, context, evt, idx, data); \
}
SUPER()
#undef GO
Expand Down Expand Up @@ -1117,7 +1117,7 @@ typedef struct my_pa_spawn_api_s {

EXPORT int my_pa_context_connect(x86emu_t* emu, void* context, void* server, int flags, my_pa_spawn_api_t* api)
{
pulse_my_t* my = (pulse_my_t*)GetLibInternal(pulseName)->priv.w.p2;
pulse_my_t* my = (pulse_my_t*)emu->context->pulse->priv.w.p2;
if(!api) {
return my->pa_context_connect(context, server, flags, api);
}
Expand Down
2 changes: 1 addition & 1 deletion src/wrapped/wrappedpulse_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

GO(pa_ascii_filter, pFp)
GO(pa_ascii_valid, pFp)
GO(pa_bytes_per_second, uFp)
GO(pa_bytes_per_second, LFp)
GO(pa_bytes_snprint, pFpuu)
GO(pa_bytes_to_usec, UFUp)
GO(pa_channel_map_can_balance, iFp)
Expand Down

0 comments on commit 25f1e8e

Please sign in to comment.