Skip to content

[WRAPPER] Fix dbus callback return type and format string bugs#3634

Merged
ptitSeb merged 1 commit intoptitSeb:mainfrom
gigachadmma69:fix-dbus-callback-return-type
Mar 9, 2026
Merged

[WRAPPER] Fix dbus callback return type and format string bugs#3634
ptitSeb merged 1 commit intoptitSeb:mainfrom
gigachadmma69:fix-dbus-callback-return-type

Conversation

@gigachadmma69
Copy link
Contributor

Summary

  • Fix DBusObjectPathMessageFunction callback bridge returning void instead of DBusHandlerResult (int). The native dbus library reads the return register to determine message handling disposition (DBUS_HANDLER_RESULT_HANDLED, NOT_YET_HANDLED, etc.), so returning void causes indeterminate behavior.
  • Fix DBusNewConnectionFunction RunFunctionFmt format string using "pppp" (4 args) when only 3 arguments are passed. Correct signature is void (*)(DBusServer*, DBusConnection*, void*) — 3 pointer args.
  • Both fixes applied to src/wrapped/wrappeddbus.c and src/wrapped32/wrappeddbus.c.

Verified callback signatures against dbus API docs:

  • DBusObjectPathMessageFunction returns DBusHandlerResult (line 380)
  • DBusNewConnectionFunction takes 3 params (server, new_connection, data)

Should help #3632

AI Disclosure

AI (Claude) was used to assist with identifying the callback signature mismatches and generating the wrapper corrections, per CONTRIBUTING.md guidelines for wrapper callback handling. All changes were manually reviewed and verified against the dbus API documentation.

🤖 Generated with Claude Code

Fix DBusObjectPathMessageFunction callback returning void instead of
DBusHandlerResult (int). The native dbus library expects an int return
value from this callback to determine message handling disposition.
Returning void causes dbus to read an indeterminate value from the
return register, which can lead to incorrect message dispatch behavior.

Also fix DBusNewConnectionFunction RunFunctionFmt format string using
"pppp" (4 args) when only 3 arguments are passed. The correct format
is "ppp" matching the 3-parameter DBusNewConnectionFunction signature:
(DBusServer*, DBusConnection*, void*).

Both fixes applied to wrapped/ and wrapped32/ variants.

Should help ptitSeb#3632

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ptitSeb
Copy link
Owner

ptitSeb commented Mar 9, 2026

Yep, thisis a fair use of AI here. Nice find.

@ptitSeb ptitSeb merged commit 4474ac0 into ptitSeb:main Mar 9, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants