Follow-up from "Add windows implementation of dbus-run-session helper tool"
The following discussions from !7 (closed) should be addressed:
Why does a change to dbus-run-session require changing the libraries that are linked into a manual test?
Don't expose this directly. dbus-run-session should call
_dbus_hash_table_unref()instead - that's already
In general, a particular data structure should either be refcounted (has
DBusHashTable) or not refcounted (has
DBusString). A mixture of the two means we got it wrong somewhere.
If this is only used in dbus-run-session, I'd prefer to put it in dbus-sysdeps-win-util.c, which means it doesn't need to be
DBUS_PRIVATE_EXPORTand isn't part of the shared library.
Coding style: align pointer stars with the name, not the type, because that's how C precedence works (
char *a, b;is the same as
char *a; char b;, but if you write it as
char* a, bthen you might be misled into thinking it's the same as
char *a; char *b;).
Can we continue to link with
libdbus-1.laon Unix, and only use
Coding style: space before open parenthesis
This is a bit of a weird setup; I'll have to look at the old Bugzilla bug to refresh my memory of how we got here.
Coding style nitpick:
app_handlecould be uninitialized at this point. If I'm remembering correctly that a
HANDLEis a pointer, use:
HANDLE server_handle = NULL; ... out: ... if (server_handle != NULL) CloseHandle (server_handle); ...
dbus_freeshould already be a
DBusFreeFunction, so you shouldn't need this cast.
goto outafter this point, you'll double-free
env_tablewill be uninitialized. Initialize it to
NULLand only free it if it's non-
Is this relevant to the rest of the commit?
NULL, which means "use the standard session bus config file", so this needs to be something like
if (config_file != NULL) _dbus_string_append_printf (&argv_strings, "--config-file=%s", config_file); else _dbus_string_append_printf (&argv_strings, "--session");
to match the Unix implementation.